[source] ramips : add support for PandoraBox D1

LEDE Commits lede-commits at lists.infradead.org
Tue Sep 27 09:21:14 PDT 2016


blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/9fe833e1d020748fa92e485aeb08b1ac9a6fdb09

commit 9fe833e1d020748fa92e485aeb08b1ac9a6fdb09
Author: BangLang Huang <banglang.huang at foxmail.com>
AuthorDate: Tue Sep 27 14:23:27 2016 +0800

    ramips : add support for PandoraBox D1
    
    Signed-off-by: BangLang Huang <banglang.huang at foxmail.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/PBR-D1.dts                 | 159 +++++++++++++++++++++
 target/linux/ramips/image/mt7688.mk                |   8 ++
 7 files changed, 177 insertions(+), 1 deletion(-)

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 29bba0b..5dee0d5 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -242,6 +242,9 @@ oy-0001)
 	ucidef_set_led_default "power" "power" "$board:green:power" "1"
 	set_wifi_led "$board:green:wifi"
 	;;
+pbr-d1)
+	set_usb_led "$board:orange:usb"
+	;;
 pbr-m1)
 	ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
 	ucidef_set_led_default "power" "power" "$board:blue:power" "1"
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 e757acb..70297de 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -178,6 +178,7 @@ ramips_setup_interfaces()
 	mzk-ex300np|\
 	mzk-ex750np|\
 	na930|\
+	pbr-d1|\
 	wli-tx4-ag300n|\
 	wmr-300|\
 	wrh-300cr)
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 1eb4036..e604d7f 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -113,7 +113,8 @@ get_status_led() {
 		status_led="$board:blue:power"
 		;;
 	db-wrt01|\
-	esr-9753)
+	esr-9753|\
+	pbr-d1)
 		status_led="$board:orange:power"
 		;;
 	f5d8235-v2)
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 3a72835..7429816 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -337,6 +337,9 @@ ramips_board_detect() {
 	*"OY-0001")
 		name="oy-0001"
 		;;
+	*"PBR-D1")
+		name="pbr-d1"
+		;;
 	*"PBR-M1")
 		name="pbr-m1"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index a71d806..162a69e 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -99,6 +99,7 @@ platform_check_image() {
 	nixcore|\
 	nw718|\
 	oy-0001|\
+	pbr-d1|\
 	pbr-m1|\
 	psg1208|\
 	psr-680w|\
diff --git a/target/linux/ramips/dts/PBR-D1.dts b/target/linux/ramips/dts/PBR-D1.dts
new file mode 100644
index 0000000..30477a0
--- /dev/null
+++ b/target/linux/ramips/dts/PBR-D1.dts
@@ -0,0 +1,159 @@
+/dts-v1/;
+
+#include "mt7628an.dtsi"
+
+/ {
+	compatible = "mediatek,pbr-d1", "mediatek,mt7628an-soc";
+	model = "PBR-D1";
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	aliases {
+		serial0 = &uart2;
+	};
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x0 0x8000000>;
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		usb {
+			label = "pbr-d1:orange:usb";
+			gpios = <&gpio0 0 1>;
+			default-state = "off";
+		};
+
+		power {
+			label = "pbr-d1:orange:power";
+			gpios = <&gpio0 14 1>;
+			default-state = "on";
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		wps {
+			label = "reset";
+			gpios = <&gpio1 38 1>;
+			linux,code = <0x211>;
+		};
+	};
+
+	wgpio: gpio-wifi {
+		compatible = "mediatek,gpio-wifi";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+};
+
+&pinctrl {
+	state_default: pinctrl0 {
+		gpio {
+			ralink,group = "gpio";
+			ralink,function = "gpio";
+		};
+
+		i2c {
+			ralink,group = "i2c";
+			ralink,function = "gpio";
+		};
+
+		i2s {
+			ralink,group = "i2s";
+			ralink,function = "gpio";
+		};
+
+		spis {
+			ralink,group = "spis";
+			ralink,function = "gpio";
+		};
+
+		wdt {
+			ralink,group = "wdt";
+			ralink,function = "gpio";
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
+
+	m25p80 at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		linux,modalias = "m25p80", "w25q128";
+		spi-max-frequency = <40000000>;
+		m25p,chunked-io = <31>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x30000>;
+			read-only;
+		};
+
+		partition at 30000 {
+			label = "u-boot-env";
+			reg = <0x30000 0x10000>;
+		};
+
+		factory: partition at 40000 {
+			label = "factory";
+			reg = <0x40000 0x10000>;
+			read-only;
+		};
+
+		partition at 50000 {
+			label = "firmware";
+			reg = <0x50000 0x0fb0000>;
+		};
+	};
+
+	spidev at 1 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "linux,spidev";
+		reg = <1>;
+		spi-max-frequency = <40000000>;
+	};
+};
+
+&i2c {
+	status = "okay";
+};
+
+&uart1 {
+	status = "okay";
+};
+
+&uart2 {
+	status = "okay";
+};
+
+&pwm {
+	status = "okay";
+};
+
+&ethernet {
+	mtd-mac-address = <&factory 0x28>;
+};
+
+&sdhci {
+	status = "okay";
+	mediatek,cd-high;
+};
diff --git a/target/linux/ramips/image/mt7688.mk b/target/linux/ramips/image/mt7688.mk
index ffd92d2..406af69 100644
--- a/target/linux/ramips/image/mt7688.mk
+++ b/target/linux/ramips/image/mt7688.mk
@@ -10,6 +10,14 @@ define Device/LinkIt7688
 endef
 TARGET_DEVICES += LinkIt7688
 
+define Device/pbr-d1
+  DTS := PBR-D1
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  DEVICE_TITLE := PBR-D1
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
+endef
+TARGET_DEVICES += pbr-d1
+
 define Device/wrtnode2r
   DTS := WRTNODE2R
   IMAGE_SIZE := $(ralink_default_fw_size_16M)



More information about the lede-commits mailing list