diff mbox series

dt-bindings: arm: bcm: Add a select to the RPI Firmware binding

Message ID 20200626115433.125735-1-maxime@cerno.tech
State Changes Requested
Headers show
Series dt-bindings: arm: bcm: Add a select to the RPI Firmware binding | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 1 warnings, 15 lines checked

Commit Message

Maxime Ripard June 26, 2020, 11:54 a.m. UTC
The RaspberryPi firmware binding uses two compatible, include simple-bus.
The select statement generated by default will thus select any node that
has simple-bus, not all of them being the raspberrypi firmware node.

This results in warnings being wrongfully reported. Let's add a custom
select statement to fix that.

Fixes: 5bc0b9be8544 ("dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>

---

The original binding has been merged through the clock tree, so it should
be merged there.

Even though the original binding (and the DT) are using the simple-bus
compatible, this creates some DTC warnings since the firmware really isn't
a bus, so the node name doesn't match what a bus should have, none of the
children have a reg property, #address-cells and #size-cells are missing,
etc.

I can only guess that simple-bus was used to make the sub-devices probe,
but maybe simple-mfd would be more appropriate here?
---
 .../bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml   | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Florian Fainelli June 26, 2020, 4:03 p.m. UTC | #1
On 6/26/2020 4:54 AM, Maxime Ripard wrote:
> The RaspberryPi firmware binding uses two compatible, include simple-bus.
> The select statement generated by default will thus select any node that
> has simple-bus, not all of them being the raspberrypi firmware node.
> 
> This results in warnings being wrongfully reported. Let's add a custom
> select statement to fix that.
> 
> Fixes: 5bc0b9be8544 ("dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

Thanks Maxime!
Rob Herring July 15, 2020, 8:06 p.m. UTC | #2
On Fri, Jun 26, 2020 at 01:54:33PM +0200, Maxime Ripard wrote:
> The RaspberryPi firmware binding uses two compatible, include simple-bus.
> The select statement generated by default will thus select any node that
> has simple-bus, not all of them being the raspberrypi firmware node.
> 
> This results in warnings being wrongfully reported. Let's add a custom
> select statement to fix that.
> 
> Fixes: 5bc0b9be8544 ("dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> 
> ---
> 
> The original binding has been merged through the clock tree, so it should
> be merged there.
> 
> Even though the original binding (and the DT) are using the simple-bus
> compatible, this creates some DTC warnings since the firmware really isn't
> a bus, so the node name doesn't match what a bus should have, none of the
> children have a reg property, #address-cells and #size-cells are missing,
> etc.
> 
> I can only guess that simple-bus was used to make the sub-devices probe,
> but maybe simple-mfd would be more appropriate here?

As these are not mmio devices, I think simple-mfd is better.

> ---
>  .../bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml   | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml b/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
> index b48ed875eb8e..17e4f20c8d39 100644
> --- a/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
> +++ b/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
> @@ -10,6 +10,15 @@ maintainers:
>    - Eric Anholt <eric@anholt.net>
>    - Stefan Wahren <wahrenst@gmx.net>
>  
> +select:
> +  properties:
> +    compatible:
> +      contains:
> +        const: raspberrypi,bcm2835-firmware
> +
> +  required:
> +    - compatible
> +
>  properties:
>    compatible:
>      items:
> -- 
> 2.26.2
>
Maxime Ripard July 23, 2020, 3:44 p.m. UTC | #3
Hi Stephen, Mike,

On Fri, Jun 26, 2020 at 01:54:33PM +0200, Maxime Ripard wrote:
> The RaspberryPi firmware binding uses two compatible, include simple-bus.
> The select statement generated by default will thus select any node that
> has simple-bus, not all of them being the raspberrypi firmware node.
> 
> This results in warnings being wrongfully reported. Let's add a custom
> select statement to fix that.
> 
> Fixes: 5bc0b9be8544 ("dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
>
> ---
>
> The original binding has been merged through the clock tree, so it should
> be merged there.

Could you apply that patch to clk-next?

Thanks!
Maxime
Rob Herring July 23, 2020, 8:04 p.m. UTC | #4
On Thu, Jul 23, 2020 at 9:44 AM Maxime Ripard <maxime@cerno.tech> wrote:
>
> Hi Stephen, Mike,
>
> On Fri, Jun 26, 2020 at 01:54:33PM +0200, Maxime Ripard wrote:
> > The RaspberryPi firmware binding uses two compatible, include simple-bus.
> > The select statement generated by default will thus select any node that
> > has simple-bus, not all of them being the raspberrypi firmware node.
> >
> > This results in warnings being wrongfully reported. Let's add a custom
> > select statement to fix that.
> >
> > Fixes: 5bc0b9be8544 ("dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML")
> > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> >
> > ---
> >
> > The original binding has been merged through the clock tree, so it should
> > be merged there.
>
> Could you apply that patch to clk-next?

While I said 'simple-mfd' would be more appropriate, that's a separate
issue I guess, so:

Acked-by: Rob Herring <robh@kernel.org>

BTW, qcom,msm8996-apcc.yaml is also breaking linux-next.
Stephen Boyd July 23, 2020, 10:02 p.m. UTC | #5
Quoting Maxime Ripard (2020-07-23 08:44:21)
> Hi Stephen, Mike,
> 
> On Fri, Jun 26, 2020 at 01:54:33PM +0200, Maxime Ripard wrote:
> > The RaspberryPi firmware binding uses two compatible, include simple-bus.
> > The select statement generated by default will thus select any node that
> > has simple-bus, not all of them being the raspberrypi firmware node.
> > 
> > This results in warnings being wrongfully reported. Let's add a custom
> > select statement to fix that.
> > 
> > Fixes: 5bc0b9be8544 ("dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML")
> > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> >
> > ---
> >
> > The original binding has been merged through the clock tree, so it should
> > be merged there.
> 
> Could you apply that patch to clk-next?
> 

Rob has an unresolved comment on this patch.
Stephen Boyd July 23, 2020, 10:33 p.m. UTC | #6
Quoting Maxime Ripard (2020-06-26 04:54:33)
> The RaspberryPi firmware binding uses two compatible, include simple-bus.
> The select statement generated by default will thus select any node that
> has simple-bus, not all of them being the raspberrypi firmware node.
> 
> This results in warnings being wrongfully reported. Let's add a custom
> select statement to fix that.
> 
> Fixes: 5bc0b9be8544 ("dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> 
> ---

Applied to clk-next but I had to fix the fixes tag.
Stephen Boyd July 23, 2020, 10:45 p.m. UTC | #7
Quoting Maxime Ripard (2020-06-26 04:54:33)
> The RaspberryPi firmware binding uses two compatible, include simple-bus.
> The select statement generated by default will thus select any node that
> has simple-bus, not all of them being the raspberrypi firmware node.
> 
> This results in warnings being wrongfully reported. Let's add a custom
> select statement to fix that.
> 
> Fixes: 5bc0b9be8544 ("dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> 
> ---
> 
> The original binding has been merged through the clock tree, so it should
> be merged there.
> 
> Even though the original binding (and the DT) are using the simple-bus
> compatible, this creates some DTC warnings since the firmware really isn't
> a bus, so the node name doesn't match what a bus should have, none of the
> children have a reg property, #address-cells and #size-cells are missing,
> etc.
> 
> I can only guess that simple-bus was used to make the sub-devices probe,
> but maybe simple-mfd would be more appropriate here?
> ---
>  .../bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml   | 9 +++++++++
>  1 file changed, 9 insertions(+)

Hmm. I'm still seeing warnings.

Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dts:23.37-26.15: Warning (simple_bus_reg): /example-0/firmware/clocks: missing or emp
ty reg/ranges property
Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: $nodename:0: 'firmware' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: '#address-cells' is a required property
Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: '#size-cells' is a required property
Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: 'ranges' is a required property
Maxime Ripard July 27, 2020, 3:52 p.m. UTC | #8
On Thu, Jul 23, 2020 at 03:45:48PM -0700, Stephen Boyd wrote:
> Quoting Maxime Ripard (2020-06-26 04:54:33)
> > The RaspberryPi firmware binding uses two compatible, include simple-bus.
> > The select statement generated by default will thus select any node that
> > has simple-bus, not all of them being the raspberrypi firmware node.
> > 
> > This results in warnings being wrongfully reported. Let's add a custom
> > select statement to fix that.
> > 
> > Fixes: 5bc0b9be8544 ("dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML")
> > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> > 
> > ---
> > 
> > The original binding has been merged through the clock tree, so it should
> > be merged there.
> > 
> > Even though the original binding (and the DT) are using the simple-bus
> > compatible, this creates some DTC warnings since the firmware really isn't
> > a bus, so the node name doesn't match what a bus should have, none of the
> > children have a reg property, #address-cells and #size-cells are missing,
> > etc.
> > 
> > I can only guess that simple-bus was used to make the sub-devices probe,
> > but maybe simple-mfd would be more appropriate here?
> > ---
> >  .../bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml   | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> 
> Hmm. I'm still seeing warnings.
> 
> Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dts:23.37-26.15: Warning (simple_bus_reg): /example-0/firmware/clocks: missing or emp
> ty reg/ranges property
> Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: $nodename:0: 'firmware' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: '#address-cells' is a required property
> Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: '#size-cells' is a required property
> Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: 'ranges' is a required property

Yeah, those are the warnings related to the issue we were discussing
with Rob. The patch should fix an hard error.

I'll send a followup patch for the warnings.

Thanks!
Maxime
Stephen Boyd July 27, 2020, 7:39 p.m. UTC | #9
Quoting Maxime Ripard (2020-07-27 08:52:32)
> On Thu, Jul 23, 2020 at 03:45:48PM -0700, Stephen Boyd wrote:
> > Quoting Maxime Ripard (2020-06-26 04:54:33)
> > > The RaspberryPi firmware binding uses two compatible, include simple-bus.
> > > The select statement generated by default will thus select any node that
> > > has simple-bus, not all of them being the raspberrypi firmware node.
> > > 
> > > This results in warnings being wrongfully reported. Let's add a custom
> > > select statement to fix that.
> > > 
> > > Fixes: 5bc0b9be8544 ("dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML")
> > > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> > > 
> > > ---
> > > 
> > > The original binding has been merged through the clock tree, so it should
> > > be merged there.
> > > 
> > > Even though the original binding (and the DT) are using the simple-bus
> > > compatible, this creates some DTC warnings since the firmware really isn't
> > > a bus, so the node name doesn't match what a bus should have, none of the
> > > children have a reg property, #address-cells and #size-cells are missing,
> > > etc.
> > > 
> > > I can only guess that simple-bus was used to make the sub-devices probe,
> > > but maybe simple-mfd would be more appropriate here?
> > > ---
> > >  .../bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml   | 9 +++++++++
> > >  1 file changed, 9 insertions(+)
> > 
> > Hmm. I'm still seeing warnings.
> > 
> > Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dts:23.37-26.15: Warning (simple_bus_reg): /example-0/firmware/clocks: missing or emp
> > ty reg/ranges property
> > Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: $nodename:0: 'firmware' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: '#address-cells' is a required property
> > Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: '#size-cells' is a required property
> > Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.example.dt.yaml: firmware: 'ranges' is a required property
> 
> Yeah, those are the warnings related to the issue we were discussing
> with Rob. The patch should fix an hard error.
> 
> I'll send a followup patch for the warnings.

Ah ok. Let me merge it up now.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml b/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
index b48ed875eb8e..17e4f20c8d39 100644
--- a/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
+++ b/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
@@ -10,6 +10,15 @@  maintainers:
   - Eric Anholt <eric@anholt.net>
   - Stefan Wahren <wahrenst@gmx.net>
 
+select:
+  properties:
+    compatible:
+      contains:
+        const: raspberrypi,bcm2835-firmware
+
+  required:
+    - compatible
+
 properties:
   compatible:
     items: