mt7981: add support for sn-r1
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -36,3 +36,5 @@ git-src
|
|||||||
!/dl/datconf*
|
!/dl/datconf*
|
||||||
!/dl/mt79*
|
!/dl/mt79*
|
||||||
!/dl/warp*
|
!/dl/warp*
|
||||||
|
|
||||||
|
.config-*
|
||||||
@@ -61,6 +61,8 @@ CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_ruijie_rg-x30e-pro-firmware2=y
|
|||||||
CONFIG_TARGET_DEVICE_PACKAGES_mediatek_mt7981_DEVICE_ruijie_rg-x30e-pro-firmware2=""
|
CONFIG_TARGET_DEVICE_PACKAGES_mediatek_mt7981_DEVICE_ruijie_rg-x30e-pro-firmware2=""
|
||||||
CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_ruijie_rg-x30e-pro-stock=y
|
CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_ruijie_rg-x30e-pro-stock=y
|
||||||
CONFIG_TARGET_DEVICE_PACKAGES_mediatek_mt7981_DEVICE_ruijie_rg-x30e-pro-stock=""
|
CONFIG_TARGET_DEVICE_PACKAGES_mediatek_mt7981_DEVICE_ruijie_rg-x30e-pro-stock=""
|
||||||
|
CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_sn_r1=y
|
||||||
|
CONFIG_TARGET_DEVICE_PACKAGES_mediatek_mt7981_DEVICE_sn_r1=""
|
||||||
CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_xiaomi_mi-router-ax3000t=y
|
CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_xiaomi_mi-router-ax3000t=y
|
||||||
CONFIG_TARGET_DEVICE_PACKAGES_mediatek_mt7981_DEVICE_xiaomi_mi-router-ax3000t=""
|
CONFIG_TARGET_DEVICE_PACKAGES_mediatek_mt7981_DEVICE_xiaomi_mi-router-ax3000t=""
|
||||||
CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_xiaomi_mi-router-ax3000t-stock=y
|
CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_xiaomi_mi-router-ax3000t-stock=y
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ case "$board" in
|
|||||||
cmcc,rax3000m-emmc |\
|
cmcc,rax3000m-emmc |\
|
||||||
cmcc,xr30-emmc |\
|
cmcc,xr30-emmc |\
|
||||||
glinet,gl-mt6000 |\
|
glinet,gl-mt6000 |\
|
||||||
jdcloud,re-cp-03)
|
jdcloud,re-cp-03 |\
|
||||||
|
philips,hy3000 |\
|
||||||
|
sn,r1)
|
||||||
env_dev=$(find_mmc_part "u-boot-env")
|
env_dev=$(find_mmc_part "u-boot-env")
|
||||||
[ -n "$env_dev" ] && ubootenv_add_uci_config "$env_dev" "0" "0x80000"
|
[ -n "$env_dev" ] && ubootenv_add_uci_config "$env_dev" "0" "0x80000"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -765,6 +765,8 @@ setup_model()
|
|||||||
newland,nl-wr9103 |\
|
newland,nl-wr9103 |\
|
||||||
nradio,wt9103 |\
|
nradio,wt9103 |\
|
||||||
ruijie,rg-x30e* |\
|
ruijie,rg-x30e* |\
|
||||||
|
philips,hy3000 |\
|
||||||
|
sn,r1 |\
|
||||||
*7981*)
|
*7981*)
|
||||||
MT7981_whnat $num_of_wifi $usbnet
|
MT7981_whnat $num_of_wifi $usbnet
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -0,0 +1,218 @@
|
|||||||
|
/dts-v1/;
|
||||||
|
#include "mt7981.dtsi"
|
||||||
|
|
||||||
|
/ {
|
||||||
|
model = "SN R1";
|
||||||
|
compatible = "sn,r1", "mediatek,mt7981";
|
||||||
|
|
||||||
|
chosen {
|
||||||
|
bootargs = "console=ttyS0,115200n1 loglevel=8 \
|
||||||
|
earlycon=uart8250,mmio32,0x11002000 \
|
||||||
|
root=PARTLABEL=rootfs rootfstype=squashfs,f2fs";
|
||||||
|
};
|
||||||
|
|
||||||
|
aliases {
|
||||||
|
led-boot = &status_red_led;
|
||||||
|
led-failsafe = &status_red_led;
|
||||||
|
led-running = &status_blue_led;
|
||||||
|
led-upgrade = &status_yellow_led;
|
||||||
|
};
|
||||||
|
|
||||||
|
leds {
|
||||||
|
compatible = "gpio-leds";
|
||||||
|
|
||||||
|
status_blue_led: led-0 {
|
||||||
|
label = "blue:status";
|
||||||
|
gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
status_yellow_led: led-1 {
|
||||||
|
label = "yellow:status";
|
||||||
|
gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
status_red_led: led-2 {
|
||||||
|
label = "red:status";
|
||||||
|
gpios = <&pio 13 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
gpio-keys {
|
||||||
|
compatible = "gpio-keys";
|
||||||
|
|
||||||
|
reset {
|
||||||
|
label = "reset";
|
||||||
|
linux,code = <KEY_RESTART>;
|
||||||
|
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
|
||||||
|
};
|
||||||
|
|
||||||
|
wps {
|
||||||
|
label = "wps";
|
||||||
|
gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
|
||||||
|
linux,code = <BTN_9>;
|
||||||
|
linux,input-type = <EV_SW>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
memory {
|
||||||
|
reg = <0 0x40000000 0 0x10000000>;
|
||||||
|
};
|
||||||
|
|
||||||
|
reg_3p3v: regulator-3p3v {
|
||||||
|
compatible = "regulator-fixed";
|
||||||
|
regulator-name = "fixed-3.3V";
|
||||||
|
regulator-min-microvolt = <3300000>;
|
||||||
|
regulator-max-microvolt = <3300000>;
|
||||||
|
regulator-boot-on;
|
||||||
|
regulator-always-on;
|
||||||
|
};
|
||||||
|
|
||||||
|
gsw: gsw@0 {
|
||||||
|
compatible = "mediatek,mt753x";
|
||||||
|
mediatek,ethsys = <ðsys>;
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&uart0 {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&watchdog {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
ð {
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
gmac0: mac@0 {
|
||||||
|
compatible = "mediatek,eth-mac";
|
||||||
|
reg = <0>;
|
||||||
|
phy-mode = "2500base-x";
|
||||||
|
|
||||||
|
fixed-link {
|
||||||
|
speed = <2500>;
|
||||||
|
full-duplex;
|
||||||
|
pause;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
gmac1: mac@1 {
|
||||||
|
compatible = "mediatek,eth-mac";
|
||||||
|
reg = <1>;
|
||||||
|
phy-mode = "gmii";
|
||||||
|
phy-handle = <&phy0>;
|
||||||
|
};
|
||||||
|
|
||||||
|
mdio: mdio-bus {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
|
||||||
|
phy0: ethernet-phy@0 {
|
||||||
|
compatible = "ethernet-phy-id03a2.9461";
|
||||||
|
reg = <0>;
|
||||||
|
phy-mode = "gmii";
|
||||||
|
nvmem-cells = <&phy_calibration>;
|
||||||
|
nvmem-cell-names = "phy-cal-data";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&gsw {
|
||||||
|
mediatek,mdio = <&mdio>;
|
||||||
|
mediatek,portmap = "wllll";
|
||||||
|
mediatek,mdio_master_pinmux = <0>;
|
||||||
|
reset-gpios = <&pio 39 0>;
|
||||||
|
interrupt-parent = <&pio>;
|
||||||
|
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
port5: port@5 {
|
||||||
|
compatible = "mediatek,mt753x-port";
|
||||||
|
reg = <5>;
|
||||||
|
phy-mode = "sgmii";
|
||||||
|
|
||||||
|
fixed-link {
|
||||||
|
speed = <2500>;
|
||||||
|
full-duplex;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
port6: port@6 {
|
||||||
|
compatible = "mediatek,mt753x-port";
|
||||||
|
mediatek,ssc-on;
|
||||||
|
reg = <6>;
|
||||||
|
phy-mode = "sgmii";
|
||||||
|
|
||||||
|
fixed-link {
|
||||||
|
speed = <2500>;
|
||||||
|
full-duplex;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&hnat {
|
||||||
|
mtketh-wan = "eth0.2";
|
||||||
|
mtketh-ppd = "eth0.1";
|
||||||
|
mtketh-lan = "eth0";
|
||||||
|
mtketh-max-gmac = <1>;
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&mmc0 {
|
||||||
|
bus-width = <8>;
|
||||||
|
cap-mmc-highspeed;
|
||||||
|
max-frequency = <52000000>;
|
||||||
|
no-sd;
|
||||||
|
no-sdio;
|
||||||
|
non-removable;
|
||||||
|
pinctrl-names = "default", "state_uhs";
|
||||||
|
pinctrl-0 = <&mmc0_pins_default>;
|
||||||
|
pinctrl-1 = <&mmc0_pins_uhs>;
|
||||||
|
vmmc-supply = <®_3p3v>;
|
||||||
|
non-removable;
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&spi1 {
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&spic_pins>;
|
||||||
|
status = "disabled";
|
||||||
|
};
|
||||||
|
|
||||||
|
&pio {
|
||||||
|
spic_pins: spi1-pins {
|
||||||
|
mux {
|
||||||
|
function = "spi";
|
||||||
|
groups = "spi1_1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mmc0_pins_default: mmc0-pins-default {
|
||||||
|
mux {
|
||||||
|
function = "flash";
|
||||||
|
groups = "emmc_45";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mmc0_pins_uhs: mmc0-pins-uhs {
|
||||||
|
mux {
|
||||||
|
function = "flash";
|
||||||
|
groups = "emmc_45";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
pcie_pins: pcie-pins {
|
||||||
|
mux {
|
||||||
|
function = "pcie";
|
||||||
|
groups = "pcie_pereset", "pcie_clk", "pcie_wake";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&pcie {
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&pcie_pins>;
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
@@ -821,3 +821,15 @@ define Device/routerich_ax3000
|
|||||||
DEVICE_PACKAGES := $(MT7981_USB_PKGS)
|
DEVICE_PACKAGES := $(MT7981_USB_PKGS)
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += routerich_ax3000
|
TARGET_DEVICES += routerich_ax3000
|
||||||
|
|
||||||
|
define Device/sn_r1
|
||||||
|
DEVICE_VENDOR := SN
|
||||||
|
DEVICE_MODEL := R1
|
||||||
|
DEVICE_DTS := mt7981-sn-r1
|
||||||
|
DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
|
||||||
|
SUPPORTED_DEVICES := sn,r1
|
||||||
|
DEVICE_PACKAGES := f2fsck losetup mkf2fs f2fs-tools kmod-fs-f2fs kmod-mmc \
|
||||||
|
luci-app-samba4 e2fsprogs kmod-nvme mmc-utils
|
||||||
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||||
|
endef
|
||||||
|
TARGET_DEVICES += sn_r1
|
||||||
|
|||||||
@@ -103,6 +103,11 @@ mediatek_setup_interfaces()
|
|||||||
ucidef_add_switch "switch0" \
|
ucidef_add_switch "switch0" \
|
||||||
"0:lan:1" "2:lan:2" "3:lan:3" "4:wan" "6u@eth0" "5u@eth1"
|
"0:lan:1" "2:lan:2" "3:lan:3" "4:wan" "6u@eth0" "5u@eth1"
|
||||||
;;
|
;;
|
||||||
|
sn,r1)
|
||||||
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
||||||
|
ucidef_add_switch "switch0" \
|
||||||
|
"1:lan" "2:lan" "3:lan" "4:lan:4" "0:wan" "6t@eth0"
|
||||||
|
;;
|
||||||
ikuai,q3000 |\
|
ikuai,q3000 |\
|
||||||
ruijie,rg-x30e*)
|
ruijie,rg-x30e*)
|
||||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan
|
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan
|
||||||
@@ -280,6 +285,21 @@ mediatek_setup_macs()
|
|||||||
echo "MacAddress=$b1mac" >> ${b1dat}
|
echo "MacAddress=$b1mac" >> ${b1dat}
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
sn,r1)
|
||||||
|
lan_mac=$(mmc_get_mac_binary factory 0x2a)
|
||||||
|
wan_mac=$(mmc_get_mac_binary factory 0x24)
|
||||||
|
label_mac=$wan_mac
|
||||||
|
local b0dat="$(l1dat if2dat ra0)"
|
||||||
|
local b1dat="$(l1dat if2dat rax0)"
|
||||||
|
if [ -f ${b0dat} ] && ! grep -q "MacAddress=" ${b0dat}; then
|
||||||
|
local b0mac="$(macaddr_add $lan_mac 2)"
|
||||||
|
echo "MacAddress=$b0mac" >> ${b0dat}
|
||||||
|
fi
|
||||||
|
if [ -f ${b1dat} ] && ! grep -q "MacAddress=" ${b1dat}; then
|
||||||
|
local b1mac="$(macaddr_add $lan_mac 3)"
|
||||||
|
echo "MacAddress=$b1mac" >> ${b1dat}
|
||||||
|
fi
|
||||||
|
;;
|
||||||
ikuai,q3000)
|
ikuai,q3000)
|
||||||
wan_mac=$(mtd_get_mac_binary $part_name 0x10048)
|
wan_mac=$(mtd_get_mac_binary $part_name 0x10048)
|
||||||
lan_mac=$(macaddr_add $wan_mac 1)
|
lan_mac=$(macaddr_add $wan_mac 1)
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ do_extract_caldata() {
|
|||||||
case $(board_name) in
|
case $(board_name) in
|
||||||
cmcc,xr30-emmc |\
|
cmcc,xr30-emmc |\
|
||||||
cmcc,rax3000m-emmc |\
|
cmcc,rax3000m-emmc |\
|
||||||
philips,hy3000)
|
philips,hy3000 |\
|
||||||
|
sn,r1)
|
||||||
FIRMWARE=MT7981_iPAiLNA_EEPROM.bin
|
FIRMWARE=MT7981_iPAiLNA_EEPROM.bin
|
||||||
caldata_validate && exit 0
|
caldata_validate && exit 0
|
||||||
caldata_extract_mmc "factory" 0x0 0x1000
|
caldata_extract_mmc "factory" 0x0 0x1000
|
||||||
|
|||||||
@@ -220,6 +220,7 @@ platform_do_upgrade() {
|
|||||||
cmcc,rax3000m-emmc |\
|
cmcc,rax3000m-emmc |\
|
||||||
cmcc,xr30-emmc |\
|
cmcc,xr30-emmc |\
|
||||||
philips,hy3000 |\
|
philips,hy3000 |\
|
||||||
|
sn,r1 |\
|
||||||
*emmc*)
|
*emmc*)
|
||||||
CI_KERNPART="kernel"
|
CI_KERNPART="kernel"
|
||||||
CI_ROOTPART="rootfs"
|
CI_ROOTPART="rootfs"
|
||||||
@@ -271,6 +272,7 @@ platform_check_image() {
|
|||||||
newland,nl-wr9103 |\
|
newland,nl-wr9103 |\
|
||||||
nradio,wt9103 |\
|
nradio,wt9103 |\
|
||||||
philips,hy3000 |\
|
philips,hy3000 |\
|
||||||
|
sn,r1 |\
|
||||||
*snand* |\
|
*snand* |\
|
||||||
*emmc* |\
|
*emmc* |\
|
||||||
routerich,ax3000)
|
routerich,ax3000)
|
||||||
|
|||||||
Reference in New Issue
Block a user