Skip to content

Commit bee60ed

Browse files
FRASTMkartben
authored andcommitted
drivers: flash: stm32 xspi driver size and address of the external NOR
New property of the st,stm32-xspi-nor compatible gives the external NOR flash in bits. The property of the st,stm32-xspi compatible gives the external NOR flash base address Signed-off-by: Francois Ramu <francois.ramu@st.com>
1 parent a76b784 commit bee60ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/flash/flash_stm32_xspi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ LOG_MODULE_REGISTER(flash_stm32_xspi, CONFIG_FLASH_LOG_LEVEL);
3737
(_CONCAT(HAL_XSPIM_, DT_STRING_TOKEN(STM32_XSPI_NODE, prop))), \
3838
((default_value)))
3939

40-
/* Get the base address of the flash from the DTS node */
41-
#define STM32_XSPI_BASE_ADDRESS DT_INST_REG_ADDR(0)
40+
/* Get the base address of the flash from the DTS st,stm32-xspi node */
41+
#define STM32_XSPI_BASE_ADDRESS DT_REG_ADDR_BY_IDX(STM32_XSPI_NODE, 1)
4242

4343
#define STM32_XSPI_RESET_GPIO DT_INST_NODE_HAS_PROP(0, reset_gpios)
4444

@@ -2434,7 +2434,7 @@ static const struct flash_stm32_xspi_config flash_stm32_xspi_cfg = {
24342434
.pclken = pclken,
24352435
.pclk_len = DT_NUM_CLOCKS(STM32_XSPI_NODE),
24362436
.irq_config = flash_stm32_xspi_irq_config_func,
2437-
.flash_size = DT_INST_REG_SIZE(0),
2437+
.flash_size = DT_INST_PROP(0, size) / 8, /* In Bytes */
24382438
.max_frequency = DT_INST_PROP(0, ospi_max_frequency),
24392439
.data_mode = DT_INST_PROP(0, spi_bus_width), /* SPI or OPI */
24402440
.data_rate = DT_INST_PROP(0, data_rate), /* DTR or STR */

0 commit comments

Comments
 (0)