From 8265d0672850275ad7fed5eb259fb05f4364d0f5 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 4 Dec 2020 15:25:07 +0100 Subject: [PATCH] tools/litex_json2dts: Fix SPI bus #size-cells As per Documentation/devicetree/bindings/spi/spi-controller.yaml, "#size-cells" must be zero for a PCI bus. This gets rid of the following build warnings: build/orangecrab/orangecrab.dts:105.29-39: Warning (reg_format): /soc/spi@f0004800/mmc-slot@0:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) buildroot/rv32.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' buildroot/rv32.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' buildroot/rv32.dtb: Warning (simple_bus_reg): Failed prerequisite 'reg_format' buildroot/rv32.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' build/orangecrab/orangecrab.dts:91.46-110.19: Warning (spi_bus_bridge): /soc/spi@f0004800: incorrect #size-cells for SPI bus buildroot/rv32.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format' buildroot/rv32.dtb: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge' Fixes: fafa844aa78d552e ("json2dts: Add Linux DT generation script") Signed-off-by: Geert Uytterhoeven --- litex/tools/litex_json2dts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litex/tools/litex_json2dts.py b/litex/tools/litex_json2dts.py index ebaa07218..4aadf1a91 100755 --- a/litex/tools/litex_json2dts.py +++ b/litex/tools/litex_json2dts.py @@ -254,7 +254,7 @@ def generate_dts(d): litespi,num-cs = <1>; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; spidev0: spidev@0 {{ compatible = "linux,spidev"; @@ -302,7 +302,7 @@ def generate_dts(d): litespi,num-cs = <1>; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; mmc-slot@0 {{ compatible = "mmc-spi-slot";