Skip to contentSkip to conversation

arm64: add config for Broadcom BCM4908 SoCs

PATCH Superseded Rafał Miłecki 2 participants 5 messages Nov 5, 2020 – Nov 11, 2020

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 arm64: add config for Broadcom BCM4908 SoCs

From: Rafał Miłecki <[email protected]>

Add ARCH_BCM4908 config that can be used for compiling DTS files.

---
 arch/arm64/Kconfig.platforms | 8 ++++++++
 arch/arm64/configs/defconfig | 1 +
 2 files changed, 9 insertions(+)
arch/arm64/Kconfig.platforms +8 -0
index cd58f8495c45..52434264a2af 100644
@@ -43,6 +43,14 @@ config ARCH_BCM2835
 	  This enables support for the Broadcom BCM2837 and BCM2711 SoC.
 	  These SoCs are used in the Raspberry Pi 3 and 4 devices.
 
+config ARCH_BCM4908
+	bool "Broadcom BCM4908 family"
+	select GPIOLIB
+	help
+	  This enables support for the Broadcom BCM4906, BCM4908 and
+	  BCM49408 SoCs. These SoCs use Cortex-B53 cores and can be
+	  found in home routers.
+
 config ARCH_BCM_IPROC
 	bool "Broadcom iProc SoC Family"
 	select COMMON_CLK_IPROC
arch/arm64/configs/defconfig +1 -0
index e0f33826819f..d2717bf2afe1 100644
@@ -32,6 +32,7 @@ CONFIG_ARCH_AGILEX=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_ARCH_ALPINE=y
 CONFIG_ARCH_BCM2835=y
+CONFIG_ARCH_BCM4908=y
 CONFIG_ARCH_BCM_IPROC=y
 CONFIG_ARCH_BERLIN=y
 CONFIG_ARCH_BRCMSTB=y
Signature · 1 line
2.27.0
#1 lore raw

PATCH v2 2/2 arm64: dts: broadcom: add BCM4908 and Asus GT-AC5300 early DTS files

From: Rafał Miłecki <[email protected]>

They don't descibe hardware fully yet but it's enough to boot a system.

Some missing blocks:
1. PMC (Power Management Controller?)
2. Ethernet
3. Crypto
4. Thermal

Asus DTS is missing defining full NAND partitions layout and buttons.

Further changes will fill those gaps as soon as required bindings will be found / tested / added.

---
V2: Move some NAND properties to device dts
Fix CPU compatible strings
Add axi@81000000
Fix PMU compatible string

---
 arch/arm64/boot/dts/broadcom/Makefile         |   1 +
 arch/arm64/boot/dts/broadcom/bcm4908/Makefile |   2 +
 .../bcm4908/bcm4908-asus-gt-ac5300.dts        |  66 ++++++
 .../boot/dts/broadcom/bcm4908/bcm4908.dtsi    | 188 ++++++++++++++++++
 4 files changed, 257 insertions(+)
 create mode 100644 arch/arm64/boot/dts/broadcom/bcm4908/Makefile
 create mode 100644 arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
 create mode 100644 arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
arch/arm64/boot/dts/broadcom/Makefile +1 -0
index cb7de8d99223..998e240aa698 100644
@@ -5,5 +5,6 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-4-b.dtb \
 			      bcm2837-rpi-3-b-plus.dtb \
 			      bcm2837-rpi-cm3-io3.dtb
 
+subdir-y	+= bcm4908
 subdir-y	+= northstar2
 subdir-y	+= stingray
arch/arm64/boot/dts/broadcom/bcm4908/Makefile new file +2 -0
new file mode 100644
index 000000000000..ef26c23603ce
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0
+dtb-$(CONFIG_ARCH_BCM4908) += bcm4908-asus-gt-ac5300.dtb
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts new file +66 -0

66 lines not on this page · raw message

arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi new file +188 -0

188 lines not on this page · raw message

Signature · 1 line
2.27.0
#2 lore raw

Re: [PATCH V2 2/2] arm64: dts: broadcom: add BCM4908 and Asus GT-AC5300 early DTS files

Quoted 10 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

They don't descibe hardware fully yet but it's enough to boot a system.

Some missing blocks:
1. PMC (Power Management Controller?)
2. Ethernet
3. Crypto
4. Thermal

Quoted 6 lines

Asus DTS is missing defining full NAND partitions layout and buttons.

Further changes will fill those gaps as soon as required bindings will be found / tested / added.

We would need a board/SoC binding document under Documentation/devicetree/bindings/arm/bcm/ which describes the 4908 SoC and its possible boards at least.

[snip]
h

Quoted 8 lines
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts new file +8 -0
+
+&nandcs {
+	nand-ecc-strength = <4>;
+	nand-ecc-step-size = <512>;
+	nand-on-flash-bbt;
+	brcm,nand-has-wp;
+
+	#address-cells = <1>;

arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts line 63

Quoted 10 lines
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts new file +10 -0
+	#size-cells = <0>;
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition@0 {
+			label = "cferom";
+			reg = <0x000000000000 0x000000100000>;

You can probably trim the leading zeroes.

Quoted 18 lines
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts new file +3 -0
+		};
+	};
+};
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi new file +9 -0
new file mode 100644
index 000000000000..3bbefc86b978
@@ -0,0 +1,188 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/dts-v1/;
+
+/ {
+	interrupt-parent = <&gic>;

arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi line 19

Quoted 10 lines
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi new file +10 -0
+
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		bootargs = "earlycon=bcm63xx_uart,0xff800640";

We talked about it before, but the earlycon should be dropped from the .dtsi file, it does not really belong there.

The rest looks good to me!

Signature · 1 line
Florian
#3 lore raw

Re: [PATCH V2 2/2] arm64: dts: broadcom: add BCM4908 and Asus GT-AC5300 early DTS files

Quoted 20 lines · Florian Fainelli
Quoted 20 lines
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi new file +14 -0
new file mode 100644
index 000000000000..3bbefc86b978
@@ -0,0 +1,188 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/dts-v1/;
+
+/ {
+	interrupt-parent = <&gic>;
+
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	aliases {
Quoted 8 lines

arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi line 19

Quoted 5 lines
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi new file +5 -0
+		serial0 = &uart0;
+	};
+
+	chosen {
+		bootargs = "earlycon=bcm63xx_uart,0xff800640";

We talked about it before, but the earlycon should be dropped from the .dtsi file, it does not really belong there.

I asked the following question that you probably missed, could you check it, please?

Quoted 1 line · Rafał Miłecki

Can you explain why, is that some kernel rule I missed? That's extremely helpful for debugging.

^^

#4 lore raw

Re: [PATCH V2 2/2] arm64: dts: broadcom: add BCM4908 and Asus GT-AC5300 early DTS files

Quoted 31 lines · Rafał Miłecki
Quoted 21 lines · Florian Fainelli
Quoted 21 lines
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi new file +14 -0
new file mode 100644
index 000000000000..3bbefc86b978
@@ -0,0 +1,188 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/dts-v1/;
+
+/ {
+    interrupt-parent = <&gic>;
+
+    #address-cells = <2>;
+    #size-cells = <2>;
+
+    aliases {
Quoted 8 lines

arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi line 19

Quoted 5 lines
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi new file +5 -0
+        serial0 = &uart0;
+    };
+
+    chosen {
+        bootargs = "earlycon=bcm63xx_uart,0xff800640";

We talked about it before, but the earlycon should be dropped from the .dtsi file, it does not really belong there.

Quoted 6 lines

I asked the following question that you probably missed, could you check it, please?

Quoted 1 line · Rafał Miłecki

Can you explain why, is that some kernel rule I missed? That's

extremely helpful for debugging.

It's useful for debugging but because it is meant for debugging it does not really belong in a .dtsi which gets included by a board level .dts file and I would argue that it does not belong in a board level .dts either. This is something that you can and should keep locally while debugging and remove for "production". That is not a rule that is written somewhere, and there are certainly cases of .dts files in the kernel containing "earlycon" for better or for worse.

Signature · 1 line
Florian