Lines Matching full:size
32 static bool range_is_valid(off_t offset, uint32_t size) in range_is_valid() argument
34 return (offset + size) <= (CONFIG_FLASH_SIZE * 1024); in range_is_valid()
102 static __ramfunc size_t qspic_write_page(uint32_t address, const uint8_t *data, size_t size) in qspic_write_page() argument
107 size = MIN(size, FLASH_PAGE_SIZE - (address & (FLASH_PAGE_SIZE - 1))); in qspic_write_page()
108 written = size; in qspic_write_page()
115 while (size >= 4) { in qspic_write_page()
118 size -= 4; in qspic_write_page()
121 while (size) { in qspic_write_page()
124 size--; in qspic_write_page()
132 static __ramfunc void qspic_write(uint32_t address, const uint8_t *data, size_t size) in qspic_write() argument
136 while (size) { in qspic_write()
139 written = qspic_write_page(address, data, size); in qspic_write()
142 size -= written; in qspic_write()
149 void *data, size_t size) in flash_smartbond_read() argument
153 if (!range_is_valid(offset, size)) { in flash_smartbond_read()
157 if (!size) { in flash_smartbond_read()
161 memcpy(data, (uint8_t *)(config->qspif_base_address + offset), size); in flash_smartbond_read()
168 size_t size) in flash_smartbond_write() argument
173 if (!range_is_valid(offset, size)) { in flash_smartbond_write()
177 if (!size) { in flash_smartbond_write()
187 qspic_write(offset, data, size); in flash_smartbond_write()
198 size_t size) in flash_smartbond_erase() argument
204 if (!range_is_valid(offset, size)) { in flash_smartbond_erase()
212 if ((size % FLASH_ERASE_SIZE) != 0) { in flash_smartbond_erase()
216 if (!size) { in flash_smartbond_erase()
226 while (size) { in flash_smartbond_erase()
238 size -= FLASH_ERASE_SIZE; in flash_smartbond_erase()