brcm63xx: Add Observa VH4032N support
authorDaniel Gonzalez Cabanelas <dgcbueu@gmail.com>
Sat, 3 Dec 2016 14:51:05 +0000 (15:51 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 28 Apr 2017 15:09:55 +0000 (17:09 +0200)
Add support for the Observa Telecom VH4032N router.

This is another BCM6368 router, 128 MB RAM, 32MB flash and 3 USB
host ports.

The wifi chip is an onboard Broadcom BCM43222.

Signed-off-by: Daniel Gonzalez Cabanelas <dgcbueu@gmail.com>
[jonas.gorski: use gpio-hog instead of abusing ephy-reset]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
target/linux/brcm63xx/base-files/etc/board.d/02_network
target/linux/brcm63xx/base-files/etc/diag.sh
target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
target/linux/brcm63xx/base-files/lib/brcm63xx.sh
target/linux/brcm63xx/dts/vh4032n.dts [new file with mode: 0644]
target/linux/brcm63xx/image/bcm63xx.mk
target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch [new file with mode: 0644]

index c20caf9b9a6a2c498e8103d6128b2ee93c4a6a7f..c83aa620804f996e5ed48f7e97571ada3acf9682 100755 (executable)
@@ -98,6 +98,11 @@ vr-3026e)
                "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "8t@eth0"
        ;;
 
+vh4032n)
+       ucidef_add_switch "switch0" \
+               "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "8t@eth0"
+       ;;
+
 bcm96368mvwg)
        ucidef_add_switch "switch0" \
                "1:lan" "2:lan" "4:lan" "5:lan" "8t@eth0"
index 852a70146e1187e716c3ca0bd23e4193a1aad2bc..3a858e4d857aac7dee2bf30b6c26d5ccc0c47584 100644 (file)
@@ -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"
                ;;
index 1201168feb7d9edf4943bb54794fea186b380c6f..650db9da60c543eac6ac3d1f9da23262f9afa9f0 100644 (file)
@@ -31,6 +31,7 @@ case "$(brcm63xx_board_name)" in
        spw303v |\
        v2110 |\
        v2500v_bb |\
+       vh4032n |\
        vr-3025u |\
        vr-3025un |\
        vr-3026e |\
index 9cc0b2b570e14b76a246bac43c6b748b4c6333fd..3dce282fd26766a54614d210670dcbc0cae3438a 100755 (executable)
@@ -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 (file)
index 0000000..8b8abd9
--- /dev/null
@@ -0,0 +1,102 @@
+/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>;
+               };
+       };
+};
+
+&gpio0 {
+       usb_hub_reset {
+               gpio-hog;
+               gpios = <27 0>;
+               output-high;
+               line-name = "usb-hub-reset-gpio";
+       };
+};
+
+&pflash {
+       status = "ok";
+
+       linux,part-probe = "bcm63xxpart";
+
+       cfe@0 {
+               label = "CFE";
+               reg = <0x0000000 0x0020000>;
+               read-only;
+       };
+
+       linux@20000 {
+               label = "linux";
+               reg = <0x0020000 0x1fc0000>;
+       };
+
+       nvram@1fe0000 {
+               label = "nvram";
+               reg = <0x1fe0000 0x020000>;
+       };
+};
index ce03f7b700290437ed2e9be54a023bfe441a5502..da3dbba78402d262eaa64ece852868f596875b34 100644 (file)
@@ -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/577-board_VH4032N.patch b/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch
new file mode 100644 (file)
index 0000000..2e5c13e
--- /dev/null
@@ -0,0 +1,64 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2356,6 +2356,45 @@ static struct board_info __initdata boar
+       },
+ };
++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,
++
++      .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",
+ };
+@@ -2662,6 +2701,7 @@ static const struct board_info __initcon
+       &board_HG622,
+       &board_HG655b,
+       &board_P870HW51A_V2,
++      &board_VH4032N,
+       &board_VR3025u,
+       &board_VR3025un,
+       &board_VR3026e,
+@@ -2773,6 +2813,7 @@ static struct of_device_id const bcm963x
+       { .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