ramips: add support for Youku X2
authorShiji Yang <yangshiji66@qq.com>
Sat, 5 Nov 2022 11:52:08 +0000 (19:52 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 5 Nov 2022 20:12:24 +0000 (21:12 +0100)
Specifications:
  SOC:      MT7620AN + MT7612EN
  RAM:      128 MiB DDR2
  Flash:    16 MiB (Winbond W25Q28FVFG)
  WLAN:     2.4G + 5G
  LAN:      LAN ports *2
  WAN:      WAN port *1
  USB:      USB2.0 *1
  SD Card:  MicroSD *1
  Buttons:  Reset *1
  LEDs: ethernet *3, system, usb, wlan2g, wlan5g

MAC Address:
  use        address               source
  label      54:36:9b:xx:xx:ac     lan
  lan        54:36:9b:xx:xx:ac     factory.0x0028
  wan        54:36:9b:xx:xx:ad     factory.0x002e
  wlan2g     54:36:9b:xx:xx:ae     factory.0x0004
  wlan5g     54:36:9b:xx:xx:af     factory.0x8004

Installation:
1. Apply initramfs-kernel.bin in stock firmware Web UI.
2. Install sysupgrade.bin on OpenWrt and do not retain any configuration.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
target/linux/ramips/dts/mt7620a_youku_x2.dts [new file with mode: 0644]
target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi
target/linux/ramips/image/mt7620.mk
target/linux/ramips/mt7620/base-files/etc/board.d/02_network

diff --git a/target/linux/ramips/dts/mt7620a_youku_x2.dts b/target/linux/ramips/dts/mt7620a_youku_x2.dts
new file mode 100644 (file)
index 0000000..ad9e252
--- /dev/null
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7620a_youku_yk-l1.dtsi"
+
+/ {
+       compatible = "youku,x2", "ralink,mt7620a-soc";
+       model = "Youku X2";
+};
+
+&ethernet {
+       mediatek,portmap = "wllll";
+};
+
+&firmware {
+       reg = <0x50000 0xfb0000>;
+};
+
+&led_wlan {
+       linux,default-trigger = "phy1tpt";
+};
+
+&pcie {
+       status = "okay";
+};
+
+&pcie0 {
+       wifi@0,0 {
+               compatible = "mediatek,mt76";
+               reg = <0x0000 0 0 0 0>;
+               mediatek,mtd-eeprom = <&factory 0x8000>;
+               ieee80211-freq-limit = <5000000 6000000>;
+
+               led {
+                       led-sources = <2>;
+                       led-active-low;
+               };
+       };
+};
index 210b0d7d1957505b40ba46c98344f4e9df2d0956..5af7b343d9b4d63428a88bd4441d496dc08bc2e4 100644 (file)
@@ -15,7 +15,7 @@
        leds {
                compatible = "gpio-leds";
 
-               wlan {
+               led_wlan: wlan {
                        label = "blue:wlan";
                        gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "phy0tpt";
index db6ac93b2a25895bdf1add40f0ad5dc28a6ec081..231f6ad47d7ee917617d219340a5ee791db0bd16 100644 (file)
@@ -1273,6 +1273,18 @@ define Device/xiaomi_miwifi-mini
 endef
 TARGET_DEVICES += xiaomi_miwifi-mini
 
+define Device/youku_x2
+  SOC := mt7620a
+  IMAGE_SIZE := 16064k
+  DEVICE_VENDOR := Youku
+  DEVICE_MODEL := X2
+  DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci \
+       kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport
+  UIMAGE_MAGIC := 0x12291000
+  UIMAGE_NAME := 400000000000000000001000
+endef
+TARGET_DEVICES += youku_x2
+
 define Device/youku_yk-l1
   SOC := mt7620a
   IMAGE_SIZE := 32448k
index 79df10205613f0bbd58153af787d5950e831592b..ac1cf5e62a8a72386dd2c295018e46f3252ad205 100644 (file)
@@ -237,6 +237,10 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "5:lan" "4:wan" "6@eth0"
                ;;
+       youku,x2)
+               ucidef_add_switch "switch0" \
+                       "1:lan:2" "4:lan:1" "0:wan" "6@eth0"
+               ;;
        youku,yk-l1|\
        youku,yk-l1c)
                ucidef_add_switch "switch0" \
@@ -368,6 +372,7 @@ ramips_setup_macs()
        ohyeah,oy-0001|\
        wavlink,wl-wn530hg4|\
        wevo,air-duo|\
+       youku,x2|\
        youku,yk-l1|\
        youku,yk-l1c)
                wan_mac=$(mtd_get_mac_binary factory 0x2e)