This series adds SPI NOR support for STM32MP25 SoCs from STMicroelectronics.
On STM32MP25 SoCs family, an Octo Memory Manager block manages the muxing, the memory area split, the chip select override and the time constraint between its 2 Octo SPI children.
Due to these depedencies, this series adds support for: - Octo Memory Manager driver. - Octo SPI driver. - yaml schema for Octo Memory Manager and Octo SPI drivers.
The device tree files adds Octo Memory Manager and its 2 associated Octo SPI chidren in stm32mp251.dtsi and adds SPI NOR support in stm32mp257f-ev1 board.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
Changes in v13: - Make firewall prototypes always exposed. - Restore STM32_OMM Kconfig dependency from v11. - Link to v12: https://lore.kernel.org/r/20250506-upstream_ospi_v6-v12-0-e3bb5a0d78fb@foss....
Changes in v12: - Update Kconfig dependencies. - Link to v11: https://lore.kernel.org/r/20250428-upstream_ospi_v6-v11-0-1548736fd9d2@foss....
Changes in v11: - Add stm32_omm_toggle_child_clock(dev, false) in stm32_omm_disable_child() in case of error. - Check MUXEN bit in stm32_omm_probe() to check if child clock must be disabled. - Add dev_err_probe() in stm32_omm_probe(). - Link to v10: https://lore.kernel.org/r/20250422-upstream_ospi_v6-v10-0-6f4942a04e10@foss....
Changes in v10: - Add of_node_put() in stm32_omm_set_amcr(). - Link to v9: https://lore.kernel.org/r/20250410-upstream_ospi_v6-v9-0-cf119508848a@foss.s...
Changes in v9: - split patchset by susbsystem, current one include only OMM related patches. - Update SPDX Identifiers to "GPL-2.0-only". - Add of_node_put)() instm32_omm_set_amcr(). - Rework error path in stm32_omm_toggle_child_clock(). - Make usage of reset_control_acquire/release() in stm32_omm_disable_child() and move reset_control_get in probe(). - Rename error label in stm32_omm_configure(). - Remove child compatible check in stm32_omm_probe(). - Make usage of devm_of_platform_populate(). - Link to v8: https://lore.kernel.org/r/20250407-upstream_ospi_v6-v8-0-7b7716c1c1f6@foss.s...
Changes in v8: - update OMM's dt-bindings: - Remove minItems for clocks and resets properties. - Fix st,syscfg-amcr items declaration. - move power-domains property before vendor specific properties. - Update compatible check wrongly introduced during internal tests in stm32_omm.c. - Move ommanager's node outside bus@42080000's node in stm32mp251.dtsi. - Link to v7: https://lore.kernel.org/r/20250401-upstream_ospi_v6-v7-0-0ef28513ed81@foss.s...
Changes in v7: - update OMM's dt-bindings by updating : - clock-names and reset-names properties. - spi unit-address node. - example. - update stm32mp251.dtsi to match with OMM's bindings update. - update stm32mp257f-ev1.dts to match with OMM's bindings update. - Link to v6: https://lore.kernel.org/r/20250321-upstream_ospi_v6-v6-0-37bbcab43439@foss.s...
Changes in v6: - Update MAINTAINERS file. - Remove previous patch 1/8 and 2/8, merged by Mark Brown in spi git tree. - Fix Signed-off-by order for patch 3. - OMM driver: - Add dev_err_probe() in error path. - Rename stm32_omm_enable_child_clock() to stm32_omm_toggle_child_clock(). - Reorder initialised/non-initialized variable in stm32_omm_configure() and stm32_omm_probe(). - Move pm_runtime_disable() calls from stm32_omm_configure() to stm32_omm_probe(). - Update children's clocks and reset management. - Use of_platform_populate() to probe children. - Add missing pm_runtime_disable(). - Remove useless stm32_omm_check_access's first parameter. - Update OMM's dt-bindings by adding OSPI's clocks and resets. - Update stm32mp251.dtsi by adding OSPI's clock and reset in OMM's node.
Changes in v5: - Add Reviewed-by Krzysztof Kozlowski for patch 1 and 3.
Changes in v4: - Add default value requested by Krzysztof for st,omm-req2ack-ns, st,omm-cssel-ovr and st,omm-mux properties in st,stm32mp25-omm.yaml - Remove constraint in free form test for st,omm-mux property. - Fix drivers/memory/Kconfig by replacing TEST_COMPILE_ by COMPILE_TEST. - Fix SPDX-License-Identifier for stm32-omm.c. - Fix Kernel test robot by fixing dev_err() format in stm32-omm.c. - Add missing pm_runtime_disable() in the error handling path in stm32-omm.c. - Replace an int by an unsigned int in stm32-omm.c - Remove uneeded "," after terminator in stm32-omm.c. - Update cover letter description to explain dependecies between Octo Memory Manager and its 2 Octo SPI children.
Changes in v3: - Squash defconfig patches 8 and 9. - Update STM32 Octo Memory Manager controller bindings. - Rename st,stm32-omm.yaml to st,stm32mp25-omm.yaml. - Update STM32 OSPI controller bindings. - Reorder DT properties in .dtsi and .dts files. - Replace devm_reset_control_get_optional() by devm_reset_control_get_optional_exclusive() in stm32_omm.c. - Reintroduce region-memory-names management in stm32_omm.c. - Rename stm32_ospi_tx_poll() and stm32_ospi_tx() to respectively to stm32_ospi_poll() and stm32_ospi_xfer() in spi-stm32-ospi.c. - Set SPI_CONTROLLER_HALF_DUPLEX in controller flags in spi-stm32-ospi.c.
Changes in v2: - Move STM32 Octo Memory Manager controller driver and bindings from misc to memory-controllers. - Update STM32 OSPI controller bindings. - Update STM32 Octo Memory Manager controller bindings. - Update STM32 Octo Memory Manager driver to match bindings update. - Update DT to match bindings update.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com --- Patrice Chotard (4): firewall: Always expose firewall prototype dt-bindings: memory-controllers: Add STM32 Octo Memory Manager controller memory: Add STM32 Octo Memory Manager driver MAINTAINERS: add entry for STM32 OCTO MEMORY MANAGER driver
.../memory-controllers/st,stm32mp25-omm.yaml | 226 ++++++++++ MAINTAINERS | 6 + drivers/memory/Kconfig | 17 + drivers/memory/Makefile | 1 + drivers/memory/stm32_omm.c | 476 +++++++++++++++++++++ include/linux/bus/stm32_firewall_device.h | 10 +- 6 files changed, 735 insertions(+), 1 deletion(-) --- base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8 change-id: 20250320-upstream_ospi_v6-d432a8172105
Best regards,
In case CONFIG_STM32_FIREWALL is not set, prototype are not visible which leads to following errors when enabling, for example, COMPILE_TEST and STM32_OMM:
stm32_firewall_device.h:117:5: error: no previous prototype for ‘stm32_firewall_get_firewall’ [-Werror=missing-prototypes] 117 | int stm32_firewall_get_firewall(struct device_node *np, struct stm32_firewall *firewall, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:123:5: error: no previous prototype for ‘stm32_firewall_grant_access’ [-Werror=missing-prototypes] 123 | int stm32_firewall_grant_access(struct stm32_firewall *firewall) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:128:6: error: no previous prototype for ‘stm32_firewall_release_access’ [-Werror=missing-prototypes] 128 | void stm32_firewall_release_access(struct stm32_firewall *firewall) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:132:5: error: no previous prototype for ‘stm32_firewall_grant_access_by_id’ [-Werror=missing-prototypes] 132 | int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:137:6: error: no previous prototype for ‘stm32_firewall_release_access_by_id’ [-Werror=missing-prototypes] 137 | void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Make prototypes always exposed to fix this issue.
Cc: stable@vger.kernel.org Fixes: 5c9668cfc6d7 ("firewall: introduce stm32_firewall framework")
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com --- include/linux/bus/stm32_firewall_device.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/linux/bus/stm32_firewall_device.h b/include/linux/bus/stm32_firewall_device.h index 5178b72bc920986bb6c55887453d146f382a8e77..ba6ef4468a0a8dfeb3e146ec90502e2f35172edc 100644 --- a/include/linux/bus/stm32_firewall_device.h +++ b/include/linux/bus/stm32_firewall_device.h @@ -35,7 +35,6 @@ struct stm32_firewall { u32 firewall_id; };
-#if IS_ENABLED(CONFIG_STM32_FIREWALL) /** * stm32_firewall_get_firewall - Get the firewall(s) associated to given device. * The firewall controller reference is always the first argument @@ -112,6 +111,15 @@ int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall, u32 subsy */ void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id);
+#if IS_ENABLED(CONFIG_STM32_FIREWALL) + +extern int stm32_firewall_get_firewall(struct device_node *np, struct stm32_firewall *firewall, + unsigned int nb_firewall); +extern int stm32_firewall_grant_access(struct stm32_firewall *firewall); +extern void stm32_firewall_release_access(struct stm32_firewall *firewall); +extern int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id); +extern void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id); + #else /* CONFIG_STM32_FIREWALL */
int stm32_firewall_get_firewall(struct device_node *np, struct stm32_firewall *firewall,
On 07/05/2025 09:25, Patrice Chotard wrote:
In case CONFIG_STM32_FIREWALL is not set, prototype are not visible which leads to following errors when enabling, for example, COMPILE_TEST and STM32_OMM:
stm32_firewall_device.h:117:5: error: no previous prototype for ‘stm32_firewall_get_firewall’ [-Werror=missing-prototypes] 117 | int stm32_firewall_get_firewall(struct device_node *np, struct stm32_firewall *firewall, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:123:5: error: no previous prototype for ‘stm32_firewall_grant_access’ [-Werror=missing-prototypes] 123 | int stm32_firewall_grant_access(struct stm32_firewall *firewall) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:128:6: error: no previous prototype for ‘stm32_firewall_release_access’ [-Werror=missing-prototypes] 128 | void stm32_firewall_release_access(struct stm32_firewall *firewall) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:132:5: error: no previous prototype for ‘stm32_firewall_grant_access_by_id’ [-Werror=missing-prototypes] 132 | int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:137:6: error: no previous prototype for ‘stm32_firewall_release_access_by_id’ [-Werror=missing-prototypes] 137 | void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Make prototypes always exposed to fix this issue.
Cc: stable@vger.kernel.org Fixes: 5c9668cfc6d7 ("firewall: introduce stm32_firewall framework")
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
include/linux/bus/stm32_firewall_device.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/linux/bus/stm32_firewall_device.h b/include/linux/bus/stm32_firewall_device.h index 5178b72bc920986bb6c55887453d146f382a8e77..ba6ef4468a0a8dfeb3e146ec90502e2f35172edc 100644 --- a/include/linux/bus/stm32_firewall_device.h +++ b/include/linux/bus/stm32_firewall_device.h @@ -35,7 +35,6 @@ struct stm32_firewall { u32 firewall_id; }; -#if IS_ENABLED(CONFIG_STM32_FIREWALL) /**
- stm32_firewall_get_firewall - Get the firewall(s) associated to given device.
The firewall controller reference is always the first argument
@@ -112,6 +111,15 @@ int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall, u32 subsy */ void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id); +#if IS_ENABLED(CONFIG_STM32_FIREWALL)
+extern int stm32_firewall_get_firewall(struct device_node *np, struct stm32_firewall *firewall,
unsigned int nb_firewall);
That's duplicated with earlier declaration. If you need to duplicate declarations means your code is not correct. That's not a fix at all and you are again masking the real problem which I asked to understand and learn.
This is something solved already in all other common interfaces (ones with stubs) and it confuses me why here it takes so much time. I'll just fix it myself and I will apply v11.
Best regards, Krzysztof
On 07/05/2025 09:25, Patrice Chotard wrote:
This series adds SPI NOR support for STM32MP25 SoCs from STMicroelectronics.
On STM32MP25 SoCs family, an Octo Memory Manager block manages the muxing, the memory area split, the chip select override and the time constraint between its 2 Octo SPI children.
Due to these depedencies, this series adds support for:
- Octo Memory Manager driver.
- Octo SPI driver.
- yaml schema for Octo Memory Manager and Octo SPI drivers.
The device tree files adds Octo Memory Manager and its 2 associated Octo SPI chidren in stm32mp251.dtsi and adds SPI NOR support in stm32mp257f-ev1 board. Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
Changes in v13:
- Make firewall prototypes always exposed.
I do not see any changes here.
b4 diff suggests this is the same as v11 so I expect the same failures.
Best regards, Krzysztof
On 5/7/25 10:28, Krzysztof Kozlowski wrote:
On 07/05/2025 09:25, Patrice Chotard wrote:
This series adds SPI NOR support for STM32MP25 SoCs from STMicroelectronics.
On STM32MP25 SoCs family, an Octo Memory Manager block manages the muxing, the memory area split, the chip select override and the time constraint between its 2 Octo SPI children.
Due to these depedencies, this series adds support for:
- Octo Memory Manager driver.
- Octo SPI driver.
- yaml schema for Octo Memory Manager and Octo SPI drivers.
The device tree files adds Octo Memory Manager and its 2 associated Octo SPI chidren in stm32mp251.dtsi and adds SPI NOR support in stm32mp257f-ev1 board. Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
Changes in v13:
- Make firewall prototypes always exposed.
I do not see any changes here.
b4 diff suggests this is the same as v11 so I expect the same failures.
Hi Krzysztof,
In this series there is an additional patch vs previous one : "[PATCH v13 1/4] firewall: Always expose firewall prototype"
Patrice
Best regards, Krzysztof
On 07/05/2025 10:28, Krzysztof Kozlowski wrote:
On 07/05/2025 09:25, Patrice Chotard wrote:
This series adds SPI NOR support for STM32MP25 SoCs from STMicroelectronics.
On STM32MP25 SoCs family, an Octo Memory Manager block manages the muxing, the memory area split, the chip select override and the time constraint between its 2 Octo SPI children.
Due to these depedencies, this series adds support for:
- Octo Memory Manager driver.
- Octo SPI driver.
- yaml schema for Octo Memory Manager and Octo SPI drivers.
The device tree files adds Octo Memory Manager and its 2 associated Octo SPI chidren in stm32mp251.dtsi and adds SPI NOR support in stm32mp257f-ev1 board. Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
Changes in v13:
- Make firewall prototypes always exposed.
I do not see any changes here.
b4 diff suggests this is the same as v11 so I expect the same failures.
My bad, I missed patch #1 here, so it seems fine on the first glance.
Best regards, Krzysztof
linux-stable-mirror@lists.linaro.org