[LEDE-DEV] [PATCH v2] brcm63xx: Add Observa VH4032N support

Daniel Gonzalez Cabanelas dgcbueu at gmail.com
Sat Dec 3 06:51:05 PST 2016


Add support for the Observa Telecom VH4032N router.

This is another BCM6368 router, 128 MB RAM, 32MB flash and 3 USB
host ports. It has an onboard USB hub that needs to be pulled out of
reset via GPIO27. 

The 4 LAN switch LEDs should be controlled via hardware but they don't 
work as with all BCM6368 based boards (known bug, GPIO LAN-LED mux 
is lost at boot time). There is an ongoing patch to fix it in a different commit.

The wifi chip is an onboard Broadcom BCM43222.
---
change in v2:
shift order in LAN ports, and rename them to match exactly what
this board has
---
Signed-off-by: Daniel Gonzalez Cabanelas <dgcbueu at gmail.com>
diff --git a/target/linux/brcm63xx/base-files/etc/board.d/02_network b/target/linux/brcm63xx/base-files/etc/board.d/02_network
index c20caf9..c83aa62 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/02_network
+++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network
@@ -98,6 +98,11 @@ vr-3026e)
 		"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "8t at eth0"
 	;;
 
+vh4032n)
+	ucidef_add_switch "switch0" \
+		"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "8t at eth0"
+	;;
+
 bcm96368mvwg)
 	ucidef_add_switch "switch0" \
 		"1:lan" "2:lan" "4:lan" "5:lan" "8t at eth0"
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh
index 852a701..3a858e4 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -33,6 +33,9 @@ set_state() {
 	spw303v)
 		status_led="spw303v:green:power+adsl"
 		;;
+	vh4032n)
+		status_led="VH4032N:red:power"
+		;;
 	vr-3025un)
 		status_led="VR-3025un:green:power"
 		;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
index 1201168..650db9d 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
@@ -31,6 +31,7 @@ case "$(brcm63xx_board_name)" in
 	spw303v |\
 	v2110 |\
 	v2500v_bb |\
+	vh4032n |\
 	vr-3025u |\
 	vr-3025un |\
 	vr-3026e |\
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 9cc0b2b..3dce282 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -189,6 +189,9 @@ brcm63xx_dt_detect() {
 	"NuCom R5010UN v2")
 		board_name="r5010un_v2"
 		;;
+	"Observa VH4032N")
+		board_name="vh4032n"
+		;;
 	"Pirelli A226G")
 		board_name="a226g"
 		;;
diff --git a/target/linux/brcm63xx/dts/vh4032n.dts b/target/linux/brcm63xx/dts/vh4032n.dts
new file mode 100644
index 0000000..d75c636
--- /dev/null
+++ b/target/linux/brcm63xx/dts/vh4032n.dts
@@ -0,0 +1,93 @@
+/dts-v1/;
+
+#include "bcm6368.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Observa VH4032N";
+	compatible = "observa,vh4032n", "brcm,bcm6368";
+
+	chosen {
+		bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200";
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		debounce-interval = <60>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio1 2 1>;
+			linux,code = <KEY_RESTART>;
+		};
+		wps {
+			label = "wps";
+			gpios = <&gpio1 3 1>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		dsl_blue {
+			label = "VH4032N:blue:dsl";
+			gpios = <&gpio0 2 1>;
+		};
+		dsl_red {
+			label = "VH4032N:red:dsl";
+			gpios = <&gpio0 5 1>;
+		};
+		hspa_blue {
+			label = "VH4032N:blue:hspa";
+			gpios = <&gpio0 11 1>;
+		};
+		hspa_red {
+			label = "VH4032N:red:hspa";
+			gpios = <&gpio0 12 1>;
+		};
+		power_blue {
+			label = "VH4032N:blue:power";
+			gpios = <&gpio0 22 0>;
+		};
+		power_red {
+			label = "VH4032N:red:power";
+			gpios = <&gpio0 24 0>;
+			default-state = "on";
+		};
+		voice_blue {
+			label = "VH4032N:blue:voice";
+			gpios = <&gpio0 25 1>;
+		};
+		voice_red {
+			label = "VH4032N:red:voice";
+			gpios = <&gpio0 26 1>;
+		};
+	};
+};
+
+&pflash {
+	status = "ok";
+
+	linux,part-probe = "bcm63xxpart";
+
+	cfe at 0 {
+		label = "CFE";
+		reg = <0x0000000 0x0020000>;
+		read-only;
+	};
+
+	linux at 20000 {
+		label = "linux";
+		reg = <0x0020000 0x1fc0000>;
+	};
+
+	nvram at 1fe0000 {
+		label = "nvram";
+		reg = <0x1fe0000 0x020000>;
+	};
+};
diff --git a/target/linux/brcm63xx/image/bcm63xx.mk b/target/linux/brcm63xx/image/bcm63xx.mk
index 34d496e..9e012aa 100644
--- a/target/linux/brcm63xx/image/bcm63xx.mk
+++ b/target/linux/brcm63xx/image/bcm63xx.mk
@@ -806,6 +806,21 @@ define Device/R5010UNv2
 endef
 TARGET_DEVICES += R5010UNv2
 
+### Observa ###
+define Device/VH4032N
+  $(Device/bcm63xx)
+  IMAGES += sysupgrade.bin
+  DEVICE_TITLE := Observa VH4032N
+  DEVICE_DTS := vh4032n
+  CFE_BOARD_ID := 96368VVW
+  CFE_CHIP_ID := 6368
+  BLOCK_SIZE := 0x20000
+  FLASH_MB := 32
+  DEVICE_PACKAGES := \
+    $(B43_PACKAGES) $(USB2_PACKAGES)
+endef
+TARGET_DEVICES += VH4032N
+
 ### Pirelli ###
 define Device/A226G
   $(Device/bcm63xx)
diff --git a/target/linux/brcm63xx/patches-4.4/576-board_VH4032N.patch b/target/linux/brcm63xx/patches-4.4/576-board_VH4032N.patch
new file mode 100644
index 0000000..2222011
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.4/576-board_VH4032N.patch
@@ -0,0 +1,69 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2350,6 +2350,50 @@
+ 	},
+ };
+ 
++static struct board_info __initdata board_VH4032N = {
++	.name				= "VH4032N",
++	.expected_cpu_id		= 0x6368,
++
++	.has_uart0			= 1,
++	.has_pci			= 1,
++	.has_ohci0			= 1,
++	.has_ehci0			= 1,
++	.num_usbh_ports			= 2,
++
++	/* Onboard USB hub has the RST# pin tied to GPIO27. Workaround: Pull it out
++	 * of reset using the bcm63xx_enet driver. FIXME */
++	.ephy_reset_gpio		= 27,
++	.ephy_reset_gpio_flags		= GPIO_ACTIVE_LOW,
++
++	.has_enetsw			= 1,
++	.enetsw = {
++		.used_ports = {
++			[0] = {
++				.used   = 1,
++				.phy_id = 1,
++				.name   = "LAN4",
++			},
++			[1] = {
++				.used   = 1,
++				.phy_id = 2,
++				.name   = "LAN3",
++			},
++			[2] = {
++				.used   = 1,
++				.phy_id = 3,
++				.name   = "LAN2",
++			},
++			[3] = {
++				.used   = 1,
++				.phy_id = 4,
++				.name   = "LAN1",
++			},
++		},
++	},
++
++	.use_fallback_sprom		= 1,
++};
++
+ static struct b53_platform_data WAP5813n_b53_pdata = {
+ 	.alias = "eth0",
+ };
+@@ -2655,6 +2699,7 @@
+ 	&board_HG622,
+ 	&board_HG655b,
+ 	&board_P870HW51A_V2,
++	&board_VH4032N,
+ 	&board_VR3025u,
+ 	&board_VR3025un,
+ 	&board_VR3026e,
+@@ -2765,6 +2810,7 @@
+ 	{ .compatible = "huawei,hg655b", .data = &board_HG655b, },
+ 	{ .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, },
+ 	{ .compatible = "netgear,evg2000", .data = &board_EVG2000, },
++	{ .compatible = "observa,vh4032n", .data = &board_VH4032N, },
+ 	{ .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, },
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_63268




More information about the Lede-dev mailing list