[OpenWrt-Devel] [PATCH] add support for WRTnode2P and WRTnode2R add led support for wrtnode platform
xzmu
xzmu at wrtnode.com
Thu Dec 24 03:56:03 EST 2015
Signed-off-by: xzmu <xzmu at wrtnode.com>
---
.../linux/ramips/base-files/etc/board.d/02_network | 2 +
target/linux/ramips/base-files/etc/diag.sh | 5 +
target/linux/ramips/base-files/lib/ramips.sh | 6 ++
.../ramips/base-files/lib/upgrade/platform.sh | 2 +
target/linux/ramips/dts/WRTNODE2P.dts | 99 ++++++++++++++++++
target/linux/ramips/dts/WRTNODE2R.dts | 114 +++++++++++++++++++++
6 files changed, 228 insertions(+)
create mode 100644 target/linux/ramips/dts/WRTNODE2P.dts
create mode 100644 target/linux/ramips/dts/WRTNODE2R.dts
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index d7d016b..816a1a7 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -175,6 +175,8 @@ ramips_setup_interfaces()
hg255d | \
rt-n14u | \
wrtnode | \
+ wrtnode2p | \
+ wrtnode2r | \
wt3020 | \
ur-326n4g | \
zbt-wa05)
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index a7e2501..d596b8a 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -253,6 +253,11 @@ get_status_led() {
zte-q7)
status_led="zte:red:status"
;;
+ wrtnode2r | \
+ wrtnode2p | \
+ wrtnode)
+ status_led="wrtnode:blue:indicator"
+ ;;
esac
}
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 4141ddd..6c74412 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -391,6 +391,12 @@ ramips_board_detect() {
*"WRTNODE")
name="wrtnode"
;;
+ *"WRTnode2R")
+ name="wrtnode2r"
+ ;;
+ *"WRTnode2P")
+ name="wrtnode2p"
+ ;;
*"Wansview NCS601W")
name="ncs601w"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 2f64d8c..0fc5c26 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -119,6 +119,8 @@ platform_check_image() {
wr6202 |\
wr8305rt |\
wrtnode |\
+ wrtnode2r |\
+ wrtnode2p |\
wt1520 |\
wt3020 |\
x5 |\
diff --git a/target/linux/ramips/dts/WRTNODE2P.dts b/target/linux/ramips/dts/WRTNODE2P.dts
new file mode 100644
index 0000000..59866dd
--- /dev/null
+++ b/target/linux/ramips/dts/WRTNODE2P.dts
@@ -0,0 +1,99 @@
+/dts-v1/;
+
+/include/ "mt7628an.dtsi"
+
+/ {
+ compatible = "mediatek,wrtnode2p", "mediatek,mt7628an-soc";
+ model = "WRTnode2P";
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+
+ pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "gpio", "jtag";
+ ralink,function = "gpio";
+ };
+ };
+ };
+
+ palmbus at 10000000 {
+ spi at b00 {
+ status = "okay";
+
+ m25p80 at 0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "w25q256";
+ reg = <0 0>;
+ linux,modalias = "m25p80", "w25q256";
+ spi-max-frequency = <10000000>;
+ m25p,chunked-io = <32>;
+
+ partition at 0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition at 30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition at 40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition at 50000 {
+ label = "firmware";
+ reg = <0x50000 0x1fb0000>;
+ };
+ };
+ };
+
+ uart1 at d00 {
+ status = "okay";
+ };
+
+ };
+
+ ethernet at 10100000 {
+ mtd-mac-address = <&factory 0x4>;
+ ralink,port-map = "llllw";
+ };
+
+ sdhci at 10130000 {
+ status = "okay";
+ };
+
+ pcie at 10140000 {
+ status = "okay";
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+ indicator {
+ label = "wrtnode:blue:indicator";
+ gpios = <&gpio1 9 1>;
+ };
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+ reset {
+ label = "reset";
+ gpios = <&gpio0 5 1>;
+ linux,code = <0x198>;
+ };
+ };
+};
+
diff --git a/target/linux/ramips/dts/WRTNODE2R.dts b/target/linux/ramips/dts/WRTNODE2R.dts
new file mode 100644
index 0000000..7f383ad
--- /dev/null
+++ b/target/linux/ramips/dts/WRTNODE2R.dts
@@ -0,0 +1,114 @@
+/dts-v1/;
+
+/include/ "mt7628an.dtsi"
+
+/ {
+ compatible = "mediatek,wrtnode2r", "mediatek,mt7628an-soc";
+ model = "WRTnode2R";
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+
+ pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "gpio", "wled_an";
+ ralink,function = "gpio";
+ };
+ };
+ };
+
+ palmbus at 10000000 {
+ spi at b00 {
+ status = "okay";
+
+ m25p80 at 0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "w25q256";
+ reg = <0 0>;
+ linux,modalias = "m25p80", "w25q256";
+ spi-max-frequency = <10000000>;
+ m25p,chunked-io = <32>;
+
+ partition at 0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition at 30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition at 40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition at 50000 {
+ label = "firmware";
+ reg = <0x50000 0x1fb0000>;
+ };
+ };
+
+
+ spidev at 1 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "spidev";
+ reg = <1 0>;
+ linux,modalias = "spidev", "spidev";
+ spi-max-frequency = <10000000>;
+ };
+ };
+
+ uart1 at d00 {
+ status = "okay";
+ };
+
+ i2c at 900 {
+ status = "okay";
+ };
+
+ };
+
+ ethernet at 10100000 {
+ mtd-mac-address = <&factory 0x4>;
+ ralink,port-map = "llllw";
+ };
+
+ sdhci at 10130000 {
+ status = "okay";
+ };
+
+ pcie at 10140000 {
+ status = "okay";
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+ indicator {
+ label = "wrtnode:blue:indicator";
+ gpios = <&gpio1 12 1>;
+ };
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+ reset {
+ label = "reset";
+ gpios = <&gpio0 5 1>;
+ linux,code = <0x198>;
+ };
+ };
+
+};
+
--
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