ramips: add support for DuZun DM06
authorMichael Lee <igvtee@gmail.com>
Sat, 28 May 2016 14:22:10 +0000 (22:22 +0800)
committerJohn Crispin <john@phrozen.org>
Mon, 13 Jun 2016 20:51:43 +0000 (22:51 +0200)
DuZun DM06 is a develop board based on mt7628
64M RAM, 8M SPI Flash, 1 WAN, 1 LAN.
wm8960 codec with line out, line in and speaker output.

Signed-off-by: Michael Lee <igvtee@gmail.com>
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/DUZUN-DM06.dts [new file with mode: 0644]
target/linux/ramips/image/mt7628.mk

index 4728c75..6807eed 100755 (executable)
@@ -172,6 +172,10 @@ ramips_setup_interfaces()
        wrh-300cr)
                ucidef_set_interface_lan "eth0"
                ;;
+       duzun-dm06)
+               ucidef_add_switch "switch0" \
+                       "1:lan" "0:wan" "6@eth0"
+               ;;
        e1700|\
        mt7620a_mt7530)
                ucidef_add_switch "switch1" \
index cbe455d..567e506 100755 (executable)
@@ -151,6 +151,9 @@ ramips_board_detect() {
        *"Dovado Tiny AC")
                name="tiny-ac"
                ;;
+       *"DuZun DM06")
+               name="duzun-dm06"
+               ;;
        *"E1700")
                name="e1700"
                ;;
index 91c9997..c71fc64 100755 (executable)
@@ -50,6 +50,7 @@ platform_check_image() {
        dir-620-a1|\
        dir-620-d1|\
        dir-810l|\
+       duzun-dm06|\
        e1700|\
        esr-9753|\
        ex2700|\
diff --git a/target/linux/ramips/dts/DUZUN-DM06.dts b/target/linux/ramips/dts/DUZUN-DM06.dts
new file mode 100644 (file)
index 0000000..946a421
--- /dev/null
@@ -0,0 +1,155 @@
+/dts-v1/;
+
+/include/ "mt7628an.dtsi"
+
+/ {
+       compatible = "duzun,dm06-mt7628an", "mediatek,mt7628an-soc";
+       model = "DuZun DM06";
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x4000000>;
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <100>;
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio1 14 1>;
+                       linux,code = <0x198>;
+               };
+
+               wps {
+                       label = "wps";
+                       gpios = <&gpio1 6 1>;
+                       linux,code = <0x211>;
+               };
+       };
+
+       sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "Audio-I2S";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,bitclock-master = <&dailink0_master>;
+               simple-audio-card,frame-master = <&dailink0_master>;
+               simple-audio-card,widgets =
+                       "Headphone", "Headphones";
+               simple-audio-card,routing =
+                       "Headphones", "HP_L",
+                       "Headphones", "HP_R";
+               simple-audio-card,mclk-fs = <256>;
+
+               simple-audio-card,cpu {
+                       sound-dai = <&i2s>;
+               };
+
+               dailink0_master: simple-audio-card,codec {
+                       sound-dai = <&codec>;
+               };
+       };
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               gpio {
+                       ralink,group = "wdt", "uart1";
+                       ralink,function = "gpio";
+               };
+       };
+
+       i2s_pins: i2s {
+               i2s {
+                       ralink,group = "i2s";
+                       ralink,function = "i2s";
+               };
+       };
+
+       wm8960_mclk_pins: wm8960_mclk {
+               wm8960_mclk {
+                       ralink,group = "refclk";
+                       ralink,function = "reclk";
+               };
+       };
+};
+
+&gpio1 {
+       status = "okay";
+};
+
+&i2c {
+       status = "okay";
+
+       codec: wm8960@1a {
+               #sound-dai-cells = <0>;
+               compatible = "wlf,wm8960";
+               reg = <0x1a>;
+
+               wlf,shared-lrclk;
+       };
+};
+
+&ethernet {
+       mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+       mediatek,portmap = <0x3>;
+       mediatek,portdisable = <0x3c>;
+};
+
+&i2s {
+       #sound-dai-cells = <0>;
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2s_pins>, <&wm8960_mclk_pins>;
+};
+
+&sdhci {
+       status = "okay";
+};
+
+&gdma {
+       status = "okay";
+};
+
+&spi0 {
+       status = "okay";
+
+       m25p80@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               linux,modalias = "m25p80";
+               spi-max-frequency = <60000000>;
+               m25p,chunked-io = <32>;
+               m25p,fast-read;
+
+               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 0x7b0000>;
+               };
+       };
+};
index 8274e11..fa7d1e7 100644 (file)
@@ -25,3 +25,11 @@ define Device/wrtnode2p
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
 endef
 TARGET_DEVICES += wrtnode2p
+
+define Device/duzun-dm06
+  DTS := DUZUN-DM06
+  IMAGE_SIZE := $(ralink_default_fw_size_8M)
+  DEVICE_TITLE := DuZun DM06
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+TARGET_DEVICES += duzun-dm06