[OpenWrt-Devel] [PATCH] [brcm63xx] Add support for Plusnet 2704N

Matt Goring matt.goring at googlemail.com
Mon May 18 13:22:03 EDT 2015


Hello, this is my first submission, please excuse me if I have the wrong 
mailing list, or missed a mailing rule.


This patch is to add support for the Plusnet 2704N Router (BCM6318), on 
the current trunk.
This will most possibly add support for the Sagem 2704N (Ver 1) and the 
TP-Link-TD-W8960N (Ver 5) due to the same hardware, but unconfirmed.
ADSL does not work (same with all Broadcom devices) and the Fibre (via 
copper) is purposely not configured.  Otherwise you will loose a 
Ethernet port.

The openwrt image will not work out-the-box for this Plusnet router.  So 
I will create a wiki page if this patch is accepted.

Signed-off-by: Matt Goring <matt.goring at googlemail.com>

-------------- next part --------------
diff --git a/build_dir/target-mips_mips32_uClibc-0.9.33.2/linux-brcm63xx_generic/linux-3.18.11/arch/mips/bcm63xx/boards/board_bcm963xx.c b/build_dir/target-mips_mips32_uClibc-0.9.33.2/linux-brcm63xx_generic/linux-3.18.11/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 6b6cfc0..a0ef569 100644
--- a/build_dir/target-mips_mips32_uClibc-0.9.33.2/linux-brcm63xx_generic/linux-3.18.11/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/build_dir/target-mips_mips32_uClibc-0.9.33.2/linux-brcm63xx_generic/linux-3.18.11/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -2401,6 +2401,7 @@ static struct of_device_id const bcm963xx_boards_dt[] = {
 	{ .compatible = "brcm,bcm96318ref", .data = &board_96318ref, },
 	{ .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, },
 	{ .compatible = "d-link,dsl-275xb-d", .data = &board_dsl_2751b_d1, },
+	{ .compatible = "plusnet,f at st2704n", .data = &board_96318ref, },
 #endif
 #ifdef CONFIG_BCM63XX_CPU_6328
 	{ .compatible = "adb,a4001n", .data = &board_A4001N, },
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh
index 03d98b9..e97547a 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -69,6 +69,9 @@ set_state() {
 	fast2504n)
 		status_led="fast2504n:green:ok"
 		;;
+	fast2704n)
+		status_led2="F at ST2704N:red:power"
+		;;
 	fast2704v2)
 		status_led="F at ST2704V2:green:power"
 		;;
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 58404a1..c40a94f 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
@@ -22,6 +22,9 @@ dgnd3700v1_dgnd3800b)
 	ucidef_set_led_usbdev "usb1" "USB1" "DGND3700v1_3800B:green:usb-back" "1-1"
 	ucidef_set_led_usbdev "usb2" "USB2" "DGND3700v1_3800B:green:usb-front" "1-2"
 	;;
+fast2704n)
+	ucidef_set_led_netdev "lan" "LAN" "F at ST2704N:green:lan1" "eth0.1"
+	;;
 fast2704v2)
 	ucidef_set_led_usbdev "usb" "USB" "F at ST2704V2:green:usb" "1-1"
 	;;
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 814e100..c31373a 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -91,6 +91,13 @@ bcm96368mvngr |\
 dsl-274xb-f |\
 dsl-275xb-d |\
 fast2504n |\
+fast2704n)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+	ucidef_add_switch "eth0" "1" "1"
+	ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 8t"
+	;;
+
 fast2704v2 |\
 p870hw-51a_v2 |\
 vr-3025un |\
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 5cb390f..e09478e 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -186,6 +186,9 @@ brcm63xx_dt_detect() {
 	"Pirelli Alice Gate AGPF-S0")
 		board_name="agpf-s0"
 		;;
+	"Plusnet F at ST2704N")
+		board_name="fast2704n"
+		;;
 	"Sagem F at ST2404")
 		board_name="fast2404"
 		;;
diff --git a/target/linux/brcm63xx/dts/fast2704n.dts b/target/linux/brcm63xx/dts/fast2704n.dts
new file mode 100755
index 0000000..08bc58b
--- /dev/null
+++ b/target/linux/brcm63xx/dts/fast2704n.dts
@@ -0,0 +1,70 @@
+/dts-v1/;
+
+/include/ "bcm6318.dtsi"
+
+/ {
+	model = "Plusnet F at ST2704N";
+	compatible = "plusnet,f at st2704n", "brcm,bcm6318";
+
+	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 = <0x198>;
+		};
+		wps {
+			label = "wps";
+			gpios = <&gpio1 1 1>;
+			linux,code = <0x211>;
+		};
+	};
+
+	/* Wireless LAN led is controlled independently */
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		wps_green {
+			label = "F at ST2704N:green:wps";
+			gpios = <&gpio0 2 1>;
+		};
+		inet_red {
+			label = "F at ST2704N:red:inet";
+			gpios = <&gpio0 9 1>;
+		};
+		inet_green {
+			label = "F at ST2704N:green:inet";
+			gpios = <&gpio0 8 1>;
+		};
+		dsl_green {
+			label = "F at ST2704N:green:dsl";
+			gpios = <&gpio0 10 1>;
+		};
+		lan4_green {
+			label = "F at ST2704N:green:lan4";
+			gpios = <&gpio0 7 1>;
+		};
+		lan3_green {
+			label = "F at ST2704N:green:lan3";
+			gpios = <&gpio0 6 1>;
+		};
+		lan2_green {
+			label = "F at ST2704N:green:lan2";
+			gpios = <&gpio0 5 1>;
+		};
+		lan1_green {
+			label = "F at ST2704N:green:lan1";
+			gpios = <&gpio0 4 1>;
+		};
+		power_red {
+			label = "F at ST2704N:red:power";
+			gpios = <&gpio0 11 1>;
+		};
+	};
+};
diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile
index e98011d..805f0c5 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -383,6 +383,8 @@ $(eval $(call ImageDTB,CFEDTB,A226G,A226G,a226g,DWV-S0,6358,--signature2 IMAGE -
 # Pirelli A226M/A226M-FWB
 $(eval $(call ImageDTB,CFEDTB,A226M,A226M,a226m,DWV-S0,6358,--signature2 IMAGE --tag-version 8))
 $(eval $(call ImageDTB,CFEDTB,A226M,A226M-FWB,a226m-fwb,DWV-S0,6358,--block-size 0x20000 --image-offset 0x20000 --signature2 IMAGE --tag-version 8))
+# Plusnet F at ST2704N / Sagem F at ST2704N (V1)
+$(eval $(call ImageDTB,CFEDTB,FAST2704N,F at ST2704N,fast2704n,F at ST2704N,6318))
 # Sagem F at ST2404
 $(eval $(call ImageDTB,CFEDTB,FAST2404,F at ST2404,fast2404,F at ST2404,6348))
 # Sagem F at ST2504n


-------------- next part --------------
_______________________________________________
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