Skip to contentSkip to conversation

dt-bindings: bus: brcm,bus-axi: Convert binding to YAML

PATCH In review Rosen Penev 3 participants 3 messages Jul 26 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: bus: brcm,bus-axi: Convert binding to YAML

Convert the Broadcom AXI bus (bcma) binding from legacy .txt format to dt-schema YAML format. This resolves dtbs_check schema validation warnings for the brcm,bus-axi compatible string across all BCM47xx and BCM53xx ARM SoC board DTBs.

The schema documents the AXI bus node with its required compatible and reg properties, address/size/interrupt cell configurations, and interrupt-map for assigning IRQ numbers on BCM47xx/BCM53xx platforms where automatic detection is not available.

---
 .../devicetree/bindings/bus/brcm,bus-axi.txt  | 53 -------------
 .../devicetree/bindings/bus/brcm,bus-axi.yaml | 77 +++++++++++++++++++
 2 files changed, 77 insertions(+), 53 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/brcm,bus-axi.txt
 create mode 100644 Documentation/devicetree/bindings/bus/brcm,bus-axi.yaml
Documentation/devicetree/bindings/bus/brcm,bus-axi.txt deleted +0 -53
deleted file mode 100644
index edd44d802139..000000000000
@@ -1,53 +0,0 @@
-Driver for ARM AXI Bus with Broadcom Plugins (bcma)
-
-Required properties:
-
-- compatible : brcm,bus-axi
-
-- reg : iomem address range of chipcommon core
-
-The cores on the AXI bus are automatically detected by bcma with the
-memory ranges they are using and they get registered afterwards.
-Automatic detection of the IRQ number is not working on
-BCM47xx/BCM53xx ARM SoCs. To assign IRQ numbers to the cores, provide
-them manually through device tree. Use an interrupt-map to specify the
-IRQ used by the devices on the bus. The first address is just an index,
-because we do not have any special register.
-
-The top-level axi bus may contain children representing attached cores
-(devices). This is needed since some hardware details can't be auto
-detected (e.g. IRQ numbers). Also some of the cores may be responsible
-for extra things, e.g. ChipCommon providing access to the GPIO chip.
-
-Example:
-
-	axi@18000000 {
-		compatible = "brcm,bus-axi";
-		reg = <0x18000000 0x1000>;
-		ranges = <0x00000000 0x18000000 0x00100000>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-		#interrupt-cells = <1>;
-		interrupt-map-mask = <0x000fffff 0xffff>;
-		interrupt-map =
-			/* Ethernet Controller 0 */
-			<0x00024000 0 &gic GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
-
-			/* Ethernet Controller 1 */
-			<0x00025000 0 &gic GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
-
-			/* PCIe Controller 0 */
-			<0x00012000 0 &gic GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
-			<0x00012000 1 &gic GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>,
-			<0x00012000 2 &gic GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>,
-			<0x00012000 3 &gic GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>,
-			<0x00012000 4 &gic GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
-			<0x00012000 5 &gic GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
-
-		chipcommon {
-			reg = <0x00000000 0x1000>;
-
-			gpio-controller;
-			#gpio-cells = <2>;
-		};
-	};
Documentation/devicetree/bindings/bus/brcm,bus-axi.yaml new file +77 -0

77 lines not on this page · raw message

Signature · 1 line
2.55.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Low] DT Example Compilation Failure due to missing includes and undefined phandle. - [Low] DT Schema…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] DT Example Compilation Failure due to missing includes and undefined phandle.
- [Low] DT Schema Validation Failure & DTC Warning due to missing unit-address in child node. --

--- Patch [1]: [PATCH] dt-bindings: bus: brcm,bus-axi: Convert binding to YAML --- commit afe32a853f1abd5449035c850043c368de3892be
Author: Rosen Penev <[email protected]>

dt-bindings: bus: brcm,bus-axi: Convert binding to YAML

Convert the Broadcom AXI bus (bcma) binding from legacy .txt format to dt-schema YAML format. This resolves dtbs_check schema validation warnings for the brcm,bus-axi compatible string across all BCM47xx and BCM53xx ARM SoC board DTBs.

Quoted 5 lines
Documentation/devicetree/bindings/bus/brcm,bus-axi.yaml new file +0 -0
new file mode 100644
index 0000000000000..951aa139dd987

[ ... ]

Quoted 5 lines
Documentation/devicetree/bindings/bus/brcm,bus-axi.yaml new file +5 -0
+examples:
+  - |
+    axi@18000000 {
+        compatible = "brcm,bus-axi";
+        reg = <0x18000000 0x1000>;

Documentation/devicetree/bindings/bus/brcm,bus-axi.yaml line 70

Quoted 10 lines
Documentation/devicetree/bindings/bus/brcm,bus-axi.yaml new file +10 -0
+        ranges = <0x00000000 0x18000000 0x00100000>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        #interrupt-cells = <1>;
+        interrupt-map-mask = <0x000fffff 0xffff>;
+        interrupt-map =
+            /* Ethernet Controller 0 */
+            <0x00024000 0 &gic GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
+            /* Ethernet Controller 1 */
+            <0x00025000 0 &gic GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;

[Severity: Low]
Will this example fail to compile during make dt_binding_check?

The example uses macros like GIC_SPI and IRQ_TYPE_LEVEL_HIGH, but seems to be missing the required includes:
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>

Additionally, is the &gic phandle defined anywhere in the example scope? If not, it might cause a reference to non-existent node or label dtc error.

Documentation/devicetree/bindings/bus/brcm,bus-axi.yaml

Quoted 2 lines
Documentation/devicetree/bindings/bus/brcm,bus-axi.yaml new file +2 -0
+
+        chipcommon {

[Severity: Low]
Does this child node need a unit address to pass schema validation?

The schema defines valid children using patternProperties: "@[0-9a-f]+$". Since this node contains a reg property, the Devicetree specification requires a unit address (e.g., chipcommon@0). Without it, make dt_binding_check might reject this as an undocumented property and emit a unit_address_vs_reg warning.

Quoted 5 lines
Documentation/devicetree/bindings/bus/brcm,bus-axi.yaml new file +5 -0
+            reg = <0x00000000 0x1000>;
+            gpio-controller;
+            #gpio-cells = <2>;
+        };
+    };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to Rosen Penev
Quoted 10 lines · Rosen Penev

Convert the Broadcom AXI bus (bcma) binding from legacy .txt format to dt-schema YAML format. This resolves dtbs_check schema validation warnings for the brcm,bus-axi compatible string across all BCM47xx and BCM53xx ARM SoC board DTBs.

The schema documents the AXI bus node with its required compatible and reg properties, address/size/interrupt cell configurations, and interrupt-map for assigning IRQ numbers on BCM47xx/BCM53xx platforms where automatic detection is not available.

Quoted 8 lines
---
 .../devicetree/bindings/bus/brcm,bus-axi.txt  | 53 -------------
 .../devicetree/bindings/bus/brcm,bus-axi.yaml | 77 +++++++++++++++++++
 2 files changed, 77 insertions(+), 53 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/brcm,bus-axi.txt
 create mode 100644 Documentation/devicetree/bindings/bus/brcm,bus-axi.yaml

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Lexical error: Documentation/devicetree/bindings/bus/brcm,bus-axi.example.dts:28.36-43 Unexpected 'GIC_SPI' Lexical error: Documentation/devicetree/bindings/bus/brcm,bus-axi.example.dts:28.48-67 Unexpected 'IRQ_TYPE_LEVEL_HIGH' Lexical error: Documentation/devicetree/bindings/bus/brcm,bus-axi.example.dts:30.36-43 Unexpected 'GIC_SPI' Lexical error: Documentation/devicetree/bindings/bus/brcm,bus-axi.example.dts:30.48-67 Unexpected 'IRQ_TYPE_LEVEL_HIGH' FATAL ERROR: Syntax error parsing input tree
make[2]: *** [scripts/Makefile.dtbs:140: Documentation/devicetree/bindings/bus/brcm,bus-axi.example.dtb] Error 1 make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1705: dt_binding_check] Error 2
make: *** [Makefile:248: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.