arm: nordic: flash: Use FLASH_DEV_NAME define
We want to move to use a common FLASH_DEV_NAME across the various flash drivers. So samples, tests, or other code can be a bit more generic. So replace CONFIG_SOC_FLASH_NRF5_DEV_NAME with FLASH_DEV_NAME. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
7474ad6286
commit
26e4da52cf
|
@ -232,7 +232,7 @@ static int nrf5_flash_init(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEVICE_INIT(nrf5_flash, CONFIG_SOC_FLASH_NRF5_DEV_NAME, nrf5_flash_init,
|
||||
DEVICE_INIT(nrf5_flash, FLASH_DEV_NAME, nrf5_flash_init,
|
||||
NULL, NULL, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
||||
|
||||
#if defined(CONFIG_SOC_FLASH_NRF5_RADIO_SYNC)
|
||||
|
|
|
@ -329,7 +329,7 @@ void board_init(u16_t *addr, u32_t *seq)
|
|||
|
||||
printk("SEQ_PAGE 0x%08x\n", SEQ_PAGE);
|
||||
|
||||
nvm = device_get_binding(CONFIG_SOC_FLASH_NRF5_DEV_NAME);
|
||||
nvm = device_get_binding(FLASH_DEV_NAME);
|
||||
pwm = device_get_binding(CONFIG_PWM_NRF5_SW_0_DEV_NAME);
|
||||
|
||||
*addr = NRF_UICR->CUSTOMER[0];
|
||||
|
|
|
@ -38,7 +38,7 @@ void main(void)
|
|||
printf("\nNordic nRF5 Flash Testing\n");
|
||||
printf("=========================\n");
|
||||
|
||||
flash_dev = device_get_binding(CONFIG_SOC_FLASH_NRF5_DEV_NAME);
|
||||
flash_dev = device_get_binding(FLASH_DEV_NAME);
|
||||
|
||||
if (!flash_dev) {
|
||||
printf("Nordic nRF5 flash driver was not found!\n");
|
||||
|
|
|
@ -31,7 +31,7 @@ static int cmd_erase(int argc, char *argv[])
|
|||
int result;
|
||||
u32_t size;
|
||||
|
||||
flash_dev = device_get_binding(CONFIG_SOC_FLASH_NRF5_DEV_NAME);
|
||||
flash_dev = device_get_binding(FLASH_DEV_NAME);
|
||||
if (!flash_dev) {
|
||||
printk("Nordic nRF5 flash driver was not found!\n");
|
||||
return -ENODEV;
|
||||
|
@ -71,7 +71,7 @@ static int cmd_flash(int argc, char *argv[])
|
|||
u32_t w_addr;
|
||||
int j = 0;
|
||||
|
||||
flash_dev = device_get_binding(CONFIG_SOC_FLASH_NRF5_DEV_NAME);
|
||||
flash_dev = device_get_binding(FLASH_DEV_NAME);
|
||||
if (!flash_dev) {
|
||||
printk("Nordic nRF5 flash driver was not found!\n");
|
||||
return -ENODEV;
|
||||
|
@ -123,7 +123,7 @@ static int cmd_read(int argc, char *argv[])
|
|||
u32_t addr;
|
||||
int cnt;
|
||||
|
||||
flash_dev = device_get_binding(CONFIG_SOC_FLASH_NRF5_DEV_NAME);
|
||||
flash_dev = device_get_binding(FLASH_DEV_NAME);
|
||||
if (!flash_dev) {
|
||||
printk("Nordic nRF5 flash driver was not found!\n");
|
||||
return -ENODEV;
|
||||
|
@ -163,7 +163,7 @@ static int cmd_test(int argc, char *argv[])
|
|||
u32_t addr;
|
||||
u32_t size;
|
||||
|
||||
flash_dev = device_get_binding(CONFIG_SOC_FLASH_NRF5_DEV_NAME);
|
||||
flash_dev = device_get_binding(FLASH_DEV_NAME);
|
||||
if (!flash_dev) {
|
||||
printk("Nordic nRF5 flash driver was not found!\n");
|
||||
return -ENODEV;
|
||||
|
|
|
@ -15,7 +15,7 @@ void test_collecting(void)
|
|||
u32_t i, j;
|
||||
u8_t data[5], temp, k;
|
||||
|
||||
flash_dev = device_get_binding(CONFIG_SOC_FLASH_NRF5_DEV_NAME);
|
||||
flash_dev = device_get_binding(FLASH_DEV_NAME);
|
||||
|
||||
flash_write_protection_set(flash_dev, false);
|
||||
flash_erase(flash_dev, FLASH_AREA_IMAGE_1_OFFSET,
|
||||
|
|
|
@ -23,7 +23,7 @@ void test_bank_erase(void)
|
|||
off_t offs;
|
||||
int ret;
|
||||
|
||||
flash_dev = device_get_binding(CONFIG_SOC_FLASH_NRF5_DEV_NAME);
|
||||
flash_dev = device_get_binding(FLASH_DEV_NAME);
|
||||
|
||||
for (offs = FLASH_AREA_IMAGE_1_OFFSET;
|
||||
offs <= FLASH_AREA_IMAGE_1_OFFSET + FLASH_AREA_IMAGE_1_SIZE;
|
||||
|
@ -74,7 +74,7 @@ void test_request_upgrade(void)
|
|||
u32_t readout[ARRAY_SIZE(expectation)];
|
||||
int ret;
|
||||
|
||||
flash_dev = device_get_binding(CONFIG_SOC_FLASH_NRF5_DEV_NAME);
|
||||
flash_dev = device_get_binding(FLASH_DEV_NAME);
|
||||
|
||||
zassert(boot_request_upgrade(false) == 0, "pass", "fail");
|
||||
|
||||
|
@ -108,7 +108,7 @@ void test_write_confirm(void)
|
|||
struct device *flash_dev;
|
||||
int ret;
|
||||
|
||||
flash_dev = device_get_binding(CONFIG_SOC_FLASH_NRF5_DEV_NAME);
|
||||
flash_dev = device_get_binding(FLASH_DEV_NAME);
|
||||
|
||||
ret = flash_read(flash_dev, FLASH_AREA_IMAGE_0_OFFSET +
|
||||
FLASH_AREA_IMAGE_0_SIZE - sizeof(img_magic), &readout,
|
||||
|
|
|
@ -2,7 +2,6 @@ CONFIG_FLASH=y
|
|||
CONFIG_FLASH_PAGE_LAYOUT=y
|
||||
CONFIG_MPU_ALLOW_FLASH_WRITE=y
|
||||
CONFIG_SOC_FLASH_NRF5=y
|
||||
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
|
||||
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
|
||||
CONFIG_ZTEST=y
|
||||
CONFIG_ZTEST_STACKSIZE=2048
|
||||
|
|
|
@ -37,7 +37,7 @@ void flash_map_test_case_2(void)
|
|||
zassert_true(rc == 0, "flash_area_open() fail");
|
||||
|
||||
/* First erase the area so it's ready for use. */
|
||||
flash_dev = device_get_binding(CONFIG_SOC_FLASH_NRF5_DEV_NAME);
|
||||
flash_dev = device_get_binding(FLASH_DEV_NAME);
|
||||
rc = flash_erase(flash_dev, fa->fa_off, fa->fa_size);
|
||||
zassert_true(rc == 0, "flash area erase fail");
|
||||
|
||||
|
|
Loading…
Reference in a new issue