Skip to content

stm32: q/o/x-spi bindings generate dtc warnings #88404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
erwango opened this issue Apr 10, 2025 · 1 comment · May be fixed by #88646
Open

stm32: q/o/x-spi bindings generate dtc warnings #88404

erwango opened this issue Apr 10, 2025 · 1 comment · May be fixed by #88646
Assignees
Labels
area: OSPI Octo SPI area: QSPI Quad SPI bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: medium Medium impact/importance bug
Milestone

Comments

@erwango
Copy link
Member

erwango commented Apr 10, 2025

Is your enhancement proposal related to a problem? Please describe.
Current STM32 Q/O/X-SPI bindings is not following device tree specification and since #76735 a warning is generated when building platforms enabling Q/O/X-SPI nodes:

CMake Warning at /local/home/frq07517/zephyrproject/zephyr/cmake/modules/dts.cmake:425 (message):
  dtc raised one or more warnings:


  /local/home/frq07517/zephyrproject/zephyr/build/b_u585i_iot02a/zephyr/zephyr.dts:820.26-848.5:
  Warning (spi_bus_bridge): /soc/spi@420d2400: incorrect #size-cells for SPI
  bus

  <stdout>: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'

This is because we don't respect a device tree (dtc check which is the de facto specification) which states that reg and sizes of SPI devices (nodes sitting on a SPI bus), should be defined as:

      reg = <FOO>;
      size = <BAR>;

ie #size-cells = <0>;

On STM32 SoCs, we're defining them as:

           reg = <FOO BAR>;

ie #size-cells = <1>;. This design was adopted in #68274 which was approved by subsytem maintainer at that time.

Describe the solution you'd like
Review STM32 Q/O/X-SPI devices binding to comply with dts spec and do the same as others socs description vendors, where address is defined in bus node:

           reg = <0x500c8000 0x1000>, <0x90000000 DT_SIZE_M(8)>;

and first two cells are address/size of the controller and last two cells are addressable address/size

@erwango erwango added bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 area: eSPI eSPI area: QSPI Quad SPI area: OSPI Octo SPI and removed area: eSPI eSPI labels Apr 10, 2025
@erwango erwango added the priority: low Low impact/importance bug label Apr 10, 2025
@erwango erwango changed the title stm32: q/o/x-spi bindings don't respect dtc expectations stm32: q/o/x-spi bindings generate dtc warnings Apr 10, 2025
@erwango erwango added this to the v4.2.0 milestone Apr 10, 2025
@erwango erwango added priority: medium Medium impact/importance bug and removed priority: low Low impact/importance bug labels Apr 10, 2025
@rruuaanng rruuaanng self-assigned this Apr 11, 2025
@erwango erwango assigned FRASTM and unassigned erwango Apr 15, 2025
@FRASTM
Copy link
Collaborator

FRASTM commented Apr 15, 2025

@rruuaanng rruuaanng linked a pull request Apr 16, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: OSPI Octo SPI area: QSPI Quad SPI bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants