dts: nrf_qspi_nor: add option for specifying size in bytes
If a user has a 1GB external flash it is currently not possible to configure this through DTS. To allow for such a configuration we add an option which specifies the size in bytes not bits. Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
This commit is contained in:
parent
a4d4384447
commit
7aeef175e8
5 changed files with 47 additions and 3 deletions
10
tests/drivers/flash/boards/nrf52840_size_in_bytes.overlay
Normal file
10
tests/drivers/flash/boards/nrf52840_size_in_bytes.overlay
Normal file
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Nordic Semiconductor ASA
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&mx25r64 {
|
||||
/delete-property/ size;
|
||||
size-in-bytes = <8388608>;
|
||||
};
|
|
@ -11,9 +11,15 @@
|
|||
#include <storage/flash_map.h>
|
||||
|
||||
#if (CONFIG_NORDIC_QSPI_NOR - 0)
|
||||
#define FLASH_DEVICE DT_LABEL(DT_INST(0, nordic_qspi_nor))
|
||||
#define NORDIC_QSPI_NOR_NODE DT_INST(0, nordic_qspi_nor)
|
||||
#define FLASH_DEVICE DT_LABEL(NORDIC_QSPI_NOR_NODE)
|
||||
#define FLASH_TEST_REGION_OFFSET 0xff000
|
||||
#define TEST_AREA_MAX DT_PROP(DT_INST(0, nordic_qspi_nor), size)
|
||||
|
||||
#if DT_NODE_HAS_PROP(NORDIC_QSPI_NOR_NODE, size_in_bytes)
|
||||
#define TEST_AREA_MAX (DT_PROP(DT_INST(0, nordic_qspi_nor), size_in_bytes))
|
||||
#else
|
||||
#define TEST_AREA_MAX DT_PROP(DT_INST(0, nordic_qspi_nor), size * 8)
|
||||
#endif
|
||||
|
||||
#elif defined(CONFIG_FLASH_MCUX_FLEXSPI_NOR)
|
||||
|
||||
|
|
|
@ -5,6 +5,14 @@ tests:
|
|||
extra_args: OVERLAY_CONFIG=boards/nrf52840_flash_qspi.conf
|
||||
integration_platforms:
|
||||
- nrf52840dk_nrf52840
|
||||
drivers.flash.nrf_qspi_nor.size_in_bytes:
|
||||
platform_allow: nrf52840dk_nrf52840
|
||||
tags: flash nrf52 nrf_qspi_fash
|
||||
extra_args:
|
||||
OVERLAY_CONFIG=boards/nrf52840_flash_qspi.conf
|
||||
DTC_OVERLAY_FILE=boards/nrf52840_size_in_bytes.overlay
|
||||
integration_platforms:
|
||||
- nrf52840dk_nrf52840
|
||||
drivers.flash.soc_flash_nrf:
|
||||
platform_allow: nrf52840dk_nrf52840
|
||||
tags: nrf52 soc_flash_nrf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue