brcm63xx: add support for Huawei HG622
authorJonas Gorski <jogo@openwrt.org>
Mon, 18 Jan 2016 10:47:23 +0000 (10:47 +0000)
committerJonas Gorski <jogo@openwrt.org>
Mon, 18 Jan 2016 10:47:23 +0000 (10:47 +0000)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
SVN-Revision: 48305

target/linux/brcm63xx/base-files/etc/board.d/01_leds
target/linux/brcm63xx/base-files/etc/board.d/02_network
target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
target/linux/brcm63xx/base-files/lib/brcm63xx.sh
target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
target/linux/brcm63xx/dts/hg622.dts [new file with mode: 0644]
target/linux/brcm63xx/image/Makefile
target/linux/brcm63xx/patches-4.1/574-board_HG622.patch [new file with mode: 0644]
target/linux/brcm63xx/patches-4.4/574-board_HG622.patch [new file with mode: 0644]
target/linux/brcm63xx/profiles/huawei.mk

index 2697a56e8ea82b32cf3e9754f80a466d8642a097..8339254b750ddbae4f499368d2299d05aa5c31db 100755 (executable)
@@ -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"
        ;;
index c01aba81b85fc37d96601ce66e8e2bf6310cbbf1..f96da088f27567b38e14e0f3c638a2dfb7161414 100755 (executable)
@@ -86,6 +86,7 @@ dsl-274xb-f |\
 dsl-275xb-d |\
 fast2504n |\
 fast2704v2 |\
+hg622 |\
 hg655b |\
 p870hw-51a_v2 |\
 r5010un_v2 |\
index 434748537e89dfa4f5a6839334f313d3c14af67d..21c510f17beac9fed4572c366718af782e9a7695 100644 (file)
@@ -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
                ;;
index bc9ae213c9fb15b6c5945ef3fcaa4fb2c3cd4fde..70dbe2a8377cfff759759e21f4fdfbb859500eb1 100644 (file)
@@ -21,6 +21,7 @@ case "$(brcm63xx_board_name)" in
        cpva642 |\
        ct-6373 |\
        dsl-274xb-f |\
+       hg622 |\
        magic |\
        p870hw-51a_v2 |\
        r5010un_v2 |\
index 7dc57fdd73b6e6c009091324ab2f5902543817c4..a2d6519aa27823286f3f759bcad9a97179f82a6c 100755 (executable)
@@ -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"
                ;;
index abf5b89c573339a643799470a9f42b3cfef60fc5..7e4dfcb2e0eaffc90d3d1b3f131b84242211e7d4 100644 (file)
@@ -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 (file)
index 0000000..6cfc067
--- /dev/null
@@ -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@0 {
+               label = "CFE";
+               reg = <0x000000 0x020000>;
+               read-only;
+       };
+
+       linux@20000 {
+               label = "linux";
+               reg = <0x020000 0xf80000>;
+       };
+
+       cal_data@fa0000 {
+               label = "cal_data";
+               reg = <0xfa0000 0x020000>;
+               read-only;
+       };
+
+       nvram@fe0000 {
+               label = "nvram";
+               reg = <0xfe0000 0x020000>;
+       };
+};
index 81a9dc70cc816fe60ab5a03cb2f48c46b3e6c9bc..e00b6fb9486bb5226b57013c1fa8cd0824904b18 100644 (file)
@@ -575,6 +575,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 (file)
index 0000000..53818dc
--- /dev/null
@@ -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 (file)
index 0000000..53818dc
--- /dev/null
@@ -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, },
index a6764b73e3281a9680a9f7f026d95cb0c7d2885b..36f4be10bf47406b4a81fcb90440502d1b390a95 100644 (file)
@@ -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 \