summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtarget/linux/ramips/base-files/etc/board.d/01_leds4
-rwxr-xr-xtarget/linux/ramips/base-files/etc/board.d/02_network1
-rw-r--r--target/linux/ramips/base-files/etc/diag.sh1
-rwxr-xr-xtarget/linux/ramips/base-files/lib/ramips.sh3
-rwxr-xr-xtarget/linux/ramips/base-files/lib/upgrade/platform.sh1
-rw-r--r--target/linux/ramips/dts/D240.dts157
-rw-r--r--target/linux/ramips/image/mt7620.mk8
7 files changed, 175 insertions, 0 deletions
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 545d6a4..4e6eeb2 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -109,6 +109,10 @@ d105)
ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
set_usb_led "$board:green:usb"
;;
+d240)
+ set_wifi_led "$board:blue:wifi"
+ set_usb_led "$board:blue:usb"
+ ;;
db-wrt01)
ucidef_set_led_default "power" "power" "$board:orange: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 cc092b1..af5a951 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -73,6 +73,7 @@ ramips_setup_interfaces()
3g-6200n|\
ac1200pro|\
ai-br100|\
+ d240|\
db-wrt01|\
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 9499833..4ed18d7 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -108,6 +108,7 @@ get_status_led() {
w502u)
status_led="$board:blue:wps"
;;
+ d240|\
dap-1350|\
na930|\
pbr-m1|\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 8292da1..e642d56 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -112,6 +112,9 @@ ramips_board_detect() {
*"D105")
name="d105"
;;
+ *"D240")
+ name="d240"
+ ;;
*"DAP-1350")
name="dap-1350"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index c6ad8ca..7f5b1dd 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -35,6 +35,7 @@ platform_check_image() {
cf-wr800n|\
cs-qr10|\
d105|\
+ d240|\
dap-1350|\
db-wrt01|\
dcs-930|\
diff --git a/target/linux/ramips/dts/D240.dts b/target/linux/ramips/dts/D240.dts
new file mode 100644
index 0000000..3da96f2
--- /dev/null
+++ b/target/linux/ramips/dts/D240.dts
@@ -0,0 +1,157 @@
+/*
+ * BSD LICENSE
+ *
+ * Copyright(c) 2017 Kristian Evensen <kristian.evensen@gmail.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Broadcom Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/dts-v1/;
+
+#include "mt7620a.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ compatible = "d240", "ralink,mt7620a-soc";
+ model = "Sanlinking Technologies D240";
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ power {
+ label = "d240:blue:power";
+ gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
+ };
+
+ usb {
+ label = "d240:blue:usb";
+ gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
+ };
+
+ air {
+ label = "d240:blue:wifi";
+ gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+
+ reset {
+ label = "reset";
+ gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ en25q128@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ ralink,port-map = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "i2c", "uartf", "wled", "spi refclk", "pa";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+};
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index f4f072f..42745c4 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -473,3 +473,11 @@ define Device/kng_rc
zyimage -d 8997 -v "ZyXEL Keenetic Viva"
endef
TARGET_DEVICES += kng_rc
+
+define Device/d240
+ DTS := D240
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Sanlinking Technologies D240
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76 kmod-sdhci-mt7620
+endef
+TARGET_DEVICES += d240