[OpenWrt-Devel] [PATCH] ramips: add support for Planex DB-WRT01

YuheiOKAWA tochiro.srchack at gmail.com
Mon Aug 10 11:16:33 EDT 2015


 This patch add support for Planex DB-WRT01. DANBOARD route on
 the MT7620A SoC with two Ethernet port and a 802.11n 2.4 GHz radio.
 DANBOARD is Cartoon character.

Signed-off-by: YuheiOKAWA <tochiro.srchack at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds |  3 +
 .../linux/ramips/base-files/etc/board.d/02_network |  1 +
 target/linux/ramips/base-files/etc/diag.sh         |  3 +
 target/linux/ramips/base-files/lib/ramips.sh       |  3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |  1 +
 target/linux/ramips/dts/DB-WRT01.dts               | 99 ++++++++++++++++++++++
 target/linux/ramips/image/Makefile                 |  2 +
 7 files changed, 112 insertions(+)
 create mode 100644 target/linux/ramips/dts/DB-WRT01.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index c6bfd7e..2d4fb92 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -85,6 +85,9 @@ case $board in
 		ucidef_set_led_default "power" "POWER" "d105:red:power" "1"
 		set_usb_led "d105:green:usb"
 		;;
+	db-wrt01)
+		ucidef_set_led_default "power" "power" "dbwrt01:orange:power" "1"
+		;;
 	dcs-930l-b1)
 		ucidef_set_led_default "power" "POWER" "d-link:red:power" "1"
 		ucidef_set_led_netdev "wifi" "WiFi" "d-link:blue:wps"
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 da1854a..083081e 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -126,6 +126,7 @@ ramips_setup_interfaces()
 
 	3g-6200n | \
 	ai-br100 | \
+	db-wrt01 | \
 	dir-610-a1 | \
 	dir-300-b7 | \
 	dir-320-b1 | \
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index e63f0df..8e1bc92 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -48,6 +48,9 @@ get_status_led() {
 	d105)
 		status_led="d105:red:power"
 		;;
+	db-wrt01)
+		status_led="dbwrt01:orange:power"
+		;;
 	dcs-930 | dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-610-a1 | dir-615-h1 | dir-615-d | dir-620-a1| dir-620-d1| dir-300-b7| dir-320-b1)
 		status_led="d-link:green:status"
 		;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 7db6d37..e745db9 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -211,6 +211,9 @@ ramips_board_detect() {
 	*"Linksys RE6500")
 		name="re6500"
 		;;
+	*"Planex DB-WRT01")
+		name="db-wrt01"
+		;;
 	*"Planex MZK-750DHP")
 		name="mzk-750dhp"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 8221997..d09fc80 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -36,6 +36,7 @@ platform_check_image() {
 	cf-wr800n | \
 	d105 | \
 	dap-1350 | \
+	db-wrt01 | \
 	dcs-930 | \
 	dcs-930l-b1 | \
 	dir-300-b1 | \
diff --git a/target/linux/ramips/dts/DB-WRT01.dts b/target/linux/ramips/dts/DB-WRT01.dts
new file mode 100644
index 0000000..c396cab
--- /dev/null
+++ b/target/linux/ramips/dts/DB-WRT01.dts
@@ -0,0 +1,99 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+	compatible = "ralink,mt7620a-soc";
+	model = "Planex DB-WRT01";
+
+	palmbus at 10000000 {
+		gpio1: gpio at 638 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "en25q64";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "mx25l6405d";
+				spi-max-frequency = <10000000>;
+
+				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 0x7b0000>;
+				};
+			};
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "spi refclk", "rgmii1";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&ephy_pins>;
+
+		mtd-mac-address = <&factory 0x4>;
+		ralink,port-map = "llllw";
+	};
+
+	gsw at 10110000 {
+		ralink,port4 = "ephy";
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	pcie at 10140000 {
+		status = "okay";
+	};
+	
+	gpio-leds {
+		compatible = "gpio-leds";
+		power {
+			label = "dbwrt01:orange:power";
+			gpios = <&gpio1 1 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		s1 {
+			label = "wps";
+			gpios = <&gpio0 2 1>;
+			linux,code = <0x211>;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 409ff26..088cf5a 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -857,6 +857,7 @@ Image/Build/Profile/MT7620a_MT7530=$(call BuildFirmware/Default8M/$(1),$(1),mt76
 Image/Build/Profile/MT7620a_V22SG=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_v22sg,MT7620a_V22SG)
 br100_mtd_size=8126464
 Image/Build/Profile/AIBR100=$(call BuildFirmware/CustomFlash/$(1),$(1),ai-br100,AIBR100,$(br100_mtd_size),Ai-BR)
+Image/Build/Profile/DB-WRT01=$(call BuildFirmware/Default8M/$(1),$(1),db-wrt01,DB-WRT01)
 Image/Build/Profile/RP-N53=$(call BuildFirmware/Default8M/$(1),$(1),rp_n53,RP-N53)
 whr_300hp2_mtd_size=7012352
 Image/Build/Profile/WHR300HP2=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-300hp2,WHR-300HP2,$(whr_300hp2_mtd_size))
@@ -895,6 +896,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/MT7620a_MT7530,$(1))
 	$(call Image/Build/Profile/MT7620a_V22SG,$(1))
 	$(call Image/Build/Profile/AIBR100,$(1))
+	$(call Image/Build/Profile/DB-WRT01,$(1))
 	$(call Image/Build/Profile/CF-WR800N,$(1))
 	$(call Image/Build/Profile/RP-N53,$(1))
 	$(call Image/Build/Profile/DIR-810L,$(1))
-- 
1.9.1
_______________________________________________
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