Skip to contentSkip to conversation

arm64: dts: broadcom: bcm4908: describe USB PHY

PATCH Applied Rafał Miłecki 2 participants 11 messages Feb 19, 2021 – Mar 9, 2021 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/5 arm64: dts: broadcom: bcm4908: describe USB PHY

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

BCM4908 uses slightly modified STB family USB PHY. It handles OHCI/EHCI and XHCI. It requires powering up using the PMB.

---
 .../bcm4908/bcm4906-netgear-r8000p.dts        | 17 +++++++++++++
 .../bcm4908/bcm4908-asus-gt-ac5300.dts        | 17 +++++++++++++
 .../boot/dts/broadcom/bcm4908/bcm4908.dtsi    | 25 ++++++++++++++++---
 3 files changed, 55 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts +17 -0
index ee3ed612274c..bf0d534ace2e 100644
@@ -26,6 +26,23 @@ wps {
 	};
 };
 
+&usb_phy {
+	brcm,ioc = <1>;
+	status = "okay";
+};
+
+&ehci {
+	status = "okay";
+};
+
+&ohci {
+	status = "okay";
+};
+
+&xhci {
+	status = "okay";
+};
+
 &nandcs {
 	nand-ecc-strength = <4>;
 	nand-ecc-step-size = <512>;
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts +17 -0
index 6e4ad66ff536..bb06683d6acf 100644
@@ -44,6 +44,23 @@ brightness {
 	};
 };
 
+&usb_phy {
+	brcm,ioc = <1>;
+	status = "okay";
+};
+
+&ehci {
+	status = "okay";
+};
+
+&ohci {
+	status = "okay";
+};
+
+&xhci {
+	status = "okay";
+};
+
 &ports {
 	port@0 {
 		label = "lan2";
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi +21 -4
index 9354077f74cd..358958105337 100644
@@ -2,6 +2,8 @@
 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/phy/phy.h>
+#include <dt-bindings/soc/bcm-pmb.h>
 
 /dts-v1/;
 
@@ -110,24 +112,39 @@ soc {
 		#size-cells = <1>;
 		ranges = <0x00 0x00 0x80000000 0x281000>;
 
-		usb@c300 {
+		usb_phy: usb-phy@c200 {
+			compatible = "brcm,bcm4908-usb-phy";
+			reg = <0xc200 0x100>;
+			reg-names = "crtl";
+			power-domains = <&pmb BCM_PMB_HOST_USB>;
+			dr_mode = "host";
+			brcm,has-xhci;
+			brcm,has-eohci;
+			#phy-cells = <1>;
+			status = "disabled";
+		};
+
+		ehci: usb@c300 {
 			compatible = "generic-ehci";
 			reg = <0xc300 0x100>;
 			interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
+			phys = <&usb_phy PHY_TYPE_USB2>;
 			status = "disabled";
 		};
 
-		usb@c400 {
+		ohci: usb@c400 {
 			compatible = "generic-ohci";
 			reg = <0xc400 0x100>;
 			interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
+			phys = <&usb_phy PHY_TYPE_USB2>;
 			status = "disabled";
 		};
 
-		usb@d000 {
+		xhci: usb@d000 {
 			compatible = "generic-xhci";
 			reg = <0xd000 0x8c8>;
 			interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+			phys = <&usb_phy PHY_TYPE_USB3>;
 			status = "disabled";
 		};
 
@@ -222,7 +239,7 @@ procmon: syscon@280000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
 
-			power-controller@2800c0 {
+			pmb: power-controller@2800c0 {
 				compatible = "brcm,bcm4908-pmb";
 				reg = <0x2800c0 0x40>;
 				#power-domain-cells = <1>;
Signature · 1 line
2.26.2
#1 lore raw

PATCH v2 2/5 arm64: dts: broadcom: bcm4908: describe Ethernet controller

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

BCM4908 SoCs have an integrated Ethernet controller.

---
V2: Drop redundant brcm,use-bcm-hdr

---
 .../boot/dts/broadcom/bcm4908/bcm4908.dtsi    | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi +19 -0
index 358958105337..bdbf94f3348a 100644
@@ -112,6 +112,14 @@ soc {
 		#size-cells = <1>;
 		ranges = <0x00 0x00 0x80000000 0x281000>;
 
+		enet: ethernet@2000 {
+			compatible = "brcm,bcm4908-enet";
+			reg = <0x2000 0x1000>;
+
+			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "rx";
+		};
+
 		usb_phy: usb-phy@c200 {
 			compatible = "brcm,bcm4908-usb-phy";
 			reg = <0xc200 0x100>;
@@ -199,6 +207,17 @@ port@3 {
 						phy-mode = "internal";
 						phy-handle = <&phy11>;
 					};
+
+					port@8 {
+						reg = <8>;
+						phy-mode = "internal";
+						ethernet = <&enet>;
+
+						fixed-link {
+							speed = <1000>;
+							full-duplex;
+						};
+					};
 				};
 			};
 
Signature · 1 line
2.26.2
#3 lore raw

PATCH v2 3/5 arm64: dts: broadcom: bcm4908: describe Netgear R8000P switch

In reply to Rafał Miłecki

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

R8000P model has 4 LAN ports and 1 WAN port.

---
 .../bcm4908/bcm4906-netgear-r8000p.dts        | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts +25 -0
index bf0d534ace2e..af2616e82e83 100644
@@ -43,6 +43,31 @@ &xhci {
 	status = "okay";
 };
 
+&ports {
+	port@0 {
+		label = "lan4";
+	};
+
+	port@1 {
+		label = "lan3";
+	};
+
+	port@2 {
+		label = "lan2";
+	};
+
+	port@3 {
+		label = "lan1";
+	};
+
+	port@7 {
+		reg = <7>;
+		phy-mode = "internal";
+		phy-handle = <&phy12>;
+		label = "wan";
+	};
+};
+
 &nandcs {
 	nand-ecc-strength = <4>;
 	nand-ecc-step-size = <512>;
Signature · 1 line
2.26.2
#5 lore raw

PATCH v2 4/5 arm64: dts: broadcom: bcm4908: add remaining Netgear R8000P LEDs

In reply to Rafał Miłecki

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

There are a few more GPIO connected LEDs there didn't get described initially.

---
 .../bcm4908/bcm4906-netgear-r8000p.dts        | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts +48 -0
index af2616e82e83..0d02986c80ab 100644
@@ -18,11 +18,59 @@ memory@0 {
 	leds {
 		compatible = "gpio-leds";
 
+		power-white {
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
+		};
+
+		power-amber {
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_AMBER>;
+			gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
+		};
+
 		wps {
 			function = LED_FUNCTION_WPS;
 			color = <LED_COLOR_ID_WHITE>;
 			gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
 		};
+
+		2ghz {
+			function = "2ghz";
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
+		};
+
+		5ghz-1 {
+			function = "5ghz-1";
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
+		};
+
+		5ghz-2 {
+			function = "5ghz-2";
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
+		};
+
+		usb2 {
+			function = "usb2";
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
+		};
+
+		usb3 {
+			function = "usb3";
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
+		};
+
+		wifi {
+			function = "wifi";
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&gpio0 56 GPIO_ACTIVE_LOW>;
+		};
 	};
 };
 
Signature · 1 line
2.26.2
#8 lore raw

PATCH v2 5/5 arm64: dts: broadcom: bcm4908: describe firmware partitions

In reply to Rafał Miłecki

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

BCM4908 bootloader supports multiple firmware partitions and has its own bindings defined for them.

---
 .../dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts  |  1 +
 .../dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts  | 12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts +1 -0
index 0d02986c80ab..7b24ad365a3c 100644
@@ -135,6 +135,7 @@ partition@0 {
 		};
 
 		partition@100000 {
+			compatible = "brcm,bcm4908-firmware";
 			label = "firmware";
 			reg = <0x100000 0x4400000>;
 		};
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts +11 -1
index bb06683d6acf..7240a9ee9812 100644
@@ -122,7 +122,7 @@ &nandcs {
 	#size-cells = <0>;
 
 	partitions {
-		compatible = "fixed-partitions";
+		compatible = "brcm,bcm4908-partitions";
 		#address-cells = <1>;
 		#size-cells = <1>;
 
@@ -130,5 +130,15 @@ partition@0 {
 			label = "cferom";
 			reg = <0x0 0x100000>;
 		};
+
+		partition@100000 {
+			compatible = "brcm,bcm4908-firmware";
+			reg = <0x100000 0x5700000>;
+		};
+
+		partition@5800000 {
+			compatible = "brcm,bcm4908-firmware";
+			reg = <0x5800000 0x5700000>;
+		};
 	};
 };
Signature · 1 line
2.26.2
#7 lore raw

Re: [PATCH V2 4/5] arm64: dts: broadcom: bcm4908: add remaining Netgear R8000P LEDs

In reply to Rafał Miłecki

arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts

Quoted 14 lines · Rafał Miłecki

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

There are a few more GPIO connected LEDs there didn't get described initially.

---
 .../bcm4908/bcm4906-netgear-r8000p.dts        | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts +0 -0
index af2616e82e83..0d02986c80ab 100644

Can you send me a fixup patch to fix the following warnings:

+arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dt.yaml:
leds: '2ghz', '5ghz-1', '5ghz-2' do not match any of the regexes:
'.*-names$', '.*-supply$', '^#.*-cells$', '^#[a-zA-Z0-9,+\\-._]{0,63}$', '^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}$', '^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-fA-F]+(,[0-9a-fA-F]+)*$', '^__.*__$', 'pinctrl-[0-9]+' +arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dt.yaml:
leds: '2ghz', '5ghz-1', '5ghz-2', 'power-amber', 'power-white', 'usb2', 'usb3', 'wifi', 'wps' do not match any of the regexes:
'(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' -arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dt.yaml:
leds: 'wps' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+'

Signature · 1 line
Florian