ramips: mt7621: add support for Netgear R6800

This commit is contained in:
LEAN-ESX 2019-12-13 08:25:54 -08:00
parent ca61310f1f
commit 7ea08e97fe
493 changed files with 12007 additions and 7256 deletions

View File

@ -109,10 +109,13 @@ endef
# append a fake/empty uImage header, to fool bootloaders rootfs integrity check
# for example
define Build/append-uImage-fakehdr
$(eval type=$(word 1,$(1)))
$(eval magic=$(word 2,$(1)))
touch $@.fakehdr
$(STAGING_DIR_HOST)/bin/mkimage \
-A $(LINUX_KARCH) -O linux -T $(1) -C none \
-n '$(VERSION_DIST) fake $(1)' \
-A $(LINUX_KARCH) -O linux -T $(type) -C none \
-n '$(VERSION_DIST) fake $(type)' \
$(if $(magic),-M $(magic)) \
-d $@.fakehdr \
-s \
$@.fakehdr
@ -131,25 +134,18 @@ define Build/tplink-safeloader
$(if $(findstring sysupgrade,$(word 1,$(1))),-S) && mv $@.new $@ || rm -f $@
endef
define Build/mksercommfw
-$(STAGING_DIR_HOST)/bin/mksercommfw \
$@ \
$(KERNEL_OFFSET) \
$(HWID) \
$(HWVER) \
$(SWVER)
endef
define Build/append-dtb
cat $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb >> $@
endef
define Build/install-dtb
$(call locked, \
$(foreach dts,$(DEVICE_DTS), \
$(CP) \
$(DTS_DIR)/$(dts).dtb \
$(BIN_DIR)/$(IMG_PREFIX)-$(dts).dtb; \
), \
install-dtb-$(IMG_PREFIX) \
)
endef
@ -178,6 +174,16 @@ define Build/gzip
@mv $@.new $@
endef
define Build/zip
mkdir $@.tmp
mv $@ $@.tmp/$(1)
zip -j -X \
$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
$@ $@.tmp/$(if $(1),$(1),$@)
rm -rf $@.tmp
endef
define Build/jffs2
rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 && \
mkdir -p $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$$(dirname $(1)) && \
@ -230,8 +236,7 @@ define Build/append-uboot
endef
define Build/pad-to
dd if=$@ of=$@.new bs=$(1) conv=sync
mv $@.new $@
$(call Image/pad-to,$@,$(1))
endef
define Build/pad-extra
@ -297,14 +302,14 @@ endef
define Build/qsdk-ipq-factory-nand
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
$@.its ubi $@
mkimage -f $@.its $@.new
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
@mv $@.new $@
endef
define Build/qsdk-ipq-factory-nor
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
$@.its hlos $(IMAGE_KERNEL) rootfs $(IMAGE_ROOTFS)
mkimage -f $@.its $@.new
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
@mv $@.new $@
endef
@ -355,12 +360,14 @@ json_quote=$(subst ','\'',$(subst ",\",$(1)))
metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))"))))
metadata_json = \
'{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \
"metadata_version": "1.0", \
"supported_devices":[$(call metadata_devices,$(1))], \
"version": { \
"dist": "$(call json_quote,$(VERSION_DIST))", \
"version": "$(call json_quote,$(VERSION_NUMBER))", \
"revision": "$(call json_quote,$(REVISION))", \
"board": "$(call json_quote,$(BOARD))" \
"target": "$(call json_quote,$(TARGETID))", \
"board": "$(call json_quote,$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)))" \
} \
}'

View File

@ -30,7 +30,7 @@ param_get_default = $(firstword $(call param_get,$(1),$(2)) $(3))
param_mangle = $(subst $(space),_,$(strip $(1)))
param_unmangle = $(subst _,$(space),$(1))
mkfs_packages_id = $(shell echo $(sort $(1)) | mkhash md5 | head -c 8)
mkfs_packages_id = $(shell echo $(sort $(1)) | mkhash md5 | cut -b1-8)
mkfs_target_dir = $(if $(call param_get,pkg,$(1)),$(KDIR)/target-dir-$(call param_get,pkg,$(1)),$(TARGET_DIR))
KDIR=$(KERNEL_BUILD_DIR)
@ -44,6 +44,7 @@ IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERS
IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
IMG_ROOTFS:=$(IMG_PREFIX)-rootfs
IMG_COMBINED:=$(IMG_PREFIX)-combined
IMG_PART_SIGNATURE:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | mkhash md5 | cut -b1-8)
MKFS_DEVTABLE_OPT := -D $(INCLUDE_DIR)/device_table.txt
@ -242,7 +243,7 @@ define Image/mkfs/squashfs
$(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
-nopad -noappend -root-owned \
-comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
-processors 16
-processors 1
endef
# $(1): board name
@ -287,7 +288,7 @@ define Image/mkfs/ubifs
endef
define Image/mkfs/ext4
$(STAGING_DIR_HOST)/bin/make_ext4fs \
$(STAGING_DIR_HOST)/bin/make_ext4fs -L rootfs \
-l $(ROOTFS_PARTSIZE) -b $(CONFIG_TARGET_EXT4_BLOCKSIZE) \
$(if $(CONFIG_TARGET_EXT4_RESERVED_PCT),-m $(CONFIG_TARGET_EXT4_RESERVED_PCT)) \
$(if $(CONFIG_TARGET_EXT4_JOURNAL),,-J) \
@ -597,6 +598,7 @@ define Device/Build/image
SUPPORTED_DEVICES="$(SUPPORTED_DEVICES)" \
$(TOPDIR)/scripts/json_add_image_info.py \
)
endef
define Device/Build/artifact

View File

@ -1230,3 +1230,18 @@ define KernelPackage/it87-wdt/description
endef
$(eval $(call KernelPackage,it87-wdt))
define KernelPackage/pinctrl-sx150x
SUBMENU:=$(OTHER_MENU)
TITLE:=Semtech SX150x-series I2C GPIO expanders
DEPENDS:= +kmod-i2c-core @!LINUX_4_9
KCONFIG:=CONFIG_PINCTRL_SX150X=y
AUTOLOAD:=$(call AutoLoad,40,pinctrl-sx150x)
endef
define KernelPackage/pinctrl-sx150x/description
This driver adds support for Semtech SX150x-series I2C GPIO expanders.
endef
$(eval $(call KernelPackage,pinctrl-sx150x))

26
scripts/functions.sh Normal file
View File

@ -0,0 +1,26 @@
#!/bin/sh
get_magic_word() {
dd if=$1 bs=4 count=1 2>/dev/null | od -A n -N 4 -t x1 | tr -d ' '
}
get_fs_type() {
local magic_word="$(get_magic_word "$1")"
case "$magic_word" in
"3118"*)
echo "ubifs"
;;
"68737173")
echo "squashfs"
;;
*)
echo "unknown"
;;
esac
}
round_up() {
echo "$(((($1 + ($2 - 1))/ $2) * $2))"
}

View File

@ -1,5 +1,7 @@
#!/bin/sh
. $TOPDIR/scripts/functions.sh
part=""
ubootenv=""
ubinize_param=""
@ -7,16 +9,7 @@ kernel=""
rootfs=""
outfile=""
err=""
get_magic_word() {
dd if=$1 bs=2 count=1 2>/dev/null | hexdump -v -n 2 -e '1/1 "%02x"'
}
is_ubifs() {
if [ "$( get_magic_word $1 )" = "3118" ]; then
echo "1"
fi
}
ubinize_seq=""
ubivol() {
volid=$1
@ -31,7 +24,7 @@ ubivol() {
echo "vol_name=$name"
if [ "$image" ]; then
echo "image=$image"
[ -n "$size" ] && echo "vol_size=${size}MiB"
[ -n "$size" ] && echo "vol_size=${size}"
else
echo "vol_size=1MiB"
fi
@ -42,7 +35,10 @@ ubivol() {
ubilayout() {
local vol_id=0
local root_is_ubifs="$( is_ubifs "$2" )"
local rootsize=
local autoresize=
local rootfs_type="$( get_fs_type "$2" )"
if [ "$1" = "ubootenv" ]; then
ubivol $vol_id ubootenv
vol_id=$(( $vol_id + 1 ))
@ -62,16 +58,34 @@ ubilayout() {
size="$part"
ubivol $vol_id "$name" "$image" "" "$size"
ubivol $vol_id "$name" "$image" "" "${size}MiB"
vol_id=$(( $vol_id + 1 ))
done
if [ "$3" ]; then
ubivol $vol_id kernel "$3"
vol_id=$(( $vol_id + 1 ))
fi
ubivol $vol_id rootfs "$2" $root_is_ubifs
case "$rootfs_type" in
"ubifs")
autoresize=1
;;
"squashfs")
# squashfs uses 1k block size, ensure we do not
# violate that
rootsize="$( round_up "$( stat -c%s "$2" )" 1024 )"
;;
esac
ubivol $vol_id rootfs "$2" "$autoresize" "$rootsize"
vol_id=$(( $vol_id + 1 ))
[ "$root_is_ubifs" ] || ubivol $vol_id rootfs_data "" 1
[ "$rootfs_type" = "ubifs" ] || ubivol $vol_id rootfs_data "" 1
}
set_ubinize_seq() {
if [ -n "$SOURCE_DATE_EPOCH" ] ; then
ubinize_seq="-Q $SOURCE_DATE_EPOCH"
fi
}
while [ "$1" ]; do
@ -130,8 +144,9 @@ if [ -z "$ubinizecfg" ]; then
fi
ubilayout "$ubootenv" "$rootfs" "$kernel" > "$ubinizecfg"
set_ubinize_seq
cat "$ubinizecfg"
ubinize -o "$outfile" $ubinize_param "$ubinizecfg"
ubinize $ubinize_seq -o "$outfile" $ubinize_param "$ubinizecfg"
err="$?"
[ ! -e "$outfile" ] && err=2
rm "$ubinizecfg"

View File

@ -1,462 +0,0 @@
#!/bin/sh
. /lib/functions/uci-defaults.sh
set_wifi_led() {
ucidef_set_led_netdev "wifi_led" "wifi" "${1}" "${2:-wlan0}"
}
board=$(board_name)
boardname="${board##*,}"
board_config_update
case $board in
3g-6200n|\
br-6475nd|\
mzk-w300nh2)
set_wifi_led "$boardname:amber:wlan"
;;
3g-6200nl|\
air3gii|\
hilink,hlk-7628n|\
mr-102n|\
skylab,skw92a|\
wnce2001|\
zbt-we2026)
set_wifi_led "$boardname:green:wlan"
;;
ai-br100)
ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" "eth0.2"
set_wifi_led "$boardname:blue:wlan"
;;
alfa-network,ac1200rm)
set_wifi_led "$boardname:green:wlan2g" "wlan1"
;;
alfa-network,awusfree1|\
edimax,br-6478ac-v2)
set_wifi_led "$boardname:blue:wlan"
;;
alfa-network,r36m-e4g)
ucidef_set_led_netdev "4g" "4g" "$boardname:orange:4g" "wwan0"
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x8"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
;;
alfa-network,tube-e4g)
ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0"
ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" "eth0"
;;
all0256n-4M|\
all0256n-8M)
ucidef_set_rssimon "wlan0" "200000" "1"
ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6"
ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5"
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
set_wifi_led "rt2800pci-phy0::radio"
;;
ar670w|\
ar725w|\
awapn2403)
set_wifi_led "rt2800soc-phy0::radio"
;;
asl26555-8M|\
asl26555-16M)
ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
set_wifi_led "asl26555:green:wlan"
;;
bdcom,wap2100-sk|\
hiwifi,hc5861b)
set_wifi_led "$boardname:green:wlan2g"
;;
belkin,f9k1109v1)
set_usb_led "$boardname:green:usb1"
ucidef_set_led_netdev "lan" "lan" "$boardname:blue:wps" "eth0"
;;
broadway)
set_wifi_led "$boardname:red:wps_active"
;;
c108)
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
ucidef_set_led_netdev "modem" "modem" "$boardname:green:modem" "wwan0"
;;
c20i)
ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01"
ucidef_set_led_wlan "wlan" "wlan" "$boardname:blue:wlan" "phy0radio"
;;
c50)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" wlan1
set_wifi_led "$boardname:green:wlan5g"
;;
cf-wr800n)
ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1
set_wifi_led "$boardname:white:wifi"
;;
cudy,wr1000)
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"
ucidef_set_led_switch "lan1" "lan1" "$boardname:blue:lan1" "switch0" "0x08"
ucidef_set_led_switch "lan2" "lan2" "$boardname:blue:lan2" "switch0" "0x04"
;;
d240|\
mlw221|\
mlwg2|\
rakwireless,rak633|\
rt-ac51u)
set_wifi_led "$boardname:blue:wifi"
;;
dcs-930l-b1)
ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps"
;;
dir-300-b1|\
dir-300-b7|\
dir-320-b1|\
dir-600-b1|\
dir-610-a1|\
dir-615-d|\
dir-615-h1|\
dir-620-a1|\
esr-9753|\
hlk-rm04|\
kn|\
nbg-419n2|\
sl-r7205|\
v11st-fe|\
w306r-v20|\
w502u|\
wt1520-4M|\
wt1520-8M|\
zyxel,keenetic-start)
set_wifi_led "rt2800pci-phy0::radio"
;;
dir-620-d1|\
dlink,dwr-116-a1|\
head-weblink,hdrm200|\
kn_rc|\
kn_rf|\
kng_rc|\
mzk-ex300np|\
oy-0001|\
tew-714tru|\
zbt-wr8305rt)
set_wifi_led "$boardname:green:wifi"
;;
dlink,dwr-118-a1)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1f"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x20"
set_wifi_led "$boardname:green:wlan2g" "wlan1"
;;
dlink,dwr-118-a2)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0e"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
set_wifi_led "$boardname:green:wlan2g" "wlan1"
;;
dlink,dwr-921-c1|\
dlink,dwr-922-e2)
set_wifi_led "$boardname:green:wifi"
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f"
ucidef_set_led_netdev "signalstrength" "signalstrength" "$boardname:green:sigstrength" "wwan0" "link"
ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0" "tx rx"
;;
dir-860l-b1)
ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2"
;;
ex2700|\
wn3000rpv3)
set_wifi_led "$boardname:green:router"
;;
ex3700)
ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$boardname:green:router" "wlan0"
ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$boardname:green:device" "wlan1"
;;
f5d8235-v1)
set_wifi_led "$boardname:blue:wireless"
;;
fonera20n|\
tiny-ac)
set_wifi_led "$boardname:orange:wifi"
;;
gnubee,gb-pc1|\
gnubee,gb-pc2)
ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x01"
ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x10"
;;
gl-mt300a|\
gl-mt300n|\
gl-mt750)
set_wifi_led "$boardname:wlan"
;;
gl-mt300n-v2)
set_wifi_led "$boardname:red:wlan"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x1"
;;
hc5661|\
hc5661a)
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
set_wifi_led "$boardname:blue:wlan2g"
;;
hc5761|\
hc5861)
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "wlan0"
ucidef_set_led_netdev "wifi2g" "wifi2g" "$boardname:blue:wlan2g" "wlan1"
;;
hg255d)
set_wifi_led "$boardname:green:wlan"
ucidef_set_led_netdev "internet" "internet" "$boardname:green:internet" "eth0.2"
;;
hpm)
ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
set_wifi_led "$boardname:green:wifi"
;;
ht-tm02)
ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:lan" "eth0"
set_wifi_led "$boardname:blue:wlan"
;;
iodata,wn-ac1167gr|\
iodata,wn-ac733gr3)
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$boardname:green:wlan5g" "phy0radio"
ucidef_set_led_wlan "wlan2g" "WLAN2G" "$boardname:green:wlan2g" "phy1radio"
;;
kimax,u35wf)
set_wifi_led "$boardname:blue:wifi"
ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
;;
lava,lr-25g001)
ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "wlan1"
ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:green:wlan5g" "wlan0"
;;
linkits7688)
ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt"
;;
m2m)
set_wifi_led "$boardname:blue:wifi"
ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:wan" "eth0"
;;
mikrotik,rbm11g)
ucidef_set_rssimon "wlan0" "200000" "1"
ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100"
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan0" "20" "100"
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssi2" "wlan0" "40" "100"
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssi3" "wlan0" "60" "100"
ucidef_set_led_rssi "rssiveryhigh" "RSSIVERYHIGH" "$boardname:green:rssi4" "wlan0" "80" "100"
;;
miniembplug)
set_wifi_led "$boardname:red:wlan"
;;
mr200)
ucidef_set_led_netdev "lan" "lan" "$boardname:white:lan" "eth0.1"
ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "usb0"
set_wifi_led "$boardname:white:wlan"
;;
mtc,wr1201)
ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x0f"
;;
mzk-ex750np|\
zbtlink,zbt-we826-e)
set_wifi_led "$boardname:red:wifi"
;;
netgear,r6120)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "phy0tpt"
;;
gehua,ghl-r-001|\
pbr-m1)
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
;;
d-team,newifi-d2)
ucidef_set_led_switch "internet" "internet" "$boardname:amber:internet" "switch0" "0x10"
ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0"
ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1"
;;
psg1208)
set_wifi_led "$boardname:white:wlan2g"
;;
px-4885-4M|\
px-4885-8M)
set_wifi_led "px-4885:orange:wifi"
;;
r6220|\
netgear,r6350|\
wndr3700v5)
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
;;
re350-v1)
ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0"
ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$boardname:blue:wifi5G" "wlan1"
ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "eth0" "tx rx"
ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x01"
;;
rp-n53)
ucidef_set_led_netdev "eth" "Network" "$boardname:white:back" "eth0"
set_wifi_led "$boardname:blue:wifi"
;;
rt-n12p)
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" eth0.1
ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" eth0.2
set_wifi_led "$boardname:green:air"
;;
rt-n14u)
ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" eth0.1
ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" eth0.2
set_wifi_led "$boardname:blue:air"
;;
tama,w06)
ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
;;
tl-wr840n-v4)
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
;;
tl-wr841n-v13)
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x2"
ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x4"
ucidef_set_led_switch "lan3" "lan3" "$boardname:green:lan3" "switch0" "0x8"
ucidef_set_led_switch "lan4" "lan4" "$boardname:green:lan4" "switch0" "0x10"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
;;
tplink,c2-v1)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch1" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch1" "0x01"
set_wifi_led "$boardname:green:wlan"
;;
tplink,c20-v1)
ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01"
ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:blue:wlan2g" "wlan0"
;;
tplink,c20-v4)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" "wlan0"
;;
tplink,c50-v3|\
tplink,c50-v4)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan2g" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "wlan5g" "$boardname:green:wlan5g" "phy1tpt"
;;
tplink,tl-wa801nd-v5)
ucidef_set_led_wlan "wlan" "wlan" "$boardname:green:wlan" "phy0tpt"
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
;;
tplink,tl-mr3020-v3)
set_wifi_led "$boardname:green:wlan"
ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
;;
tplink,tl-mr3420-v5|\
tplink,tl-wr842n-v5)
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
;;
tplink,tl-wr902ac-v3)
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x10"
;;
u25awf-h1)
set_wifi_led "u25awf:red:wifi"
ucidef_set_led_netdev "eth" "eth" "u25awf:green:lan" "eth0"
;;
u7628-01-128M-16M)
ucidef_set_led_switch "lan1" "lan1" "u7628-01:green:lan1" "switch0" "0x2"
ucidef_set_led_switch "lan2" "lan2" "u7628-01:green:lan2" "switch0" "0x4"
ucidef_set_led_switch "lan3" "lan3" "u7628-01:green:lan3" "switch0" "0x8"
ucidef_set_led_switch "lan4" "lan4" "u7628-01:green:lan4" "switch0" "0x10"
ucidef_set_led_switch "wan" "wan" "u7628-01:green:wan" "switch0" "0x01"
set_wifi_led "u7628-01:green:wlan"
;;
vocore-8M|\
vocore-16M)
ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
;;
wavlink,wl-wn570ha1)
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
ucidef_set_rssimon "wlan0" "200000" "1"
ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan0" "1" "49"
ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan0" "50" "84"
ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan0" "85" "100"
set_wifi_led "$boardname:green:wifi"
;;
wavlink,wl-wn575a3)
ucidef_set_rssimon "wlan1" "200000" "1"
ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan1" "1" "49"
ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan1" "50" "84"
ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan1" "85" "100"
;;
we1026-5g-16m)
ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0"
set_wifi_led "we1026-5g:green:wifi"
;;
wrh-300cr)
set_wifi_led "$boardname:green:wlan"
ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0"
;;
xiaomi,mir3g)
ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08"
ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08"
ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
;;
xiaomi,mir3p)
ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x10" "0x08"
ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x02" "0x08"
ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
ucidef_set_led_switch "lan3-amber" "LAN3 (amber)" "$boardname:amber:lan3" "switch0" "0x08" "0x08"
;;
xzwifi,creativebox-v1)
ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10"
;;
y1)
ucidef_set_led_netdev "wifi" "WIFI" "$boardname:blue:wifi" "wlan1"
ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi5g" "wlan0"
ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x03"
;;
y1s)
ucidef_set_led_netdev "wifi" "WIFI" "$boardname:yellow:wifi" "wlan1"
ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi" "wlan0"
ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx"
;;
youhua,wr1200js)
ucidef_set_led_switch "internet" "INTERNET" "$boardname:green:wan" "switch0" "0x01"
;;
zbt-ape522ii)
ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$boardname:green:wlan2g4" "wlan1"
ucidef_set_led_netdev "sys1" "wlan1" "$boardname:green:sys1" "wlan1" "tx rx"
ucidef_set_led_netdev "sys2" "wlan0" "$boardname:green:sys2" "wlan0" "tx rx"
;;
zbt-wa05)
set_wifi_led "$boardname:blue:air"
;;
zbt-we826-16M|\
zbt-we826-32M)
set_wifi_led "zbt-we826:green:wifi"
;;
zbtlink,zbt-we1226)
set_wifi_led "$boardname:green:wlan"
ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x01"
ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x02"
ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x10"
;;
zorlik,zl5900v2)
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" eth0
;;
zyxel,keenetic-extra-ii)
set_wifi_led "$boardname:green:wifi"
ucidef_set_led_switch "internet" "internet" "$boardname:green:internet" "switch0" "0x01"
;;
youku-yk1)
set_wifi_led "$boardname:blue:air"
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"
;;
esac
board_config_flush
exit 0

View File

@ -1,704 +0,0 @@
#!/bin/sh
. /lib/functions.sh
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
ramips_setup_rt3x5x_vlans()
{
if [ ! -x /sbin/swconfig ]; then
# legacy default
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
return
fi
local wanports=""
local lanports=""
for port in 5 4 3 2 1 0; do
if [ `swconfig dev rt305x port $port get disable` = "1" ]; then
continue
fi
if [ `swconfig dev rt305x port $port get lan` = "0" ]; then
wanports="$port:wan $wanports"
else
lanports="$port:lan $lanports"
fi
done
ucidef_add_switch "rt305x" $lanports $wanports "6t@eth0"
}
ramips_setup_interfaces()
{
local board="$1"
case $board in
11acnas|\
d-team,newifi-d2|\
dir-615-h1|\
w2914nsv2|\
zbt-we2026)
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0"
;;
3g150b|\
3g300m|\
a5-v11|\
all0256n-4M|\
all0256n-8M|\
all5002|\
all5003|\
bocco|\
broadway|\
dcs-930|\
dcs-930l-b1|\
ht-tm02|\
kimax,u35wf|\
linkits7688 | \
m2m|\
microwrt|\
mikrotik,rbm11g|\
mpr-a2|\
ncs601w|\
omega2 | \
omega2p | \
timecloud|\
tplink,tl-wa801nd-v5|\
w150m|\
widora,neo-16m|\
widora,neo-32m|\
wnce2001|\
zbt-cpe102|\
zorlik,zl5900v2|\
zte-q7)
ucidef_add_switch "switch0"
ucidef_add_switch_attr "switch0" "enable" "false"
ucidef_set_interface_lan "eth0"
;;
mlw221|\
mr-102n)
ucidef_set_interface_lan "eth0.2"
;;
3g-6200n|\
ai-br100|\
alfa-network,ac1200rm|\
mediatek,ap-mt7621a-v60|\
xiaoyu,xy-c5|\
xzwifi,creativebox-v1|\
d240|\
db-wrt01|\
dir-300-b7|\
dir-320-b1|\
dir-610-a1|\
dir-810l|\
dlink,dwr-116-a1|\
dlink,dwr-921-c1|\
dlink,dwr-922-e2|\
ew1200|\
firewrt|\
hc5661a|\
hc5962|\
hlk-rm04|\
k2p|\
kn|\
kn_rc|\
mac1200rv2|\
miwifi-mini|\
miwifi-nano|\
mt7621|\
mt7628|\
mtc,wr1201|\
mzk-750dhp|\
mzk-w300nh2|\
nixcore-x1-8M|\
nixcore-x1-16M|\
oy-0001|\
pbr-m1|\
psg1208|\
psg1218a|\
rt-n12p|\
sap-g3200u3|\
sk-wb8|\
telco-electronics,x1|\
totolink,lr1200|\
unielec,u7621-06-256m-16m|\
unielec,u7621-06-512m-64m|\
vr500|\
wavlink,wl-wn570ha1|\
wavlink,wl-wn575a3|\
wf-2881|\
whr-g300n|\
mqmaker,witi-256m|\
mqmaker,witi-512m|\
youku-yk1|\
youku,yk-l2|\
zbt-ape522ii|\
zbt-we1326|\
zbtlink,zbt-we826-e|\
zbtlink,zbt-we3526|\
zbt-we826-16M|\
zbt-we826-32M|\
zbt-wg2626|\
zbt-wg3526-16M|\
zbt-wg3526-32M|\
zbt-wr8305rt)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
;;
gehua,ghl-r-001)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "4:wan" "6@eth0"
;;
alfa-network,awusfree1|\
alfa-network,tube-e4g|\
cs-qr10|\
d105|\
dlink,dap-1522-a1|\
dch-m225|\
ex2700|\
ex3700|\
hpm|\
mzk-ex300np|\
mzk-ex750np|\
na930|\
pbr-d1|\
ravpower,wd03|\
tama,w06|\
tplink,tl-mr3020-v3|\
tplink,tl-wr802n-v4|\
u25awf-h1|\
wli-tx4-ag300n|\
wmdr-143n|\
wmr-300|\
wn3000rpv3|\
wrh-300cr)
ucidef_set_interface_lan "eth0"
;;
alfa-network,quad-e4g|\
netgear,r6120|\
r6220|\
netgear,r6350|\
wndr3700v5)
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
;;
alfa-network,r36m-e4g|\
wcr-1166ds)
ucidef_add_switch "switch0" \
"3:lan" "4:wan" "6@eth0"
;;
dlink,dwr-118-a1)
ucidef_add_switch "switch0" \
"1:lan:2" "2:lan:3" "3:lan:1" "4:lan:0" "5:wan" "6@eth0"
;;
dlink,dwr-118-a2)
ucidef_add_switch "switch0" \
"1:lan:2" "2:lan:1" "3:lan:3" "4:lan" "0:wan" "6@eth0"
;;
psg1218b)
ucidef_add_switch "switch0" \
"0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "6@eth0"
;;
whr-300hp2|\
whr-600d|\
wsr-1166|\
wsr-600)
ucidef_add_switch "switch0" \
"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:wan:5" "6@eth0"
;;
ar670w|\
ar725w|\
rakwireless,rak633|\
rt-ac51u)
ucidef_add_switch "switch0" \
"0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
;;
belkin,f9k1109v1|\
rt-n15|\
wl-351)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0"
;;
asl26555-8M|\
asl26555-16M|\
rp-n53)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
;;
asus,rt-ac57u|\
atp-52b|\
awm002-evb-4M|\
awm002-evb-8M|\
bdcom,wap2100-sk|\
c20i|\
dir-645|\
gl-mt300a|\
gl-mt300n|\
gl-mt750|\
hilink,hlk-7628n|\
hiwifi,hc5861b|\
jhr-n805r|\
jhr-n825r|\
jhr-n926r|\
mikrotik,rb750gr3|\
mikrotik,rbm33g|\
mzk-wdpr|\
rt-n14u|\
skylab,skw92a|\
tplink,c20-v4|\
tplink,c50-v3|\
tplink,c50-v4|\
tplink,tl-mr3420-v5|\
tplink,tl-wr842n-v5|\
tl-wr840n-v4|\
tl-wr840n-v5|\
tl-wr841n-v13|\
u7628-01-128M-16M|\
ubnt-erx|\
ubnt-erx-sfp|\
ur-326n4g|\
wrtnode|\
wrtnode2p | \
wrtnode2r | \
youhua,wr1200js|\
zbt-wa05|\
zyxel,keenetic-extra-ii)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
;;
c50|\
tplink,c20-v1)
ucidef_add_switch "switch0" \
"1:lan:3" "2:lan:4" "3:lan:1" "4:lan:2" "0:wan" "6@eth0"
;;
dir-860l-b1|\
elecom,wrc-1167ghbk2-s|\
elecom,wrc-2533gst|\
elecom,wrc-1900gst|\
hg255d|\
iodata,wn-ax1167gr|\
iodata,wn-gx300gr)
ucidef_add_switch "switch0" \
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
;;
gnubee,gb-pc1|\
gnubee,gb-pc2)
ucidef_add_switch "switch0" \
"0:lan" "4:lan" "6@eth0"
;;
gl-mt300n-v2)
ucidef_add_switch "switch0" \
"1:lan" "0:wan" "6@eth0"
;;
awapn2403)
ucidef_add_switch "switch0" \
"0:lan" "1:wan" "6@eth0"
;;
b2c|\
nw718|\
psr-680w|\
sl-r7205|\
ur-336un|\
w502u|\
wr6202)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
;;
br-6475nd)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
;;
c108|\
cf-wr800n)
ucidef_add_switch "switch0" \
"4:lan" "6t@eth0"
;;
cudy,wr1000)
ucidef_add_switch "switch0" \
"2:lan:2" "3:lan:1" "4:wan" "6@eth0"
;;
cy-swr1100)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "9@eth0"
;;
duzun-dm06)
ucidef_add_switch "switch0" \
"1:lan" "0:wan" "6@eth0"
;;
e1700|\
mt7620a_mt7530)
ucidef_add_switch "switch1" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
;;
edimax,br-6478ac-v2|\
tplink,c2-v1)
ucidef_add_switch "switch1" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
;;
hc5661|\
head-weblink,hdrm200|\
y1s)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "5:lan" "0:wan" "6@eth0"
;;
hc5861)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "5:wan" "6@eth0"
;;
iodata,wn-ac1167gr|\
iodata,wn-ac733gr3)
ucidef_add_switch "switch1" \
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
;;
kn_rf)
ucidef_add_switch "switch0" \
"0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6@eth0"
;;
kng_rc)
ucidef_add_switch "switch1" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "7t@eth0"
;;
mlwg2|\
wizard8800|\
wl-330n)
ucidef_set_interface_lan "eth0.1"
;;
mr200)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0"
ucidef_set_interface_wan "usb0"
;;
hc5761)
ucidef_add_switch "switch0" \
"1:lan" "4:lan" "0:wan" "6@eth0"
;;
mzk-dp150n|\
vocore-8M|\
vocore-16M)
ucidef_add_switch "switch0" \
"0:lan" "4:lan" "6t@eth0"
;;
newifi-d1)
ucidef_add_switch "switch0" \
"1:lan:2" "2:lan:1" "4:wan" "6@eth0"
;;
phicomm,k2g)
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5:wan" "6@eth0"
;;
dlink,dir-510l|\
glinet,vixmini|\
netgear,ex6150|\
re350-v1)
ucidef_add_switch "switch0" \
"0:lan" "6@eth0"
;;
re6500)
ucidef_add_switch "switch0" \
"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "6@eth0"
;;
rt-n56u)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "8@eth0"
;;
tew-638apb-v2)
ucidef_add_switch "switch0" \
"4:lan" "6@eth0"
;;
lava,lr-25g001|\
tew-691gr|\
tew-692gr|\
wlr-6000)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
;;
tplink,tl-wr902ac-v3)
ucidef_add_switch "switch0" \
"4:lan" "6@eth0"
;;
vonets,var11n-300|\
wt1520-4M|\
wt1520-8M)
ucidef_add_switch "switch0" \
"0:lan" "4:wan" "6@eth0"
;;
vocore2|\
vocore2lite)
ucidef_add_switch "switch0" \
"0:lan" "2:lan" "6t@eth0"
;;
f5d8235-v1|\
f5d8235-v2|\
tew-714tru|\
v11st-fe|\
wzr-agl300nh)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
;;
wcr-150gn|\
we1026-5g-16m)
ucidef_add_switch "switch0" \
"0:lan" "6t@eth0"
;;
whr-1166d)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "5:wan" "6@eth0"
;;
wizfi630a)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:wan" "6@eth0"
;;
wiznet,wizfi630s)
ucidef_add_switch "switch0" \
"0:wan" "3:lan" "4:lan" "6@eth0"
;;
wt3020-4M|\
wt3020-8M)
ucidef_add_switch "switch0" \
"4:lan" "0:wan" "6@eth0"
;;
xiaomi,mir3g)
ucidef_add_switch "switch0" \
"2:lan:2" "3:lan:1" "1:wan" "6t@eth0"
;;
xiaomi,mir3p)
ucidef_add_switch "switch0" \
"1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
;;
xiaomi,mir4a-100m)
ucidef_add_switch "switch0" \
"4:lan:1" "2:lan:2" "0:wan" "6@eth0"
;;
zbtlink,zbt-we1226|\
y1)
ucidef_add_switch "switch0" \
"0:lan:2" "1:lan:1" "4:wan" "6@eth0"
;;
zyxel,keenetic-start)
ucidef_add_switch "switch0" \
"0:lan:3" "1:lan:2" "2:lan:1" "3:lan:0" "4:wan" "6@eth0"
;;
*)
RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"`
if [ -n "${RT3X5X}" ]; then
ramips_setup_rt3x5x_vlans
else
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
fi
;;
esac
}
ramips_setup_macs()
{
local board="$1"
local lan_mac=""
local wan_mac=""
case $board in
a5-v11|\
ht-tm02|\
wmdr-143n)
lan_mac=$(cat /sys/class/net/eth0/address)
;;
asus,rt-ac57u|\
vr500)
lan_mac=$(mtd_get_mac_binary factory 57344)
wan_mac=$(mtd_get_mac_binary factory 57350)
;;
alfa-network,quad-e4g|\
elecom,wrc-1167ghbk2-s|\
elecom,wrc-2533gst|\
elecom,wrc-1900gst|\
sk-wb8)
wan_mac=$(mtd_get_mac_binary factory 57350)
;;
alfa-network,r36m-e4g|\
carambola|\
freestation5|\
w502u|\
wnce2001)
wan_mac=$(mtd_get_mac_binary factory 46)
;;
bc2|\
broadway|\
d105|\
dir-300-b7|\
dir-320-b1|\
dir-620-a1|\
esr-9753|\
hilink,hlk-7628n|\
hlk-rm04|\
mpr-a1|\
psr-680w|\
sl-r7205|\
y1|\
y1s)
lan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_setbit_la "$lan_mac")
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
belkin,f9k1109v1)
wan_mac=$(mtd_get_mac_ascii uboot-env HW_WAN_MAC)
lan_mac=$(mtd_get_mac_ascii uboot-env HW_LAN_MAC)
;;
br-6475nd)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(mtd_get_mac_binary devdata 7)
;;
cy-swr1100|\
dir-645)
lan_mac=$(mtd_get_mac_ascii nvram lanmac)
wan_mac=$(mtd_get_mac_ascii nvram wanmac)
;;
dch-m225)
lan_mac=$(mtd_get_mac_ascii factory lanmac)
;;
dir-860l-b1)
lan_mac=$(mtd_get_mac_ascii factory lanmac)
wan_mac=$(mtd_get_mac_ascii factory wanmac)
;;
dlink,dir-510l|\
dlink,dwr-116-a1|\
dlink,dwr-118-a1|\
dlink,dwr-118-a2|\
dlink,dwr-921-c1|\
dlink,dwr-922-e2|\
lava,lr-25g001)
wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
e1700)
wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
;;
edimax,br-6478ac-v2|\
netgear,r6350)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 2)
;;
gl-mt300n-v2|\
whr-g300n)
wan_mac=$(mtd_get_mac_binary factory 4)
;;
hc5*61|\
hc5661a|\
hc5962|\
hiwifi,hc5861b)
lan_mac=`mtd_get_mac_ascii bdinfo "Vfac_mac "`
[ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
iodata,wn-ac1167gr|\
iodata,wn-ac733gr3)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" -1)
;;
iodata,wn-ax1167gr|\
iodata,wn-gx300gr)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" 1)
;;
kn_rc|\
kn_rf|\
kng_rc)
wan_mac=$(mtd_get_mac_binary factory 40)
;;
linkits7688)
wan_mac=$(mtd_get_mac_binary factory 4)
lan_mac=$(mtd_get_mac_binary factory 46)
;;
mac1200rv2)
lan_mac=$(mtd_get_mac_binary factory_info 13)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
miwifi-mini)
wan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_setbit_la "$wan_mac")
;;
m3|\
m4-4M|\
m4-8M|\
x5|\
x8)
lan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_add "$lan_mac" -2)
;;
newifi-d1)
lan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_add "$lan_mac" 2)
;;
omega2|\
omega2p)
wan_mac=$(mtd_get_mac_binary factory 4)
lan_mac=$(mtd_get_mac_binary factory 46)
;;
oy-0001|\
phicomm,k2g)
lan_mac=$(mtd_get_mac_binary factory 40)
wan_mac=$(mtd_get_mac_binary factory 46)
;;
rt-n56u)
lan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_setbit_la "$lan_mac")
wan_mac=$(mtd_get_mac_binary factory 32772)
;;
skylab,skw92a)
lan_mac=$(mtd_get_mac_binary factory 40)
wan_mac=$(mtd_get_mac_binary factory 46)
;;
tew-691gr)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" 3)
;;
tew-692gr)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" 1)
;;
tiny-ac)
lan_mac=$(mtd_get_mac_ascii u-boot-env LAN_MAC_ADDR)
wan_mac=$(mtd_get_mac_ascii u-boot-env WAN_MAC_ADDR)
;;
w306r-v20)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 5)
;;
wcr-1166ds|\
wsr-1166)
local index="$(find_mtd_index "board_data")"
wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
lan_mac=$wan_mac
;;
wcr-150gn)
wan_mac=$(mtd_get_mac_binary factory 40)
;;
whr-1166d|\
whr-300hp2|\
whr-600d|\
wsr-600)
wan_mac=$(mtd_get_mac_binary factory 4)
lan_mac=$wan_mac
;;
wizfi630a)
lan_mac=$(mtd_get_mac_binary factory 4)
wan_mac=$(mtd_get_mac_binary factory 40)
;;
wlr-6000)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 32772)" 2)
;;
xiaomi,mir3g|\
xiaomi,mir3p)
lan_mac=$(mtd_get_mac_binary Factory 0xe006)
;;
zyxel,keenetic-start)
wan_mac=$(mtd_get_mac_binary factory 40)
;;
*)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
}
board_config_update
board=$(board_name)
ramips_setup_interfaces $board
ramips_setup_macs $board
board_config_flush
exit 0

View File

@ -1,79 +0,0 @@
#!/bin/sh
rt2x00_eeprom_die() {
echo "rt2x00 eeprom: " "$*"
exit 1
}
rt2x00_eeprom_extract() {
local part=$1
local offset=$2
local count=$3
local mtd
mtd=$(find_mtd_part $part)
[ -n "$mtd" ] || \
rt2x00_eeprom_die "no mtd device found for partition $part"
dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
rt2x00_eeprom_die "failed to extract from $mtd"
}
jboot_eeprom_extract() {
local part=$1
local offset=$2
local mtd
mtd=$(find_mtd_part $part)
[ -n "$mtd" ] || \
rt2x00_eeprom_die "no mtd device found for partition $part"
jboot_config_read -i $mtd -o $offset -e /lib/firmware/$FIRMWARE 2>/dev/null || \
rt2x00_eeprom_die "failed to extract from $mtd"
}
rt2x00_eeprom_set_macaddr() {
local macaddr=$1
[ -n "$macaddr" ] || \
rt2x00_eeprom_die "invalid wlan mac address"
macaddr_2bin $macaddr | dd of=/lib/firmware/$FIRMWARE \
conv=notrunc oflag=seek_bytes bs=6 seek=4 count=1 2>/dev/null || \
rt2x00_eeprom_die "failed to write mac address to eeprom file"
}
FW="/lib/firmware/$FIRMWARE"
[ -e "$FW" ] && exit 0
. /lib/functions.sh
. /lib/functions/system.sh
board=$(board_name)
case "$FIRMWARE" in
"soc_wmac.eeprom")
case $board in
dlink,dir-510l|\
dlink,dwr-116-a1|\
dlink,dwr-118-a1|\
dlink,dwr-118-a2|\
dlink,dwr-921-c1|\
dlink,dwr-922-e2|\
lava,lr-25g001)
wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000)
wifi_mac=$(macaddr_add "$wan_mac" 1)
jboot_eeprom_extract "config" 0xE000
rt2x00_eeprom_set_macaddr $wifi_mac
;;
tiny-ac)
wifi_mac=$(mtd_get_mac_ascii u-boot-env INIC_MAC_ADDR)
rt2x00_eeprom_extract "factory" 0 512
rt2x00_eeprom_set_macaddr $wifi_mac
;;
*)
rt2x00_eeprom_die "Please define mtd-eeprom in $board DTS file!"
;;
esac
;;
esac

View File

@ -14,13 +14,13 @@ fix_checksum() {
board=$(board_name)
case "$board" in
cy-swr1100 | \
dch-m225 | \
dir-645 | \
dir-860l-b1)
fix_checksum seama
;;
dlink,dap-1522-a1)
fix_checksum wrg
;;
dlink,dch-m225|\
dlink,dir-645|\
dlink,dir-860l-b1|\
samsung,cy-swr1100)
fix_checksum seama
;;
esac

View File

@ -1,9 +0,0 @@
#!/bin/sh
do_ramips() {
. /lib/ramips.sh
ramips_board_detect
}
boot_hook_add preinit_main do_ramips

View File

@ -3,10 +3,8 @@
# Copyright (C) 2013 OpenWrt.org
#
. /lib/ramips.sh
ramips_set_preinit_iface() {
RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350|MT7628|MT7688|MT7620|MT7621)"`
RT3X5X=$(grep -E "(RT3.5|RT5350|MT7628|MT7688|MT7620|MT7621)" /proc/cpuinfo)
if [ -n "${RT3X5X}" ]; then
# The ethernet switch driver enables VLAN by default, but

View File

@ -1,715 +0,0 @@
#!/bin/sh
#
# Copyright (C) 2010-2013 OpenWrt.org
#
ramips_board_detect() {
local machine
local name
machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
case "$machine" in
*"11AC NAS Router")
name="11acnas"
;;
*"3G150B")
name="3g150b"
;;
*"3G300M")
name="3g300m"
;;
*"3g-6200n")
name="3g-6200n"
;;
*"3g-6200nl")
name="3g-6200nl"
;;
*"A5-V11")
name="a5-v11"
;;
*"Ai-BR100")
name="ai-br100"
;;
*"Air3GII")
name="air3gii"
;;
*"ALL0256N (4M)")
name="all0256n-4M"
;;
*"ALL0256N (8M)")
name="all0256n-8M"
;;
*"ALL5002")
name="all5002"
;;
*"ALL5003")
name="all5003"
;;
*"AR670W")
name="ar670w"
;;
*"AR725W")
name="ar725w"
;;
*"ASL26555 (8M)")
name="asl26555-8M"
;;
*"ASL26555 (16M)")
name="asl26555-16M"
;;
*"ATP-52B")
name="atp-52b"
;;
*"AWAPN2403")
name="awapn2403"
;;
*"AWM002 EVB (4M)")
name="awm002-evb-4M"
;;
*"AWM002 EVB (8M)")
name="awm002-evb-8M"
;;
*"BC2")
name="bc2"
;;
*"BOCCO")
name="bocco"
;;
*"BR-6475nD")
name="br-6475nd"
;;
*"Broadway")
name="broadway"
;;
*"C108")
name="c108"
;;
*"C20i")
name="c20i"
;;
*"C50")
name="c50"
;;
*"Carambola")
name="carambola"
;;
*"CF-WR800N")
name="cf-wr800n"
;;
*"CS-QR10")
name="cs-qr10"
;;
*"CY-SWR1100")
name="cy-swr1100"
;;
*"D105")
name="d105"
;;
*"D240")
name="d240"
;;
*"DAP-1350")
name="dap-1350"
;;
*"DB-WRT01")
name="db-wrt01"
;;
*"DCH-M225")
name="dch-m225"
;;
*"DCS-930")
name="dcs-930"
;;
*"DCS-930L B1")
name="dcs-930l-b1"
;;
*"DIR-300 B1")
name="dir-300-b1"
;;
*"DIR-300 B7")
name="dir-300-b7"
;;
*"DIR-320 B1")
name="dir-320-b1"
;;
*"DIR-600 B1")
name="dir-600-b1"
;;
*"DIR-610 A1")
name="dir-610-a1"
;;
*"DIR-615 D")
name="dir-615-d"
;;
*"DIR-615 H1")
name="dir-615-h1"
;;
*"DIR-620 A1")
name="dir-620-a1"
;;
*"DIR-620 D1")
name="dir-620-d1"
;;
*"DIR-645")
name="dir-645"
;;
*"DIR-810L")
name="dir-810l"
;;
*"DIR-860L B1")
name="dir-860l-b1"
;;
*"Dovado Tiny AC")
name="tiny-ac"
;;
*"DuZun DM06")
name="duzun-dm06"
;;
*"DWR-512 B")
name="dwr-512-b"
;;
*"E1700")
name="e1700"
;;
*"ESR-9753")
name="esr-9753"
;;
*"EW1200")
name="ew1200"
;;
*"EX2700")
name="ex2700";
;;
*"EX3700/EX3800")
name="ex3700"
;;
*"F5D8235 v1")
name="f5d8235-v1"
;;
*"F5D8235 v2")
name="f5d8235-v2"
;;
*"F7C027")
name="f7c027"
;;
*"FireWRT")
name="firewrt"
;;
*"Fonera 2.0N")
name="fonera20n"
;;
*"FreeStation5")
name="freestation5"
;;
*"GL-MT300A")
name="gl-mt300a"
;;
*"GL-MT300N")
name="gl-mt300n"
;;
*"GL-MT750")
name="gl-mt750"
;;
*"GL-MT300N-V2")
name="gl-mt300n-v2"
;;
*"HC5661")
name="hc5661"
;;
*"HC5661A")
name="hc5661a"
;;
*"HC5761")
name="hc5761"
;;
*"HC5861")
name="hc5861"
;;
*"HC5962")
name="hc5962"
;;
*"HG255D")
name="hg255d"
;;
*"HLK-RM04")
name="hlk-rm04"
;;
*"HPM")
name="hpm"
;;
*"HT-TM02")
name="ht-tm02"
;;
*"HW550-3G")
name="hw550-3g"
;;
*"IP2202")
name="ip2202"
;;
*"JHR-N805R")
name="jhr-n805r"
;;
*"JHR-N825R")
name="jhr-n825r"
;;
*"JHR-N926R")
name="jhr-n926r"
;;
*"K2P")
name="k2p"
;;
*"M3")
name="m3"
;;
*"M4 (4M)")
name="m4-4M"
;;
*"M4 (8M)")
name="m4-8M"
;;
*"MediaTek LinkIt Smart 7688")
name="linkits7688"
;;
*"Memory 2 Move")
name="m2m"
;;
*"Mercury MAC1200R v2")
name="mac1200rv2"
;;
*"MicroWRT")
name="microwrt"
;;
*"MiniEMBPlug")
name="miniembplug"
;;
*"MiniEMBWiFi")
name="miniembwifi"
;;
*"MiWiFi Mini")
name="miwifi-mini"
;;
*"MiWiFi Nano")
name="miwifi-nano"
;;
*"MLW221")
name="mlw221"
;;
*"MLWG2")
name="mlwg2"
;;
*"MOFI3500-3GN")
name="mofi3500-3gn"
;;
*"MPR-A1")
name="mpr-a1"
;;
*"MPR-A2")
name="mpr-a2"
;;
*"MR-102N")
name="mr-102n"
;;
*"MR200")
name="mr200"
;;
*"MT7620a + MT7530 evaluation"*)
name="mt7620a_mt7530"
;;
*"MT7620a V22SG"*)
name="mt7620a_v22sg"
;;
*"MT7621 evaluation"*)
name="mt7621"
;;
*"MT7628AN evaluation"*)
name="mt7628"
;;
*"MT7688 evaluation"*)
name="mt7688"
;;
*"MZK-750DHP")
name="mzk-750dhp"
;;
*"MZK-DP150N")
name="mzk-dp150n"
;;
*"MZK-EX300NP")
name="mzk-ex300np"
;;
*"MZK-EX750NP")
name="mzk-ex750np"
;;
*"MZK-W300NH2"*)
name="mzk-w300nh2"
;;
*"MZK-WDPR"*)
name="mzk-wdpr"
;;
*"NA930")
name="na930"
;;
*"NBG-419N")
name="nbg-419n"
;;
*"NBG-419N v2")
name="nbg-419n2"
;;
*"Newifi-D1")
name="newifi-d1"
;;
*"NCS601W")
name="ncs601w"
;;
*"NixcoreX1 (8M)")
name="nixcore-x1-8M"
;;
*"NixcoreX1 (16M)")
name="nixcore-x1-16M"
;;
*"NW718")
name="nw718"
;;
*"Onion Omega2")
name="omega2"
;;
*"Onion Omega2+")
name="omega2p"
;;
*"OY-0001")
name="oy-0001"
;;
*"PBR-D1")
name="pbr-d1"
;;
*"PBR-M1")
name="pbr-m1"
;;
*"PSG1208")
name="psg1208"
;;
*"PSG1218 rev.A")
name="psg1218a"
;;
*"PSG1218 rev.B")
name="psg1218b"
;;
*"PSR-680W"*)
name="psr-680w"
;;
*"PWH2004")
name="pwh2004"
;;
*"PX-4885 (4M)")
name="px-4885-4M"
;;
*"PX-4885 (8M)")
name="px-4885-8M"
;;
*"Q7")
name="zte-q7"
;;
*"R6220")
name="r6220"
;;
*"RE350 v1")
name="re350-v1"
;;
*"RE6500")
name="re6500"
;;
*"RN502J")
name="xdxrn502j"
;;
*"RP-N53")
name="rp-n53"
;;
*"RT5350F-OLinuXino")
name="rt5350f-olinuxino"
;;
*"RT5350F-OLinuXino-EVB")
name="rt5350f-olinuxino-evb"
;;
*"RT-AC51U")
name="rt-ac51u"
;;
*"RT-G32 B1")
name="rt-g32-b1"
;;
*"RT-N10+")
name="rt-n10-plus"
;;
*"RT-N12+")
name="rt-n12p"
;;
*"RT-N13U")
name="rt-n13u"
;;
*"RT-N14U")
name="rt-n14u"
;;
*"RT-N15")
name="rt-n15"
;;
*"RT-N56U")
name="rt-n56u"
;;
*"RUT5XX")
name="rut5xx"
;;
*"SamKnows Whitebox 8")
name="sk-wb8"
;;
*"SAP-G3200U3")
name="sap-g3200u3"
;;
*"SL-R7205"*)
name="sl-r7205"
;;
*"TEW-638APB v2")
name="tew-638apb-v2"
;;
*"TEW-691GR")
name="tew-691gr"
;;
*"TEW-692GR")
name="tew-692gr"
;;
*"TEW-714TRU")
name="tew-714tru"
;;
*"Timecloud")
name="timecloud"
;;
*"TL-WR840N v4")
name="tl-wr840n-v4"
;;
*"TL-WR840N v5")
name="tl-wr840n-v5"
;;
*"TL-WR841N v13")
name="tl-wr841n-v13"
;;
*"U25AWF-H1")
name="u25awf-h1"
;;
*"U7628-01 (128M RAM/16M flash)")
name="u7628-01-128M-16M"
;;
*"UBNT-ERX")
name="ubnt-erx"
;;
*"UBNT-ERX-SFP")
name="ubnt-erx-sfp"
;;
*"UR-326N4G")
name="ur-326n4g"
;;
*"UR-336UN")
name="ur-336un"
;;
*"V11ST-FE")
name="v11st-fe"
;;
*"V22RW-2X2")
name="v22rw-2x2"
;;
*"VoCore (8M)")
name="vocore-8M"
;;
*"VoCore (16M)")
name="vocore-16M"
;;
*"VoCore2")
name="vocore2"
;;
*"VoCore2-Lite")
name="vocore2lite"
;;
*"VR500")
name="vr500"
;;
*"W150M")
name="w150m"
;;
*"W2914NS v2")
name="w2914nsv2"
;;
*"W306R V2.0")
name="w306r-v20"
;;
*"W502U")
name="w502u"
;;
*"WCR-1166DS")
name="wcr-1166ds"
;;
*"WCR-150GN")
name="wcr-150gn"
;;
*"WE1026-5G (16M)")
name="we1026-5g-16m"
;;
*"WF-2881")
name="wf-2881"
;;
*"WHR-1166D")
name="whr-1166d"
;;
*"WHR-300HP2")
name="whr-300hp2"
;;
*"WHR-600D")
name="whr-600d"
;;
*"WHR-G300N")
name="whr-g300n"
;;
*"WIZARD 8800")
name="wizard8800"
;;
*"WizFi630A")
name="wizfi630a"
;;
*"WL-330N")
name="wl-330n"
;;
*"WL-330N3G")
name="wl-330n3g"
;;
*"WL-351 v1 002")
name="wl-351"
;;
*"WLI-TX4-AG300N")
name="wli-tx4-ag300n"
;;
*"WLR-6000")
name="wlr-6000"
;;
*"WMDR-143N")
name="wmdr-143n"
;;
*"WMR-300")
name="wmr-300"
;;
*"WN3000RPv3")
name="wn3000rpv3"
;;
*"WNCE2001")
name="wnce2001"
;;
*"WNDR3700v5")
name="wndr3700v5"
;;
*"WR512-3GN (4M)")
name="wr512-3gn-4M"
;;
*"WR512-3GN (8M)")
name="wr512-3gn-8M"
;;
*"WR6202")
name="wr6202"
;;
*"WRH-300CR")
name="wrh-300cr"
;;
*"WRTNODE")
name="wrtnode"
;;
*"WRTnode2R")
name="wrtnode2r"
;;
*"WRTnode2P")
name="wrtnode2p"
;;
*"WSR-1166DHP")
name="wsr-1166"
;;
*"WSR-600DHP")
name="wsr-600"
;;
*"WT1520 (4M)")
name="wt1520-4M"
;;
*"WT1520 (8M)")
name="wt1520-8M"
;;
*"WT3020 (4M)")
name="wt3020-4M"
;;
*"WT3020 (8M)")
name="wt3020-8M"
;;
*"WZR-AGL300NH")
name="wzr-agl300nh"
;;
*"X5")
name="x5"
;;
*"X8")
name="x8"
;;
*"Y1")
name="y1"
;;
*"Y1S")
name="y1s"
;;
*"ZBT-APE522II")
name="zbt-ape522ii"
;;
*"ZBT-CPE102")
name="zbt-cpe102"
;;
*"ZBT-WA05")
name="zbt-wa05"
;;
*"ZBT-WE1326")
name="zbt-we1326"
;;
*"ZBT-WE2026")
name="zbt-we2026"
;;
*"ZBT-WE826 (16M)")
name="zbt-we826-16M"
;;
*"ZBT-WE826 (32M)")
name="zbt-we826-32M"
;;
*"ZBT-WG2626")
name="zbt-wg2626"
;;
*"ZBT-WG3526 (16M)")
name="zbt-wg3526-16M"
;;
*"ZBT-WG3526 (32M)")
name="zbt-wg3526-32M"
;;
*"ZBT-WR8305RT")
name="zbt-wr8305rt"
;;
*"ZyXEL Keenetic")
name="kn"
;;
*"ZyXEL Keenetic Omni")
name="kn_rc"
;;
*"ZyXEL Keenetic Omni II")
name="kn_rf"
;;
*"ZyXEL Keenetic Viva")
name="kng_rc"
;;
*"YK1")
name="youku-yk1"
;;
esac
# use generic board detect if no name is set
[ -z "$name" ] && return
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
echo "$name" > /tmp/sysinfo/board_name
echo "$machine" > /tmp/sysinfo/model
}

View File

@ -1,199 +0,0 @@
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
/ {
compatible = "tplink,c20-v1", "ralink,mt7620a-soc";
model = "TP-Link Archer C20 v1";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
chosen {
bootargs = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
lan {
label = "c20-v1:blue:lan";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
};
led_power: power {
label = "c20-v1:blue:power";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
default-state = "keep";
};
usb {
label = "c20-v1:blue:usb";
gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
wan {
label = "c20-v1:blue:wan";
gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
};
wan_orange {
label = "c20-v1:orange:wan";
gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
};
wlan5g {
label = "c20-v1:blue:wlan5g";
gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "c20-v1:blue:wlan2g";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
wps {
label = "c20-v1:blue:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
reset {
label = "reset";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
rfkill {
label = "rfkill";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RFKILL>;
};
};
};
&gpio1 {
status = "okay";
};
&gpio2 {
status = "okay";
};
&gpio3 {
status = "okay";
};
&spi0 {
status = "okay";
m25p80@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x20000>;
read-only;
};
partition@20000 {
compatible = "tplink,firmware";
label = "firmware";
reg = <0x20000 0x7a0000>;
};
partition@7c0000 {
label = "config";
reg = <0x7c0000 0x10000>;
read-only;
};
rom: partition@7d0000 {
label = "rom";
reg = <0x7d0000 0x10000>;
read-only;
};
partition@7e0000 {
label = "romfile";
reg = <0x7e0000 0x10000>;
read-only;
};
radio: partition@7f0000 {
label = "radio";
reg = <0x7f0000 0x10000>;
read-only;
};
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "uartf", "wled", "ephy", "spi refclk", "wdt";
ralink,function = "gpio";
};
};
};
&ethernet {
pinctrl-names = "default";
mtd-mac-address = <&rom 0xf100>;
mediatek,portmap = "wllll";
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};
&gsw {
mediatek,port4 = "ephy";
};
&wmac {
ralink,mtd-eeprom = <&radio 0>;
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-2)>;
pinctrl-names = "default";
pinctrl-0 = <&pa_pins>;
};
&pcie {
status = "okay";
};
&pcie0 {
mt76@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&radio 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-1)>;
};
};

View File

@ -1,198 +0,0 @@
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
/ {
compatible = "tplink,c50", "ralink,mt7620a-soc";
model = "TP-Link Archer C50";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
chosen {
bootargs = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
lan {
label = "c50:green:lan";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
};
led_power: power {
label = "c50:green:power";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
default-state = "on";
};
usb {
label = "c50:green:usb";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
wan {
label = "c50:green:wan";
gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
};
wan_orange {
label = "c50:orange:wan";
gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
};
wlan5g {
label = "c50:green:wlan5g";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "c50:green:wlan2g";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
wps {
label = "c50:green:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
reset {
label = "reset";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
rfkill {
label = "rfkill";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RFKILL>;
}; };
};
&gpio1 {
status = "okay";
};
&gpio2 {
status = "okay";
};
&gpio3 {
status = "okay";
};
&spi0 {
status = "okay";
m25p80@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x20000>;
read-only;
};
partition@20000 {
compatible = "tplink,firmware";
label = "firmware";
reg = <0x20000 0x7a0000>;
};
partition@7c0000 {
label = "config";
reg = <0x7c0000 0x10000>;
read-only;
};
rom: partition@7d0000 {
label = "rom";
reg = <0x7d0000 0x10000>;
read-only;
};
partition@7e0000 {
label = "romfile";
reg = <0x7e0000 0x10000>;
read-only;
};
radio: partition@7f0000 {
label = "radio";
reg = <0x7f0000 0x10000>;
read-only;
};
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "ephy", "spi refclk", "mdio", "wdt", "nd_sd";
ralink,function = "gpio";
};
};
};
&ethernet {
pinctrl-names = "default";
mtd-mac-address = <&rom 0xf100>;
mediatek,portmap = "wllll";
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};
&gsw {
mediatek,port4 = "ephy";
};
&wmac {
ralink,mtd-eeprom = <&radio 0>;
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-2)>;
pinctrl-names = "default";
pinctrl-0 = <&pa_pins>;
};
&pcie {
status = "okay";
};
&pcie0 {
mt76@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&radio 32768>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-1)>;
};
};

View File

@ -1,155 +0,0 @@
/*
* Device Tree file for the Netgear EX2700
*
* Copyright (C) 2016 Joseph C. Lehner <joseph.c.lehner@gmail.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "netgear,ex2700", "ralink,mt7620a-soc";
model = "Netgear EX2700";
aliases {
led-boot = &led_power_green;
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_power_green;
};
chosen {
bootargs = "console=ttyS0,57600";
};
leds {
compatible = "gpio-leds";
led_power_green: power_g {
label = "ex2700:green:power";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
default-state = "on";
};
power_r {
label = "ex2700:red:power";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
device_g {
label = "ex2700:green:device";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
};
device_r {
label = "ex2700:red:device";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
};
router_g {
label = "ex2700:green:router";
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
};
router_r {
label = "ex2700:red:router";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};
wps {
label = "ex2700:green:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
reset {
label = "reset";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&spi0 {
status = "okay";
m25p80@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
partition@40000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x40000 0x3b0000>;
};
art: partition@3f0000 {
label = "art";
reg = <0x3f0000 0x10000>;
read-only;
};
};
};
};
&ethernet {
mtd-mac-address = <&art 0x0>;
};
&wmac {
mtd-mac-address = <&art 0x6>;
ralink,mtd-eeprom = <&art 0x1000>;
};
&pinctrl {
state_default: pinctrl0 {
default {
ralink,group = "i2c", "uartf", "spi refclk";
ralink,function = "gpio";
};
};
};

View File

@ -1,144 +0,0 @@
/dts-v1/;
#include "mt7628an.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "hiwifi,hc5861b", "mediatek,mt7628an-soc";
model = "HiWiFi HC5861B";
aliases {
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
};
chosen {
bootargs = "console=ttyS0,115200";
};
memory@0 {
device_type = "memory";
reg = <0x0 0x8000000>;
};
leds {
compatible = "gpio-leds";
led_system: system {
label = "hc5861b:green:system";
gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "hc5861b:green:wlan2g";
gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
reset {
label = "reset";
gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "refclk", "wdt", "wled_an";
ralink,function = "gpio";
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "hw_panic";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0xf70000>;
};
partition@fc0000 {
label = "oem";
reg = <0xfc0000 0x20000>;
read-only;
};
bdinfo: partition@fe0000 {
label = "bdinfo";
reg = <0xfe0000 0x10000>;
read-only;
};
partition@ff0000 {
label = "backup";
reg = <0xff0000 0x10000>;
read-only;
};
};
};
};
&ethernet {
mtd-mac-address = <&factory 0x4>;
};
&wmac {
status = "okay";
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
mtd-mac-address = <&factory 0x2e>;
ieee80211-freq-limit = <5000000 6000000>;
led {
led-sources = <2>;
led-active-low;
};
};
};

View File

@ -1,7 +0,0 @@
/dts-v1/;
#include "UBNT-ER-e50.dtsi"
/ {
model = "UBNT-ERX";
};

View File

@ -1,81 +0,0 @@
/*
* 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 "WE1026-5G.dtsi"
/ {
compatible = "zbtlink,we1026-5g-16m", "ralink,mt7620a-soc";
model = "ZBT WE1026-5G (16M)";
};
&spi0 {
status = "okay";
en25q128@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
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;
};
firmware: partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0xfb0000>;
};
};
};
};

View File

@ -1,125 +0,0 @@
/*
* 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.
*/
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "zbtlink,we1026-5g", "ralink,mt7620a-soc";
chosen {
bootargs = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
lan {
label = "we1026-5g:green:lan";
gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
};
usb {
label = "we1026-5g:green:usb";
gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
wifi {
label = "we1026-5g:green:wifi";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
reset {
label = "reset";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&gpio2 {
status = "okay";
};
&gpio3 {
status = "okay";
};
&sdhci {
status = "okay";
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};
&ethernet {
mtd-mac-address = <&factory 0x28>;
};
&wmac {
ralink,mtd-eeprom = <&factory 0>;
};
&pinctrl {
state_default: pinctrl0 {
default {
ralink,group = "i2c", "uartf", "spi refclk", "ephy", "wled";
ralink,function = "gpio";
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
compatible = "pci14c3,7662";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
};

View File

@ -1,13 +0,0 @@
/dts-v1/;
#include "WITI.dtsi"
/ {
compatible = "mqmaker,witi-256m", "mqmaker,witi", "mediatek,mt7621-soc";
model = "MQmaker WiTi (256MB RAM)";
memory@0 {
device_type = "memory";
reg = <0x0 0x10000000>;
};
};

View File

@ -1,13 +0,0 @@
/dts-v1/;
#include "WITI.dtsi"
/ {
compatible = "mqmaker,witi-512m", "mqmaker,witi", "mediatek,mt7621-soc";
model = "MQmaker WiTi (512MB RAM)";
memory@0 {
device_type = "memory";
reg = <0x0 0x1c000000>, <0x20000000 0x4000000>;
};
};

View File

@ -1,153 +0,0 @@
/* This file is released into the public domain */
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
/ {
compatible = "netgear,wn3000rp-v3", "ralink,mt7620a-soc";
model = "Netgear WN3000RPv3";
aliases {
led-boot = &led_power_green;
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_power_green;
};
chosen {
bootargs = "console=ttyS0,57600";
};
leds {
compatible = "gpio-leds";
led_power_green: power_g {
label = "wn3000rpv3:green:power";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
default-state = "on";
};
power_r {
label = "wn3000rpv3:red:power";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
client_g {
label = "wn3000rpv3:green:client";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
};
client_r {
label = "wn3000rpv3:red:client";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
};
router_g {
label = "wn3000rpv3:green:router";
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
};
router_r {
label = "wn3000rpv3:red:router";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};
wps {
label = "wn3000rpv3:green:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
l_arrow {
label = "wn3000rpv3:blue:leftarrow";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
};
r_arrow {
label = "wn3000rpv3:blue:rightarrow";
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
reset {
label = "reset";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
};
&gpio1 {
status = "okay";
};
&spi0 {
status = "okay";
m25p80@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
partition@40000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x40000 0x7b0000>;
};
art: partition@7f0000 {
label = "art";
reg = <0x7f0000 0x10000>;
read-only;
};
};
};
};
&ethernet {
mtd-mac-address = <&art 0x0>;
};
&wmac {
mtd-mac-address = <&art 0x6>;
ralink,mtd-eeprom = <&art 0x1000>;
};
&pinctrl {
state_default: pinctrl0 {
default {
ralink,group = "i2c", "uartf", "spi refclk";
ralink,function = "gpio";
};
};
};

View File

@ -31,8 +31,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -51,8 +51,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -11,6 +11,7 @@
model = "ALFA Network R36M-E4G";
aliases {
label-mac-device = &wmac;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;

View File

@ -11,6 +11,7 @@
model = "ALFA Network Tube-E4G";
aliases {
label-mac-device = &ethernet;
led-boot = &power;
led-failsafe = &power;
led-running = &power;

View File

@ -10,8 +10,7 @@
model = "Asus RP-N53";
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
touch {
label = "touch";

View File

@ -38,8 +38,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";
@ -53,17 +52,6 @@
linux,code = <KEY_WPS_BUTTON>;
};
};
gpio_export {
compatible = "gpio-export";
#size-cells = <0>;
enable-leds {
gpio-export,name = "enable-leds";
gpio-export,output = <1>;
gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
};
};
};
&spi0 {
@ -114,6 +102,15 @@
status = "okay";
};
&gpio0 {
enable-leds {
gpio-hog;
line-name = "enable-leds";
output-low;
gpios = <10 GPIO_ACTIVE_HIGH>;
};
};
&gpio3 {
status = "okay";
};

View File

@ -41,8 +41,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
wps {
label = "wps";

View File

@ -56,8 +56,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";
@ -144,6 +143,8 @@
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins>;
mtd-mac-address = <&factory 0x4>;
port@5 {
status = "okay";
phy-handle = <&phy5>;

View File

@ -56,8 +56,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";
@ -143,6 +142,7 @@
&ethernet {
pinctrl-names = "default";
pinctrl-0 = <&ephy_pins>;
mtd-mac-address = <&factory 0x4>;
mediatek,portmap = "llllw";
};

View File

@ -56,8 +56,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -17,8 +17,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <100>;
compatible = "gpio-keys";
wps {
label = "wps";

View File

@ -22,8 +22,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";
@ -50,7 +49,6 @@
label = "dir-510l:red:status";
gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
};
};
};
@ -139,4 +137,3 @@
};
};
};

View File

@ -14,11 +14,11 @@
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_power_green;
label-mac-device = &ethernet;
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -17,8 +17,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
wps {
label = "wps";

View File

@ -15,8 +15,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
wps {
label = "wps";
@ -157,25 +156,27 @@
&ethernet {
status = "okay";
mediatek,portmap = "wllll";
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins>;
port@4 {
status = "okay";
phy-handle = <&phy4>;
phy-handle = <&phy0>;
phy-mode = "rgmii";
};
mdio-bus {
status = "okay";
phy4: ethernet-phy@4 {
reg = <4>;
phy-mode = "rgmii";
phy0: ethernet-phy@0 {
reg = <0>;
phy-mode = "rgmii-rxid";
};
};
};
&gsw {
mediatek,port4 = "gmac";
mediatek,ephy-base-address = /bits/ 16 < 2 >;
};

View File

@ -30,8 +30,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -34,8 +34,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset_wps {
label = "reset_wps";
@ -51,14 +50,17 @@
label = "br-6478ac-v2:white:power";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
internet {
label = "br-6478ac-v2:blue:internet";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
};
wlan {
label = "br-6478ac-v2:blue:wlan";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
};
usb {
label = "br-6478ac-v2:blue:usb";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
@ -67,7 +69,6 @@
};
};
gpio_export {
compatible = "gpio-export";
#size-cells = <0>;
@ -79,7 +80,6 @@
};
};
&gpio2 {
status = "okay";
};

View File

@ -0,0 +1,46 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7620a_edimax_ew-747x.dtsi"
/ {
compatible = "edimax,ew-7476rpc", "ralink,mt7620a-soc";
model = "Edimax EW-7476RPC";
leds {
compatible = "gpio-leds";
led_power: power {
label = "ew-7476rpc:green:power";
gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
};
lan {
label = "ew-7476rpc:green:lan";
gpios = <&gpio2 26 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "ew-7476rpc:blue:wlan2g";
gpios = <&gpio2 30 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1radio";
};
wlan5g {
label = "ew-7476rpc:blue:wlan5g";
gpios = <&gpio2 31 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0radio";
};
wps {
label = "ew-7476rpc:green:wps";
gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
};
crossband {
label = "ew-7476rpc:green:crossband";
gpios = <&gpio2 29 GPIO_ACTIVE_LOW>;
};
};
};

View File

@ -0,0 +1,46 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7620a_edimax_ew-747x.dtsi"
/ {
compatible = "edimax,ew-7478ac", "ralink,mt7620a-soc";
model = "Edimax EW-7478AC";
leds {
compatible = "gpio-leds";
led_power: power {
label = "ew-7478ac:green:power";
gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
};
lan {
label = "ew-7478ac:green:lan";
gpios = <&gpio2 26 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "ew-7478ac:blue:wlan2g";
gpios = <&gpio2 30 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1radio";
};
wlan5g {
label = "ew-7478ac:blue:wlan5g";
gpios = <&gpio2 31 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0radio";
};
wps {
label = "ew-7478ac:green:wps";
gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
};
crossband {
label = "ew-7478ac:green:crossband";
gpios = <&gpio2 29 GPIO_ACTIVE_LOW>;
};
};
};

View File

@ -0,0 +1,201 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "edimax,ew-7478apc", "ralink,mt7620a-soc";
model = "Edimax EW-7478APC";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
chosen {
bootargs = "console=ttyS0,57600";
};
keys {
compatible = "gpio-keys";
reset_wps {
label = "reset_wps";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
led_power: power {
label = "ew-7478apc:white:power";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
internet {
label = "ew-7478apc:blue:internet";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
};
wlan {
label = "ew-7478apc:blue:wlan";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
};
usb {
label = "ew-7478apc:blue:usb";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
};
};
&gpio2 {
status = "okay";
enable_usb_power {
gpio-hog;
line-name = "enable USB power";
gpios = <5 GPIO_ACTIVE_HIGH>;
output-high;
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
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 = "cimage";
reg = <0x50000 0x20000>;
read-only;
};
partition@70000 {
compatible = "edimax,uimage";
label = "firmware";
reg = <0x00070000 0x00790000>;
};
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "uartf", "nd_sd";
ralink,function = "gpio";
};
};
};
&ethernet {
status = "okay";
mtd-mac-address = <&factory 0x4>;
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
mediatek,portmap = "wllll";
port@5 {
status = "okay";
mediatek,fixed-link = <1000 1 1 1>;
phy-mode = "rgmii";
};
mdio-bus {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
phy-mode = "rgmii";
};
phy1: ethernet-phy@1 {
reg = <1>;
phy-mode = "rgmii";
};
phy2: ethernet-phy@2 {
reg = <2>;
phy-mode = "rgmii";
};
phy3: ethernet-phy@3 {
reg = <3>;
phy-mode = "rgmii";
};
phy4: ethernet-phy@4 {
reg = <4>;
phy-mode = "rgmii";
};
phy1f: ethernet-phy@1f {
reg = <0x1f>;
phy-mode = "rgmii";
};
};
};
&gsw {
mediatek,port4 = "gmac";
};
&wmac {
ralink,mtd-eeprom = <&factory 0>;
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
mediatek,2ghz = <0>;
};
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};

View File

@ -0,0 +1,190 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "ralink,mt7620a-soc";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
chosen {
bootargs = "console=ttyS0,57600";
};
keys {
compatible = "gpio-keys";
reset_wps {
label = "reset_wps";
gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
switch_high {
label = "switch high";
gpios = <&gpio2 22 GPIO_ACTIVE_LOW>;
linux,code = <BTN_0>;
linux,input-type = <EV_SW>;
};
switch_off {
label = "switch off";
gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
linux,code = <BTN_1>;
linux,input-type = <EV_SW>;
};
};
};
&gpio1 {
status = "okay";
};
&gpio2 {
status = "okay";
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
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 = "cimage";
reg = <0x50000 0x20000>;
read-only;
};
partition@70000 {
compatible = "edimax,uimage";
label = "firmware";
reg = <0x00070000 0x00790000>;
};
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "uartf", "nd_sd", "rgmii2";
ralink,function = "gpio";
};
};
phy_reset_pins: phy-reset {
gpio {
ralink,group = "spi refclk";
ralink,function = "gpio";
};
};
};
&ethernet {
status = "okay";
mtd-mac-address = <&factory 0x4>;
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins &phy_reset_pins>;
mediatek,portmap = "l";
mediatek,mdio-mode = <1>;
phy-reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
phy-reset-duration = <30>;
port@5 {
status = "okay";
mediatek,fixed-link = <1000 1 1 1>;
phy-mode = "rgmii";
};
mdio-bus {
status = "okay";
phy0: ethernet-phy@0 {
status = "disabled";
reg = <0>;
phy-mode = "rgmii";
};
phy1: ethernet-phy@1 {
status = "disabled";
reg = <1>;
phy-mode = "rgmii";
};
phy2: ethernet-phy@2 {
status = "disabled";
reg = <2>;
phy-mode = "rgmii";
};
phy3: ethernet-phy@3 {
status = "disabled";
reg = <3>;
phy-mode = "rgmii";
};
phy4: ethernet-phy@4 {
status = "disabled";
reg = <4>;
phy-mode = "rgmii";
};
};
};
&gsw {
mediatek,port5 = "gmac";
};
&wmac {
ralink,mtd-eeprom = <&factory 0>;
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
mediatek,2ghz = <0>;
};
};

View File

@ -0,0 +1,202 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "engenius,esr600", "ralink,mt7620a-soc";
model = "EnGenius ESR600";
chosen {
bootargs = "console=ttyS0,115200";
};
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
leds {
compatible = "gpio-leds";
led_power: power {
label = "esr600:amber:power";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
};
wps2g {
label = "esr600:amber:wps2g";
gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
};
wlan5g {
label = "esr600:blue:wlan5g";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "esr600:blue:wlan2g";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
debounce-interval = <60>;
};
wps {
label = "wps";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
debounce-interval = <60>;
};
};
};
&gpio1 {
status = "okay";
};
&gpio2 {
status = "okay";
};
&gpio3 {
status = "okay";
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
m25p,fast-read;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
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;
};
iNIC_rf: partition@50000 {
label = "iNIC_rf";
reg = <0x50000 0x10000>;
read-only;
};
partition@60000 {
label = "firmware";
reg = <0x60000 0xf40000>;
compatible = "denx,uimage";
};
partition@fa0000 {
label = "backup";
reg = <0xfa0000 0x10000>;
read-only;
};
partition@fb0000 {
label = "storage";
reg = <0xfb0000 0x50000>;
read-only;
};
};
};
};
&ethernet {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins>;
mtd-mac-address = <&iNIC_rf 0x4>;
port@5 {
status = "okay";
phy-mode = "rgmii";
mediatek,fixed-link = <1000 1 1 1>;
};
mdio-bus {
status = "okay";
mediatek,mdio-mode;
ethernet-phy@0 {
reg = <0>;
phy-mode = "rgmii";
qca,ar8327-initvals = <
0x10 0x40000000 /* POWER-ON STRAPPING */
0x04 0x07600000 /* PORT0 PAD MODE CTRL */
0x7c 0x0000007e /* PORT0 STATUS */
0x0c 0x05600000 /* PORT6 PAD MODE CTRL */
0x94 0x0000007e /* PORT6 STATUS */
>;
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", /* gpio0: 1-2 */
"uartf", /* gpio0: 7-14 */
"nd_sd", /* gpio2: 45-59 */
"wled"; /* gpio3: 72 */
ralink,function = "gpio";
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
compatible = "pci1814,5592";
reg = <0x0 0 0 0 0>;
ralink,mtd-eeprom = <&factory 0x0>;
};
};
&wmac {
ralink,mtd-eeprom = <&iNIC_rf 0x0>;
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};

View File

@ -0,0 +1,166 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "fon,fon2601", "ralink,mt7620a-soc";
model = "Fon FON2601";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
leds {
compatible = "gpio-leds";
led_power: power_r {
label = "fon2601:red:power";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
};
internet_g {
label = "fon2601:green:internet";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
};
net_g {
label = "fon2601:green:net";
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
};
wifi_g {
label = "fon2601:green:wifi";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
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 {
compatible = "fonfxc,uimage";
label = "firmware";
reg = <0x50000 0xf90000>;
};
partition@fe0000 {
label = "board_data";
reg = <0xfe0000 0x20000>;
read-only;
};
};
};
};
&state_default {
gpio {
ralink,group = "i2c", "uartf";
ralink,function = "gpio";
};
nd_sd {
ralink,group = "nd_sd";
ralink,function = "sd";
};
spi_cs {
ralink,group = "spi refclk";
ralink,function = "spi refclk";
};
};
&ethernet {
pinctrl-names = "default";
pinctrl-0 = <&rgmii2_pins &mdio_pins>;
mtd-mac-address = <&factory 0x4>;
port@4 {
status = "okay";
phy-handle = <&phy4>;
phy-mode = "rgmii";
};
mdio-bus {
status = "okay";
phy4: ethernet-phy@4 {
reg = <4>;
phy-mode = "rgmii";
};
};
};
&gsw {
mediatek,port4 = "gmac";
};
&wmac {
ralink,mtd-eeprom = <&factory 0>;
pinctrl-names = "default";
pinctrl-0 = <&pa_pins>, <&wled_pins>;
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
compatible = "pci14c3,7662";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};

View File

@ -9,6 +9,10 @@
compatible = "glinet,gl-mt300a", "ralink,mt7620a-soc";
model = "GL-MT300A";
aliases {
label-mac-device = &wmac;
};
chosen {
bootargs = "console=ttyS0,115200";
};
@ -38,8 +42,8 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;

View File

@ -9,6 +9,10 @@
compatible = "glinet,gl-mt300n", "ralink,mt7620a-soc";
model = "GL-MT300N";
aliases {
label-mac-device = &wmac;
};
chosen {
bootargs = "console=ttyS0,115200";
};
@ -33,8 +37,8 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;

View File

@ -9,6 +9,10 @@
compatible = "glinet,gl-mt750", "ralink,mt7620a-soc";
model = "GL-MT750";
aliases {
label-mac-device = &wmac;
};
chosen {
bootargs = "console=ttyS0,115200";
};
@ -33,8 +37,8 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;

View File

@ -41,8 +41,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
wps {
label = "wps";

View File

@ -1,6 +1,6 @@
/dts-v1/;
#include "HC5X61.dtsi"
#include "mt7620a_hiwifi_hc5x61.dtsi"
/ {
compatible = "hiwifi,hc5661", "hiwifi,hc5x61", "ralink,mt7620a-soc";

View File

@ -1,6 +1,6 @@
/dts-v1/;
#include "HC5X61.dtsi"
#include "mt7620a_hiwifi_hc5x61.dtsi"
/ {
compatible = "hiwifi,hc5761", "hiwifi,hc5x61", "ralink,mt7620a-soc";

View File

@ -1,6 +1,6 @@
/dts-v1/;
#include "HC5X61.dtsi"
#include "mt7620a_hiwifi_hc5x61.dtsi"
/ {
compatible = "hiwifi,hc5861", "hiwifi,hc5x61", "ralink,mt7620a-soc";

View File

@ -11,8 +11,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -94,8 +94,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -17,11 +17,6 @@
led-upgrade = &led_power;
};
memory@0 {
device_type = "memory";
reg = <0x0 0x4000000>;
};
leds {
compatible = "gpio-leds";
@ -48,8 +43,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
wps {
label = "wps";
@ -97,8 +91,8 @@
read-only;
};
Factory: partition@40000 {
label = "Factory";
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x8000>;
read-only;
};
@ -145,7 +139,7 @@
&ethernet {
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins>;
mtd-mac-address = <&Factory 0x4>;
mtd-mac-address = <&factory 0x4>;
port@5 {
status = "okay";
@ -212,5 +206,5 @@
};
&wmac {
ralink,mtd-eeprom = <&Factory 0x0>;
ralink,mtd-eeprom = <&factory 0x0>;
};

View File

@ -17,11 +17,6 @@
led-upgrade = &led_power;
};
memory@0 {
device_type = "memory";
reg = <0x0 0x4000000>;
};
leds {
compatible = "gpio-leds";
@ -48,8 +43,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";
@ -111,8 +105,8 @@
read-only;
};
Factory: partition@40000 {
label = "Factory";
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x8000>;
read-only;
};
@ -153,7 +147,7 @@
&ethernet {
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins>;
mtd-mac-address = <&Factory 0x4>;
mtd-mac-address = <&factory 0x4>;
port@5 {
status = "okay";
@ -194,5 +188,5 @@
};
&wmac {
ralink,mtd-eeprom = <&Factory 0x0>;
ralink,mtd-eeprom = <&factory 0x0>;
};

View File

@ -17,8 +17,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -17,8 +17,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
wps {
label = "wps";

View File

@ -1,6 +1,6 @@
/dts-v1/;
#include "Y1.dtsi"
#include "mt7620a_lenovo_newifi-y1.dtsi"
/ {
compatible = "lenovo,newifi-y1", "ralink,mt7620a-soc";
@ -11,40 +11,41 @@
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
label-mac-device = &ethernet;
};
leds {
compatible = "gpio-leds";
led_power: power {
label = "y1:blue:power";
label = "newifi-y1:blue:power";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
};
wlan1 {
label = "y1:blue:wifi";
label = "newifi-y1:blue:wifi";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
wlan2 {
label = "y1:blue:wifi5g";
label = "newifi-y1:blue:wifi5g";
gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
};
usb {
label = "y1:blue:usb";
label = "newifi-y1:blue:usb";
gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
lan {
label = "y1:blue:lan";
label = "newifi-y1:blue:lan";
gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
};
internet {
label = "y1:blue:internet";
label = "newifi-y1:blue:internet";
gpios = <&gpio2 11 GPIO_ACTIVE_LOW>;
};
};
@ -53,6 +54,6 @@
&ethernet {
pinctrl-names = "default";
pinctrl-0 = <&ephy_pins>;
mtd-mac-address = <&factory 0x4>;
mtd-mac-address = <&factory 0x28>;
mediatek,portmap = "llllw";
};

View File

@ -11,8 +11,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -1,6 +1,6 @@
/dts-v1/;
#include "Y1.dtsi"
#include "mt7620a_lenovo_newifi-y1.dtsi"
/ {
compatible = "lenovo,newifi-y1s", "lenovo,newifi-y1", "ralink,mt7620a-soc";
@ -11,6 +11,7 @@
led-failsafe = &led_power_blue;
led-running = &led_power_blue;
led-upgrade = &led_power_blue;
label-mac-device = &ethernet;
};
gpio_export {
@ -38,39 +39,39 @@
compatible = "gpio-leds";
power1 {
label = "y1s:yellow:power";
label = "newifi-y1s:yellow:power";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};
led_power_blue: power2 {
label = "y1s:blue:power";
label = "newifi-y1s:blue:power";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
};
wlan1 {
label = "y1s:yellow:wifi";
label = "newifi-y1s:yellow:wifi";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
wlan2 {
label = "y1s:blue:wifi";
label = "newifi-y1s:blue:wifi";
gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
};
usb1 {
label = "y1s:yellow:usb";
label = "newifi-y1s:yellow:usb";
gpios = <&gpio2 13 GPIO_ACTIVE_LOW>;
};
usb2 {
label = "y1s:blue:usb";
label = "newifi-y1s:blue:usb";
gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
internet {
label = "y1s:blue:internet";
label = "newifi-y1s:blue:internet";
gpios = <&gpio2 11 GPIO_ACTIVE_LOW>;
};
};
@ -78,7 +79,7 @@
&ethernet {
status = "okay";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address = <&factory 0x28>;
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
mediatek,portmap = "wllll";

View File

@ -27,8 +27,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -14,8 +14,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -0,0 +1,91 @@
/*
* Device Tree file for the Netgear EX2700
*
* Copyright (C) 2016 Joseph C. Lehner <joseph.c.lehner@gmail.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
/dts-v1/;
#include "mt7620a_netgear_ex2700_wn3000rp-v3.dtsi"
/ {
compatible = "netgear,ex2700", "ralink,mt7620a-soc";
model = "Netgear EX2700";
aliases {
led-boot = &led_power_green;
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_power_green;
};
leds {
compatible = "gpio-leds";
led_power_green: power_g {
label = "ex2700:green:power";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
default-state = "on";
};
power_r {
label = "ex2700:red:power";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
device_g {
label = "ex2700:green:device";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
};
device_r {
label = "ex2700:red:device";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
};
router_g {
label = "ex2700:green:router";
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
};
router_r {
label = "ex2700:red:router";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};
wps {
label = "ex2700:green:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
};
};
&partitions {
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
partition@40000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x40000 0x3b0000>;
};
art: partition@3f0000 {
label = "art";
reg = <0x3f0000 0x10000>;
read-only;
};
};

View File

@ -0,0 +1,64 @@
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "mt7620a.dtsi"
/ {
chosen {
bootargs = "console=ttyS0,57600";
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
};
&gpio1 {
status = "okay";
};
&spi0 {
status = "okay";
m25p80@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions: partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
};
};
};
&ethernet {
mtd-mac-address = <&art 0x0>;
};
&wmac {
ralink,mtd-eeprom = <&art 0x1000>;
mtd-mac-address = <&art 0x6>;
};
&pinctrl {
state_default: pinctrl0 {
default {
ralink,group = "i2c", "uartf", "spi refclk";
ralink,function = "gpio";
};
};
};

View File

@ -0,0 +1,57 @@
/* This file is released into the public domain */
/dts-v1/;
#include "mt7620a_netgear_ex3700_ex6130.dtsi"
/ {
compatible = "netgear,ex3700", "ralink,mt7620a-soc";
model = "Netgear EX3700/EX3800";
aliases {
led-boot = &led_power_green;
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_power_green;
};
leds {
compatible = "gpio-leds";
led_power_green: power_g {
label = "ex3700:green:power";
gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
default-state = "on";
};
power_a {
label = "ex3700:amber:power";
gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
};
router_g {
label = "ex3700:green:router";
gpios = <&gpio2 25 GPIO_ACTIVE_LOW>;
};
router_r {
label = "ex3700:red:router";
gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
};
device_g {
label = "ex3700:green:device";
gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
};
device_r {
label = "ex3700:red:device";
gpios = <&gpio2 21 GPIO_ACTIVE_LOW>;
};
wps {
label = "ex3700:green:wps";
gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
};
};
};

View File

@ -1,70 +1,15 @@
/* This file is released into the public domain */
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "mt7620a.dtsi"
/ {
compatible = "netgear,ex3700", "ralink,mt7620a-soc";
model = "Netgear EX3700/EX3800";
aliases {
led-boot = &led_power_green;
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_power_green;
};
chosen {
bootargs = "console=ttyS0,57600";
};
leds {
compatible = "gpio-leds";
led_power_green: power_g {
label = "ex3700:green:power";
gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
default-state = "on";
};
power_a {
label = "ex3700:amber:power";
gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
};
router_g {
label = "ex3700:green:router";
gpios = <&gpio2 25 GPIO_ACTIVE_LOW>;
};
router_r {
label = "ex3700:red:router";
gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
};
device_g {
label = "ex3700:green:device";
gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
};
device_r {
label = "ex3700:red:device";
gpios = <&gpio2 21 GPIO_ACTIVE_LOW>;
};
wps {
label = "ex3700:green:wps";
gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";
@ -94,7 +39,7 @@
m25p80@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
spi-max-frequency = <50000000>;
partitions {
compatible = "fixed-partitions";
@ -146,7 +91,7 @@
&pcie0 {
mt76@0,0 {
reg = <0x0000 0 0 0 0 >;
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};

View File

@ -0,0 +1,57 @@
/* This file is released into the public domain */
/dts-v1/;
#include "mt7620a_netgear_ex3700_ex6130.dtsi"
/ {
compatible = "netgear,ex6130", "ralink,mt7620a-soc";
model = "Netgear EX6130";
aliases {
led-boot = &led_power_green;
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_power_green;
};
leds {
compatible = "gpio-leds";
led_power_green: power_g {
label = "ex6130:green:power";
gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
default-state = "on";
};
power_a {
label = "ex6130:amber:power";
gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
};
router_g {
label = "ex6130:green:router";
gpios = <&gpio2 25 GPIO_ACTIVE_LOW>;
};
router_r {
label = "ex6130:red:router";
gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
};
device_g {
label = "ex6130:green:device";
gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
};
device_r {
label = "ex6130:red:device";
gpios = <&gpio2 21 GPIO_ACTIVE_LOW>;
};
wps {
label = "ex6130:green:wps";
gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
};
};
};

View File

@ -0,0 +1,93 @@
/* This file is released into the public domain */
/dts-v1/;
#include "mt7620a_netgear_ex2700_wn3000rp-v3.dtsi"
/ {
compatible = "netgear,wn3000rp-v3", "ralink,mt7620a-soc";
model = "Netgear WN3000RP v3";
aliases {
led-boot = &led_power_green;
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_power_green;
};
leds {
compatible = "gpio-leds";
led_power_green: power_g {
label = "wn3000rp-v3:green:power";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
default-state = "on";
};
power_r {
label = "wn3000rp-v3:red:power";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
client_g {
label = "wn3000rp-v3:green:client";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
};
client_r {
label = "wn3000rp-v3:red:client";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
};
router_g {
label = "wn3000rp-v3:green:router";
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
};
router_r {
label = "wn3000rp-v3:red:router";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};
wps {
label = "wn3000rp-v3:green:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
l_arrow {
label = "wn3000rp-v3:blue:leftarrow";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
};
r_arrow {
label = "wn3000rp-v3:blue:rightarrow";
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
};
};
};
&partitions {
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
partition@40000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x40000 0x7b0000>;
};
art: partition@7f0000 {
label = "art";
reg = <0x7f0000 0x10000>;
read-only;
};
};

View File

@ -35,8 +35,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
s1 {
label = "reset";
@ -106,6 +105,7 @@
&ethernet {
pinctrl-names = "default";
pinctrl-0 = <&ephy_pins>;
mtd-mac-address = <&factory 0x28>;
mediatek,portmap = "llllw";
};

View File

@ -37,8 +37,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -31,8 +31,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -7,8 +7,7 @@
compatible = "phicomm,psg1218", "ralink,mt7620a-soc";
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -1,6 +1,6 @@
/dts-v1/;
#include "PSG1218.dtsi"
#include "mt7620a_phicomm_psg1218.dtsi"
/ {
compatible = "phicomm,psg1218a", "phicomm,psg1218", "ralink,mt7620a-soc";
@ -15,6 +15,7 @@
leds {
compatible = "gpio-leds";
led_blue: blue {
label = "psg1218a:blue:status";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;

View File

@ -1,6 +1,6 @@
/dts-v1/;
#include "PSG1218.dtsi"
#include "mt7620a_phicomm_psg1218.dtsi"
/ {
compatible = "phicomm,psg1218b", "phicomm,psg1218", "ralink,mt7620a-soc";
@ -15,6 +15,7 @@
leds {
compatible = "gpio-leds";
led_blue: blue {
label = "psg1218b:blue:status";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;

View File

@ -26,8 +26,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
s1 {
label = "reset";

View File

@ -26,8 +26,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
s1 {
label = "wps";

View File

@ -36,8 +36,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
s1 {
label = "reset";

View File

@ -51,8 +51,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -56,8 +56,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -6,12 +6,11 @@
#include <dt-bindings/input/input.h>
/ {
compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
compatible = "ralink,mt7620a-evb", "ralink,mt7620a-soc";
model = "Ralink MT7620a + MT7610e evaluation board";
keys {
compatible = "gpio-keys";
poll-interval = <20>;
s2 {
label = "S2";

View File

@ -3,7 +3,7 @@
#include "mt7620a.dtsi"
/ {
compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
compatible = "ralink,mt7620a-mt7530-evb", "ralink,mt7620a-soc";
model = "Ralink MT7620a + MT7530 evaluation board";
};

View File

@ -6,12 +6,11 @@
#include <dt-bindings/input/input.h>
/ {
compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
compatible = "ralink,mt7620a-mt7610e-evb", "ralink,mt7620a-soc";
model = "Ralink MT7620A evaluation board";
keys {
compatible = "gpio-keys";
poll-interval = <20>;
wps {
label = "wps";

View File

@ -6,12 +6,11 @@
#include <dt-bindings/input/input.h>
/ {
compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
compatible = "ralink,mt7620a-v22sg-evb", "ralink,mt7620a-soc";
model = "Ralink MT7620a V22SG High Power evaluation board";
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -92,8 +92,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -55,8 +55,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -6,7 +6,7 @@
#include <dt-bindings/input/input.h>
/ {
compatible = "tplink,c2-v1", "ralink,mt7620a-soc";
compatible = "tplink,archer-c2-v1", "ralink,mt7620a-soc";
model = "TP-Link Archer C2 v1";
aliases {
@ -33,29 +33,29 @@
compatible = "gpio-leds";
lan {
label = "c2-v1:green:lan";
label = "archer-c2-v1:green:lan";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
};
usb {
label = "c2-v1:green:usb";
label = "archer-c2-v1:green:usb";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
led_wps: wps {
label = "c2-v1:green:wps";
label = "archer-c2-v1:green:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
wan {
label = "c2-v1:green:wan";
label = "archer-c2-v1:green:wan";
gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
};
wlan {
label = "c2-v1:green:wlan";
label = "archer-c2-v1:green:wlan";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
};
@ -153,7 +153,6 @@
};
};
&gpio1 {
status = "okay";
};

View File

@ -0,0 +1,84 @@
/dts-v1/;
#include "mt7620a_tplink_archer.dtsi"
/ {
compatible = "tplink,archer-c20-v1", "ralink,mt7620a-soc";
model = "TP-Link Archer C20 v1";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
leds {
compatible = "gpio-leds";
lan {
label = "archer-c20-v1:blue:lan";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
};
led_power: power {
label = "archer-c20-v1:blue:power";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
default-state = "keep";
};
usb {
label = "archer-c20-v1:blue:usb";
gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
wan {
label = "archer-c20-v1:blue:wan";
gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
};
wan_orange {
label = "archer-c20-v1:orange:wan";
gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
};
wlan5g {
label = "archer-c20-v1:blue:wlan5g";
gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "archer-c20-v1:blue:wlan2g";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
wps {
label = "archer-c20-v1:blue:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "uartf", "wled", "ephy", "spi refclk", "wdt";
ralink,function = "gpio";
};
};
};
&wmac {
pinctrl-names = "default";
pinctrl-0 = <&pa_pins>;
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-2)>;
};
&wifi {
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-1)>;
};

View File

@ -0,0 +1,52 @@
/dts-v1/;
#include "mt7620a_tplink_archer.dtsi"
/ {
compatible = "tplink,archer-c20i", "ralink,mt7620a-soc";
model = "TP-Link Archer C20i";
aliases {
label-mac-device = &ethernet;
};
leds {
compatible = "gpio-leds";
lan {
label = "archer-c20i:blue:lan";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
};
usb {
label = "archer-c20i:blue:usb";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
wps {
label = "archer-c20i:blue:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
wan {
label = "archer-c20i:blue:wan";
gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
};
wlan {
label = "archer-c20i:blue:wlan";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd", "ephy", "spi refclk";
ralink,function = "gpio";
};
};
};

View File

@ -0,0 +1,84 @@
/dts-v1/;
#include "mt7620a_tplink_archer.dtsi"
/ {
compatible = "tplink,archer-c50-v1", "ralink,mt7620a-soc";
model = "TP-Link Archer C50 v1";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
leds {
compatible = "gpio-leds";
lan {
label = "archer-c50-v1:green:lan";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
};
led_power: power {
label = "archer-c50-v1:green:power";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
default-state = "on";
};
usb {
label = "archer-c50-v1:green:usb";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
wan {
label = "archer-c50-v1:green:wan";
gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
};
wan_orange {
label = "archer-c50-v1:orange:wan";
gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
};
wlan5g {
label = "archer-c50-v1:green:wlan5g";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "archer-c50-v1:green:wlan2g";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
wps {
label = "archer-c50-v1:green:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "ephy", "spi refclk", "mdio", "wdt", "nd_sd";
ralink,function = "gpio";
};
};
};
&wmac {
pinctrl-names = "default";
pinctrl-0 = <&pa_pins>;
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-2)>;
};
&wifi {
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-1)>;
};

View File

@ -6,7 +6,7 @@
#include <dt-bindings/input/input.h>
/ {
compatible = "tplink,mr200", "ralink,mt7620a-soc";
compatible = "tplink,archer-mr200", "ralink,mt7620a-soc";
model = "TP-Link Archer MR200";
aliases {
@ -24,52 +24,52 @@
compatible = "gpio-leds";
lan {
label = "mr200:white:lan";
label = "archer-mr200:white:lan";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
};
wan {
label = "mr200:white:wan";
label = "archer-mr200:white:wan";
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
};
led_power: power {
label = "mr200:white:power";
label = "archer-mr200:white:power";
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
};
4g {
label = "mr200:white:4g";
label = "archer-mr200:white:4g";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};
wps {
label = "mr200:white:wps";
label = "archer-mr200:white:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
signal1 {
label = "mr200:white:signal1";
label = "archer-mr200:white:signal1";
gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
};
signal2 {
label = "mr200:white:signal2";
label = "archer-mr200:white:signal2";
gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
};
signal3 {
label = "mr200:white:signal3";
label = "archer-mr200:white:signal3";
gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
};
signal4 {
label = "mr200:white:signal4";
label = "archer-mr200:white:signal4";
gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
};
wlan {
label = "mr200:white:wlan";
label = "archer-mr200:white:wlan";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
};
@ -187,7 +187,7 @@
};
&wmac {
ralink,mtd-eeprom = <&radio 0>;
ralink,mtd-eeprom = <&radio 0x0>;
};
&pcie {
@ -197,6 +197,6 @@
&pcie0 {
mt76@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&radio 32768>;
mediatek,mtd-eeprom = <&radio 0x8000>;
};
};

View File

@ -1,57 +1,27 @@
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
/ {
compatible = "tplink,c20i", "ralink,mt7620a-soc";
model = "TP-Link Archer C20i";
chosen {
bootargs = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
lan {
label = "c20i:blue:lan";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
};
usb {
label = "c20i:blue:usb";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
wps {
label = "c20i:blue:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
wan {
label = "c20i:blue:wan";
gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
};
wlan {
label = "c20i:blue:wlan";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
rfkill {
label = "rfkill";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RFKILL>;
};
reset_wps {
label = "reset_wps";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
@ -95,40 +65,35 @@
partition@7c0000 {
label = "config";
reg = <0x7c0000 0x10000>;
read-only;
};
rom: partition@7d0000 {
label = "rom";
reg = <0x7d0000 0x10000>;
read-only;
};
partition@7e0000 {
label = "romfile";
reg = <0x7e0000 0x10000>;
read-only;
};
radio: partition@7f0000 {
label = "radio";
reg = <0x7f0000 0x10000>;
read-only;
};
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd", "ephy", "spi refclk";
ralink,function = "gpio";
};
};
};
&ethernet {
pinctrl-names = "default";
mtd-mac-address = <&rom 0xf100>;
mediatek,portmap = "wllll";
};
};
&ehci {
status = "okay";
@ -143,7 +108,7 @@
};
&wmac {
ralink,mtd-eeprom = <&radio 0>;
ralink,mtd-eeprom = <&radio 0x0>;
};
&pcie {
@ -151,9 +116,9 @@
};
&pcie0 {
mt76@0,0 {
wifi: mt76@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&radio 32768>;
mediatek,mtd-eeprom = <&radio 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
};

View File

@ -14,6 +14,7 @@
led-failsafe = &led_blue;
led-running = &led_blue;
led-upgrade = &led_blue;
label-mac-device = &ethernet;
};
chosen {
@ -41,8 +42,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -18,29 +18,33 @@
leds {
compatible = "gpio-leds";
wan {
label = "youku-yk1:blue:wan";
label = "yk1:blue:wan";
gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
};
air {
label = "youku-yk1:blue:air";
label = "yk1:blue:air";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
usb {
label = "youku-yk1:blue:usb";
label = "yk1:blue:usb";
gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
led_power: power {
label = "youku-yk1:blue:power";
label = "yk1:blue:power";
gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;

View File

@ -6,12 +6,11 @@
#include <dt-bindings/input/input.h>
/ {
compatible = "planex,cs-qr10", "ralink,mt7620a-soc";
compatible = "yukai,bocco", "ralink,mt7620a-soc";
model = "YUKAI Engineering BOCCO";
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -7,7 +7,7 @@
/ {
compatible = "zbtlink,zbt-ape522ii", "ralink,mt7620a-soc";
model = "ZBT-APE522II";
model = "Zbtlink ZBT-APE522II";
chosen {
bootargs = "console=ttyS0,115200";
@ -43,8 +43,7 @@
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
compatible = "gpio-keys";
reset {
label = "reset";

View File

@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7620a_zbtlink_zbt-we1026-5g.dtsi"
/ {
compatible = "zbtlink,zbt-we1026-5g-16m", "zbtlink,zbt-we1026-5g",
"zbtlink,zbt-we1026", "ralink,mt7620a-soc";
model = "Zbtlink ZBT-WE1026-5G (16M)";
};
&firmware {
reg = <0x50000 0xfb0000>;
};

View File

@ -0,0 +1,42 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7620a_zbtlink_zbt-we1026.dtsi"
/ {
compatible = "zbtlink,zbt-we1026-5g", "zbtlink,zbt-we1026",
"ralink,mt7620a-soc";
leds {
compatible = "gpio-leds";
lan {
label = "we1026-5g:green:lan";
gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
};
usb {
label = "we1026-5g:green:usb";
gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
wifi {
label = "we1026-5g:green:wifi";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
compatible = "pci14c3,7662";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
};

View File

@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7620a_zbtlink_zbt-we1026-h.dtsi"
/ {
compatible = "zbtlink,zbt-we1026-h-32m", "zbtlink,zbt-we1026-h",
"zbtlink,zbt-we1026", "ralink,mt7620a-soc";
model = "Zbtlink ZBT-WE1026-H (32M)";
};
&firmware {
reg = <0x50000 0x1fb0000>;
};

View File

@ -0,0 +1,32 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7620a_zbtlink_zbt-we1026.dtsi"
/ {
compatible = "zbtlink,zbt-we1026-h", "zbtlink,zbt-we1026",
"ralink,mt7620a-soc";
leds {
compatible = "gpio-leds";
usb {
label = "we1026-h:green:usb";
gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
};
lan {
label = "we1026-h:green:lan";
gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
};
wan {
label = "we1026-h:green:wan";
gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
};
wifi {
label = "we1026-h:green:wifi";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
};
};

Some files were not shown because too many files have changed in this diff Show More