[OpenWrt-Devel] [PATCH] brcm63xx: add support for Huawei HG622

Álvaro Fernández Rojas noltari at gmail.com
Wed Dec 16 17:05:41 EST 2015


Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
 .../linux/brcm63xx/base-files/etc/board.d/01_leds  |  3 +
 .../brcm63xx/base-files/etc/board.d/02_network     |  1 +
 .../etc/hotplug.d/firmware/10-rt2x00-eeprom        |  1 +
 .../base-files/etc/uci-defaults/09_fix_crc         |  1 +
 target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
 .../lib/preinit/05_init_interfaces_brcm63xx        |  1 +
 target/linux/brcm63xx/dts/hg622.dts                | 74 ++++++++++++++++++++++
 target/linux/brcm63xx/image/Makefile               |  2 +
 .../brcm63xx/patches-4.1/574-board_HG622.patch     | 72 +++++++++++++++++++++
 .../brcm63xx/patches-4.4/574-board_HG622.patch     | 72 +++++++++++++++++++++
 target/linux/brcm63xx/profiles/huawei.mk           | 10 +++
 11 files changed, 240 insertions(+)
 create mode 100644 target/linux/brcm63xx/dts/hg622.dts
 create mode 100644 target/linux/brcm63xx/patches-4.1/574-board_HG622.patch
 create mode 100644 target/linux/brcm63xx/patches-4.4/574-board_HG622.patch

diff --git a/target/linux/brcm63xx/base-files/etc/board.d/01_leds b/target/linux/brcm63xx/base-files/etc/board.d/01_leds
index 2697a56..8339254 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/board.d/01_leds
@@ -39,6 +39,9 @@ hg556a_*)
 	ucidef_set_led_netdev "lan" "LAN" "HW556:red:dsl" "eth0"
 	ucidef_set_led_usbdev "usb" "USB" "HW556:red:hspa" "1-2"
 	;;
+hg622)
+	ucidef_set_led_usbdev "usb" "USB" "HG622:green:usb" "1-2"
+	;;
 hg655b)
 	ucidef_set_led_usbdev "usb" "USB" "HW65x:green:usb" "1-2"
 	;;
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 c01aba8..f96da08 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/02_network
+++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network
@@ -86,6 +86,7 @@ dsl-274xb-f |\
 dsl-275xb-d |\
 fast2504n |\
 fast2704v2 |\
+hg622 |\
 hg655b |\
 p870hw-51a_v2 |\
 r5010un_v2 |\
diff --git a/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index 4347485..21c510f 100644
--- a/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -34,6 +34,7 @@ case "$FIRMWARE" in
 	hg556a_c)
 		rt2x00_eeprom_extract "cal_data" 130560 512
 		;;
+	hg622 |\
 	hg655b)
 		rt2x00_eeprom_extract "cal_data" 0 512
 		;;
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 bc9ae21..70dbe2a 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
@@ -21,6 +21,7 @@ case "$(brcm63xx_board_name)" in
 	cpva642 |\
 	ct-6373 |\
 	dsl-274xb-f |\
+	hg622 |\
 	magic |\
 	p870hw-51a_v2 |\
 	r5010un_v2 |\
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 7dc57fd..a2d6519 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -159,6 +159,9 @@ brcm63xx_dt_detect() {
 	"Huawei EchoLife HG556a (version C)")
 		board_name="hg556a_c"
 		;;
+	"Huawei HG622")
+		board_name="hg622"
+		;;
 	"Huawei HG655b")
 		board_name="hg655b"
 		;;
diff --git a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
index abf5b89..7e4dfcb 100644
--- a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
+++ b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
@@ -23,6 +23,7 @@ set_preinit_iface() {
 	hg553 |\
 	hg556a_* |\
 	hg520 |\
+	hg622 |\
 	neufbox6 |\
 	p870hw-51a_v2 |\
 	rta770bw |\
diff --git a/target/linux/brcm63xx/dts/hg622.dts b/target/linux/brcm63xx/dts/hg622.dts
new file mode 100644
index 0000000..6cfc067
--- /dev/null
+++ b/target/linux/brcm63xx/dts/hg622.dts
@@ -0,0 +1,74 @@
+/dts-v1/;
+
+#include "bcm6368.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Huawei HG622";
+	compatible = "huawei,hg622", "brcm,bcm6368";
+
+	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>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		dsl_green {
+			label = "HG622:green:dsl";
+			gpios = <&gpio0 2 1>;
+		};
+		inet_green {
+			label = "HG622:green:inet";
+			gpios = <&gpio0 5 1>;
+		};
+		usb_green {
+			label = "HG622:green:usb";
+			gpios = <&gpio0 11 1>;
+		};
+		power_green {
+			label = "HG622:green:power";
+			gpios = <&gpio0 22 1>;
+			default-state = "on";
+		};
+	};
+};
+
+&pflash {
+	status = "ok";
+
+	linux,part-probe = "bcm63xxpart";
+
+	cfe at 0 {
+		label = "CFE";
+		reg = <0x000000 0x020000>;
+		read-only;
+	};
+
+	linux at 20000 {
+		label = "linux";
+		reg = <0x020000 0xf80000>;
+	};
+
+	cal_data at fa0000 {
+		label = "cal_data";
+		reg = <0xfa0000 0x020000>;
+		read-only;
+	};
+
+	nvram at fe0000 {
+		label = "nvram";
+		reg = <0xfe0000 0x020000>;
+	};
+};
diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile
index 53e4c21..bd9dee7 100644
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -574,6 +574,8 @@ $(eval $(call bcm63xxCfe,HG553,HG553,hg553,HW553,6358,--rsa-signature "EchoLife_
 $(eval $(call bcm63xxCfe,HG556a_AB,HG556a_A,hg556a-a,HW556,6358,--rsa-signature "EchoLife_HG556a" --image-offset 0x20000 --block-size 0x10000 --tag-version 8))
 $(eval $(call bcm63xxCfe,HG556a_AB,HG556a_B,hg556a-b,HW556,6358,--rsa-signature "EchoLife_HG556a" --image-offset 0x20000 --block-size 0x20000 --tag-version 8))
 $(eval $(call bcm63xxCfe,HG556a_C,HG556a_C,hg556a-c,HW556,6358,--rsa-signature "EchoLife_HG556a" --image-offset 0x20000 --block-size 0x20000 --tag-version 8))
+# Huawei HG622
+$(eval $(call bcm63xxCfe,HG622,HG622,hg622,96368MVWG_hg622,6368,--image-offset 0x20000 --block-size 0x20000 --tag-version 7 --pad 8))
 # Huawei HG655b
 $(eval $(call bcm63xxCfe,HG655b,HG655b,hg655b,HW65x,6368,--image-offset 0x20000 --tag-version 7 --pad 4))
 # Inteno VG50
diff --git a/target/linux/brcm63xx/patches-4.1/574-board_HG622.patch b/target/linux/brcm63xx/patches-4.1/574-board_HG622.patch
new file mode 100644
index 0000000..53818dc
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.1/574-board_HG622.patch
@@ -0,0 +1,72 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2057,6 +2057,53 @@ static struct board_info __initdata boar
+ 	},
+ };
+ 
++static struct board_info __initdata board_HG622 = {
++	.name				= "96368MVWG_hg622",
++	.expected_cpu_id		= 0x6368,
++
++	.has_uart0			= 1,
++	.has_pci			= 1,
++	.has_ohci0			= 1,
++	.has_ehci0			= 1,
++	.num_usbh_ports			= 2,
++
++	.has_caldata			= 1,
++	.caldata = {
++		{
++			.vendor			= PCI_VENDOR_ID_RALINK,
++			.caldata_offset		= 0xfa0000,
++			.slot			= 1,
++			.eeprom			= "rt2x00.eeprom",
++		},
++	},
++
++	.has_enetsw			= 1,
++	.enetsw = {
++		.used_ports = {
++			[0] = {
++				.used		= 1,
++				.phy_id		= 1,
++				.name		= "port1",
++			},
++			[1] = {
++				.used		= 1,
++				.phy_id		= 2,
++				.name		= "port2",
++			},
++			[2] = {
++				.used		= 1,
++				.phy_id		= 3,
++				.name		= "port3",
++			},
++			[3] = {
++				.used		= 1,
++				.phy_id		= 4,
++				.name		= "port4",
++			},
++		},
++	},
++};
++
+ static struct sprom_fixup __initdata vr3025u_fixups[] = {
+ 	{ .offset = 97, .value = 0xfeb3 },
+ 	{ .offset = 98, .value = 0x1618 },
+@@ -2563,6 +2610,7 @@ static const struct board_info __initcon
+ 	&board_96368mvwg,
+ 	&board_96368mvngr,
+ 	&board_DGND3700v1_3800B,
++	&board_HG622,
+ 	&board_HG655b,
+ 	&board_P870HW51A_V2,
+ 	&board_VR3025u,
+@@ -2671,6 +2719,7 @@ static struct of_device_id const bcm963x
+ 	{ .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, },
+ 	{ .compatible = "comtrend,vr-3026e", .data = &board_VR3026e, },
+ 	{ .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, },
++	{ .compatible = "huawei,hg622", .data = &board_HG622, },
+ 	{ .compatible = "huawei,hg655b", .data = &board_HG655b, },
+ 	{ .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, },
+ 	{ .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, },
diff --git a/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch b/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch
new file mode 100644
index 0000000..53818dc
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch
@@ -0,0 +1,72 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2057,6 +2057,53 @@ static struct board_info __initdata boar
+ 	},
+ };
+ 
++static struct board_info __initdata board_HG622 = {
++	.name				= "96368MVWG_hg622",
++	.expected_cpu_id		= 0x6368,
++
++	.has_uart0			= 1,
++	.has_pci			= 1,
++	.has_ohci0			= 1,
++	.has_ehci0			= 1,
++	.num_usbh_ports			= 2,
++
++	.has_caldata			= 1,
++	.caldata = {
++		{
++			.vendor			= PCI_VENDOR_ID_RALINK,
++			.caldata_offset		= 0xfa0000,
++			.slot			= 1,
++			.eeprom			= "rt2x00.eeprom",
++		},
++	},
++
++	.has_enetsw			= 1,
++	.enetsw = {
++		.used_ports = {
++			[0] = {
++				.used		= 1,
++				.phy_id		= 1,
++				.name		= "port1",
++			},
++			[1] = {
++				.used		= 1,
++				.phy_id		= 2,
++				.name		= "port2",
++			},
++			[2] = {
++				.used		= 1,
++				.phy_id		= 3,
++				.name		= "port3",
++			},
++			[3] = {
++				.used		= 1,
++				.phy_id		= 4,
++				.name		= "port4",
++			},
++		},
++	},
++};
++
+ static struct sprom_fixup __initdata vr3025u_fixups[] = {
+ 	{ .offset = 97, .value = 0xfeb3 },
+ 	{ .offset = 98, .value = 0x1618 },
+@@ -2563,6 +2610,7 @@ static const struct board_info __initcon
+ 	&board_96368mvwg,
+ 	&board_96368mvngr,
+ 	&board_DGND3700v1_3800B,
++	&board_HG622,
+ 	&board_HG655b,
+ 	&board_P870HW51A_V2,
+ 	&board_VR3025u,
+@@ -2671,6 +2719,7 @@ static struct of_device_id const bcm963x
+ 	{ .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, },
+ 	{ .compatible = "comtrend,vr-3026e", .data = &board_VR3026e, },
+ 	{ .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, },
++	{ .compatible = "huawei,hg622", .data = &board_HG622, },
+ 	{ .compatible = "huawei,hg655b", .data = &board_HG655b, },
+ 	{ .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, },
+ 	{ .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, },
diff --git a/target/linux/brcm63xx/profiles/huawei.mk b/target/linux/brcm63xx/profiles/huawei.mk
index a6764b7..36f4be1 100644
--- a/target/linux/brcm63xx/profiles/huawei.mk
+++ b/target/linux/brcm63xx/profiles/huawei.mk
@@ -44,6 +44,16 @@ define Profile/HG556a_C/Description
 endef
 $(eval $(call Profile,HG556a_C))
 
+define Profile/HG622
+  NAME:=Huawei HG622
+  PACKAGES:=kmod-rt2800-pci wpad-mini \
+	kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+define Profile/HG622/Description
+  Package set optimized for Huawei HG622.
+endef
+$(eval $(call Profile,HG622))
+
 define Profile/HG655b
   NAME:=Huawei HG655b
   PACKAGES:=kmod-rt2800-pci wpad-mini \
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list