[OpenWrt-Devel] [PATCH v3] bcm53xx: add support for Huawei WS880

Sergey Shatunov me at prok.pw
Wed Dec 2 09:48:00 EST 2015


From: Prototik <me at prok.pw>

Changes since v2:
LED default state modified

Signed-off-by: Sergey Shatunov <me at prok.pw>
---
 target/linux/bcm53xx/image/Makefile                |  14 +++
 .../910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch | 115 +++++++++++++++++++++
 .../910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch | 115 +++++++++++++++++++++
 3 files changed, 244 insertions(+)
 create mode 100644 target/linux/bcm53xx/patches-4.1/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch
 create mode 100644 target/linux/bcm53xx/patches-4.3/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch

diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index c9987dd..2b46988 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -133,6 +133,19 @@ define Device/smartrg-sr400ac
   IMAGE/trx := trx-serial
 endef
 
+define Device/huawei
+  IMAGES := trx
+  IMAGE/trx := trx-nand | asus-trx
+endef
+
+define HuaweiDevice
+  define Device/huawei-$(1)
+	$$(Device/huawei)
+	PRODUCTID := $(2)
+  endef
+  TARGET_DEVICES += huawei-$(1)
+endef
+
 TARGET_DEVICES += \
 	buffalo-wzr-1750dhp buffalo-wzr-600dhp2 buffalo-wzr-900dhp \
 	buffalo-wxr-1900dhp \
@@ -145,5 +158,6 @@ $(eval $(call AsusDevice,rt-ac87u,RT-AC87U))
 $(eval $(call AsusDevice,rt-n18u,RT-N18U))
 $(eval $(call LinksysDevice,ea6300-v1))
 $(eval $(call NetgearDevice,r7000,U12H270T00_NETGEAR))
+$(eval $(call HuaweiDevice,ws880,WS880))
 
 $(eval $(call BuildImage))
diff --git a/target/linux/bcm53xx/patches-4.1/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch b/target/linux/bcm53xx/patches-4.1/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch
new file mode 100644
index 0000000..395025b
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.1/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch
@@ -0,0 +1,115 @@
+From: Sergey Shatunov <me at prok.pw>
+Subject: [PATCH] ARM: BCM5301X: Add DT for Huawei WS880
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Sergey Shatunov <me at prok.pw>
+---
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -59,6 +59,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm4708-asus-rt-ac56u.dtb \
+ 	bcm4708-asus-rt-ac68u.dtb \
+ 	bcm4708-buffalo-wzr-1750dhp.dtb \
++	bcm4708-huawei-ws880.dtb \
+ 	bcm4708-linksys-ea6300-v1.dtb \
+ 	bcm4708-luxul-xwc-1000.dtb \
+ 	bcm4708-netgear-r6250.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm4708-huawei-ws880.dts
+@@ -0,0 +1,94 @@
++/*
++ * Broadcom BCM470X / BCM5301X ARM platform code.
++ * DTS for Huawei WS880
++ *
++ * Copyright (C) 2015 Sergey Shatunov <me at prok.pw>
++ *
++ * Licensed under the GNU/GPL. See COPYING for details.
++ */
++
++/dts-v1/;
++
++#include "bcm4708.dtsi"
++#include "bcm5301x-nand-cs0-bch8.dtsi"
++
++/ {
++	compatible = "huawei,ws880", "brcm,bcm4708";
++	model = "Huawei WS880 (BCM4708)";
++
++	chosen {
++		bootargs = "console=ttyS0,115200";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		wlan {
++			label = "bcm53xx:white:wlan";
++			gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-ffn";
++		};
++
++		lan {
++			label = "bcm53xx:white:lan";
++			gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-on";
++		};
++
++		wps {
++			label = "bcm53xx:white:wps";
++			gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		internet {
++			label = "bcm53xx:white:internet";
++			gpios = <&chipcommon 12 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "default-on";
++		};
++
++		usb {
++			label = "bcm53xx:white:usb";
++			gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>;
++		};
++
++		wps {
++			label = "WPS";
++			linux,code = <KEY_WPS_BUTTON>;
++			gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
++		};
++
++		power {
++			label = "Power";
++			linux,code = <KEY_POWER>;
++			gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
++		};
++	};
++	
++	nand at 18028000 {
++		nandcs at 0 {
++			nand-ecc-strength = <4>;
++		};
++	};
++};
++
++&uart0 {
++	status = "okay";
++};
diff --git a/target/linux/bcm53xx/patches-4.3/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch b/target/linux/bcm53xx/patches-4.3/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch
new file mode 100644
index 0000000..7c0e550
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.3/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch
@@ -0,0 +1,115 @@
+From: Sergey Shatunov <me at prok.pw>
+Subject: [PATCH] ARM: BCM5301X: Add DT for Huawei WS880
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Sergey Shatunov <me at prok.pw>
+---
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -59,6 +59,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm4708-asus-rt-ac56u.dtb \
+ 	bcm4708-asus-rt-ac68u.dtb \
+ 	bcm4708-buffalo-wzr-1750dhp.dtb \
++	bcm4708-huawei-ws880.dtb \
+ 	bcm4708-linksys-ea6300-v1.dtb \
+ 	bcm4708-luxul-xwc-1000.dtb \
+ 	bcm4708-netgear-r6250.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm4708-huawei-ws880.dts
+@@ -0,0 +1,94 @@
++/*
++ * Broadcom BCM470X / BCM5301X ARM platform code.
++ * DTS for Huawei WS880
++ *
++ * Copyright (C) 2015 Sergey Shatunov <me at prok.pw>
++ *
++ * Licensed under the GNU/GPL. See COPYING for details.
++ */
++
++/dts-v1/;
++
++#include "bcm4708.dtsi"
++#include "bcm5301x-nand-cs0-bch8.dtsi"
++
++/ {
++	compatible = "huawei,ws880", "brcm,bcm4708";
++	model = "Huawei WS880 (BCM4708)";
++
++	chosen {
++		bootargs = "console=ttyS0,115200";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		wlan {
++			label = "bcm53xx:white:wlan";
++			gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		lan {
++			label = "bcm53xx:white:lan";
++			gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-on";
++		};
++
++		wps {
++			label = "bcm53xx:white:wps";
++			gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		internet {
++			label = "bcm53xx:white:internet";
++			gpios = <&chipcommon 12 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "default-on";
++		};
++
++		usb {
++			label = "bcm53xx:white:usb";
++			gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>;
++		};
++
++		wps {
++			label = "WPS";
++			linux,code = <KEY_WPS_BUTTON>;
++			gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
++		};
++
++		power {
++			label = "Power";
++			linux,code = <KEY_POWER>;
++			gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
++		};
++	};
++	
++	nand at 18028000 {
++		nandcs at 0 {
++			nand-ecc-strength = <4>;
++		};
++	};
++};
++
++&uart0 {
++	status = "okay";
++};
-- 
2.6.2
_______________________________________________
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