"td0w8968.patch" - Views: 1,826 · Hits: 1,826 - Type: Public

 .../linux/brcm63xx/base-files/etc/board.d/01_leds  |  3 +
 .../brcm63xx/base-files/etc/board.d/02_network     |  5 ++
 target/linux/brcm63xx/base-files/etc/diag.sh       |  3 +
 target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
 target/linux/brcm63xx/dts/td-w8968.dts             | 75 ++++++++++++++++++++++
 target/linux/brcm63xx/image/bcm63xx.mk             | 12 ++++
 .../brcm63xx/patches-4.4/576-board_td-w8968.patch  | 72 +++++++++++++++++++++
 target/linux/brcm63xx/profiles/td-w8968.mk         | 18 ++++++
 8 files changed, 191 insertions(+)

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 4163214732..8472912bce 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/board.d/01_leds
@@ -61,6 +61,9 @@ homehub2a)
 r5010un_v2)
 	ucidef_set_led_usbdev "usb" "USB" "R5010UNv2:green:usb" "1-1"
 	;;
+td-w8968)
+	ucidef_set_led_netdev "wan" "WAN" "TD-W8968:green:inet" "eth0.2"
+	;;
 esac
 
 board_config_flush
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 83367c1997..e49738c18b 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/02_network
+++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network
@@ -129,6 +129,11 @@ bcm963268bu_p300)
 		"0:lan" "3:lan" "4:lan" "5:lan" "6:lan" "7:lan" "[email protected]"
 	;;
 
+td-w8968)
+	ucidef_add_switch "switch0" \
+		"3:lan:1" "2:lan:2" "1:lan:3" "4:lan:4" "0:wan" "[email protected]"
+	;;
+
 *)
 	ucidef_set_interfaces_lan_wan "eth1" "eth0"
 	;;
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh
index 51756ae835..31614d75c0 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -120,6 +120,9 @@ set_state() {
 	v2110)
 		status_led="V2110:power:green"
 		;;
+	td-w8968)
+		status_led2="TD-W8968:green:dsl"
+		;;
 	esac
 
 	case "$1" in
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 9cc0b2b570..a932423567 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -246,6 +246,9 @@ brcm63xx_dt_detect() {
 	"TP-Link TD-W8900GB")
 		board_name="td-w8900gb"
 		;;
+	"TP-Link TD-W8968")
+		board_name="td-w8968"
+		;;
 	"USRobotics 9108")
 		board_name="usr9108"
 		;;
diff --git a/target/linux/brcm63xx/dts/td-w8968.dts b/target/linux/brcm63xx/dts/td-w8968.dts
new file mode 100644
index 0000000000..bc9f73ccb8
--- /dev/null
+++ b/target/linux/brcm63xx/dts/td-w8968.dts
@@ -0,0 +1,75 @@
+/dts-v1/;
+
+#include "bcm6318.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "TP-Link TD-W8968";
+	compatible = "tp-link,td-w8968", "brcm,bcm6318";
+
+	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>;
+
+		wlan {
+			label = "wlan";
+			gpios = <&gpio0 9 1>;
+			linux,code = <KEY_WLAN>;
+		};
+		wps {
+			label = "wps";
+			gpios = <&gpio1 1 1>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+		reset {
+			label = "reset";
+			gpios = <&gpio1 2 1>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		lan1_green {
+			label = "TD-W8968:green:lan1";
+			gpios = <&gpio0 4 1>;
+		};
+		lan2_green {
+			label = "TD-W8968:green:lan2";
+			gpios = <&gpio0 5 1>;
+		};
+		lan3_green {
+			label = "TD-W8968:green:lan3";
+			gpios = <&gpio0 6 1>;
+		};
+		lan4_green {
+			label = "TD-W8968:green:lan4";
+			gpios = <&gpio0 7 1>;
+		};
+		inet_green {
+			label = "TD-W8968:green:inet";
+			gpios = <&gpio0 8 1>;
+		};
+		dsl_green {
+			label = "TD-W8968:green:dsl";
+			gpios = <&gpio0 10 1>;
+		};
+		wps_green {
+			label = "TD-W8968:green:wps";
+			gpios = <&gpio0 2 1>;
+		};
+		usb_green {
+			label = "TD-W8968:green:usb";
+			gpios = <&gpio0 13 1>;
+		};
+	};
+};
diff --git a/target/linux/brcm63xx/image/bcm63xx.mk b/target/linux/brcm63xx/image/bcm63xx.mk
index af14168b74..264249fbbb 100644
--- a/target/linux/brcm63xx/image/bcm63xx.mk
+++ b/target/linux/brcm63xx/image/bcm63xx.mk
@@ -1055,6 +1055,18 @@ define Device/TD-W8900GB
 endef
 TARGET_DEVICES += TD-W8900GB
 
+define Device/TD-W8968
+  $(Device/bcm63xx)
+  DEVICE_TITLE := TP-Link TD-W8968
+  DEVICE_DTS := td-w8968
+  CFE_BOARD_ID := TD-W8968
+  CFE_CHIP_ID := 6318
+  FLASH_MB := 8
+  DEVICE_PACKAGES := \
+    $(B43_PACKAGES) $(USB2_PACKAGES)
+endef
+TARGET_DEVICES += TD-W8968
+
 ### USRobotics ###
 define Device/USR9108
   $(Device/bcm63xx)
diff --git a/target/linux/brcm63xx/patches-4.4/576-board_td-w8968.patch b/target/linux/brcm63xx/patches-4.4/576-board_td-w8968.patch
new file mode 100644
index 0000000000..83357581e2
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.4/576-board_td-w8968.patch
@@ -0,0 +1,72 @@
+This adds kernel support support for TP-Link TD-W8958 wireless ADSL router.
+It's a BCM6318-based 802.11n wireless router with USB port and ADSL2+ modem 
+equipped with 32 MiB RAM and 8 MiB flash.
+
+Index: arch/mips/bcm63xx/boards/board_bcm963xx.c
+===================================================================
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
[email protected]@ -261,6 +261,47 @@ static struct board_info __initdata boar
+ 		},
+ 	},
+ };
++
++static struct board_info __initdata board_tdw8968 = {
++	.name				= "TD-W8968",
++	.expected_cpu_id		= 0x6318,
++
++	.has_uart0			= 1,
++	.has_pci			= 1,
++	.use_fallback_sprom		= 1,
++
++	.has_enetsw			= 1,
++
++	.has_ohci0			= 1,
++	.has_ehci0			= 1,
++	.num_usbh_ports			= 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",
++			},
++		},
++	},
++};
++
+ #endif /* CONFIG_BCM63XX_CPU_6318 */
+ 
+ /*
[email protected]@ -2575,6 +2616,7 @@ static const struct board_info __initcon
+ 	&board_96318ref_p300,
+ 	&board_dsl_2751b_d1,
+ 	&board_FAST2704N,
++	&board_tdw8968,
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_6328
+ 	&board_96328avng,
[email protected]@ -2677,6 +2719,7 @@ static struct of_device_id const bcm963x
+ 	{ .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, },
+ 	{ .compatible = "d-link,dsl-275xb-d", .data = &board_dsl_2751b_d1, },
+ 	{ .compatible = "sagem,[email protected]", .data = &board_FAST2704N, },
++	{ .compatible = "tp-link,td-w8968", .data = &board_tdw8968, },
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_6328
+ 	{ .compatible = "adb,a4001n", .data = &board_A4001N, },
diff --git a/target/linux/brcm63xx/profiles/td-w8968.mk b/target/linux/brcm63xx/profiles/td-w8968.mk
new file mode 100644
index 0000000000..fcc4ce476c
--- /dev/null
+++ b/target/linux/brcm63xx/profiles/td-w8968.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2016 LEDE project
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/TD-W8968
+  NAME:=Profile for TP-Link TD-W8968
+  PACKAGES:=kmod-b43 wpad-mini libiwinfo-lua uhttpd luci-base luci-mod-admin-full luci-theme-bootstrap luci-app-firewall luci-proto-ipv6 luci-proto-ppp
+  PRIORITY:=1
+endef
+
+define Profile/TD-W8968/description
+  Package set for TP-Link TD-W8968.
+endef
+
+$(eval $(call Profile,TD-W8968))