ramips: sync upstream source code

This commit is contained in:
AmadeusGhost 2020-03-14 12:15:16 +08:00
parent 7a69201b43
commit eff2d6c4a1
7 changed files with 201 additions and 3 deletions

View File

@ -0,0 +1,141 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "ubnt,unifi-nanohd", "mediatek,mt7621-soc";
model = "Ubiquiti UniFi nanoHD";
aliases {
led-boot = &led_white;
led-failsafe = &led_white;
led-running = &led_blue;
led-upgrade = &led_blue;
label-mac-device = &ethernet;
};
chosen {
bootargs = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
led_blue: dome_blue {
label = "nanohd:blue:dome";
gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
};
led_white: dome_white {
label = "nanohd:white:dome";
gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "mx25l25635f", "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x60000>;
read-only;
};
partition@60000 {
label = "u-boot-env";
reg = <0x60000 0x10000>;
read-only;
};
factory: partition@70000 {
label = "factory";
reg = <0x70000 0x10000>;
read-only;
};
eeprom: partition@80000 {
label = "eeprom";
reg = <0x80000 0x10000>;
read-only;
};
partition@90000 {
label = "bs";
reg = <0x90000 0x10000>;
};
partition@a0000 {
label = "cfg";
reg = <0xa0000 0x100000>;
read-only;
};
partition@1a0000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x1a0000 0xf30000>;
};
partition@10d0000 {
label = "kernel1";
reg = <0x10d0000 0xf30000>;
read-only;
};
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
reg = <0x0 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0000>;
};
};
&pcie1 {
wifi@0,0 {
reg = <0x0 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
};
};
&ethernet {
mtd-mac-address = <&eeprom 0x0>;
};
&state_default {
gpio {
ralink,group = "i2c", "uart2";
ralink,function = "gpio";
};
};

View File

@ -0,0 +1,36 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7628an_iptime.dtsi"
/ {
compatible = "totolink,a3", "mediatek,mt7628an-soc";
model = "TOTOLINK A3";
aliases {
led-boot = &led_cpu;
led-failsafe = &led_cpu;
led-running = &led_cpu;
led-upgrade = &led_cpu;
};
leds {
compatible = "gpio-leds";
led_cpu: cpu {
label = "a3:blue:cpu";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
wlan {
label = "a3:blue:wlan";
gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
};
};
&esw {
mediatek,portmap = <0x3e>;
mediatek,portdisable = <0x32>;
};

View File

@ -611,6 +611,7 @@ define Device/netgear_ex2700
DEVICE_VENDOR := NETGEAR
DEVICE_MODEL := EX2700
SUPPORTED_DEVICES += ex2700
DEFAULT := n
endef
TARGET_DEVICES += netgear_ex2700

View File

@ -814,6 +814,14 @@ define Device/ubiquiti_edgerouterx-sfp
endef
TARGET_DEVICES += ubiquiti_edgerouterx-sfp
define Device/ubnt_unifi-nanohd
DEVICE_VENDOR := Ubiquiti
DEVICE_MODEL := UniFi nanoHD
DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615e wpad-openssl
IMAGE_SIZE := 15552k
endef
TARGET_DEVICES += ubnt_unifi-nanohd
define Device/unielec_u7621-06-16m
IMAGE_SIZE := 16064k
DEVICE_VENDOR := UniElec

View File

@ -230,6 +230,15 @@ define Device/tama_w06
endef
TARGET_DEVICES += tama_w06
define Device/totolink_a3
IMAGE_SIZE := 7936k
UIMAGE_NAME := za3
DEVICE_VENDOR := TOTOLINK
DEVICE_MODEL := A3
DEVICE_PACKAGES := kmod-mt76x2
endef
TARGET_DEVICES += totolink_a3
define Device/totolink_lr1200
IMAGE_SIZE := 7872k
DEVICE_VENDOR := TOTOLINK

View File

@ -135,7 +135,8 @@ ramips_setup_interfaces()
;;
netgear,ex6150|\
tplink,re350-v1|\
tplink,re650-v1)
tplink,re650-v1|\
ubnt,unifi-nanohd)
ucidef_add_switch "switch0" \
"0:lan" "6@eth0"
;;

View File

@ -72,7 +72,8 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "4:wan" "6@eth0"
;;
iptime,a3)
iptime,a3|\
totolink,a3)
ucidef_add_switch "switch0" \
"2:lan:2" "3:lan:1" "0:wan" "6@eth0"
;;
@ -166,7 +167,8 @@ ramips_setup_macs()
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
iptime,a3|\
iptime,a604m)
iptime,a604m|\
totolink,a3)
wan_mac=$(mtd_get_mac_binary u-boot 0x1fc40)
;;
mediatek,linkit-smart-7688|\