Lines Matching refs:base_addr

35 static unsigned int nor_status(uintptr_t base_addr)  in nor_status()  argument
39 nor_send_cmd(base_addr, NOR_CMD_READ_STATUS_REG); in nor_status()
40 status = mmio_read_32(base_addr); in nor_status()
52 static int nor_poll_dws(uintptr_t base_addr, unsigned long int retries) in nor_poll_dws() argument
57 nor_send_cmd(base_addr, NOR_CMD_READ_STATUS_REG); in nor_poll_dws()
58 status = mmio_read_32(base_addr); in nor_poll_dws()
72 static int nor_full_status_check(uintptr_t base_addr) in nor_full_status_check() argument
77 status = nor_status(base_addr); in nor_full_status_check()
86 void nor_send_cmd(uintptr_t base_addr, unsigned long cmd) in nor_send_cmd() argument
88 mmio_write_32(base_addr, NOR_2X16(cmd)); in nor_send_cmd()
99 int nor_word_program(uintptr_t base_addr, unsigned long data) in nor_word_program() argument
104 nor_send_cmd(base_addr, NOR_CMD_CLEAR_STATUS_REG); in nor_word_program()
107 nor_send_cmd(base_addr, NOR_CMD_WORD_PROGRAM); in nor_word_program()
108 mmio_write_32(base_addr, data); in nor_word_program()
110 ret = nor_poll_dws(base_addr, DWS_WORD_PROGRAM_RETRIES); in nor_word_program()
113 nor_send_cmd(base_addr, NOR_CMD_READ_STATUS_REG); in nor_word_program()
114 status = mmio_read_32(base_addr); in nor_word_program()
117 nor_send_cmd(base_addr, NOR_CMD_CLEAR_STATUS_REG); in nor_word_program()
123 ret = nor_full_status_check(base_addr); in nor_word_program()
124 nor_send_cmd(base_addr, NOR_CMD_READ_ARRAY); in nor_word_program()
135 int nor_erase(uintptr_t base_addr) in nor_erase() argument
139 nor_send_cmd(base_addr, NOR_CMD_CLEAR_STATUS_REG); in nor_erase()
141 nor_send_cmd(base_addr, NOR_CMD_BLOCK_ERASE); in nor_erase()
142 nor_send_cmd(base_addr, NOR_CMD_BLOCK_ERASE_ACK); in nor_erase()
144 ret = nor_poll_dws(base_addr, DWS_WORD_ERASE_RETRIES); in nor_erase()
146 ret = nor_full_status_check(base_addr); in nor_erase()
147 nor_send_cmd(base_addr, NOR_CMD_READ_ARRAY); in nor_erase()
158 int nor_lock(uintptr_t base_addr) in nor_lock() argument
162 nor_send_cmd(base_addr, NOR_CMD_CLEAR_STATUS_REG); in nor_lock()
164 nor_send_cmd(base_addr, NOR_CMD_LOCK_UNLOCK); in nor_lock()
165 nor_send_cmd(base_addr, NOR_LOCK_BLOCK); in nor_lock()
167 ret = nor_poll_dws(base_addr, DWS_WORD_LOCK_RETRIES); in nor_lock()
169 ret = nor_full_status_check(base_addr); in nor_lock()
170 nor_send_cmd(base_addr, NOR_CMD_READ_ARRAY); in nor_lock()
181 int nor_unlock(uintptr_t base_addr) in nor_unlock() argument
185 nor_send_cmd(base_addr, NOR_CMD_CLEAR_STATUS_REG); in nor_unlock()
187 nor_send_cmd(base_addr, NOR_CMD_LOCK_UNLOCK); in nor_unlock()
188 nor_send_cmd(base_addr, NOR_UNLOCK_BLOCK); in nor_unlock()
190 ret = nor_poll_dws(base_addr, DWS_WORD_LOCK_RETRIES); in nor_unlock()
192 ret = nor_full_status_check(base_addr); in nor_unlock()
193 nor_send_cmd(base_addr, NOR_CMD_READ_ARRAY); in nor_unlock()