[OpenWrt-Devel] [PATCH 2/3] Add support for TG582n DANT-1 board.

Kejia Hu (Terry) kejia.hu at codethink.co.uk
Wed Jun 3 08:28:44 EDT 2015


From: Kejia Hu <kejia.hu at codethink.co.uk>

The other variant board (DANT-T) of the router may be supported after these patches, but
these patches have only been tested on DANT-1 board.
---
 target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
 target/linux/brcm63xx/dts/tg582n.dts               | 81 ++++++++++++++++++++++
 target/linux/brcm63xx/image/Makefile               |  2 +
 .../brcm63xx/patches-3.18/571-board_TG582N.patch   | 70 +++++++++++++++++++
 4 files changed, 156 insertions(+)
 create mode 100644 target/linux/brcm63xx/dts/tg582n.dts
 create mode 100644 target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch

diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 0eb9a75..dd87b9d 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -231,6 +231,9 @@ brcm63xx_dt_detect() {
 	"TP-Link TD-W8900GB")
 		board_name="td-w8900gb"
 		;;
+	"THOMSON TG582N")
+		board_name="tg582n"
+		;;
 	"USRobotics 9108")
 		board_name="usr9108"
 		;;
diff --git a/target/linux/brcm63xx/dts/tg582n.dts b/target/linux/brcm63xx/dts/tg582n.dts
new file mode 100644
index 0000000..a6986a7
--- /dev/null
+++ b/target/linux/brcm63xx/dts/tg582n.dts
@@ -0,0 +1,81 @@
+/dts-v1/;
+
+/include/ "bcm6328.dtsi"
+
+/ {
+	model = "TG582N";
+	compatible = "thomson,tg582n", "brcm,bcm6328";
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		debounce-interval = <60>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 23 1>;
+			linux,code = <0x198>;
+		};
+		wps {
+			label = "wlan";
+			gpios = <&gpio0 24 1>;
+			linux,code = <0xee>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		inet_red {
+			label = "A4001N1:red:inet";
+			gpios = <&gpio0 2 1>;
+		};
+		ppp_green {
+			label = "A4001N1:green:ppp";
+			gpios = <&gpio0 3 1>;
+		};
+		power_green {
+			label = "A4001N1:green:power";
+			gpios = <&gpio0 4 1>;
+			default-state = "on";
+		};
+		ppp_red {
+			label = "A4001N1:red:ppp";
+			gpios = <&gpio0 5 1>;
+		};
+		usb_green {
+			label = "A4001N1:green:3g";
+			gpios = <&gpio0 6 1>;
+		};
+		usb_red {
+			label = "A4001N1:red:3g";
+			gpios = <&gpio0 7 1>;
+		};
+		power_red {
+			label = "A4001N1:red:power";
+			gpios = <&gpio0 8 1>;
+		};
+		wlan_green {
+			label = "A4001N1:green:wlan";
+			gpios = <&gpio0 9 1>;
+		};
+		wlan_red {
+			label = "A4001N1:red:wlan";
+			gpios = <&gpio0 10 1>;
+		};
+		inet_green {
+			label = "A4001N1:green:inet";
+			gpios = <&gpio0 11 1>;
+		};
+		eth_red {
+			label = "A4001N1:red:eth";
+			gpios = <&gpio0 20 1>;
+		};
+		eth_green {
+			label = "A4001N1:green:eth";
+			gpios = <&gpio0 31 1>;
+		};
+	};
+};
diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile
index 139a2e3..3e68e98 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -415,6 +415,8 @@ $(eval $(call ImageDTB,CFEDTB,CPVA642,CPA-ZNTE60T,cpva642,CPVA642,6358,--signatu
 $(eval $(call ImageDTB,Dummy,MAGIC,MAGIC,magic,MAGIC,6348))
 # TP-Link TD-W8900GB
 $(eval $(call ImageDTB,CFEDTB,TDW8900GB,TD-W8900GB,td-w8900gb,96348GW-11,6348,--rsa-signature "$(shell printf 'PRID\x89\x10\x00\x02')" --image-offset 0x20000))
+# Thomsom TG582n
+$(eval $(call ImageDTB,CFEDTB,TG582N,TG582N,tg582n,963281T_TEF,6328,--pad 8))
 # USRobotics 9108
 $(eval $(call ImageDTB,CFEDTB,USR9108,USR9108,usr9108,96348GW-A,6348))
 # ZyXEL P870HW-51a v2
diff --git a/target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch b/target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch
new file mode 100644
index 0000000..005f858
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch
@@ -0,0 +1,70 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -606,6 +606,51 @@ static struct board_info __initdata board_FAST2704V2 = {
+ 		},
+ 	},
+ };
++
++static struct board_info __initdata board_TG582N = {
++        .name                                   = "TG582N",
++        .expected_cpu_id                        = 0x6328,
++
++        .has_uart0                              = 1,
++        .has_pci                                = 1,
++        .use_fallback_sprom                     = 1,
++        .has_ohci0                              = 1,
++        .has_ehci0                              = 1,
++        .num_usbh_ports                         = 1,
++        .has_enetsw                             = 1,
++
++        .enetsw = {
++                .used_ports = {
++                        [0] = {
++                                .used           = 1,
++                                .phy_id         = 1,
++                                .name           = "Port 1",
++                        },
++                        [1] = {
++                                .used           = 1,
++                                .phy_id         = 2,
++                                .name           = "Port 2",
++                                                                                                        },
++                        [2] = {
++                                .used           = 1,
++                                .phy_id         = 3,
++                                .name           = "Port 3",
++                        },
++                        [3] = {
++                                .used           = 1,
++                                .phy_id         = 4,
++                                .name           = "Port 4",
++                        },
++                },
++        },
++
++        .fallback_sprom = {
++                .type                           = SPROM_BCM43227,
++                .pci_bus                        = 1,
++                .pci_dev                        = 0,
++        },
++};
++
+ #endif /* CONFIG_BCM63XX_CPU_6328 */
+ 
+ /*
+@@ -2362,6 +2407,7 @@ static const struct board_info __initconst *bcm963xx_boards[] = {
+ 	&board_A4001N1,
+ 	&board_dsl_274xb_f1,
+ 	&board_FAST2704V2,
++        &board_TG582N
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_6338
+ 	&board_96338gw,
+@@ -2458,6 +2504,7 @@ static struct of_device_id const bcm963xx_boards_dt[] = {
+ 	{ .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, },
+ 	{ .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, },
+ 	{ .compatible = "d-link,dsl-274xb-f", .data = &board_dsl_274xb_f1, },
++	{ .compatible = "thomson,tg582n", .data = &board_TG582N, },
+ 	{ .compatible = "sagem,f at st2704v2", .data = &board_FAST2704V2, },
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_6338
-- 
2.1.4
_______________________________________________
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