ramips : add support for PandoraBox D1
authorBangLang Huang <banglang.huang@foxmail.com>
Tue, 27 Sep 2016 06:23:27 +0000 (14:23 +0800)
committerJohn Crispin <john@phrozen.org>
Tue, 27 Sep 2016 15:50:22 +0000 (17:50 +0200)
Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/base-files/etc/diag.sh
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/PBR-D1.dts [new file with mode: 0644]
target/linux/ramips/image/mt7688.mk

index 29bba0b..5dee0d5 100755 (executable)
@@ -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"
index e757acb..70297de 100755 (executable)
@@ -178,6 +178,7 @@ ramips_setup_interfaces()
        mzk-ex300np|\
        mzk-ex750np|\
        na930|\
+       pbr-d1|\
        wli-tx4-ag300n|\
        wmr-300|\
        wrh-300cr)
index 1eb4036..e604d7f 100644 (file)
@@ -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)
index 3a72835..7429816 100755 (executable)
@@ -337,6 +337,9 @@ ramips_board_detect() {
        *"OY-0001")
                name="oy-0001"
                ;;
+       *"PBR-D1")
+               name="pbr-d1"
+               ;;
        *"PBR-M1")
                name="pbr-m1"
                ;;
index a71d806..162a69e 100755 (executable)
@@ -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 (file)
index 0000000..30477a0
--- /dev/null
@@ -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@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@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@0 {
+                       label = "u-boot";
+                       reg = <0x0 0x30000>;
+                       read-only;
+               };
+
+               partition@30000 {
+                       label = "u-boot-env";
+                       reg = <0x30000 0x10000>;
+               };
+
+               factory: partition@40000 {
+                       label = "factory";
+                       reg = <0x40000 0x10000>;
+                       read-only;
+               };
+
+               partition@50000 {
+                       label = "firmware";
+                       reg = <0x50000 0x0fb0000>;
+               };
+       };
+
+       spidev@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;
+};
index ffd92d2..406af69 100644 (file)
@@ -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)