Skip to contentSkip to conversation

ARM: dts: Add some BCM6846 device tree

PATCH Applied Linus Walleij 2 participants 20 messages Oct 19, 2024 – Nov 24, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v3 cover ARM: dts: Add some BCM6846 device tree

This adds some silicon blocks to the BCM6846 DTSI file and adds a device tree for the Genexis XG6846B device that make use of it.

This is mainly so as to get this off my hard drive and share the basics with others who want to work on the BCM6846.

I think most of the DTSI changes can be just copied verbatim to the rest of the BCMBCA family (maybe extracted into a common bcbca.dtsi?) but let's think about that later. This will do for now.

The XG6846B device tree uses the new shift register bits property of the BCM63138 LEDs, which is ACKed by the DT maintainers albeit not yet merged in the LED tree.

---
Changes in v3:
- Fix the MDIO size-cells and address-cells, the <0> and <1> were switched
around.
- Defined, and made sure the ngpios property was accepted to the GPIO tree before proceeding to use it.
See: https://lore.kernel.org/linux-gpio/[email protected]/
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Use the new "brcm,bcm6846-mdio" compatible for the MDIO block. (Merged
to the netdev tree).
- Add the ARM PrimeCell PL081 DMA controller block.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Linus Walleij (9):
ARM: dts: bcm6846: Add iproc rng
ARM: dts: bcm6846: Enable watchdog
ARM: dts: bcm6846: Add GPIO blocks
ARM: dts: bcm6846: Add MDIO control block
ARM: dts: bcm6846: Add LED controller
ARM: dts: bcm6846: Add ARM PL081 DMA block
dt-bindings: vendor-prefixes: Add Genexis
dt-bindings: arm: bcmbca: Add Genexis XG6846B
ARM: dts: broadcom: Add Genexis XG6846B DTS file

 .../devicetree/bindings/arm/bcm/brcm,bcmbca.yaml   |   1 +
 .../devicetree/bindings/vendor-prefixes.yaml       |   2 +
 arch/arm/boot/dts/broadcom/Makefile                |   1 +
 .../boot/dts/broadcom/bcm6846-genexis-xg6846b.dts  | 244 +++++++++++++++++++++
 arch/arm/boot/dts/broadcom/bcm6846.dtsi            | 120 ++++++++++
 5 files changed, 368 insertions(+)

---
base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
change-id: 20241010-genexis-xg6846b-base-ef3fbec0be01

Best regards,

Signature · 1 line
Linus Walleij <[email protected]>
#1 lore raw

PATCH v3 1/9 ARM: dts: bcm6846: Add iproc rng

The bcm6846 has a standard iproc 200 RNG which is already fully supported by bindings, so just add it to the DTS file.

---
 arch/arm/boot/dts/broadcom/bcm6846.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/broadcom/bcm6846.dtsi +5 -0
index ee361cb00b7c..c2a8deef150a 100644
@@ -108,6 +108,11 @@ uart0: serial@640 {
 			status = "disabled";
 		};
 
+		rng@b80 {
+			compatible = "brcm,iproc-rng200";
+			reg = <0xb80 0x28>;
+		};
+
 		hsspi: spi@1000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
Signature · 1 line
2.46.2
#3 lore raw

PATCH v3 2/9 ARM: dts: bcm6846: Enable watchdog

In reply to Linus Walleij

The BCM6846 has a BCM7038-compatible watchdog timer, just add it to the device tree.

---
 arch/arm/boot/dts/broadcom/bcm6846.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/broadcom/bcm6846.dtsi +5 -0
index c2a8deef150a..f4f1f3a06eac 100644
@@ -99,6 +99,11 @@ bus@ff800000 {
 		#size-cells = <1>;
 		ranges = <0 0xff800000 0x800000>;
 
+		watchdog@480 {
+			compatible = "brcm,bcm6345-wdt";
+			reg = <0x480 0x10>;
+		};
+
 		uart0: serial@640 {
 			compatible = "brcm,bcm6345-uart";
 			reg = <0x640 0x1b>;
Signature · 1 line
2.46.2
#5 lore raw

PATCH v3 3/9 ARM: dts: bcm6846: Add GPIO blocks

In reply to Linus Walleij

The BCM6846 has the same simplistic GPIOs as some other Broadcom SoCs: plain memory-mapped registers with up to 8 blocks of 32 GPIOs each totalling 256 GPIOs.

Users of the SoC can selectively enable the GPIO blocks actually used with a certain design.

---
 arch/arm/boot/dts/broadcom/bcm6846.dtsi | 80 +++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
arch/arm/boot/dts/broadcom/bcm6846.dtsi +80 -0
index f4f1f3a06eac..dc0c87c79569 100644
@@ -104,6 +104,86 @@ watchdog@480 {
 			reg = <0x480 0x10>;
 		};
 
+		/* GPIOs 0 .. 31 */
+		gpio0: gpio@500 {
+			compatible = "brcm,bcm6345-gpio";
+			reg = <0x500 0x04>, <0x520 0x04>;
+			reg-names = "dirout", "dat";
+			gpio-controller;
+			#gpio-cells = <2>;
+			status = "disabled";
+		};
+
+		/* GPIOs 32 .. 63 */
+		gpio1: gpio@504 {
+			compatible = "brcm,bcm6345-gpio";
+			reg = <0x504 0x04>, <0x524 0x04>;
+			reg-names = "dirout", "dat";
+			gpio-controller;
+			#gpio-cells = <2>;
+			status = "disabled";
+		};
+
+		/* GPIOs 64 .. 95 */
+		gpio2: gpio@508 {
+			compatible = "brcm,bcm6345-gpio";
+			reg = <0x508 0x04>, <0x528 0x04>;
+			reg-names = "dirout", "dat";
+			gpio-controller;
+			#gpio-cells = <2>;
+			status = "disabled";
+		};
+
+		/* GPIOs 96 .. 127 */
+		gpio3: gpio@50c {
+			compatible = "brcm,bcm6345-gpio";
+			reg = <0x50c 0x04>, <0x52c 0x04>;
+			reg-names = "dirout", "dat";
+			gpio-controller;
+			#gpio-cells = <2>;
+			status = "disabled";
+		};
+
+		/* GPIOs 128 .. 159 */
+		gpio4: gpio@510 {
+			compatible = "brcm,bcm6345-gpio";
+			reg = <0x510 0x04>, <0x530 0x04>;
+			reg-names = "dirout", "dat";
+			gpio-controller;
+			#gpio-cells = <2>;
+			status = "disabled";
+		};
+
+		/* GPIOs 160 .. 191 */
+		gpio5: gpio@514 {
+			compatible = "brcm,bcm6345-gpio";
+			reg = <0x514 0x04>, <0x534 0x04>;
+			reg-names = "dirout", "dat";
+			gpio-controller;
+			#gpio-cells = <2>;
+			status = "disabled";
+		};
+
+		/* GPIOs 192 .. 223 */
+		gpio6: gpio@518 {
+			compatible = "brcm,bcm6345-gpio";
+			reg = <0x518 0x04>, <0x538 0x04>;
+			reg-names = "dirout", "dat";
+			gpio-controller;
+			#gpio-cells = <2>;
+			status = "disabled";
+		};
+
+		/* GPIOs 224 .. 255 */
+		gpio7: gpio@51c {
+			compatible = "brcm,bcm6345-gpio";
+			reg = <0x51c 0x04>, <0x53c 0x04>;
+			reg-names = "dirout", "dat";
+			gpio-controller;
+			#gpio-cells = <2>;
+			status = "disabled";
+		};
+
 		uart0: serial@640 {
 			compatible = "brcm,bcm6345-uart";
 			reg = <0x640 0x1b>;
Signature · 1 line
2.46.2
maintainer Applied
#6 lore raw

Re: [PATCH v3 3/9] ARM: dts: bcm6846: Add GPIO blocks

From: Florian Fainelli <[email protected]>

Quoted 9 lines · Linus Walleij

The BCM6846 has the same simplistic GPIOs as some other Broadcom SoCs: plain memory-mapped registers with up to 8 blocks of 32 GPIOs each totalling 256 GPIOs.

Users of the SoC can selectively enable the GPIO blocks actually used with a certain design.

---

Applied to https://github.com/Broadcom/stblinux/commits/devicetree/next, thanks! --
Florian

#7 lore raw

PATCH v3 4/9 ARM: dts: bcm6846: Add MDIO control block

In reply to Linus Walleij

This adds the MDIO block found in the BCM6846. Use the new "brcm,bcm6846-mdio" compatible (merged to the networking tree) for this block.

---
 arch/arm/boot/dts/broadcom/bcm6846.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/broadcom/bcm6846.dtsi +9 -0
index dc0c87c79569..d6f5fe740ca5 100644
@@ -223,5 +223,14 @@ nandcs: nand@0 {
 				reg = <0>;
 			};
 		};
+
+		mdio: mdio@2060 {
+			compatible = "brcm,bcm6846-mdio";
+			reg = <0x02060 0x10>, <0x5a068 0x4>;
+			reg-names = "mdio", "mdio_indir_rw";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
 	};
 };
Signature · 1 line
2.46.2
#9 lore raw

PATCH v3 5/9 ARM: dts: bcm6846: Add LED controller

In reply to Linus Walleij

Add the BCMBCA LED controller to the BCM6846 DTSI.

---
 arch/arm/boot/dts/broadcom/bcm6846.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/broadcom/bcm6846.dtsi +8 -0
index d6f5fe740ca5..378dbd1b41b3 100644
@@ -198,6 +198,14 @@ rng@b80 {
 			reg = <0xb80 0x28>;
 		};
 
+		leds: led-controller@800 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "brcm,bcm63138-leds";
+			reg = <0x800 0xdc>;
+			status = "disabled";
+		};
+
 		hsspi: spi@1000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
Signature · 1 line
2.46.2
#11 lore raw

PATCH v3 6/9 ARM: dts: bcm6846: Add ARM PL081 DMA block

In reply to Linus Walleij

The ARM PL081 DMA controller can be found in the BCM6846 memory map, and it turns out to work.

The block may be used as DMA engine for some of the peripherals (maybe the EMMC controller found in the same group of peripherals?) but it can always be used as a memcpy engine, which is a generic "blitter".

I tested it with the dmatest module, and it copies lots of data very fast and fires hundreds of thousands of interrupts so it works just fine.

Add it to the BCM6846 DTSI file.

---
 arch/arm/boot/dts/broadcom/bcm6846.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/boot/dts/broadcom/bcm6846.dtsi +13 -0
index 378dbd1b41b3..e0e06af3fe89 100644
@@ -240,5 +240,18 @@ mdio: mdio@2060 {
 			#size-cells = <0>;
 			status = "disabled";
 		};
+
+		pl081_dma: dma-controller@59000 {
+			compatible = "arm,pl081", "arm,primecell";
+			// The magic B105F00D info is missing
+			arm,primecell-periphid = <0x00041081>;
+			reg = <0x59000 0x1000>;
+			interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
+			memcpy-burst-size = <256>;
+			memcpy-bus-width = <32>;
+			clocks = <&periph_clk>;
+			clock-names = "apb_pclk";
+			#dma-cells = <2>;
+		};
 	};
 };
Signature · 1 line
2.46.2
maintainer Applied
#12 lore raw

Re: [PATCH v3 6/9] ARM: dts: bcm6846: Add ARM PL081 DMA block

From: Florian Fainelli <[email protected]>

Quoted 8 lines · Linus Walleij

The ARM PL081 DMA controller can be found in the BCM6846 memory map, and it turns out to work.

The block may be used as DMA engine for some of the peripherals (maybe the EMMC controller found in the same group of peripherals?) but it can always be used as a memcpy engine, which is a generic "blitter".

Quoted 8 lines

I tested it with the dmatest module, and it copies lots of data very fast and fires hundreds of thousands of interrupts so it works just fine.

Add it to the BCM6846 DTSI file.

---

Applied to https://github.com/Broadcom/stblinux/commits/devicetree/next, thanks! --
Florian

#13 lore raw

PATCH v3 7/9 dt-bindings: vendor-prefixes: Add Genexis

In reply to Linus Walleij

Genexis is Swedish/Dutch company producing broadband access equipment.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index b320a39de7fe..43d936361fdd 100644
@@ -567,6 +567,8 @@ patternProperties:
     description: Gemtek Technology Co., Ltd.
   "^genesys,.*":
     description: Genesys Logic, Inc.
+  "^genexis,.*":
+    description: Genexis BV/AB
   "^geniatech,.*":
     description: Geniatech, Inc.
   "^giantec,.*":
Signature · 1 line
2.46.2
#15 lore raw

PATCH v3 8/9 dt-bindings: arm: bcmbca: Add Genexis XG6846B

In reply to Linus Walleij

This adds the device tree bindings for the Genexis XG6846B router/gateway/broadband modem.

---
 Documentation/devicetree/bindings/arm/bcm/brcm,bcmbca.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/bcm/brcm,bcmbca.yaml +1 -0
index 07892cbdd23c..2223234be687 100644
@@ -115,6 +115,7 @@ properties:
         items:
           - enum:
               - brcm,bcm96846
+              - genexis,xg6846b
           - const: brcm,bcm6846
           - const: brcm,bcmbca
 
Signature · 1 line
2.46.2
#17 lore raw

PATCH v3 9/9 ARM: dts: broadcom: Add Genexis XG6846B DTS file

In reply to Linus Walleij

This adds a device tree for the Genexis XG6846B router.

---
 arch/arm/boot/dts/broadcom/Makefile                |   1 +
 .../boot/dts/broadcom/bcm6846-genexis-xg6846b.dts  | 244 +++++++++++++++++++++
 2 files changed, 245 insertions(+)
arch/arm/boot/dts/broadcom/Makefile +1 -0
index 5881bcc95eba..d23cf466127b 100644
@@ -36,6 +36,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
 	bcm2835-rpi-zero.dtb \
 	bcm2835-rpi-zero-w.dtb
 dtb-$(CONFIG_ARCH_BCMBCA) += \
+	bcm6846-genexis-xg6846b.dtb \
 	bcm947622.dtb \
 	bcm963138.dtb \
 	bcm963138dvt.dtb \
arch/arm/boot/dts/broadcom/bcm6846-genexis-xg6846b.dts new file +244 -0

244 lines not on this page · raw message

Signature · 1 line
2.46.2
#19 lore raw
In reply to Linus Walleij
Quoted 3 lines · Linus Walleij

This adds some silicon blocks to the BCM6846 DTSI file and adds a device tree for the Genexis XG6846B device that make use of it.

Is this series good to go? All prerequisites and ACKs should be in place. Pending on the list for two weeks.

Yours,
Linus Walleij