Skip to content

Commit 958087f

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

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/flash/flash_stm32_ospi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ LOG_MODULE_REGISTER(flash_stm32_ospi, CONFIG_FLASH_LOG_LEVEL);
3939
#define DT_OSPI_PROP_OR(prop, default_value) \
4040
DT_PROP_OR(STM32_OSPI_NODE, prop, default_value)
4141

42-
/* Get the base address of the flash from the DTS node */
43-
#define STM32_OSPI_BASE_ADDRESS DT_INST_REG_ADDR(0)
42+
/* Get the base address of the flash from the DTS st,stm32-ospi node */
43+
#define STM32_OSPI_BASE_ADDRESS DT_REG_ADDR_BY_IDX(STM32_OSPI_NODE, 1)
4444

4545
#define STM32_OSPI_RESET_GPIO DT_INST_NODE_HAS_PROP(0, reset_gpios)
4646

@@ -2658,7 +2658,7 @@ static const struct flash_stm32_ospi_config flash_stm32_ospi_cfg = {
26582658
.enr = DT_CLOCKS_CELL_BY_NAME(STM32_OSPI_NODE, ospi_mgr, bits)},
26592659
#endif
26602660
.irq_config = flash_stm32_ospi_irq_config_func,
2661-
.flash_size = DT_INST_REG_SIZE(0),
2661+
.flash_size = DT_INST_PROP(0, size) / 8, /* In Bytes */
26622662
.max_frequency = DT_INST_PROP(0, ospi_max_frequency),
26632663
.data_mode = DT_INST_PROP(0, spi_bus_width), /* SPI or OPI */
26642664
.data_rate = DT_INST_PROP(0, data_rate), /* DTR or STR */

0 commit comments

Comments
 (0)