From 2d3371cd0fa1bd3631633ad9c2ddd1d232d8397f Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Wed, 25 Mar 2015 15:35:12 +0000 Subject: [PATCH] brcm63xx: Add BT Home Hub 2A support. Support for the BT HomeHub 2.0 Type A. This router was manufactured by Thomson, and it's BCM6358 based. The leds are controled by two chained HC594, all working ok. The BCM5325 switch has the RESET# pin wired to the GPIO15, but currently there is no way to tell the b53 driver how to get this gpio number in brcm63xx, therefore swconfig won't use it when performing a switch reset. The patch was tested with several firmwares, and all except unsupported stuff (i.e xDSL) works pretty well. Tested-by: Tahir Signed-off-by: Daniel Gonzalez SVN-Revision: 44985 --- target/linux/brcm63xx/base-files/etc/diag.sh | 4 + .../base-files/etc/uci-defaults/01_leds | 6 + .../base-files/etc/uci-defaults/02_network | 3 +- .../linux/brcm63xx/base-files/lib/brcm63xx.sh | 3 + target/linux/brcm63xx/dts/homehub2a.dts | 140 ++++++++++++++++++ target/linux/brcm63xx/image/Makefile | 2 + .../patches-3.18/569-board_homehub2a.patch | 51 +++++++ target/linux/brcm63xx/profiles/bt.mk | 10 ++ 8 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 target/linux/brcm63xx/dts/homehub2a.dts create mode 100644 target/linux/brcm63xx/patches-3.18/569-board_homehub2a.patch diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh index 928c02ba10..03d98b9146 100644 --- a/target/linux/brcm63xx/base-files/etc/diag.sh +++ b/target/linux/brcm63xx/base-files/etc/diag.sh @@ -72,6 +72,10 @@ set_state() { fast2704v2) status_led="F@ST2704V2:green:power" ;; + homehub2a) + status_led="HOMEHUB2A:green:upgrading" + status_led2="HOMEHUB2A:blue:upgrading" + ;; gw6200) status_led="GW6200:green:line1" status_led2="GW6200:green:tel" diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds index c9bf2f412d..58404a165f 100644 --- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds @@ -34,6 +34,12 @@ hg556a_*) ucidef_set_led_netdev "lan" "LAN" "HW556:red:dsl" "eth0" ucidef_set_led_usbdev "usb" "USB" "HW556:red:hspa" "1-2" ;; +homehub2a) + ucidef_set_led_netdev "lan" "LAN" "HOMEHUB2A:blue:broadband" "eth0.1" + ucidef_set_led_netdev "wlan0" "WIFI" "HOMEHUB2A:green:wireless" "wlan0" + ucidef_set_led_usbdev "usb1" "USB1" "HOMEHUB2A:blue:phone" "1-1" + ucidef_set_led_usbdev "usb2" "USB2" "HOMEHUB2A:green:phone" "2-1" + ;; esac ucidef_commit_leds diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network index df4e29307b..814e1003cd 100644 --- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network @@ -66,7 +66,8 @@ v2500v_bb) dsl-274xb-c |\ hg553 |\ -hg556a_*) +hg556a_* |\ +homehub2a) ucidef_set_interface_lan "eth0.1" ucidef_add_switch "eth0" "1" "1" ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5t" diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh index 2c18762d19..9c8a612039 100755 --- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh +++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh @@ -60,6 +60,9 @@ brcm63xx_dt_detect() { "Broadcom BCM96368MVWG reference board") board_name="bcm96368mvwg" ;; + "BT Home Hub 2.0 Type A") + board_name="homehub2a" + ;; "BT Voyager V2500V") board_name="v2500v" ;; diff --git a/target/linux/brcm63xx/dts/homehub2a.dts b/target/linux/brcm63xx/dts/homehub2a.dts new file mode 100644 index 0000000000..28de52871c --- /dev/null +++ b/target/linux/brcm63xx/dts/homehub2a.dts @@ -0,0 +1,140 @@ +/dts-v1/; + +/include/ "bcm6358.dtsi" + +/ { + model = "BT Home Hub 2.0 Type A"; + compatible = "thomson,homehub2a", "brcm,bcm6358"; + + spi-gpio { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-gpio"; + + gpio-mosi = <&gpio0 7 0>; + gpio-sck = <&gpio0 6 0>; + cs-gpios = <&gpio0 5 0>; + num-chipselects = <1>; + + hc595: gpio-spi-controller@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + registers-number = <2>; + spi-max-frequency = <100000>; + + gpio-controller; + #gpio-cells = <2>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + debounce-interval = <60>; + + phone { + label = "phone"; + gpios = <&gpio0 1 1>; + linux,code = <169>; + }; + reset { + label = "reset"; + gpios = <&gpio0 9 1>; + linux,code = <0x198>; + }; + wps { + label = "wps"; + gpios = <&gpio0 11 1>; + linux,code = <0x211>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + power_red { + label = "HOMEHUB2A:red:power"; + gpios = <&hc595 0 1>; + }; + power_green { + label = "HOMEHUB2A:green:power"; + gpios = <&hc595 1 1>; + default-state = "on"; + }; + power_blue { + label = "HOMEHUB2A:blue:power"; + gpios = <&hc595 2 1>; + }; + broadband_red { + label = "HOMEHUB2A:red:broadband"; + gpios = <&hc595 3 1>; + }; + broadband_green { + label = "HOMEHUB2A:green:broadband"; + gpios = <&hc595 4 1>; + }; + broadband_blue { + label = "HOMEHUB2A:blue:broadband"; + gpios = <&hc595 5 1>; + }; + wireless_red { + label = "HOMEHUB2A:red:wireless"; + gpios = <&hc595 6 1>; + }; + wireless_green { + label = "HOMEHUB2A:green:wireless"; + gpios = <&hc595 7 1>; + }; + wireless_blue { + label = "HOMEHUB2A:blue:wireless"; + gpios = <&hc595 8 1>; + }; + phone_red { + label = "HOMEHUB2A:red:phone"; + gpios = <&hc595 9 1>; + }; + phone_green { + label = "HOMEHUB2A:green:phone"; + gpios = <&hc595 10 1>; + }; + phone_blue { + label = "HOMEHUB2A:blue:phone"; + gpios = <&hc595 11 1>; + }; + upgrading_red { + label = "HOMEHUB2A:red:upgrading"; + gpios = <&hc595 12 1>; + }; + upgrading_green { + label = "HOMEHUB2A:green:upgrading"; + gpios = <&hc595 13 1>; + }; + upgrading_blue { + label = "HOMEHUB2A:blue:upgrading"; + gpios = <&hc595 14 1>; + }; + }; +}; + +&pflash { + status = "ok"; + + linux,part-probe = "bcm63xxpart"; + + cfe@0 { + label = "CFE"; + reg = <0x000000 0x020000>; + }; + + linux@20000 { + label = "linux"; + reg = <0x020000 0xfc0000>; + }; + + nvram@fe0000 { + label = "nvram"; + reg = <0xfe0000 0x020000>; + }; +}; diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile index a55fc46d6c..bae025f7d2 100755 --- a/target/linux/brcm63xx/image/Makefile +++ b/target/linux/brcm63xx/image/Makefile @@ -275,6 +275,8 @@ $(eval $(call ImageDTB,CFEDTB,RG100A,RG100A,rg100a,96358VW2,6358,--block-size 0x $(eval $(call ImageDTB,CFEDTB,AR1004G,AR1004G,ar1004g,96348GW-10,6348)) # Belkin F5D7633 $(eval $(call ImageDTB,CFEDTB,F5D7633,F5D7633,f5d7633,96348GW-10,6348,--block-size 0x20000 --image-offset 0x20000)) +# BT Home Hub 2.0 A +$(eval $(call ImageDTB,CFEDTB,BTHOMEHUB2A,HomeHub2A,homehub2a,HOMEHUB2A,6358,--image-offset 0x20000 --block-size 0x20000)) # BT Voyager V2500V, V2500V_SIP_CLUB, V2500V_AA $(eval $(call ImageDTB,CFEDTB,BTV2500V,BTV2500V,v2500v-bb,V2500V_BB,6348,--layoutver 5)) # Comtrend AR-5381u diff --git a/target/linux/brcm63xx/patches-3.18/569-board_homehub2a.patch b/target/linux/brcm63xx/patches-3.18/569-board_homehub2a.patch new file mode 100644 index 0000000000..2f3a02a677 --- /dev/null +++ b/target/linux/brcm63xx/patches-3.18/569-board_homehub2a.patch @@ -0,0 +1,51 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -1748,6 +1748,32 @@ + }, + }; + ++static struct board_info __initdata board_homehub2a = { ++ .name = "HOMEHUB2A", ++ .expected_cpu_id = 0x6358, ++ ++ .has_uart0 = 1, ++ .has_pci = 1, ++ .use_fallback_sprom = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, ++ ++ .has_enet1 = 1, ++ .enet1 = { ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, ++ }, ++ ++ .fallback_sprom = { ++ .type = SPROM_BCM4322, ++ .pci_bus = 0, ++ .pci_dev = 1, ++ }, ++}; ++ + static struct board_info __initdata board_HW520 = { + .name = "HW6358GW_B", + .expected_cpu_id = 0x6358, +@@ -2748,6 +2774,7 @@ + &board_nb4_ser_r0, + &board_nb4_fxc_r1, + &board_ct6373_1, ++ &board_homehub2a, + &board_HW520, + &board_HW553, + &board_HW556_A, +@@ -2845,6 +2872,7 @@ + { .compatible = "sfr,nb4-fxc-r1", .data = &board_nb4_fxc_r1, }, + { .compatible = "t-com,spw303v", .data = &board_spw303v, }, + { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, ++ { .compatible = "thomson,homehub2a", .data = &board_homehub2a, }, + #endif + #ifdef CONFIG_BCM63XX_CPU_6362 + { .compatible = "sagem,f@st2504n", .data = &board_fast2504n, }, diff --git a/target/linux/brcm63xx/profiles/bt.mk b/target/linux/brcm63xx/profiles/bt.mk index 0863752412..3ca8fe16ff 100644 --- a/target/linux/brcm63xx/profiles/bt.mk +++ b/target/linux/brcm63xx/profiles/bt.mk @@ -5,6 +5,16 @@ # See /LICENSE for more information. # +define Profile/BTHOMEHUB2A + NAME:=BT Home Hub 2A + PACKAGES:=kmod-b43 wpad-mini \ + kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev +endef +define Profile/BTHOMEHUB2A/Description + Package set optimized for BTHOMEHUB2A. +endef +$(eval $(call Profile,BTHOMEHUB2A)) + define Profile/BTV2500V NAME:=BT Voyager V2500V PACKAGES:=kmod-b43 wpad-mini -- 2.25.1