Lines Matching +full:static +full:- +full:address

4  * SPDX-License-Identifier: Apache-2.0
27 static const struct flash_parameters flash_smartbond_parameters = {
32 static bool range_is_valid(off_t offset, uint32_t size) in range_is_valid()
37 static ALWAYS_INLINE void qspic_data_write8(uint8_t data) in qspic_data_write8()
39 volatile uint8_t *reg8 = (uint8_t *)&QSPIC->QSPIC_WRITEDATA_REG; in qspic_data_write8()
44 static ALWAYS_INLINE void qspic_data_write32(uint32_t data) in qspic_data_write32()
46 volatile uint32_t *reg32 = (uint32_t *)&QSPIC->QSPIC_WRITEDATA_REG; in qspic_data_write32()
51 static ALWAYS_INLINE uint8_t qspic_data_read8(void) in qspic_data_read8()
53 volatile uint8_t *reg8 = (uint8_t *)&QSPIC->QSPIC_READDATA_REG; in qspic_data_read8()
58 static __ramfunc uint8_t qspic_read_status(void) in qspic_read_status()
62 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_EN_CS_Msk; in qspic_read_status()
65 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_DIS_CS_Msk; in qspic_read_status()
71 static __ramfunc void qspic_wait_busy(void) in qspic_wait_busy()
77 static __ramfunc void qspic_automode_exit(void) in qspic_automode_exit()
79 QSPIC->QSPIC_CTRLMODE_REG &= ~QSPIC_QSPIC_CTRLMODE_REG_QSPIC_AUTO_MD_Msk; in qspic_automode_exit()
80 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_SET_SINGLE_Msk; in qspic_automode_exit()
81 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_EN_CS_Msk; in qspic_automode_exit()
84 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_DIS_CS_Msk; in qspic_automode_exit()
87 static __ramfunc void qspic_write_enable(void) in qspic_write_enable()
92 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_EN_CS_Msk; in qspic_write_enable()
94 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_DIS_CS_Msk; in qspic_write_enable()
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()
110 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_EN_CS_Msk; in qspic_write_page()
112 address = sys_cpu_to_be32(address); in qspic_write_page()
113 qspic_data_write32(address | 0x02); in qspic_write_page()
118 size -= 4; in qspic_write_page()
124 size--; in qspic_write_page()
127 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_DIS_CS_Msk; in qspic_write_page()
132 static __ramfunc void qspic_write(uint32_t address, const uint8_t *data, size_t size) in qspic_write() argument
139 written = qspic_write_page(address, data, size); in qspic_write()
140 address += written; in qspic_write()
142 size -= written; in qspic_write()
148 static int flash_smartbond_read(const struct device *dev, off_t offset, in flash_smartbond_read()
151 const struct flash_smartbond_config *config = dev->config; in flash_smartbond_read()
154 return -EINVAL; in flash_smartbond_read()
161 memcpy(data, (uint8_t *)(config->qspif_base_address + offset), size); in flash_smartbond_read()
166 static __ramfunc int flash_smartbond_write(const struct device *dev, in flash_smartbond_write()
174 return -EINVAL; in flash_smartbond_write()
183 ctrlmode = QSPIC->QSPIC_CTRLMODE_REG; in flash_smartbond_write()
189 QSPIC->QSPIC_CTRLMODE_REG = ctrlmode; in flash_smartbond_write()
190 CACHE->CACHE_CTRL1_REG |= CACHE_CACHE_CTRL1_REG_CACHE_FLUSH_Msk; in flash_smartbond_write()
197 static __ramfunc int flash_smartbond_erase(const struct device *dev, off_t offset, in flash_smartbond_erase()
202 uint32_t address; in flash_smartbond_erase() local
205 return -EINVAL; in flash_smartbond_erase()
209 return -EINVAL; in flash_smartbond_erase()
213 return -EINVAL; in flash_smartbond_erase()
222 ctrlmode = QSPIC->QSPIC_CTRLMODE_REG; in flash_smartbond_erase()
229 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_EN_CS_Msk; in flash_smartbond_erase()
231 address = sys_cpu_to_be32(offset); in flash_smartbond_erase()
232 qspic_data_write32(address | 0x20); in flash_smartbond_erase()
233 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_DIS_CS_Msk; in flash_smartbond_erase()
238 size -= FLASH_ERASE_SIZE; in flash_smartbond_erase()
241 QSPIC->QSPIC_CTRLMODE_REG = ctrlmode; in flash_smartbond_erase()
242 CACHE->CACHE_CTRL1_REG |= CACHE_CACHE_CTRL1_REG_CACHE_FLUSH_Msk; in flash_smartbond_erase()
249 static const struct flash_parameters *
258 static const struct flash_pages_layout flash_smartbond_0_pages_layout = {
273 static DEVICE_API(flash, flash_smartbond_driver_api) = {
283 static const struct flash_smartbond_config flash_smartbond_0_config = {