Lines Matching +full:address +full:- +full:aligned
4 * SPDX-License-Identifier: Apache-2.0
29 BUILD_ASSERT((FLASH_WRITE_BLOCK_SIZE & (MIN_WRITE_SIZE - 1)) == 0,
60 if ((offset < 0) || offset >= SOC_NV_FLASH_SIZE || (SOC_NV_FLASH_SIZE - offset) < len) { in flash_ambiq_valid_range()
72 return -EINVAL; in flash_ambiq_read()
90 uint32_t aligned[FLASH_WRITE_BLOCK_SIZE / sizeof(uint32_t)] = {0}; in flash_ambiq_write() local
93 /* write address must be block size aligned and the write length must be multiple of block in flash_ambiq_write()
97 ((uint32_t)offset & (FLASH_WRITE_BLOCK_SIZE - 1)) || in flash_ambiq_write()
98 (len & (FLASH_WRITE_BLOCK_SIZE - 1))) { in flash_ambiq_write()
99 return -EINVAL; in flash_ambiq_write()
112 /* Make sure the source data is 4-byte aligned. */ in flash_ambiq_write()
113 aligned[j] = UNALIGNED_GET((uint32_t *)src); in flash_ambiq_write()
118 AM_HAL_MRAM_PROGRAM_KEY, aligned, in flash_ambiq_write()
123 AM_HAL_FLASH_PROGRAM_KEY, aligned, in flash_ambiq_write()
146 return -EINVAL; in flash_ambiq_erase()
154 /* The erase address and length alignment check will be done in HAL.*/ in flash_ambiq_erase()
158 return -EINVAL; in flash_ambiq_erase()
163 return -EINVAL; in flash_ambiq_erase()