Skip to content

Commit 6e5d139

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

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/flash/flash_stm32_qspi.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@
3737
#define STM32_QSPI_USE_QUAD_IO 0
3838
#endif
3939

40-
/* Get the base address of the flash from the DTS node */
41-
#define STM32_QSPI_BASE_ADDRESS DT_INST_REG_ADDR(0)
40+
#define STM32_QSPI_NODE DT_INST_PARENT(0)
41+
/* Get the base address of the flash from the DTS st,stm32-qspi node */
42+
#define STM32_QSPI_BASE_ADDRESS DT_REG_ADDR_BY_IDX(STM32_QSPI_NODE, 1)
4243

4344
#define STM32_QSPI_RESET_GPIO DT_INST_NODE_HAS_PROP(0, reset_gpios)
4445
#define STM32_QSPI_RESET_CMD DT_INST_PROP(0, reset_cmd)
@@ -1702,7 +1703,7 @@ static const struct flash_stm32_qspi_config flash_stm32_qspi_cfg = {
17021703
.bus = DT_CLOCKS_CELL(STM32_QSPI_NODE, bus)
17031704
},
17041705
.irq_config = flash_stm32_qspi_irq_config_func,
1705-
.flash_size = DT_INST_REG_SIZE(0) << STM32_QSPI_DOUBLE_FLASH,
1706+
.flash_size = (DT_INST_PROP(0, size) / 8) << STM32_QSPI_DOUBLE_FLASH,
17061707
.max_frequency = DT_INST_PROP(0, qspi_max_frequency),
17071708
.pcfg = PINCTRL_DT_DEV_CONFIG_GET(STM32_QSPI_NODE),
17081709
#if STM32_QSPI_RESET_GPIO

0 commit comments

Comments
 (0)