Lines Matching refs:addr
162 static uint32_t otp_select(uint32_t addr) in otp_select() argument
166 if (addr < 0x1c0) { /* 0-447 otp0 S */ in otp_select()
171 } else if (addr >= 0x1c0 && addr < 0x200) { /* 448-511 otp0 NS */ in otp_select()
209 static int rk_otp_sbpi_read(uint32_t addr, uint16_t *read_data, bool is_need_ecc) in rk_otp_sbpi_read() argument
214 otp_base = otp_select(addr); in rk_otp_sbpi_read()
246 mmio_write_32(otp_base + REG_OTPC_SBPI_CMD_OFFSET(1), addr & 0xff); /* sbpi cmd 3c addr */ in rk_otp_sbpi_read()
248 (addr >> 8) & 0xff); /* sbpi cmd 3d addr */ in rk_otp_sbpi_read()
279 VERBOSE("otp_addr:0x%x, otp_qp:0x%x\n", addr, otp_qp); in rk_otp_sbpi_read()
281 otp_ns_ecc_flag[addr - OTP_S_BYTE_SIZE / 2] = 1; in rk_otp_sbpi_read()
282 ERROR("ecc otp_addr:0x%x, otp_qp failed 0x%x\n", addr, otp_qp); in rk_otp_sbpi_read()
319 uint32_t addr, length; in rk_otp_read() local
330 addr = byte_addr / 2; in rk_otp_read()
333 if (addr >= OTP_MAX_SIZE || length <= 0 || length > OTP_MAX_SIZE || !buf) in rk_otp_read()
336 if ((addr + length) > OTP_MAX_SIZE) in rk_otp_read()
339 if (addr < OTP_S_SIZE && (addr + length) > OTP_S_SIZE) { in rk_otp_read()
346 if (addr < 0x1C0) { /* 0-447 otp0 S */ in rk_otp_read()
350 } else if (addr >= 0x1C0 && addr < 0x200) { /* 448-511 otp0 NS */ in rk_otp_read()
358 ret = rk_otp_sbpi_read(addr + i, buf + i, is_need_ecc); in rk_otp_read()
360 ERROR("---OTP---sbpi read otp failed! addr: 0x%x", addr + i); in rk_otp_read()
368 if (addr < 0x1C0) { /* 0-447 otp0 S */ in rk_otp_read()
372 } else if (addr >= 0x1C0 && addr < 0x200) { /* 448-511 otp0 NS */ in rk_otp_read()
381 int rk_otp_ns_ecc_flag(uint32_t addr) in rk_otp_ns_ecc_flag() argument
383 if (addr >= OTP_NS_BYTE_SIZE) in rk_otp_ns_ecc_flag()
386 return otp_ns_ecc_flag[addr / 2]; in rk_otp_ns_ecc_flag()