[U-Boot] [PATCH 1/2] sandbox: Correct dtc warning in /chosen node

At present dtc produces these warnings when compiling sandbox:
arch/sandbox/dts/test.dtb: Warning (reg_format): "reg" property in /chosen/chosen-test has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) arch/sandbox/dts/test.dtb: Warning (avoid_default_addr_size): Relying on default #address-cells value for /chosen/chosen-test arch/sandbox/dts/test.dtb: Warning (avoid_default_addr_size): Relying on default #size-cells value for /chosen/chosen-test
Add the missing properties to avoid this.
Signed-off-by: Simon Glass sjg@chromium.org Fixes: f200680 (dm: core: parse chosen node) ---
arch/sandbox/dts/test.dts | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 3f9e788e6c3..c38e3691628 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -480,6 +480,8 @@ };
chosen { + #address-cells = <1>; + #size-cells = <1>; chosen-test { compatible = "denx,u-boot-fdt-test"; reg = <9 1>;

At present dtc produces these warnings when compiling sandbox:
arch/sandbox/dts/test.dtb: Warning (gpios_property): Could not get phandle node for /base-gpios:num-gpios(cell 0) arch/sandbox/dts/test.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /reset-ctl or bad phandle (referred from /extra-gpios:num-gpios[0])
Both are due to it assuming that the 'num-gpios' property holds a phandle pointing to a GPIO node.
To avoid these warnings, rename the sandbox property so that it does not include the string 'gpios'.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/sandbox/dts/test.dts | 4 ++-- drivers/gpio/sandbox.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index c38e3691628..b0f0ca8f19c 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -177,7 +177,7 @@ gpio-controller; #gpio-cells = <1>; gpio-bank-name = "a"; - num-gpios = <20>; + sandbox,gpio-count = <20>; };
gpio_b: extra-gpios { @@ -185,7 +185,7 @@ gpio-controller; #gpio-cells = <5>; gpio-bank-name = "b"; - num-gpios = <10>; + sandbox,gpio-count = <10>; };
i2c@0 { diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c index 4f7b62eba0d..2a18f328576 100644 --- a/drivers/gpio/sandbox.c +++ b/drivers/gpio/sandbox.c @@ -198,7 +198,8 @@ static int sandbox_gpio_ofdata_to_platdata(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
- uc_priv->gpio_count = dev_read_u32_default(dev, "num-gpios", 0); + uc_priv->gpio_count = dev_read_u32_default(dev, "sandbox,gpio-count", + 0); uc_priv->bank_name = dev_read_string(dev, "gpio-bank-name");
return 0;

On 4 February 2018 at 04:36, Simon Glass sjg@chromium.org wrote:
At present dtc produces these warnings when compiling sandbox:
arch/sandbox/dts/test.dtb: Warning (gpios_property): Could not get phandle node for /base-gpios:num-gpios(cell 0) arch/sandbox/dts/test.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /reset-ctl or bad phandle (referred from /extra-gpios:num-gpios[0])
Both are due to it assuming that the 'num-gpios' property holds a phandle pointing to a GPIO node.
To avoid these warnings, rename the sandbox property so that it does not include the string 'gpios'.
Signed-off-by: Simon Glass sjg@chromium.org
arch/sandbox/dts/test.dts | 4 ++-- drivers/gpio/sandbox.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-)
This was applied to u-boot-dm and is now in mainline.
participants (1)
-
Simon Glass