OP-TEE / optee_os

Trusted side of the TEE
Other
1.6k stars 1.07k forks source link

Minor issues with the DT build commands #6551

Closed jforissier closed 2 months ago

jforissier commented 11 months ago

I was checking how device tree files are preprocessed and whether or not it is OK to use pre-processor macros such as the BIT() (see discussion: https://github.com/OP-TEE/optee_os/pull/6547#discussion_r1427755938). I found the following issues.

  1. core/arch/arm/dts/stm32mp157.dtsi causes warnings (see below)
  2. The .pre.dts files cannot be remade by make path/to/target/file.pre.dts
    
    $ make PLATFORM=stm32mp1-157A_DK1 out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.pre.dts
    make: *** No rule to make target 'out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.pre.dts'.  Stop

$ make -j$(nproc) -s PLATFORM=stm32mp1-157A_DK1 core/arch/arm/dts/stm32mp157.dtsi:20.21-35.5: Warning (avoid_unnecessary_addr_size): /soc/dsi@5a000000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property core/arch/arm/dts/stm32mp151.dtsi:389.22-401.5: Warning (unique_unit_address): /soc/spi@4000b000: duplicate unit-address (also used in node /soc/audio-controller@4000b000) core/arch/arm/dts/stm32mp151.dtsi:414.22-426.5: Warning (unique_unit_address): /soc/spi@4000c000: duplicate unit-address (also used in node /soc/audio-controller@4000c000) core/arch/arm/dts/stm32mp151.dtsi:705.22-717.5: Warning (unique_unit_address): /soc/spi@44004000: duplicate unit-address (also used in node /soc/audio-controller@44004000) core/arch/arm/dts/stm32mp151.dtsi:38.38-44.4: Warning (interrupt_provider): /interrupt-controller@a0021000: Missing #address-cells in interrupt provider core/arch/arm/dts/stm32mp151.dtsi:1176.39-1181.5: Warning (interrupt_provider): /soc/interrupt-controller@5000d000: Missing #address-cells in interrupt provider core/arch/arm/dts/stm32mp15xx-dkx.dtsi:274.18-416.4: Warning (interrupt_provider): /soc/i2c@5c002000/stpmic@33: Missing #address-cells in interrupt provider core/arch/arm/dts/stm32mp151.dtsi:1683.25-1692.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50002000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:10.23-14.4 core/arch/arm/dts/stm32mp151.dtsi:1694.25-1703.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50003000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:16.23-20.4 core/arch/arm/dts/stm32mp151.dtsi:1705.25-1714.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50004000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:22.23-26.4 core/arch/arm/dts/stm32mp151.dtsi:1716.25-1725.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50005000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:28.23-32.4 core/arch/arm/dts/stm32mp151.dtsi:1727.25-1736.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50006000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:34.23-38.4 core/arch/arm/dts/stm32mp151.dtsi:1738.25-1747.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50007000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:40.23-44.4 core/arch/arm/dts/stm32mp151.dtsi:1749.25-1758.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50008000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:46.23-50.4 core/arch/arm/dts/stm32mp151.dtsi:1760.25-1769.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50009000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:52.23-56.4 core/arch/arm/dts/stm32mp151.dtsi:1771.25-1780.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@5000a000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:58.23-62.4 core/arch/arm/dts/stm32mp151.dtsi:1782.25-1791.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@5000b000: Missing #address-cells in interrupt provider core/arch/arm/dts/stm32mp151.dtsi:1793.25-1802.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@5000c000: Missing #address-cells in interrupt provider core/arch/arm/dts/stm32mp151.dtsi:1814.25-1824.6: Warning (interrupt_provider): /soc/pinctrl@54004000/gpio@54004000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:68.23-72.4 core/arch/arm/dts/stm32mp151.dtsi:1503.9-1506.6: Warning (graph_child_address): /soc/display-controller@5a001000/port: graph node has single child node 'endpoint@0', #address-cells/#size-cells are not necessary also defined at core/arch/arm/dts/stm32mp15xx-dkx.dtsi:469.7-474.4

$ make PLATFORM=stm32mp1-157A_DK1 out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.pre.dts make: Nothing to be done for 'out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.pre.dts'.

$ ls -ls out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.pre.dts -rw-rw-r-- 1 jerome jerome 129800 Dec 15 16:48 out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.pre.dts

3. `make ... V=1` does not print the build commands used to generate the DTB

$ rm -rf out/arm-plat-stm32mp1 $ make V=1 PLATFORM=stm32mp1-157A_DK1 out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.dtb core/arch/arm/dts/stm32mp157.dtsi:20.21-35.5: Warning (avoid_unnecessary_addr_size): /soc/dsi@5a000000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property core/arch/arm/dts/stm32mp151.dtsi:389.22-401.5: Warning (unique_unit_address): /soc/spi@4000b000: duplicate unit-address (also used in node /soc/audio-controller@4000b000) core/arch/arm/dts/stm32mp151.dtsi:414.22-426.5: Warning (unique_unit_address): /soc/spi@4000c000: duplicate unit-address (also used in node /soc/audio-controller@4000c000) core/arch/arm/dts/stm32mp151.dtsi:705.22-717.5: Warning (unique_unit_address): /soc/spi@44004000: duplicate unit-address (also used in node /soc/audio-controller@44004000) core/arch/arm/dts/stm32mp151.dtsi:38.38-44.4: Warning (interrupt_provider): /interrupt-controller@a0021000: Missing #address-cells in interrupt provider core/arch/arm/dts/stm32mp151.dtsi:1176.39-1181.5: Warning (interrupt_provider): /soc/interrupt-controller@5000d000: Missing #address-cells in interrupt provider core/arch/arm/dts/stm32mp15xx-dkx.dtsi:274.18-416.4: Warning (interrupt_provider): /soc/i2c@5c002000/stpmic@33: Missing #address-cells in interrupt provider core/arch/arm/dts/stm32mp151.dtsi:1683.25-1692.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50002000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:10.23-14.4 core/arch/arm/dts/stm32mp151.dtsi:1694.25-1703.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50003000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:16.23-20.4 core/arch/arm/dts/stm32mp151.dtsi:1705.25-1714.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50004000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:22.23-26.4 core/arch/arm/dts/stm32mp151.dtsi:1716.25-1725.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50005000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:28.23-32.4 core/arch/arm/dts/stm32mp151.dtsi:1727.25-1736.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50006000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:34.23-38.4 core/arch/arm/dts/stm32mp151.dtsi:1738.25-1747.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50007000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:40.23-44.4 core/arch/arm/dts/stm32mp151.dtsi:1749.25-1758.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50008000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:46.23-50.4 core/arch/arm/dts/stm32mp151.dtsi:1760.25-1769.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@50009000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:52.23-56.4 core/arch/arm/dts/stm32mp151.dtsi:1771.25-1780.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@5000a000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:58.23-62.4 core/arch/arm/dts/stm32mp151.dtsi:1782.25-1791.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@5000b000: Missing #address-cells in interrupt provider core/arch/arm/dts/stm32mp151.dtsi:1793.25-1802.6: Warning (interrupt_provider): /soc/pinctrl@50002000/gpio@5000c000: Missing #address-cells in interrupt provider core/arch/arm/dts/stm32mp151.dtsi:1814.25-1824.6: Warning (interrupt_provider): /soc/pinctrl@54004000/gpio@54004000: Missing #address-cells in interrupt provider also defined at core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi:68.23-72.4 core/arch/arm/dts/stm32mp151.dtsi:1503.9-1506.6: Warning (graph_child_address): /soc/display-controller@5a001000/port: graph node has single child node 'endpoint@0', #address-cells/#size-cells are not necessary also defined at core/arch/arm/dts/stm32mp15xx-dkx.dtsi:469.7-474.4 $ ls -l out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.dtb -rw-rw-r-- 1 jerome jerome 62352 Dec 15 16:53 out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.dtb

4. The `dtc` command contains the same flags several times (`-I dts -O dtb -Wno-unit_address_vs_reg` is there 5 times)

$ rm -rf out/arm-plat-stm32mp1 $ $ make PLATFORM=stm32mp1-157A_DK1 out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.dtb 2>/dev/null CPP out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.pre.dts DTC out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.dtb $ cat out/arm-plat-stm32mp1/core/arch/arm/dts/.stm32mp157a-dk1.dtb.cmd dtb-old-precmd-out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.dtb := arm-linux-gnueabihf-cpp -Icore/include/ -x assembler-with-cpp -Ulinux -Uunix -E -ffreestanding -MD -MF out/arm-plat-stm32mp1/core/arch/arm/dts/.stm32mp157a-dk1.pre.dts.d -MT out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.dtb -o out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.pre.dts core/arch/arm/dts/stm32mp157a-dk1.dts dtb-old-cmd-out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.dtb := dtc -I dts -O dtb -Wno-unit_address_vs_reg -I dts -O dtb -Wno-unit_address_vs_reg -I dts -O dtb -Wno-unit_address_vs_reg -I dts -O dtb -Wno-unit_address_vs_reg -I dts -O dtb -Wno-unit_address_vs_reg -d out/arm-plat-stm32mp1/core/arch/arm/dts/.stm32mp157a-dk1.dtb.d -o out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.dtb out/arm-plat-stm32mp1/core/arch/arm/dts/stm32mp157a-dk1.pre.dts

github-actions[bot] commented 10 months ago

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

etienne-lms commented 10 months ago

@jforissier, I missed this Issue. Can you keep it alive? I'll have look when I can. Thanks.

github-actions[bot] commented 9 months ago

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

etienne-lms commented 9 months ago

Please keep alive. Sorry, this issue is in my low priority list :\

github-actions[bot] commented 8 months ago

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

UVV-gh commented 3 months ago

Any idea why this is closed? I've just hit the issue 2 from the list above. Whenever the DT file name contains an underscore, I get No rule to make target error

jforissier commented 3 months ago

Any idea why this is closed? I've just hit the issue 2 from the list above. Whenever the DT file name contains an underscore, I get No rule to make target error

"This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity."

Re-opening. Feel free to contribute a fix. Thanks

UVV-gh commented 3 months ago

I would be glad to if you have any hints as to where an underscore in the file name could make a difference (been looking at it for a few hours already ;) )

jforissier commented 3 months ago

@UVV-gh I do not see how the underscore could be a problem, could you provide more details please? Anyways, please also see #6992.

UVV-gh commented 3 months ago

Yeah, you are right, I was confused by not cleaning the build directory and some artifacts existed from one build, but not from the other, in other words it has nothing to do with the underscore. But I coincidentally got the same error message. Sorry for the confusion. And thanks for the fixes!

(I personally don't like make for that and prefer cmake/meson)

github-actions[bot] commented 2 months ago

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.