Skip to contentSkip to conversation

arm64: dts: broadcom: bcm4908: describe USB PHY

PATCH Superseded Rafał Miłecki 3 participants 7 messages Feb 15, 2021 – Feb 17, 2021 Device tree bindings

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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 2/5 arm64: dts: broadcom: bcm4908: describe Ethernet controller

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

BCM4908 SoCs have an integrated Ethernet controller.

---
 .../boot/dts/broadcom/bcm4908/bcm4908.dtsi    | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi +20 -0
index 358958105337..2d2c23292508 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,18 @@ port@3 {
 						phy-mode = "internal";
 						phy-handle = <&phy11>;
 					};
+
+					port@8 {
+						reg = <8>;
+						phy-mode = "internal";
+						ethernet = <&enet>;
+						brcm,use-bcm-hdr;
+
+						fixed-link {
+							speed = <1000>;
+							full-duplex;
+						};
+					};
 				};
 			};
 
Signature · 1 line
2.26.2
#2 lore raw

Re: [PATCH 2/5] arm64: dts: broadcom: bcm4908: describe Ethernet controller

Quoted 29 lines · Rafał Miłecki

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

BCM4908 SoCs have an integrated Ethernet controller.

---
 .../boot/dts/broadcom/bcm4908/bcm4908.dtsi    | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi +8 -0
index 358958105337..2d2c23292508 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>;

arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi port@3 { · line 215

Quoted 9 lines
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi +6 -0
@@ -199,6 +207,18 @@ port@3 {
 						phy-mode = "internal";
 						phy-handle = <&phy11>;
 					};
+
+					port@8 {
+						reg = <8>;
+						phy-mode = "internal";
+						ethernet = <&enet>;
+						brcm,use-bcm-hdr;

This looks redundant, because we have an "ethernet" phandle property here this will become the CPU port for DSA and so we would enable Broadcom tags on that port. Did you somehow need that for the switch driver to work?

Signature · 1 line
Florian
#3 lore raw

Re: [PATCH 2/5] arm64: dts: broadcom: bcm4908: describe Ethernet controller

Quoted 36 lines · Florian Fainelli
Quoted 35 lines · Rafał Miłecki

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

BCM4908 SoCs have an integrated Ethernet controller.

---
  .../boot/dts/broadcom/bcm4908/bcm4908.dtsi    | 20 +++++++++++++++++++
  1 file changed, 20 insertions(+)
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi +11 -0
index 358958105337..2d2c23292508 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,18 @@ port@3 {
  						phy-mode = "internal";
  						phy-handle = <&phy11>;
  					};
+
+					port@8 {
+						reg = <8>;
Quoted 8 lines

arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi port@3 { · line 215

Quoted 3 lines
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi +3 -0
+						phy-mode = "internal";
+						ethernet = <&enet>;
+						brcm,use-bcm-hdr;

This looks redundant, because we have an "ethernet" phandle property here this will become the CPU port for DSA and so we would enable Broadcom tags on that port. Did you somehow need that for the switch driver to work?

I blindly added that property. I verified now that it's not needed.

It seems bcm_sf2_imp_setup() handles setup properly.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw

PATCH 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 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
#6 lore raw

PATCH 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