Skip to content

Commit 7a48812

Browse files
committed
drivers: flash: stm32 ospi driver function to check memorymapped
Add a function to check the octospi controller and return true if the octo-SPI NOR is configured in memorymapped mode (else false) Signed-off-by: Francois Ramu <[email protected]>
1 parent 4125b27 commit 7a48812

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/flash/flash_stm32_ospi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,9 @@ static bool stm32_ospi_is_memorymapped(const struct device *dev)
10741074
{
10751075
struct flash_stm32_ospi_data *dev_data = dev->data;
10761076

1077-
return (HAL_OSPI_IsMemoryMapped(&dev_data->hospi) == 1) ? true : false;
1077+
return ((READ_BIT(dev_data->hospi.Instance->CR,
1078+
OCTOSPI_CR_FMODE) == OCTOSPI_CR_FMODE) ?
1079+
true : false);
10781080

10791081
}
10801082
#endif /* CONFIG_STM32_XIP */

0 commit comments

Comments
 (0)