diff --git a/include/image-commands.mk b/include/image-commands.mk index 0644f0ac3..5dfd6a2c2 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -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 @@ -120,7 +123,7 @@ define Build/append-uImage-fakehdr endef define Build/tplink-safeloader - -$(STAGING_DIR_HOST)/bin/tplink-safeloader \ + -$(STAGING_DIR_HOST)/bin/tplink-safeloader \ -B $(TPLINK_BOARD_ID) \ -V $(REVISION) \ -k $(IMAGE_KERNEL) \ @@ -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 - $(foreach dts,$(DEVICE_DTS), \ - $(CP) \ - $(DTS_DIR)/$(dts).dtb \ - $(BIN_DIR)/$(IMG_PREFIX)-$(dts).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)))" \ } \ }' diff --git a/include/image.mk b/include/image.mk index 6fb9cb56f..8592c19b9 100644 --- a/include/image.mk +++ b/include/image.mk @@ -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 diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 0ffaac201..deff3a6f6 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -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)) diff --git a/scripts/functions.sh b/scripts/functions.sh new file mode 100644 index 000000000..9a7fcde62 --- /dev/null +++ b/scripts/functions.sh @@ -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))" +} diff --git a/scripts/ubinize-image.sh b/scripts/ubinize-image.sh index 09a00b189..c6f8bcefe 100755 --- a/scripts/ubinize-image.sh +++ b/scripts/ubinize-image.sh @@ -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" diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds deleted file mode 100755 index 83cb88ad5..000000000 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ /dev/null @@ -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 diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network deleted file mode 100755 index 993b3a678..000000000 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ /dev/null @@ -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 diff --git a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom deleted file mode 100644 index fc044c123..000000000 --- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom +++ /dev/null @@ -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 diff --git a/target/linux/ramips/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/ramips/base-files/etc/uci-defaults/09_fix-checksum index 54deb5b2e..482659a2f 100644 --- a/target/linux/ramips/base-files/etc/uci-defaults/09_fix-checksum +++ b/target/linux/ramips/base-files/etc/uci-defaults/09_fix-checksum @@ -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 diff --git a/target/linux/ramips/base-files/lib/preinit/01_preinit_do_ramips.sh b/target/linux/ramips/base-files/lib/preinit/01_preinit_do_ramips.sh deleted file mode 100644 index 31ef5f814..000000000 --- a/target/linux/ramips/base-files/lib/preinit/01_preinit_do_ramips.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -do_ramips() { - . /lib/ramips.sh - - ramips_board_detect -} - -boot_hook_add preinit_main do_ramips diff --git a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips index 5048dacb4..003a4dda7 100644 --- a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips +++ b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips @@ -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 diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh deleted file mode 100755 index 093303892..000000000 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ /dev/null @@ -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 -} diff --git a/target/linux/ramips/dts/ArcherC20v1.dts b/target/linux/ramips/dts/ArcherC20v1.dts deleted file mode 100644 index 39e33b8ff..000000000 --- a/target/linux/ramips/dts/ArcherC20v1.dts +++ /dev/null @@ -1,199 +0,0 @@ -/dts-v1/; - -#include "mt7620a.dtsi" - -#include -#include - -/ { - 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 = ; - }; - - rfkill { - label = "rfkill"; - gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; -}; - -&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"; - }; - }; -}; - -ðernet { - 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)>; - }; -}; diff --git a/target/linux/ramips/dts/ArcherC50.dts b/target/linux/ramips/dts/ArcherC50.dts deleted file mode 100644 index b6f5bed0b..000000000 --- a/target/linux/ramips/dts/ArcherC50.dts +++ /dev/null @@ -1,198 +0,0 @@ -/dts-v1/; - -#include "mt7620a.dtsi" - -#include -#include - -/ { - 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 = ; - }; - - rfkill { - label = "rfkill"; - gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; - linux,code = ; - }; }; -}; - -&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"; - }; - }; -}; - -ðernet { - 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)>; - }; -}; diff --git a/target/linux/ramips/dts/EX2700.dts b/target/linux/ramips/dts/EX2700.dts deleted file mode 100644 index 7d7b2220f..000000000 --- a/target/linux/ramips/dts/EX2700.dts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Device Tree file for the Netgear EX2700 - * - * Copyright (C) 2016 Joseph C. Lehner - * - * 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 -#include - -/ { - 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 = ; - }; - - wps { - label = "wps"; - gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; -}; - -&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; - }; - }; - }; -}; - -ðernet { - 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"; - }; - }; -}; diff --git a/target/linux/ramips/dts/HC5861B.dts b/target/linux/ramips/dts/HC5861B.dts deleted file mode 100644 index 5cc2634dc..000000000 --- a/target/linux/ramips/dts/HC5861B.dts +++ /dev/null @@ -1,144 +0,0 @@ -/dts-v1/; - -#include "mt7628an.dtsi" - -#include -#include - -/ { - 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 = ; - }; - }; -}; - -&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; - }; - }; - }; -}; - -ðernet { - 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; - }; - }; -}; diff --git a/target/linux/ramips/dts/UBNT-ERX.dts b/target/linux/ramips/dts/UBNT-ERX.dts deleted file mode 100644 index 556d1156c..000000000 --- a/target/linux/ramips/dts/UBNT-ERX.dts +++ /dev/null @@ -1,7 +0,0 @@ -/dts-v1/; - -#include "UBNT-ER-e50.dtsi" - -/ { - model = "UBNT-ERX"; -}; diff --git a/target/linux/ramips/dts/WE1026-5G-16M.dts b/target/linux/ramips/dts/WE1026-5G-16M.dts deleted file mode 100644 index 8954006ec..000000000 --- a/target/linux/ramips/dts/WE1026-5G-16M.dts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * BSD LICENSE - * - * Copyright(c) 2017 Kristian Evensen . - * 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>; - }; - }; - }; -}; diff --git a/target/linux/ramips/dts/WE1026-5G.dtsi b/target/linux/ramips/dts/WE1026-5G.dtsi deleted file mode 100644 index e7e64e251..000000000 --- a/target/linux/ramips/dts/WE1026-5G.dtsi +++ /dev/null @@ -1,125 +0,0 @@ -/* - * BSD LICENSE - * - * Copyright(c) 2017 Kristian Evensen . - * 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 -#include - -/ { - 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 = ; - }; - }; -}; - -&gpio2 { - status = "okay"; -}; - -&gpio3 { - status = "okay"; -}; - -&sdhci { - status = "okay"; -}; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - -ðernet { - 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>; - }; -}; diff --git a/target/linux/ramips/dts/WITI-256M.dts b/target/linux/ramips/dts/WITI-256M.dts deleted file mode 100644 index 4c12d8c3b..000000000 --- a/target/linux/ramips/dts/WITI-256M.dts +++ /dev/null @@ -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>; - }; -}; diff --git a/target/linux/ramips/dts/WITI-512M.dts b/target/linux/ramips/dts/WITI-512M.dts deleted file mode 100644 index b24907553..000000000 --- a/target/linux/ramips/dts/WITI-512M.dts +++ /dev/null @@ -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>; - }; -}; diff --git a/target/linux/ramips/dts/WN3000RPV3.dts b/target/linux/ramips/dts/WN3000RPV3.dts deleted file mode 100644 index b067a4e44..000000000 --- a/target/linux/ramips/dts/WN3000RPV3.dts +++ /dev/null @@ -1,153 +0,0 @@ -/* This file is released into the public domain */ - -/dts-v1/; - -#include "mt7620a.dtsi" - -#include -#include - -/ { - 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 = ; - }; - - wps { - label = "wps"; - gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; -}; - -&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; - }; - }; - }; -}; - -ðernet { - 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"; - }; - }; -}; diff --git a/target/linux/ramips/dts/AI-BR100.dts b/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts similarity index 96% rename from target/linux/ramips/dts/AI-BR100.dts rename to target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts index 8de4b5877..019fdf92c 100644 --- a/target/linux/ramips/dts/AI-BR100.dts +++ b/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts @@ -31,8 +31,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/AC1200RM.dts b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts similarity index 98% rename from target/linux/ramips/dts/AC1200RM.dts rename to target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts index 388b088d9..0be685844 100644 --- a/target/linux/ramips/dts/AC1200RM.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts @@ -51,8 +51,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/R36M-E4G.dts b/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts similarity index 99% rename from target/linux/ramips/dts/R36M-E4G.dts rename to target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts index 8d7d512d2..ce839f72f 100644 --- a/target/linux/ramips/dts/R36M-E4G.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts @@ -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; diff --git a/target/linux/ramips/dts/TUBE-E4G.dts b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts similarity index 98% rename from target/linux/ramips/dts/TUBE-E4G.dts rename to target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts index 4097dc614..b02b1629b 100644 --- a/target/linux/ramips/dts/TUBE-E4G.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts @@ -11,6 +11,7 @@ model = "ALFA Network Tube-E4G"; aliases { + label-mac-device = ðernet; led-boot = &power; led-failsafe = &power; led-running = &power; diff --git a/target/linux/ramips/dts/RP-N53.dts b/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts similarity index 97% rename from target/linux/ramips/dts/RP-N53.dts rename to target/linux/ramips/dts/mt7620a_asus_rp-n53.dts index 2d2820ed7..c9c440fe8 100644 --- a/target/linux/ramips/dts/RP-N53.dts +++ b/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts @@ -10,8 +10,7 @@ model = "Asus RP-N53"; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; touch { label = "touch"; diff --git a/target/linux/ramips/dts/RT-AC51U.dts b/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts similarity index 89% rename from target/linux/ramips/dts/RT-AC51U.dts rename to target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts index 3e54ffdad..6efba7489 100644 --- a/target/linux/ramips/dts/RT-AC51U.dts +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts @@ -38,8 +38,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -53,17 +52,6 @@ linux,code = ; }; }; - - 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"; }; diff --git a/target/linux/ramips/dts/BDCOM-WAP2100-SK.dts b/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts similarity index 97% rename from target/linux/ramips/dts/BDCOM-WAP2100-SK.dts rename to target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts index e71d14c6a..898deee7e 100644 --- a/target/linux/ramips/dts/BDCOM-WAP2100-SK.dts +++ b/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts @@ -41,8 +41,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; diff --git a/target/linux/ramips/dts/WHR-1166D.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts similarity index 97% rename from target/linux/ramips/dts/WHR-1166D.dts rename to target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts index 9a6ca335a..64fbeb0fe 100644 --- a/target/linux/ramips/dts/WHR-1166D.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts @@ -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>; diff --git a/target/linux/ramips/dts/WHR-300HP2.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts similarity index 97% rename from target/linux/ramips/dts/WHR-300HP2.dts rename to target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts index 8a79d6ab0..8bdf87501 100644 --- a/target/linux/ramips/dts/WHR-300HP2.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts @@ -56,8 +56,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -143,6 +142,7 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/WHR-600D.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts similarity index 97% rename from target/linux/ramips/dts/WHR-600D.dts rename to target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts index f4b5661ea..a99910db8 100644 --- a/target/linux/ramips/dts/WHR-600D.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts @@ -56,8 +56,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/DCH-M225.dts b/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts similarity index 98% rename from target/linux/ramips/dts/DCH-M225.dts rename to target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts index 0644378ba..b08edfadf 100644 --- a/target/linux/ramips/dts/DCH-M225.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + compatible = "gpio-keys"; wps { label = "wps"; diff --git a/target/linux/ramips/dts/DIR-510L.dts b/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts similarity index 97% rename from target/linux/ramips/dts/DIR-510L.dts rename to target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts index 885e64f9f..56c0f8f89 100644 --- a/target/linux/ramips/dts/DIR-510L.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts @@ -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 @@ }; }; }; - diff --git a/target/linux/ramips/dts/DIR-810L.dts b/target/linux/ramips/dts/mt7620a_dlink_dir-810l.dts similarity index 97% rename from target/linux/ramips/dts/DIR-810L.dts rename to target/linux/ramips/dts/mt7620a_dlink_dir-810l.dts index 479005fbf..9232d4929 100644 --- a/target/linux/ramips/dts/DIR-810L.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dir-810l.dts @@ -14,11 +14,11 @@ led-failsafe = &led_power_green; led-running = &led_power_green; led-upgrade = &led_power_green; + label-mac-device = ðernet; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/DWR-118-A1.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts similarity index 98% rename from target/linux/ramips/dts/DWR-118-A1.dts rename to target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts index 707bc1c3d..44ca66369 100644 --- a/target/linux/ramips/dts/DWR-118-A1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; diff --git a/target/linux/ramips/dts/DWR-118-A2.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts similarity index 93% rename from target/linux/ramips/dts/DWR-118-A2.dts rename to target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts index e1d181a87..449f4ff4b 100644 --- a/target/linux/ramips/dts/DWR-118-A2.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts @@ -15,8 +15,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; @@ -157,25 +156,27 @@ ðernet { 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 >; }; diff --git a/target/linux/ramips/dts/TINY-AC.dts b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts similarity index 97% rename from target/linux/ramips/dts/TINY-AC.dts rename to target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts index e36af1dc7..d0229e471 100644 --- a/target/linux/ramips/dts/TINY-AC.dts +++ b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts @@ -30,8 +30,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/BR-6478AC-V2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts similarity index 98% rename from target/linux/ramips/dts/BR-6478AC-V2.dts rename to target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts index 5c90aa154..43698d9fd 100644 --- a/target/linux/ramips/dts/BR-6478AC-V2.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts @@ -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"; }; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7476rpc.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7476rpc.dts new file mode 100644 index 000000000..782263a06 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7476rpc.dts @@ -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>; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7478ac.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7478ac.dts new file mode 100644 index 000000000..37caeba23 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7478ac.dts @@ -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>; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts new file mode 100644 index 000000000..da5b428fa --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + 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 = ; + }; + }; + + 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"; + }; + }; +}; + +ðernet { + 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"; +}; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi new file mode 100644 index 000000000..52c0ac092 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi @@ -0,0 +1,190 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a.dtsi" + +#include +#include + +/ { + 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 = ; + }; + + switch_high { + label = "switch high"; + gpios = <&gpio2 22 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + switch_off { + label = "switch off"; + gpios = <&gpio2 23 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + }; +}; + +&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"; + }; + }; +}; + +ðernet { + + 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>; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts new file mode 100644 index 000000000..65d71b99a --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts @@ -0,0 +1,202 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + 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 = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + 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; + }; + }; + }; +}; + +ðernet { + 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"; +}; diff --git a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts new file mode 100644 index 000000000..33329a104 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts @@ -0,0 +1,166 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + 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 = ; + }; + }; +}; + +&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"; + }; +}; + +ðernet { + 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"; +}; diff --git a/target/linux/ramips/dts/GL-MT300A.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts similarity index 96% rename from target/linux/ramips/dts/GL-MT300A.dts rename to target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts index 2cea9d9be..6b2e2d115 100644 --- a/target/linux/ramips/dts/GL-MT300A.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts @@ -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>; diff --git a/target/linux/ramips/dts/GL-MT300N.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts similarity index 96% rename from target/linux/ramips/dts/GL-MT300N.dts rename to target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts index a30792cac..1c2b296a9 100644 --- a/target/linux/ramips/dts/GL-MT300N.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts @@ -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>; diff --git a/target/linux/ramips/dts/GL-MT750.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts similarity index 96% rename from target/linux/ramips/dts/GL-MT750.dts rename to target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts index 11133a126..08451d8a8 100644 --- a/target/linux/ramips/dts/GL-MT750.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts @@ -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>; diff --git a/target/linux/ramips/dts/HDRM200.dts b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts similarity index 97% rename from target/linux/ramips/dts/HDRM200.dts rename to target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts index ad16d0271..8d58d12f0 100644 --- a/target/linux/ramips/dts/HDRM200.dts +++ b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts @@ -41,8 +41,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; @@ -184,5 +183,5 @@ }; &uart { - status = "okay"; + status = "okay"; }; diff --git a/target/linux/ramips/dts/HC5661.dts b/target/linux/ramips/dts/mt7620a_hiwifi_hc5661.dts similarity index 94% rename from target/linux/ramips/dts/HC5661.dts rename to target/linux/ramips/dts/mt7620a_hiwifi_hc5661.dts index 091483a13..185e045de 100644 --- a/target/linux/ramips/dts/HC5661.dts +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5661.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "HC5X61.dtsi" +#include "mt7620a_hiwifi_hc5x61.dtsi" / { compatible = "hiwifi,hc5661", "hiwifi,hc5x61", "ralink,mt7620a-soc"; diff --git a/target/linux/ramips/dts/HC5761.dts b/target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts similarity index 95% rename from target/linux/ramips/dts/HC5761.dts rename to target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts index dff129a93..265f7d9bb 100644 --- a/target/linux/ramips/dts/HC5761.dts +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "HC5X61.dtsi" +#include "mt7620a_hiwifi_hc5x61.dtsi" / { compatible = "hiwifi,hc5761", "hiwifi,hc5x61", "ralink,mt7620a-soc"; diff --git a/target/linux/ramips/dts/HC5861.dts b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts similarity index 97% rename from target/linux/ramips/dts/HC5861.dts rename to target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts index b1d5ce4fa..73f1a4079 100644 --- a/target/linux/ramips/dts/HC5861.dts +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "HC5X61.dtsi" +#include "mt7620a_hiwifi_hc5x61.dtsi" / { compatible = "hiwifi,hc5861", "hiwifi,hc5x61", "ralink,mt7620a-soc"; diff --git a/target/linux/ramips/dts/HC5X61.dtsi b/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi similarity index 97% rename from target/linux/ramips/dts/HC5X61.dtsi rename to target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi index 09b303fd3..a7e3bd199 100644 --- a/target/linux/ramips/dts/HC5X61.dtsi +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi @@ -11,8 +11,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/C108.dts b/target/linux/ramips/dts/mt7620a_hnet_c108.dts similarity index 98% rename from target/linux/ramips/dts/C108.dts rename to target/linux/ramips/dts/mt7620a_hnet_c108.dts index 2d89d34ad..c122b6dfd 100644 --- a/target/linux/ramips/dts/C108.dts +++ b/target/linux/ramips/dts/mt7620a_hnet_c108.dts @@ -94,8 +94,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/WN-AC1167GR.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts similarity index 92% rename from target/linux/ramips/dts/WN-AC1167GR.dts rename to target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts index 14c851a3a..5da91071d 100644 --- a/target/linux/ramips/dts/WN-AC1167GR.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts @@ -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 @@ ðernet { 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>; }; diff --git a/target/linux/ramips/dts/WN-AC733GR3.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts similarity index 92% rename from target/linux/ramips/dts/WN-AC733GR3.dts rename to target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts index ea837c4d3..12e6e12f0 100644 --- a/target/linux/ramips/dts/WN-AC733GR3.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts @@ -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 @@ ðernet { 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>; }; diff --git a/target/linux/ramips/dts/U25AWF-H1.dts b/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts similarity index 96% rename from target/linux/ramips/dts/U25AWF-H1.dts rename to target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts index 4b4d0b635..e1aeb4fa8 100644 --- a/target/linux/ramips/dts/U25AWF-H1.dts +++ b/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/LR-25G001.dts b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts similarity index 97% rename from target/linux/ramips/dts/LR-25G001.dts rename to target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts index 20974c93e..3130365b9 100644 --- a/target/linux/ramips/dts/LR-25G001.dts +++ b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; diff --git a/target/linux/ramips/dts/Y1.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts similarity index 71% rename from target/linux/ramips/dts/Y1.dts rename to target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts index 87eb1bf4c..2b98d6c55 100644 --- a/target/linux/ramips/dts/Y1.dts +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts @@ -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 = ðernet; }; 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 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; - mtd-mac-address = <&factory 0x4>; + mtd-mac-address = <&factory 0x28>; mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/Y1.dtsi b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi similarity index 96% rename from target/linux/ramips/dts/Y1.dtsi rename to target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi index 5d6c9922f..a5262ffca 100644 --- a/target/linux/ramips/dts/Y1.dtsi +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi @@ -11,8 +11,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/Y1S.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts similarity index 82% rename from target/linux/ramips/dts/Y1S.dts rename to target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts index 6cdf0b5cd..de01b480e 100644 --- a/target/linux/ramips/dts/Y1S.dts +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts @@ -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 = ðernet; }; 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 @@ ðernet { 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"; diff --git a/target/linux/ramips/dts/E1700.dts b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts similarity index 97% rename from target/linux/ramips/dts/E1700.dts rename to target/linux/ramips/dts/mt7620a_linksys_e1700.dts index 2ea7400a7..256b30630 100644 --- a/target/linux/ramips/dts/E1700.dts +++ b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts @@ -27,8 +27,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/MicroWRT.dts b/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts similarity index 96% rename from target/linux/ramips/dts/MicroWRT.dts rename to target/linux/ramips/dts/mt7620a_microduino_microwrt.dts index a010a9c62..76ab099a1 100644 --- a/target/linux/ramips/dts/MicroWRT.dts +++ b/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts @@ -14,8 +14,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts b/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts new file mode 100644 index 000000000..857f2ed22 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts @@ -0,0 +1,91 @@ +/* + * Device Tree file for the Netgear EX2700 + * + * Copyright (C) 2016 Joseph C. Lehner + * + * 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; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex2700_wn3000rp-v3.dtsi b/target/linux/ramips/dts/mt7620a_netgear_ex2700_wn3000rp-v3.dtsi new file mode 100755 index 000000000..000c7535d --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_netgear_ex2700_wn3000rp-v3.dtsi @@ -0,0 +1,64 @@ +#include +#include + +#include "mt7620a.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,57600"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&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>; + }; + }; +}; + +ðernet { + 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"; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex3700.dts b/target/linux/ramips/dts/mt7620a_netgear_ex3700.dts new file mode 100644 index 000000000..f657e926c --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_netgear_ex3700.dts @@ -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>; + }; + }; +}; diff --git a/target/linux/ramips/dts/EX3700.dts b/target/linux/ramips/dts/mt7620a_netgear_ex3700_ex6130.dtsi similarity index 58% rename from target/linux/ramips/dts/EX3700.dts rename to target/linux/ramips/dts/mt7620a_netgear_ex3700_ex6130.dtsi index d971909b2..d8d74ffc3 100644 --- a/target/linux/ramips/dts/EX3700.dts +++ b/target/linux/ramips/dts/mt7620a_netgear_ex3700_ex6130.dtsi @@ -1,70 +1,15 @@ -/* This file is released into the public domain */ - -/dts-v1/; - #include #include #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>; }; diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex6130.dts b/target/linux/ramips/dts/mt7620a_netgear_ex6130.dts new file mode 100644 index 000000000..68dd3f65d --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_netgear_ex6130.dts @@ -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>; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_netgear_wn3000rp-v3.dts b/target/linux/ramips/dts/mt7620a_netgear_wn3000rp-v3.dts new file mode 100644 index 000000000..917db865a --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_netgear_wn3000rp-v3.dts @@ -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; + }; +}; diff --git a/target/linux/ramips/dts/OY-0001.dts b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts similarity index 96% rename from target/linux/ramips/dts/OY-0001.dts rename to target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts index 6b93b8d08..6ef7e8415 100644 --- a/target/linux/ramips/dts/OY-0001.dts +++ b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts @@ -35,8 +35,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; s1 { label = "reset"; @@ -106,6 +105,7 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x28>; mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/K2G.dts b/target/linux/ramips/dts/mt7620a_phicomm_k2g.dts similarity index 97% rename from target/linux/ramips/dts/K2G.dts rename to target/linux/ramips/dts/mt7620a_phicomm_k2g.dts index 4ca522974..e71211e68 100644 --- a/target/linux/ramips/dts/K2G.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_k2g.dts @@ -37,8 +37,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/PSG1208.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts similarity index 96% rename from target/linux/ramips/dts/PSG1208.dts rename to target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts index 564b083f8..310f78ec5 100644 --- a/target/linux/ramips/dts/PSG1208.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts @@ -31,8 +31,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/PSG1218.dtsi b/target/linux/ramips/dts/mt7620a_phicomm_psg1218.dtsi similarity index 95% rename from target/linux/ramips/dts/PSG1218.dtsi rename to target/linux/ramips/dts/mt7620a_phicomm_psg1218.dtsi index 33eabb6f7..87e44f0b6 100644 --- a/target/linux/ramips/dts/PSG1218.dtsi +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1218.dtsi @@ -7,8 +7,7 @@ compatible = "phicomm,psg1218", "ralink,mt7620a-soc"; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/PSG1218A.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts similarity index 95% rename from target/linux/ramips/dts/PSG1218A.dts rename to target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts index 2ae8871d8..4e023ed6b 100644 --- a/target/linux/ramips/dts/PSG1218A.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts @@ -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>; diff --git a/target/linux/ramips/dts/PSG1218B.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts similarity index 95% rename from target/linux/ramips/dts/PSG1218B.dts rename to target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts index f6445e8c4..f451b43ae 100644 --- a/target/linux/ramips/dts/PSG1218B.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts @@ -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>; diff --git a/target/linux/ramips/dts/CS-QR10.dts b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts similarity index 97% rename from target/linux/ramips/dts/CS-QR10.dts rename to target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts index dadd37acb..c5efb3956 100644 --- a/target/linux/ramips/dts/CS-QR10.dts +++ b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts @@ -26,8 +26,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; s1 { label = "reset"; diff --git a/target/linux/ramips/dts/DB-WRT01.dts b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts similarity index 96% rename from target/linux/ramips/dts/DB-WRT01.dts rename to target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts index bb2c14e09..ecbf91083 100644 --- a/target/linux/ramips/dts/DB-WRT01.dts +++ b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts @@ -26,8 +26,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; s1 { label = "wps"; diff --git a/target/linux/ramips/dts/MZK-750DHP.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts similarity index 97% rename from target/linux/ramips/dts/MZK-750DHP.dts rename to target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts index a4a6c9b8b..be7a56983 100644 --- a/target/linux/ramips/dts/MZK-750DHP.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts @@ -36,8 +36,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; s1 { label = "reset"; diff --git a/target/linux/ramips/dts/MZK-EX300NP.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts similarity index 97% rename from target/linux/ramips/dts/MZK-EX300NP.dts rename to target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts index 6578d952c..ea2a11b82 100644 --- a/target/linux/ramips/dts/MZK-EX300NP.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts @@ -51,8 +51,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/MZK-EX750NP.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts similarity index 97% rename from target/linux/ramips/dts/MZK-EX750NP.dts rename to target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts index 497693d39..7fe329f03 100644 --- a/target/linux/ramips/dts/MZK-EX750NP.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts @@ -56,8 +56,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/MT7620a.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts similarity index 95% rename from target/linux/ramips/dts/MT7620a.dts rename to target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts index 9166fdc57..5b62fd92d 100644 --- a/target/linux/ramips/dts/MT7620a.dts +++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts @@ -6,12 +6,11 @@ #include / { - 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"; diff --git a/target/linux/ramips/dts/MT7620a_MT7530.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts similarity index 96% rename from target/linux/ramips/dts/MT7620a_MT7530.dts rename to target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts index 3fc19d907..976e2acca 100644 --- a/target/linux/ramips/dts/MT7620a_MT7530.dts +++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts @@ -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"; }; diff --git a/target/linux/ramips/dts/MT7620a_MT7610e.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts similarity index 94% rename from target/linux/ramips/dts/MT7620a_MT7610e.dts rename to target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts index e0ae57a0d..b4554675c 100644 --- a/target/linux/ramips/dts/MT7620a_MT7610e.dts +++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts @@ -6,12 +6,11 @@ #include / { - 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"; diff --git a/target/linux/ramips/dts/MT7620a_V22SG.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts similarity index 93% rename from target/linux/ramips/dts/MT7620a_V22SG.dts rename to target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts index d2863ee75..7b3517c13 100644 --- a/target/linux/ramips/dts/MT7620a_V22SG.dts +++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts @@ -6,12 +6,11 @@ #include / { - 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"; diff --git a/target/linux/ramips/dts/D240.dts b/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts similarity index 98% rename from target/linux/ramips/dts/D240.dts rename to target/linux/ramips/dts/mt7620a_sanlinking_d240.dts index 2110959ee..c2b94eebb 100644 --- a/target/linux/ramips/dts/D240.dts +++ b/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts @@ -92,8 +92,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/NA930.dts b/target/linux/ramips/dts/mt7620a_sercomm_na930.dts similarity index 97% rename from target/linux/ramips/dts/NA930.dts rename to target/linux/ramips/dts/mt7620a_sercomm_na930.dts index 6d8591426..76e1eb79b 100644 --- a/target/linux/ramips/dts/NA930.dts +++ b/target/linux/ramips/dts/mt7620a_sercomm_na930.dts @@ -55,8 +55,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/ArcherC2-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts similarity index 91% rename from target/linux/ramips/dts/ArcherC2-v1.dts rename to target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts index 921a50a56..2da35936b 100644 --- a/target/linux/ramips/dts/ArcherC2-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts @@ -6,7 +6,7 @@ #include / { - 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"; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts new file mode 100644 index 000000000..23719c3f3 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts @@ -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)>; +}; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts new file mode 100644 index 000000000..975e0af66 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts @@ -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 = ðernet; + }; + + 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"; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts new file mode 100644 index 000000000..77885853e --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts @@ -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)>; +}; diff --git a/target/linux/ramips/dts/ArcherMR200.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts similarity index 83% rename from target/linux/ramips/dts/ArcherMR200.dts rename to target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts index ff00dbe95..21fc3a185 100644 --- a/target/linux/ramips/dts/ArcherMR200.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts @@ -6,7 +6,7 @@ #include / { - 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>; }; }; diff --git a/target/linux/ramips/dts/ArcherC20i.dts b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi similarity index 59% rename from target/linux/ramips/dts/ArcherC20i.dts rename to target/linux/ramips/dts/mt7620a_tplink_archer.dtsi index cf715a413..dd213ad21 100644 --- a/target/linux/ramips/dts/ArcherC20i.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi @@ -1,57 +1,27 @@ -/dts-v1/; - #include "mt7620a.dtsi" -#include #include +#include / { - 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 = ; + }; + rfkill { label = "rfkill"; gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; linux,code = ; }; - reset_wps { - label = "reset_wps"; - gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; - linux,code = ; - }; }; }; @@ -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"; - }; - }; -}; - ðernet { - pinctrl-names = "default"; - mtd-mac-address = <&rom 0xf100>; - mediatek,portmap = "wllll"; - }; + 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>; }; }; diff --git a/target/linux/ramips/dts/MIWIFI-MINI.dts b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts similarity index 97% rename from target/linux/ramips/dts/MIWIFI-MINI.dts rename to target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts index e8ff02f2a..8bf6565d2 100644 --- a/target/linux/ramips/dts/MIWIFI-MINI.dts +++ b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts @@ -14,6 +14,7 @@ led-failsafe = &led_blue; led-running = &led_blue; led-upgrade = &led_blue; + label-mac-device = ðernet; }; chosen { @@ -41,8 +42,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/YOUKU-YK1.dts b/target/linux/ramips/dts/mt7620a_youku_yk1.dts similarity index 91% rename from target/linux/ramips/dts/YOUKU-YK1.dts rename to target/linux/ramips/dts/mt7620a_youku_yk1.dts index 5d90b17a0..82be9c4c9 100644 --- a/target/linux/ramips/dts/YOUKU-YK1.dts +++ b/target/linux/ramips/dts/mt7620a_youku_yk1.dts @@ -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>; diff --git a/target/linux/ramips/dts/BOCCO.dts b/target/linux/ramips/dts/mt7620a_yukai_bocco.dts similarity index 95% rename from target/linux/ramips/dts/BOCCO.dts rename to target/linux/ramips/dts/mt7620a_yukai_bocco.dts index 6b6ac754e..7abc34d19 100644 --- a/target/linux/ramips/dts/BOCCO.dts +++ b/target/linux/ramips/dts/mt7620a_yukai_bocco.dts @@ -6,12 +6,11 @@ #include / { - 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"; diff --git a/target/linux/ramips/dts/ZBT-APE522II.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts similarity index 96% rename from target/linux/ramips/dts/ZBT-APE522II.dts rename to target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts index 70ad0f0b5..f7bc4f200 100644 --- a/target/linux/ramips/dts/ZBT-APE522II.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts @@ -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"; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g-16m.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g-16m.dts new file mode 100644 index 000000000..c7a77a3c8 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g-16m.dts @@ -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>; +}; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi new file mode 100644 index 000000000..b594cab2c --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi @@ -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>; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-h-32m.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-h-32m.dts new file mode 100644 index 000000000..e00ad8381 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-h-32m.dts @@ -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>; +}; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-h.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-h.dtsi new file mode 100644 index 000000000..f8f9bc754 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-h.dtsi @@ -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>; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi new file mode 100644 index 000000000..d5a6d5389 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "zbtlink,zbt-we1026", "ralink,mt7620a-soc"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + aliases { + label-mac-device = &wmac; + }; +}; + +&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; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + }; + }; + }; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&sdhci { + status = "okay"; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0x0>; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "i2c", "uartf", "spi refclk", "ephy", "wled"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/ZBT-WE826-16M.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts similarity index 90% rename from target/linux/ramips/dts/ZBT-WE826-16M.dts rename to target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts index c33a11ecb..d115b8a09 100644 --- a/target/linux/ramips/dts/ZBT-WE826-16M.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts @@ -1,10 +1,10 @@ /dts-v1/; -#include "ZBT-WE826.dtsi" +#include "mt7620a_zbtlink_zbt-we826.dtsi" / { compatible = "zbtlink,zbt-we826-16m", "zbtlink,zbt-we826", "ralink,mt7620a-soc"; - model = "ZBT-WE826 (16M)"; + model = "Zbtlink ZBT-WE826 (16M)"; }; &spi0 { diff --git a/target/linux/ramips/dts/ZBT-WE826-32M.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts similarity index 90% rename from target/linux/ramips/dts/ZBT-WE826-32M.dts rename to target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts index 9c8f3708d..94a67dd5d 100644 --- a/target/linux/ramips/dts/ZBT-WE826-32M.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts @@ -1,10 +1,10 @@ /dts-v1/; -#include "ZBT-WE826.dtsi" +#include "mt7620a_zbtlink_zbt-we826.dtsi" / { compatible = "zbtlink,zbt-we826-32m", "zbtlink,zbt-we826", "ralink,mt7620a-soc"; - model = "ZBT-WE826 (32M)"; + model = "Zbtlink ZBT-WE826 (32M)"; }; &spi0 { diff --git a/target/linux/ramips/dts/ZBT-WE826-E.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts similarity index 94% rename from target/linux/ramips/dts/ZBT-WE826-E.dts rename to target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts index ce97b0371..2496a16a2 100644 --- a/target/linux/ramips/dts/ZBT-WE826-E.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts @@ -1,11 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "ZBT-WE826.dtsi" +#include "mt7620a_zbtlink_zbt-we826.dtsi" / { compatible = "zbtlink,zbt-we826-e", "zbtlink,zbt-we826", "ralink,mt7620a-soc"; - model = "ZBT-WE826-E"; + model = "Zbtlink ZBT-WE826-E"; /delete-node/ leds; diff --git a/target/linux/ramips/dts/ZBT-WE826.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi similarity index 95% rename from target/linux/ramips/dts/ZBT-WE826.dtsi rename to target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi index 0776ea7a7..41c6b07db 100644 --- a/target/linux/ramips/dts/ZBT-WE826.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi @@ -19,16 +19,19 @@ leds { compatible = "gpio-leds"; + led_power: power { label = "zbt-we826:green:power"; gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; }; + usb { label = "zbt-we826:green:usb"; gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; trigger-sources = <&ohci_port1>, <&ehci_port1>; linux,default-trigger = "usbport"; }; + air { label = "zbt-we826:green:wifi"; gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; @@ -36,8 +39,8 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; + reset { label = "reset"; gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; diff --git a/target/linux/ramips/dts/ZTE-Q7.dts b/target/linux/ramips/dts/mt7620a_zte_q7.dts similarity index 96% rename from target/linux/ramips/dts/ZTE-Q7.dts rename to target/linux/ramips/dts/mt7620a_zte_q7.dts index 5b4c5ee04..50368b8bd 100644 --- a/target/linux/ramips/dts/ZTE-Q7.dts +++ b/target/linux/ramips/dts/mt7620a_zte_q7.dts @@ -31,8 +31,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/kng_rc.dts b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts similarity index 93% rename from target/linux/ramips/dts/kng_rc.dts rename to target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts index 3d6d2c6f0..16a606ea1 100644 --- a/target/linux/ramips/dts/kng_rc.dts +++ b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts @@ -20,36 +20,35 @@ compatible = "gpio-leds"; wan { - label = "kng_rc:green:wan"; + label = "keenetic-viva:green:wan"; gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; }; usb { - label = "kng_rc:green:usb"; + label = "keenetic-viva:green:usb"; gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; trigger-sources = <&ohci_port1>, <&ehci_port1>; linux,default-trigger = "usbport"; }; power_alert { - label = "kng_rc:red:power"; + label = "keenetic-viva:red:power"; gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; }; wifi { - label = "kng_rc:green:wifi"; + label = "keenetic-viva:green:wifi"; gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; }; led_power_green: power { - label = "kng_rc:green:power"; + label = "keenetic-viva:green:power"; gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; }; }; keys { compatible = "gpio-keys"; - poll-interval = <20>; reset { label = "reset"; diff --git a/target/linux/ramips/dts/RT-N12-PLUS.dts b/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts similarity index 96% rename from target/linux/ramips/dts/RT-N12-PLUS.dts rename to target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts index 83a7b6adf..76c362f59 100644 --- a/target/linux/ramips/dts/RT-N12-PLUS.dts +++ b/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts @@ -45,8 +45,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/RT-N14U.dts b/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts similarity index 97% rename from target/linux/ramips/dts/RT-N14U.dts rename to target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts index 834eb0ddf..960d2acae 100644 --- a/target/linux/ramips/dts/RT-N14U.dts +++ b/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts @@ -48,8 +48,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/WMR-300.dts b/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts similarity index 96% rename from target/linux/ramips/dts/WMR-300.dts rename to target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts index f0f1cc133..f7c24ec48 100644 --- a/target/linux/ramips/dts/WMR-300.dts +++ b/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts @@ -36,8 +36,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/CF-WR800N.dts b/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts similarity index 96% rename from target/linux/ramips/dts/CF-WR800N.dts rename to target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts index 65f44e43d..b033ef90c 100644 --- a/target/linux/ramips/dts/CF-WR800N.dts +++ b/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts @@ -40,8 +40,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/DWR-116-A1.dts b/target/linux/ramips/dts/mt7620n_dlink_dwr-116-a1.dts similarity index 96% rename from target/linux/ramips/dts/DWR-116-A1.dts rename to target/linux/ramips/dts/mt7620n_dlink_dwr-116-a1.dts index 6f76a6403..14bfc0f30 100644 --- a/target/linux/ramips/dts/DWR-116-A1.dts +++ b/target/linux/ramips/dts/mt7620n_dlink_dwr-116-a1.dts @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; diff --git a/target/linux/ramips/dts/DWR-921-C1.dts b/target/linux/ramips/dts/mt7620n_dlink_dwr-921-c1.dts similarity index 97% rename from target/linux/ramips/dts/DWR-921-C1.dts rename to target/linux/ramips/dts/mt7620n_dlink_dwr-921-c1.dts index 92bcd54a4..8214e4a78 100644 --- a/target/linux/ramips/dts/DWR-921-C1.dts +++ b/target/linux/ramips/dts/mt7620n_dlink_dwr-921-c1.dts @@ -15,8 +15,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; diff --git a/target/linux/ramips/dts/DWR-922-E2.dts b/target/linux/ramips/dts/mt7620n_dlink_dwr-922-e2.dts similarity index 97% rename from target/linux/ramips/dts/DWR-922-E2.dts rename to target/linux/ramips/dts/mt7620n_dlink_dwr-922-e2.dts index c2dd26a09..ab38ad057 100644 --- a/target/linux/ramips/dts/DWR-922-E2.dts +++ b/target/linux/ramips/dts/mt7620n_dlink_dwr-922-e2.dts @@ -16,8 +16,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; diff --git a/target/linux/ramips/dts/WRH-300CR.dts b/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts similarity index 96% rename from target/linux/ramips/dts/WRH-300CR.dts rename to target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts index eb6dbe6d1..b1eceeed8 100644 --- a/target/linux/ramips/dts/WRH-300CR.dts +++ b/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts @@ -16,7 +16,7 @@ led-upgrade = &led_wps; }; - leds { + leds { compatible = "gpio-leds"; led_wps: wps { @@ -36,8 +36,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/U35WF.dts b/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts similarity index 96% rename from target/linux/ramips/dts/U35WF.dts rename to target/linux/ramips/dts/mt7620n_kimax_u35wf.dts index d058b8394..c49cb02bb 100644 --- a/target/linux/ramips/dts/U35WF.dts +++ b/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/MLW221.dts b/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts similarity index 97% rename from target/linux/ramips/dts/MLW221.dts rename to target/linux/ramips/dts/mt7620n_kingston_mlw221.dts index 815370e6f..9658f6c4d 100644 --- a/target/linux/ramips/dts/MLW221.dts +++ b/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts @@ -31,8 +31,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/MLWG2.dts b/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts similarity index 97% rename from target/linux/ramips/dts/MLWG2.dts rename to target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts index f88af7189..6d7d2d06b 100644 --- a/target/linux/ramips/dts/MLWG2.dts +++ b/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts @@ -31,8 +31,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/WT3020-4M.dts b/target/linux/ramips/dts/mt7620n_nexx_wt3020-4m.dts similarity index 95% rename from target/linux/ramips/dts/WT3020-4M.dts rename to target/linux/ramips/dts/mt7620n_nexx_wt3020-4m.dts index 4bdc3bd6b..412c25932 100644 --- a/target/linux/ramips/dts/WT3020-4M.dts +++ b/target/linux/ramips/dts/mt7620n_nexx_wt3020-4m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "WT3020.dtsi" +#include "mt7620n_nexx_wt3020.dtsi" / { compatible = "nexx,wt3020-4m", "nexx,wt3020", "ralink,mt7620n-soc"; diff --git a/target/linux/ramips/dts/WT3020-8M.dts b/target/linux/ramips/dts/mt7620n_nexx_wt3020-8m.dts similarity index 95% rename from target/linux/ramips/dts/WT3020-8M.dts rename to target/linux/ramips/dts/mt7620n_nexx_wt3020-8m.dts index be429f0c2..9569703a3 100644 --- a/target/linux/ramips/dts/WT3020-8M.dts +++ b/target/linux/ramips/dts/mt7620n_nexx_wt3020-8m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "WT3020.dtsi" +#include "mt7620n_nexx_wt3020.dtsi" / { compatible = "nexx,wt3020-8m", "nexx,wt3020", "ralink,mt7620n-soc"; diff --git a/target/linux/ramips/dts/WT3020.dtsi b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi similarity index 93% rename from target/linux/ramips/dts/WT3020.dtsi rename to target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi index 59558a2e9..2fc366264 100644 --- a/target/linux/ramips/dts/WT3020.dtsi +++ b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi @@ -11,11 +11,11 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; + label-mac-device = ðernet; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/WD03.dts b/target/linux/ramips/dts/mt7620n_ravpower_wd03.dts similarity index 96% rename from target/linux/ramips/dts/WD03.dts rename to target/linux/ramips/dts/mt7620n_ravpower_wd03.dts index bbb2ca3dc..7dcff4691 100644 --- a/target/linux/ramips/dts/WD03.dts +++ b/target/linux/ramips/dts/mt7620n_ravpower_wd03.dts @@ -21,7 +21,6 @@ gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>; }; - blue-wifi { label = "wd03:blue:wifi"; gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>; @@ -29,8 +28,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/VAR11N-300.dts b/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts similarity index 96% rename from target/linux/ramips/dts/VAR11N-300.dts rename to target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts index cf4b7c54a..184d947e3 100644 --- a/target/linux/ramips/dts/VAR11N-300.dts +++ b/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts @@ -26,8 +26,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/WRTNODE.dts b/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts similarity index 100% rename from target/linux/ramips/dts/WRTNODE.dts rename to target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts diff --git a/target/linux/ramips/dts/ZBT-CPE102.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts similarity index 96% rename from target/linux/ramips/dts/ZBT-CPE102.dts rename to target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts index 6f0213bf7..388542834 100644 --- a/target/linux/ramips/dts/ZBT-CPE102.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts @@ -13,7 +13,6 @@ bootargs = "console=ttyS0,115200"; }; - aliases { led-boot = &led_4g_0; led-failsafe = &led_4g_0; @@ -39,8 +38,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/ZBT-WA05.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts similarity index 97% rename from target/linux/ramips/dts/ZBT-WA05.dts rename to target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts index 21b56dcae..7949c4838 100644 --- a/target/linux/ramips/dts/ZBT-WA05.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts @@ -42,8 +42,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/ZBT-WE2026.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts similarity index 96% rename from target/linux/ramips/dts/ZBT-WE2026.dts rename to target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts index be8d13be9..0cadbddcb 100644 --- a/target/linux/ramips/dts/ZBT-WE2026.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts @@ -35,8 +35,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/ZBT-WR8305RT.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts similarity index 97% rename from target/linux/ramips/dts/ZBT-WR8305RT.dts rename to target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts index 5292c70db..cdfeaff39 100644 --- a/target/linux/ramips/dts/ZBT-WR8305RT.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts @@ -38,8 +38,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/kn_rf.dts b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts similarity index 93% rename from target/linux/ramips/dts/kn_rf.dts rename to target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts index 765629548..98c560921 100644 --- a/target/linux/ramips/dts/kn_rf.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts @@ -20,31 +20,30 @@ compatible = "gpio-leds"; wan { - label = "kn_rc:green:wan"; + label = "keenetic-omni-ii:green:wan"; gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; }; usb { - label = "kn_rc:green:usb"; + label = "keenetic-omni-ii:green:usb"; gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; trigger-sources = <&ohci_port1>, <&ehci_port1>; linux,default-trigger = "usbport"; }; wifi { - label = "kn_rc:green:wifi"; + label = "keenetic-omni-ii:green:wifi"; gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; }; led_power: power { - label = "kn_rc:green:power"; + label = "keenetic-omni-ii:green:power"; gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; }; }; keys { compatible = "gpio-keys"; - poll-interval = <20>; reset { label = "reset"; diff --git a/target/linux/ramips/dts/kn_rc.dts b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts similarity index 93% rename from target/linux/ramips/dts/kn_rc.dts rename to target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts index 74396d1fc..ff9a9ee1a 100644 --- a/target/linux/ramips/dts/kn_rc.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts @@ -20,31 +20,30 @@ compatible = "gpio-leds"; wan { - label = "kn_rc:green:wan"; + label = "keenetic-omni:green:wan"; gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; }; usb { - label = "kn_rc:green:usb"; + label = "keenetic-omni:green:usb"; gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; trigger-sources = <&ohci_port1>, <&ehci_port1>; linux,default-trigger = "usbport"; }; wifi { - label = "kn_rc:green:wifi"; + label = "keenetic-omni:green:wifi"; gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; }; led_power: power { - label = "kn_rc:green:power"; + label = "keenetic-omni:green:power"; gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; }; }; keys { compatible = "gpio-keys"; - poll-interval = <20>; reset { label = "reset"; diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index 4f69e0902..849f1f0a0 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -49,8 +49,6 @@ clock-frequency = <50000000>; }; - - palmbus: palmbus@1E000000 { compatible = "palmbus"; reg = <0x1E000000 0x100000>; diff --git a/target/linux/ramips/dts/mt7621_adslr_g7.dts b/target/linux/ramips/dts/mt7621_adslr_g7.dts new file mode 100644 index 000000000..c086b16f7 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_adslr_g7.dts @@ -0,0 +1,119 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "adslr,g7", "mediatek,mt7621-soc"; + model = "ADSLR G7"; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + label-mac-device = ðernet; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + leds { + compatible = "gpio-leds"; + + led_sys: sys { + label = "g7:blue:sys"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + 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 = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe00c>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "wdt"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/EW1200.dts b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts similarity index 94% rename from target/linux/ramips/dts/EW1200.dts rename to target/linux/ramips/dts/mt7621_afoundry_ew1200.dts index def47d519..a165c2074 100644 --- a/target/linux/ramips/dts/EW1200.dts +++ b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts @@ -16,11 +16,6 @@ led-upgrade = &led_run; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -32,8 +27,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/QUAD-E4G.dts b/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts similarity index 98% rename from target/linux/ramips/dts/QUAD-E4G.dts rename to target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts index 3826f6987..f3080c29e 100644 --- a/target/linux/ramips/dts/QUAD-E4G.dts +++ b/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts @@ -11,6 +11,7 @@ model = "ALFA Network Quad-E4G"; aliases { + label-mac-device = ðernet; led-boot = &led_system; led-failsafe = &led_system; led-running = &led_system; @@ -138,11 +139,6 @@ }; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; - watchdog { compatible = "linux,wdt-gpio"; gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts new file mode 100644 index 000000000..9926a9bd5 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include "mt7621_asiarf_ap7621.dtsi" + +/ { + compatible = "asiarf,ap7621-001", "mediatek,mt7621-soc"; + model = "AsiaRF AP7621-001"; +}; diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts new file mode 100644 index 000000000..ec322d0e0 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include "mt7621_asiarf_ap7621.dtsi" + +/ { + compatible = "asiarf,ap7621-nv1", "mediatek,mt7621-soc"; + model = "AsiaRF AP7621-NV1"; +}; diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi b/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi new file mode 100644 index 000000000..db83f99c3 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + chosen { + bootargs = "console=ttyS0,57600"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + wlan1 { + label = "ap7621-001:orange:wlan1"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; + + wlan0 { + label = "ap7621-001:orange:wlan0"; + gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&sdhci { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + 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 0x2000>; + }; + + partition@32000 { + label = "2860"; + reg = <0x32000 0x4000>; + }; + + partition@36000 { + label = "rtdev"; + reg = <0x36000 0x2000>; + }; + + partition@38000 { + label = "Reserve"; + reg = <0x38000 0x8000>; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfa0000>; + compatible = "denx,uimage"; + }; + + partition@ff0000 { + label = "nvram"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; + mediatek,portmap = "llllw"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "wdt", "jtag"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/RT-AC57U.dts b/target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts similarity index 97% rename from target/linux/ramips/dts/RT-AC57U.dts rename to target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts index 6fec0cdf6..e589461a4 100644 --- a/target/linux/ramips/dts/RT-AC57U.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts @@ -17,11 +17,6 @@ led-upgrade = &led_power; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ac65p.dts b/target/linux/ramips/dts/mt7621_asus_rt-ac65p.dts new file mode 100644 index 000000000..07a714a84 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_asus_rt-ac65p.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621_asus_rt-acx5p.dtsi" + +/ { + compatible = "asus,rt-ac65p", "mediatek,mt7621-soc"; + model = "ASUS RT-AC65P"; +}; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ac85p.dts b/target/linux/ramips/dts/mt7621_asus_rt-ac85p.dts new file mode 100644 index 000000000..add33bf2d --- /dev/null +++ b/target/linux/ramips/dts/mt7621_asus_rt-ac85p.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621_asus_rt-acx5p.dtsi" + +/ { + compatible = "asus,rt-ac85p", "mediatek,mt7621-soc"; + model = "ASUS RT-AC85P"; +}; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi new file mode 100644 index 000000000..8eaf55dbc --- /dev/null +++ b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi @@ -0,0 +1,157 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + palmbus: palmbus@1E000000 { + i2c@900 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "rt-ac85p:blue:power"; + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + }; + wlan2g { + label = "rt-ac85p:blue:wlan2g"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0radio"; + }; + + wlan5g { + label = "rt-ac85p:blue:wlan5g"; + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1radio"; + }; + }; +}; + +&sdhci { + status = "okay"; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0xe0000>; + read-only; + }; + + partition@e0000 { + label = "u-boot-env"; + reg = <0xe0000 0x100000>; + read-only; + }; + + factory: partition@1e0000 { + label = "factory"; + reg = <0x1e0000 0x100000>; + read-only; + }; + + factory2: partition@2e0000 { + label = "factory2"; + reg = <0x2e0000 0x100000>; + read-only; + }; + + partition@3e0000 { + label = "kernel"; + reg = <0x3e0000 0x400000>; + }; + + partition@7e0000 { + label = "ubi"; + reg = <0x7e0000 0x2e00000>; + }; + + partition@35e0000 { + label = "firmware2"; + reg = <0x35e0000 0x3200000>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi0: wifi@0,0 { + compatible = "pci14c3,7615"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi1: wifi@0,0 { + compatible = "pci14c3,7615"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; + mediatek,portmap = "wllll"; + port@5 { + status = "disabled"; + }; +}; + +&i2c { + status = "disabled"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "uart2", "uart3", "i2c"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/WSR-1166.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts similarity index 96% rename from target/linux/ramips/dts/WSR-1166.dts rename to target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts index ff033c41e..1b99f8147 100644 --- a/target/linux/ramips/dts/WSR-1166.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts @@ -16,11 +16,6 @@ led-upgrade = &led_power; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -70,8 +65,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; power { label = "power"; diff --git a/target/linux/ramips/dts/WSR-600.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts similarity index 96% rename from target/linux/ramips/dts/WSR-600.dts rename to target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts index 0cdd79cdd..36bcd15e4 100644 --- a/target/linux/ramips/dts/WSR-600.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts @@ -16,11 +16,6 @@ led-upgrade = &led_power; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -70,8 +65,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; power { label = "power"; @@ -186,6 +180,10 @@ }; }; +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + &xhci { status = "disabled"; }; diff --git a/target/linux/ramips/dts/Newifi-D2.dts b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts similarity index 94% rename from target/linux/ramips/dts/Newifi-D2.dts rename to target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts index 31fc42cde..896d9f603 100644 --- a/target/linux/ramips/dts/Newifi-D2.dts +++ b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts @@ -14,11 +14,7 @@ led-failsafe = &led_power_blue; led-running = &led_power_blue; led-upgrade = &led_power_blue; - }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; + label-mac-device = ðernet; }; chosen { @@ -67,8 +63,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/PBR-M1.dts b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts similarity index 95% rename from target/linux/ramips/dts/PBR-M1.dts rename to target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts index e89a7ef93..fd598de4b 100644 --- a/target/linux/ramips/dts/PBR-M1.dts +++ b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts @@ -16,11 +16,6 @@ led-upgrade = &led_sys; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -68,8 +63,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/DIR-860L-B1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts similarity index 93% rename from target/linux/ramips/dts/DIR-860L-B1.dts rename to target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts index c212e05a2..f189365ba 100644 --- a/target/linux/ramips/dts/DIR-860L-B1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts @@ -14,11 +14,7 @@ led-failsafe = &led_power_green; led-running = &led_power_green; led-upgrade = &led_power_green; - }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; + label-mac-device = &wifi1; }; chosen { @@ -50,8 +46,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -124,7 +119,7 @@ }; &pcie0 { - mt76@0,0 { + wifi0: mt76@0,0 { reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&radio 0x2000>; ieee80211-freq-limit = <5000000 6000000>; @@ -132,7 +127,7 @@ }; &pcie1 { - mt76@0,0 { + wifi1: mt76@0,0 { reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&radio 0>; ieee80211-freq-limit = <2400000 2500000>; diff --git a/target/linux/ramips/dts/mt7621_edimax_rg21s.dts b/target/linux/ramips/dts/mt7621_edimax_rg21s.dts new file mode 100644 index 000000000..6ed08413c --- /dev/null +++ b/target/linux/ramips/dts/mt7621_edimax_rg21s.dts @@ -0,0 +1,155 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "edimax,rg21s", "mediatek,mt7621-soc"; + model = "Edimax RG21S"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + palmbus: palmbus@1E000000 { + i2c@900 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: led_1 { + label = "rg21s:red:led1"; + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + }; + + led_2 { + label = "rg21s:red:led2"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + + led_3 { + label = "rg21s:red:led3"; + gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; + }; + + led_4 { + label = "rg21s:red:led4"; + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&sdhci { + 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 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi0: wifi@0,0 { + compatible = "pci14c3,7615"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi1: wifi@0,0 { + compatible = "pci14c3,7615"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +ðernet { + mediatek,portmap = "wllll"; + port@5 { + status = "disabled"; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "wdt", "rgmii2", "jtag", "mdio"; + ralink,function = "gpio"; + }; + }; +}; + +&xhci { + status = "disabled"; +}; diff --git a/target/linux/ramips/dts/WRC-1167GHBK2-S.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts similarity index 90% rename from target/linux/ramips/dts/WRC-1167GHBK2-S.dts rename to target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts index 9587b3769..3d0b72652 100644 --- a/target/linux/ramips/dts/WRC-1167GHBK2-S.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts @@ -16,11 +16,6 @@ led-upgrade = &led_power_green; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -31,6 +26,7 @@ wlan2g { label = "wrc-1167ghbk2-s:white:wlan2g"; gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0radio"; }; wlan5g { @@ -60,8 +56,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -144,10 +139,16 @@ &pcie { status = "okay"; - /* - * WRC-1167GHBK2-S has MT7615D for 2.4/5 GHz wifi, - * but it's not supported in OpenWrt. - */ +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <1>; + }; }; &xhci { diff --git a/target/linux/ramips/dts/WRC-1900GST.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts similarity index 77% rename from target/linux/ramips/dts/WRC-1900GST.dts rename to target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts index c910bdeec..7cbf2cd80 100644 --- a/target/linux/ramips/dts/WRC-1900GST.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts @@ -1,10 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 /dts-v1/; -#include "elecom_wrc-gst.dtsi" - +#include "mt7621_elecom_wrc-gst.dtsi" / { compatible = "elecom,wrc-1900gst", "mediatek,mt7621-soc"; model = "ELECOM WRC-1900GST"; - }; +}; diff --git a/target/linux/ramips/dts/WRC-2533GST.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts similarity index 72% rename from target/linux/ramips/dts/WRC-2533GST.dts rename to target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts index 7aecdccbf..aa15674b4 100644 --- a/target/linux/ramips/dts/WRC-2533GST.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts @@ -1,9 +1,8 @@ /dts-v1/; -#include "elecom_wrc-gst.dtsi" - +#include "mt7621_elecom_wrc-gst.dtsi" / { compatible = "elecom,wrc-2533gst", "mediatek,mt7621-soc"; model = "ELECOM WRC-2533GST"; - }; +}; diff --git a/target/linux/ramips/dts/elecom_wrc-gst.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gst.dtsi similarity index 95% rename from target/linux/ramips/dts/elecom_wrc-gst.dtsi rename to target/linux/ramips/dts/mt7621_elecom_wrc-gst.dtsi index 40f16adb8..b4aaec46f 100644 --- a/target/linux/ramips/dts/elecom_wrc-gst.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gst.dtsi @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -/dts-v1/; #include "mt7621.dtsi" @@ -14,11 +13,6 @@ led-upgrade = &led_power_green; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -48,8 +42,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/FIREWRT.dts b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts similarity index 92% rename from target/linux/ramips/dts/FIREWRT.dts rename to target/linux/ramips/dts/mt7621_firefly_firewrt.dts index 2abc01b2a..773cf82e3 100644 --- a/target/linux/ramips/dts/FIREWRT.dts +++ b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts @@ -16,11 +16,6 @@ led-upgrade = &led_power; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -35,8 +30,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; diff --git a/target/linux/ramips/dts/GHL-R-001.dts b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts similarity index 92% rename from target/linux/ramips/dts/GHL-R-001.dts rename to target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts index 59640a179..b7ddc51fb 100644 --- a/target/linux/ramips/dts/GHL-R-001.dts +++ b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts @@ -10,11 +10,6 @@ compatible = "gehua,ghl-r-001", "mediatek,mt7621-soc"; model = "GeHua GHL-R-001"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -36,8 +31,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/GB-PC1.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts similarity index 92% rename from target/linux/ramips/dts/GB-PC1.dts rename to target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts index e09e9f75a..c7a610590 100644 --- a/target/linux/ramips/dts/GB-PC1.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts @@ -16,18 +16,12 @@ led-upgrade = &led_status; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/GB-PC2.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts similarity index 92% rename from target/linux/ramips/dts/GB-PC2.dts rename to target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts index dff1b3d5f..bd3411b61 100644 --- a/target/linux/ramips/dts/GB-PC2.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts @@ -16,18 +16,12 @@ led-upgrade = &led_status; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -132,4 +126,3 @@ }; }; }; - diff --git a/target/linux/ramips/dts/HC5962.dts b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts similarity index 94% rename from target/linux/ramips/dts/HC5962.dts rename to target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts index 817b571d2..1d0471fd3 100644 --- a/target/linux/ramips/dts/HC5962.dts +++ b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts @@ -16,11 +16,6 @@ led-upgrade = &led_status; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -40,8 +35,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/WN-AX1167GR.dts b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts similarity index 91% rename from target/linux/ramips/dts/WN-AX1167GR.dts rename to target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts index cc7f7f240..40e11014d 100644 --- a/target/linux/ramips/dts/WN-AX1167GR.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts @@ -16,11 +16,6 @@ led-upgrade = &led_power; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -40,8 +35,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -96,8 +90,8 @@ read-only; }; - Factory: partition@40000 { - label = "Factory"; + factory: partition@40000 { + label = "factory"; reg = <0x40000 0x10000>; read-only; }; @@ -162,7 +156,7 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&Factory 0x0>; + mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/WN-GX300GR.dts b/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts similarity index 90% rename from target/linux/ramips/dts/WN-GX300GR.dts rename to target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts index 5399a4939..1e692ea3c 100644 --- a/target/linux/ramips/dts/WN-GX300GR.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts @@ -16,11 +16,6 @@ led-upgrade = &led_power; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -40,8 +35,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -96,8 +90,8 @@ read-only; }; - Factory: partition@40000 { - label = "Factory"; + factory: partition@40000 { + label = "factory"; reg = <0x40000 0x10000>; read-only; }; @@ -136,7 +130,7 @@ }; ðernet { - mtd-mac-address = <&Factory 0x4>; + mtd-mac-address = <&factory 0x4>; }; &pinctrl { @@ -155,7 +149,7 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&Factory 0x0>; + mediatek,mtd-eeprom = <&factory 0x0>; }; }; diff --git a/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts new file mode 100644 index 000000000..09bc9a3d5 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts @@ -0,0 +1,165 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "iodata,wnpr2600g", "mediatek,mt7621-soc"; + model = "I-O DATA WNPR2600G"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "wnpr2600g:green:power"; + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + notification { + label = "wnpr2600g:green:notification"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + + wlan2g { + label = "wnpr2600g:green:wlan2g"; + gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0radio"; + }; + + wlan5g { + label = "wnpr2600g:green:wlan5g"; + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1radio"; + }; + }; + + keys { + compatible = "gpio-keys"; + + auto { + label = "auto"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + reset { + label = "reset"; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x030000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x030000 0x010000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xda0000>; + }; + + partition@df0000 { + label = "manufacture"; + reg = <0xdf0000 0x190000>; + read-only; + }; + + partition@f80000 { + label = "storage"; + reg = <0xf80000 0x080000>; + read-only; + }; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "uart2", "uart3", "jtag", "wdt"; + ralink,function = "gpio"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&xhci { + status = "disabled"; +}; diff --git a/target/linux/ramips/dts/Newifi-D1.dts b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts similarity index 94% rename from target/linux/ramips/dts/Newifi-D1.dts rename to target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts index 2c180585c..7403a8760 100644 --- a/target/linux/ramips/dts/Newifi-D1.dts +++ b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts @@ -14,11 +14,7 @@ led-failsafe = &led_blue; led-running = &led_blue; led-upgrade = &led_blue; - }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; + label-mac-device = ðernet; }; chosen { @@ -46,8 +42,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/RE6500.dts b/target/linux/ramips/dts/mt7621_linksys_re6500.dts similarity index 94% rename from target/linux/ramips/dts/RE6500.dts rename to target/linux/ramips/dts/mt7621_linksys_re6500.dts index de5c31060..a7f1fdd26 100644 --- a/target/linux/ramips/dts/RE6500.dts +++ b/target/linux/ramips/dts/mt7621_linksys_re6500.dts @@ -16,11 +16,6 @@ led-upgrade = &led_power; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -40,8 +35,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; diff --git a/target/linux/ramips/dts/AP-MT7621A-V60.dts b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts similarity index 96% rename from target/linux/ramips/dts/AP-MT7621A-V60.dts rename to target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts index b613c9c37..15a4d71c1 100644 --- a/target/linux/ramips/dts/AP-MT7621A-V60.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts @@ -6,11 +6,6 @@ compatible = "mediatek,ap-mt7621a-v60", "mediatek,mt7621-soc"; model = "Mediatek AP-MT7621A-V60 EVB"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; diff --git a/target/linux/ramips/dts/MT7621.dts b/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts similarity index 92% rename from target/linux/ramips/dts/MT7621.dts rename to target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts index 290083a85..177154b8d 100644 --- a/target/linux/ramips/dts/MT7621.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts @@ -6,11 +6,6 @@ compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc"; model = "Mediatek MT7621 evaluation board"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x2000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; diff --git a/target/linux/ramips/dts/RB750Gr3.dts b/target/linux/ramips/dts/mt7621_mikrotik_rb750gr3.dts similarity index 95% rename from target/linux/ramips/dts/RB750Gr3.dts rename to target/linux/ramips/dts/mt7621_mikrotik_rb750gr3.dts index 4a303eddd..b164ed2c7 100644 --- a/target/linux/ramips/dts/RB750Gr3.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_rb750gr3.dts @@ -17,11 +17,6 @@ led-upgrade = &led_usr; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -42,8 +37,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; mode { label = "mode"; diff --git a/target/linux/ramips/dts/RBM11G.dts b/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts similarity index 95% rename from target/linux/ramips/dts/RBM11G.dts rename to target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts index ce8d7208f..f13a77960 100644 --- a/target/linux/ramips/dts/RBM11G.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts @@ -16,11 +16,6 @@ led-upgrade = &led_usr; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -60,8 +55,8 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; + res { label = "reset"; gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; @@ -82,7 +77,6 @@ }; }; - &spi0 { status = "okay"; @@ -149,7 +143,6 @@ mtd-mac-address-increment = <1>; }; - &pinctrl { state_default: pinctrl0 { gpio { diff --git a/target/linux/ramips/dts/RBM33G.dts b/target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts similarity index 96% rename from target/linux/ramips/dts/RBM33G.dts rename to target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts index f40c4f733..45b2182de 100644 --- a/target/linux/ramips/dts/RBM33G.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts @@ -16,11 +16,6 @@ led-upgrade = &led_usr; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -35,8 +30,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; res { label = "res"; @@ -93,7 +87,6 @@ }; }; - &spi0 { status = "okay"; @@ -174,7 +167,6 @@ mtd-mac-address-increment = <1>; }; - &pinctrl { state_default: pinctrl0 { gpio { diff --git a/target/linux/ramips/dts/WITI.dtsi b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts similarity index 96% rename from target/linux/ramips/dts/WITI.dtsi rename to target/linux/ramips/dts/mt7621_mqmaker_witi.dts index 6e474e90b..6d13ac147 100644 --- a/target/linux/ramips/dts/WITI.dtsi +++ b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts @@ -7,6 +7,7 @@ / { compatible = "mqmaker,witi", "mediatek,mt7621-soc"; + model = "MQmaker WiTi"; chosen { bootargs = "console=ttyS0,57600"; @@ -25,8 +26,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/WR1201.dts b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts similarity index 93% rename from target/linux/ramips/dts/WR1201.dts rename to target/linux/ramips/dts/mt7621_mtc_wr1201.dts index 08c9b2c18..fb3efe6d7 100644 --- a/target/linux/ramips/dts/WR1201.dts +++ b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts @@ -14,11 +14,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; + label-mac-device = ðernet; }; chosen { @@ -52,8 +48,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -89,7 +84,7 @@ }; factory: partition@40000 { - label = "Factory"; + label = "factory"; reg = <0x40000 0x10000>; read-only; }; @@ -147,7 +142,6 @@ }; }; - &pinctrl { state_default: pinctrl0 { gpio { diff --git a/target/linux/ramips/dts/EX6150.dts b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts similarity index 96% rename from target/linux/ramips/dts/EX6150.dts rename to target/linux/ramips/dts/mt7621_netgear_ex6150.dts index a5827f270..fc8a68a13 100644 --- a/target/linux/ramips/dts/EX6150.dts +++ b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts @@ -17,11 +17,6 @@ led-upgrade = &power_amber; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -78,8 +73,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; diff --git a/target/linux/ramips/dts/R6220.dts b/target/linux/ramips/dts/mt7621_netgear_r6220.dts similarity index 91% rename from target/linux/ramips/dts/R6220.dts rename to target/linux/ramips/dts/mt7621_netgear_r6220.dts index 28c3a3938..4779b71c1 100644 --- a/target/linux/ramips/dts/R6220.dts +++ b/target/linux/ramips/dts/mt7621_netgear_r6220.dts @@ -1,10 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /dts-v1/; -#include "R6220.dtsi" - -#include -#include +#include "mt7621_netgear_sercomm_ayx.dtsi" / { compatible = "netgear,r6220", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_netgear_r6260.dts b/target/linux/ramips/dts/mt7621_netgear_r6260.dts new file mode 100644 index 000000000..8251fe595 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_netgear_r6260.dts @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "mt7621_netgear_sercomm_chj.dtsi" + +/ { + compatible = "netgear,r6260", "mediatek,mt7621-soc"; + model = "Netgear R6260"; +}; + +&led_power { + label = "r6260:green:power"; +}; + +&led_usb { + label = "r6260:green:usb"; +}; + +&led_internet { + label = "r6260:green:wan"; +}; + +&led_wifi { + label = "r6260:green:wifi"; +}; diff --git a/target/linux/ramips/dts/mt7621_netgear_r6350.dts b/target/linux/ramips/dts/mt7621_netgear_r6350.dts new file mode 100644 index 000000000..c1e3a0889 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_netgear_r6350.dts @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "mt7621_netgear_sercomm_chj.dtsi" + +/ { + compatible = "netgear,r6350", "mediatek,mt7621-soc"; + model = "Netgear R6350"; +}; + +&led_power { + label = "r6350:green:power"; +}; + +&led_usb { + label = "r6350:green:usb"; +}; + +&led_internet { + label = "r6350:green:wan"; +}; + +&led_wifi { + label = "r6350:green:wifi"; +}; diff --git a/target/linux/ramips/dts/mt7621_netgear_r6800.dts b/target/linux/ramips/dts/mt7621_netgear_r6800.dts new file mode 100644 index 000000000..0993afe4c --- /dev/null +++ b/target/linux/ramips/dts/mt7621_netgear_r6800.dts @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "mt7621_netgear_sercomm_bzv.dtsi" + +/ { + compatible = "netgear,r6800", "mediatek,mt7621-soc"; + model = "Netgear R6800"; + + aliases { + led-boot = &led_power_white; + led-failsafe = &led_power_orange; + led-running = &led_power_white; + led-upgrade = &led_power_orange; + label-mac-device = ðernet; + }; + + leds { + compatible = "gpio-leds"; + + led_power_orange: power_orange { + gpios = <&gpio_expander 0 GPIO_ACTIVE_LOW>; + label = "r6800:orange:power"; + }; + + led_power_white: power_white { + gpios = <&gpio_expander 1 GPIO_ACTIVE_LOW>; + label = "r6800:white:power"; + }; + + wan_orange { + gpios = <&gpio_expander 2 GPIO_ACTIVE_LOW>; + label = "r6800:orange:wan"; + }; + + wan_white { + gpios = <&gpio_expander 3 GPIO_ACTIVE_LOW>; + label = "r6800:white:wan"; + }; + + wlan2g { + gpios = <&gpio_expander 4 GPIO_ACTIVE_LOW>; + label = "r6800:white:wlan2g"; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + gpios = <&gpio_expander 5 GPIO_ACTIVE_LOW>; + label = "r6800:white:wlan5g"; + linux,default-trigger = "phy1tpt"; + }; + + usb2 { + gpios = <&gpio_expander 6 GPIO_ACTIVE_LOW>; + label = "r6800:white:usb2"; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port2>; + }; + + usb3 { + gpios = <&gpio_expander 7 GPIO_ACTIVE_LOW>; + label = "r6800:white:usb3"; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port1>; + }; + + lan1_orange { + gpios = <&gpio_expander 8 GPIO_ACTIVE_LOW>; + label = "r6800:orange:lan1"; + }; + + lan1_white { + gpios = <&gpio_expander 9 GPIO_ACTIVE_LOW>; + label = "r6800:white:lan1"; + }; + + lan2_orange { + gpios = <&gpio_expander 10 GPIO_ACTIVE_LOW>; + label = "r6800:orange:lan2"; + }; + + lan2_white { + gpios = <&gpio_expander 11 GPIO_ACTIVE_LOW>; + label = "r6800:white:lan2"; + }; + + lan3_orange { + gpios = <&gpio_expander 12 GPIO_ACTIVE_LOW>; + label = "r6800:orange:lan3"; + }; + + lan3_white { + gpios = <&gpio_expander 13 GPIO_ACTIVE_LOW>; + label = "r6800:white:lan3"; + }; + + lan4_orange { + gpios = <&gpio_expander 14 GPIO_ACTIVE_LOW>; + label = "r6800:orange:lan4"; + }; + + lan4_white { + gpios = <&gpio_expander 15 GPIO_ACTIVE_LOW>; + label = "r6800:white:lan4"; + }; + + wps { + gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>; + label = "r6800:white:wps"; + }; + + wlan { + gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; + label = "r6800:white:wlan"; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_netgear_r6850.dts b/target/linux/ramips/dts/mt7621_netgear_r6850.dts new file mode 100644 index 000000000..5accbbdbd --- /dev/null +++ b/target/linux/ramips/dts/mt7621_netgear_r6850.dts @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "mt7621_netgear_sercomm_chj.dtsi" + +/ { + compatible = "netgear,r6850", "mediatek,mt7621-soc"; + model = "Netgear R6850"; +}; + +&led_power { + label = "r6850:green:power"; +}; + +&led_usb { + label = "r6850:green:usb"; +}; + +&led_internet { + label = "r6850:green:wan"; +}; + +&led_wifi { + label = "r6850:green:wifi"; +}; diff --git a/target/linux/ramips/dts/R6220.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi similarity index 84% rename from target/linux/ramips/dts/R6220.dtsi rename to target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi index c9268b0ca..864952f25 100644 --- a/target/linux/ramips/dts/R6220.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -/dts-v1/; #include "mt7621.dtsi" @@ -14,17 +13,35 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; + label-mac-device = ðernet; }; chosen { bootargs = "console=ttyS0,57600"; }; + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wifi { + label = "wifi"; + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + leds { compatible = "gpio-leds"; @@ -52,29 +69,6 @@ }; }; - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; - - wps { - label = "wps"; - gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wifi { - label = "wifi"; - gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - reset { - label = "reset"; - gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - reg_usb_vbus: regulator { compatible = "regulator-fixed"; regulator-name = "usb_vbus"; @@ -95,8 +89,8 @@ &pcie0 { wifi@0,0 { - compatible = "pci14c3,7662"; - reg = <0x0000 0 0 0 0>; + compatible = "mediatek,mt76"; + reg = <0x0 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; }; @@ -104,15 +98,15 @@ &pcie1 { wifi@0,0 { - compatible = "pci14c3,7603"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + compatible = "mediatek,mt76"; + reg = <0x0 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <2400000 2500000>; }; }; ðernet { - mtd-mac-address = <&factory 0x00000004>; + mtd-mac-address = <&factory 0x4>; }; &pinctrl { diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi new file mode 100644 index 000000000..500ec06e2 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi @@ -0,0 +1,155 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "mediatek,mt7621-soc"; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + rfkill { + label = "rfkill"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&xhci { + hub_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + hub_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&state_default { + gpio { + ralink,group = "uart3", "uart2", "jtag", "wdt"; + ralink,function = "gpio"; + }; +}; + +&i2c { + status = "okay"; + + gpio_expander: i2c0gpio-expander@20{ + #gpio-cells = <2>; + #interrupt-cells = <2>; + compatible = "semtech,sx1503q"; + reg = <0x20>; + interrupt-parent = <&gic>; + interrupts = <16 0>; + + gpio-controller; + interrupt-controller; + + pinctrl-names = "default"; + pinctrl-0 = <&gpio4_cfg_pins>; + + gpio4_cfg_pins: gpio4-cfg { + pins = "gpio4"; + bias-pull-up; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "SC PART_MAP"; + reg = <0x100000 0x100000>; + read-only; + }; + + partition@200000 { + label = "kernel"; + reg = <0x200000 0x400000>; + }; + + partition@600000 { + label = "ubi"; + reg = <0x600000 0x2800000>; + }; + + partition@2e00000 { + label = "reserved0"; + reg = <0x2e00000 0x1800000>; + read-only; + }; + + factory: partition@4600000 { + label = "factory"; + reg = <0x4600000 0x200000>; + read-only; + }; + + partition@4800000 { + label = "reserved1"; + reg = <0x4800000 0x3800000>; + read-only; + }; + }; +}; diff --git a/target/linux/ramips/dts/R6350.dts b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi similarity index 76% rename from target/linux/ramips/dts/R6350.dts rename to target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi index 538fa21ac..cf9d1c607 100644 --- a/target/linux/ramips/dts/R6350.dts +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -/dts-v1/; #include "mt7621.dtsi" @@ -7,19 +6,14 @@ #include / { - compatible = "netgear,r6350", "mediatek,mt7621-soc"; - model = "Netgear R6350"; + compatible = "mediatek,mt7621-soc"; aliases { led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; + label-mac-device = ðernet; }; chosen { @@ -30,32 +24,27 @@ compatible = "gpio-leds"; led_power: power { - label = "r6350:green:power"; gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; }; - usb { - label = "r6350:green:usb"; + led_usb: usb { gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>; linux,default-trigger = "usbport"; }; - internet { - label = "r6350:green:wan"; + led_internet: internet { gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; }; - wifi { - label = "r6350:green:wifi"; + led_wifi: wifi { gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy0tpt"; }; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; @@ -70,14 +59,51 @@ }; }; - gpio_export { - compatible = "gpio-export"; - #size-cells = <0>; + reg_usb_vbus: regulator { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio0 10 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; - usbpower { - gpio-export,name = "usbpower"; - gpio-export,output = <1>; - gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>; +&xhci { + vbus-supply = <®_usb_vbus>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "uart3", "uart2", "jtag", "wdt"; + ralink,function = "gpio"; }; }; }; @@ -131,28 +157,3 @@ }; }; }; - -&pcie { - status = "okay"; -}; - -&pcie1 { - wifi@0,0 { - reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; - ieee80211-freq-limit = <2400000 2500000>; - }; -}; - -ðernet { - mtd-mac-address = <&factory 0x4>; -}; - -&pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "uart3", "uart2", "jtag", "wdt"; - ralink,function = "gpio"; - }; - }; -}; diff --git a/target/linux/ramips/dts/WNDR3700V5.dts b/target/linux/ramips/dts/mt7621_netgear_wndr3700-v5.dts similarity index 73% rename from target/linux/ramips/dts/WNDR3700V5.dts rename to target/linux/ramips/dts/mt7621_netgear_wndr3700-v5.dts index 475ddb7e9..a5c8b21d5 100644 --- a/target/linux/ramips/dts/WNDR3700V5.dts +++ b/target/linux/ramips/dts/mt7621_netgear_wndr3700-v5.dts @@ -1,34 +1,31 @@ // SPDX-License-Identifier: GPL-2.0 /dts-v1/; -#include "R6220.dtsi" - -#include -#include +#include "mt7621_netgear_sercomm_ayx.dtsi" / { compatible = "netgear,wndr3700-v5", "mediatek,mt7621-soc"; - model = "Netgear WNDR3700v5"; + model = "Netgear WNDR3700 v5"; }; &led_power { - label = "wndr3700v5:green:power"; + label = "wndr3700-v5:green:power"; }; &led_usb { - label = "wndr3700v5:green:usb"; + label = "wndr3700-v5:green:usb"; }; &led_internet { - label = "wndr3700v5:green:wan"; + label = "wndr3700-v5:green:wan"; }; &led_wifi { - label = "wndr3700v5:green:wifi"; + label = "wndr3700-v5:green:wifi"; }; &led_wps { - label = "wndr3700v5:green:wps"; + label = "wndr3700-v5:green:wps"; }; &spi0 { diff --git a/target/linux/ramips/dts/WF-2881.dts b/target/linux/ramips/dts/mt7621_netis_wf-2881.dts similarity index 81% rename from target/linux/ramips/dts/WF-2881.dts rename to target/linux/ramips/dts/mt7621_netis_wf-2881.dts index bc9d6d722..1f16174cf 100644 --- a/target/linux/ramips/dts/WF-2881.dts +++ b/target/linux/ramips/dts/mt7621_netis_wf-2881.dts @@ -14,11 +14,7 @@ led-failsafe = &led_wps; led-running = &led_wps; led-upgrade = &led_wps; - }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; + label-mac-device = ðernet; }; chosen { @@ -42,8 +38,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -63,13 +58,7 @@ partition@0 { label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x1000>; + reg = <0x0 0x80000>; read-only; }; @@ -88,7 +77,7 @@ partition@140000 { compatible = "denx,uimage"; label = "firmware"; - reg = <0x140000 0x7E40000>; + reg = <0x140000 0x7e40000>; }; }; }; @@ -98,29 +87,41 @@ }; &pcie0 { - mt76@0,0 { + wifi@0,0 { + compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + led-active-low; + }; }; }; &pcie1 { - mt76@0,0 { + wifi@0,0 { + compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x0000>; ieee80211-freq-limit = <2400000 2500000>; + + led { + led-sources = <2>; + led-active-low; + }; }; }; ðernet { - mtd-mac-address = <&factory 0xe006>; + mtd-mac-address = <&factory 0xe000>; }; &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "uart3", "jtag"; + ralink,group = "uart3", "uart2"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/K2P.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts similarity index 91% rename from target/linux/ramips/dts/K2P.dts rename to target/linux/ramips/dts/mt7621_phicomm_k2p.dts index 0b330aa20..909df622f 100644 --- a/target/linux/ramips/dts/K2P.dts +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts @@ -16,11 +16,6 @@ led-upgrade = &led_blue; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -45,8 +40,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -114,7 +108,7 @@ }; ðernet { - mtd-mac-address = <&factory 0xe006>; + mtd-mac-address = <&factory 0xe000>; }; &pinctrl { diff --git a/target/linux/ramips/dts/VR500.dts b/target/linux/ramips/dts/mt7621_planex_vr500.dts similarity index 91% rename from target/linux/ramips/dts/VR500.dts rename to target/linux/ramips/dts/mt7621_planex_vr500.dts index 4d74f2c9c..3d8d34648 100644 --- a/target/linux/ramips/dts/VR500.dts +++ b/target/linux/ramips/dts/mt7621_planex_vr500.dts @@ -16,11 +16,6 @@ led-upgrade = &led_power; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -35,8 +30,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -86,6 +80,10 @@ }; }; +ðernet { + mtd-mac-address = <&factory 0xe000>; +}; + &pinctrl { state_default: pinctrl0 { gpio { diff --git a/target/linux/ramips/dts/SK-WB8.dts b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts similarity index 94% rename from target/linux/ramips/dts/SK-WB8.dts rename to target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts index 9511432e1..84cc4541e 100644 --- a/target/linux/ramips/dts/SK-WB8.dts +++ b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts @@ -15,11 +15,6 @@ led-upgrade = &led_wps; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -41,13 +36,14 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; + wps { label = "wps"; gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; linux,code = ; }; + reset { label = "reset"; gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; diff --git a/target/linux/ramips/dts/SAP-G3200U3.dts b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts similarity index 93% rename from target/linux/ramips/dts/SAP-G3200U3.dts rename to target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts index d1d6a534b..4194154f0 100644 --- a/target/linux/ramips/dts/SAP-G3200U3.dts +++ b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts @@ -9,11 +9,6 @@ compatible = "storylink,sap-g3200u3", "mediatek,mt7621-soc"; model = "STORYLiNK SAP-G3200U3"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -30,8 +25,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/Telco-Electronics-X1.dts b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts similarity index 95% rename from target/linux/ramips/dts/Telco-Electronics-X1.dts rename to target/linux/ramips/dts/mt7621_telco-electronics_x1.dts index 33fc1810a..9e8f9f75e 100644 --- a/target/linux/ramips/dts/Telco-Electronics-X1.dts +++ b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts @@ -23,8 +23,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -81,11 +80,6 @@ gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; }; }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; }; &spi0 { diff --git a/target/linux/ramips/dts/Timecloud.dts b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts similarity index 92% rename from target/linux/ramips/dts/Timecloud.dts rename to target/linux/ramips/dts/mt7621_thunder_timecloud.dts index 1b8aa9d85..4ff845543 100644 --- a/target/linux/ramips/dts/Timecloud.dts +++ b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts @@ -16,11 +16,6 @@ led-upgrade = &led_statuso; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -40,8 +35,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/mt7621_totolink_a7000r.dts b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts new file mode 100644 index 000000000..68bc8afa1 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "totolink,a7000r", "mediatek,mt7621-soc"; + model = "TOTOLINK A7000R"; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + leds { + compatible = "gpio-leds"; + + led_sys: sys { + label = "a7000r:blue:sys"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + 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 = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "wdt"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/RE350.dts b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts similarity index 95% rename from target/linux/ramips/dts/RE350.dts rename to target/linux/ramips/dts/mt7621_tplink_re350-v1.dts index 5414fe147..7859f611e 100644 --- a/target/linux/ramips/dts/RE350.dts +++ b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts @@ -16,11 +16,6 @@ led-upgrade = &led_power; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; @@ -65,8 +60,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; led { label = "led"; diff --git a/target/linux/ramips/dts/mt7621_tplink_re650-v1.dts b/target/linux/ramips/dts/mt7621_tplink_re650-v1.dts new file mode 100644 index 000000000..23b559daa --- /dev/null +++ b/target/linux/ramips/dts/mt7621_tplink_re650-v1.dts @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "tplink,re650-v1", "mediatek,mt7621-soc"; + model = "TP-Link RE650 v1"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ðernet; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "re650-v1:blue:power"; + gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; + }; + + wifi2g { + label = "re650-v1:blue:wifi2G"; + gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; + }; + + wifi5g { + label = "re650-v1:blue:wifi5G"; + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; + }; + + wps_red { + label = "re650-v1:red:wps"; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + }; + + wps_blue { + label = "re650-v1:blue:wps"; + gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; + }; + + eth_act { + label = "re650-v1:green:eth_act"; + gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; + }; + + eth_link { + label = "re650-v1:green:eth_link"; + gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + + power { + label = "power"; + gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + + led { + label = "led"; + gpios = <&gpio0 30 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + w25q64@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + 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 0xde0000>; + }; + + config: partition@e00000 { + label = "config"; + reg = <0xe00000 0x50000>; + read-only; + }; + + /* range 0xe50000 to 0xff0000 is empty in vendor + * firmware, so we do not use it either + */ + + radio: partition@ff0000 { + label = "radio"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0>; + mtd-mac-address = <&config 0x10008>; + mtd-mac-address-increment = <1>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x8000>; + mtd-mac-address = <&config 0x10008>; + mtd-mac-address-increment = <2>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +ðernet { + mtd-mac-address = <&config 0x10008>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "rgmii2", "wdt"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/UBNT-ERX-SFP.dts b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx-sfp.dts similarity index 90% rename from target/linux/ramips/dts/UBNT-ERX-SFP.dts rename to target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx-sfp.dts index 7de37804a..06f887a37 100644 --- a/target/linux/ramips/dts/UBNT-ERX-SFP.dts +++ b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx-sfp.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "UBNT-ER-e50.dtsi" +#include "mt7621_ubiquiti_edgerouterx.dtsi" #include diff --git a/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dts b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dts new file mode 100644 index 000000000..e78fdcf10 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dts @@ -0,0 +1,7 @@ +/dts-v1/; + +#include "mt7621_ubiquiti_edgerouterx.dtsi" + +/ { + model = "UBNT-ERX"; +}; diff --git a/target/linux/ramips/dts/UBNT-ER-e50.dtsi b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi similarity index 93% rename from target/linux/ramips/dts/UBNT-ER-e50.dtsi rename to target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi index 1d54713fe..d03c3256e 100644 --- a/target/linux/ramips/dts/UBNT-ER-e50.dtsi +++ b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi @@ -6,9 +6,8 @@ / { compatible = "ubiquiti,edgerouterx", "mediatek,mt7621-soc"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; + aliases { + label-mac-device = ðernet; }; chosen { @@ -16,8 +15,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/U7621-06-256M-16M.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts similarity index 91% rename from target/linux/ramips/dts/U7621-06-256M-16M.dts rename to target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts index e6cc4c920..603e2dd2d 100644 --- a/target/linux/ramips/dts/U7621-06-256M-16M.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts @@ -34,19 +34,14 @@ /dts-v1/; -#include "U7621-06.dtsi" +#include "mt7621_unielec_u7621-06.dtsi" #include #include / { - compatible = "unielec,u7621-06-256m-16m", "unielec,u7621-06", "mediatek,mt7621-soc"; - model = "UniElec U7621-06 (256M RAM/16M flash)"; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; + compatible = "unielec,u7621-06-16m", "unielec,u7621-06", "mediatek,mt7621-soc"; + model = "UniElec U7621-06 (16M flash)"; }; &spi0 { diff --git a/target/linux/ramips/dts/U7621-06-512M-64M.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts similarity index 90% rename from target/linux/ramips/dts/U7621-06-512M-64M.dts rename to target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts index d710477c1..3498be044 100644 --- a/target/linux/ramips/dts/U7621-06-512M-64M.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts @@ -35,19 +35,14 @@ /dts-v1/; -#include "U7621-06.dtsi" +#include "mt7621_unielec_u7621-06.dtsi" #include #include / { - compatible = "unielec,u7621-06-512m-64m", "unielec,u7621-06", "mediatek,mt7621-soc"; - model = "UniElec U7621-06 (512M RAM/64M flash)"; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; - }; + compatible = "unielec,u7621-06-64m", "unielec,u7621-06", "mediatek,mt7621-soc"; + model = "UniElec U7621-06 (64M flash)"; }; &spi0 { diff --git a/target/linux/ramips/dts/U7621-06.dtsi b/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi similarity index 98% rename from target/linux/ramips/dts/U7621-06.dtsi rename to target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi index 301edfe68..5bd7f0b92 100644 --- a/target/linux/ramips/dts/U7621-06.dtsi +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi @@ -63,8 +63,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/11ACNAS.dts b/target/linux/ramips/dts/mt7621_wevo_11acnas.dts similarity index 78% rename from target/linux/ramips/dts/11ACNAS.dts rename to target/linux/ramips/dts/mt7621_wevo_11acnas.dts index 2b1556696..ec3154263 100644 --- a/target/linux/ramips/dts/11ACNAS.dts +++ b/target/linux/ramips/dts/mt7621_wevo_11acnas.dts @@ -1,16 +1,11 @@ /dts-v1/; -#include "W2914NSV2.dtsi" +#include "mt7621_wevo_w2914ns-v2.dtsi" / { compatible = "wevo,11acnas", "wevo,w2914ns-v2", "mediatek,mt7621-soc"; model = "WeVO 11AC NAS Router"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; - leds { compatible = "gpio-leds"; diff --git a/target/linux/ramips/dts/W2914NSV2.dts b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dts similarity index 74% rename from target/linux/ramips/dts/W2914NSV2.dts rename to target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dts index bd8e80944..816f6b1c0 100644 --- a/target/linux/ramips/dts/W2914NSV2.dts +++ b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dts @@ -1,15 +1,10 @@ /dts-v1/; -#include "W2914NSV2.dtsi" +#include "mt7621_wevo_w2914ns-v2.dtsi" / { model = "WeVO W2914NS v2"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - leds { compatible = "gpio-leds"; diff --git a/target/linux/ramips/dts/W2914NSV2.dtsi b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi similarity index 83% rename from target/linux/ramips/dts/W2914NSV2.dtsi rename to target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi index 63cff0c10..6ad3ef111 100644 --- a/target/linux/ramips/dts/W2914NSV2.dtsi +++ b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi @@ -11,8 +11,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -35,10 +34,11 @@ &spi0 { status = "okay"; - m25p80@0 { + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <10000000>; + spi-max-frequency = <80000000>; + m25p,fast-read; partitions { compatible = "fixed-partitions"; @@ -78,18 +78,28 @@ &pcie0 { wifi@0,0 { - compatible = "pci14c3,7603"; + compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x0000>; + + led { + led-sources = <0>; + led-active-low; + }; }; }; &pcie1 { wifi@0,0 { - compatible = "pci14c3,7662"; + compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + led-active-low; + }; }; }; @@ -100,7 +110,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "wdt", "rgmii2", "jtag", "mdio"; + ralink,group = "wdt", "rgmii2"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts b/target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts new file mode 100644 index 000000000..757e487bc --- /dev/null +++ b/target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts @@ -0,0 +1,147 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "xiaomi,mir3g-v2", "mediatek,mt7621-soc"; + model = "Xiaomi Mi Router 3G v2"; + + aliases { + led-boot = &led_status_yellow; + led-failsafe = &led_status_yellow; + led-running = &led_status_blue; + led-upgrade = &led_status_yellow; + }; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue: status_blue { + label = "mir3gv2:blue:status"; + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; + }; + + led_status_yellow: status_yellow { + label = "mir3gv2:yellow:status"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <80000000>; + + 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 { + label = "Bdata"; + reg = <0x40000 0x10000>; + read-only; + }; + + factory: partition@50000 { + label = "factory"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "crash"; + reg = <0x60000 0x10000>; + read-only; + }; + + partition@70000 { + label = "cfg_bak"; + reg = <0x70000 0x10000>; + read-only; + }; + + partition@80000 { + label = "overlay"; + reg = <0x80000 0x100000>; + read-only; + }; + + firmware: partition@180000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x180000 0xe80000>; + }; + }; + }; +}; + +&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>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "pci14c3,7603"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; + mediatek,portmap = "lllwl"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "jtag", "uart2", "uart3", "wdt"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/MIR3G.dts b/target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts similarity index 96% rename from target/linux/ramips/dts/MIR3G.dts rename to target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts index b0b63f808..29ac01989 100644 --- a/target/linux/ramips/dts/MIR3G.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts @@ -16,11 +16,6 @@ led-upgrade = &led_status_yellow; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; - chosen { bootargs = "console=ttyS0,115200n8"; }; @@ -59,9 +54,8 @@ }; }; - button { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + keys { + compatible = "gpio-keys"; reset { label = "reset"; @@ -110,7 +104,7 @@ }; factory: partition@100000 { - label = "Factory"; + label = "factory"; reg = <0x100000 0x40000>; read-only; }; diff --git a/target/linux/ramips/dts/MIR3P.dts b/target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts similarity index 92% rename from target/linux/ramips/dts/MIR3P.dts rename to target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts index cd929e5e3..9482889b8 100644 --- a/target/linux/ramips/dts/MIR3P.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts @@ -17,11 +17,6 @@ led-upgrade = &led_status_yellow; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x1c000000>, <0x20000000 0x04000000>; - }; - chosen { bootargs = "console=ttyS0,115200n8"; }; @@ -65,9 +60,8 @@ }; }; - button { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + keys { + compatible = "gpio-keys"; reset { label = "reset"; @@ -116,7 +110,7 @@ }; factory: partition@c0000 { - label = "Factory"; + label = "factory"; reg = <0x0c0000 0x40000>; read-only; }; @@ -161,15 +155,16 @@ &pcie0 { wifi@0,0 { - compatible = "pci14c3,7615"; + compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; }; }; &pcie1 { wifi@0,0 { - compatible = "pci14c3,7615"; + compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; diff --git a/target/linux/ramips/dts/XiaoYu-C5.dts b/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts similarity index 99% rename from target/linux/ramips/dts/XiaoYu-C5.dts rename to target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts index 8d7cf3ecf..4b12ee538 100644 --- a/target/linux/ramips/dts/XiaoYu-C5.dts +++ b/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts @@ -16,7 +16,7 @@ led-upgrade = &led_sys; label-mac-device = ðernet; }; - + memory@0 { device_type = "memory"; reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; diff --git a/target/linux/ramips/dts/CreativeBox-v1.dts b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts similarity index 94% rename from target/linux/ramips/dts/CreativeBox-v1.dts rename to target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts index 06cec3b02..f33a6fce4 100644 --- a/target/linux/ramips/dts/CreativeBox-v1.dts +++ b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts @@ -17,12 +17,6 @@ led-upgrade = &led_sys; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x1C000000>, - <0x20000000 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -60,8 +54,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/WR1200JS.dts b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts similarity index 94% rename from target/linux/ramips/dts/WR1200JS.dts rename to target/linux/ramips/dts/mt7621_youhua_wr1200js.dts index 6fd087ca0..7f7d5cb27 100644 --- a/target/linux/ramips/dts/WR1200JS.dts +++ b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts @@ -14,11 +14,6 @@ led-failsafe = &led_wps; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -45,8 +40,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/YOUKU-YK2.dts b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts similarity index 94% rename from target/linux/ramips/dts/YOUKU-YK2.dts rename to target/linux/ramips/dts/mt7621_youku_yk-l2.dts index 55fdf2f22..3a9794da0 100644 --- a/target/linux/ramips/dts/YOUKU-YK2.dts +++ b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts @@ -17,11 +17,6 @@ led-upgrade = &led_wps; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x10000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -49,8 +44,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/ZBT-WE1326.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts similarity index 91% rename from target/linux/ramips/dts/ZBT-WE1326.dts rename to target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts index 2f6f94f3f..9d4ab65d3 100644 --- a/target/linux/ramips/dts/ZBT-WE1326.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts @@ -7,15 +7,18 @@ / { compatible = "zbtlink,zbt-we1326", "mediatek,mt7621-soc"; - model = "ZBT-WE1326"; + model = "Zbtlink ZBT-WE1326"; + + aliases { + label-mac-device = &wifi1; + }; chosen { bootargs = "console=ttyS0,115200"; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -83,7 +86,7 @@ }; &pcie0 { - mt76@0,0 { + wifi0: mt76@0,0 { reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; @@ -91,7 +94,7 @@ }; &pcie1 { - mt76@0,0 { + wifi1: mt76@0,0 { reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x0000>; ieee80211-freq-limit = <2400000 2500000>; diff --git a/target/linux/ramips/dts/ZBT-WE3526.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts similarity index 90% rename from target/linux/ramips/dts/ZBT-WE3526.dts rename to target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts index 30c941c9c..9ee88d964 100644 --- a/target/linux/ramips/dts/ZBT-WE3526.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts @@ -7,12 +7,7 @@ / { compatible = "zbtlink,zbt-we3526", "mediatek,mt7621-soc"; - model = "ZBT-WE3526"; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; - }; + model = "Zbtlink ZBT-WE3526"; chosen { bootargs = "console=ttyS0,115200"; @@ -25,8 +20,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/ZBT-WG2626.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts similarity index 91% rename from target/linux/ramips/dts/ZBT-WG2626.dts rename to target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts index 4ceee9bd6..d1cf30880 100644 --- a/target/linux/ramips/dts/ZBT-WG2626.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts @@ -7,7 +7,7 @@ / { compatible = "zbtlink,zbt-wg2626", "mediatek,mt7621-soc"; - model = "ZBT-WG2626"; + model = "Zbtlink ZBT-WG2626"; aliases { led-boot = &led_status; @@ -16,11 +16,6 @@ led-upgrade = &led_status; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; - }; - chosen { bootargs = "console=ttyS0,115200"; }; @@ -32,8 +27,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/ZBT-WG3526-16M.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526-16m.dts similarity index 65% rename from target/linux/ramips/dts/ZBT-WG3526-16M.dts rename to target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526-16m.dts index 73fc55e1f..a9bd9180f 100644 --- a/target/linux/ramips/dts/ZBT-WG3526-16M.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526-16m.dts @@ -1,10 +1,10 @@ /dts-v1/; -#include "ZBT-WG3526.dtsi" +#include "mt7621_zbtlink_zbt-wg3526.dtsi" / { compatible = "zbtlink,zbt-wg3526-16m", "zbtlink,zbt-wg3526", "mediatek,mt7621-soc"; - model = "ZBT-WG3526 (16M)"; + model = "Zbtlink ZBT-WG3526 (16M)"; }; &firmware { diff --git a/target/linux/ramips/dts/ZBT-WG3526-32M.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526-32m.dts similarity index 65% rename from target/linux/ramips/dts/ZBT-WG3526-32M.dts rename to target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526-32m.dts index d61d38dd9..e7add46d3 100644 --- a/target/linux/ramips/dts/ZBT-WG3526-32M.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526-32m.dts @@ -1,10 +1,10 @@ /dts-v1/; -#include "ZBT-WG3526.dtsi" +#include "mt7621_zbtlink_zbt-wg3526.dtsi" / { compatible = "zbtlink,zbt-wg3526-32m", "zbtlink,zbt-wg3526", "mediatek,mt7621-soc"; - model = "ZBT-WG3526 (32M)"; + model = "Zbtlink ZBT-WG3526 (32M)"; }; &firmware { diff --git a/target/linux/ramips/dts/ZBT-WG3526.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi similarity index 91% rename from target/linux/ramips/dts/ZBT-WG3526.dtsi rename to target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi index 0cf94d57d..f1b126ad1 100644 --- a/target/linux/ramips/dts/ZBT-WG3526.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi @@ -11,11 +11,7 @@ led-failsafe = &led_status; led-running = &led_status; led-upgrade = &led_status; - }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; + label-mac-device = &wifi0; }; chosen { @@ -29,8 +25,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -97,7 +92,7 @@ }; &pcie0 { - wifi@0,0 { + wifi0: wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x0000>; @@ -105,7 +100,7 @@ }; &pcie1 { - wifi@0,0 { + wifi1: wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; diff --git a/target/linux/ramips/dts/AWUSFREE1.dts b/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts similarity index 95% rename from target/linux/ramips/dts/AWUSFREE1.dts rename to target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts index 4e5ce1cc7..35665172c 100644 --- a/target/linux/ramips/dts/AWUSFREE1.dts +++ b/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts @@ -53,8 +53,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -76,11 +75,6 @@ gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; }; }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; }; &ehci { @@ -169,5 +163,4 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; }; diff --git a/target/linux/ramips/dts/WCR-1166DS.dts b/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts similarity index 98% rename from target/linux/ramips/dts/WCR-1166DS.dts rename to target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts index 602ea8c5d..2c878ff8a 100644 --- a/target/linux/ramips/dts/WCR-1166DS.dts +++ b/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; aoss { label = "aoss"; diff --git a/target/linux/ramips/dts/WR1000.dts b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts similarity index 95% rename from target/linux/ramips/dts/WR1000.dts rename to target/linux/ramips/dts/mt7628an_cudy_wr1000.dts index ff0b9badd..aa3f01e68 100644 --- a/target/linux/ramips/dts/WR1000.dts +++ b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts @@ -14,11 +14,11 @@ led-boot = &led_wps; led-failsafe = &led_wps; led-upgrade = &led_wps; + label-mac-device = &wmac; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -100,7 +100,6 @@ label = "firmware"; reg = <0x50000 0x7b0000>; }; - }; }; }; @@ -139,6 +138,6 @@ }; ðernet { - mtd-mac-address = <&factory 0x2e>; + mtd-mac-address = <&factory 0x28>; mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/PBR-D1.dts b/target/linux/ramips/dts/mt7628an_d-team_pbr-d1.dts similarity index 95% rename from target/linux/ramips/dts/PBR-D1.dts rename to target/linux/ramips/dts/mt7628an_d-team_pbr-d1.dts index 6d98a4492..cef92c5bf 100644 --- a/target/linux/ramips/dts/PBR-D1.dts +++ b/target/linux/ramips/dts/mt7628an_d-team_pbr-d1.dts @@ -24,11 +24,6 @@ serial0 = &uart2; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - leds { compatible = "gpio-leds"; @@ -47,8 +42,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/DUZUN-DM06.dts b/target/linux/ramips/dts/mt7628an_duzun_dm06.dts similarity index 94% rename from target/linux/ramips/dts/DUZUN-DM06.dts rename to target/linux/ramips/dts/mt7628an_duzun_dm06.dts index 7325e2c69..20d3bd83b 100644 --- a/target/linux/ramips/dts/DUZUN-DM06.dts +++ b/target/linux/ramips/dts/mt7628an_duzun_dm06.dts @@ -9,14 +9,8 @@ compatible = "duzun,dm06", "mediatek,mt7628an-soc"; model = "DuZun DM06"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/GL-MT300N-V2.dts b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts similarity index 93% rename from target/linux/ramips/dts/GL-MT300N-V2.dts rename to target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts index e4220736d..979f5d2bc 100644 --- a/target/linux/ramips/dts/GL-MT300N-V2.dts +++ b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts @@ -14,17 +14,13 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; + label-mac-device = ðernet; }; chosen { bootargs = "console=ttyS0,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - leds { compatible = "gpio-leds"; @@ -46,8 +42,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -95,7 +90,6 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; }; &spi0 { diff --git a/target/linux/ramips/dts/VIXMINI.dts b/target/linux/ramips/dts/mt7628an_glinet_vixmini.dts similarity index 91% rename from target/linux/ramips/dts/VIXMINI.dts rename to target/linux/ramips/dts/mt7628an_glinet_vixmini.dts index 5a52fe2a1..46d74b765 100644 --- a/target/linux/ramips/dts/VIXMINI.dts +++ b/target/linux/ramips/dts/mt7628an_glinet_vixmini.dts @@ -21,11 +21,6 @@ bootargs = "console=ttyS0,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - leds { compatible = "gpio-leds"; @@ -43,8 +38,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -69,8 +63,6 @@ &wmac { status = "okay"; - - ralink,mtd-eeprom = <&factory 0x0>; }; &spi0 { diff --git a/target/linux/ramips/dts/HLK-7628N.dts b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts similarity index 91% rename from target/linux/ramips/dts/HLK-7628N.dts rename to target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts index 71c6b60ac..f31e129e9 100644 --- a/target/linux/ramips/dts/HLK-7628N.dts +++ b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts @@ -10,18 +10,12 @@ compatible = "hilink,hlk-7628n", "mediatek,mt7628an-soc"; model = "HILINK HLK-7628N"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,57600"; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -96,4 +90,3 @@ &wmac { status = "okay"; }; - diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5661a.dts b/target/linux/ramips/dts/mt7628an_hiwifi_hc5661a.dts new file mode 100644 index 000000000..1f93141a3 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5661a.dts @@ -0,0 +1,45 @@ +/dts-v1/; + +#include "mt7628an_hiwifi_hc5x61a.dtsi" + +/ { + compatible = "hiwifi,hc5661a", "mediatek,mt7628an-soc"; + model = "HiWiFi HC5661A"; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "hc5661a:blue:system"; + gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; + }; + + internet { + label = "hc5661a:blue:internet"; + gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; + }; + + wlan2g { + label = "hc5661a:blue:wlan2g"; + gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "refclk", "wdt", "wled_an"; + ralink,function = "gpio"; + }; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts b/target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts new file mode 100644 index 000000000..a8b904939 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an_hiwifi_hc5x61a.dtsi" + +/ { + compatible = "hiwifi,hc5761a", "mediatek,mt7628an-soc"; + model = "HiWiFi HC5761A"; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "hc5761a:blue:system"; + gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; + }; + + internet { + label = "hc5761a:blue:internet"; + gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; + }; + + wlan2g { + label = "hc5761a:blue:wlan2g"; + gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + label = "hc5761a:blue:wlan5g"; + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "refclk", "wdt", "p3led_an", "wled_an"; + ralink,function = "gpio"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts b/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts new file mode 100644 index 000000000..050c91d12 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts @@ -0,0 +1,58 @@ +/dts-v1/; + +#include "mt7628an_hiwifi_hc5x61a.dtsi" + +/ { + compatible = "hiwifi,hc5861b", "mediatek,mt7628an-soc"; + model = "HiWiFi HC5861B"; + + 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>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "refclk", "wdt", "wled_an"; + ralink,function = "gpio"; + }; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + +&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; + }; + }; +}; diff --git a/target/linux/ramips/dts/HC5661A.dts b/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi similarity index 63% rename from target/linux/ramips/dts/HC5661A.dts rename to target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi index 25f1ff1a0..7a6631d2e 100644 --- a/target/linux/ramips/dts/HC5661A.dts +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi @@ -1,4 +1,4 @@ -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "mt7628an.dtsi" @@ -6,8 +6,7 @@ #include / { - compatible = "hiwifi,hc5661a", "mediatek,mt7628an-soc"; - model = "HiWiFi HC5661A"; + compatible = "hiwifi,hc5x61a", "mediatek,mt7628an-soc"; aliases { led-boot = &led_system; @@ -20,31 +19,8 @@ bootargs = "console=ttyS0,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - - leds { - compatible = "gpio-leds"; - - led_system: system { - label = "hc5661a:blue:system"; - gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; - }; - internet { - label = "hc5661a:blue:internet"; - gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; - }; - wlan2g { - label = "hc5661a:blue:wlan2g"; - gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; - }; - }; - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -54,23 +30,14 @@ }; }; -&pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "i2c", "refclk", "wled_an"; - ralink,function = "gpio"; - }; - }; -}; - &spi0 { status = "okay"; - m25p80@0 { + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - linux,modalias = "m25p80", "w25q128"; - spi-max-frequency = <10000000>; + spi-max-frequency = <80000000>; + m25p,fast-read; partitions { compatible = "fixed-partitions"; @@ -124,7 +91,6 @@ ðernet { mtd-mac-address = <&factory 0x4>; - mediatek,portmap = "wllll"; }; &wmac { diff --git a/target/linux/ramips/dts/mt7628an_iptime.dtsi b/target/linux/ramips/dts/mt7628an_iptime.dtsi new file mode 100644 index 000000000..bbd8642f2 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_iptime.dtsi @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include + +/ { + aliases { + label-mac-device = ðernet; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label = "config"; + reg = <0x20000 0x10000>; + read-only; + }; + + factory: partition@30000 { + label = "factory"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x40000 0x7c0000>; + }; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "uart1", "wdt"; + ralink,function = "gpio"; + }; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + +ðernet { + mtd-mac-address = <&uboot 0x1fc20>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&wmac { + status = "okay"; +}; diff --git a/target/linux/ramips/dts/mt7628an_iptime_a3.dts b/target/linux/ramips/dts/mt7628an_iptime_a3.dts new file mode 100644 index 000000000..a4d8458de --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_iptime_a3.dts @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an_iptime.dtsi" + +/ { + compatible = "iptime,a3", "mediatek,mt7628an-soc"; + model = "ipTIME A3"; + + aliases { + led-boot = &led_cpu; + led-failsafe = &led_cpu; + led-running = &led_cpu; + led-upgrade = &led_cpu; + }; + + leds { + compatible = "gpio-leds"; + + led_cpu: cpu { + label = "a3:blue:cpu"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "a3:blue:wlan"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&esw { + mediatek,portmap = <0x3e>; + mediatek,portdisable = <0x32>; +}; diff --git a/target/linux/ramips/dts/mt7628an_iptime_a604m.dts b/target/linux/ramips/dts/mt7628an_iptime_a604m.dts new file mode 100644 index 000000000..da44eb539 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_iptime_a604m.dts @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an_iptime.dtsi" + +/ { + compatible = "iptime,a604m", "mediatek,mt7628an-soc"; + model = "ipTIME A604M"; + + aliases { + led-boot = &led_cpu; + led-failsafe = &led_cpu; + led-running = &led_cpu; + led-upgrade = &led_cpu; + }; + + leds { + compatible = "gpio-leds"; + + wlan5g { + label = "a604m:blue:wlan5g"; + gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led_cpu: cpu { + label = "a604m:blue:cpu"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "a604m:blue:wlan2g"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "uart1", "wdt"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/LINKIT7688.dts b/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts similarity index 94% rename from target/linux/ramips/dts/LINKIT7688.dts rename to target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts index eaa75f407..d4eadf68e 100644 --- a/target/linux/ramips/dts/LINKIT7688.dts +++ b/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts @@ -24,11 +24,6 @@ serial0 = &uart2; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - bootstrap { compatible = "mediatek,linkit"; @@ -45,8 +40,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "reset"; diff --git a/target/linux/ramips/dts/MT7628.dts b/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts similarity index 93% rename from target/linux/ramips/dts/MT7628.dts rename to target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts index b4afc8ce9..6b9c3e4af 100644 --- a/target/linux/ramips/dts/MT7628.dts +++ b/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts @@ -5,11 +5,6 @@ / { compatible = "mediatek,mt7628an-eval-board", "mediatek,mt7628an-soc"; model = "Mediatek MT7628AN evaluation board"; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x2000000>; - }; }; &pinctrl { diff --git a/target/linux/ramips/dts/MAC1200RV2.dts b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts similarity index 96% rename from target/linux/ramips/dts/MAC1200RV2.dts rename to target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts index 7d1362113..715f4d1ff 100644 --- a/target/linux/ramips/dts/MAC1200RV2.dts +++ b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts @@ -20,13 +20,9 @@ bootargs = "console=ttyS0,57600"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x2000000>; - }; - leds { compatible = "gpio-leds"; + led_status: status { label = "mac1200rv2:green:status"; gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; diff --git a/target/linux/ramips/dts/R6120.dts b/target/linux/ramips/dts/mt7628an_netgear_r6120.dts similarity index 92% rename from target/linux/ramips/dts/R6120.dts rename to target/linux/ramips/dts/mt7628an_netgear_r6120.dts index d263c7824..12eb638df 100644 --- a/target/linux/ramips/dts/R6120.dts +++ b/target/linux/ramips/dts/mt7628an_netgear_r6120.dts @@ -14,16 +14,11 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; + label-mac-device = ðernet; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -138,8 +133,6 @@ &wmac { status = "okay"; - mtd-mac-address = <&factory 0x4>; - mediatek,mtd-eeprom = <&factory 0x0>; }; ðernet { diff --git a/target/linux/ramips/dts/OMEGA2.dts b/target/linux/ramips/dts/mt7628an_onion_omega2.dts similarity index 67% rename from target/linux/ramips/dts/OMEGA2.dts rename to target/linux/ramips/dts/mt7628an_onion_omega2.dts index 25cc818d5..e75abbc1f 100644 --- a/target/linux/ramips/dts/OMEGA2.dts +++ b/target/linux/ramips/dts/mt7628an_onion_omega2.dts @@ -1,15 +1,10 @@ /dts-v1/; -#include "OMEGA2.dtsi" +#include "mt7628an_onion_omega2.dtsi" / { compatible = "onion,omega2", "mediatek,mt7628an-soc"; model = "Onion Omega2"; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; }; &firmware { diff --git a/target/linux/ramips/dts/OMEGA2.dtsi b/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi similarity index 97% rename from target/linux/ramips/dts/OMEGA2.dtsi rename to target/linux/ramips/dts/mt7628an_onion_omega2.dtsi index e36602d6c..8b761d781 100644 --- a/target/linux/ramips/dts/OMEGA2.dtsi +++ b/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi @@ -26,8 +26,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/OMEGA2P.dts b/target/linux/ramips/dts/mt7628an_onion_omega2p.dts similarity index 69% rename from target/linux/ramips/dts/OMEGA2P.dts rename to target/linux/ramips/dts/mt7628an_onion_omega2p.dts index 53e837729..be753372f 100644 --- a/target/linux/ramips/dts/OMEGA2P.dts +++ b/target/linux/ramips/dts/mt7628an_onion_omega2p.dts @@ -1,15 +1,10 @@ /dts-v1/; -#include "OMEGA2.dtsi" +#include "mt7628an_onion_omega2.dtsi" / { compatible = "onion,omega2p", "onion,omega2", "mediatek,mt7628an-soc"; model = "Onion Omega2+"; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; }; &firmware { diff --git a/target/linux/ramips/dts/RAK633.dts b/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts similarity index 95% rename from target/linux/ramips/dts/RAK633.dts rename to target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts index ac7218510..1316a290d 100644 --- a/target/linux/ramips/dts/RAK633.dts +++ b/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts @@ -10,11 +10,6 @@ compatible = "rakwireless,rak633", "mediatek,mt7628an-soc"; model = "Rakwireless RAK633"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - leds { compatible = "gpio-leds"; diff --git a/target/linux/ramips/dts/SKW92A.dts b/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts similarity index 90% rename from target/linux/ramips/dts/SKW92A.dts rename to target/linux/ramips/dts/mt7628an_skylab_skw92a.dts index dddb794a8..addcabd7f 100644 --- a/target/linux/ramips/dts/SKW92A.dts +++ b/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts @@ -19,11 +19,6 @@ bootargs = "console=ttyS0,57600"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - leds { compatible = "gpio-leds"; @@ -39,8 +34,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -65,7 +59,6 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; }; &spi0 { diff --git a/target/linux/ramips/dts/W06.dts b/target/linux/ramips/dts/mt7628an_tama_w06.dts similarity index 92% rename from target/linux/ramips/dts/W06.dts rename to target/linux/ramips/dts/mt7628an_tama_w06.dts index 55b117c19..2a906c266 100644 --- a/target/linux/ramips/dts/W06.dts +++ b/target/linux/ramips/dts/mt7628an_tama_w06.dts @@ -9,11 +9,6 @@ compatible = "tama,w06", "mediatek,mt7628an-soc"; model = "Tama W06"; - memory@0{ - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - leds { compatible = "gpio-leds"; @@ -34,8 +29,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/TOTOLINK-LR1200.dts b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts similarity index 95% rename from target/linux/ramips/dts/TOTOLINK-LR1200.dts rename to target/linux/ramips/dts/mt7628an_totolink_lr1200.dts index 81aa8db91..4a712e917 100644 --- a/target/linux/ramips/dts/TOTOLINK-LR1200.dts +++ b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts @@ -17,11 +17,6 @@ led-upgrade = &led_sys; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - leds { compatible = "gpio-leds"; @@ -29,35 +24,43 @@ label = "lr1200:blue:sys"; gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; }; + sms { label = "lr1200:blue:sms"; gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; }; + wifi { label = "lr1200:blue:wifi"; gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy0tpt"; }; + 3g { label = "lr1200:blue:3g"; gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; }; + 4g { label = "lr1200:blue:4g"; gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; }; + rssi1 { label = "lr1200:blue:rssi1"; gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; }; + rssi2 { label = "lr1200:blue:rssi2"; gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; }; + rssi3 { label = "lr1200:blue:rssi3"; gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; }; + rssi4 { label = "lr1200:blue:rssi4"; gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; @@ -65,8 +68,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi similarity index 95% rename from target/linux/ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi rename to target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi index c62079ee5..6d7fb01c5 100644 --- a/target/linux/ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi @@ -6,9 +6,8 @@ bootargs = "console=ttyS0,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; + aliases { + label-mac-device = ðernet; }; }; diff --git a/target/linux/ramips/dts/TPLINK-8M.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi similarity index 93% rename from target/linux/ramips/dts/TPLINK-8M.dtsi rename to target/linux/ramips/dts/mt7628an_tplink_8m.dtsi index 9f7f7ccd6..ba3350ed0 100644 --- a/target/linux/ramips/dts/TPLINK-8M.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi @@ -5,9 +5,8 @@ bootargs = "console=ttyS0,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; + aliases { + label-mac-device = ðernet; }; }; diff --git a/target/linux/ramips/dts/ArcherC20v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts similarity index 78% rename from target/linux/ramips/dts/ArcherC20v4.dts rename to target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts index aaafcc52f..91401b5a3 100644 --- a/target/linux/ramips/dts/ArcherC20v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts @@ -1,12 +1,12 @@ /dts-v1/; -#include "TPLINK-8M.dtsi" +#include "mt7628an_tplink_8m.dtsi" #include #include / { - compatible = "tplink,c20-v4", "mediatek,mt7628an-soc"; + compatible = "tplink,archer-c20-v4", "mediatek,mt7628an-soc"; model = "TP-Link Archer C20 v4"; aliases { @@ -20,44 +20,43 @@ compatible = "gpio-leds"; lan { - label = "c20-v4:green:lan"; + label = "archer-c20-v4:green:lan"; gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; }; led_power: power { - label = "c20-v4:green:power"; + label = "archer-c20-v4:green:power"; gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; }; wan { - label = "c20-v4:green:wan"; + label = "archer-c20-v4:green:wan"; gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; }; wan_orange { - label = "c20-v4:orange:wan"; + label = "archer-c20-v4:orange:wan"; gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; }; wlan5g { - label = "c20-v4:green:wlan5g"; + label = "archer-c20-v4:green:wlan5g"; gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; }; wlan2g { - label = "c20-v4:green:wlan2g"; + label = "archer-c20-v4:green:wlan2g"; gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; }; wps { - label = "c20-v4:green:wps"; + label = "archer-c20-v4:green:wps"; gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; }; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/ArcherC50V3.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts similarity index 77% rename from target/linux/ramips/dts/ArcherC50V3.dts rename to target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts index cc4e72819..2f0576f2f 100644 --- a/target/linux/ramips/dts/ArcherC50V3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts @@ -1,12 +1,12 @@ /dts-v1/; -#include "TPLINK-8M.dtsi" +#include "mt7628an_tplink_8m.dtsi" #include #include / { - compatible = "tplink,c50-v3", "mediatek,mt7628an-soc"; + compatible = "tplink,archer-c50-v3", "mediatek,mt7628an-soc"; model = "TP-Link Archer C50 v3"; aliases { @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -37,37 +36,37 @@ compatible = "gpio-leds"; lan { - label = "c50-v3:green:lan"; + label = "archer-c50-v3:green:lan"; gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; }; led_power: power { - label = "c50-v3:green:power"; + label = "archer-c50-v3:green:power"; gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; }; wan { - label = "c50-v3:green:wan"; + label = "archer-c50-v3:green:wan"; gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; }; wan_orange { - label = "c50-v3:orange:wan"; + label = "archer-c50-v3:orange:wan"; gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; }; wlan { - label = "c50-v3:green:wlan2g"; + label = "archer-c50-v3:green:wlan2g"; gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; }; wlan5 { - label = "c50-v3:green:wlan5g"; + label = "archer-c50-v3:green:wlan5g"; gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; }; wps { - label = "c50-v3:green:wps"; + label = "archer-c50-v3:green:wps"; gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; }; }; diff --git a/target/linux/ramips/dts/ArcherC50V4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts similarity index 77% rename from target/linux/ramips/dts/ArcherC50V4.dts rename to target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts index 37f388620..197773db0 100644 --- a/target/linux/ramips/dts/ArcherC50V4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts @@ -1,13 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "TPLINK-8M-SPLIT-UBOOT.dtsi" +#include "mt7628an_tplink_8m-split-uboot.dtsi" #include #include / { - compatible = "tplink,c50-v4", "mediatek,mt7628an-soc"; + compatible = "tplink,archer-c50-v4", "mediatek,mt7628an-soc"; model = "TP-Link Archer C50 v4"; aliases { @@ -18,8 +18,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -38,37 +37,37 @@ compatible = "gpio-leds"; led_power: power { - label = "c50-v4:green:power"; + label = "archer-c50-v4:green:power"; gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; }; wlan2 { - label = "c50-v4:green:wlan2g"; + label = "archer-c50-v4:green:wlan2g"; gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; }; wlan5 { - label = "c50-v4:green:wlan5g"; + label = "archer-c50-v4:green:wlan5g"; gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; }; lan { - label = "c50-v4:green:lan"; + label = "archer-c50-v4:green:lan"; gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; }; wan { - label = "c50-v4:green:wan"; + label = "archer-c50-v4:green:wan"; gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; }; wan_orange { - label = "c50-v4:orange:wan"; + label = "archer-c50-v4:orange:wan"; gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; }; wps { - label = "c50-v4:green:wps"; + label = "archer-c50-v4:green:wps"; gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; }; }; diff --git a/target/linux/ramips/dts/TL-MR3020V3.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts similarity index 94% rename from target/linux/ramips/dts/TL-MR3020V3.dts rename to target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts index 7a9ef4144..84fe3224b 100644 --- a/target/linux/ramips/dts/TL-MR3020V3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts @@ -20,14 +20,8 @@ bootargs = "console=ttyS0,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; diff --git a/target/linux/ramips/dts/TL-MR3420V5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts similarity index 94% rename from target/linux/ramips/dts/TL-MR3420V5.dts rename to target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts index a528152d3..2bc4fac50 100644 --- a/target/linux/ramips/dts/TL-MR3420V5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "TPLINK-8M.dtsi" +#include "mt7628an_tplink_8m.dtsi" #include #include @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/TL-WA801NDV5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts similarity index 92% rename from target/linux/ramips/dts/TL-WA801NDV5.dts rename to target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts index fb944b07e..0336730a4 100644 --- a/target/linux/ramips/dts/TL-WA801NDV5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "TPLINK-8M.dtsi" +#include "mt7628an_tplink_8m.dtsi" #include #include @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/TL-WR802NV4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts similarity index 90% rename from target/linux/ramips/dts/TL-WR802NV4.dts rename to target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts index 668da700c..5e97733d0 100644 --- a/target/linux/ramips/dts/TL-WR802NV4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "TPLINK-8M.dtsi" +#include "mt7628an_tplink_8m.dtsi" #include #include @@ -18,8 +18,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/TL-WR840NV4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts similarity index 92% rename from target/linux/ramips/dts/TL-WR840NV4.dts rename to target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts index 5f5bb4fa4..32d4cdf4e 100644 --- a/target/linux/ramips/dts/TL-WR840NV4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "TPLINK-8M.dtsi" +#include "mt7628an_tplink_8m.dtsi" #include #include @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/TL-WR840NV5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts similarity index 91% rename from target/linux/ramips/dts/TL-WR840NV5.dts rename to target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts index 773839098..93869381c 100644 --- a/target/linux/ramips/dts/TL-WR840NV5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts @@ -20,14 +20,8 @@ bootargs = "console=ttyS0,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -35,6 +29,7 @@ linux,code = ; }; }; + /* LED used is dual-color,dual lead LED */ leds { compatible = "gpio-leds"; @@ -96,7 +91,6 @@ &wmac { status = "okay"; mtd-mac-address = <&factory 0xf100>; - mediatek,mtd-eeprom = <&factory 0x0>; }; ðernet { diff --git a/target/linux/ramips/dts/TL-WR841NV13.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts similarity index 95% rename from target/linux/ramips/dts/TL-WR841NV13.dts rename to target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts index 3dea06328..5bfabe4bd 100644 --- a/target/linux/ramips/dts/TL-WR841NV13.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "TPLINK-8M.dtsi" +#include "mt7628an_tplink_8m.dtsi" #include #include @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts new file mode 100644 index 000000000..554300c97 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "tplink,tl-wr841n-v14", "mediatek,mt7628an-soc"; + model = "TP-Link TL-WR841N v14"; + + aliases { + led-boot = &led_wlan; + led-failsafe = &led_wlan; + led-upgrade = &led_wlan; + + led-wlan = &led_wlan; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + lan { + label = "tl-wr841n-v14:green:lan"; + gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; + }; + + wan_green { + label = "tl-wr841n-v14:green:wan"; + gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; + }; + + led_wlan: wlan { + label = "tl-wr841n-v14:green:wlan"; + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wan_orange { + label = "tl-wr841n-v14:orange:wan"; + gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + m25p,chunked-io = <32>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "boot"; + reg = <0x0 0x10000>; + read-only; + }; + + partition@10000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x10000 0x3e0000>; + }; + + factory: partition@3f0000 { + label = "factory"; + reg = <0x3f0000 0x10000>; + read-only; + }; + }; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + +&wmac { + status = "okay"; + mtd-mac-address = <&factory 0xf100>; + mediatek,mtd-eeprom = <&factory 0x10000>; +}; + +ðernet { + mtd-mac-address = <&factory 0xf100>; + mediatek,portmap = "wllll"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "p4led_an", "p3led_an", "p2led_an", "p1led_an", "p0led_an", "wdt"; + ralink,function = "gpio"; + }; + }; +}; + +&gpio1 { + led_wlan_enable { + gpio-hog; + gpios = <11 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; diff --git a/target/linux/ramips/dts/TL-WR842NV5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts similarity index 94% rename from target/linux/ramips/dts/TL-WR842NV5.dts rename to target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts index 0610b2025..648e64766 100644 --- a/target/linux/ramips/dts/TL-WR842NV5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "TPLINK-8M.dtsi" +#include "mt7628an_tplink_8m.dtsi" #include #include @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/TL-WR902ACV3.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts similarity index 95% rename from target/linux/ramips/dts/TL-WR902ACV3.dts rename to target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts index 1d634314c..33449d965 100644 --- a/target/linux/ramips/dts/TL-WR902ACV3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "TPLINK-8M.dtsi" +#include "mt7628an_tplink_8m.dtsi" #include #include @@ -17,8 +17,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/U7628-01-128M-16M.dts b/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts similarity index 91% rename from target/linux/ramips/dts/U7628-01-128M-16M.dts rename to target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts index ac9fd503c..66fea358b 100644 --- a/target/linux/ramips/dts/U7628-01-128M-16M.dts +++ b/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts @@ -34,16 +34,11 @@ /dts-v1/; -#include "U7628-01.dtsi" +#include "mt7628an_unielec_u7628-01.dtsi" / { - compatible = "unielec,u7628-01-128m-16m", "unielec,u7628-01", "mediatek,mt7628an-soc"; - model = "UniElec U7628-01 (128M RAM/16M flash)"; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; + compatible = "unielec,u7628-01-16m", "unielec,u7628-01", "mediatek,mt7628an-soc"; + model = "UniElec U7628-01 (16M flash)"; }; &spi0 { diff --git a/target/linux/ramips/dts/U7628-01.dtsi b/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi similarity index 97% rename from target/linux/ramips/dts/U7628-01.dtsi rename to target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi index 03da1f88f..3416714d9 100644 --- a/target/linux/ramips/dts/U7628-01.dtsi +++ b/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi @@ -52,8 +52,8 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; + reset { label = "reset"; gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; @@ -126,7 +126,6 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; }; &pinctrl { diff --git a/target/linux/ramips/dts/VOCORE2LITE.dts b/target/linux/ramips/dts/mt7628an_vocore_vocore2-lite.dts similarity index 89% rename from target/linux/ramips/dts/VOCORE2LITE.dts rename to target/linux/ramips/dts/mt7628an_vocore_vocore2-lite.dts index db45a95a8..fc8fc89b7 100644 --- a/target/linux/ramips/dts/VOCORE2LITE.dts +++ b/target/linux/ramips/dts/mt7628an_vocore_vocore2-lite.dts @@ -1,11 +1,11 @@ /dts-v1/; -#include "VOCORE2.dtsi" +#include "mt7628an_vocore_vocore2.dtsi" #include / { - compatible = "vocore,vocore2lite", "vocore,vocore2", "mediatek,mt7628an-soc"; + compatible = "vocore,vocore2-lite", "vocore,vocore2", "mediatek,mt7628an-soc"; model = "VoCore2-Lite"; aliases { diff --git a/target/linux/ramips/dts/VOCORE2.dts b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dts similarity index 96% rename from target/linux/ramips/dts/VOCORE2.dts rename to target/linux/ramips/dts/mt7628an_vocore_vocore2.dts index a78d2cc73..939bb0b76 100644 --- a/target/linux/ramips/dts/VOCORE2.dts +++ b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "VOCORE2.dtsi" +#include "mt7628an_vocore_vocore2.dtsi" #include diff --git a/target/linux/ramips/dts/VOCORE2.dtsi b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi similarity index 93% rename from target/linux/ramips/dts/VOCORE2.dtsi rename to target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi index f7aec8e1f..6a312ff0b 100644 --- a/target/linux/ramips/dts/VOCORE2.dtsi +++ b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi @@ -3,12 +3,15 @@ / { compatible = "vocore,vocore2", "mediatek,mt7628an-soc"; + aliases { + label-mac-device = &wmac; + }; + chosen { bootargs = "console=ttyS2,115200"; }; }; - &pinctrl { state_default: pinctrl0 { gpio { diff --git a/target/linux/ramips/dts/WL-WN570HA1.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts similarity index 94% rename from target/linux/ramips/dts/WL-WN570HA1.dts rename to target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts index a07490b85..fa59a8b10 100644 --- a/target/linux/ramips/dts/WL-WN570HA1.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts @@ -12,14 +12,8 @@ bootargs = "console=ttyS0,57600"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/WL-WN575A3.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts similarity index 93% rename from target/linux/ramips/dts/WL-WN575A3.dts rename to target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts index 76923d5cf..0aed99c45 100644 --- a/target/linux/ramips/dts/WL-WN575A3.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts @@ -12,14 +12,8 @@ bootargs = "console=ttyS0,57600"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/WIDORA-NEO-16M.dts b/target/linux/ramips/dts/mt7628an_widora_neo-16m.dts similarity index 96% rename from target/linux/ramips/dts/WIDORA-NEO-16M.dts rename to target/linux/ramips/dts/mt7628an_widora_neo-16m.dts index 9ed6b1533..9aa9e78fb 100644 --- a/target/linux/ramips/dts/WIDORA-NEO-16M.dts +++ b/target/linux/ramips/dts/mt7628an_widora_neo-16m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "WIDORA-NEO.dtsi" +#include "mt7628an_widora_neo.dtsi" / { compatible = "widora,neo-16m", "widora,neo", "mediatek,mt7628an-soc"; diff --git a/target/linux/ramips/dts/WIDORA-NEO-32M.dts b/target/linux/ramips/dts/mt7628an_widora_neo-32m.dts similarity index 96% rename from target/linux/ramips/dts/WIDORA-NEO-32M.dts rename to target/linux/ramips/dts/mt7628an_widora_neo-32m.dts index cfd6ba709..6f67e60bb 100644 --- a/target/linux/ramips/dts/WIDORA-NEO-32M.dts +++ b/target/linux/ramips/dts/mt7628an_widora_neo-32m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "WIDORA-NEO.dtsi" +#include "mt7628an_widora_neo.dtsi" / { compatible = "widora,neo-32m", "widora,neo", "mediatek,mt7628an-soc"; diff --git a/target/linux/ramips/dts/WIDORA-NEO.dtsi b/target/linux/ramips/dts/mt7628an_widora_neo.dtsi similarity index 92% rename from target/linux/ramips/dts/WIDORA-NEO.dtsi rename to target/linux/ramips/dts/mt7628an_widora_neo.dtsi index af3a1b1a1..5457ca85c 100644 --- a/target/linux/ramips/dts/WIDORA-NEO.dtsi +++ b/target/linux/ramips/dts/mt7628an_widora_neo.dtsi @@ -17,11 +17,6 @@ bootargs = "console=ttyS0,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - leds { compatible = "gpio-leds"; @@ -33,8 +28,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "reset"; diff --git a/target/linux/ramips/dts/WIZFI630S.dts b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts similarity index 95% rename from target/linux/ramips/dts/WIZFI630S.dts rename to target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts index 13c8f68f1..b5da84c9f 100644 --- a/target/linux/ramips/dts/WIZFI630S.dts +++ b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts @@ -14,11 +14,6 @@ bootargs = "console=ttyS1,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - aliases { led-boot = &led_run; led-failsafe = &led_run; @@ -53,10 +48,10 @@ }; keys { - compatible = "gpio-keys-polled"; + compatible = "gpio-keys"; + #address-cells = <1>; #size-cells = <0>; - poll-interval = <20>; reset { label = "reset"; @@ -81,7 +76,6 @@ gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; linux,code = ; }; - }; }; @@ -102,7 +96,6 @@ ralink,function = "gpio"; }; - i2c { ralink,group = "i2c"; ralink,function = "gpio"; diff --git a/target/linux/ramips/dts/WRTNODE2.dtsi b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi similarity index 85% rename from target/linux/ramips/dts/WRTNODE2.dtsi rename to target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi index 9bac82287..206da8b16 100644 --- a/target/linux/ramips/dts/WRTNODE2.dtsi +++ b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi @@ -11,8 +11,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -60,14 +59,6 @@ }; }; }; - - spidev@1 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "linux,spidev"; - reg = <1>; - spi-max-frequency = <10000000>; - }; }; &uart1 { diff --git a/target/linux/ramips/dts/WRTNODE2P.dts b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2p.dts similarity index 92% rename from target/linux/ramips/dts/WRTNODE2P.dts rename to target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2p.dts index cd668d601..fe9cf0dd1 100644 --- a/target/linux/ramips/dts/WRTNODE2P.dts +++ b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2p.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "WRTNODE2.dtsi" +#include "mt7628an_wrtnode_wrtnode2.dtsi" / { compatible = "wrtnode,wrtnode2p", "wrtnode,wrtnode2", "mediatek,mt7628an-soc"; diff --git a/target/linux/ramips/dts/WRTNODE2R.dts b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2r.dts similarity index 77% rename from target/linux/ramips/dts/WRTNODE2R.dts rename to target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2r.dts index bfe533c0c..7defe9c03 100644 --- a/target/linux/ramips/dts/WRTNODE2R.dts +++ b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2r.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "WRTNODE2.dtsi" +#include "mt7628an_wrtnode_wrtnode2.dtsi" / { compatible = "wrtnode,wrtnode2r", "wrtnode,wrtnode2", "mediatek,mt7628an-soc"; @@ -41,3 +41,13 @@ }; }; }; + +&spi0 { + spidev@1 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "linux,spidev"; + reg = <1>; + spi-max-frequency = <10000000>; + }; +}; diff --git a/target/linux/ramips/dts/XIAOMI-MIR4A-100M.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts similarity index 94% rename from target/linux/ramips/dts/XIAOMI-MIR4A-100M.dts rename to target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts index 8a33745f7..2de28041e 100644 --- a/target/linux/ramips/dts/XIAOMI-MIR4A-100M.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts @@ -14,11 +14,6 @@ bootargs = "console=ttyS0,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - aliases { led-boot = &power_yellow; led-failsafe = &power_yellow; @@ -41,8 +36,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/MIWIFI-NANO.dts b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts similarity index 88% rename from target/linux/ramips/dts/MIWIFI-NANO.dts rename to target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts index bad37e21f..8b2a3d6c9 100644 --- a/target/linux/ramips/dts/MIWIFI-NANO.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts @@ -20,11 +20,6 @@ bootargs = "console=ttyS0,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - leds { compatible = "gpio-leds"; @@ -32,10 +27,12 @@ label = "miwifi-nano:blue:status"; gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; }; + status_red { label = "miwifi-nano:red:status"; gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; }; + status_amber { label = "miwifi-nano:amber:status"; gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; @@ -43,8 +40,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -57,12 +53,20 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "refclk", "wled_an", "gpio"; + ralink,group = "gpio", "refclk", "wdt", "wled_an"; ralink,function = "gpio"; }; }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &wmac { status = "okay"; ralink,mtd-eeprom = <&factory 0x4>; @@ -78,7 +82,7 @@ m25p80@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <10000000>; + spi-max-frequency = <40000000>; partitions { compatible = "fixed-partitions"; @@ -94,7 +98,6 @@ partition@30000 { label = "u-boot-env"; reg = <0x30000 0x10000>; - read-only; }; factory: partition@40000 { diff --git a/target/linux/ramips/dts/ZBT-WE1226.dts b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts similarity index 93% rename from target/linux/ramips/dts/ZBT-WE1226.dts rename to target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts index aace0042e..b89e68950 100644 --- a/target/linux/ramips/dts/ZBT-WE1226.dts +++ b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts @@ -19,14 +19,8 @@ bootargs = "console=ttyS0,115200"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x4000000>; - }; - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ramips/dts/ki_rb.dts b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts similarity index 93% rename from target/linux/ramips/dts/ki_rb.dts rename to target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts index 56912a786..f4d678e38 100644 --- a/target/linux/ramips/dts/ki_rb.dts +++ b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts @@ -16,18 +16,12 @@ led-upgrade = &led_power; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,57600n8"; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -113,7 +107,7 @@ }; factory: partition@40000 { - label = "rf-eeprom"; + label = "factory"; reg = <0x40000 0x10000>; read-only; }; @@ -190,7 +184,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; }; &pcie { @@ -202,7 +195,6 @@ reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - mtd-mac-address = <&factory 0x8004>; }; }; diff --git a/target/linux/ramips/dts/AR670W.dts b/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts similarity index 100% rename from target/linux/ramips/dts/AR670W.dts rename to target/linux/ramips/dts/rt2880_airlink101_ar670w.dts diff --git a/target/linux/ramips/dts/AR725W.dts b/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts similarity index 100% rename from target/linux/ramips/dts/AR725W.dts rename to target/linux/ramips/dts/rt2880_airlink101_ar725w.dts diff --git a/target/linux/ramips/dts/RT-N15.dts b/target/linux/ramips/dts/rt2880_asus_rt-n15.dts similarity index 100% rename from target/linux/ramips/dts/RT-N15.dts rename to target/linux/ramips/dts/rt2880_asus_rt-n15.dts diff --git a/target/linux/ramips/dts/F5D8235_V1.dts b/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts similarity index 100% rename from target/linux/ramips/dts/F5D8235_V1.dts rename to target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts diff --git a/target/linux/ramips/dts/WLI-TX4-AG300N.dts b/target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts similarity index 100% rename from target/linux/ramips/dts/WLI-TX4-AG300N.dts rename to target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts diff --git a/target/linux/ramips/dts/WZR-AGL300NH.dts b/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts similarity index 100% rename from target/linux/ramips/dts/WZR-AGL300NH.dts rename to target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts diff --git a/target/linux/ramips/dts/DAP-1522-A1.dts b/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts similarity index 100% rename from target/linux/ramips/dts/DAP-1522-A1.dts rename to target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts diff --git a/target/linux/ramips/dts/V11STFE.dts b/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts similarity index 100% rename from target/linux/ramips/dts/V11STFE.dts rename to target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts diff --git a/target/linux/ramips/dts/CARAMBOLA.dts b/target/linux/ramips/dts/rt3050_8devices_carambola.dts similarity index 100% rename from target/linux/ramips/dts/CARAMBOLA.dts rename to target/linux/ramips/dts/rt3050_8devices_carambola.dts diff --git a/target/linux/ramips/dts/ALL0256N-4M.dts b/target/linux/ramips/dts/rt3050_allnet_all0256n-4m.dts similarity index 91% rename from target/linux/ramips/dts/ALL0256N-4M.dts rename to target/linux/ramips/dts/rt3050_allnet_all0256n-4m.dts index 60421a422..4f1504bef 100644 --- a/target/linux/ramips/dts/ALL0256N-4M.dts +++ b/target/linux/ramips/dts/rt3050_allnet_all0256n-4m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "ALL0256N.dtsi" +#include "rt3050_allnet_all0256n.dtsi" / { compatible = "allnet,all0256n-4m", "allnet,all0256n", "ralink,rt3050-soc"; @@ -41,7 +41,7 @@ partition@50000 { compatible = "denx,uimage"; label = "firmware"; - reg = <0x50000 0x3c8000>; + reg = <0x50000 0x3b0000>; }; }; }; diff --git a/target/linux/ramips/dts/ALL0256N-8M.dts b/target/linux/ramips/dts/rt3050_allnet_all0256n-8m.dts similarity index 95% rename from target/linux/ramips/dts/ALL0256N-8M.dts rename to target/linux/ramips/dts/rt3050_allnet_all0256n-8m.dts index 3832d1a7d..e901f3c90 100644 --- a/target/linux/ramips/dts/ALL0256N-8M.dts +++ b/target/linux/ramips/dts/rt3050_allnet_all0256n-8m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "ALL0256N.dtsi" +#include "rt3050_allnet_all0256n.dtsi" / { compatible = "allnet,all0256n-8m", "allnet,all0256n", "ralink,rt3050-soc"; diff --git a/target/linux/ramips/dts/ALL0256N.dtsi b/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi similarity index 100% rename from target/linux/ramips/dts/ALL0256N.dtsi rename to target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi diff --git a/target/linux/ramips/dts/ASL26555-16M.dts b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts similarity index 95% rename from target/linux/ramips/dts/ASL26555-16M.dts rename to target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts index fce92ff0f..76781ab11 100644 --- a/target/linux/ramips/dts/ASL26555-16M.dts +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "ASL26555.dtsi" +#include "rt3050_alphanetworks_asl26555.dtsi" / { compatible = "alphanetworks,asl26555-16m", "alphanetworks,asl26555", "ralink,rt3050-soc"; diff --git a/target/linux/ramips/dts/ASL26555-8M.dts b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts similarity index 95% rename from target/linux/ramips/dts/ASL26555-8M.dts rename to target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts index 8411990be..3d11de0fa 100644 --- a/target/linux/ramips/dts/ASL26555-8M.dts +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "ASL26555.dtsi" +#include "rt3050_alphanetworks_asl26555.dtsi" / { compatible = "alphanetworks,asl26555-8m", "alphanetworks,asl26555", "ralink,rt3050-soc"; diff --git a/target/linux/ramips/dts/ASL26555.dtsi b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi similarity index 100% rename from target/linux/ramips/dts/ASL26555.dtsi rename to target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi diff --git a/target/linux/ramips/dts/FREESTATION5.dts b/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts similarity index 100% rename from target/linux/ramips/dts/FREESTATION5.dts rename to target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts diff --git a/target/linux/ramips/dts/RT-G32-B1.dts b/target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts similarity index 100% rename from target/linux/ramips/dts/RT-G32-B1.dts rename to target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts diff --git a/target/linux/ramips/dts/RT-N10-PLUS.dts b/target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts similarity index 100% rename from target/linux/ramips/dts/RT-N10-PLUS.dts rename to target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts diff --git a/target/linux/ramips/dts/WL-330N.dts b/target/linux/ramips/dts/rt3050_asus_wl-330n.dts similarity index 100% rename from target/linux/ramips/dts/WL-330N.dts rename to target/linux/ramips/dts/rt3050_asus_wl-330n.dts diff --git a/target/linux/ramips/dts/WL-330N3G.dts b/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts similarity index 100% rename from target/linux/ramips/dts/WL-330N3G.dts rename to target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts diff --git a/target/linux/ramips/dts/DCS-930.dts b/target/linux/ramips/dts/rt3050_dlink_dcs-930.dts similarity index 100% rename from target/linux/ramips/dts/DCS-930.dts rename to target/linux/ramips/dts/rt3050_dlink_dcs-930.dts diff --git a/target/linux/ramips/dts/DIR-300-B1.dts b/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts similarity index 98% rename from target/linux/ramips/dts/DIR-300-B1.dts rename to target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts index 8bc77e422..030796f28 100644 --- a/target/linux/ramips/dts/DIR-300-B1.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts @@ -39,7 +39,7 @@ read-only; }; - factory: partition@40000 { + partition@40000 { label = "devconf"; reg = <0x40000 0x10000>; read-only; diff --git a/target/linux/ramips/dts/DIR-600-B1.dts b/target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts similarity index 100% rename from target/linux/ramips/dts/DIR-600-B1.dts rename to target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts diff --git a/target/linux/ramips/dts/DIR-615-D.dts b/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts similarity index 96% rename from target/linux/ramips/dts/DIR-615-D.dts rename to target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts index 5f8ea1b22..c0593dd6e 100644 --- a/target/linux/ramips/dts/DIR-615-D.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts @@ -6,7 +6,7 @@ #include / { - compatible = "dlink,dir-615-d1", "ralink,rt3050-soc"; + compatible = "dlink,dir-615-d", "ralink,rt3050-soc"; model = "D-Link DIR-615 D"; aliases { @@ -14,6 +14,7 @@ led-failsafe = &led_status_green; led-running = &led_status_green; led-upgrade = &led_status_green; + label-mac-device = &wmac; }; cfi@1f000000 { @@ -117,5 +118,3 @@ }; }; }; - - diff --git a/target/linux/ramips/dts/DIR-620-A1.dts b/target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts similarity index 100% rename from target/linux/ramips/dts/DIR-620-A1.dts rename to target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts diff --git a/target/linux/ramips/dts/3G-6200N.dts b/target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts similarity index 100% rename from target/linux/ramips/dts/3G-6200N.dts rename to target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts diff --git a/target/linux/ramips/dts/3G-6200NL.dts b/target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts similarity index 100% rename from target/linux/ramips/dts/3G-6200NL.dts rename to target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts diff --git a/target/linux/ramips/dts/D105.dts b/target/linux/ramips/dts/rt3050_huawei_d105.dts similarity index 100% rename from target/linux/ramips/dts/D105.dts rename to target/linux/ramips/dts/rt3050_huawei_d105.dts diff --git a/target/linux/ramips/dts/JHR-N805R.dts b/target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts similarity index 100% rename from target/linux/ramips/dts/JHR-N805R.dts rename to target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts diff --git a/target/linux/ramips/dts/NW718.dts b/target/linux/ramips/dts/rt3050_netcore_nw718.dts similarity index 100% rename from target/linux/ramips/dts/NW718.dts rename to target/linux/ramips/dts/rt3050_netcore_nw718.dts diff --git a/target/linux/ramips/dts/WCR150GN.dts b/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts similarity index 96% rename from target/linux/ramips/dts/WCR150GN.dts rename to target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts index b20967680..a2f763cb8 100644 --- a/target/linux/ramips/dts/WCR150GN.dts +++ b/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts @@ -6,7 +6,7 @@ #include / { - compatible = "sparklan,wcr150gn", "ralink,rt3050-soc"; + compatible = "sparklan,wcr-150gn", "ralink,rt3050-soc"; model = "Sparklan WCR-150GN"; aliases { diff --git a/target/linux/ramips/dts/RUT5XX.dts b/target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts similarity index 100% rename from target/linux/ramips/dts/RUT5XX.dts rename to target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts diff --git a/target/linux/ramips/dts/W150M.dts b/target/linux/ramips/dts/rt3050_tenda_w150m.dts similarity index 98% rename from target/linux/ramips/dts/W150M.dts rename to target/linux/ramips/dts/rt3050_tenda_w150m.dts index e128580ec..e6a2c4ab1 100644 --- a/target/linux/ramips/dts/W150M.dts +++ b/target/linux/ramips/dts/rt3050_tenda_w150m.dts @@ -48,7 +48,7 @@ partition@50000 { compatible = "denx,uimage"; label = "firmware"; - reg = <0x50000 0x3c8000>; + reg = <0x50000 0x3b0000>; }; }; }; diff --git a/target/linux/ramips/dts/TEW-638APB-V2.dts b/target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts similarity index 100% rename from target/linux/ramips/dts/TEW-638APB-V2.dts rename to target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts diff --git a/target/linux/ramips/dts/WR6202.dts b/target/linux/ramips/dts/rt3052_accton_wr6202.dts similarity index 98% rename from target/linux/ramips/dts/WR6202.dts rename to target/linux/ramips/dts/rt3052_accton_wr6202.dts index 26ec6de8f..1caec41a4 100644 --- a/target/linux/ramips/dts/WR6202.dts +++ b/target/linux/ramips/dts/rt3052_accton_wr6202.dts @@ -7,7 +7,7 @@ / { compatible = "accton,wr6202", "ralink,rt3052-soc"; - model = "AWB WR6202"; + model = "Accton WR6202"; chosen { bootargs = "console=ttyS0,115200"; diff --git a/target/linux/ramips/dts/W502U.dts b/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts similarity index 95% rename from target/linux/ramips/dts/W502U.dts rename to target/linux/ramips/dts/rt3052_alfa-network_w502u.dts index a53c47819..5c1b47bc0 100644 --- a/target/linux/ramips/dts/W502U.dts +++ b/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts @@ -6,8 +6,8 @@ #include / { - compatible = "alfanetworks,w502u", "ralink,rt3052-soc"; - model = "ALFA Networks W502U"; + compatible = "alfa-network,w502u", "ralink,rt3052-soc"; + model = "ALFA Network W502U"; aliases { led-boot = &led_wps; diff --git a/target/linux/ramips/dts/ATP-52B.dts b/target/linux/ramips/dts/rt3052_argus_atp-52b.dts similarity index 99% rename from target/linux/ramips/dts/ATP-52B.dts rename to target/linux/ramips/dts/rt3052_argus_atp-52b.dts index 2fa5c19d0..046fe676c 100644 --- a/target/linux/ramips/dts/ATP-52B.dts +++ b/target/linux/ramips/dts/rt3052_argus_atp-52b.dts @@ -92,7 +92,6 @@ }; }; - ðernet { mtd-mac-address = <&factory 0x4>; }; diff --git a/target/linux/ramips/dts/AWAPN2403.dts b/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts similarity index 99% rename from target/linux/ramips/dts/AWAPN2403.dts rename to target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts index 97f105a63..38ad539eb 100644 --- a/target/linux/ramips/dts/AWAPN2403.dts +++ b/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts @@ -16,7 +16,6 @@ led-upgrade = &led_wps; }; - leds { compatible = "gpio-leds"; diff --git a/target/linux/ramips/dts/RT-N13U.dts b/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts similarity index 100% rename from target/linux/ramips/dts/RT-N13U.dts rename to target/linux/ramips/dts/rt3052_asus_rt-n13u.dts diff --git a/target/linux/ramips/dts/MR-102N.dts b/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts similarity index 99% rename from target/linux/ramips/dts/MR-102N.dts rename to target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts index ffb76e3bf..d8efb425e 100644 --- a/target/linux/ramips/dts/MR-102N.dts +++ b/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts @@ -125,7 +125,6 @@ ralink,mtd-eeprom = <&factory 0>; }; - &otg { status = "okay"; }; diff --git a/target/linux/ramips/dts/HW550-3G.dts b/target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts similarity index 100% rename from target/linux/ramips/dts/HW550-3G.dts rename to target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts diff --git a/target/linux/ramips/dts/F5D8235_V2.dts b/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts similarity index 100% rename from target/linux/ramips/dts/F5D8235_V2.dts rename to target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts diff --git a/target/linux/ramips/dts/WHR-G300N.dts b/target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts similarity index 100% rename from target/linux/ramips/dts/WHR-G300N.dts rename to target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts diff --git a/target/linux/ramips/dts/DAP-1350.dts b/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts similarity index 100% rename from target/linux/ramips/dts/DAP-1350.dts rename to target/linux/ramips/dts/rt3052_dlink_dap-1350.dts diff --git a/target/linux/ramips/dts/ESR-9753.dts b/target/linux/ramips/dts/rt3052_engenius_esr-9753.dts similarity index 100% rename from target/linux/ramips/dts/ESR-9753.dts rename to target/linux/ramips/dts/rt3052_engenius_esr-9753.dts diff --git a/target/linux/ramips/dts/FONERA20N.dts b/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts similarity index 93% rename from target/linux/ramips/dts/FONERA20N.dts rename to target/linux/ramips/dts/rt3052_fon_fonera-20n.dts index 83ce17317..dfe55a257 100644 --- a/target/linux/ramips/dts/FONERA20N.dts +++ b/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts @@ -6,7 +6,7 @@ #include / { - compatible = "fon,fonera20n", "ralink,rt3052-soc"; + compatible = "fon,fonera-20n", "ralink,rt3052-soc"; model = "La Fonera 2.0N"; aliases { @@ -57,17 +57,17 @@ compatible = "gpio-leds"; wifi { - label = "fonera20n:orange:wifi"; + label = "fonera-20n:orange:wifi"; gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; }; led_power: power { - label = "fonera20n:green:power"; + label = "fonera-20n:green:power"; gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; }; usb { - label = "fonera20n:orange:usb"; + label = "fonera-20n:orange:usb"; gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; trigger-sources = <&otg_port1>; linux,default-trigger = "usbport"; diff --git a/target/linux/ramips/dts/BROADWAY.dts b/target/linux/ramips/dts/rt3052_hauppauge_broadway.dts similarity index 100% rename from target/linux/ramips/dts/BROADWAY.dts rename to target/linux/ramips/dts/rt3052_hauppauge_broadway.dts diff --git a/target/linux/ramips/dts/HG255D.dts b/target/linux/ramips/dts/rt3052_huawei_hg255d.dts similarity index 100% rename from target/linux/ramips/dts/HG255D.dts rename to target/linux/ramips/dts/rt3052_huawei_hg255d.dts diff --git a/target/linux/ramips/dts/JHR-N825R.dts b/target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts similarity index 100% rename from target/linux/ramips/dts/JHR-N825R.dts rename to target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts diff --git a/target/linux/ramips/dts/JHR-N926R.dts b/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts similarity index 100% rename from target/linux/ramips/dts/JHR-N926R.dts rename to target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts diff --git a/target/linux/ramips/dts/MOFI3500-3GN.dts b/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts similarity index 100% rename from target/linux/ramips/dts/MOFI3500-3GN.dts rename to target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts diff --git a/target/linux/ramips/dts/WNCE2001.dts b/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts similarity index 100% rename from target/linux/ramips/dts/WNCE2001.dts rename to target/linux/ramips/dts/rt3052_netgear_wnce2001.dts diff --git a/target/linux/ramips/dts/BC2.dts b/target/linux/ramips/dts/rt3052_nexaira_bc2.dts similarity index 100% rename from target/linux/ramips/dts/BC2.dts rename to target/linux/ramips/dts/rt3052_nexaira_bc2.dts diff --git a/target/linux/ramips/dts/MINIEMBWIFI.dts b/target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts similarity index 100% rename from target/linux/ramips/dts/MINIEMBWIFI.dts rename to target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts diff --git a/target/linux/ramips/dts/PSR-680W.dts b/target/linux/ramips/dts/rt3052_petatel_psr-680w.dts similarity index 100% rename from target/linux/ramips/dts/PSR-680W.dts rename to target/linux/ramips/dts/rt3052_petatel_psr-680w.dts diff --git a/target/linux/ramips/dts/MZK-W300NH2.dts b/target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts similarity index 100% rename from target/linux/ramips/dts/MZK-W300NH2.dts rename to target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts diff --git a/target/linux/ramips/dts/MZK-WDPR.dts b/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts similarity index 100% rename from target/linux/ramips/dts/MZK-WDPR.dts rename to target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts diff --git a/target/linux/ramips/dts/IP2202.dts b/target/linux/ramips/dts/rt3052_poray_ip2202.dts similarity index 100% rename from target/linux/ramips/dts/IP2202.dts rename to target/linux/ramips/dts/rt3052_poray_ip2202.dts diff --git a/target/linux/ramips/dts/PWH2004.dts b/target/linux/ramips/dts/rt3052_prolink_pwh2004.dts similarity index 100% rename from target/linux/ramips/dts/PWH2004.dts rename to target/linux/ramips/dts/rt3052_prolink_pwh2004.dts diff --git a/target/linux/ramips/dts/V22RW-2X2.dts b/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts similarity index 100% rename from target/linux/ramips/dts/V22RW-2X2.dts rename to target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts diff --git a/target/linux/ramips/dts/WL-351.dts b/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts similarity index 100% rename from target/linux/ramips/dts/WL-351.dts rename to target/linux/ramips/dts/rt3052_sitecom_wl-351.dts diff --git a/target/linux/ramips/dts/SL-R7205.dts b/target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts similarity index 100% rename from target/linux/ramips/dts/SL-R7205.dts rename to target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts diff --git a/target/linux/ramips/dts/3G300M.dts b/target/linux/ramips/dts/rt3052_tenda_3g300m.dts similarity index 100% rename from target/linux/ramips/dts/3G300M.dts rename to target/linux/ramips/dts/rt3052_tenda_3g300m.dts diff --git a/target/linux/ramips/dts/W306R_V20.dts b/target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts similarity index 100% rename from target/linux/ramips/dts/W306R_V20.dts rename to target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts diff --git a/target/linux/ramips/dts/WR512-3GN-4M.dts b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts similarity index 90% rename from target/linux/ramips/dts/WR512-3GN-4M.dts rename to target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts index beba80550..ae8e6b8b4 100644 --- a/target/linux/ramips/dts/WR512-3GN-4M.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "WR512-3GN.dtsi" +#include "rt3052_unbranded_wr512-3gn.dtsi" / { compatible = "unbranded,wr512-3gn-4m", "unbranded,wr512-3gn", "ralink,rt3052-soc"; @@ -38,7 +38,7 @@ partition@50000 { compatible = "denx,uimage"; label = "firmware"; - reg = <0x50000 0x3c8000>; + reg = <0x50000 0x3b0000>; }; }; }; diff --git a/target/linux/ramips/dts/WR512-3GN-8M.dts b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts similarity index 94% rename from target/linux/ramips/dts/WR512-3GN-8M.dts rename to target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts index 118c69a34..c21b59168 100644 --- a/target/linux/ramips/dts/WR512-3GN-8M.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "WR512-3GN.dtsi" +#include "rt3052_unbranded_wr512-3gn.dtsi" / { compatible = "unbranded,wr512-3gn-8m", "unbranded,wr512-3gn", "ralink,rt3052-soc"; diff --git a/target/linux/ramips/dts/WR512-3GN.dtsi b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn.dtsi similarity index 100% rename from target/linux/ramips/dts/WR512-3GN.dtsi rename to target/linux/ramips/dts/rt3052_unbranded_wr512-3gn.dtsi diff --git a/target/linux/ramips/dts/XDXRN502J.dts b/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts similarity index 96% rename from target/linux/ramips/dts/XDXRN502J.dts rename to target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts index 0cab20f8f..2d1b416ce 100644 --- a/target/linux/ramips/dts/XDXRN502J.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts @@ -6,7 +6,7 @@ #include / { - compatible = "unbranded,xdxrn502j", "ralink,rt3052-soc"; + compatible = "unbranded,xdx-rn502j", "ralink,rt3052-soc"; model = "XDX RN502J"; aliases { diff --git a/target/linux/ramips/dts/UR-326N4G.dts b/target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts similarity index 100% rename from target/linux/ramips/dts/UR-326N4G.dts rename to target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts diff --git a/target/linux/ramips/dts/UR-336UN.dts b/target/linux/ramips/dts/rt3052_upvel_ur-336un.dts similarity index 100% rename from target/linux/ramips/dts/UR-336UN.dts rename to target/linux/ramips/dts/rt3052_upvel_ur-336un.dts diff --git a/target/linux/ramips/dts/kn.dts b/target/linux/ramips/dts/rt3052_zyxel_keenetic.dts similarity index 100% rename from target/linux/ramips/dts/kn.dts rename to target/linux/ramips/dts/rt3052_zyxel_keenetic.dts diff --git a/target/linux/ramips/dts/NBG-419N.dts b/target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts similarity index 100% rename from target/linux/ramips/dts/NBG-419N.dts rename to target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts diff --git a/target/linux/ramips/dts/ALL5002.dts b/target/linux/ramips/dts/rt3352_allnet_all5002.dts similarity index 100% rename from target/linux/ramips/dts/ALL5002.dts rename to target/linux/ramips/dts/rt3352_allnet_all5002.dts diff --git a/target/linux/ramips/dts/DIR-615-H1.dts b/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts similarity index 98% rename from target/linux/ramips/dts/DIR-615-H1.dts rename to target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts index 79d4717f5..a87fc1e9a 100644 --- a/target/linux/ramips/dts/DIR-615-H1.dts +++ b/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts @@ -14,6 +14,7 @@ led-failsafe = &led_status_green; led-running = &led_status_green; led-upgrade = &led_status_green; + label-mac-device = &wmac; }; leds { diff --git a/target/linux/ramips/dts/DIR-620-D1.dts b/target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts similarity index 100% rename from target/linux/ramips/dts/DIR-620-D1.dts rename to target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts diff --git a/target/linux/ramips/dts/NBG-419N2.dts b/target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts similarity index 100% rename from target/linux/ramips/dts/NBG-419N2.dts rename to target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts diff --git a/target/linux/ramips/dts/RT-N56U.dts b/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts similarity index 97% rename from target/linux/ramips/dts/RT-N56U.dts rename to target/linux/ramips/dts/rt3662_asus_rt-n56u.dts index 9c2a32a98..13f6cdd1d 100644 --- a/target/linux/ramips/dts/RT-N56U.dts +++ b/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts @@ -6,7 +6,7 @@ #include / { - compatible = "asus,rt-n56u", "ralink,rt3883-soc"; + compatible = "asus,rt-n56u", "ralink,rt3662-soc", "ralink,rt3883-soc"; model = "Asus RT-N56U"; aliases { diff --git a/target/linux/ramips/dts/DIR-645.dts b/target/linux/ramips/dts/rt3662_dlink_dir-645.dts similarity index 96% rename from target/linux/ramips/dts/DIR-645.dts rename to target/linux/ramips/dts/rt3662_dlink_dir-645.dts index 35d011ebb..5effbf9fa 100644 --- a/target/linux/ramips/dts/DIR-645.dts +++ b/target/linux/ramips/dts/rt3662_dlink_dir-645.dts @@ -6,7 +6,7 @@ #include / { - compatible = "dlink,dir-645", "ralink,rt3883-soc"; + compatible = "dlink,dir-645", "ralink,rt3662-soc", "ralink,rt3883-soc"; model = "D-Link DIR-645"; aliases { diff --git a/target/linux/ramips/dts/BR-6475ND.dts b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts similarity index 97% rename from target/linux/ramips/dts/BR-6475ND.dts rename to target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts index f7fb8b5c4..9e6d98f95 100644 --- a/target/linux/ramips/dts/BR-6475ND.dts +++ b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts @@ -6,7 +6,7 @@ #include / { - compatible = "edimax,br-6475nd", "ralink,rt3883-soc"; + compatible = "edimax,br-6475nd", "ralink,rt3662-soc", "ralink,rt3883-soc"; model = "Edimax BR-6475nD"; aliases { diff --git a/target/linux/ramips/dts/WMDR-143N.dts b/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts similarity index 88% rename from target/linux/ramips/dts/WMDR-143N.dts rename to target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts index 66711420a..af5ffda28 100644 --- a/target/linux/ramips/dts/WMDR-143N.dts +++ b/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts @@ -3,7 +3,7 @@ #include "rt3883.dtsi" / { - compatible = "loewe,wmdr-143n", "ralink,rt3883-soc"; + compatible = "loewe,wmdr-143n", "ralink,rt3662-soc", "ralink,rt3883-soc"; model = "Loewe WMDR-143N"; }; @@ -64,6 +64,5 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0>; - mtd-mac-address = <&factory 0x4>; + ralink,mtd-eeprom = <&factory 0x0>; }; diff --git a/target/linux/ramips/dts/HPM.dts b/target/linux/ramips/dts/rt3662_omnima_hpm.dts similarity index 97% rename from target/linux/ramips/dts/HPM.dts rename to target/linux/ramips/dts/rt3662_omnima_hpm.dts index 7ccd07814..5d3f3278a 100644 --- a/target/linux/ramips/dts/HPM.dts +++ b/target/linux/ramips/dts/rt3662_omnima_hpm.dts @@ -6,7 +6,7 @@ #include / { - compatible = "omnima,hpm", "ralink,rt3883-soc"; + compatible = "omnima,hpm", "ralink,rt3662-soc", "ralink,rt3883-soc"; model = "Omnima HPM"; aliases { diff --git a/target/linux/ramips/dts/CY-SWR1100.dts b/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts similarity index 84% rename from target/linux/ramips/dts/CY-SWR1100.dts rename to target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts index afffee2bd..0d98a43e0 100644 --- a/target/linux/ramips/dts/CY-SWR1100.dts +++ b/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts @@ -6,12 +6,14 @@ #include / { - compatible = "samsung,cy-swr1100", "ralink,rt3883-soc"; + compatible = "samsung,cy-swr1100", "ralink,rt3662-soc", "ralink,rt3883-soc"; model = "Samsung CY-SWR1100"; aliases { - led-boot = &led_wps; - led-failsafe = &led_wps; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; nor-flash@1c000000 { @@ -49,8 +51,9 @@ }; partition@40000 { - label = "devdata"; + label = "devconf"; reg = <0x40000 0x10000>; + read-only; }; partition@50000 { @@ -69,8 +72,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -88,7 +90,7 @@ leds { compatible = "gpio-leds"; - led_wps: wps { + wps { label = "cy-swr1100:blue:wps"; gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; }; @@ -99,6 +101,11 @@ trigger-sources = <&ohci_port1>, <&ehci_port1>; linux,default-trigger = "usbport"; }; + + led_power: power { + label = "cy-swr1100:blue:power"; + gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; + }; }; }; @@ -130,9 +137,8 @@ status = "okay"; wifi@0,0 { - compatible = "pci0,0"; + compatible = "pci1814,3091"; reg = <0x10000 0 0 0 0>; - ralink,5ghz = <0>; ralink,mtd-eeprom = <&factory 0x2000>; }; }; diff --git a/target/linux/ramips/dts/F9K1109V1.dts b/target/linux/ramips/dts/rt3883_belkin_f9k1109v1.dts similarity index 97% rename from target/linux/ramips/dts/F9K1109V1.dts rename to target/linux/ramips/dts/rt3883_belkin_f9k1109v1.dts index cdd2b6b71..98c099cec 100644 --- a/target/linux/ramips/dts/F9K1109V1.dts +++ b/target/linux/ramips/dts/rt3883_belkin_f9k1109v1.dts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "F9K110x.dtsi" +#include "rt3883_belkin_f9k110x.dtsi" #include #include @@ -49,7 +49,6 @@ label = "f9k1109v1:blue:wps"; gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; }; - }; keys { diff --git a/target/linux/ramips/dts/F9K110x.dtsi b/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi similarity index 99% rename from target/linux/ramips/dts/F9K110x.dtsi rename to target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi index a34c3f360..98ad1b13e 100644 --- a/target/linux/ramips/dts/F9K110x.dtsi +++ b/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi @@ -14,7 +14,6 @@ gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>; realtek,extif1 = <1 0 1 1 1 1 1 1 2>; }; - }; &gpio1 { diff --git a/target/linux/ramips/dts/WLR-6000.dts b/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts similarity index 100% rename from target/linux/ramips/dts/WLR-6000.dts rename to target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts diff --git a/target/linux/ramips/dts/TEW-691GR.dts b/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts similarity index 100% rename from target/linux/ramips/dts/TEW-691GR.dts rename to target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts diff --git a/target/linux/ramips/dts/TEW-692GR.dts b/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts similarity index 100% rename from target/linux/ramips/dts/TEW-692GR.dts rename to target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts diff --git a/target/linux/ramips/dts/PX-4885-4M.dts b/target/linux/ramips/dts/rt5350_7links_px-4885-4m.dts similarity index 91% rename from target/linux/ramips/dts/PX-4885-4M.dts rename to target/linux/ramips/dts/rt5350_7links_px-4885-4m.dts index ee2068f8f..914ceb0c5 100644 --- a/target/linux/ramips/dts/PX-4885-4M.dts +++ b/target/linux/ramips/dts/rt5350_7links_px-4885-4m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "PX-4885.dtsi" +#include "rt5350_7links_px-4885.dtsi" / { compatible = "7links,px-4885-4m", "7links,px-4885", "ralink,rt5350-soc"; @@ -32,7 +32,7 @@ read-only; }; - factory: partition@40000 { + devconf: partition@40000 { label = "devconf"; reg = <0x40000 0x10000>; read-only; diff --git a/target/linux/ramips/dts/PX-4885-8M.dts b/target/linux/ramips/dts/rt5350_7links_px-4885-8m.dts similarity index 91% rename from target/linux/ramips/dts/PX-4885-8M.dts rename to target/linux/ramips/dts/rt5350_7links_px-4885-8m.dts index a52ba2eda..c9826166b 100644 --- a/target/linux/ramips/dts/PX-4885-8M.dts +++ b/target/linux/ramips/dts/rt5350_7links_px-4885-8m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "PX-4885.dtsi" +#include "rt5350_7links_px-4885.dtsi" / { compatible = "7links,px-4885-8m", "7links,px-4885", "ralink,rt5350-soc"; @@ -32,7 +32,7 @@ read-only; }; - factory: partition@40000 { + devconf: partition@40000 { label = "devconf"; reg = <0x40000 0x10000>; read-only; diff --git a/target/linux/ramips/dts/PX-4885.dtsi b/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi similarity index 93% rename from target/linux/ramips/dts/PX-4885.dtsi rename to target/linux/ramips/dts/rt5350_7links_px-4885.dtsi index 032a89cd1..cdd3033be 100644 --- a/target/linux/ramips/dts/PX-4885.dtsi +++ b/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi @@ -51,7 +51,7 @@ }; ðernet { - mtd-mac-address = <&factory 0x28>; + mtd-mac-address = <&devconf 0x28>; }; &esw { @@ -59,5 +59,5 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0>; + ralink,mtd-eeprom = <&devconf 0>; }; diff --git a/target/linux/ramips/dts/AIR3GII.dts b/target/linux/ramips/dts/rt5350_airlive_air3gii.dts similarity index 100% rename from target/linux/ramips/dts/AIR3GII.dts rename to target/linux/ramips/dts/rt5350_airlive_air3gii.dts diff --git a/target/linux/ramips/dts/ALL5003.dts b/target/linux/ramips/dts/rt5350_allnet_all5003.dts similarity index 100% rename from target/linux/ramips/dts/ALL5003.dts rename to target/linux/ramips/dts/rt5350_allnet_all5003.dts diff --git a/target/linux/ramips/dts/AWM002-EVB-4M.dts b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-4m.dts similarity index 94% rename from target/linux/ramips/dts/AWM002-EVB-4M.dts rename to target/linux/ramips/dts/rt5350_asiarf_awm002-evb-4m.dts index c8045a0f9..843cb51c3 100644 --- a/target/linux/ramips/dts/AWM002-EVB-4M.dts +++ b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-4m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "AWM002-EVB.dtsi" +#include "rt5350_asiarf_awm002-evb.dtsi" / { compatible = "asiarf,awm002-evb-4m", "ralink,rt5350-soc"; diff --git a/target/linux/ramips/dts/AWM002-EVB-8M.dts b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-8m.dts similarity index 94% rename from target/linux/ramips/dts/AWM002-EVB-8M.dts rename to target/linux/ramips/dts/rt5350_asiarf_awm002-evb-8m.dts index d7e9bd834..46ba3a7e1 100644 --- a/target/linux/ramips/dts/AWM002-EVB-8M.dts +++ b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-8m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "AWM002-EVB.dtsi" +#include "rt5350_asiarf_awm002-evb.dtsi" / { compatible = "asiarf,awm002-evb-8m", "ralink,rt5350-soc"; diff --git a/target/linux/ramips/dts/AWM002-EVB.dtsi b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi similarity index 100% rename from target/linux/ramips/dts/AWM002-EVB.dtsi rename to target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi diff --git a/target/linux/ramips/dts/F7C027.dts b/target/linux/ramips/dts/rt5350_belkin_f7c027.dts similarity index 100% rename from target/linux/ramips/dts/F7C027.dts rename to target/linux/ramips/dts/rt5350_belkin_f7c027.dts diff --git a/target/linux/ramips/dts/DCS-930L-B1.dts b/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts similarity index 100% rename from target/linux/ramips/dts/DCS-930L-B1.dts rename to target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts diff --git a/target/linux/ramips/dts/DIR-300-B7.dts b/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts similarity index 100% rename from target/linux/ramips/dts/DIR-300-B7.dts rename to target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts diff --git a/target/linux/ramips/dts/DIR-320-B1.dts b/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts similarity index 100% rename from target/linux/ramips/dts/DIR-320-B1.dts rename to target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts diff --git a/target/linux/ramips/dts/DIR-610-A1.dts b/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts similarity index 100% rename from target/linux/ramips/dts/DIR-610-A1.dts rename to target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts diff --git a/target/linux/ramips/dts/DWR-512-B.dts b/target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts similarity index 100% rename from target/linux/ramips/dts/DWR-512-B.dts rename to target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts diff --git a/target/linux/ramips/dts/WIZARD8800.dts b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts similarity index 95% rename from target/linux/ramips/dts/WIZARD8800.dts rename to target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts index af105b5af..a69ed4bd0 100644 --- a/target/linux/ramips/dts/WIZARD8800.dts +++ b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts @@ -3,7 +3,7 @@ #include "rt5350.dtsi" / { - compatible = "easyacc,wizard8800", "ralink,rt5350-soc"; + compatible = "easyacc,wizard-8800", "ralink,rt5350-soc"; model = "EASYACC WI-STOR WIZARD 8800"; }; diff --git a/target/linux/ramips/dts/MPRA1.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts similarity index 100% rename from target/linux/ramips/dts/MPRA1.dts rename to target/linux/ramips/dts/rt5350_hame_mpr-a1.dts diff --git a/target/linux/ramips/dts/MPRA2.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts similarity index 100% rename from target/linux/ramips/dts/MPRA2.dts rename to target/linux/ramips/dts/rt5350_hame_mpr-a2.dts diff --git a/target/linux/ramips/dts/HLKRM04.dts b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts similarity index 96% rename from target/linux/ramips/dts/HLKRM04.dts rename to target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts index 7b2791fa6..cf586bf59 100644 --- a/target/linux/ramips/dts/HLKRM04.dts +++ b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts @@ -9,11 +9,6 @@ compatible = "hilink,hlk-rm04", "ralink,rt5350-soc"; model = "HILINK HLK-RM04"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x1000000>; - }; - chosen { bootargs = "console=ttyS1,57600"; }; diff --git a/target/linux/ramips/dts/HT-TM02.dts b/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts similarity index 100% rename from target/linux/ramips/dts/HT-TM02.dts rename to target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts diff --git a/target/linux/ramips/dts/M2M.dts b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts similarity index 94% rename from target/linux/ramips/dts/M2M.dts rename to target/linux/ramips/dts/rt5350_intenso_memory2move.dts index 122c70e21..763256934 100644 --- a/target/linux/ramips/dts/M2M.dts +++ b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts @@ -24,12 +24,12 @@ compatible = "gpio-leds"; led_wifi: wifi { - label = "m2m:blue:wifi"; + label = "memory2move:blue:wifi"; gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; }; wan { - label = "m2m:green:wan"; + label = "memory2move:green:wan"; gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; }; }; @@ -78,7 +78,7 @@ }; factory: partition@40000 { - label = "Factory"; + label = "factory"; reg = <0x40000 0x10000>; read-only; }; diff --git a/target/linux/ramips/dts/WT1520-4M.dts b/target/linux/ramips/dts/rt5350_nexx_wt1520-4m.dts similarity index 95% rename from target/linux/ramips/dts/WT1520-4M.dts rename to target/linux/ramips/dts/rt5350_nexx_wt1520-4m.dts index 1f54efe42..e5109c96b 100644 --- a/target/linux/ramips/dts/WT1520-4M.dts +++ b/target/linux/ramips/dts/rt5350_nexx_wt1520-4m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "WT1520.dtsi" +#include "rt5350_nexx_wt1520.dtsi" / { compatible = "nexx,wt1520-4m", "nexx,wt1520", "ralink,rt5350-soc"; diff --git a/target/linux/ramips/dts/WT1520-8M.dts b/target/linux/ramips/dts/rt5350_nexx_wt1520-8m.dts similarity index 95% rename from target/linux/ramips/dts/WT1520-8M.dts rename to target/linux/ramips/dts/rt5350_nexx_wt1520-8m.dts index e238826aa..a0e3d3b5b 100644 --- a/target/linux/ramips/dts/WT1520-8M.dts +++ b/target/linux/ramips/dts/rt5350_nexx_wt1520-8m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "WT1520.dtsi" +#include "rt5350_nexx_wt1520.dtsi" / { compatible = "nexx,wt1520-8m", "nexx,wt1520", "ralink,rt5350-soc"; diff --git a/target/linux/ramips/dts/WT1520.dtsi b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi similarity index 90% rename from target/linux/ramips/dts/WT1520.dtsi rename to target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi index 28d498bc8..a66b0096a 100644 --- a/target/linux/ramips/dts/WT1520.dtsi +++ b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi @@ -6,11 +6,6 @@ / { compatible = "nexx,wt1520", "ralink,rt5350-soc"; - memory@0 { - device_type = "memory"; - reg = <0x0 0x2000000>; - }; - keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/NIXCORE-16M.dts b/target/linux/ramips/dts/rt5350_nixcore_x1-16m.dts similarity index 95% rename from target/linux/ramips/dts/NIXCORE-16M.dts rename to target/linux/ramips/dts/rt5350_nixcore_x1-16m.dts index 328217787..790470174 100644 --- a/target/linux/ramips/dts/NIXCORE-16M.dts +++ b/target/linux/ramips/dts/rt5350_nixcore_x1-16m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "NIXCORE.dtsi" +#include "rt5350_nixcore_x1.dtsi" / { compatible = "nixcore,x1-16m", "nixcore,x1", "ralink,rt5350-soc"; diff --git a/target/linux/ramips/dts/NIXCORE-8M.dts b/target/linux/ramips/dts/rt5350_nixcore_x1-8m.dts similarity index 95% rename from target/linux/ramips/dts/NIXCORE-8M.dts rename to target/linux/ramips/dts/rt5350_nixcore_x1-8m.dts index f32bcf3f4..f02bb4c3d 100644 --- a/target/linux/ramips/dts/NIXCORE-8M.dts +++ b/target/linux/ramips/dts/rt5350_nixcore_x1-8m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "NIXCORE.dtsi" +#include "rt5350_nixcore_x1.dtsi" / { compatible = "nixcore,x1-8m", "nixcore,x1", "ralink,rt5350-soc"; diff --git a/target/linux/ramips/dts/NIXCORE.dtsi b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi similarity index 100% rename from target/linux/ramips/dts/NIXCORE.dtsi rename to target/linux/ramips/dts/rt5350_nixcore_x1.dtsi diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino-evb.dts similarity index 92% rename from target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts rename to target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino-evb.dts index 5c7b3c7c4..57164ea8a 100644 --- a/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts +++ b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino-evb.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "RT5350F-OLINUXINO.dtsi" +#include "rt5350_olimex_rt5350f-olinuxino.dtsi" #include diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dts b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dts similarity index 71% rename from target/linux/ramips/dts/RT5350F-OLINUXINO.dts rename to target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dts index 2e0dcb155..f3b2c948e 100644 --- a/target/linux/ramips/dts/RT5350F-OLINUXINO.dts +++ b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "RT5350F-OLINUXINO.dtsi" +#include "rt5350_olimex_rt5350f-olinuxino.dtsi" / { compatible = "olimex,rt5350f-olinuxino", "ralink,rt5350-soc"; diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi similarity index 99% rename from target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi rename to target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi index 88b412c8d..ff30966bf 100644 --- a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi +++ b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi @@ -9,7 +9,6 @@ }; }; - &spi0 { status = "okay"; @@ -96,4 +95,3 @@ &uart { status = "okay"; }; - diff --git a/target/linux/ramips/dts/MINIEMBPLUG.dts b/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts similarity index 100% rename from target/linux/ramips/dts/MINIEMBPLUG.dts rename to target/linux/ramips/dts/rt5350_omnima_miniembplug.dts diff --git a/target/linux/ramips/dts/MZK-DP150N.dts b/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts similarity index 100% rename from target/linux/ramips/dts/MZK-DP150N.dts rename to target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts diff --git a/target/linux/ramips/dts/M3.dts b/target/linux/ramips/dts/rt5350_poray_m3.dts similarity index 100% rename from target/linux/ramips/dts/M3.dts rename to target/linux/ramips/dts/rt5350_poray_m3.dts diff --git a/target/linux/ramips/dts/M4-4M.dts b/target/linux/ramips/dts/rt5350_poray_m4-4m.dts similarity index 95% rename from target/linux/ramips/dts/M4-4M.dts rename to target/linux/ramips/dts/rt5350_poray_m4-4m.dts index 53a58b3d4..f917d344d 100644 --- a/target/linux/ramips/dts/M4-4M.dts +++ b/target/linux/ramips/dts/rt5350_poray_m4-4m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "M4.dtsi" +#include "rt5350_poray_m4.dtsi" / { compatible = "poray,m4-4m", "poray,m4", "ralink,rt5350-soc"; diff --git a/target/linux/ramips/dts/M4-8M.dts b/target/linux/ramips/dts/rt5350_poray_m4-8m.dts similarity index 95% rename from target/linux/ramips/dts/M4-8M.dts rename to target/linux/ramips/dts/rt5350_poray_m4-8m.dts index b947a36d0..ac689f859 100644 --- a/target/linux/ramips/dts/M4-8M.dts +++ b/target/linux/ramips/dts/rt5350_poray_m4-8m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "M4.dtsi" +#include "rt5350_poray_m4.dtsi" / { compatible = "poray,m4-8m", "poray,m4", "ralink,rt5350-soc"; diff --git a/target/linux/ramips/dts/M4.dtsi b/target/linux/ramips/dts/rt5350_poray_m4.dtsi similarity index 100% rename from target/linux/ramips/dts/M4.dtsi rename to target/linux/ramips/dts/rt5350_poray_m4.dtsi diff --git a/target/linux/ramips/dts/X5.dts b/target/linux/ramips/dts/rt5350_poray_x5.dts similarity index 100% rename from target/linux/ramips/dts/X5.dts rename to target/linux/ramips/dts/rt5350_poray_x5.dts diff --git a/target/linux/ramips/dts/X8.dts b/target/linux/ramips/dts/rt5350_poray_x8.dts similarity index 100% rename from target/linux/ramips/dts/X8.dts rename to target/linux/ramips/dts/rt5350_poray_x8.dts diff --git a/target/linux/ramips/dts/3G150B.dts b/target/linux/ramips/dts/rt5350_tenda_3g150b.dts similarity index 100% rename from target/linux/ramips/dts/3G150B.dts rename to target/linux/ramips/dts/rt5350_tenda_3g150b.dts diff --git a/target/linux/ramips/dts/TEW-714TRU.dts b/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts similarity index 100% rename from target/linux/ramips/dts/TEW-714TRU.dts rename to target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts diff --git a/target/linux/ramips/dts/A5-V11.dts b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts similarity index 98% rename from target/linux/ramips/dts/A5-V11.dts rename to target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts index 707963d69..f4e4d17b0 100644 --- a/target/linux/ramips/dts/A5-V11.dts +++ b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts @@ -14,6 +14,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; + label-mac-device = ðernet; }; leds { diff --git a/target/linux/ramips/dts/VOCORE-16M.dts b/target/linux/ramips/dts/rt5350_vocore_vocore-16m.dts similarity index 95% rename from target/linux/ramips/dts/VOCORE-16M.dts rename to target/linux/ramips/dts/rt5350_vocore_vocore-16m.dts index 30781b53b..5d9a4e96e 100644 --- a/target/linux/ramips/dts/VOCORE-16M.dts +++ b/target/linux/ramips/dts/rt5350_vocore_vocore-16m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "VOCORE.dtsi" +#include "rt5350_vocore_vocore.dtsi" / { compatible = "vocore,vocore-16m", "vocore,vocore", "ralink,rt5350-soc"; diff --git a/target/linux/ramips/dts/VOCORE-8M.dts b/target/linux/ramips/dts/rt5350_vocore_vocore-8m.dts similarity index 95% rename from target/linux/ramips/dts/VOCORE-8M.dts rename to target/linux/ramips/dts/rt5350_vocore_vocore-8m.dts index ec301965c..bfc307dfc 100644 --- a/target/linux/ramips/dts/VOCORE-8M.dts +++ b/target/linux/ramips/dts/rt5350_vocore_vocore-8m.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "VOCORE.dtsi" +#include "rt5350_vocore_vocore.dtsi" / { compatible = "vocore,vocore-8m", "vocore,vocore", "ralink,rt5350-soc"; diff --git a/target/linux/ramips/dts/VOCORE.dtsi b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi similarity index 99% rename from target/linux/ramips/dts/VOCORE.dtsi rename to target/linux/ramips/dts/rt5350_vocore_vocore.dtsi index c5c26e77c..cce444c00 100644 --- a/target/linux/ramips/dts/VOCORE.dtsi +++ b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi @@ -10,6 +10,7 @@ led-failsafe = &led_status; led-running = &led_status; led-upgrade = &led_status; + label-mac-device = ðernet; }; gpio-export { diff --git a/target/linux/ramips/dts/NCS601W.dts b/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts similarity index 100% rename from target/linux/ramips/dts/NCS601W.dts rename to target/linux/ramips/dts/rt5350_wansview_ncs601w.dts diff --git a/target/linux/ramips/dts/WIZFI630A.dts b/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts similarity index 100% rename from target/linux/ramips/dts/WIZFI630A.dts rename to target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts diff --git a/target/linux/ramips/dts/ZL5900V2.dts b/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts similarity index 100% rename from target/linux/ramips/dts/ZL5900V2.dts rename to target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts diff --git a/target/linux/ramips/dts/kn_st.dts b/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts similarity index 98% rename from target/linux/ramips/dts/kn_st.dts rename to target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts index 16ab9567c..b8db4fdc7 100644 --- a/target/linux/ramips/dts/kn_st.dts +++ b/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts @@ -15,6 +15,7 @@ led-failsafe = &led_status; led-running = &led_status; led-upgrade = &led_status; + label-mac-device = ðernet; }; leds { @@ -102,7 +103,6 @@ mtd-mac-address = <&factory 0x28>; }; - &esw { mediatek,portmap = <0x2f>; mediatek,led_polarity = <0x17>; diff --git a/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c b/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c index 4ced4b660..cb0aa4231 100644 --- a/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c +++ b/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c @@ -2205,16 +2205,12 @@ static int msdc_drv_probe(struct platform_device *pdev) struct msdc_host *host; struct msdc_hw *hw; int ret; - u32 reg; //FIXME: this should be done by pinconf and not by the sd driver - if (ralink_soc == MT762X_SOC_MT7688 || - ralink_soc == MT762X_SOC_MT7628AN) { - /* set EPHY pads to digital mode */ - reg = sdr_read32((void __iomem *)(RALINK_SYSCTL_BASE + 0x3c)); - reg |= 0x1e << 16; - sdr_write32((void __iomem *)(RALINK_SYSCTL_BASE + 0x3c), reg); - } + if ((ralink_soc == MT762X_SOC_MT7688 || + ralink_soc == MT762X_SOC_MT7628AN) && + (!(rt_sysc_r32(0x60) & BIT(15)))) + rt_sysc_m32(0xf << 17, 0xf << 17, 0x3c); hw = &msdc0_hw; diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/gsw_mt7620.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/gsw_mt7620.c index 5fc5080aa..bd379e6c7 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/gsw_mt7620.c +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/gsw_mt7620.c @@ -116,73 +116,82 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode) mt7530_mdio_w32(gsw, 0x7a78, 0x855); } else { + + if (gsw->ephy_base) { + /* set phy base addr to ephy_base */ + mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_GPC1) | + (gsw->ephy_base << 16), + GSW_REG_GPC1); + fe_reset(BIT(24)); /* Resets the Ethernet PHY block. */ + } + /* global page 4 */ - _mt7620_mii_write(gsw, 1, 31, 0x4000); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x4000); - _mt7620_mii_write(gsw, 1, 17, 0x7444); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 17, 0x7444); if (is_BGA) - _mt7620_mii_write(gsw, 1, 19, 0x0114); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 19, 0x0114); else - _mt7620_mii_write(gsw, 1, 19, 0x0117); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 19, 0x0117); - _mt7620_mii_write(gsw, 1, 22, 0x10cf); - _mt7620_mii_write(gsw, 1, 25, 0x6212); - _mt7620_mii_write(gsw, 1, 26, 0x0777); - _mt7620_mii_write(gsw, 1, 29, 0x4000); - _mt7620_mii_write(gsw, 1, 28, 0xc077); - _mt7620_mii_write(gsw, 1, 24, 0x0000); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 22, 0x10cf); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 25, 0x6212); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 26, 0x0777); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 29, 0x4000); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 28, 0xc077); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 24, 0x0000); /* global page 3 */ - _mt7620_mii_write(gsw, 1, 31, 0x3000); - _mt7620_mii_write(gsw, 1, 17, 0x4838); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x3000); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 17, 0x4838); /* global page 2 */ - _mt7620_mii_write(gsw, 1, 31, 0x2000); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x2000); if (is_BGA) { - _mt7620_mii_write(gsw, 1, 21, 0x0515); - _mt7620_mii_write(gsw, 1, 22, 0x0053); - _mt7620_mii_write(gsw, 1, 23, 0x00bf); - _mt7620_mii_write(gsw, 1, 24, 0x0aaf); - _mt7620_mii_write(gsw, 1, 25, 0x0fad); - _mt7620_mii_write(gsw, 1, 26, 0x0fc1); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 21, 0x0515); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 22, 0x0053); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 23, 0x00bf); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 24, 0x0aaf); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 25, 0x0fad); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 26, 0x0fc1); } else { - _mt7620_mii_write(gsw, 1, 21, 0x0517); - _mt7620_mii_write(gsw, 1, 22, 0x0fd2); - _mt7620_mii_write(gsw, 1, 23, 0x00bf); - _mt7620_mii_write(gsw, 1, 24, 0x0aab); - _mt7620_mii_write(gsw, 1, 25, 0x00ae); - _mt7620_mii_write(gsw, 1, 26, 0x0fff); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 21, 0x0517); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 22, 0x0fd2); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 23, 0x00bf); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 24, 0x0aab); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 25, 0x00ae); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 26, 0x0fff); } /* global page 1 */ - _mt7620_mii_write(gsw, 1, 31, 0x1000); - _mt7620_mii_write(gsw, 1, 17, 0xe7f8); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x1000); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 17, 0xe7f8); /* turn on all PHYs */ for (i = 0; i <= 4; i++) { - val = _mt7620_mii_read(gsw, i, 0); + val = _mt7620_mii_read(gsw, gsw->ephy_base + i, 0); val &= ~BIT(11); - _mt7620_mii_write(gsw, i, 0, val); + _mt7620_mii_write(gsw, gsw->ephy_base + i, 0, val); } } /* global page 0 */ - _mt7620_mii_write(gsw, 1, 31, 0x8000); - _mt7620_mii_write(gsw, 0, 30, 0xa000); - _mt7620_mii_write(gsw, 1, 30, 0xa000); - _mt7620_mii_write(gsw, 2, 30, 0xa000); - _mt7620_mii_write(gsw, 3, 30, 0xa000); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x8000); + _mt7620_mii_write(gsw, gsw->ephy_base + 0, 30, 0xa000); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 30, 0xa000); + _mt7620_mii_write(gsw, gsw->ephy_base + 2, 30, 0xa000); + _mt7620_mii_write(gsw, gsw->ephy_base + 3, 30, 0xa000); - _mt7620_mii_write(gsw, 0, 4, 0x05e1); - _mt7620_mii_write(gsw, 1, 4, 0x05e1); - _mt7620_mii_write(gsw, 2, 4, 0x05e1); - _mt7620_mii_write(gsw, 3, 4, 0x05e1); + _mt7620_mii_write(gsw, gsw->ephy_base + 0, 4, 0x05e1); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 4, 0x05e1); + _mt7620_mii_write(gsw, gsw->ephy_base + 2, 4, 0x05e1); + _mt7620_mii_write(gsw, gsw->ephy_base + 3, 4, 0x05e1); /* global page 2 */ - _mt7620_mii_write(gsw, 1, 31, 0xa000); - _mt7620_mii_write(gsw, 0, 16, 0x1111); - _mt7620_mii_write(gsw, 1, 16, 0x1010); - _mt7620_mii_write(gsw, 2, 16, 0x1515); - _mt7620_mii_write(gsw, 3, 16, 0x0f0f); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0xa000); + _mt7620_mii_write(gsw, gsw->ephy_base + 0, 16, 0x1111); + _mt7620_mii_write(gsw, gsw->ephy_base + 1, 16, 0x1010); + _mt7620_mii_write(gsw, gsw->ephy_base + 2, 16, 0x1515); + _mt7620_mii_write(gsw, gsw->ephy_base + 3, 16, 0x0f0f); /* CPU Port6 Force Link 1G, FC ON */ mtk_switch_w32(gsw, 0x5e33b, GSW_REG_PORT_PMCR(6)); @@ -196,9 +205,9 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode) val |= 3 << 14; rt_sysc_w32(val, SYSC_REG_CFG1); - _mt7620_mii_write(gsw, 4, 30, 0xa000); - _mt7620_mii_write(gsw, 4, 4, 0x05e1); - _mt7620_mii_write(gsw, 4, 16, 0x1313); + _mt7620_mii_write(gsw, gsw->ephy_base + 4, 30, 0xa000); + _mt7620_mii_write(gsw, gsw->ephy_base + 4, 4, 0x05e1); + _mt7620_mii_write(gsw, gsw->ephy_base + 4, 16, 0x1313); pr_info("gsw: setting port4 to ephy mode\n"); } else if (!mdio_mode) { u32 val = rt_sysc_r32(SYSC_REG_CFG1); @@ -247,6 +256,7 @@ static int mt7620_gsw_probe(struct platform_device *pdev) const char *port4 = NULL; struct mt7620_gsw *gsw; struct device_node *np = pdev->dev.of_node; + u16 val; gsw = devm_kzalloc(&pdev->dev, sizeof(struct mt7620_gsw), GFP_KERNEL); if (!gsw) @@ -266,6 +276,11 @@ static int mt7620_gsw_probe(struct platform_device *pdev) else gsw->port4 = PORT4_EPHY; + if (of_property_read_u16(np, "mediatek,ephy-base-address", &val) == 0) + gsw->ephy_base = val; + else + gsw->ephy_base = 0; + gsw->irq = platform_get_irq(pdev, 0); platform_set_drvdata(pdev, gsw); diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/gsw_mt7620.h b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/gsw_mt7620.h index ae0b6de02..555a586c4 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/gsw_mt7620.h +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/gsw_mt7620.h @@ -103,6 +103,7 @@ struct mt7620_gsw { int irq; int port4; unsigned long int autopoll; + u16 ephy_base; }; void mtk_switch_w32(struct mt7620_gsw *gsw, u32 val, unsigned reg); diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio.c index a1c115687..ce27abf69 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio.c +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio.c @@ -60,19 +60,19 @@ static void fe_phy_link_adjust(struct net_device *dev) spin_unlock_irqrestore(&priv->phy->lock, flags); } -int fe_connect_phy_node(struct fe_priv *priv, struct device_node *phy_node) +int fe_connect_phy_node(struct fe_priv *priv, struct device_node *phy_node, int port) { - const __be32 *_port = NULL; + const __be32 *_phy_addr = NULL; struct phy_device *phydev; - int phy_mode, port; + int phy_mode; - _port = of_get_property(phy_node, "reg", NULL); + _phy_addr = of_get_property(phy_node, "reg", NULL); - if (!_port || (be32_to_cpu(*_port) >= 0x20)) { - pr_err("%s: invalid port id\n", phy_node->name); + if (!_phy_addr || (be32_to_cpu(*_phy_addr) >= 0x20)) { + pr_err("%s: invalid phy id\n", phy_node->name); return -EINVAL; } - port = be32_to_cpu(*_port); + phy_mode = of_get_phy_mode(phy_node); if (phy_mode < 0) { dev_err(priv->dev, "incorrect phy-mode %d\n", phy_mode); @@ -127,8 +127,14 @@ static int fe_phy_connect(struct fe_priv *priv) priv->phy_dev = priv->phy->phy[i]; priv->phy_flags = FE_PHY_FLAG_PORT; } - } else if (priv->mii_bus && mdiobus_get_phy(priv->mii_bus, i)) { - phy_init(priv, mdiobus_get_phy(priv->mii_bus, i)); + } else if (priv->mii_bus) { + struct phy_device *phydev; + + phydev = mdiobus_get_phy(priv->mii_bus, i); + if (!phydev || phydev->attached_dev) + continue; + + phy_init(priv, phydev); if (!priv->phy_dev) { priv->phy_dev = mdiobus_get_phy(priv->mii_bus, i); priv->phy_flags = FE_PHY_FLAG_ATTACH; diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio.h b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio.h index 498cf144e..78364e33a 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio.h +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio.h @@ -19,7 +19,8 @@ int fe_mdio_init(struct fe_priv *priv); void fe_mdio_cleanup(struct fe_priv *priv); int fe_connect_phy_node(struct fe_priv *priv, - struct device_node *phy_node); + struct device_node *phy_node, + int port); #else static inline int fe_mdio_init(struct fe_priv *priv) { return 0; } static inline void fe_mdio_cleanup(struct fe_priv *priv) {} diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio_rt2880.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio_rt2880.c index e53fd7f62..8d82c8f7a 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio_rt2880.c +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mdio_rt2880.c @@ -218,5 +218,5 @@ void rt2880_port_init(struct fe_priv *priv, struct device_node *np) } if (priv->phy->phy_node[0] && mdiobus_get_phy(priv->mii_bus, 0)) - fe_connect_phy_node(priv, priv->phy->phy_node[0]); + fe_connect_phy_node(priv, priv->phy->phy_node[0], 0); } diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mt7530.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mt7530.c index 5216cb5c6..9acea3bc8 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mt7530.c +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mt7530.c @@ -51,6 +51,11 @@ #define MT7621_PORT_MIB_RXB_ID 37 /* RxByte */ /* registers */ +#define REG_ESW_WT_MAC_MFC 0x10 + +#define REG_ESW_WT_MAC_MFC_MIRROR_ENABLE BIT(3) +#define REG_ESW_WT_MAC_MFC_MIRROR_DEST_MASK 0x07 + #define REG_ESW_VLAN_VTCR 0x90 #define REG_ESW_VLAN_VAWD1 0x94 #define REG_ESW_VLAN_VAWD2 0x98 @@ -72,6 +77,11 @@ enum { #define REG_ESW_PORT_PVC(x) (0x2010 | ((x) << 8)) #define REG_ESW_PORT_PPBV1(x) (0x2014 | ((x) << 8)) +#define REG_ESW_PORT_PCR_MIRROR_SRC_RX_BIT BIT(8) +#define REG_ESW_PORT_PCR_MIRROR_SRC_TX_BIT BIT(9) +#define REG_ESW_PORT_PCR_MIRROR_SRC_RX_MASK 0x0100 +#define REG_ESW_PORT_PCR_MIRROR_SRC_TX_MASK 0x0200 + #define REG_HWTRAP 0x7804 #define MIB_DESC(_s , _o, _n) \ @@ -183,6 +193,8 @@ enum { struct mt7530_port_entry { u16 pvid; + bool mirror_rx; + bool mirror_tx; }; struct mt7530_vlan_entry { @@ -196,6 +208,8 @@ struct mt7530_priv { struct mii_bus *bus; struct switch_dev swdev; + u8 mirror_src_port; + u8 mirror_dest_port; bool global_vlan_enable; struct mt7530_vlan_entry vlan_entries[MT7530_NUM_VLANS]; struct mt7530_port_entry port_entries[MT7530_NUM_PORTS]; @@ -505,6 +519,138 @@ mt7530_get_vid(struct switch_dev *dev, const struct switch_attr *attr, return 0; } +static int +mt7530_get_mirror_rx_enable(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + val->value.i = priv->port_entries[priv->mirror_src_port].mirror_rx; + + return 0; +} + +static int +mt7530_set_mirror_rx_enable(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + priv->port_entries[priv->mirror_src_port].mirror_rx = val->value.i; + + return 0; +} + +static int +mt7530_get_mirror_tx_enable(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + val->value.i = priv->port_entries[priv->mirror_src_port].mirror_tx; + + return 0; +} + +static int +mt7530_set_mirror_tx_enable(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + priv->port_entries[priv->mirror_src_port].mirror_tx = val->value.i; + + return 0; +} + +static int +mt7530_get_mirror_monitor_port(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + val->value.i = priv->mirror_dest_port; + + return 0; +} + +static int +mt7530_set_mirror_monitor_port(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + priv->mirror_dest_port = val->value.i; + + return 0; +} + +static int +mt7530_get_mirror_source_port(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + val->value.i = priv->mirror_src_port; + + return 0; +} + +static int +mt7530_set_mirror_source_port(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + priv->mirror_src_port = val->value.i; + + return 0; +} + +static int +mt7530_get_port_mirror_rx(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + val->value.i = priv->port_entries[val->port_vlan].mirror_rx; + + return 0; +} + +static int +mt7530_set_port_mirror_rx(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + priv->port_entries[val->port_vlan].mirror_rx = val->value.i; + + return 0; +} + +static int +mt7530_get_port_mirror_tx(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + val->value.i = priv->port_entries[val->port_vlan].mirror_tx; + + return 0; +} + +static int +mt7530_set_port_mirror_tx(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); + + priv->port_entries[val->port_vlan].mirror_tx = val->value.i; + + return 0; +} + static void mt7530_write_vlan_entry(struct mt7530_priv *priv, int vlan, u16 vid, u8 ports, u8 etags) @@ -558,6 +704,7 @@ mt7530_apply_config(struct switch_dev *dev) int i, j; u8 tag_ports; u8 untag_ports; + bool is_mirror = false; if (!priv->global_vlan_enable) { for (i = 0; i < MT7530_NUM_PORTS; i++) @@ -637,6 +784,31 @@ mt7530_apply_config(struct switch_dev *dev) mt7530_w32(priv, REG_ESW_PORT_PPBV1(i), val); } + /* set mirroring source port */ + for (i = 0; i < MT7530_NUM_PORTS; i++) { + u32 val = mt7530_r32(priv, REG_ESW_PORT_PCR(i)); + if (priv->port_entries[i].mirror_rx) { + val |= REG_ESW_PORT_PCR_MIRROR_SRC_RX_BIT; + is_mirror = true; + } + + if (priv->port_entries[i].mirror_tx) { + val |= REG_ESW_PORT_PCR_MIRROR_SRC_TX_BIT; + is_mirror = true; + } + + mt7530_w32(priv, REG_ESW_PORT_PCR(i), val); + } + + /* set mirroring monitor port */ + if (is_mirror) { + u32 val = mt7530_r32(priv, REG_ESW_WT_MAC_MFC); + val |= REG_ESW_WT_MAC_MFC_MIRROR_ENABLE; + val &= ~REG_ESW_WT_MAC_MFC_MIRROR_DEST_MASK; + val |= priv->mirror_dest_port; + mt7530_w32(priv, REG_ESW_WT_MAC_MFC, val); + } + return 0; } @@ -830,6 +1002,34 @@ static const struct switch_attr mt7530_global[] = { .description = "Get MIB counters for switch", .get = mt7530_sw_get_mib, .set = NULL, + }, { + .type = SWITCH_TYPE_INT, + .name = "enable_mirror_rx", + .description = "Enable mirroring of RX packets", + .set = mt7530_set_mirror_rx_enable, + .get = mt7530_get_mirror_rx_enable, + .max = 1 + }, { + .type = SWITCH_TYPE_INT, + .name = "enable_mirror_tx", + .description = "Enable mirroring of TX packets", + .set = mt7530_set_mirror_tx_enable, + .get = mt7530_get_mirror_tx_enable, + .max = 1 + }, { + .type = SWITCH_TYPE_INT, + .name = "mirror_monitor_port", + .description = "Mirror monitor port", + .set = mt7530_set_mirror_monitor_port, + .get = mt7530_get_mirror_monitor_port, + .max = MT7530_NUM_PORTS - 1 + }, { + .type = SWITCH_TYPE_INT, + .name = "mirror_source_port", + .description = "Mirror source port", + .set = mt7530_set_mirror_source_port, + .get = mt7530_get_mirror_source_port, + .max = MT7530_NUM_PORTS - 1 }, }; @@ -840,6 +1040,20 @@ static const struct switch_attr mt7621_port[] = { .description = "Get MIB counters for port", .get = mt7621_sw_get_port_mib, .set = NULL, + }, { + .type = SWITCH_TYPE_INT, + .name = "enable_mirror_rx", + .description = "Enable mirroring of RX packets", + .set = mt7530_set_port_mirror_rx, + .get = mt7530_get_port_mirror_rx, + .max = 1, + }, { + .type = SWITCH_TYPE_INT, + .name = "enable_mirror_tx", + .description = "Enable mirroring of TX packets", + .set = mt7530_set_port_mirror_tx, + .get = mt7530_get_port_mirror_tx, + .max = 1, }, }; @@ -861,6 +1075,20 @@ static const struct switch_attr mt7530_port[] = { .description = "Get MIB counters for port", .get = mt7530_sw_get_port_mib, .set = NULL, + }, { + .type = SWITCH_TYPE_INT, + .name = "enable_mirror_rx", + .description = "Enable mirroring of RX packets", + .set = mt7530_set_port_mirror_rx, + .get = mt7530_get_port_mirror_rx, + .max = 1, + }, { + .type = SWITCH_TYPE_INT, + .name = "enable_mirror_tx", + .description = "Enable mirroring of TX packets", + .set = mt7530_set_port_mirror_tx, + .get = mt7530_get_port_mirror_tx, + .max = 1, }, }; diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c index b2c3d32c5..00e84bbcf 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -32,6 +32,9 @@ #include #include #include +#include +#include +#include #include @@ -1333,6 +1336,35 @@ static int fe_stop(struct net_device *dev) return 0; } +static void fe_reset_phy(struct fe_priv *priv) +{ + int err, msec = 30; + struct gpio_desc *phy_reset; + + phy_reset = devm_gpiod_get_optional(priv->dev, "phy-reset", + GPIOD_OUT_HIGH); + if (!phy_reset) + return; + + if (IS_ERR(phy_reset)) { + dev_err(priv->dev, "Error acquiring reset gpio pins: %ld\n", + PTR_ERR(phy_reset)); + return; + } + + err = of_property_read_u32(priv->dev->of_node, "phy-reset-duration", + &msec); + if (!err && msec > 1000) + msec = 30; + + if (msec > 20) + msleep(msec); + else + usleep_range(msec * 1000, msec * 1000 + 1000); + + gpiod_set_value(phy_reset, 0); +} + static int __init fe_init(struct net_device *dev) { struct fe_priv *priv = netdev_priv(dev); @@ -1348,13 +1380,15 @@ static int __init fe_init(struct net_device *dev) return -ENODEV; } + fe_reset_phy(priv); + mac_addr = of_get_mac_address(priv->dev->of_node); if (mac_addr) ether_addr_copy(dev->dev_addr, mac_addr); /* If the mac address is invalid, use random mac address */ if (!is_valid_ether_addr(dev->dev_addr)) { - random_ether_addr(dev->dev_addr); + eth_hw_addr_random(dev); dev_err(priv->dev, "generated random MAC address %pM\n", dev->dev_addr); } diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/soc_mt7620.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/soc_mt7620.c index 7f728d142..fb2d45a56 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/soc_mt7620.c +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/soc_mt7620.c @@ -118,7 +118,7 @@ static void mt7620_set_mac(struct fe_priv *priv, unsigned char *mac) spin_unlock_irqrestore(&priv->page_lock, flags); } -static void mt7620_auto_poll(struct mt7620_gsw *gsw) +static void mt7620_auto_poll(struct mt7620_gsw *gsw, int port) { int phy; int lsb = -1, msb = 0; @@ -129,7 +129,9 @@ static void mt7620_auto_poll(struct mt7620_gsw *gsw) msb = phy; } - if (lsb == msb) + if (lsb == msb && port == 4) + msb++; + else if (lsb == msb && port == 5) lsb--; mtk_switch_w32(gsw, PHY_AN_EN | PHY_PRE_EN | PMY_MDC_CONF(5) | @@ -140,6 +142,7 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np) { struct mt7620_gsw *gsw = (struct mt7620_gsw *)priv->soc->swpriv; const __be32 *_id = of_get_property(np, "reg", NULL); + const __be32 *phy_addr; int phy_mode, size, id; int shift = 12; u32 val, mask = 0; @@ -234,14 +237,15 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np) return; } - if (priv->phy->phy_node[id] && mdiobus_get_phy(priv->mii_bus, id)) { + phy_addr = of_get_property(priv->phy->phy_node[id], "reg", NULL); + if (phy_addr && mdiobus_get_phy(priv->mii_bus, be32_to_cpup(phy_addr))) { u32 val = PMCR_BACKPRES | PMCR_BACKOFF | PMCR_RX_EN | PMCR_TX_EN | PMCR_MAC_MODE | PMCR_IPG; mtk_switch_w32(gsw, val, GSW_REG_PORT_PMCR(id)); - fe_connect_phy_node(priv, priv->phy->phy_node[id]); - gsw->autopoll |= BIT(id); - mt7620_auto_poll(gsw); + fe_connect_phy_node(priv, priv->phy->phy_node[id], id); + gsw->autopoll |= BIT(be32_to_cpup(phy_addr)); + mt7620_auto_poll(gsw,id); return; } } diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 07251aebb..d700e6944 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -DEVICE_VARS += DTS IMAGE_SIZE NETGEAR_BOARD_ID NETGEAR_HW_ID +DEVICE_VARS += IMAGE_SIZE NETGEAR_BOARD_ID NETGEAR_HW_ID DEVICE_VARS += BUFFALO_TAG_PLATFORM BUFFALO_TAG_VERSION BUFFALO_TAG_MINOR DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK DEVICE_VARS += SERCOMM_HWID SERCOMM_HWVER SERCOMM_SWVER @@ -23,10 +23,10 @@ KERNEL_DTB = kernel-bin | append-dtb | lzma define Device/Default PROFILES = Default KERNEL := $(KERNEL_DTB) | uImage lzma + MTK_SOC := DEVICE_DTS_DIR := ../dts - DEVICE_DTS = $$(DTS) + DEVICE_DTS = $$(MTK_SOC)_$(1) IMAGES := sysupgrade.bin - IMAGE_SIZE := $(ralink_default_fw_size_8M) SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) sysupgrade_bin := append-kernel | append-rootfs | pad-rootfs IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) @@ -55,7 +55,7 @@ endef define Build/trx $(STAGING_DIR_HOST)/bin/trx $(1) \ -o $@ \ - -m $(IMAGE_SIZE) \ + -m $$(($(subst k, * 1024,$(IMAGE_SIZE)))) \ -f $(IMAGE_KERNEL) \ -a 4 -f $(IMAGE_ROOTFS) endef @@ -89,6 +89,26 @@ define Build/relocate-kernel rm -rf $@.relocate endef +define Build/elx-header + $(eval hw_id=$(word 1,$(1))) + $(eval xor_pattern=$(word 2,$(1))) + ( \ + echo -ne "\x00\x00\x00\x00\x00\x00\x00\x03" | \ + dd bs=42 count=1 conv=sync; \ + hw_id="$(hw_id)"; \ + echo -ne "\x$${hw_id:0:2}\x$${hw_id:2:2}\x$${hw_id:4:2}\x$${hw_id:6:2}" | \ + dd bs=20 count=1 conv=sync; \ + echo -ne "$$(printf '%08x' $$(stat -c%s $@) | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \ + dd bs=8 count=1 conv=sync; \ + echo -ne "$$($(STAGING_DIR_HOST)/bin/mkhash md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \ + dd bs=58 count=1 conv=sync; \ + ) > $(KDIR)/tmp/$(DEVICE_NAME).header + $(call Build/xor-image,-p $(xor_pattern) -x) + cat $(KDIR)/tmp/$(DEVICE_NAME).header $@ > $@.new + mv $@.new $@ + rm -rf $(KDIR)/tmp/$(DEVICE_NAME).header +endef + define Build/umedia-header fix-u-media-header -T 0x46 -B $(1) -i $@ -o $@.new && mv $@.new $@ endef @@ -147,10 +167,10 @@ define Build/sercom-footer $(call Build/sercom-seal,-f) endef -ralink_default_fw_size_4M=3866624 -ralink_default_fw_size_8M=8060928 -ralink_default_fw_size_16M=16121856 -ralink_default_fw_size_32M=33226752 +define Build/fonfxcimage + uimage_padhdr -i $@ -o $@.new + mv $@.new $@ +endef ifeq ($(SUBTARGET),rt288x) include rt288x.mk diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index fff10425a..8aea7f05f 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -13,56 +13,42 @@ define Build/elecom-header ) | mkhash md5 > $(KDIR)/v_0.0.0.md5 $(STAGING_DIR_HOST)/bin/tar -c \ $(if $(SOURCE_DATE_EPOCH),--mtime=@$(SOURCE_DATE_EPOCH)) \ - -f $@ -C $(KDIR) v_0.0.0.bin v_0.0.0.md5 + --owner=0 --group=0 -f $@ -C $(KDIR) v_0.0.0.bin v_0.0.0.md5 endef -define Build/elx-header - $(eval hw_id=$(word 1,$(1))) - $(eval xor_pattern=$(word 2,$(1))) - ( \ - echo -ne "\x00\x00\x00\x00\x00\x00\x00\x03" | \ - dd bs=42 count=1 conv=sync; \ - hw_id="$(hw_id)"; \ - echo -ne "\x$${hw_id:0:2}\x$${hw_id:2:2}\x$${hw_id:4:2}\x$${hw_id:6:2}" | \ - dd bs=20 count=1 conv=sync; \ - echo -ne "$$(printf '%08x' $$(stat -c%s $@) | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \ - dd bs=8 count=1 conv=sync; \ - echo -ne "$$($(STAGING_DIR_HOST)/bin/mkhash md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \ - dd bs=58 count=1 conv=sync; \ - ) > $(KDIR)/tmp/$(DEVICE_NAME).header - $(call Build/xor-image,-p $(xor_pattern) -x) - cat $(KDIR)/tmp/$(DEVICE_NAME).header $@ > $@.new - mv $@.new $@ -endef - -define Device/ai-br100 - DTS := AI-BR100 +define Device/aigale_ai-br100 + MTK_SOC := mt7620a IMAGE_SIZE := 7936k - DEVICE_TITLE := Aigale Ai-BR100 + DEVICE_VENDOR := Aigale + DEVICE_MODEL := Ai-BR100 DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += ai-br100 endef -TARGET_DEVICES += ai-br100 +TARGET_DEVICES += aigale_ai-br100 define Device/alfa-network_ac1200rm - DTS := AC1200RM + MTK_SOC := mt7620a IMAGE_SIZE := 16064k - DEVICE_TITLE := ALFA Network AC1200RM + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := AC1200RM DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci uboot-envtools endef TARGET_DEVICES += alfa-network_ac1200rm define Device/alfa-network_r36m-e4g - DTS := R36M-E4G + MTK_SOC := mt7620a IMAGE_SIZE := 16064k - DEVICE_TITLE := ALFA Network R36M-E4G + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := R36M-E4G DEVICE_PACKAGES := kmod-i2c-ralink kmod-usb2 kmod-usb-ohci uboot-envtools uqmi endef TARGET_DEVICES += alfa-network_r36m-e4g define Device/alfa-network_tube-e4g - DTS := TUBE-E4G + MTK_SOC := mt7620a IMAGE_SIZE := 16064k - DEVICE_TITLE := ALFA Network Tube-E4G + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := Tube-E4G DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci uboot-envtools uqmi \ -iwinfo -kmod-rt2800-soc -wpad-basic endef @@ -78,6 +64,8 @@ define Device/amit_jboot endef define Device/Archer + MTK_SOC := mt7620a + DEVICE_VENDOR := TP-Link TPLINK_HWREVADD := 0 TPLINK_HVERSION := 3 KERNEL := $(KERNEL_DTB) @@ -86,122 +74,120 @@ define Device/Archer IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata endef -define Device/ArcherC20i - $(Device/Archer) - DTS := ArcherC20i - SUPPORTED_DEVICES := c20i - TPLINK_FLASHLAYOUT := 8Mmtk - TPLINK_HWID := 0xc2000001 - TPLINK_HWREV := 58 - IMAGES += factory.bin - DEVICE_PACKAGES := kmod-mt76x0e - DEVICE_TITLE := TP-Link ArcherC20i - DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci +define Device/asus_rp-n53 + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Asus + DEVICE_MODEL := RP-N53 + DEVICE_PACKAGES := kmod-rt2800-pci + SUPPORTED_DEVICES += rp-n53 endef -TARGET_DEVICES += ArcherC20i +TARGET_DEVICES += asus_rp-n53 -define Device/ArcherC50v1 - $(Device/Archer) - DTS := ArcherC50 - SUPPORTED_DEVICES := c50 - TPLINK_FLASHLAYOUT := 8Mmtk - TPLINK_HWID := 0xc7500001 - TPLINK_HWREV := 69 - IMAGES += factory-us.bin factory-eu.bin - IMAGE/factory-us.bin := tplink-v2-image -e -w 0 - IMAGE/factory-eu.bin := tplink-v2-image -e -w 2 - DEVICE_TITLE := TP-Link ArcherC50v1 - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci +define Device/asus_rt-ac51u + MTK_SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Asus + DEVICE_MODEL := RT-AC51U + DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += rt-ac51u endef -TARGET_DEVICES += ArcherC50v1 +TARGET_DEVICES += asus_rt-ac51u -define Device/ArcherMR200 - $(Device/Archer) - DTS := ArcherMR200 - SUPPORTED_DEVICES := mr200 - TPLINK_FLASHLAYOUT := 8MLmtk - TPLINK_HWID := 0xd7500001 - TPLINK_HWREV := 0x4a - DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb-enablemodem - DEVICE_TITLE := TP-Link ArcherMR200 +define Device/asus_rt-n12p + MTK_SOC := mt7620n + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Asus + DEVICE_MODEL := RT-N11P/RT-N12+/RT-N12Eb1 + SUPPORTED_DEVICES += rt-n12p endef -TARGET_DEVICES += ArcherMR200 +TARGET_DEVICES += asus_rt-n12p + +define Device/asus_rt-n14u + MTK_SOC := mt7620n + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Asus + DEVICE_MODEL := RT-N14u + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += rt-n14u +endef +TARGET_DEVICES += asus_rt-n14u define Device/bdcom_wap2100-sk - DTS := BDCOM-WAP2100-SK + MTK_SOC := mt7620a IMAGE_SIZE := 15808k - DEVICE_TITLE := BDCOM WAP2100-SK (ZTE ZXECS EBG3130) + DEVICE_VENDOR := BDCOM + DEVICE_MODEL := WAP2100-SK (ZTE ZXECS EBG3130) DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76x2 kmod-mt76x0e kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport endef TARGET_DEVICES += bdcom_wap2100-sk -define Device/bocco - DTS := BOCCO - DEVICE_TITLE := YUKAI Engineering BOCCO - DEVICE_PACKAGES := kmod-sound-core kmod-sound-mt7620 kmod-i2c-ralink +define Device/buffalo_whr-1166d + MTK_SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WHR-1166D + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += whr-1166d endef -TARGET_DEVICES += bocco +TARGET_DEVICES += buffalo_whr-1166d -define Device/c108 - DTS := C108 - IMAGE_SIZE := 16777216 - DEVICE_TITLE := HNET C108 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 +define Device/buffalo_whr-300hp2 + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WHR-300HP2 + SUPPORTED_DEVICES += whr-300hp2 endef -TARGET_DEVICES += c108 +TARGET_DEVICES += buffalo_whr-300hp2 -define Device/cf-wr800n - DTS := CF-WR800N - DEVICE_TITLE := Comfast CF-WR800N +define Device/buffalo_whr-600d + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WHR-600D + DEVICE_PACKAGES := kmod-rt2800-pci + SUPPORTED_DEVICES += whr-600d endef -TARGET_DEVICES += cf-wr800n +TARGET_DEVICES += buffalo_whr-600d -define Device/cs-qr10 - DTS := CS-QR10 - DEVICE_TITLE := Planex CS-QR10 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci \ - kmod-sound-core kmod-sound-mt7620 \ - kmod-i2c-ralink kmod-sdhci-mt7620 +define Device/buffalo_wmr-300 + MTK_SOC := mt7620n + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WMR-300 + SUPPORTED_DEVICES += wmr-300 endef -TARGET_DEVICES += cs-qr10 +TARGET_DEVICES += buffalo_wmr-300 -define Device/d240 - DTS := D240 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Sanlinking Technologies D240 - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 +define Device/comfast_cf-wr800n + MTK_SOC := mt7620n + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Comfast + DEVICE_MODEL := CF-WR800N + SUPPORTED_DEVICES += cf-wr800n endef -TARGET_DEVICES += d240 +TARGET_DEVICES += comfast_cf-wr800n -define Device/db-wrt01 - DTS := DB-WRT01 - DEVICE_TITLE := Planex DB-WRT01 -endef -TARGET_DEVICES += db-wrt01 - -define Device/dch-m225 +define Device/dlink_dch-m225 $(Device/seama) - DTS := DCH-M225 + MTK_SOC := mt7620a BLOCKSIZE := 4k SEAMA_SIGNATURE := wapn22_dlink.2013gui_dap1320b IMAGE_SIZE := 6848k - DEVICE_TITLE := D-Link DCH-M225 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DCH-M225 DEVICE_PACKAGES := kmod-sound-core kmod-sound-mt7620 kmod-i2c-ralink + SUPPORTED_DEVICES += dch-m225 endef -TARGET_DEVICES += dch-m225 - -define Device/dir-810l - DTS := DIR-810L - DEVICE_PACKAGES := kmod-mt76x0e - DEVICE_TITLE := D-Link DIR-810L - IMAGE_SIZE := 6720k -endef -TARGET_DEVICES += dir-810l +TARGET_DEVICES += dlink_dch-m225 define Device/dlink_dir-510l $(Device/amit_jboot) - DTS := DIR-510L - DEVICE_TITLE := D-Link DIR-510L + MTK_SOC := mt7620a + IMAGE_SIZE := 14208k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-510L DEVICE_PACKAGES += kmod-mt76x0e DLINK_ROM_ID := DLK6E3805001 DLINK_FAMILY_MEMBER := 0x6E38 @@ -210,10 +196,23 @@ define Device/dlink_dir-510l endef TARGET_DEVICES += dlink_dir-510l +define Device/dlink_dir-810l + MTK_SOC := mt7620a + DEVICE_PACKAGES := kmod-mt76x0e + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-810L + IMAGE_SIZE := 6720k + SUPPORTED_DEVICES += dir-810l +endef +TARGET_DEVICES += dlink_dir-810l + define Device/dlink_dwr-116-a1 $(Device/amit_jboot) - DTS := DWR-116-A1 - DEVICE_TITLE := D-Link DWR-116 A1/A2 + MTK_SOC := mt7620n + IMAGE_SIZE := 8064k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DWR-116 + DEVICE_VARIANT := A1/A2 DLINK_ROM_ID := DLK6E3803001 DLINK_FAMILY_MEMBER := 0x6E38 DLINK_FIRMWARE_SIZE := 0x7E0000 @@ -222,8 +221,11 @@ TARGET_DEVICES += dlink_dwr-116-a1 define Device/dlink_dwr-118-a1 $(Device/amit_jboot) - DTS := DWR-118-A1 - DEVICE_TITLE := D-Link DWR-118 A1 + MTK_SOC := mt7620a + IMAGE_SIZE := 16256k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DWR-118 + DEVICE_VARIANT := A1 DEVICE_PACKAGES += kmod-mt76x0e DLINK_ROM_ID := DLK6E3811001 DLINK_FAMILY_MEMBER := 0x6E38 @@ -233,8 +235,11 @@ TARGET_DEVICES += dlink_dwr-118-a1 define Device/dlink_dwr-118-a2 $(Device/amit_jboot) - DTS := DWR-118-A2 - DEVICE_TITLE := D-Link DWR-118 A2 + MTK_SOC := mt7620a + IMAGE_SIZE := 16256k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DWR-118 + DEVICE_VARIANT := A2 DEVICE_PACKAGES += kmod-mt76x2 DLINK_ROM_ID := DLK6E3814001 DLINK_FAMILY_MEMBER := 0x6E38 @@ -244,9 +249,11 @@ TARGET_DEVICES += dlink_dwr-118-a2 define Device/dlink_dwr-921-c1 $(Device/amit_jboot) - DTS := DWR-921-C1 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := D-Link DWR-921 C1 + MTK_SOC := mt7620n + IMAGE_SIZE := 16256k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DWR-921 + DEVICE_VARIANT := C1 DLINK_ROM_ID := DLK6E2414001 DLINK_FAMILY_MEMBER := 0x6E24 DLINK_FIRMWARE_SIZE := 0xFE0000 @@ -256,7 +263,10 @@ TARGET_DEVICES += dlink_dwr-921-c1 define Device/dlink_dwr-921-c3 $(Device/dlink_dwr-921-c1) - DEVICE_TITLE := D-Link DWR-921 C3 + DEVICE_DTS := mt7620n_dlink_dwr-921-c1 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DWR-921 + DEVICE_VARIANT := C3 DLINK_ROM_ID := DLK6E2414009 SUPPORTED_DEVICES := dlink,dwr-921-c1 endef @@ -264,9 +274,11 @@ TARGET_DEVICES += dlink_dwr-921-c3 define Device/dlink_dwr-922-e2 $(Device/amit_jboot) - DTS := DWR-922-E2 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := D-Link DWR-922 E2 + MTK_SOC := mt7620n + IMAGE_SIZE := 16256k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DWR-922 + DEVICE_VARIANT := E2 DLINK_ROM_ID := DLK6E2414005 DLINK_FAMILY_MEMBER := 0x6E24 DLINK_FIRMWARE_SIZE := 0xFE0000 @@ -274,110 +286,192 @@ define Device/dlink_dwr-922-e2 endef TARGET_DEVICES += dlink_dwr-922-e2 -define Device/e1700 - DTS := E1700 - IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ - umedia-header 0x013326 - DEVICE_TITLE := Linksys E1700 +define Device/dovado_tiny-ac + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Dovado + DEVICE_MODEL := Tiny AC + DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += tiny-ac endef -TARGET_DEVICES += e1700 +TARGET_DEVICES += dovado_tiny-ac -define Device/ex2700 - NETGEAR_HW_ID := 29764623+4+0+32+2x2+0 - NETGEAR_BOARD_ID := EX2700 - DTS := EX2700 - BLOCKSIZE := 4k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - IMAGES += factory.bin - KERNEL := $(KERNEL_DTB) | uImage lzma | pad-offset 64k 64 | append-uImage-fakehdr filesystem - IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ - netgear-dni - DEVICE_TITLE := Netgear EX2700 +define Device/edimax_br-6478ac-v2 + MTK_SOC := mt7620a + DEVICE_VENDOR := Edimax + DEVICE_MODEL := BR-6478AC + DEVICE_VARIANT := V2 + BLOCKSIZE := 64k + IMAGE_SIZE := 7744k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + edimax-header -s CSYS -m RN68 -f 0x70000 -S 0x01100000 | pad-rootfs | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport endef -#TARGET_DEVICES += ex2700 +TARGET_DEVICES += edimax_br-6478ac-v2 -define Device/ex3700-ex3800 - NETGEAR_BOARD_ID := U12H319T00_NETGEAR - DTS := EX3700 +define Device/edimax_ew-7476rpc + MTK_SOC := mt7620a + DEVICE_VENDOR := Edimax + DEVICE_MODEL := EW-7476RPC BLOCKSIZE := 4k IMAGE_SIZE := 7744k - IMAGES += factory.chk - IMAGE/factory.chk := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | netgear-chk - DEVICE_PACKAGES := kmod-mt76x2 - DEVICE_TITLE := Netgear EX3700/EX3800 - SUPPORTED_DEVICES := ex3700 + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + edimax-header -s CSYS -m RN79 -f 0x70000 -S 0x01100000 | pad-rootfs | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + DEVICE_PACKAGES := kmod-mt76x2 kmod-phy-realtek endef -TARGET_DEVICES += ex3700-ex3800 +TARGET_DEVICES += edimax_ew-7476rpc -define Device/gl-mt300a - DTS := GL-MT300A - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := GL-Inet GL-MT300A +define Device/edimax_ew-7478ac + MTK_SOC := mt7620a + DEVICE_VENDOR := Edimax + DEVICE_MODEL := EW-7478AC + BLOCKSIZE := 4k + IMAGE_SIZE := 7744k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + edimax-header -s CSYS -m RN70 -f 0x70000 -S 0x01100000 | pad-rootfs | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + DEVICE_PACKAGES := kmod-mt76x2 kmod-phy-realtek +endef +TARGET_DEVICES += edimax_ew-7478ac + +define Device/edimax_ew-7478apc + MTK_SOC := mt7620a + DEVICE_VENDOR := Edimax + DEVICE_MODEL := EW-7478APC + BLOCKSIZE := 4k + IMAGE_SIZE := 7744k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + edimax-header -s CSYS -m RN75 -f 0x70000 -S 0x01100000 | pad-rootfs | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += edimax_ew-7478apc + +define Device/elecom_wrh-300cr + MTK_SOC := mt7620n + IMAGE_SIZE := 14272k + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + elecom-header + DEVICE_VENDOR := Elecom + DEVICE_MODEL := WRH-300CR DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += wrh-300cr endef -TARGET_DEVICES += gl-mt300a +TARGET_DEVICES += elecom_wrh-300cr -define Device/u25awf-h1 - DTS := U25AWF-H1 - IMAGE_SIZE := 16064k - DEVICE_TITLE := Kimax U25AWF-H1 +define Device/engenius_esr600 + MTK_SOC := mt7620a + BLOCKSIZE := 64k + IMAGE_SIZE := 15616k + IMAGES += factory.dlf + IMAGE/factory.dlf := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + senao-header -r 0x101 -p 0x57 -t 2 + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := ESR600 + DEVICE_PACKAGES += kmod-rt2800-pci kmod-usb-storage kmod-usb-ohci kmod-usb-ehci +endef +TARGET_DEVICES += engenius_esr600 + +define Device/fon_fon2601 + MTK_SOC := mt7620a + IMAGE_SIZE := 15936k + DEVICE_VENDOR := Fon + DEVICE_MODEL := FON2601 + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci + KERNEL_INITRAMFS := $$(KERNEL) | fonfxcimage + IMAGE/sysupgrade.bin := append-kernel | append-rootfs |\ + fonfxcimage |\ + pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += fon_fon2601 + +define Device/glinet_gl-mt300a + MTK_SOC := mt7620a + IMAGE_SIZE := 15872k + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-MT300A DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += gl-mt300a endef -TARGET_DEVICES += u25awf-h1 +TARGET_DEVICES += glinet_gl-mt300a -define Device/gl-mt300n - DTS := GL-MT300N - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := GL-Inet GL-MT300N +define Device/glinet_gl-mt300n + MTK_SOC := mt7620a + IMAGE_SIZE := 15872k + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-MT300N DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += gl-mt300n endef -TARGET_DEVICES += gl-mt300n +TARGET_DEVICES += glinet_gl-mt300n -define Device/gl-mt750 - DTS := GL-MT750 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := GL-Inet GL-MT750 +define Device/glinet_gl-mt750 + MTK_SOC := mt7620a + IMAGE_SIZE := 15872k + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-MT750 DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += gl-mt750 endef -TARGET_DEVICES += gl-mt750 - -define Device/hc5661 - DTS := HC5661 - IMAGE_SIZE := 15872k - DEVICE_TITLE := HiWiFi HC5661 - DEVICE_PACKAGES := kmod-sdhci-mt7620 -endef -TARGET_DEVICES += hc5661 - -define Device/hc5761 - DTS := HC5761 - IMAGE_SIZE := 15872k - DEVICE_TITLE := HiWiFi HC5761 - DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += hc5761 - -define Device/hc5861 - DTS := HC5861 - IMAGE_SIZE := 15872k - DEVICE_TITLE := HiWiFi HC5861 - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += hc5861 +TARGET_DEVICES += glinet_gl-mt750 define Device/head-weblink_hdrm200 - DTS := HDRM200 + MTK_SOC := mt7620a IMAGE_SIZE := 16064k - DEVICE_TITLE := Head Weblink HDRM2000 + DEVICE_VENDOR := Head Weblink + DEVICE_MODEL := HDRM2000 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 \ uqmi kmod-usb-serial kmod-usb-serial-option endef TARGET_DEVICES += head-weblink_hdrm200 +define Device/hiwifi_hc5661 + MTK_SOC := mt7620a + IMAGE_SIZE := 15872k + DEVICE_VENDOR := HiWiFi + DEVICE_MODEL := HC5661 + DEVICE_PACKAGES := kmod-sdhci-mt7620 + SUPPORTED_DEVICES += hc5661 +endef +TARGET_DEVICES += hiwifi_hc5661 + +define Device/hiwifi_hc5761 + MTK_SOC := mt7620a + IMAGE_SIZE := 15872k + DEVICE_VENDOR := HiWiFi + DEVICE_MODEL := HC5761 + DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += hc5761 +endef +TARGET_DEVICES += hiwifi_hc5761 + +define Device/hiwifi_hc5861 + MTK_SOC := mt7620a + IMAGE_SIZE := 15872k + DEVICE_VENDOR := HiWiFi + DEVICE_MODEL := HC5861 + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += hc5861 +endef +TARGET_DEVICES += hiwifi_hc5861 + +define Device/hnet_c108 + MTK_SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := HNET + DEVICE_MODEL := C108 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 + SUPPORTED_DEVICES += c108 +endef +TARGET_DEVICES += hnet_c108 + define Device/iodata_wn-ac1167gr - DTS := WN-AC1167GR - DEVICE_TITLE := I-O DATA WN-AC1167GR + MTK_SOC := mt7620a + DEVICE_VENDOR := I-O DATA + DEVICE_MODEL := WN-AC1167GR IMAGE_SIZE := 6864k IMAGES += factory.bin IMAGE/factory.bin := \ @@ -388,8 +482,9 @@ endef TARGET_DEVICES += iodata_wn-ac1167gr define Device/iodata_wn-ac733gr3 - DTS := WN-AC733GR3 - DEVICE_TITLE := I-O DATA WN-AC733GR3 + MTK_SOC := mt7620a + DEVICE_VENDOR := I-O DATA + DEVICE_MODEL := WN-AC733GR3 IMAGE_SIZE := 6992k IMAGES += factory.bin IMAGE/factory.bin := \ @@ -399,60 +494,54 @@ define Device/iodata_wn-ac733gr3 endef TARGET_DEVICES += iodata_wn-ac733gr3 -define Device/kimax_u35wf - DTS := U35WF +define Device/kimax_u25awf-h1 + MTK_SOC := mt7620a IMAGE_SIZE := 16064k - DEVICE_TITLE := Kimax U35WF - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + DEVICE_VENDOR := Kimax + DEVICE_MODEL := U25AWF + DEVICE_VARIANT := H1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-storage kmod-scsi-core \ + kmod-fs-ext4 kmod-fs-vfat block-mount + SUPPORTED_DEVICES += u25awf-h1 +endef +TARGET_DEVICES += kimax_u25awf-h1 + +define Device/kimax_u35wf + MTK_SOC := mt7620n + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Kimax + DEVICE_MODEL := U35WF + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-storage kmod-scsi-core \ + kmod-fs-ext4 kmod-fs-vfat block-mount endef TARGET_DEVICES += kimax_u35wf -define Device/kng_rc - DTS := kng_rc - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := ZyXEL Keenetic Viva - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport kmod-switch-rtl8366-smi kmod-switch-rtl8367b - IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ - zyimage -d 8997 -v "ZyXEL Keenetic Viva" - SUPPORTED_DEVICES := kng_rc +define Device/kingston_mlw221 + MTK_SOC := mt7620n + IMAGE_SIZE := 15744k + DEVICE_VENDOR := Kingston + DEVICE_MODEL := MLW221 + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += mlw221 endef -TARGET_DEVICES += kng_rc +TARGET_DEVICES += kingston_mlw221 -define Device/kn_rc - DTS := kn_rc - DEVICE_TITLE := ZyXEL Keenetic Omni - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport - IMAGES += factory.bin - IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ - zyimage -d 4882 -v "ZyXEL Keenetic Omni" - SUPPORTED_DEVICES := kn_rc +define Device/kingston_mlwg2 + MTK_SOC := mt7620n + IMAGE_SIZE := 15744k + DEVICE_VENDOR := Kingston + DEVICE_MODEL := MLWG2 + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += mlwg2 endef -TARGET_DEVICES += kn_rc - -define Device/kn_rf - DTS := kn_rf - DEVICE_TITLE := ZyXEL Keenetic Omni II - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport - IMAGES += factory.bin - IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ - zyimage -d 2102034 -v "ZyXEL Keenetic Omni II" - SUPPORTED_DEVICES := kn_rf -endef -TARGET_DEVICES += kn_rf - -define Device/microwrt - DTS := MicroWRT - IMAGE_SIZE := 16128k - DEVICE_TITLE := Microduino MicroWRT - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += microwrt +TARGET_DEVICES += kingston_mlwg2 define Device/lava_lr-25g001 $(Device/amit_jboot) - DTS := LR-25G001 - DEVICE_TITLE := LAVA LR-25G001 + MTK_SOC := mt7620a + IMAGE_SIZE := 16256k + DEVICE_VENDOR := LAVA + DEVICE_MODEL := LR-25G001 DLINK_ROM_ID := LVA6E3804001 DLINK_FAMILY_MEMBER := 0x6E38 DLINK_FIRMWARE_SIZE := 0xFE0000 @@ -460,393 +549,570 @@ define Device/lava_lr-25g001 endef TARGET_DEVICES += lava_lr-25g001 -define Device/miwifi-mini - DTS := MIWIFI-MINI - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Xiaomi MiWiFi Mini +define Device/lenovo_newifi-y1 + MTK_SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Lenovo + DEVICE_MODEL := Y1 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += y1 endef -TARGET_DEVICES += miwifi-mini +TARGET_DEVICES += lenovo_newifi-y1 -define Device/mlw221 - DTS := MLW221 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Kingston MLW221 +define Device/lenovo_newifi-y1s + MTK_SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Lenovo + DEVICE_MODEL := Y1S DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += y1s endef -TARGET_DEVICES += mlw221 +TARGET_DEVICES += lenovo_newifi-y1s -define Device/mlwg2 - DTS := MLWG2 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Kingston MLWG2 - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += mlwg2 - -define Device/mt7620a - DTS := MT7620a - DEVICE_TITLE := MediaTek MT7620a EVB -endef -TARGET_DEVICES += mt7620a - -define Device/mt7620a_mt7530 - DTS := MT7620a_MT7530 - DEVICE_TITLE := MediaTek MT7620a + MT7530 EVB - SUPPORTED_DEVICES := mt7620a_mt7530 -endef -TARGET_DEVICES += mt7620a_mt7530 - -define Device/mt7620a_mt7610e - DTS := MT7620a_MT7610e - DEVICE_TITLE := MediaTek MT7620a + MT7610e EVB - DEVICE_PACKAGES := kmod-mt76x0e - SUPPORTED_DEVICES := mt7620a_mt7610e -endef -TARGET_DEVICES += mt7620a_mt7610e - -define Device/mt7620a_v22sg - DTS := MT7620a_V22SG - DEVICE_TITLE := MediaTek MT7620a V22SG - SUPPORTED_DEVICES := mt7620a_v22sg -endef -TARGET_DEVICES += mt7620a_v22sg - -define Device/mzk-750dhp - DTS := MZK-750DHP - DEVICE_TITLE := Planex MZK-750DHP - DEVICE_PACKAGES := kmod-mt76x0e -endef -TARGET_DEVICES += mzk-750dhp - -define Device/mzk-ex300np - DTS := MZK-EX300NP - DEVICE_TITLE := Planex MZK-EX300NP -endef -TARGET_DEVICES += mzk-ex300np - -define Device/mzk-ex750np - DTS := MZK-EX750NP - DEVICE_TITLE := Planex MZK-EX750NP - DEVICE_PACKAGES := kmod-mt76x2 -endef -TARGET_DEVICES += mzk-ex750np - -define Device/na930 - DTS := NA930 - IMAGE_SIZE := 20m - DEVICE_TITLE := Sercomm NA930 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += na930 - -define Device/oy-0001 - DTS := OY-0001 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Oh Yeah OY-0001 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += oy-0001 - -define Device/psg1208 - DTS := PSG1208 - DEVICE_TITLE := Phicomm PSG1208 - DEVICE_PACKAGES := kmod-mt76x2 -endef -TARGET_DEVICES += psg1208 - -define Device/psg1218a - DTS := PSG1218A - DEVICE_TITLE := Phicomm PSG1218 rev.Ax - DEVICE_PACKAGES := kmod-mt76x2 - SUPPORTED_DEVICES += psg1218 -endef -TARGET_DEVICES += psg1218a - -define Device/psg1218b - DTS := PSG1218B - DEVICE_TITLE := Phicomm PSG1218 rev.Bx - DEVICE_PACKAGES := kmod-mt76x2 - SUPPORTED_DEVICES += psg1218 -endef -TARGET_DEVICES += psg1218b - -define Device/phicomm_k2g - DTS := K2G - IMAGE_SIZE := 7552k - DEVICE_TITLE := Phicomm K2G - DEVICE_PACKAGES := kmod-mt76x2 -endef -TARGET_DEVICES += phicomm_k2g - -define Device/rp-n53 - DTS := RP-N53 - DEVICE_TITLE := Asus RP-N53 - DEVICE_PACKAGES := kmod-rt2800-pci -endef -TARGET_DEVICES += rp-n53 - -define Device/rt-n12p - DTS := RT-N12-PLUS - DEVICE_TITLE := Asus RT-N11P/RT-N12+/RT-N12Eb1 -endef -TARGET_DEVICES += rt-n12p - -define Device/rt-n14u - DTS := RT-N14U - DEVICE_TITLE := Asus RT-N14u - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += rt-n14u - -define Device/rt-ac51u - DTS := RT-AC51U - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Asus RT-AC51U - DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += rt-ac51u - -define Device/tiny-ac - DTS := TINY-AC - DEVICE_TITLE := Dovado Tiny AC - DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += tiny-ac - -define Device/edimax_br-6478ac-v2 - DTS := BR-6478AC-V2 - DEVICE_TITLE := Edimax BR-6478AC V2 - BLOCKSIZE := 64k - IMAGE_SIZE := 7616k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ - edimax-header -s CSYS -m RN68 -f 0x70000 -S 0x01100000 | pad-rootfs | \ - append-metadata | check-size $$$$(IMAGE_SIZE) - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += edimax_br-6478ac-v2 - -define Device/tplink_c2-v1 - $(Device/Archer) - DTS := ArcherC2-v1 - TPLINK_FLASHLAYOUT := 8Mmtk - TPLINK_HWID := 0xc7500001 - TPLINK_HWREV := 50 +define Device/linksys_e1700 + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k IMAGES += factory.bin - DEVICE_TITLE := TP-Link Archer C2 v1 - DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport kmod-switch-rtl8366-smi kmod-switch-rtl8367b + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + umedia-header 0x013326 + DEVICE_VENDOR := Linksys + DEVICE_MODEL := E1700 + SUPPORTED_DEVICES += e1700 endef -TARGET_DEVICES += tplink_c2-v1 +TARGET_DEVICES += linksys_e1700 -define Device/tplink_c20-v1 - $(Device/Archer) - DTS := ArcherC20v1 - TPLINK_FLASHLAYOUT := 8Mmtk - TPLINK_HWID := 0xc2000001 - TPLINK_HWREV := 0x44 - TPLINK_HWREVADD := 0x1 - IMAGES += factory.bin - DEVICE_TITLE := TP-Link ArcherC20 v1 - DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport +define Device/microduino_microwrt + MTK_SOC := mt7620a + IMAGE_SIZE := 16128k + DEVICE_VENDOR := Microduino + DEVICE_MODEL := MicroWRT + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += microwrt endef -TARGET_DEVICES += tplink_c20-v1 +TARGET_DEVICES += microduino_microwrt -define Device/vonets_var11n-300 - DTS := VAR11N-300 - IMAGE_SIZE := $(ralink_default_fw_size_4M) +define Device/netgear_ex2700 + MTK_SOC := mt7620a + NETGEAR_HW_ID := 29764623+4+0+32+2x2+0 + NETGEAR_BOARD_ID := EX2700 BLOCKSIZE := 4k - DEVICE_TITLE := Vonets VAR11N-300 + IMAGE_SIZE := 3776k + IMAGES += factory.bin + KERNEL := $(KERNEL_DTB) | uImage lzma | pad-offset 64k 64 | append-uImage-fakehdr filesystem + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + netgear-dni + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := EX2700 + SUPPORTED_DEVICES += ex2700 endef -TARGET_DEVICES += vonets_var11n-300 +TARGET_DEVICES += netgear_ex2700 -define Device/ravpower_wd03 - DTS := WD03 - IMAGE_SIZE := $(ralink_default_fw_size_8M) - DEVICE_TITLE := Ravpower WD03 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += ravpower_wd03 - -define Device/whr-1166d - DTS := WHR-1166D - IMAGE_SIZE := 15040k - DEVICE_TITLE := Buffalo WHR-1166D +define Device/netgear_ex3700 + MTK_SOC := mt7620a + NETGEAR_BOARD_ID := U12H319T00_NETGEAR + BLOCKSIZE := 4k + IMAGE_SIZE := 7744k + IMAGES += factory.chk + IMAGE/factory.chk := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | netgear-chk DEVICE_PACKAGES := kmod-mt76x2 + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := EX3700/EX3800 + SUPPORTED_DEVICES += ex3700 endef -TARGET_DEVICES += whr-1166d +TARGET_DEVICES += netgear_ex3700 -define Device/whr-300hp2 - DTS := WHR-300HP2 - IMAGE_SIZE := 6848k - DEVICE_TITLE := Buffalo WHR-300HP2 +define Device/netgear_ex6130 + MTK_SOC := mt7620a + NETGEAR_BOARD_ID := U12H319T50_NETGEAR + BLOCKSIZE := 4k + IMAGE_SIZE := 7744k + IMAGES += factory.chk + IMAGE/factory.chk := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | netgear-chk + DEVICE_PACKAGES := kmod-mt76x2 + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := EX6130 endef -TARGET_DEVICES += whr-300hp2 +TARGET_DEVICES += netgear_ex6130 -define Device/whr-600d - DTS := WHR-600D - IMAGE_SIZE := 6848k - DEVICE_TITLE := Buffalo WHR-600D - DEVICE_PACKAGES := kmod-rt2800-pci -endef -TARGET_DEVICES += whr-600d - -define Device/wmr-300 - DTS := WMR-300 - DEVICE_TITLE := Buffalo WMR-300 -endef -TARGET_DEVICES += wmr-300 - -define Device/wn3000rpv3 +define Device/netgear_wn3000rp-v3 + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k NETGEAR_HW_ID := 29764836+8+0+32+2x2+0 NETGEAR_BOARD_ID := WN3000RPv3 - DTS := WN3000RPV3 BLOCKSIZE := 4k IMAGES += factory.bin KERNEL := $(KERNEL_DTB) | uImage lzma | pad-offset 64k 64 | append-uImage-fakehdr filesystem IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ netgear-dni - DEVICE_TITLE := Netgear WN3000RPv3 + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := WN3000RP + DEVICE_VARIANT := v3 + SUPPORTED_DEVICES += wn3000rpv3 endef -TARGET_DEVICES += wn3000rpv3 +TARGET_DEVICES += netgear_wn3000rp-v3 -define Device/wrh-300cr - DTS := WRH-300CR - IMAGE_SIZE := $(ralink_default_fw_size_16M) - IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ - elecom-header - DEVICE_TITLE := Elecom WRH-300CR - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += wrh-300cr - -define Device/wrtnode - DTS := WRTNODE - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := WRTNode - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += wrtnode - -define Device/wt3020-4M - DTS := WT3020-4M +define Device/nexx_wt3020-4m + MTK_SOC := mt7620n BLOCKSIZE := 4k - IMAGE_SIZE := $(ralink_default_fw_size_4M) + IMAGE_SIZE := 3776k IMAGES += factory.bin - SUPPORTED_DEVICES += wt3020 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ poray-header -B WT3020 -F 4M - DEVICE_TITLE := Nexx WT3020 (4MB) + DEVICE_VENDOR := Nexx + DEVICE_MODEL := WT3020 + DEVICE_VARIANT := 4M + SUPPORTED_DEVICES += wt3020 wt3020-4M endef -#TARGET_DEVICES += wt3020-4M +TARGET_DEVICES += nexx_wt3020-4m -define Device/wt3020-8M - DTS := WT3020-8M +define Device/nexx_wt3020-8m + MTK_SOC := mt7620n + IMAGE_SIZE := 7872k IMAGES += factory.bin - SUPPORTED_DEVICES += wt3020 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ poray-header -B WT3020 -F 8M - DEVICE_TITLE := Nexx WT3020 (8MB) + DEVICE_VENDOR := Nexx + DEVICE_MODEL := WT3020 + DEVICE_VARIANT := 8M DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += wt3020 wt3020-8M endef -TARGET_DEVICES += wt3020-8M +TARGET_DEVICES += nexx_wt3020-8m -define Device/y1 - DTS := Y1 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Lenovo Y1 - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci +define Device/ohyeah_oy-0001 + MTK_SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Oh Yeah + DEVICE_MODEL := OY-0001 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += oy-0001 endef -TARGET_DEVICES += y1 +TARGET_DEVICES += ohyeah_oy-0001 -define Device/y1s - DTS := Y1S - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Lenovo Y1S - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += y1s - -define Device/youku-yk1 - DTS := YOUKU-YK1 - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := YOUKU YK1 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += youku-yk1 - -define Device/we1026-5g-16m - DTS := WE1026-5G-16M - IMAGE_SIZE := 16777216 - SUPPORTED_DEVICES += we1026-5g-16m - DEVICE_TITLE := Zbtlink ZBT-WE1026-5G (16M) - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 -endef -TARGET_DEVICES += we1026-5g-16m - -define Device/zbt-ape522ii - DTS := ZBT-APE522II - DEVICE_TITLE := Zbtlink ZBT-APE522II +define Device/phicomm_k2g + MTK_SOC := mt7620a + IMAGE_SIZE := 7552k + DEVICE_VENDOR := Phicomm + DEVICE_MODEL := K2G DEVICE_PACKAGES := kmod-mt76x2 endef -TARGET_DEVICES += zbt-ape522ii +TARGET_DEVICES += phicomm_k2g -define Device/zbt-cpe102 - DTS := ZBT-CPE102 - DEVICE_TITLE := Zbtlink ZBT-CPE102 +define Device/phicomm_psg1208 + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Phicomm + DEVICE_MODEL := PSG1208 + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += psg1208 +endef +TARGET_DEVICES += phicomm_psg1208 + +define Device/phicomm_psg1218a + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Phicomm + DEVICE_MODEL := PSG1218 + DEVICE_VARIANT:= Ax + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += psg1218 psg1218a +endef +TARGET_DEVICES += phicomm_psg1218a + +define Device/phicomm_psg1218b + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Phicomm + DEVICE_MODEL := PSG1218 + DEVICE_VARIANT := Bx + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += psg1218 psg1218b +endef +TARGET_DEVICES += phicomm_psg1218b + +define Device/planex_cs-qr10 + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Planex + DEVICE_MODEL := CS-QR10 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci \ + kmod-sound-core kmod-sound-mt7620 \ + kmod-i2c-ralink kmod-sdhci-mt7620 + SUPPORTED_DEVICES += cs-qr10 +endef +TARGET_DEVICES += planex_cs-qr10 + +define Device/planex_db-wrt01 + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Planex + DEVICE_MODEL := DB-WRT01 + SUPPORTED_DEVICES += db-wrt01 +endef +TARGET_DEVICES += planex_db-wrt01 + +define Device/planex_mzk-750dhp + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Planex + DEVICE_MODEL := MZK-750DHP + DEVICE_PACKAGES := kmod-mt76x0e + SUPPORTED_DEVICES += mzk-750dhp +endef +TARGET_DEVICES += planex_mzk-750dhp + +define Device/planex_mzk-ex300np + MTK_SOC := mt7620a + IMAGE_SIZE := 7360k + DEVICE_VENDOR := Planex + DEVICE_MODEL := MZK-EX300NP + SUPPORTED_DEVICES += mzk-ex300np +endef +TARGET_DEVICES += planex_mzk-ex300np + +define Device/planex_mzk-ex750np + MTK_SOC := mt7620a + IMAGE_SIZE := 7360k + DEVICE_VENDOR := Planex + DEVICE_MODEL := MZK-EX750NP + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += mzk-ex750np +endef +TARGET_DEVICES += planex_mzk-ex750np + +define Device/ralink_mt7620a-evb + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := MediaTek + DEVICE_MODEL := MT7620a EVB +endef +TARGET_DEVICES += ralink_mt7620a-evb + +define Device/ralink_mt7620a-mt7530-evb + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := MediaTek + DEVICE_MODEL := MT7620a + MT7530 EVB + SUPPORTED_DEVICES += mt7620a_mt7530 +endef +TARGET_DEVICES += ralink_mt7620a-mt7530-evb + +define Device/ralink_mt7620a-mt7610e-evb + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := MediaTek + DEVICE_MODEL := MT7620a + MT7610e EVB + DEVICE_PACKAGES := kmod-mt76x0e + SUPPORTED_DEVICES += mt7620a_mt7610e +endef +TARGET_DEVICES += ralink_mt7620a-mt7610e-evb + +define Device/ralink_mt7620a-v22sg-evb + MTK_SOC := mt7620a + IMAGE_SIZE := 130560k + DEVICE_VENDOR := MediaTek + DEVICE_MODEL := MT7620a V22SG + SUPPORTED_DEVICES += mt7620a_v22sg +endef +TARGET_DEVICES += ralink_mt7620a-v22sg-evb + +define Device/ravpower_wd03 + MTK_SOC := mt7620n + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Ravpower + DEVICE_MODEL := WD03 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci endef -TARGET_DEVICES += zbt-cpe102 +TARGET_DEVICES += ravpower_wd03 -define Device/zbt-wa05 - DTS := ZBT-WA05 - DEVICE_TITLE := Zbtlink ZBT-WA05 +define Device/sanlinking_d240 + MTK_SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Sanlinking Technologies + DEVICE_MODEL := D240 + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 + SUPPORTED_DEVICES += d240 +endef +TARGET_DEVICES += sanlinking_d240 + +define Device/sercomm_na930 + MTK_SOC := mt7620a + IMAGE_SIZE := 20480k + DEVICE_VENDOR := Sercomm + DEVICE_MODEL := NA930 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += na930 endef -TARGET_DEVICES += zbt-wa05 +TARGET_DEVICES += sercomm_na930 -define Device/zbt-we2026 - DTS := ZBT-WE2026 - DEVICE_TITLE := Zbtlink ZBT-WE2026 +define Device/tplink_archer-c20i + $(Device/Archer) + IMAGE_SIZE := 7808k + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0xc2000001 + TPLINK_HWREV := 58 + IMAGES += factory.bin + DEVICE_PACKAGES := kmod-mt76x0e + DEVICE_MODEL := Archer C20i + DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += c20i endef -TARGET_DEVICES += zbt-we2026 +TARGET_DEVICES += tplink_archer-c20i -define Device/zbt-we826-16M - DTS := ZBT-WE826-16M - IMAGE_SIZE := $(ralink_default_fw_size_16M) - SUPPORTED_DEVICES += zbt-we826 - DEVICE_TITLE := Zbtlink ZBT-WE826 (16M) +define Device/tplink_archer-c20-v1 + $(Device/Archer) + IMAGE_SIZE := 7808k + SUPPORTED_DEVICES += tplink,c20-v1 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0xc2000001 + TPLINK_HWREV := 0x44 + TPLINK_HWREVADD := 0x1 + IMAGES += factory.bin + DEVICE_MODEL := Archer C20 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += tplink_archer-c20-v1 + +define Device/tplink_archer-c2-v1 + $(Device/Archer) + IMAGE_SIZE := 7808k + SUPPORTED_DEVICES += tplink,c2-v1 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0xc7500001 + TPLINK_HWREV := 50 + IMAGES += factory.bin + DEVICE_MODEL := Archer C2 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport kmod-switch-rtl8366-smi kmod-switch-rtl8367b +endef +TARGET_DEVICES += tplink_archer-c2-v1 + +define Device/tplink_archer-c50-v1 + $(Device/Archer) + IMAGE_SIZE := 7808k + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0xc7500001 + TPLINK_HWREV := 69 + IMAGES += factory-us.bin factory-eu.bin + IMAGE/factory-us.bin := tplink-v2-image -e -w 0 + IMAGE/factory-eu.bin := tplink-v2-image -e -w 2 + DEVICE_MODEL := Archer C50 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += c50 +endef +TARGET_DEVICES += tplink_archer-c50-v1 + +define Device/tplink_archer-mr200 + $(Device/Archer) + IMAGE_SIZE := 7872k + TPLINK_FLASHLAYOUT := 8MLmtk + TPLINK_HWID := 0xd7500001 + TPLINK_HWREV := 0x4a + DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb-enablemodem + DEVICE_MODEL := Archer MR200 + SUPPORTED_DEVICES += mr200 +endef +TARGET_DEVICES += tplink_archer-mr200 + +define Device/vonets_var11n-300 + MTK_SOC := mt7620n + IMAGE_SIZE := 3776k + BLOCKSIZE := 4k + DEVICE_VENDOR := Vonets + DEVICE_MODEL := VAR11N-300 +endef +TARGET_DEVICES += vonets_var11n-300 + +define Device/wrtnode_wrtnode + MTK_SOC := mt7620n + IMAGE_SIZE := 16064k + DEVICE_VENDOR := WRTNode + DEVICE_MODEL := WRTNode + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += wrtnode +endef +TARGET_DEVICES += wrtnode_wrtnode + +define Device/xiaomi_miwifi-mini + MTK_SOC := mt7620a + IMAGE_SIZE := 15872k + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := MiWiFi Mini + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += miwifi-mini +endef +TARGET_DEVICES += xiaomi_miwifi-mini + +define Device/youku_yk1 + MTK_SOC := mt7620a + IMAGE_SIZE := 32448k + DEVICE_VENDOR := YOUKU + DEVICE_MODEL := YK1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += youku-yk1 +endef +TARGET_DEVICES += youku_yk1 + +define Device/yukai_bocco + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := YUKAI Engineering + DEVICE_MODEL := BOCCO + DEVICE_PACKAGES := kmod-sound-core kmod-sound-mt7620 kmod-i2c-ralink + SUPPORTED_DEVICES += bocco +endef +TARGET_DEVICES += yukai_bocco + +define Device/zbtlink_zbt-ape522ii + MTK_SOC := mt7620a + IMAGE_SIZE := 15872k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-APE522II + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += zbt-ape522ii +endef +TARGET_DEVICES += zbtlink_zbt-ape522ii + +define Device/zbtlink_zbt-cpe102 + MTK_SOC := mt7620n + IMAGE_SIZE := 7552k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-CPE102 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += zbt-cpe102 +endef +TARGET_DEVICES += zbtlink_zbt-cpe102 + +define Device/zbtlink_zbt-wa05 + MTK_SOC := mt7620n + IMAGE_SIZE := 7552k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WA05 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += zbt-wa05 +endef +TARGET_DEVICES += zbtlink_zbt-wa05 + +define Device/zbtlink_zbt-we1026-5g-16m + MTK_SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WE1026-5G + DEVICE_VARIANT := 16M DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 + SUPPORTED_DEVICES += we1026-5g-16m zbtlink,we1026-5g-16m endef -TARGET_DEVICES += zbt-we826-16M +TARGET_DEVICES += zbtlink_zbt-we1026-5g-16m -define Device/zbt-we826-32M - DTS := ZBT-WE826-32M - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := Zbtlink ZBT-WE826 (32M) - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 +define Device/zbtlink_zbt-we1026-h-32m + MTK_SOC := mt7620a + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WE1026-H + DEVICE_VARIANT := 32M + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 \ + kmod-ledtrig-netdev endef -TARGET_DEVICES += zbt-we826-32M +TARGET_DEVICES += zbtlink_zbt-we1026-h-32m + +define Device/zbtlink_zbt-we2026 + MTK_SOC := mt7620n + IMAGE_SIZE := 7552k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WE2026 + SUPPORTED_DEVICES += zbt-we2026 +endef +TARGET_DEVICES += zbtlink_zbt-we2026 + +define Device/zbtlink_zbt-we826-16m + MTK_SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WE826 + DEVICE_VARIANT := 16M + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 + SUPPORTED_DEVICES += zbt-we826 zbt-we826-16M +endef +TARGET_DEVICES += zbtlink_zbt-we826-16m + +define Device/zbtlink_zbt-we826-32m + MTK_SOC := mt7620a + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WE826 + DEVICE_VARIANT := 32M + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 + SUPPORTED_DEVICES += zbt-we826-32M +endef +TARGET_DEVICES += zbtlink_zbt-we826-32m define Device/zbtlink_zbt-we826-e - DTS := ZBT-WE826-E + MTK_SOC := mt7620a IMAGE_SIZE := 32448k - DEVICE_TITLE := Zbtlink ZBT-WE826-E + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WE826-E DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 uqmi \ kmod-usb-serial kmod-usb-serial-option endef TARGET_DEVICES += zbtlink_zbt-we826-e -define Device/zbt-wr8305rt - DTS := ZBT-WR8305RT - DEVICE_TITLE := Zbtlink ZBT-WR8305RT +define Device/zbtlink_zbt-wr8305rt + MTK_SOC := mt7620n + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WR8305RT DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += zbt-wr8305rt endef -TARGET_DEVICES += zbt-wr8305rt +TARGET_DEVICES += zbtlink_zbt-wr8305rt -define Device/zte-q7 - DTS := ZTE-Q7 - DEVICE_TITLE := ZTE Q7 +define Device/zte_q7 + MTK_SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := ZTE + DEVICE_MODEL := Q7 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += zte-q7 endef -TARGET_DEVICES += zte-q7 +TARGET_DEVICES += zte_q7 + +define Device/zyxel_keenetic-omni + MTK_SOC := mt7620n + IMAGE_SIZE := 7872k + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := Keenetic Omni + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + IMAGES += factory.bin + IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ + zyimage -d 4882 -v "ZyXEL Keenetic Omni" + SUPPORTED_DEVICES += kn_rc +endef +TARGET_DEVICES += zyxel_keenetic-omni + +define Device/zyxel_keenetic-omni-ii + MTK_SOC := mt7620n + IMAGE_SIZE := 7872k + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := Keenetic Omni II + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + IMAGES += factory.bin + IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ + zyimage -d 2102034 -v "ZyXEL Keenetic Omni II" + SUPPORTED_DEVICES += kn_rf +endef +TARGET_DEVICES += zyxel_keenetic-omni-ii + +define Device/zyxel_keenetic-viva + MTK_SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := Keenetic Viva + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport kmod-switch-rtl8366-smi kmod-switch-rtl8367b + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ + zyimage -d 8997 -v "ZyXEL Keenetic Viva" + SUPPORTED_DEVICES += kng_rc +endef +TARGET_DEVICES += zyxel_keenetic-viva diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index af15b9e48..ea5162ca7 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -47,19 +47,6 @@ define Build/iodata-factory fi endef -# The OEM webinterface expects an kernel with initramfs which has the uImage -# header field ih_name. -# We don't wan't to set the header name field for the kernel include in the -# sysupgrade image as well, as this image shouldn't be accepted by the OEM -# webinterface. It will soft-brick the board. -define Build/wr1201-factory-header - mkimage -A $(LINUX_KARCH) \ - -O linux -T kernel \ - -C lzma -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n 'WR1201_8_128' -d $@ $@.new - mv $@.new $@ -endef - define Build/ubnt-erx-factory-image if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \ echo '21001:6' > $(1).compat; \ @@ -84,307 +71,339 @@ define Build/ubnt-erx-factory-image fi endef -define Device/11acnas - DTS := 11ACNAS - IMAGE_SIZE := $(ralink_default_fw_size_16M) - UIMAGE_NAME := 11AC-NAS-Router(0.0.0) - DEVICE_TITLE := WeVO 11AC NAS Router - DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic +# The OEM webinterface expects an kernel with initramfs which has the uImage +# header field ih_name. +# We don't wan't to set the header name field for the kernel include in the +# sysupgrade image as well, as this image shouldn't be accepted by the OEM +# webinterface. It will soft-brick the board. +define Build/wr1201-factory-header + mkimage -A $(LINUX_KARCH) \ + -O linux -T kernel \ + -C lzma -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -n 'WR1201_8_128' -d $@ $@.new + mv $@.new $@ endef -TARGET_DEVICES += 11acnas + +define Device/afoundry_ew1200 + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := AFOUNDRY + DEVICE_MODEL := EW1200 + DEVICE_PACKAGES := \ + kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-mt7603 kmod-usb3 \ + kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += ew1200 +endef +TARGET_DEVICES += afoundry_ew1200 define Device/alfa-network_quad-e4g - DTS := QUAD-E4G + MTK_SOC := mt7621 IMAGE_SIZE := 16064k - DEVICE_TITLE := ALFA Network Quad-E4G + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := Quad-E4G DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 \ uboot-envtools endef TARGET_DEVICES += alfa-network_quad-e4g +define Device/asiarf_ap7621-001 + MTK_SOC := mt7621 + IMAGE_SIZE := 16000k + DEVICE_VENDOR := AsiaRF + DEVICE_MODEL := AP7621-001 + DEVICE_PACKAGES := \ + kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 +endef +TARGET_DEVICES += asiarf_ap7621-001 + +define Device/asiarf_ap7621-nv1 + MTK_SOC := mt7621 + IMAGE_SIZE := 16000k + DEVICE_VENDOR := AsiaRF + DEVICE_MODEL := AP7621-NV1 + DEVICE_PACKAGES := \ + kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 +endef +TARGET_DEVICES += asiarf_ap7621-nv1 + define Device/asus_rt-ac57u - DTS := RT-AC57U - DEVICE_TITLE := ASUS RT-AC57U + MTK_SOC := mt7621 + DEVICE_VENDOR := ASUS + DEVICE_MODEL := RT-AC57U IMAGE_SIZE := 16064k DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic endef TARGET_DEVICES += asus_rt-ac57u -define Device/dir-860l-b1 +define Device/asus_rt-ac65p + MTK_SOC := mt7621 + DEVICE_VENDOR := ASUS + DEVICE_MODEL := RT-AC65P + IMAGE_SIZE := 51200k + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 4096k + IMAGES += factory.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE) + DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e wpad-basic uboot-envtools +endef +TARGET_DEVICES += asus_rt-ac65p + +define Device/asus_rt-ac85p + MTK_SOC := mt7621 + DEVICE_VENDOR := ASUS + DEVICE_MODEL := RT-AC85P + IMAGE_SIZE := 51200k + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 4096k + IMAGES += factory.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE) + DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e wpad-basic uboot-envtools +endef +TARGET_DEVICES += asus_rt-ac85p + +define Device/buffalo_wsr-1166dhp + MTK_SOC := mt7621 + IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata + IMAGE_SIZE := 15936k + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WSR-1166DHP + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic + SUPPORTED_DEVICES += wsr-1166 +endef +TARGET_DEVICES += buffalo_wsr-1166dhp + +define Device/buffalo_wsr-600dhp + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WSR-600DHP + DEVICE_PACKAGES := kmod-mt7603 kmod-rt2800-pci wpad-basic + SUPPORTED_DEVICES += wsr-600 +endef +TARGET_DEVICES += buffalo_wsr-600dhp + +define Device/dlink_dir-860l-b1 $(Device/seama) - DTS := DIR-860L-B1 + MTK_SOC := mt7621 BLOCKSIZE := 64k SEAMA_SIGNATURE := wrgac13_dlink.2013gui_dir860lb KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := D-Link DIR-860L B1 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-860L + DEVICE_VARIANT := B1 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += dir-860l-b1 endef -TARGET_DEVICES += dir-860l-b1 +TARGET_DEVICES += dlink_dir-860l-b1 -define Device/mediatek_ap-mt7621a-v60 - DTS := AP-MT7621A-V60 - IMAGE_SIZE := $(ralink_default_fw_size_8M) - DEVICE_TITLE := Mediatek AP-MT7621A-V60 EVB - DEVICE_PACKAGES := kmod-usb3 kmod-sdhci-mt7620 kmod-sound-mt7620 +define Device/d-team_newifi-d2 + MTK_SOC := mt7621 + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Newifi + DEVICE_MODEL := D2 + DEVICE_PACKAGES := \ + kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic endef -TARGET_DEVICES += mediatek_ap-mt7621a-v60 +TARGET_DEVICES += d-team_newifi-d2 -define Device/xiaoyu_xy-c5 - DTS := XiaoYu-C5 - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := XiaoYu_XY-C5 - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 -endef -TARGET_DEVICES += xiaoyu_xy-c5 - -define Device/xzwifi_creativebox-v1 - DTS := CreativeBox-v1 - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := CreativeBox v1 +define Device/d-team_pbr-m1 + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := PandoraBox + DEVICE_MODEL := PBR-M1 DEVICE_PACKAGES := \ kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \ - kmod-usb3 + kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += pbr-m1 endef -TARGET_DEVICES += xzwifi_creativebox-v1 +TARGET_DEVICES += d-team_pbr-m1 + +define Device/edimax_rg21s + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Edimax + DEVICE_MODEL := Gemini AC2600 RG21S + IMAGES += factory.bin + IMAGE/factory.bin := \ + $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + elx-header 02020038 8844A2D168B45A2D + DEVICE_PACKAGES := \ + kmod-mt7615e wpad-basic +endef +TARGET_DEVICES += edimax_rg21s define Device/elecom_wrc-1167ghbk2-s - DTS := WRC-1167GHBK2-S + MTK_SOC := mt7621 IMAGE_SIZE := 15488k - DEVICE_TITLE := ELECOM WRC-1167GHBK2-S + DEVICE_VENDOR := ELECOM + DEVICE_MODEL := WRC-1167GHBK2-S IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) |\ elecom-wrc-factory WRC-1167GHBK2-S 0.00 + DEVICE_PACKAGES := kmod-mt7615e wpad-basic endef TARGET_DEVICES += elecom_wrc-1167ghbk2-s -define Device/elecom_wrc-2533gst - DTS := WRC-2533GST - IMAGE_SIZE := 11264k - DEVICE_TITLE := ELECOM WRC-2533GST - IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) |\ - elecom-gst-factory WRC-2533GST 0.00 -endef -TARGET_DEVICES += elecom_wrc-2533gst - define Device/elecom_wrc-1900gst - DTS := WRC-1900GST + MTK_SOC := mt7621 IMAGE_SIZE := 11264k - DEVICE_TITLE := ELECOM WRC-1900GST + DEVICE_VENDOR := ELECOM + DEVICE_MODEL := WRC-1900GST IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) |\ elecom-gst-factory WRC-1900GST 0.00 endef TARGET_DEVICES += elecom_wrc-1900gst -define Device/ew1200 - DTS := EW1200 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := AFOUNDRY EW1200 - DEVICE_PACKAGES := \ - kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-mt7603 kmod-usb3 \ - kmod-usb-ledtrig-usbport wpad-basic +define Device/elecom_wrc-2533gst + MTK_SOC := mt7621 + IMAGE_SIZE := 11264k + DEVICE_VENDOR := ELECOM + DEVICE_MODEL := WRC-2533GST + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) |\ + elecom-gst-factory WRC-2533GST 0.00 endef -TARGET_DEVICES += ew1200 +TARGET_DEVICES += elecom_wrc-2533gst -define Device/firewrt - DTS := FIREWRT - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Firefly FireWRT +define Device/firefly_firewrt + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Firefly + DEVICE_MODEL := FireWRT DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += firewrt endef -TARGET_DEVICES += firewrt +TARGET_DEVICES += firefly_firewrt define Device/gehua_ghl-r-001 - DTS := GHL-R-001 - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := GeHua GHL-R-001 + MTK_SOC := mt7621 + IMAGE_SIZE := 32448k + DEVICE_VENDOR := GeHua + DEVICE_MODEL := GHL-R-001 DEVICE_PACKAGES := \ kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic endef TARGET_DEVICES += gehua_ghl-r-001 define Device/gnubee_gb-pc1 - DTS := GB-PC1 - DEVICE_TITLE := GnuBee Personal Cloud One + MTK_SOC := mt7621 + DEVICE_VENDOR := GnuBee + DEVICE_MODEL := Personal Cloud One DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 - IMAGE_SIZE := $(ralink_default_fw_size_32M) + IMAGE_SIZE := 32448k endef TARGET_DEVICES += gnubee_gb-pc1 define Device/gnubee_gb-pc2 - DTS := GB-PC2 - DEVICE_TITLE := GnuBee Personal Cloud Two + MTK_SOC := mt7621 + DEVICE_VENDOR := GnuBee + DEVICE_MODEL := Personal Cloud Two DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 - IMAGE_SIZE := $(ralink_default_fw_size_32M) + IMAGE_SIZE := 32448k endef TARGET_DEVICES += gnubee_gb-pc2 -define Device/hc5962 - DTS := HC5962 +define Device/hiwifi_hc5962 + MTK_SOC := mt7621 BLOCKSIZE := 128k PAGESIZE := 2048 KERNEL_SIZE := 2097152 UBINIZE_OPTS := -E 5 - IMAGE_SIZE := $(ralink_default_fw_size_32M) + IMAGE_SIZE := 32768k IMAGES += factory.bin IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE) - DEVICE_TITLE := HiWiFi HC5962 + DEVICE_VENDOR := HiWiFi + DEVICE_MODEL := HC5962 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-basic + SUPPORTED_DEVICES += hc5962 endef -TARGET_DEVICES += hc5962 +TARGET_DEVICES += hiwifi_hc5962 define Device/iodata_wn-ax1167gr - DTS := WN-AX1167GR + MTK_SOC := mt7621 IMAGE_SIZE := 15552k KERNEL_INITRAMFS := $$(KERNEL) | \ iodata-factory 7864320 4 0x1055 $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.bin - DEVICE_TITLE := I-O DATA WN-AX1167GR + DEVICE_VENDOR := I-O DATA + DEVICE_MODEL := WN-AX1167GR DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic endef TARGET_DEVICES += iodata_wn-ax1167gr define Device/iodata_wn-gx300gr - DTS := WN-GX300GR - IMAGE_SIZE := 7798784 - DEVICE_TITLE := I-O DATA WN-GX300GR + MTK_SOC := mt7621 + IMAGE_SIZE := 7616k + DEVICE_VENDOR := I-O DATA + DEVICE_MODEL := WN-GX300GR DEVICE_PACKAGES := kmod-mt7603 wpad-basic endef TARGET_DEVICES += iodata_wn-gx300gr -define Device/k2p - DTS := K2P - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Phicomm K2P - DEVICE_PACKAGES := luci-app-mtwifi -endef -TARGET_DEVICES += k2p - -define Device/xiaomi_mir3p - DTS := MIR3P - BLOCKSIZE := 128k - PAGESIZE := 2048 - KERNEL_SIZE:= 4096k - UBINIZE_OPTS := -E 5 - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := Xiaomi Mi Router 3 Pro +define Device/iodata_wnpr2600g + MTK_SOC := mt7621 + DEVICE_VENDOR := I-O DATA + DEVICE_MODEL := WNPR2600G + IMAGE_SIZE := 13952k IMAGES += factory.bin - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := \ + $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + elx-header 0104003a 8844A2D168B45A2D + DEVICE_PACKAGES := kmod-mt7615e wpad-basic +endef +TARGET_DEVICES += iodata_wnpr2600g + +define Device/lenovo_newifi-d1 + MTK_SOC := mt7621 + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Newifi + DEVICE_MODEL := D1 DEVICE_PACKAGES := \ - kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic uboot-envtools + kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += newifi-d1 endef -TARGET_DEVICES += xiaomi_mir3p +TARGET_DEVICES += lenovo_newifi-d1 -define Device/xiaomi_mir3g - DTS := MIR3G - BLOCKSIZE := 128k - PAGESIZE := 2048 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 32768k - UBINIZE_OPTS := -E 5 - IMAGES += kernel1.bin rootfs0.bin - IMAGE/kernel1.bin := append-kernel - IMAGE/rootfs0.bin := append-ubi | check-size $$$$(IMAGE_SIZE) - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - DEVICE_TITLE := Xiaomi Mi Router 3G - SUPPORTED_DEVICES += R3G - SUPPORTED_DEVICES += mir3g - DEVICE_PACKAGES := \ - kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic \ - uboot-envtools -endef -TARGET_DEVICES += xiaomi_mir3g - -define Device/mt7621 - DTS := MT7621 - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := MediaTek MT7621 EVB -endef -TARGET_DEVICES += mt7621 - -define Device/newifi-d1 - DTS := Newifi-D1 - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := Newifi D1 - DEVICE_PACKAGES := \ - kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic -endef -TARGET_DEVICES += newifi-d1 - -define Device/d-team_newifi-d2 - DTS := Newifi-D2 - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := Newifi D2 - DEVICE_PACKAGES := \ - kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic -endef -TARGET_DEVICES += d-team_newifi-d2 - -define Device/pbr-m1 - DTS := PBR-M1 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := PBR-M1 - DEVICE_PACKAGES := \ - kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \ - kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic -endef -TARGET_DEVICES += pbr-m1 - -define Device/r6220 - DTS := R6220 - BLOCKSIZE := 128k - PAGESIZE := 2048 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 28672k - UBINIZE_OPTS := -E 5 - SERCOMM_HWID := AYA - SERCOMM_HWVER := A001 - SERCOMM_SWVER := 0x0086 - IMAGES += factory.img kernel.bin rootfs.bin - IMAGE/factory.img := pad-extra 2048k | append-kernel | pad-to 6144k | append-ubi | \ - pad-to $$$$(BLOCKSIZE) | sercom-footer | pad-to 128 | zip R6220.bin | sercom-seal - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - IMAGE/kernel.bin := append-kernel - IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE) - DEVICE_TITLE := Netgear R6220 - DEVICE_PACKAGES := \ - kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic -endef -TARGET_DEVICES += r6220 - -define Device/netgear_ex6150 - DTS := EX6150 - DEVICE_TITLE := Netgear EX6150 +define Device/linksys_re6500 + MTK_SOC := mt7621 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Linksys + DEVICE_MODEL := RE6500 DEVICE_PACKAGES := kmod-mt76x2 wpad-basic - NETGEAR_BOARD_ID := U12H318T00_NETGEAR - IMAGE_SIZE := 14848k - IMAGES += factory.chk - IMAGE/factory.chk := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | netgear-chk + SUPPORTED_DEVICES += re6500 endef -TARGET_DEVICES += netgear_ex6150 +TARGET_DEVICES += linksys_re6500 -define Device/netgear_r6350 - DTS := R6350 - BLOCKSIZE := 128k - PAGESIZE := 2048 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 40960k - UBINIZE_OPTS := -E 5 - IMAGES += kernel.bin rootfs.bin - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - IMAGE/kernel.bin := append-kernel - IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE) - DEVICE_TITLE := Netgear R6350 - DEVICE_PACKAGES := \ - kmod-mt7603 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic +define Device/mediatek_ap-mt7621a-v60 + MTK_SOC := mt7621 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Mediatek + DEVICE_MODEL := AP-MT7621A-V60 EVB + DEVICE_PACKAGES := kmod-usb3 kmod-sdhci-mt7620 kmod-sound-mt7620 endef -TARGET_DEVICES += netgear_r6350 +TARGET_DEVICES += mediatek_ap-mt7621a-v60 + +define Device/mediatek_mt7621-eval-board + MTK_SOC := mt7621 + BLOCKSIZE := 64k + IMAGE_SIZE := 15104k + DEVICE_VENDOR := MediaTek + DEVICE_MODEL := MT7621 EVB + SUPPORTED_DEVICES += mt7621 +endef +TARGET_DEVICES += mediatek_mt7621-eval-board define Device/MikroTik + MTK_SOC := mt7621 + DEVICE_VENDOR := MikroTik BLOCKSIZE := 64k IMAGE_SIZE := 16128k DEVICE_PACKAGES := kmod-usb3 @@ -397,181 +416,141 @@ endef define Device/mikrotik_rb750gr3 $(Device/MikroTik) - DTS := RB750Gr3 - DEVICE_TITLE := MikroTik RouterBOARD RB750Gr3 + DEVICE_MODEL := RouterBOARD RB750G + DEVICE_VARIANT := r3 DEVICE_PACKAGES += kmod-gpio-beeper endef TARGET_DEVICES += mikrotik_rb750gr3 -define Device/mikrotik_rbm33g - $(Device/MikroTik) - DTS := RBM33G - DEVICE_TITLE := MikroTik RouterBOARD M33G -endef -TARGET_DEVICES += mikrotik_rbm33g - define Device/mikrotik_rbm11g $(Device/MikroTik) - DTS := RBM11G - DEVICE_TITLE := MikroTik RouterBOARD M11G + DEVICE_MODEL := RouterBOARD M11G endef TARGET_DEVICES += mikrotik_rbm11g +define Device/mikrotik_rbm33g + $(Device/MikroTik) + DEVICE_MODEL := RouterBOARD M33G +endef +TARGET_DEVICES += mikrotik_rbm33g + +define Device/mqmaker_witi + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := MQmaker + DEVICE_MODEL := WiTi + DEVICE_PACKAGES := \ + kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \ + kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += witi mqmaker,witi-256m mqmaker,witi-512m +endef +TARGET_DEVICES += mqmaker_witi + define Device/mtc_wr1201 - DTS := WR1201 - IMAGE_SIZE := 16000k - DEVICE_TITLE := MTC Wireless Router WR1201 - KERNEL_INITRAMFS := $(KERNEL_DTB) | wr1201-factory-header - DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \ - kmod-usb-ledtrig-usbport wpad-basic + MTK_SOC := mt7621 + IMAGE_SIZE := 16000k + DEVICE_VENDOR := MTC + DEVICE_MODEL := Wireless Router WR1201 + KERNEL_INITRAMFS := $(KERNEL_DTB) | wr1201-factory-header + DEVICE_PACKAGES := \ + kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic endef TARGET_DEVICES += mtc_wr1201 -define Device/re350-v1 - DTS := RE350 - DEVICE_TITLE := TP-LINK RE350 v1 - DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic - TPLINK_BOARD_ID := RE350-V1 - TPLINK_HWID := 0x0 - TPLINK_HWREV := 0 - TPLINK_HEADER_VERSION := 1 - IMAGE_SIZE := 6016k - KERNEL := $(KERNEL_DTB) | tplink-v1-header -e -O - IMAGES += factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory -endef -TARGET_DEVICES += re350-v1 - -define Device/re6500 - DTS := RE6500 - DEVICE_TITLE := Linksys RE6500 +define Device/netgear_ex6150 + MTK_SOC := mt7621 + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := EX6150 DEVICE_PACKAGES := kmod-mt76x2 wpad-basic + NETGEAR_BOARD_ID := U12H318T00_NETGEAR + IMAGE_SIZE := 14848k + IMAGES += factory.chk + IMAGE/factory.chk := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | netgear-chk endef -TARGET_DEVICES += re6500 +TARGET_DEVICES += netgear_ex6150 -define Device/sap-g3200u3 - DTS := SAP-G3200U3 - DEVICE_TITLE := STORYLiNK SAP-G3200U3 - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic -endef -TARGET_DEVICES += sap-g3200u3 - -define Device/sk-wb8 - DTS := SK-WB8 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := SamKnows Whitebox 8 - DEVICE_PACKAGES := \ - kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport \ - uboot-envtools wpad-basic -endef -TARGET_DEVICES += sk-wb8 - -define Device/telco-electronics_x1 - DTS := Telco-Electronics-X1 - IMAGE_SIZE := 16064k - DEVICE_TITLE := Telco Electronics X1 - DEVICE_PACKAGES := kmod-usb3 kmod-mt76 wpad-basic -endef -TARGET_DEVICES += telco-electronics_x1 - -define Device/timecloud - DTS := Timecloud - DEVICE_TITLE := Thunder Timecloud - DEVICE_PACKAGES := kmod-usb3 -endef -TARGET_DEVICES += timecloud - -define Device/ubnt-erx - DTS := UBNT-ERX - FILESYSTEMS := squashfs - KERNEL_SIZE := 3145728 - KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - DEVICE_TITLE := Ubiquiti EdgeRouter X -endef -TARGET_DEVICES += ubnt-erx - -define Device/ubnt-erx-sfp - $(Device/ubnt-erx) - DTS := UBNT-ERX-SFP - DEVICE_TITLE := Ubiquiti EdgeRouter X-SFP - DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x kmod-i2c-gpio-custom -endef -TARGET_DEVICES += ubnt-erx-sfp - -define Device/unielec_u7621-06-256m-16m - DTS := U7621-06-256M-16M - IMAGE_SIZE := 16064k - DEVICE_TITLE := UniElec U7621-06 (256M RAM/16M flash) - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 - SUPPORTED_DEVICES += u7621-06-256M-16M -endef -TARGET_DEVICES += unielec_u7621-06-256m-16m - -define Device/unielec_u7621-06-512m-64m - DTS := U7621-06-512M-64M - IMAGE_SIZE := 65216k - DEVICE_TITLE := UniElec U7621-06 (512M RAM/64M flash) - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -endef -TARGET_DEVICES += unielec_u7621-06-512m-64m - -define Device/vr500 - DTS := VR500 - IMAGE_SIZE := 66453504 - DEVICE_TITLE := Planex VR500 - DEVICE_PACKAGES := kmod-usb3 -endef -TARGET_DEVICES += vr500 - -define Device/w2914nsv2 - DTS := W2914NSV2 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - UIMAGE_NAME := W2914NS-V2(0.0.0) - DEVICE_TITLE := WeVO W2914NS v2 - DEVICE_PACKAGES := \ - kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic -endef -TARGET_DEVICES += w2914nsv2 - -define Device/wf-2881 - DTS := WF-2881 +define Device/netgear_sercomm_nand + MTK_SOC := mt7621 BLOCKSIZE := 128k PAGESIZE := 2048 - FILESYSTEMS := squashfs - IMAGE_SIZE := 129280k - KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma + KERNEL_SIZE := 4096k UBINIZE_OPTS := -E 5 - IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE) - DEVICE_TITLE := NETIS WF-2881 - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + IMAGES += factory.img kernel.bin rootfs.bin + IMAGE/factory.img := pad-extra 2048k | append-kernel | pad-to 6144k | append-ubi | \ + pad-to $$$$(BLOCKSIZE) | sercom-footer | pad-to 128 | \ + zip $$$$(SERCOMM_HWNAME).bin | sercom-seal + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/kernel.bin := append-kernel + IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE) + DEVICE_VENDOR := NETGEAR + DEVICE_PACKAGES := kmod-mt7603 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic endef -TARGET_DEVICES += wf-2881 +DEVICE_VARS += SERCOMM_HWNAME SERCOMM_HWID SERCOMM_HWVER SERCOMM_SWVER -define Device/mqmaker_witi-256m - DTS := WITI-256M - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := MQmaker WiTi (256MB RAM) - DEVICE_PACKAGES := \ - kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \ - kmod-usb-ledtrig-usbport wpad-basic - SUPPORTED_DEVICES += witi +define Device/netgear_r6220 + $(Device/netgear_sercomm_nand) + DEVICE_MODEL := R6220 + SERCOMM_HWNAME := R6220 + SERCOMM_HWID := AYA + SERCOMM_HWVER := A001 + SERCOMM_SWVER := 0x0086 + IMAGE_SIZE := 28672k + DEVICE_PACKAGES += kmod-mt76x2 + SUPPORTED_DEVICES += r6220 endef -TARGET_DEVICES += mqmaker_witi-256m +TARGET_DEVICES += netgear_r6220 -define Device/mqmaker_witi-512m - DTS := WITI-512M - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := MQmaker WiTi (512MB RAM) - DEVICE_PACKAGES := \ - kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \ - kmod-usb-ledtrig-usbport wpad-basic + +define Device/netgear_r6260 + $(Device/netgear_sercomm_nand) + DEVICE_MODEL := R6260 + SERCOMM_HWNAME := R6260 + SERCOMM_HWID := CHJ + SERCOMM_HWVER := A001 + SERCOMM_SWVER := 0x0052 + IMAGE_SIZE := 40960k + DEVICE_PACKAGES += kmod-mt7615e endef -TARGET_DEVICES += mqmaker_witi-512m +TARGET_DEVICES += netgear_r6260 -define Device/wndr3700v5 - DTS := WNDR3700V5 +define Device/netgear_r6350 + $(Device/netgear_sercomm_nand) + DEVICE_MODEL := R6350 + SERCOMM_HWNAME := R6350 + SERCOMM_HWID := CHJ + SERCOMM_HWVER := A001 + SERCOMM_SWVER := 0x0052 + IMAGE_SIZE := 40960k + DEVICE_PACKAGES += kmod-mt7615e +endef +TARGET_DEVICES += netgear_r6350 + +define Device/netgear_r6800 + $(Device/netgear_sercomm_nand) + DEVICE_MODEL := R6800 + SERCOMM_HWNAME := R6950 + SERCOMM_HWID := BZV + SERCOMM_HWVER := A001 + SERCOMM_SWVER := 0x0062 + IMAGE_SIZE := 40960k + DEVICE_PACKAGES += kmod-mt7615e kmod-pinctrl-sx150x +endef +TARGET_DEVICES += netgear_r6800 + +define Device/netgear_r6850 + $(Device/netgear_sercomm_nand) + DEVICE_MODEL := R6850 + SERCOMM_HWNAME := R6850 + SERCOMM_HWID := CHJ + SERCOMM_HWVER := A001 + SERCOMM_SWVER := 0x0052 + IMAGE_SIZE := 40960k + DEVICE_PACKAGES += kmod-mt7615e +endef +TARGET_DEVICES += netgear_r6850 + +define Device/netgear_wndr3700-v5 + MTK_SOC := mt7621 BLOCKSIZE := 64k IMAGE_SIZE := 15232k SERCOMM_HWID := AYB @@ -582,94 +561,362 @@ define Device/wndr3700v5 IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE) IMAGE/factory.img := pad-extra 320k | $$(IMAGE/default) | pad-to $$$$(BLOCKSIZE) | \ sercom-footer | pad-to 128 | zip WNDR3700v5.bin | sercom-seal - DEVICE_TITLE := Netgear WNDR3700v5 + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := WNDR3700 + DEVICE_VARIANT := v5 DEVICE_PACKAGES := \ kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += wndr3700v5 endef -TARGET_DEVICES += wndr3700v5 +TARGET_DEVICES += netgear_wndr3700-v5 + +define Device/netis_wf-2881 + MTK_SOC := mt7621 + BLOCKSIZE := 128k + PAGESIZE := 2048 + FILESYSTEMS := squashfs + IMAGE_SIZE := 129280k + KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma + UBINIZE_OPTS := -E 5 + IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE) + DEVICE_VENDOR := NETIS + DEVICE_MODEL := WF-2881 + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += wf-2881 +endef +TARGET_DEVICES += netis_wf-2881 + +define Device/phicomm_k2p + MTK_SOC := mt7621 + IMAGE_SIZE := 15744k + DEVICE_VENDOR := Phicomm + DEVICE_MODEL := K2P + SUPPORTED_DEVICES += k2p + DEVICE_PACKAGES := luci-app-mtwifi +endef +TARGET_DEVICES += phicomm_k2p + +define Device/planex_vr500 + MTK_SOC := mt7621 + IMAGE_SIZE := 65216k + DEVICE_VENDOR := Planex + DEVICE_MODEL := VR500 + DEVICE_PACKAGES := kmod-usb3 + SUPPORTED_DEVICES += vr500 +endef +TARGET_DEVICES += planex_vr500 + +define Device/samknows_whitebox-v8 + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := SamKnows + DEVICE_MODEL := Whitebox 8 + DEVICE_PACKAGES := \ + kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport \ + uboot-envtools wpad-basic + SUPPORTED_DEVICES += sk-wb8 +endef +TARGET_DEVICES += samknows_whitebox-v8 + +define Device/storylink_sap-g3200u3 + MTK_SOC := mt7621 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := STORYLiNK + DEVICE_MODEL := SAP-G3200U3 + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += sap-g3200u3 +endef +TARGET_DEVICES += storylink_sap-g3200u3 + +define Device/telco-electronics_x1 + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Telco Electronics + DEVICE_MODEL := X1 + DEVICE_PACKAGES := kmod-usb3 kmod-mt76 wpad-basic +endef +TARGET_DEVICES += telco-electronics_x1 + +define Device/thunder_timecloud + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Thunder + DEVICE_MODEL := Timecloud + DEVICE_PACKAGES := kmod-usb3 + SUPPORTED_DEVICES += timecloud +endef +TARGET_DEVICES += thunder_timecloud + +define Device/totolink_a7000r + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + UIMAGE_NAME := C8340R1C-9999 + DEVICE_VENDOR := TOTOLINK + DEVICE_MODEL := A7000R + DEVICE_PACKAGES := kmod-mt7615e wpad-basic +endef +TARGET_DEVICES += totolink_a7000r + +define Device/adslr_g7 + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := ADSLR + DEVICE_MODEL := G7 + DEVICE_PACKAGES := kmod-mt7615e wpad-basic +endef +TARGET_DEVICES += adslr_g7 + +define Device/tplink-safeloader + MTK_SOC := mt7621 + DEVICE_VENDOR := TP-Link + TPLINK_BOARD_ID := + TPLINK_HWID := 0x0 + TPLINK_HWREV := 0 + TPLINK_HEADER_VERSION := 1 + KERNEL := $(KERNEL_DTB) | tplink-v1-header -e -O + IMAGES += factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory +endef + +define Device/tplink_re350-v1 + $(Device/tplink-safeloader) + DEVICE_MODEL := RE350 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic + TPLINK_BOARD_ID := RE350-V1 + IMAGE_SIZE := 6016k + SUPPORTED_DEVICES += re350-v1 +endef +TARGET_DEVICES += tplink_re350-v1 + +define Device/tplink_re650-v1 + $(Device/tplink-safeloader) + DEVICE_MODEL := RE650 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt7615e wpad-basic + TPLINK_BOARD_ID := RE650-V1 + IMAGE_SIZE := 14208k +endef +TARGET_DEVICES += tplink_re650-v1 + +define Device/ubiquiti_edgerouterx + MTK_SOC := mt7621 + IMAGE_SIZE := 256768k + FILESYSTEMS := squashfs + KERNEL_SIZE := 3145728 + KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_VENDOR := Ubiquiti + DEVICE_MODEL := EdgeRouter X + SUPPORTED_DEVICES += ubnt-erx +endef +TARGET_DEVICES += ubiquiti_edgerouterx + +define Device/ubiquiti_edgerouterx-sfp + $(Device/ubiquiti_edgerouterx) + DEVICE_VENDOR := Ubiquiti + DEVICE_MODEL := EdgeRouter X-SFP + DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x kmod-i2c-gpio-custom + SUPPORTED_DEVICES += ubnt-erx-sfp +endef +TARGET_DEVICES += ubiquiti_edgerouterx-sfp + +define Device/unielec_u7621-06-16m + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := UniElec + DEVICE_MODEL := U7621-06 + DEVICE_VARIANT := 16M + DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 + SUPPORTED_DEVICES += u7621-06-256M-16M unielec,u7621-06-256m-16m +endef +TARGET_DEVICES += unielec_u7621-06-16m + +define Device/unielec_u7621-06-64m + MTK_SOC := mt7621 + IMAGE_SIZE := 65216k + DEVICE_VENDOR := UniElec + DEVICE_MODEL := U7621-06 + DEVICE_VARIANT := 64M + DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 + SUPPORTED_DEVICES += unielec,u7621-06-512m-64m +endef +TARGET_DEVICES += unielec_u7621-06-64m + +define Device/wevo_11acnas + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + UIMAGE_NAME := 11AC-NAS-Router(0.0.0) + DEVICE_VENDOR := WeVO + DEVICE_MODEL := 11AC NAS Router + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += 11acnas +endef +TARGET_DEVICES += wevo_11acnas + +define Device/wevo_w2914ns-v2 + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + UIMAGE_NAME := W2914NS-V2(0.0.0) + DEVICE_VENDOR := WeVO + DEVICE_MODEL := W2914NS + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := \ + kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += w2914nsv2 +endef +TARGET_DEVICES += wevo_w2914ns-v2 + +define Device/xiaomi_mir3g + MTK_SOC := mt7621 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 124416k + UBINIZE_OPTS := -E 5 + IMAGES += kernel1.bin rootfs0.bin + IMAGE/kernel1.bin := append-kernel + IMAGE/rootfs0.bin := append-ubi | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := Mi Router 3G + SUPPORTED_DEVICES += R3G + SUPPORTED_DEVICES += mir3g + DEVICE_PACKAGES := \ + kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic \ + uboot-envtools +endef +TARGET_DEVICES += xiaomi_mir3g + +define Device/xiaomi_mir3g-v2 + MTK_SOC := mt7621 + IMAGE_SIZE := 14848k + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := Mi Router 3G + DEVICE_VARIANT := v2 + DEVICE_ALT0_VENDOR := Xiaomi + DEVICE_ALT0_MODEL := Mi Router 4A + DEVICE_ALT0_VARIANT := Gigabit Edition + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic +endef +TARGET_DEVICES += xiaomi_mir3g-v2 + +define Device/xiaomi_mir3p + MTK_SOC := mt7621 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE:= 4096k + UBINIZE_OPTS := -E 5 + IMAGE_SIZE := 255488k + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := Mi Router 3 Pro + IMAGES += factory.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE) + DEVICE_PACKAGES := \ + kmod-mt7615e kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic \ + uboot-envtools +endef +TARGET_DEVICES += xiaomi_mir3p + +define Device/xiaoyu_xy-c5 + MTK_SOC := mt7621 + IMAGE_SIZE := 32448k + DEVICE_VENDOR := XiaoYu + DEVICE_MODEL := XY-C5 + DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 +endef +TARGET_DEVICES += xiaoyu_xy-c5 + +define Device/xzwifi_creativebox-v1 + MTK_SOC := mt7621 + IMAGE_SIZE := 32448k + DEVICE_VENDOR := CreativeBox + DEVICE_MODEL := v1 + DEVICE_PACKAGES := \ + kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \ + kmod-usb3 +endef +TARGET_DEVICES += xzwifi_creativebox-v1 define Device/youhua_wr1200js - DTS := WR1200JS + MTK_SOC := mt7621 IMAGE_SIZE := 16064k - DEVICE_TITLE := YouHua WR1200JS + DEVICE_VENDOR := YouHua + DEVICE_MODEL := WR1200JS DEVICE_PACKAGES := \ kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic endef TARGET_DEVICES += youhua_wr1200js define Device/youku_yk-l2 - DTS := YOUKU-YK2 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Youku YK-L2 + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Youku + DEVICE_MODEL := YK-L2 DEVICE_PACKAGES := \ kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic endef TARGET_DEVICES += youku_yk-l2 -define Device/wsr-1166 - DTS := WSR-1166 - IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Buffalo WSR-1166 - DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic -endef -TARGET_DEVICES += wsr-1166 - -define Device/wsr-600 - DTS := WSR-600 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Buffalo WSR-600 - DEVICE_PACKAGES := kmod-mt7603 kmod-rt2800-pci wpad-basic -endef -TARGET_DEVICES += wsr-600 - -define Device/zbt-we1326 - DTS := ZBT-WE1326 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := ZBT WE1326 +define Device/zbtlink_zbt-we1326 + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WE1326 DEVICE_PACKAGES := \ kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 wpad-basic + SUPPORTED_DEVICES += zbt-we1326 endef -TARGET_DEVICES += zbt-we1326 +TARGET_DEVICES += zbtlink_zbt-we1326 define Device/zbtlink_zbt-we3526 - DTS := ZBT-WE3526 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := ZBT WE3526 + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WE3526 DEVICE_PACKAGES := \ kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \ kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic endef TARGET_DEVICES += zbtlink_zbt-we3526 -define Device/zbt-wg2626 - DTS := ZBT-WG2626 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := ZBT WG2626 +define Device/zbtlink_zbt-wg2626 + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WG2626 DEVICE_PACKAGES := \ kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \ kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += zbt-wg2626 endef -TARGET_DEVICES += zbt-wg2626 +TARGET_DEVICES += zbtlink_zbt-wg2626 -define Device/zbt-wg3526-16M - DTS := ZBT-WG3526-16M - IMAGE_SIZE := $(ralink_default_fw_size_16M) - SUPPORTED_DEVICES += zbt-wg3526 - DEVICE_TITLE := ZBT WG3526 (16MB flash) +define Device/zbtlink_zbt-wg3526-16m + MTK_SOC := mt7621 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WG3526 + DEVICE_VARIANT := 16M DEVICE_PACKAGES := \ kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \ kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += zbt-wg3526 zbt-wg3526-16M endef -TARGET_DEVICES += zbt-wg3526-16M +TARGET_DEVICES += zbtlink_zbt-wg3526-16m -define Device/zbt-wg3526-32M - DTS := ZBT-WG3526-32M - IMAGE_SIZE := $(ralink_default_fw_size_32M) - SUPPORTED_DEVICES += ac1200pro - DEVICE_TITLE := ZBT WG3526 (32MB flash) +define Device/zbtlink_zbt-wg3526-32m + MTK_SOC := mt7621 + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WG3526 + DEVICE_VARIANT := 32M DEVICE_PACKAGES := \ kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \ kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + SUPPORTED_DEVICES += ac1200pro zbt-wg3526-32M endef -TARGET_DEVICES += zbt-wg3526-32M +TARGET_DEVICES += zbtlink_zbt-wg3526-32m diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 054935e59..dbd80a605 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -2,7 +2,254 @@ # MT76x8 Profiles # +define Device/alfa-network_awusfree1 + MTK_SOC := mt7628an + IMAGE_SIZE := 7872k + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := AWUSFREE1 + DEVICE_PACKAGES := uboot-envtools +endef +TARGET_DEVICES += alfa-network_awusfree1 + +define Device/buffalo_wcr-1166ds + MTK_SOC := mt7628an + IMAGE_SIZE := 7936k + BUFFALO_TAG_PLATFORM := MTK + BUFFALO_TAG_VERSION := 9.99 + BUFFALO_TAG_MINOR := 9.99 + IMAGES += factory.bin + IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata + IMAGE/factory.bin := \ + trx -M 0x746f435c | pad-rootfs | append-metadata | \ + buffalo-enc WCR-1166DS $$(BUFFALO_TAG_VERSION) -l | \ + buffalo-tag-dhp WCR-1166DS JP JP | buffalo-enc-tag -l | \ + buffalo-dhp-image + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WCR-1166DS + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += wcr-1166ds +endef +TARGET_DEVICES += buffalo_wcr-1166ds + +define Device/cudy_wr1000 + MTK_SOC := mt7628an + IMAGE_SIZE := 7872k + IMAGES += factory.bin + IMAGE/factory.bin := \ + $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | jcg-header 92.122 + JCG_MAXSIZE := 8060928 + DEVICE_VENDOR := Cudy + DEVICE_MODEL := WR1000 + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += wr1000 +endef +TARGET_DEVICES += cudy_wr1000 + +define Device/d-team_pbr-d1 + MTK_SOC := mt7628an + IMAGE_SIZE := 16064k + DEVICE_VENDOR := PandoraBox + DEVICE_MODEL := PBR-D1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += pbr-d1 +endef +TARGET_DEVICES += d-team_pbr-d1 + +define Device/duzun_dm06 + MTK_SOC := mt7628an + IMAGE_SIZE := 7872k + DEVICE_VENDOR := DuZun + DEVICE_MODEL := DM06 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += duzun-dm06 +endef +TARGET_DEVICES += duzun_dm06 + +define Device/glinet_gl-mt300n-v2 + MTK_SOC := mt7628an + IMAGE_SIZE := 16064k + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-MT300N + DEVICE_VARIANT := V2 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += gl-mt300n-v2 +endef +TARGET_DEVICES += glinet_gl-mt300n-v2 + +define Device/glinet_vixmini + MTK_SOC := mt7628an + IMAGE_SIZE := 7872k + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := VIXMINI + SUPPORTED_DEVICES += vixmini +endef +TARGET_DEVICES += glinet_vixmini + +define Device/hilink_hlk-7628n + MTK_SOC := mt7628an + IMAGE_SIZE := 32448k + DEVICE_VENDOR := HILINK + DEVICE_MODEL := HLK-7628N +endef +TARGET_DEVICES += hilink_hlk-7628n + +define Device/hiwifi_hc5661a + MTK_SOC := mt7628an + IMAGE_SIZE := 15808k + DEVICE_VENDOR := HiWiFi + DEVICE_MODEL := HC5661A + SUPPORTED_DEVICES += hc5661a +endef +TARGET_DEVICES += hiwifi_hc5661a + +define Device/hiwifi_hc5761a + MTK_SOC := mt7628an + IMAGE_SIZE := 15808k + DEVICE_VENDOR := HiWiFi + DEVICE_MODEL := HC5761A + DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += hiwifi_hc5761a + +define Device/hiwifi_hc5861b + MTK_SOC := mt7628an + IMAGE_SIZE := 15808k + DEVICE_VENDOR := HiWiFi + DEVICE_MODEL := HC5861B + DEVICE_PACKAGES := kmod-mt76x2 +endef +TARGET_DEVICES += hiwifi_hc5861b + +define Device/iptime_a3 + MTK_SOC := mt7628an + IMAGE_SIZE := 7936k + UIMAGE_NAME := a3 + DEVICE_VENDOR := ipTIME + DEVICE_MODEL := A3 + DEVICE_PACKAGES := kmod-mt76x2 +endef +TARGET_DEVICES += iptime_a3 + +define Device/iptime_a604m + MTK_SOC := mt7628an + IMAGE_SIZE := 7936k + UIMAGE_NAME := a604m + DEVICE_VENDOR := ipTIME + DEVICE_MODEL := A604M + DEVICE_PACKAGES := kmod-mt76x2 +endef +TARGET_DEVICES += iptime_a604m + +define Device/mediatek_linkit-smart-7688 + MTK_SOC := mt7628an + IMAGE_SIZE := 32448k + DEVICE_VENDOR := MediaTek + DEVICE_MODEL := LinkIt Smart 7688 + DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools kmod-sdhci-mt7620 + SUPPORTED_DEVICES += linkits7688 linkits7688d +endef +TARGET_DEVICES += mediatek_linkit-smart-7688 + +define Device/mediatek_mt7628an-eval-board + MTK_SOC := mt7628an + BLOCKSIZE := 64k + IMAGE_SIZE := 7872k + DEVICE_VENDOR := MediaTek + DEVICE_MODEL := MT7628 EVB + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += mt7628 +endef +TARGET_DEVICES += mediatek_mt7628an-eval-board + +define Device/mercury_mac1200r-v2 + MTK_SOC := mt7628an + IMAGE_SIZE := 7936k + DEVICE_VENDOR := Mercury + DEVICE_MODEL := MAC1200R + DEVICE_VARIANT := v2.0 + SUPPORTED_DEVICES := mac1200rv2 + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += mac1200rv2 +endef +TARGET_DEVICES += mercury_mac1200r-v2 + +define Device/netgear_r6120 + MTK_SOC := mt7628an + BLOCKSIZE := 64k + IMAGE_SIZE := 15744k + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := R6120 + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci + SERCOMM_HWID := CGQ + SERCOMM_HWVER := A001 + SERCOMM_SWVER := 0x0040 + IMAGES += factory.img + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE)| append-rootfs | pad-rootfs + IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.img := pad-extra 576k | $$(IMAGE/default) | pad-to $$$$(BLOCKSIZE) | \ + sercom-footer | pad-to 128 | zip R6120.bin | sercom-seal +endef +TARGET_DEVICES += netgear_r6120 + +define Device/onion_omega2 + MTK_SOC := mt7628an + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Onion + DEVICE_MODEL := Omega2 + DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools + SUPPORTED_DEVICES += omega2 +endef +TARGET_DEVICES += onion_omega2 + +define Device/onion_omega2p + MTK_SOC := mt7628an + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Onion + DEVICE_MODEL := Omega2+ + DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools kmod-sdhci-mt7620 + SUPPORTED_DEVICES += omega2p +endef +TARGET_DEVICES += onion_omega2p + +define Device/rakwireless_rak633 + MTK_SOC := mt7628an + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Rakwireless + DEVICE_MODEL := RAK633 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += rakwireless_rak633 + +define Device/skylab_skw92a + MTK_SOC := mt7628an + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Skylab + DEVICE_MODEL := SKW92A + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += skylab_skw92a + +define Device/tama_w06 + MTK_SOC := mt7628an + IMAGE_SIZE := 15040k + DEVICE_VENDOR := Tama + DEVICE_MODEL := W06 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += tama_w06 + +define Device/totolink_lr1200 + MTK_SOC := mt7628an + IMAGE_SIZE := 7872k + DEVICE_VENDOR := TOTOLINK + DEVICE_MODEL := LR1200 + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 uqmi +endef +TARGET_DEVICES += totolink_lr1200 + define Device/tplink + MTK_SOC := mt7628an + DEVICE_VENDOR := TP-Link TPLINK_FLASHLAYOUT := TPLINK_HWID := TPLINK_HWREV := @@ -18,281 +265,41 @@ define Device/tplink endef DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION - -define Device/alfa-network_awusfree1 - DTS := AWUSFREE1 - IMAGE_SIZE := $(ralink_default_fw_size_8M) - DEVICE_TITLE := ALFA Network AWUSFREE1 - DEVICE_PACKAGES := uboot-envtools -endef -TARGET_DEVICES += alfa-network_awusfree1 - -define Device/cudy_wr1000 - DTS := WR1000 - IMAGE_SIZE := $(ralink_default_fw_size_8M) - IMAGES += factory.bin - IMAGE/factory.bin := \ - $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | jcg-header 92.122 - JCG_MAXSIZE := 8060928 - DEVICE_TITLE := Cudy WR1000 - DEVICE_PACKAGES := kmod-mt76x2 - SUPPORTED_DEVICES += wr1000 -endef -TARGET_DEVICES += cudy_wr1000 - -define Device/tama_w06 - DTS := W06 - IMAGE_SIZE := 15040k - DEVICE_TITLE := Tama W06 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += tama_w06 - -define Device/duzun-dm06 - DTS := DUZUN-DM06 - DEVICE_TITLE := DuZun DM06 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += duzun-dm06 - -define Device/gl-mt300n-v2 - DTS := GL-MT300N-V2 - IMAGE_SIZE := 16064k - DEVICE_TITLE := GL-iNet GL-MT300N-V2 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += gl-mt300n-v2 - -define Device/glinet_vixmini - DTS := VIXMINI - IMAGE_SIZE := 7872k - DEVICE_TITLE := GL.iNet VIXMINI - SUPPORTED_DEVICES += vixmini -endef -TARGET_DEVICES += glinet_vixmini - -define Device/hc5661a - DTS := HC5661A - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := HiWiFi HC5661A -endef -TARGET_DEVICES += hc5661a - -define Device/hilink_hlk-7628n - DTS := HLK-7628N - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := HILINK HLK7628N -endef -TARGET_DEVICES += hilink_hlk-7628n - -define Device/hiwifi_hc5861b - DTS := HC5861B - IMAGE_SIZE := 15808k - DEVICE_TITLE := HiWiFi HC5861B - DEVICE_PACKAGES := kmod-mt76x2 -endef -TARGET_DEVICES += hiwifi_hc5861b - -define Device/LinkIt7688 - DTS := LINKIT7688 - IMAGE_SIZE := $(ralink_default_fw_size_32M) - SUPPORTED_DEVICES := linkits7688 linkits7688d - DEVICE_TITLE := MediaTek LinkIt Smart 7688 - DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools -endef -TARGET_DEVICES += LinkIt7688 - -define Device/mac1200r-v2 - DTS := MAC1200RV2 - DEVICE_TITLE := Mercury MAC1200R v2.0 - SUPPORTED_DEVICES := mac1200rv2 - DEVICE_PACKAGES := kmod-mt76x2 -endef -TARGET_DEVICES += mac1200r-v2 - -define Device/miwifi-nano - DTS := MIWIFI-NANO - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Xiaomi MiWiFi Nano - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += miwifi-nano - -define Device/mt7628 - DTS := MT7628 - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := MediaTek MT7628 EVB - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += mt7628 - -define Device/netgear_r6120 - DTS := R6120 - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Netgear R6120 - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci - SERCOMM_HWID := CGQ - SERCOMM_HWVER := A001 - SERCOMM_SWVER := 0x0040 - IMAGES += factory.img - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE)| append-rootfs | pad-rootfs - IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/factory.img := pad-extra 576k | $$(IMAGE/default) | pad-to $$$$(BLOCKSIZE) | \ - sercom-footer | pad-to 128 | zip R6120.bin | sercom-seal -endef -TARGET_DEVICES += netgear_r6120 - -define Device/omega2 - DTS := OMEGA2 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Onion Omega2 - DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools -endef -TARGET_DEVICES += omega2 - -define Device/omega2p - DTS := OMEGA2P - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := Onion Omega2+ - DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools kmod-sdhci-mt7620 -endef -TARGET_DEVICES += omega2p - -define Device/pbr-d1 - DTS := PBR-D1 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := PBR-D1 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += pbr-d1 - -define Device/rakwireless_rak633 - DTS := RAK633 - DEVICE_TITLE := Rakwireless RAK633 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += rakwireless_rak633 - -define Device/skylab_skw92a - DTS := SKW92A - IMAGE_SIZE := 16064k - DEVICE_TITLE := Skylab SKW92A - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci -endef -TARGET_DEVICES += skylab_skw92a - -define Device/totolink_lr1200 - DTS := TOTOLINK-LR1200 - IMAGE_SIZE := 7872k - DEVICE_TITLE := TOTOLINK LR1200 - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 uqmi -endef -TARGET_DEVICES += totolink_lr1200 - -define Device/tplink_tl-wa801nd-v5 +define Device/tplink_archer-c20-v4 $(Device/tplink) - DTS := TL-WA801NDV5 IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link TL-WA801ND v5 - TPLINK_FLASHLAYOUT := 8Mmtk - TPLINK_HWID := 0x08010005 - TPLINK_HWREV := 0x1 - TPLINK_HWREVADD := 0x5 - TPLINK_HVERSION := 3 -endef -TARGET_DEVICES += tplink_tl-wa801nd-v5 - -define Device/tplink_tl-wr802n-v4 - $(Device/tplink) - DTS := TL-WR802NV4 - IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link TL-WR802N v4 - TPLINK_FLASHLAYOUT := 8Mmtk - TPLINK_HWID := 0x08020004 - TPLINK_HWREV := 0x1 - TPLINK_HWREVADD := 0x4 - TPLINK_HVERSION := 3 -endef -TARGET_DEVICES += tplink_tl-wr802n-v4 - -define Device/tl-wr840n-v4 - $(Device/tplink) - DTS := TL-WR840NV4 - IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link TL-WR840N v4 - TPLINK_FLASHLAYOUT := 8Mmtk - TPLINK_HWID := 0x08400004 - TPLINK_HWREV := 0x1 - TPLINK_HWREVADD := 0x4 - TPLINK_HVERSION := 3 -endef -TARGET_DEVICES += tl-wr840n-v4 - -define Device/tl-wr840n-v5 - DTS := TL-WR840NV5 - IMAGE_SIZE := 3904k - DEVICE_TITLE := TP-Link TL-WR840N v5 - TPLINK_FLASHLAYOUT := 4Mmtk - TPLINK_HWID := 0x08400005 - TPLINK_HWREV := 0x1 - TPLINK_HWREVADD := 0x5 - TPLINK_HVERSION := 3 - KERNEL := $(KERNEL_DTB) - KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e - IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \ - check-size $$$$(IMAGE_SIZE) - DEFAULT := n -endef -TARGET_DEVICES += tl-wr840n-v5 - -define Device/tl-wr841n-v13 - $(Device/tplink) - DTS := TL-WR841NV13 - IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link TL-WR841N v13 - TPLINK_FLASHLAYOUT := 8Mmtk - TPLINK_HWID := 0x08410013 - TPLINK_HWREV := 0x268 - TPLINK_HWREVADD := 0x13 - TPLINK_HVERSION := 3 -endef -TARGET_DEVICES += tl-wr841n-v13 - -define Device/tplink_c20-v4 - $(Device/tplink) - DTS := ArcherC20v4 - IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link ArcherC20 v4 + DEVICE_MODEL := Archer C20 + DEVICE_VARIANT := v4 TPLINK_FLASHLAYOUT := 8Mmtk TPLINK_HWID := 0xc200004 TPLINK_HWREV := 0x1 TPLINK_HWREVADD := 0x4 TPLINK_HVERSION := 3 DEVICE_PACKAGES := kmod-mt76x0e + SUPPORTED_DEVICES += tplink,c20-v4 endef -TARGET_DEVICES += tplink_c20-v4 +TARGET_DEVICES += tplink_archer-c20-v4 -define Device/tplink_c50-v3 +define Device/tplink_archer-c50-v3 $(Device/tplink) - DTS := ArcherC50V3 IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link ArcherC50 v3 + DEVICE_MODEL := Archer C50 + DEVICE_VARIANT := v3 TPLINK_FLASHLAYOUT := 8Mmtk TPLINK_HWID := 0x001D9BA4 TPLINK_HWREV := 0x79 TPLINK_HWREVADD := 0x1 TPLINK_HVERSION := 3 DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += tplink,c50-v3 endef -TARGET_DEVICES += tplink_c50-v3 +TARGET_DEVICES += tplink_archer-c50-v3 -define Device/tplink_c50-v4 +define Device/tplink_archer-c50-v4 $(Device/tplink) - DTS := ArcherC50V4 IMAGE_SIZE := 7616k - DEVICE_TITLE := TP-Link ArcherC50 v4 + DEVICE_MODEL := Archer C50 + DEVICE_VARIANT := v4 TPLINK_FLASHLAYOUT := 8MSUmtk TPLINK_HWID := 0x001D589B TPLINK_HWREV := 0x93 @@ -300,14 +307,15 @@ define Device/tplink_c50-v4 TPLINK_HVERSION := 3 DEVICE_PACKAGES := kmod-mt76x2 IMAGES := sysupgrade.bin + SUPPORTED_DEVICES += tplink,c50-v4 endef -TARGET_DEVICES += tplink_c50-v4 +TARGET_DEVICES += tplink_archer-c50-v4 define Device/tplink_tl-mr3020-v3 $(Device/tplink) - DTS := TL-MR3020V3 IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link TL-MR3020 v3 + DEVICE_MODEL := TL-MR3020 + DEVICE_VARIANT := v3 TPLINK_FLASHLAYOUT := 8Mmtk TPLINK_HWID := 0x30200003 TPLINK_HWREV := 0x3 @@ -319,9 +327,9 @@ TARGET_DEVICES += tplink_tl-mr3020-v3 define Device/tplink_tl-mr3420-v5 $(Device/tplink) - DTS := TL-MR3420V5 IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link TL-MR3420 v5 + DEVICE_MODEL := TL-MR3420 + DEVICE_VARIANT := v5 TPLINK_FLASHLAYOUT := 8Mmtk TPLINK_HWID := 0x34200005 TPLINK_HWREV := 0x5 @@ -331,11 +339,98 @@ define Device/tplink_tl-mr3420-v5 endef TARGET_DEVICES += tplink_tl-mr3420-v5 +define Device/tplink_tl-wa801nd-v5 + $(Device/tplink) + IMAGE_SIZE := 7808k + DEVICE_MODEL := TL-WA801ND + DEVICE_VARIANT := v5 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x08010005 + TPLINK_HWREV := 0x1 + TPLINK_HWREVADD := 0x5 + TPLINK_HVERSION := 3 +endef +TARGET_DEVICES += tplink_tl-wa801nd-v5 + +define Device/tplink_tl-wr802n-v4 + $(Device/tplink) + IMAGE_SIZE := 7808k + DEVICE_MODEL := TL-WR802N + DEVICE_VARIANT := v4 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x08020004 + TPLINK_HWREV := 0x1 + TPLINK_HWREVADD := 0x4 + TPLINK_HVERSION := 3 +endef +TARGET_DEVICES += tplink_tl-wr802n-v4 + +define Device/tplink_tl-wr840n-v4 + $(Device/tplink) + IMAGE_SIZE := 7808k + DEVICE_MODEL := TL-WR840N + DEVICE_VARIANT := v4 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x08400004 + TPLINK_HWREV := 0x1 + TPLINK_HWREVADD := 0x4 + TPLINK_HVERSION := 3 + SUPPORTED_DEVICES += tl-wr840n-v4 +endef +TARGET_DEVICES += tplink_tl-wr840n-v4 + +define Device/tplink_tl-wr840n-v5 + MTK_SOC := mt7628an + IMAGE_SIZE := 3904k + DEVICE_VENDOR := TP-Link + DEVICE_MODEL := TL-WR840N + DEVICE_VARIANT := v5 + TPLINK_FLASHLAYOUT := 4Mmtk + TPLINK_HWID := 0x08400005 + TPLINK_HWREV := 0x1 + TPLINK_HWREVADD := 0x5 + TPLINK_HVERSION := 3 + KERNEL := $(KERNEL_DTB) + KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e + IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \ + check-size $$$$(IMAGE_SIZE) + SUPPORTED_DEVICES += tl-wr840n-v5 +endef +TARGET_DEVICES += tplink_tl-wr840n-v5 + +define Device/tplink_tl-wr841n-v13 + $(Device/tplink) + IMAGE_SIZE := 7808k + DEVICE_MODEL := TL-WR841N + DEVICE_VARIANT := v13 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x08410013 + TPLINK_HWREV := 0x268 + TPLINK_HWREVADD := 0x13 + TPLINK_HVERSION := 3 + SUPPORTED_DEVICES += tl-wr841n-v13 +endef +TARGET_DEVICES += tplink_tl-wr841n-v13 + +define Device/tplink_tl-wr841n-v14 + $(Device/tplink) + IMAGE_SIZE := 3968k + DEVICE_MODEL := TL-WR841N + DEVICE_VARIANT := v14 + TPLINK_FLASHLAYOUT := 4Mmtk + TPLINK_HWID := 0x08410014 + TPLINK_HWREV := 0x1 + TPLINK_HWREVADD := 0x14 + TPLINK_HVERSION := 3 + IMAGE/tftp-recovery.bin := pad-extra 64k | $$(IMAGE/factory.bin) +endef +TARGET_DEVICES += tplink_tl-wr841n-v14 + define Device/tplink_tl-wr842n-v5 $(Device/tplink) - DTS := TL-WR842NV5 IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link TL-WR842N v5 + DEVICE_MODEL := TL-WR842N + DEVICE_VARIANT := v5 TPLINK_FLASHLAYOUT := 8Mmtk TPLINK_HWID := 0x08420005 TPLINK_HWREV := 0x5 @@ -347,9 +442,9 @@ TARGET_DEVICES += tplink_tl-wr842n-v5 define Device/tplink_tl-wr902ac-v3 $(Device/tplink) - DTS := TL-WR902ACV3 IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link TL-WR902AC v3 + DEVICE_MODEL := TL-WR902AC + DEVICE_VARIANT := v3 TPLINK_FLASHLAYOUT := 8Mmtk TPLINK_HWID := 0x000dc88f TPLINK_HWREV := 0x89 @@ -359,126 +454,141 @@ define Device/tplink_tl-wr902ac-v3 endef TARGET_DEVICES += tplink_tl-wr902ac-v3 -define Device/u7628-01-128M-16M - DTS := U7628-01-128M-16M +define Device/unielec_u7628-01-16m + MTK_SOC := mt7628an IMAGE_SIZE := 16064k - DEVICE_TITLE := UniElec U7628-01 (128M RAM/16M flash) + DEVICE_VENDOR := UniElec + DEVICE_MODEL := U7628-01 + DEVICE_VARIANT := 16M DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += u7628-01-128M-16M unielec,u7628-01-128m-16m endef -TARGET_DEVICES += u7628-01-128M-16M +TARGET_DEVICES += unielec_u7628-01-16m -define Device/vocore2 - DTS := VOCORE2 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := VoCore VoCore2 +define Device/vocore_vocore2 + MTK_SOC := mt7628an + IMAGE_SIZE := 16064k + DEVICE_VENDOR := VoCore + DEVICE_MODEL := VoCore2 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \ kmod-sdhci-mt7620 + SUPPORTED_DEVICES += vocore2 endef -TARGET_DEVICES += vocore2 +TARGET_DEVICES += vocore_vocore2 -define Device/vocore2lite - DTS := VOCORE2LITE - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := VoCore VoCore2-Lite +define Device/vocore_vocore2-lite + MTK_SOC := mt7628an + IMAGE_SIZE := 7872k + DEVICE_VENDOR := VoCore + DEVICE_MODEL := VoCore2-Lite DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \ kmod-sdhci-mt7620 + SUPPORTED_DEVICES += vocore2lite endef -TARGET_DEVICES += vocore2lite +TARGET_DEVICES += vocore_vocore2-lite define Device/wavlink_wl-wn570ha1 - DTS := WL-WN570HA1 - IMAGE_SIZE := $(ralink_default_fw_size_8M) - DEVICE_TITLE := Wavlink WL-WN570HA1 + MTK_SOC := mt7628an + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Wavlink + DEVICE_MODEL := WL-WN570HA1 DEVICE_PACKAGES := kmod-mt76x0e endef TARGET_DEVICES += wavlink_wl-wn570ha1 define Device/wavlink_wl-wn575a3 - DTS := WL-WN575A3 - IMAGE_SIZE := $(ralink_default_fw_size_8M) - DEVICE_TITLE := Wavlink WL-WN575A3 + MTK_SOC := mt7628an + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Wavlink + DEVICE_MODEL := WL-WN575A3 DEVICE_PACKAGES := kmod-mt76x2 SUPPORTED_DEVICES += wl-wn575a3 endef TARGET_DEVICES += wavlink_wl-wn575a3 -define Device/wcr-1166ds - DTS := WCR-1166DS - BUFFALO_TAG_PLATFORM := MTK - BUFFALO_TAG_VERSION := 9.99 - BUFFALO_TAG_MINOR := 9.99 - IMAGES += factory.bin - IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata - IMAGE/factory.bin := \ - trx -M 0x746f435c | pad-rootfs | append-metadata | \ - buffalo-enc WCR-1166DS $$(BUFFALO_TAG_VERSION) -l | \ - buffalo-tag-dhp WCR-1166DS JP JP | buffalo-enc-tag -l | \ - buffalo-dhp-image - DEVICE_TITLE := Buffalo WCR-1166DS - DEVICE_PACKAGES := kmod-mt76x2 -endef -TARGET_DEVICES += wcr-1166ds - define Device/widora_neo-16m - DTS := WIDORA-NEO-16M - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Widora-NEO (16M) + MTK_SOC := mt7628an + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Widora + DEVICE_MODEL := Widora-NEO + DEVICE_VARIANT := 16M DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci SUPPORTED_DEVICES += widora-neo endef TARGET_DEVICES += widora_neo-16m define Device/widora_neo-32m - DTS := WIDORA-NEO-32M - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := Widora-NEO (32M) + MTK_SOC := mt7628an + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Widora + DEVICE_MODEL := Widora-NEO + DEVICE_VARIANT := 32M DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci endef TARGET_DEVICES += widora_neo-32m define Device/wiznet_wizfi630s - DTS := WIZFI630S - IMAGE_SIZE := $(ralink_default_fw_size_32M) - DEVICE_TITLE := WIZnet WizFi630S + MTK_SOC := mt7628an + IMAGE_SIZE := 32448k + DEVICE_VENDOR := WIZnet + DEVICE_MODEL := WizFi630S endef TARGET_DEVICES += wiznet_wizfi630s -define Device/wrtnode2p - DTS := WRTNODE2P - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := WRTnode 2P +define Device/wrtnode_wrtnode2p + MTK_SOC := mt7628an + IMAGE_SIZE := 32448k + DEVICE_VENDOR := WRTnode + DEVICE_MODEL := WRTnode 2P DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += wrtnode2p endef -TARGET_DEVICES += wrtnode2p +TARGET_DEVICES += wrtnode_wrtnode2p -define Device/wrtnode2r - DTS := WRTNODE2R - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := WRTnode 2R +define Device/wrtnode_wrtnode2r + MTK_SOC := mt7628an + IMAGE_SIZE := 32448k + DEVICE_VENDOR := WRTnode + DEVICE_MODEL := WRTnode 2R DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += wrtnode2r endef -TARGET_DEVICES += wrtnode2r +TARGET_DEVICES += wrtnode_wrtnode2r define Device/xiaomi_mir4a-100m - DTS := XIAOMI-MIR4A-100M + MTK_SOC := mt7628an IMAGE_SIZE := 14976k - DEVICE_TITLE := Xiaomi Mi Router 4A (100M Edition) + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := Mi Router 4A + DEVICE_VARIANT := 100M Edition DEVICE_PACKAGES := kmod-mt76x2 endef TARGET_DEVICES += xiaomi_mir4a-100m +define Device/xiaomi_miwifi-nano + MTK_SOC := mt7628an + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := MiWiFi Nano + DEVICE_PACKAGES := uboot-envtools + SUPPORTED_DEVICES += miwifi-nano +endef +TARGET_DEVICES += xiaomi_miwifi-nano + define Device/zbtlink_zbt-we1226 - DTS := ZBT-WE1226 - IMAGE_SIZE := $(ralink_default_fw_size_8M) - DEVICE_TITLE := ZBTlink ZBT-WE1226 + MTK_SOC := mt7628an + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WE1226 endef TARGET_DEVICES += zbtlink_zbt-we1226 define Device/zyxel_keenetic-extra-ii - DTS := ki_rb + MTK_SOC := mt7628an IMAGE_SIZE := 14912k BLOCKSIZE := 64k - DEVICE_TITLE := ZyXEL Keenetic Extra II + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := Keenetic Extra II DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to $$$$(BLOCKSIZE) | \ diff --git a/target/linux/ramips/image/rt288x.mk b/target/linux/ramips/image/rt288x.mk index c7f7d064f..460df2853 100644 --- a/target/linux/ramips/image/rt288x.mk +++ b/target/linux/ramips/image/rt288x.mk @@ -9,32 +9,84 @@ define Build/gemtek-header fi endef -define Device/ar670w - DTS := AR670W +define Device/airlink101_ar670w + MTK_SOC := rt2880 BLOCKSIZE := 64k - DEVICE_TITLE := Airlink AR670W - IMAGE_SIZE := $(ralink_default_fw_size_4M) + DEVICE_VENDOR := Airlink + DEVICE_MODEL := AR670W + IMAGE_SIZE := 3840k KERNEL := $(KERNEL_DTB) | pad-to $$(BLOCKSIZE) IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ wrg-header wrgn16a_airlink_ar670w + SUPPORTED_DEVICES += ar670w endef -TARGET_DEVICES += ar670w +TARGET_DEVICES += airlink101_ar670w -define Device/ar725w - DTS := AR725W - DEVICE_TITLE := Airlink AR725W +define Device/airlink101_ar725w + MTK_SOC := rt2880 + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Airlink + DEVICE_MODEL := AR725W IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | check-size 3328k | \ gemtek-header ar725w + SUPPORTED_DEVICES += ar725w endef -TARGET_DEVICES += ar725w +TARGET_DEVICES += airlink101_ar725w + +define Device/asus_rt-n15 + MTK_SOC := rt2880 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Asus + DEVICE_MODEL := RT-N15 + DEVICE_PACKAGES := kmod-switch-rtl8366s + SUPPORTED_DEVICES += rt-n15 +endef +TARGET_DEVICES += asus_rt-n15 + +define Device/belkin_f5d8235-v1 + MTK_SOC := rt2880 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Belkin + DEVICE_MODEL := F5D8235 + DEVICE_VARIANT := V1 + DEVICE_PACKAGES := kmod-switch-rtl8366s kmod-usb-ohci \ + kmod-usb-ohci-pci kmod-usb2 kmod-usb2-pci kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += f5d8235-v1 +endef +TARGET_DEVICES += belkin_f5d8235-v1 + +define Device/buffalo_wli-tx4-ag300n + MTK_SOC := rt2880 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WLI-TX4-AG300N + DEVICE_PACKAGES := kmod-switch-ip17xx + SUPPORTED_DEVICES += wli-tx4-ag300n +endef +TARGET_DEVICES += buffalo_wli-tx4-ag300n + +define Device/buffalo_wzr-agl300nh + MTK_SOC := rt2880 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WZR-AGL300NH + DEVICE_PACKAGES := kmod-switch-rtl8366s + SUPPORTED_DEVICES += wzr-agl300nh +endef +TARGET_DEVICES += buffalo_wzr-agl300nh define Device/dlink_dap-1522-a1 - DTS := DAP-1522-A1 + MTK_SOC := rt2880 BLOCKSIZE := 64k - IMAGE_SIZE := 3801088 - DEVICE_TITLE := D-Link DAP-1522 A1 + IMAGE_SIZE := 3712k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DAP-1522 + DEVICE_VARIANT := A1 DEVICE_PACKAGES := kmod-switch-rtl8366s KERNEL := $(KERNEL_DTB) IMAGES += factory.bin @@ -46,46 +98,12 @@ define Device/dlink_dap-1522-a1 endef TARGET_DEVICES += dlink_dap-1522-a1 -define Device/f5d8235-v1 - DTS := F5D8235_V1 - IMAGE_SIZE := 7744k - DEVICE_TITLE := Belkin F5D8235 V1 - DEVICE_PACKAGES := kmod-switch-rtl8366s kmod-usb-core kmod-usb-ohci \ - kmod-usb-ohci-pci kmod-usb2 kmod-usb2-pci kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += f5d8235-v1 - -define Device/rt-n15 - DTS := RT-N15 +define Device/ralink_v11st-fe + MTK_SOC := rt2880 BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Asus RT-N15 - DEVICE_PACKAGES := kmod-switch-rtl8366s + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Ralink + DEVICE_MODEL := V11ST-FE + SUPPORTED_DEVICES += v11st-fe endef -TARGET_DEVICES += rt-n15 - -define Device/v11st-fe - DTS := V11STFE - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Ralink V11ST-FE -endef -TARGET_DEVICES += v11st-fe - -define Device/wli-tx4-ag300n - DTS := WLI-TX4-AG300N - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Buffalo WLI-TX4-AG300N - DEVICE_PACKAGES := kmod-switch-ip17xx -endef -TARGET_DEVICES += wli-tx4-ag300n - -define Device/wzr-agl300nh - DTS := WZR-AGL300NH - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Buffalo WZR-AGL300NH - DEVICE_PACKAGES := kmod-switch-rtl8366s -endef -TARGET_DEVICES += wzr-agl300nh +TARGET_DEVICES += ralink_v11st-fe diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk index f59a74894..fac2a689a 100644 --- a/target/linux/ramips/image/rt305x.mk +++ b/target/linux/ramips/image/rt305x.mk @@ -21,294 +21,443 @@ define Build/hilink-header mv $@.new $@ endef - -define Device/3g150b - DTS := 3G150B - BLOCKSIZE := 4k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - UIMAGE_NAME:= Linux Kernel Image - DEVICE_TITLE := Tenda 3G150B - DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport +define Device/7links_px-4885-4m + MTK_SOC := rt5350 + IMAGE_SIZE := 3776k + DEVICE_VENDOR := 7Links + DEVICE_MODEL := PX-4885 + DEVICE_VARIANT := 4M + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \ + kmod-usb-ledtrig-usbport kmod-leds-gpio + SUPPORTED_DEVICES += px-4885-4M endef -TARGET_DEVICES += 3g150b +TARGET_DEVICES += 7links_px-4885-4m -define Device/3g300m - DTS := 3G300M - IMAGE_SIZE := $(ralink_default_fw_size_4M) - UIMAGE_NAME := 3G150M_SPI Kernel Image - DEVICE_TITLE := Tenda 3G300M - DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport +define Device/7links_px-4885-8m + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := 7Links + DEVICE_MODEL := PX-4885 + DEVICE_VARIANT := 8M + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \ + kmod-usb-ledtrig-usbport kmod-leds-gpio + SUPPORTED_DEVICES += px-4885-8M endef -TARGET_DEVICES += 3g300m +TARGET_DEVICES += 7links_px-4885-8m -define Device/3g-6200n - DTS := 3G-6200N - IMAGE_SIZE := 3648k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ - edimax-header -s CSYS -m 3G62 -f 0x50000 -S 0x01100000 | pad-rootfs | \ - append-metadata | check-size $$$$(IMAGE_SIZE) - DEVICE_TITLE := Edimax 3g-6200n -endef -TARGET_DEVICES += 3g-6200n - -define Device/3g-6200nl - DTS := 3G-6200NL - IMAGE_SIZE := 3648k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ - edimax-header -s CSYS -m 3G62 -f 0x50000 -S 0x01100000 | pad-rootfs | \ - append-metadata | check-size $$$$(IMAGE_SIZE) - DEVICE_TITLE := Edimax 3g-6200nl -endef -TARGET_DEVICES += 3g-6200nl - -define Device/a5-v11 - DTS := A5-V11 - IMAGE_SIZE := $(ralink_default_fw_size_4M) - IMAGES += factory.bin - IMAGE/factory.bin := \ - $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B A5-V11 -F 4M - DEVICE_TITLE := A5-V11 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 - DEFAULT := n -endef -TARGET_DEVICES += a5-v11 - -define Device/air3gii - DTS := AIR3GII - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := AirLive Air3GII -endef -TARGET_DEVICES += air3gii - -define Device/all0256n-4M - DTS := ALL0256N-4M - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Allnet ALL0256N (4MB) - DEVICE_PACKAGES := rssileds -endef -TARGET_DEVICES += all0256n-4M - -define Device/all0256n-8M - DTS := ALL0256N-8M - DEVICE_TITLE := Allnet ALL0256N (8MB) - DEVICE_PACKAGES := rssileds -endef -TARGET_DEVICES += all0256n-8M - -define Device/all5002 - DTS := ALL5002 - IMAGE_SIZE := 32448k - DEVICE_TITLE := Allnet ALL5002 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ - kmod-i2c-core kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x -endef -TARGET_DEVICES += all5002 - -define Device/all5003 - DTS := ALL5003 - IMAGE_SIZE := 32448k - DEVICE_TITLE := Allnet ALL5003 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ - kmod-i2c-core kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x -endef -TARGET_DEVICES += all5003 - -define Device/asl26555-8M - DTS := ASL26555-8M - IMAGE_SIZE := 7744k - SUPPORTED_DEVICES += asl26555 - DEVICE_TITLE := Alpha ASL26555 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += asl26555-8M - -define Device/asl26555-16M - DTS := ASL26555-16M - IMAGE_SIZE := 15872k - SUPPORTED_DEVICES += asl26555 - DEVICE_TITLE := Alpha ASL26555 16M - DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += asl26555-16M - -define Device/atp-52b - DTS := ATP-52B - IMAGE_SIZE := 7808k - DEVICE_TITLE := Argus ATP-52B -endef -TARGET_DEVICES += atp-52b - -define Device/awm002-evb-4M - DTS := AWM002-EVB-4M - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := AsiaRF AWM002-EVB (4M) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \ - kmod-i2c-core kmod-i2c-gpio -endef -TARGET_DEVICES += awm002-evb-4M - -define Device/awm002-evb-8M - DTS := AWM002-EVB-8M - DEVICE_TITLE := AsiaRF AWM002-EVB (8M)/AsiaRF AWM003 EVB - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \ - kmod-i2c-core kmod-i2c-gpio -endef -TARGET_DEVICES += awm002-evb-8M - -define Device/awapn2403 - DTS := AWAPN2403 - BLOCKSIZE := 4k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := AsiaRF AWAPN2403 -endef -TARGET_DEVICES += awapn2403 - -define Device/bc2 - DTS := BC2 - DEVICE_TITLE := NexAira BC2 -endef -TARGET_DEVICES += bc2 - -define Device/broadway - DTS := BROADWAY - IMAGE_SIZE := 7744k - UIMAGE_NAME:= Broadway Kernel Image - DEVICE_TITLE := Hauppauge Broadway - DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += broadway - -define Device/carambola - DTS := CARAMBOLA - DEVICE_TITLE := 8devices Carambola +define Device/8devices_carambola + MTK_SOC := rt3050 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := 8devices + DEVICE_MODEL := Carambola DEVICE_PACKAGES := + SUPPORTED_DEVICES += carambola endef -TARGET_DEVICES += carambola +TARGET_DEVICES += 8devices_carambola -define Device/d105 - DTS := D105 +define Device/accton_wr6202 + MTK_SOC := rt3052 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Accton + DEVICE_MODEL := WR6202 + SUPPORTED_DEVICES += wr6202 +endef +TARGET_DEVICES += accton_wr6202 + +define Device/airlive_air3gii + MTK_SOC := rt5350 BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Huawei D105 + IMAGE_SIZE := 3776k + DEVICE_VENDOR := AirLive + DEVICE_MODEL := Air3GII + SUPPORTED_DEVICES += air3gii endef -TARGET_DEVICES += d105 +TARGET_DEVICES += airlive_air3gii -define Device/dap-1350 - DTS := DAP-1350 +define Device/alfa-network_w502u + MTK_SOC := rt3052 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := ALFA + DEVICE_MODEL := Networks W502U + SUPPORTED_DEVICES += w502u +endef +TARGET_DEVICES += alfa-network_w502u + +define Device/allnet_all0256n-4m + MTK_SOC := rt3050 + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Allnet + DEVICE_MODEL := ALL0256N + DEVICE_VARIANT := 4M + DEVICE_PACKAGES := rssileds + SUPPORTED_DEVICES += all0256n-4M +endef +TARGET_DEVICES += allnet_all0256n-4m + +define Device/allnet_all0256n-8m + MTK_SOC := rt3050 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Allnet + DEVICE_MODEL := ALL0256N + DEVICE_VARIANT := 8M + DEVICE_PACKAGES := rssileds + SUPPORTED_DEVICES += all0256n-8M +endef +TARGET_DEVICES += allnet_all0256n-8m + +define Device/allnet_all5002 + MTK_SOC := rt3352 + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Allnet + DEVICE_MODEL := ALL5002 + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ + kmod-i2c-core kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x + SUPPORTED_DEVICES += all5002 +endef +TARGET_DEVICES += allnet_all5002 + +define Device/allnet_all5003 + MTK_SOC := rt5350 + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Allnet + DEVICE_MODEL := ALL5003 + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ + kmod-i2c-core kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x + SUPPORTED_DEVICES += all5003 +endef +TARGET_DEVICES += allnet_all5003 + +define Device/alphanetworks_asl26555-16m + MTK_SOC := rt3050 + IMAGE_SIZE := 15872k + DEVICE_VENDOR := Alpha + DEVICE_MODEL := ASL26555 + DEVICE_VARIANT := 16M + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += asl26555 asl26555-16M +endef +TARGET_DEVICES += alphanetworks_asl26555-16m + +define Device/alphanetworks_asl26555-8m + MTK_SOC := rt3050 + IMAGE_SIZE := 7744k + DEVICE_VENDOR := Alpha + DEVICE_MODEL := ASL26555 + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += asl26555 asl26555-8M +endef +TARGET_DEVICES += alphanetworks_asl26555-8m + +define Device/arcwireless_freestation5 + MTK_SOC := rt3050 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := ARC Wireless + DEVICE_MODEL := FreeStation + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-rt2500-usb kmod-rt2800-usb kmod-rt2x00-usb + SUPPORTED_DEVICES += freestation5 +endef +TARGET_DEVICES += arcwireless_freestation5 + +define Device/argus_atp-52b + MTK_SOC := rt3052 + IMAGE_SIZE := 7808k + DEVICE_VENDOR := Argus + DEVICE_MODEL := ATP-52B + SUPPORTED_DEVICES += atp-52b +endef +TARGET_DEVICES += argus_atp-52b + +define Device/asiarf_awapn2403 + MTK_SOC := rt3052 + BLOCKSIZE := 4k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := AsiaRF + DEVICE_MODEL := AWAPN2403 + SUPPORTED_DEVICES += awapn2403 +endef +TARGET_DEVICES += asiarf_awapn2403 + +define Device/asiarf_awm002-evb-4m + MTK_SOC := rt5350 + IMAGE_SIZE := 3776k + DEVICE_VENDOR := AsiaRF + DEVICE_MODEL := AWM002-EVB + DEVICE_VARIANT := 4M + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 \ + kmod-i2c-core kmod-i2c-gpio + SUPPORTED_DEVICES += awm002-evb-4M +endef +TARGET_DEVICES += asiarf_awm002-evb-4m + +define Device/asiarf_awm002-evb-8m + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := AsiaRF + DEVICE_MODEL := AWM002-EVB/AWM003-EVB + DEVICE_VARIANT := 8M + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 \ + kmod-i2c-core kmod-i2c-gpio + SUPPORTED_DEVICES += awm002-evb-8M +endef +TARGET_DEVICES += asiarf_awm002-evb-8m + +define Device/asus_rt-g32-b1 + MTK_SOC := rt3050 + BLOCKSIZE := 4k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Asus + DEVICE_MODEL := RT-G32 + DEVICE_VARIANT := B1 + SUPPORTED_DEVICES += rt-g32-b1 +endef +TARGET_DEVICES += asus_rt-g32-b1 + +define Device/asus_rt-n10-plus + MTK_SOC := rt3050 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Asus + DEVICE_MODEL := RT-N10+ + SUPPORTED_DEVICES += rt-n10-plus +endef +TARGET_DEVICES += asus_rt-n10-plus + +define Device/asus_rt-n13u + MTK_SOC := rt3052 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Asus + DEVICE_MODEL := RT-N13U + DEVICE_PACKAGES := kmod-leds-gpio kmod-rt2800-pci kmod-usb-dwc2 + SUPPORTED_DEVICES += rt-n13u +endef +TARGET_DEVICES += asus_rt-n13u + +define Device/asus_wl-330n + MTK_SOC := rt3050 + BLOCKSIZE := 4k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Asus + DEVICE_MODEL := WL-330N + SUPPORTED_DEVICES += wl-330n +endef +TARGET_DEVICES += asus_wl-330n + +define Device/asus_wl-330n3g + MTK_SOC := rt3050 + BLOCKSIZE := 4k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Asus + DEVICE_MODEL := WL-330N3G + DEVICE_PACKAGES := + SUPPORTED_DEVICES += wl-330n3g +endef +TARGET_DEVICES += asus_wl-330n3g + +define Device/aximcom_mr-102n + MTK_SOC := rt3052 + IMAGE_SIZE := 7744k + DEVICE_VENDOR := AXIMCom + DEVICE_MODEL := MR-102N + SUPPORTED_DEVICES += mr-102n +endef +TARGET_DEVICES += aximcom_mr-102n + +define Device/aztech_hw550-3g + MTK_SOC := rt3052 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Aztech + DEVICE_MODEL := HW550-3G + DEVICE_ALT0_VENDOR := Allnet + DEVICE_ALT0_MODEL := ALL0239-3G + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += hw550-3g +endef +TARGET_DEVICES += aztech_hw550-3g + +define Device/belkin_f5d8235-v2 + MTK_SOC := rt3052 + IMAGE_SIZE := 7744k + DEVICE_VENDOR := Belkin + DEVICE_MODEL := F5D8235 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-switch-rtl8366rb + SUPPORTED_DEVICES += f5d8235-v2 +endef +TARGET_DEVICES += belkin_f5d8235-v2 + +define Device/belkin_f7c027 + MTK_SOC := rt5350 + IMAGE_SIZE := 7616k + DEVICE_VENDOR := Belkin + DEVICE_MODEL := F7C027 + DEVICE_PACKAGES := --kmod-usb-dwc2 -kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += f7c027 +endef +TARGET_DEVICES += belkin_f7c027 + +define Device/buffalo_whr-g300n + MTK_SOC := rt3052 + BLOCKSIZE := 64k + IMAGE_SIZE := 3712k + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WHR-G300N + IMAGES += tftp.bin + IMAGE/tftp.bin := $$(sysupgrade_bin) | \ + check-size $$$$(IMAGE_SIZE) | buffalo-tftp-header + SUPPORTED_DEVICES += whr-g300n +endef +TARGET_DEVICES += buffalo_whr-g300n + +define Device/dlink_dap-1350 + MTK_SOC := rt3052 IMAGES += factory.bin factory-NA.bin IMAGE_SIZE := 7488k IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ dap-header -s RT3052-AP-DAP1350WW-3 IMAGE/factory-NA.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ dap-header -s RT3052-AP-DAP1350-3 - DEVICE_TITLE := D-Link DAP-1350 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DAP-1350 + SUPPORTED_DEVICES += dap-1350 endef -TARGET_DEVICES += dap-1350 +TARGET_DEVICES += dlink_dap-1350 -define Device/dcs-930 - DTS := DCS-930 - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := D-Link DCS-930 - DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core kmod-usb-audio kmod-usb-core kmod-usb-dwc2 +define Device/dlink_dcs-930 + MTK_SOC := rt3050 + IMAGE_SIZE := 3776k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DCS-930 + DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core kmod-usb-audio kmod-usb-dwc2 + SUPPORTED_DEVICES += dcs-930 endef -TARGET_DEVICES += dcs-930 +TARGET_DEVICES += dlink_dcs-930 -define Device/dcs-930l-b1 - DTS := DCS-930L-B1 - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := D-Link DCS-930L B1 - DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core kmod-usb-audio kmod-usb-core kmod-usb-ohci kmod-usb2 +define Device/dlink_dcs-930l-b1 + MTK_SOC := rt5350 + IMAGE_SIZE := 3776k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DCS-930L + DEVICE_VARIANT := B1 + DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core kmod-usb-audio kmod-usb-ohci kmod-usb2 + SUPPORTED_DEVICES += dcs-930l-b1 endef -TARGET_DEVICES += dcs-930l-b1 +TARGET_DEVICES += dlink_dcs-930l-b1 -define Device/dir-300-b1 - DTS := DIR-300-B1 - IMAGE_SIZE := $(ralink_default_fw_size_4M) +define Device/dlink_dir-300-b1 + MTK_SOC := rt3050 + IMAGE_SIZE := 3776k IMAGES += factory.bin IMAGE/factory.bin := \ $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | wrg-header wrgn23_dlwbr_dir300b - DEVICE_TITLE := D-Link DIR-300 B1 - DEFAULT := n + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-300 + DEVICE_VARIANT := B1 + SUPPORTED_DEVICES += dir-300-b1 endef -TARGET_DEVICES += dir-300-b1 +TARGET_DEVICES += dlink_dir-300-b1 -define Device/dir-300-b7 - DTS := DIR-300-B7 +define Device/dlink_dir-300-b7 + MTK_SOC := rt5350 BLOCKSIZE := 4k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := D-Link DIR-300 B7 - DEFAULT := n + IMAGE_SIZE := 7872k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-300 + DEVICE_VARIANT := B7 + SUPPORTED_DEVICES += dir-300-b7 endef -TARGET_DEVICES += dir-300-b7 +TARGET_DEVICES += dlink_dir-300-b7 -define Device/dir-320-b1 - DTS := DIR-320-B1 - DEVICE_TITLE := D-Link DIR-320 B1 +define Device/dlink_dir-320-b1 + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-320 + DEVICE_VARIANT := B1 + SUPPORTED_DEVICES += dir-320-b1 endef -TARGET_DEVICES += dir-320-b1 +TARGET_DEVICES += dlink_dir-320-b1 -define Device/dir-600-b1 - DTS := DIR-600-B1 - IMAGE_SIZE := $(ralink_default_fw_size_4M) - SUPPORTED_DEVICES := dir-600-b1 dir-600-b2 +define Device/dlink_dir-600-b1 + MTK_SOC := rt3050 + IMAGE_SIZE := 3776k IMAGES += factory.bin IMAGE/factory.bin := \ $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | wrg-header wrgn23_dlwbr_dir600b - DEVICE_TITLE := D-Link DIR-600 B1/B2 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-600 + DEVICE_VARIANT := B1/B2 + SUPPORTED_DEVICES += dir-600-b1 dir-600-b2 endef -TARGET_DEVICES += dir-600-b1 +TARGET_DEVICES += dlink_dir-600-b1 -define Device/dir-610-a1 +define Device/dlink_dir-610-a1 $(Device/seama) - DTS := DIR-610-A1 + MTK_SOC := rt5350 BLOCKSIZE := 4k SEAMA_SIGNATURE := wrgn59_dlob.hans_dir610 KERNEL := $(KERNEL_DTB) - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := D-Link DIR-610 A1 + IMAGE_SIZE := 3776k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-610 + DEVICE_VARIANT := A1 DEVICE_PACKAGES := kmod-ledtrig-netdev kmod-ledtrig-timer + SUPPORTED_DEVICES += dir-610-a1 endef -TARGET_DEVICES += dir-610-a1 +TARGET_DEVICES += dlink_dir-610-a1 -define Device/dir-615-d - DTS := DIR-615-D - IMAGE_SIZE := $(ralink_default_fw_size_4M) +define Device/dlink_dir-615-d + MTK_SOC := rt3050 + IMAGE_SIZE := 3776k IMAGES += factory.bin IMAGE/factory.bin := \ $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | wrg-header wrgn23_dlwbr_dir615d - DEVICE_TITLE := D-Link DIR-615 D + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-615 + DEVICE_VARIANT := D + SUPPORTED_DEVICES += dir-615-d endef -TARGET_DEVICES += dir-615-d +TARGET_DEVICES += dlink_dir-615-d - -define Device/dir-615-h1 - DTS := DIR-615-H1 +define Device/dlink_dir-615-h1 + MTK_SOC := rt3352 BLOCKSIZE := 4k IMAGES += factory.bin - IMAGE_SIZE := $(ralink_default_fw_size_4M) + IMAGE_SIZE := 3776k IMAGE/factory.bin := \ $$(sysupgrade_bin) | senao-header -r 0x218 -p 0x30 -t 3 - DEVICE_TITLE := D-Link DIR-615 H1 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-615 + DEVICE_VARIANT := H1 + SUPPORTED_DEVICES += dir-615-h1 endef -TARGET_DEVICES += dir-615-h1 +TARGET_DEVICES += dlink_dir-615-h1 -define Device/dir-620-a1 - DTS := DIR-620-A1 - DEVICE_TITLE := D-Link DIR-620 A1 +define Device/dlink_dir-620-a1 + MTK_SOC := rt3050 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-620 + DEVICE_VARIANT := A1 + SUPPORTED_DEVICES += dir-620-a1 endef -TARGET_DEVICES += dir-620-a1 +TARGET_DEVICES += dlink_dir-620-a1 -define Device/dir-620-d1 - DTS := DIR-620-D1 - DEVICE_TITLE := D-Link DIR-620 D1 +define Device/dlink_dir-620-d1 + MTK_SOC := rt3352 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-620 + DEVICE_VARIANT := D1 + SUPPORTED_DEVICES += dir-620-d1 endef -TARGET_DEVICES += dir-620-d1 +TARGET_DEVICES += dlink_dir-620-d1 -define Device/dwr-512-b - DTS := DWR-512-B - IMAGE_SIZE := 7800k - DEVICE_TITLE := D-Link DWR-512 B +define Device/dlink_dwr-512-b + MTK_SOC := rt5350 + IMAGE_SIZE := 8064k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DWR-512 + DEVICE_VARIANT := B DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-spi-dev kmod-usb-serial \ kmod-usb-serial-option kmod-usb-net kmod-usb-net-cdc-ether \ comgt-ncm @@ -319,609 +468,726 @@ define Device/dwr-512-b IMAGES += factory.bin IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory + SUPPORTED_DEVICES += dwr-512-b endef -TARGET_DEVICES += dwr-512-b +TARGET_DEVICES += dlink_dwr-512-b -define Device/esr-9753 - DTS := ESR-9753 +define Device/easyacc_wizard-8800 + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + UIMAGE_NAME:= Linux Kernel Image + DEVICE_VENDOR := EasyAcc + DEVICE_MODEL := WIZARD 8800 + SUPPORTED_DEVICES += wizard8800 +endef +TARGET_DEVICES += easyacc_wizard-8800 + +define Device/edimax_3g-6200n + MTK_SOC := rt3050 + IMAGE_SIZE := 3648k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + edimax-header -s CSYS -m 3G62 -f 0x50000 -S 0x01100000 | pad-rootfs | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + DEVICE_VENDOR := Edimax + DEVICE_MODEL := 3g-6200n + SUPPORTED_DEVICES += 3g-6200n +endef +TARGET_DEVICES += edimax_3g-6200n + +define Device/edimax_3g-6200nl + MTK_SOC := rt3050 + IMAGE_SIZE := 3648k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + edimax-header -s CSYS -m 3G62 -f 0x50000 -S 0x01100000 | pad-rootfs | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + DEVICE_VENDOR := Edimax + DEVICE_MODEL := 3g-6200nl + SUPPORTED_DEVICES += 3g-6200nl +endef +TARGET_DEVICES += edimax_3g-6200nl + +define Device/engenius_esr-9753 + MTK_SOC := rt3052 BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := EnGenius ESR-9753 + IMAGE_SIZE := 3776k + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := ESR-9753 + SUPPORTED_DEVICES += esr-9753 endef -TARGET_DEVICES += esr-9753 +TARGET_DEVICES += engenius_esr-9753 -define Device/f5d8235-v2 - DTS := F5D8235_V2 - IMAGE_SIZE := 7744k - DEVICE_TITLE := Belkin F5D8235 v2 - DEVICE_PACKAGES := kmod-switch-rtl8366rb -endef -TARGET_DEVICES += f5d8235-v2 - -define Device/f7c027 - DTS := F7C027 - IMAGE_SIZE := 7616k - DEVICE_TITLE := Belkin F7C027 - DEVICE_PACKAGES := -kmod-usb-core -kmod-usb-dwc2 -kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += f7c027 - -define Device/fonera20n - DTS := FONERA20N +define Device/fon_fonera-20n + MTK_SOC := rt3052 + IMAGE_SIZE := 7872k IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | \ edimax-header -s RSDK -m NL1T -f 0x50000 -S 0xc0000 - DEVICE_TITLE := Fonera 2.0N - DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport + DEVICE_VENDOR := Fon + DEVICE_MODEL := Fonera 2.0N + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += fonera20n endef -TARGET_DEVICES += fonera20n +TARGET_DEVICES += fon_fonera-20n -define Device/freestation5 - DTS := FREESTATION5 - DEVICE_TITLE := ARC Wireless FreeStation - DEVICE_PACKAGES := kmod-usb-dwc2 kmod-rt2500-usb kmod-rt2800-usb kmod-rt2x00-usb +define Device/hame_mpr-a1 + MTK_SOC := rt5350 + BLOCKSIZE := 4k + IMAGE_SIZE := 3776k + UIMAGE_NAME:= Linux Kernel Image + DEVICE_VENDOR := HAME + DEVICE_MODEL := MPR + DEVICE_VARIANT := A1 + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev + SUPPORTED_DEVICES += mpr-a1 endef -TARGET_DEVICES += freestation5 +TARGET_DEVICES += hame_mpr-a1 -define Device/hg255d - DTS := HG255D - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := HuaWei HG255D +define Device/hame_mpr-a2 + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + UIMAGE_NAME:= Linux Kernel Image + DEVICE_VENDOR := HAME + DEVICE_MODEL := MPR + DEVICE_VARIANT := A2 + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev + SUPPORTED_DEVICES += mpr-a2 endef -TARGET_DEVICES += hg255d +TARGET_DEVICES += hame_mpr-a2 -define Device/hlk-rm04 - DTS := HLKRM04 +define Device/hauppauge_broadway + MTK_SOC := rt3052 + IMAGE_SIZE := 7744k + UIMAGE_NAME:= Broadway Kernel Image + DEVICE_VENDOR := Hauppauge + DEVICE_MODEL := Broadway + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += broadway +endef +TARGET_DEVICES += hauppauge_broadway + +define Device/hilink_hlk-rm04 + MTK_SOC := rt5350 + IMAGE_SIZE := 3776k IMAGES += factory.bin IMAGE/factory.bin := \ $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | hilink-header - DEVICE_TITLE := Hi-Link HLK-RM04 + DEVICE_VENDOR := Hi-Link + DEVICE_MODEL := HLK-RM04 + SUPPORTED_DEVICES += hlk-rm04 endef -TARGET_DEVICES += hlk-rm04 +TARGET_DEVICES += hilink_hlk-rm04 -define Device/ht-tm02 - DTS := HT-TM02 - DEVICE_TITLE := HooToo HT-TM02 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport +define Device/hootoo_ht-tm02 + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := HooToo + DEVICE_MODEL := HT-TM02 + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += ht-tm02 endef -TARGET_DEVICES += ht-tm02 +TARGET_DEVICES += hootoo_ht-tm02 -define Device/hw550-3g - DTS := HW550-3G - DEVICE_TITLE := Aztech HW550-3G - DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport +define Device/huawei_d105 + MTK_SOC := rt3050 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Huawei + DEVICE_MODEL := D105 + SUPPORTED_DEVICES += d105 endef -TARGET_DEVICES += hw550-3g +TARGET_DEVICES += huawei_d105 -define Device/ip2202 - DTS := IP2202 - DEVICE_TITLE := Poray IP2202 +define Device/huawei_hg255d + MTK_SOC := rt3052 + IMAGE_SIZE := 15744k + DEVICE_VENDOR := HuaWei + DEVICE_MODEL := HG255D + SUPPORTED_DEVICES += hg255d endef -TARGET_DEVICES += ip2202 +TARGET_DEVICES += huawei_hg255d -define Device/jhr-n805r - DTS := JHR-N805R - IMAGE_SIZE := $(ralink_default_fw_size_4M) +define Device/intenso_memory2move + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + UIMAGE_NAME:= Linux Kernel Image + DEVICE_VENDOR := Intenso + DEVICE_MODEL := Memory 2 Move + DEVICE_PACKAGES := kmod-ledtrig-netdev kmod-ledtrig-timer \ + kmod-usb2 kmod-usb-storage kmod-scsi-core \ + kmod-fs-ext4 kmod-fs-vfat block-mount + SUPPORTED_DEVICES += m2m +endef +TARGET_DEVICES += intenso_memory2move + +define Device/jcg_jhr-n805r + MTK_SOC := rt3050 + IMAGE_SIZE := 3776k IMAGES += factory.bin IMAGE/factory.bin := \ $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | jcg-header 29.24 - DEVICE_TITLE := JCG JHR-N805R + DEVICE_VENDOR := JCG + DEVICE_MODEL := JHR-N805R + SUPPORTED_DEVICES += jhr-n805r endef -TARGET_DEVICES += jhr-n805r +TARGET_DEVICES += jcg_jhr-n805r -define Device/jhr-n825r - DTS := JHR-N825R - IMAGE_SIZE := $(ralink_default_fw_size_4M) +define Device/jcg_jhr-n825r + MTK_SOC := rt3052 + IMAGE_SIZE := 3776k IMAGES += factory.bin IMAGE/factory.bin := \ $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | jcg-header 23.24 - DEVICE_TITLE := JCG JHR-N825R + DEVICE_VENDOR := JCG + DEVICE_MODEL := JHR-N825R + SUPPORTED_DEVICES += jhr-n825r endef -TARGET_DEVICES += jhr-n825r +TARGET_DEVICES += jcg_jhr-n825r -define Device/jhr-n926r - DTS := JHR-N926R - IMAGE_SIZE := $(ralink_default_fw_size_4M) +define Device/jcg_jhr-n926r + MTK_SOC := rt3052 + IMAGE_SIZE := 3776k IMAGES += factory.bin IMAGE/factory.bin := \ $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | jcg-header 25.24 - DEVICE_TITLE := JCG JHR-N926R + DEVICE_VENDOR := JCG + DEVICE_MODEL := JHR-N926R + SUPPORTED_DEVICES += jhr-n926r endef -TARGET_DEVICES += jhr-n926r +TARGET_DEVICES += jcg_jhr-n926r -define Device/m2m - DTS := M2M - UIMAGE_NAME:= Linux Kernel Image - DEVICE_TITLE := Intenso Memory 2 Move - DEVICE_PACKAGES := kmod-ledtrig-netdev kmod-ledtrig-timer \ - kmod-usb-core kmod-usb2 kmod-usb-storage kmod-scsi-core \ - kmod-fs-ext4 kmod-fs-vfat block-mount -endef -TARGET_DEVICES += m2m - -define Device/m3 - DTS := M3 - IMAGE_SIZE := $(ralink_default_fw_size_4M) - IMAGES += factory.bin - IMAGE/factory.bin := \ - $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B M3 -F 4M - DEVICE_TITLE := Poray M3 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-netdev \ - kmod-ledtrig-timer -endef -TARGET_DEVICES += m3 - -define Device/m4-4M - DTS := M4-4M - IMAGE_SIZE := $(ralink_default_fw_size_4M) - IMAGES += factory.bin - IMAGE/factory.bin := \ - $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B M4 -F 4M - DEVICE_TITLE := Poray M4 (4MB) - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-netdev \ - kmod-ledtrig-timer -endef -TARGET_DEVICES += m4-4M - -define Device/m4-8M - DTS := M4-8M - IMAGES += factory.bin - IMAGE/factory.bin := \ - $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B M4 -F 8M - DEVICE_TITLE := Poray M4 (8MB) - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer -endef -TARGET_DEVICES += m4-8M - -define Device/miniembplug - DTS := MINIEMBPLUG - DEVICE_TITLE := Omnima MiniEMBPlug -endef -TARGET_DEVICES += miniembplug - -define Device/miniembwifi - DTS := MINIEMBWIFI - DEVICE_TITLE := Omnima MiniEMBWiFi -endef -TARGET_DEVICES += miniembwifi - -define Device/mofi3500-3gn - DTS := MOFI3500-3GN - DEVICE_TITLE := MoFi Network MOFI3500-3GN -endef -TARGET_DEVICES += mofi3500-3gn - -define Device/mpr-a1 - DTS := MPRA1 - BLOCKSIZE := 4k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - UIMAGE_NAME:= Linux Kernel Image - DEVICE_TITLE := HAME MPR-A1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev -endef -TARGET_DEVICES += mpr-a1 - -define Device/mpr-a2 - DTS := MPRA2 - UIMAGE_NAME:= Linux Kernel Image - DEVICE_TITLE := HAME MPR-A2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev -endef -TARGET_DEVICES += mpr-a2 - -define Device/mr-102n - DTS := MR-102N - DEVICE_TITLE := AXIMCom MR-102N -endef -TARGET_DEVICES += mr-102n - -define Device/mzk-dp150n - DTS := MZK-DP150N - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Planex MZK-DP150N - DEVICE_PACKAGES := kmod-spi-dev -endef -TARGET_DEVICES += mzk-dp150n - -define Device/mzk-w300nh2 - DTS := MZK-W300NH2 - IMAGE_SIZE := 3648k - IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | \ - edimax-header -s CSYS -m RN52 -f 0x50000 -S 0xc0000 - DEVICE_TITLE := Planex MZK-W300NH2 -endef -TARGET_DEVICES += mzk-w300nh2 - -define Device/mzk-wdpr - DTS := MZK-WDPR - DEVICE_TITLE := Planex MZK-WDPR -endef -TARGET_DEVICES += mzk-wdpr - -define Device/nbg-419n - DTS := NBG-419N - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := ZyXEL NBG-419N -endef -TARGET_DEVICES += nbg-419n - -define Device/nbg-419n2 - DTS := NBG-419N2 - IMAGE_SIZE := $(ralink_default_fw_size_8M) - DEVICE_TITLE := ZyXEL NBG-419N2 -endef -TARGET_DEVICES += nbg-419n2 - -define Device/ncs601w - DTS := NCS601W - DEVICE_TITLE := Wansview NCS601W - DEVICE_PACKAGES := kmod-video-core kmod-video-uvc \ - kmod-usb-core kmod-usb-ohci -endef -TARGET_DEVICES += ncs601w - -define Device/nixcore-x1-8M - DTS := NIXCORE-8M +define Device/mofinetwork_mofi3500-3gn + MTK_SOC := rt3052 IMAGE_SIZE := 7872k - SUPPORTED_DEVICES += nixcore-x1 - DEVICE_TITLE := NixcoreX1 (8M) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev + DEVICE_VENDOR := MoFi Network + DEVICE_MODEL := MOFI3500-3GN + SUPPORTED_DEVICES += mofi3500-3gn endef -TARGET_DEVICES += nixcore-x1-8M +TARGET_DEVICES += mofinetwork_mofi3500-3gn -define Device/nixcore-x1-16M - DTS := NIXCORE-16M - IMAGE_SIZE := 16064k - SUPPORTED_DEVICES += nixcore-x1 - DEVICE_TITLE := NixcoreX1 (16M) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev -endef -TARGET_DEVICES += nixcore-x1-16M - -define Device/nw718 - DTS := NW718 +define Device/netcore_nw718 + MTK_SOC := rt3050 IMAGE_SIZE := 3712k UIMAGE_NAME:= ARA1B4NCRNW718;1 - DEVICE_TITLE := Netcore NW718 + DEVICE_VENDOR := Netcore + DEVICE_MODEL := NW718 + SUPPORTED_DEVICES += nw718 endef -TARGET_DEVICES += nw718 +TARGET_DEVICES += netcore_nw718 -define Device/psr-680w - DTS := PSR-680W - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Petatel PSR-680W Wireless 3G Router -endef -TARGET_DEVICES += psr-680w - -define Device/pwh2004 - DTS := PWH2004 - DEVICE_TITLE := Prolink PWH2004 - DEVICE_PACKAGES := -endef -TARGET_DEVICES += pwh2004 - -define Device/px-4885-4M - DTS := PX-4885-4M - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := 7Links PX-4885 (4M) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \ - kmod-usb-ledtrig-usbport kmod-leds-gpio -endef -TARGET_DEVICES += px-4885-4M - -define Device/px-4885-8M - DTS := PX-4885-8M - DEVICE_TITLE := 7Links PX-4885 (8M) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \ - kmod-usb-ledtrig-usbport kmod-leds-gpio -endef -TARGET_DEVICES += px-4885-8M - -define Device/rt5350f-olinuxino - DTS := RT5350F-OLINUXINO - DEVICE_TITLE := RT5350F-OLinuXino - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \ - kmod-i2c-core kmod-i2c-ralink \ - kmod-spi-dev -endef -TARGET_DEVICES += rt5350f-olinuxino - -define Device/rt5350f-olinuxino-evb - DTS := RT5350F-OLINUXINO-EVB - DEVICE_TITLE := RT5350F-OLinuXino-EVB - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \ - kmod-i2c-core kmod-i2c-ralink \ - kmod-spi-dev -endef -TARGET_DEVICES += rt5350f-olinuxino-evb - -define Device/rt-g32-b1 - DTS := RT-G32-B1 - BLOCKSIZE := 4k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Asus RT-G32 B1 -endef -TARGET_DEVICES += rt-g32-b1 - -define Device/rt-n10-plus - DTS := RT-N10-PLUS - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Asus RT-N10+ - DEFAULT := n -endef -TARGET_DEVICES += rt-n10-plus - -define Device/rt-n13u - DTS := RT-N13U - DEVICE_TITLE := Asus RT-N13U - DEVICE_PACKAGES := kmod-leds-gpio kmod-rt2800-pci kmod-usb-dwc2 -endef -TARGET_DEVICES += rt-n13u - -define Device/rut5xx - DTS := RUT5XX - DEVICE_TITLE := Teltonika RUT5XX - DEVICE_PACKAGES := om-watchdog -endef -TARGET_DEVICES += rut5xx - -define Device/sl-r7205 - DTS := SL-R7205 - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Skyline SL-R7205 Wireless 3G Router -endef -TARGET_DEVICES += sl-r7205 - -define Device/tew-638apb-v2 - DTS := TEW-638APB-V2 - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - IMAGE/sysupgrade.bin := $$(sysupgrade_bin) | umedia-header 0x026382 | \ - append-metadata | check-size $$$$(IMAGE_SIZE) - DEVICE_TITLE := TRENDnet TEW-638APB v2 -endef -TARGET_DEVICES += tew-638apb-v2 - -define Device/tew-714tru - DTS := TEW-714TRU - DEVICE_TITLE := TRENDnet TEW-714TRU -endef -TARGET_DEVICES += tew-714tru - -define Device/ur-326n4g - DTS := UR-326N4G - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := UPVEL UR-326N4G - DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += ur-326n4g - -define Device/ur-336un - DTS := UR-336UN - DEVICE_TITLE := UPVEL UR-336UN - DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += ur-336un - -define Device/v22rw-2x2 - DTS := V22RW-2X2 - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Ralink AP-RT3052-V22RW-2X2 -endef -TARGET_DEVICES += v22rw-2x2 - -define Device/vocore-8M - DTS := VOCORE-8M - IMAGE_SIZE := 7872k - SUPPORTED_DEVICES += vocore - DEVICE_TITLE := VoCore (8M) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \ - kmod-i2c-core kmod-i2c-ralink \ - kmod-spi-dev -endef -TARGET_DEVICES += vocore-8M - -define Device/vocore-16M - DTS := VOCORE-16M - IMAGE_SIZE := 16064k - SUPPORTED_DEVICES += vocore - DEVICE_TITLE := VoCore (16M) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \ - kmod-i2c-core kmod-i2c-ralink \ - kmod-spi-dev -endef -TARGET_DEVICES += vocore-16M - -define Device/w150m - DTS := W150M - IMAGE_SIZE := $(ralink_default_fw_size_4M) - UIMAGE_NAME:= W150M Kernel Image - DEVICE_TITLE := Tenda W150M -endef -TARGET_DEVICES += w150m - -define Device/w306r-v20 - DTS := W306R_V20 - IMAGE_SIZE := $(ralink_default_fw_size_4M) - UIMAGE_NAME:= linkn Kernel Image - DEVICE_TITLE := Tenda W306R V2.0 -endef -TARGET_DEVICES += w306r-v20 - -define Device/w502u - DTS := W502U - DEVICE_TITLE := ALFA Networks W502U -endef -TARGET_DEVICES += w502u - -define Device/wcr-150gn - DTS := WCR150GN - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Sparklan WCR-150GN -endef -TARGET_DEVICES += wcr-150gn - -define Device/whr-g300n - DTS := WHR-G300N - BLOCKSIZE := 64k - IMAGE_SIZE := 3801088 - DEVICE_TITLE := Buffalo WHR-G300N - IMAGES += tftp.bin - IMAGE/tftp.bin := $$(sysupgrade_bin) | \ - check-size $$$$(IMAGE_SIZE) | buffalo-tftp-header -endef -TARGET_DEVICES += whr-g300n - -define Device/wizard8800 - DTS := WIZARD8800 - UIMAGE_NAME:= Linux Kernel Image - DEVICE_TITLE := EasyAcc WIZARD 8800 -endef -TARGET_DEVICES += wizard8800 - -define Device/wizfi630a - DTS := WIZFI630A - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := WIZnet WizFi630A -endef -TARGET_DEVICES += wizfi630a - -define Device/wl-330n - DTS := WL-330N - BLOCKSIZE := 4k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Asus WL-330N -endef -TARGET_DEVICES += wl-330n - -define Device/wl-330n3g - DTS := WL-330N3G - BLOCKSIZE := 4k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Asus WL-330N3G - DEVICE_PACKAGES := -endef -TARGET_DEVICES += wl-330n3g - -define Device/wl-351 - DTS := WL-351 - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := Sitecom WL-351 v1 - DEVICE_PACKAGES := kmod-switch-rtl8366rb kmod-swconfig swconfig - DEFAULT := n -endef -TARGET_DEVICES += wl-351 - -define Device/wnce2001 - DTS := WNCE2001 - IMAGE_SIZE := $(ralink_default_fw_size_4M) +define Device/netgear_wnce2001 + MTK_SOC := rt3052 + IMAGE_SIZE := 3392k IMAGES += factory.bin factory-NA.bin IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ dap-header -s RT3052-AP-WNCE2001-3 -r WW -v 1.0.0.99 IMAGE/factory-NA.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ dap-header -s RT3052-AP-WNCE2001-3 -r NA -v 1.0.0.99 - DEVICE_TITLE := Netgear WNCE2001 + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := WNCE2001 + SUPPORTED_DEVICES += wnce2001 endef -TARGET_DEVICES += wnce2001 +TARGET_DEVICES += netgear_wnce2001 -define Device/wr512-3gn-4M - DTS := WR512-3GN-4M - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := WR512-3GN (4M) - DEFAULT := n +define Device/nexaira_bc2 + MTK_SOC := rt3052 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := NexAira + DEVICE_MODEL := BC2 + SUPPORTED_DEVICES += bc2 endef -TARGET_DEVICES += wr512-3gn-4M +TARGET_DEVICES += nexaira_bc2 -define Device/wr512-3gn-8M - DTS := WR512-3GN-8M - DEVICE_TITLE := WR512-3GN (8M) -endef -TARGET_DEVICES += wr512-3gn-8M - -define Device/wr6202 - DTS := WR6202 - DEVICE_TITLE := AWB WR6202 -endef -TARGET_DEVICES += wr6202 - -define Device/wt1520-4M - DTS := WT1520-4M - IMAGE_SIZE := $(ralink_default_fw_size_4M) +define Device/nexx_wt1520-4m + MTK_SOC := rt5350 + IMAGE_SIZE := 3776k IMAGES += factory.bin IMAGE/factory.bin := \ $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B WT1520 -F 4M - DEVICE_TITLE := Nexx WT1520 (4MB) + DEVICE_VENDOR := Nexx + DEVICE_MODEL := WT1520 + DEVICE_VARIANT := 4M + SUPPORTED_DEVICES += wt1520-4M endef -TARGET_DEVICES += wt1520-4M +TARGET_DEVICES += nexx_wt1520-4m -define Device/wt1520-8M - DTS := WT1520-8M +define Device/nexx_wt1520-8m + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k IMAGES += factory.bin IMAGE/factory.bin := \ $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B WT1520 -F 8M - DEVICE_TITLE := Nexx WT1520 (8MB) + DEVICE_VENDOR := Nexx + DEVICE_MODEL := WT1520 + DEVICE_VARIANT := 8M + SUPPORTED_DEVICES += wt1520-8M endef -TARGET_DEVICES += wt1520-8M +TARGET_DEVICES += nexx_wt1520-8m -define Device/x5 - DTS := X5 +define Device/nixcore_x1-16m + MTK_SOC := rt5350 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Nixcore + DEVICE_MODEL := X1 + DEVICE_VARIANT := 16M + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev + SUPPORTED_DEVICES += nixcore-x1 nixcore-x1-16M +endef +TARGET_DEVICES += nixcore_x1-16m + +define Device/nixcore_x1-8m + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Nixcore + DEVICE_MODEL := X1 + DEVICE_VARIANT := 8M + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev + SUPPORTED_DEVICES += nixcore-x1 nixcore-x1-8M +endef +TARGET_DEVICES += nixcore_x1-8m + +define Device/olimex_rt5350f-olinuxino + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := OLIMEX + DEVICE_MODEL := RT5350F-OLinuXino + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 \ + kmod-i2c-core kmod-i2c-ralink \ + kmod-spi-dev + SUPPORTED_DEVICES += rt5350f-olinuxino +endef +TARGET_DEVICES += olimex_rt5350f-olinuxino + +define Device/olimex_rt5350f-olinuxino-evb + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := OLIMEX + DEVICE_MODEL := RT5350F-OLinuXino-EVB + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 \ + kmod-i2c-core kmod-i2c-ralink \ + kmod-spi-dev + SUPPORTED_DEVICES += rt5350f-olinuxino-evb +endef +TARGET_DEVICES += olimex_rt5350f-olinuxino-evb + +define Device/omnima_miniembplug + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Omnima + DEVICE_MODEL := MiniEMBPlug + SUPPORTED_DEVICES += miniembplug +endef +TARGET_DEVICES += omnima_miniembplug + +define Device/omnima_miniembwifi + MTK_SOC := rt3052 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Omnima + DEVICE_MODEL := MiniEMBWiFi + SUPPORTED_DEVICES += miniembwifi +endef +TARGET_DEVICES += omnima_miniembwifi + +define Device/petatel_psr-680w + MTK_SOC := rt3052 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Petatel + DEVICE_MODEL := PSR-680W Wireless 3G Router + SUPPORTED_DEVICES += psr-680w +endef +TARGET_DEVICES += petatel_psr-680w + +define Device/planex_mzk-dp150n + MTK_SOC := rt5350 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Planex + DEVICE_MODEL := MZK-DP150N + DEVICE_PACKAGES := kmod-spi-dev + SUPPORTED_DEVICES += mzk-dp150n +endef +TARGET_DEVICES += planex_mzk-dp150n + +define Device/planex_mzk-w300nh2 + MTK_SOC := rt3052 + IMAGE_SIZE := 3648k + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | \ + edimax-header -s CSYS -m RN52 -f 0x50000 -S 0xc0000 + DEVICE_VENDOR := Planex + DEVICE_MODEL := MZK-W300NH2 + SUPPORTED_DEVICES += mzk-w300nh2 +endef +TARGET_DEVICES += planex_mzk-w300nh2 + +define Device/planex_mzk-wdpr + MTK_SOC := rt3052 + IMAGE_SIZE := 6656k + DEVICE_VENDOR := Planex + DEVICE_MODEL := MZK-WDPR + SUPPORTED_DEVICES += mzk-wdpr +endef +TARGET_DEVICES += planex_mzk-wdpr + +define Device/poray_ip2202 + MTK_SOC := rt3052 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Poray + DEVICE_MODEL := IP2202 + SUPPORTED_DEVICES += ip2202 +endef +TARGET_DEVICES += poray_ip2202 + +define Device/poray_m3 + MTK_SOC := rt5350 + IMAGE_SIZE := 3776k + IMAGES += factory.bin + IMAGE/factory.bin := \ + $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B M3 -F 4M + DEVICE_VENDOR := Poray + DEVICE_MODEL := M3 + DEVICE_PACKAGES := kmod-usb2 kmod-ledtrig-netdev \ + kmod-ledtrig-timer + SUPPORTED_DEVICES += m3 +endef +TARGET_DEVICES += poray_m3 + +define Device/poray_m4-4m + MTK_SOC := rt5350 + IMAGE_SIZE := 3776k + IMAGES += factory.bin + IMAGE/factory.bin := \ + $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B M4 -F 4M + DEVICE_VENDOR := Poray + DEVICE_MODEL := M4 + DEVICE_VARIANT := 4M + DEVICE_PACKAGES := kmod-usb2 kmod-ledtrig-netdev \ + kmod-ledtrig-timer + SUPPORTED_DEVICES += m4-4M +endef +TARGET_DEVICES += poray_m4-4m + +define Device/poray_m4-8m + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + IMAGES += factory.bin + IMAGE/factory.bin := \ + $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B M4 -F 8M + DEVICE_VENDOR := Poray + DEVICE_MODEL := M4 + DEVICE_VARIANT := 8M + DEVICE_PACKAGES := kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer + SUPPORTED_DEVICES += m4-8M +endef +TARGET_DEVICES += poray_m4-8m + +define Device/poray_x5 + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k IMAGES += factory.bin IMAGE/factory.bin := \ $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B X5 -F 8M - DEVICE_TITLE := Poray X5/X6 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer + DEVICE_VENDOR := Poray + DEVICE_MODEL := X5/X6 + DEVICE_PACKAGES := kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer + SUPPORTED_DEVICES += x5 endef -TARGET_DEVICES += x5 +TARGET_DEVICES += poray_x5 - -define Device/x8 - DTS := X8 +define Device/poray_x8 + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k IMAGES += factory.bin IMAGE/factory.bin := \ $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B X8 -F 8M - DEVICE_TITLE := Poray X8 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer + DEVICE_VENDOR := Poray + DEVICE_MODEL := X8 + DEVICE_PACKAGES := kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer + SUPPORTED_DEVICES += x8 endef -TARGET_DEVICES += x8 +TARGET_DEVICES += poray_x8 -define Device/xdxrn502j - DTS := XDXRN502J - BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := XDX RN502J +define Device/prolink_pwh2004 + MTK_SOC := rt3052 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Prolink + DEVICE_MODEL := PWH2004 + DEVICE_PACKAGES := + SUPPORTED_DEVICES += pwh2004 endef -TARGET_DEVICES += xdxrn502j +TARGET_DEVICES += prolink_pwh2004 -define Device/kn - DTS := kn +define Device/ralink_v22rw-2x2 + MTK_SOC := rt3052 BLOCKSIZE := 64k - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := ZyXEL Keenetic - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ehci kmod-usb-ledtrig-usbport - DEFAULT := n + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Ralink + DEVICE_MODEL := AP-RT3052-V22RW-2X2 + SUPPORTED_DEVICES += v22rw-2x2 endef -TARGET_DEVICES += kn +TARGET_DEVICES += ralink_v22rw-2x2 + +define Device/sitecom_wl-351 + MTK_SOC := rt3052 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Sitecom + DEVICE_MODEL := WL-351 v1 + DEVICE_PACKAGES := kmod-switch-rtl8366rb kmod-swconfig swconfig + SUPPORTED_DEVICES += wl-351 +endef +TARGET_DEVICES += sitecom_wl-351 + +define Device/skyline_sl-r7205 + MTK_SOC := rt3052 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Skyline + DEVICE_MODEL := SL-R7205 Wireless 3G Router + SUPPORTED_DEVICES += sl-r7205 +endef +TARGET_DEVICES += skyline_sl-r7205 + +define Device/sparklan_wcr-150gn + MTK_SOC := rt3050 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Sparklan + DEVICE_MODEL := WCR-150GN + SUPPORTED_DEVICES += wcr-150gn +endef +TARGET_DEVICES += sparklan_wcr-150gn + +define Device/teltonika_rut5xx + MTK_SOC := rt3050 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Teltonika + DEVICE_MODEL := RUT5XX + DEVICE_PACKAGES := om-watchdog + SUPPORTED_DEVICES += rut5xx +endef +TARGET_DEVICES += teltonika_rut5xx + +define Device/tenda_3g150b + MTK_SOC := rt5350 + BLOCKSIZE := 4k + IMAGE_SIZE := 3776k + UIMAGE_NAME:= Linux Kernel Image + DEVICE_VENDOR := Tenda + DEVICE_MODEL := 3G150B + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += 3g150b +endef +TARGET_DEVICES += tenda_3g150b + +define Device/tenda_3g300m + MTK_SOC := rt3052 + IMAGE_SIZE := 3776k + UIMAGE_NAME := 3G150M_SPI Kernel Image + DEVICE_VENDOR := Tenda + DEVICE_MODEL := 3G300M + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += 3g300m +endef +TARGET_DEVICES += tenda_3g300m + +define Device/tenda_w150m + MTK_SOC := rt3050 + IMAGE_SIZE := 3776k + UIMAGE_NAME:= W150M Kernel Image + DEVICE_VENDOR := Tenda + DEVICE_MODEL := W150M + SUPPORTED_DEVICES += w150m +endef +TARGET_DEVICES += tenda_w150m + +define Device/tenda_w306r-v2 + MTK_SOC := rt3052 + IMAGE_SIZE := 3776k + UIMAGE_NAME:= linkn Kernel Image + DEVICE_VENDOR := Tenda + DEVICE_MODEL := W306R + DEVICE_VARIANT := V2.0 + SUPPORTED_DEVICES += w306r-v20 +endef +TARGET_DEVICES += tenda_w306r-v2 + +define Device/trendnet_tew-638apb-v2 + MTK_SOC := rt3050 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + IMAGE/sysupgrade.bin := $$(sysupgrade_bin) | umedia-header 0x026382 | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + DEVICE_VENDOR := TRENDnet + DEVICE_MODEL := TEW-638APB + DEVICE_VARIANT := v2 + SUPPORTED_DEVICES += tew-638apb-v2 +endef +TARGET_DEVICES += trendnet_tew-638apb-v2 + +define Device/trendnet_tew-714tru + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := TRENDnet + DEVICE_MODEL := TEW-714TRU + SUPPORTED_DEVICES += tew-714tru +endef +TARGET_DEVICES += trendnet_tew-714tru + +define Device/unbranded_a5-v11 + MTK_SOC := rt5350 + IMAGE_SIZE := 3776k + IMAGES += factory.bin + IMAGE/factory.bin := \ + $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B A5-V11 -F 4M + DEVICE_VENDOR := + DEVICE_MODEL := A5-V11 + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 + SUPPORTED_DEVICES += a5-v11 +endef +TARGET_DEVICES += unbranded_a5-v11 + +define Device/unbranded_wr512-3gn-4m + MTK_SOC := rt3052 + IMAGE_SIZE := 3776k + DEVICE_VENDOR := Ralink + DEVICE_MODEL := WR512-3GN + DEVICE_VARIANT := 4M + SUPPORTED_DEVICES += wr512-3gn-4M +endef +TARGET_DEVICES += unbranded_wr512-3gn-4m + +define Device/unbranded_wr512-3gn-8m + MTK_SOC := rt3052 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Ralink + DEVICE_MODEL := WR512-3GN + DEVICE_VARIANT := 8M + SUPPORTED_DEVICES += wr512-3gn-8M +endef +TARGET_DEVICES += unbranded_wr512-3gn-8m + +define Device/unbranded_xdx-rn502j + MTK_SOC := rt3052 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := XDX + DEVICE_MODEL := RN502J + SUPPORTED_DEVICES += xdxrn502j +endef +TARGET_DEVICES += unbranded_xdx-rn502j + +define Device/upvel_ur-326n4g + MTK_SOC := rt3052 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := UPVEL + DEVICE_MODEL := UR-326N4G + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += ur-326n4g +endef +TARGET_DEVICES += upvel_ur-326n4g + +define Device/upvel_ur-336un + MTK_SOC := rt3052 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := UPVEL + DEVICE_MODEL := UR-336UN + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += ur-336un +endef +TARGET_DEVICES += upvel_ur-336un + +define Device/vocore_vocore-16m + MTK_SOC := rt5350 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := VoCore + DEVICE_MODEL := VoCore + DEVICE_VARIANT := 16M + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 \ + kmod-i2c-core kmod-i2c-ralink \ + kmod-spi-dev + SUPPORTED_DEVICES += vocore vocore-16M +endef +TARGET_DEVICES += vocore_vocore-16m + +define Device/vocore_vocore-8m + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := VoCore + DEVICE_MODEL := VoCore + DEVICE_VARIANT := 8M + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 \ + kmod-i2c-core kmod-i2c-ralink \ + kmod-spi-dev + SUPPORTED_DEVICES += vocore vocore-8M +endef +TARGET_DEVICES += vocore_vocore-8m + +define Device/wansview_ncs601w + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Wansview + DEVICE_MODEL := NCS601W + DEVICE_PACKAGES := kmod-video-core kmod-video-uvc \ + kmod-usb-ohci + SUPPORTED_DEVICES += ncs601w +endef +TARGET_DEVICES += wansview_ncs601w + +define Device/wiznet_wizfi630a + MTK_SOC := rt5350 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := WIZnet + DEVICE_MODEL := WizFi630A + SUPPORTED_DEVICES += wizfi630a +endef +TARGET_DEVICES += wiznet_wizfi630a + +define Device/zorlik_zl5900v2 + MTK_SOC := rt5350 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Zorlik + DEVICE_MODEL := ZL5900V2 + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev +endef +TARGET_DEVICES += zorlik_zl5900v2 + +define Device/zyxel_keenetic + MTK_SOC := rt3052 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := Keenetic + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ehci kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += kn +endef +TARGET_DEVICES += zyxel_keenetic define Device/zyxel_keenetic-start - DTS := kn_st - IMAGE_SIZE := $(ralink_default_fw_size_4M) - DEVICE_TITLE := ZyXEL Keenetic Start + MTK_SOC := rt5350 + IMAGE_SIZE := 3776k + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := Keenetic Start endef TARGET_DEVICES += zyxel_keenetic-start -define Device/zorlik_zl5900v2 - DTS := ZL5900V2 - DEVICE_TITLE := Zorlik ZL5900V2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev +define Device/zyxel_nbg-419n + MTK_SOC := rt3052 + BLOCKSIZE := 64k + IMAGE_SIZE := 3776k + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := NBG-419N + SUPPORTED_DEVICES += nbg-419n endef -TARGET_DEVICES += zorlik_zl5900v2 +TARGET_DEVICES += zyxel_nbg-419n + +define Device/zyxel_nbg-419n-v2 + MTK_SOC := rt3352 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := NBG-419N + DEVICE_VARIANT := v2 + SUPPORTED_DEVICES += nbg-419n2 +endef +TARGET_DEVICES += zyxel_nbg-419n-v2 diff --git a/target/linux/ramips/image/rt3883.mk b/target/linux/ramips/image/rt3883.mk index 1f4b261c9..0279bcd2d 100644 --- a/target/linux/ramips/image/rt3883.mk +++ b/target/linux/ramips/image/rt3883.mk @@ -5,116 +5,133 @@ define Build/mkrtn56uimg $(STAGING_DIR_HOST)/bin/mkrtn56uimg $(1) $@ endef -define Device/br-6475nd - DTS := BR-6475ND +define Device/asus_rt-n56u + MTK_SOC := rt3662 BLOCKSIZE := 64k - IMAGE_SIZE := 7744k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ - edimax-header -s CSYS -m RN54 -f 0x70000 -S 0x01100000 | pad-rootfs | \ - append-metadata | check-size $$$$(IMAGE_SIZE) - DEVICE_TITLE := Edimax BR-6475nD - DEVICE_PACKAGES := swconfig + IMAGE_SIZE := 7872k + IMAGE/sysupgrade.bin += | mkrtn56uimg -s + DEVICE_VENDOR := Asus + DEVICE_MODEL := RT-N56U + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 swconfig + SUPPORTED_DEVICES += rt-n56u endef -TARGET_DEVICES += br-6475nd - -define Device/cy-swr1100 - $(Device/seama) - DTS := CY-SWR1100 - BLOCKSIZE := 64k - KERNEL := $(KERNEL_DTB) - SEAMA_SIGNATURE := wrgnd10_samsung_ss815 - DEVICE_TITLE := Samsung CY-SWR1100 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \ - kmod-usb-ledtrig-usbport swconfig -endef -TARGET_DEVICES += cy-swr1100 - - -define Device/dir-645 - $(Device/seama) - DTS := DIR-645 - BLOCKSIZE := 4k - KERNEL := $(KERNEL_DTB) - SEAMA_SIGNATURE := wrgn39_dlob.hans_dir645 - DEVICE_TITLE := D-Link DIR-645 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig - DEFAULT := n -endef -TARGET_DEVICES += dir-645 - +TARGET_DEVICES += asus_rt-n56u define Device/belkin_f9k1109v1 - DTS := F9K1109V1 + MTK_SOC := rt3883 BLOCKSIZE := 64k - DEVICE_TITLE := Belkin F9K1109 Version 1.0 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig - IMAGE_SIZE := 7224k + DEVICE_VENDOR := Belkin + DEVICE_MODEL := F9K1109 + DEVICE_VARIANT := Version 1.0 + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 swconfig + IMAGE_SIZE := 7808k KERNEL := kernel-bin | append-dtb | lzma -d16 | uImage lzma # Stock firmware checks for this uImage image name during upload. UIMAGE_NAME := N750F9K1103VB endef TARGET_DEVICES += belkin_f9k1109v1 -define Device/hpm - DTS := HPM +define Device/dlink_dir-645 + $(Device/seama) + MTK_SOC := rt3662 + BLOCKSIZE := 4k + IMAGE_SIZE := 7872k + KERNEL := $(KERNEL_DTB) + SEAMA_SIGNATURE := wrgn39_dlob.hans_dir645 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-645 + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 swconfig + SUPPORTED_DEVICES += dir-645 +endef +TARGET_DEVICES += dlink_dir-645 + +define Device/edimax_br-6475nd + MTK_SOC := rt3662 + BLOCKSIZE := 64k + IMAGE_SIZE := 7744k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + edimax-header -s CSYS -m RN54 -f 0x70000 -S 0x01100000 | pad-rootfs | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + DEVICE_VENDOR := Edimax + DEVICE_MODEL := BR-6475nD + DEVICE_PACKAGES := swconfig + SUPPORTED_DEVICES += br-6475nd +endef +TARGET_DEVICES += edimax_br-6475nd + +define Device/loewe_wmdr-143n + MTK_SOC := rt3662 + BLOCKSIZE := 64k + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Loewe + DEVICE_MODEL := WMDR-143N + SUPPORTED_DEVICES += wmdr-143n +endef +TARGET_DEVICES += loewe_wmdr-143n + +define Device/omnima_hpm + MTK_SOC := rt3662 BLOCKSIZE := 64k IMAGE_SIZE := 16064k - DEVICE_TITLE := Omnima HPM - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 + DEVICE_VENDOR := Omnima + DEVICE_MODEL := HPM + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 + SUPPORTED_DEVICES += hpm endef -TARGET_DEVICES += hpm +TARGET_DEVICES += omnima_hpm - -define Device/rt-n56u - DTS := RT-N56U +define Device/samsung_cy-swr1100 + $(Device/seama) + MTK_SOC := rt3662 BLOCKSIZE := 64k - IMAGE/sysupgrade.bin += | mkrtn56uimg -s - DEVICE_TITLE := Asus RT-N56U - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig + IMAGE_SIZE := 7872k + KERNEL := $(KERNEL_DTB) + SEAMA_SIGNATURE := wrgnd10_samsung_ss815 + DEVICE_VENDOR := Samsung + DEVICE_MODEL := CY-SWR1100 + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport swconfig + SUPPORTED_DEVICES += cy-swr1100 endef -TARGET_DEVICES += rt-n56u +TARGET_DEVICES += samsung_cy-swr1100 - -define Device/tew-691gr - DTS := TEW-691GR - BLOCKSIZE := 64k - IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ - umedia-header 0x026910 - DEVICE_TITLE := TRENDnet TEW-691GR - DEVICE_PACKAGES := swconfig -endef -TARGET_DEVICES += tew-691gr - - -define Device/tew-692gr - DTS := TEW-692GR - BLOCKSIZE := 64k - IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ - umedia-header 0x026920 - DEVICE_TITLE := TRENDnet TEW-692GR - DEVICE_PACKAGES := swconfig -endef -TARGET_DEVICES += tew-692gr - - -define Device/wlr-6000 - DTS := WLR-6000 +define Device/sitecom_wlr-6000 + MTK_SOC := rt3883 BLOCKSIZE := 4k IMAGE_SIZE := 7244k IMAGES += factory.dlf IMAGE/factory.dlf := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ senao-header -r 0x0202 -p 0x41 -t 2 - DEVICE_TITLE := Sitecom WLR-6000 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig + DEVICE_VENDOR := Sitecom + DEVICE_MODEL := WLR-6000 + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 swconfig + SUPPORTED_DEVICES += wlr-6000 endef -TARGET_DEVICES += wlr-6000 +TARGET_DEVICES += sitecom_wlr-6000 - -define Device/wmdr-143n - DTS := WMDR-143N +define Device/trendnet_tew-691gr + MTK_SOC := rt3883 BLOCKSIZE := 64k - DEVICE_TITLE := Loewe WMDR-143N + IMAGE_SIZE := 7872k + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + umedia-header 0x026910 + DEVICE_VENDOR := TRENDnet + DEVICE_MODEL := TEW-691GR + DEVICE_PACKAGES := swconfig + SUPPORTED_DEVICES += tew-691gr endef -TARGET_DEVICES += wmdr-143n +TARGET_DEVICES += trendnet_tew-691gr + +define Device/trendnet_tew-692gr + MTK_SOC := rt3883 + BLOCKSIZE := 64k + IMAGE_SIZE := 7872k + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + umedia-header 0x026920 + DEVICE_VENDOR := TRENDnet + DEVICE_MODEL := TEW-692GR + DEVICE_PACKAGES := swconfig + SUPPORTED_DEVICES += tew-692gr +endef +TARGET_DEVICES += trendnet_tew-692gr diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds new file mode 100755 index 000000000..d88fdfb04 --- /dev/null +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -0,0 +1,233 @@ +#!/bin/sh + +. /lib/functions/leds.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 + +led_wlan="$(get_dt_led wlan)" +[ -n "$led_wlan" ] && ucidef_set_led_wlan "wifi_led" "wifi" "$led_wlan" "phy0tpt" + +case $board in +aigale,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,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" + ;; +asus,rp-n53) + ucidef_set_led_netdev "eth" "Network" "$boardname:white:back" "eth0" + set_wifi_led "$boardname:blue:wifi" + ;; +asus,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" + ;; +asus,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" + ;; +asus,rt-ac51u|\ +kingston,mlw221|\ +kingston,mlwg2|\ +sanlinking,d240) + set_wifi_led "$boardname:blue:wifi" + ;; +bdcom,wap2100-sk) + set_wifi_led "$boardname:green:wlan2g" + ;; +comfast,cf-wr800n) + ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1 + set_wifi_led "$boardname:white:wifi" + ;; +dlink,dwr-116-a1|\ +head-weblink,hdrm200|\ +ohyeah,oy-0001|\ +planex,mzk-ex300np|\ +zbtlink,zbt-wr8305rt|\ +zyxel,keenetic-omni|\ +zyxel,keenetic-omni-ii|\ +zyxel,keenetic-viva) + 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" "0x1e" + 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" + ;; +dovado,tiny-ac) + set_wifi_led "$boardname:orange:wifi" + ;; +edimax,br-6478ac-v2|\ +edimax,ew-7478apc) + set_wifi_led "$boardname:blue:wlan" + ;; +edimax,ew-7476rpc|\ +edimax,ew-7478ac) + ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x20" + ;; +elecom,wrh-300cr) + set_wifi_led "$boardname:green:wlan" + ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0" + ;; +engenius,esr600) + ucidef_set_led_netdev "wlan5g" "5.0GHz" "$boardname:blue:wlan5g" "wlan0" + ucidef_set_led_netdev "wlan2g" "2.4GHz" "$boardname:blue:wlan2g" "wlan1" + ;; +glinet,gl-mt300a|\ +glinet,gl-mt300n|\ +glinet,gl-mt750) + set_wifi_led "$boardname:wlan" + ;; +hiwifi,hc5661) + ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x01" + set_wifi_led "$boardname:blue:wlan2g" + ;; +hiwifi,hc5761) + ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x01" + ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "wlan0" + ucidef_set_led_netdev "wifi2g" "wifi2g" "$boardname:blue:wlan2g" "wlan1" + ;; +hiwifi,hc5861) + ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x20" + ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "wlan0" + ucidef_set_led_netdev "wifi2g" "wifi2g" "$boardname:blue:wlan2g" "wlan1" + ;; +hnet,c108) + ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0" + ucidef_set_led_netdev "modem" "modem" "$boardname:green:modem" "wwan0" + ;; +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,u25awf-h1) + set_wifi_led "u25awf:red:wifi" + ucidef_set_led_netdev "eth" "eth" "u25awf:green:lan" "eth0" + ;; +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" + ;; +lenovo,newifi-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" + ;; +lenovo,newifi-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" + ;; +netgear,ex2700|\ +netgear,wn3000rp-v3) + set_wifi_led "$boardname:green:router" + ;; +netgear,ex3700|\ +netgear,ex6130) + ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$boardname:green:router" "wlan0" + ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$boardname:green:device" "wlan1" + ;; +phicomm,psg1208) + set_wifi_led "$boardname:white:wlan2g" + ;; +planex,mzk-ex750np|\ +zbtlink,zbt-we826-e) + set_wifi_led "$boardname:red:wifi" + ;; +tplink,archer-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,archer-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,archer-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" + ;; +tplink,archer-c50-v1) + 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" + ;; +tplink,archer-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" + ;; +youku,yk1) + set_wifi_led "$boardname:blue:air" + ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10" + ;; +zbtlink,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" + ;; +zbtlink,zbt-wa05) + set_wifi_led "$boardname:blue:air" + ;; +zbtlink,zbt-we826-16m|\ +zbtlink,zbt-we826-32m) + set_wifi_led "zbt-we826:green:wifi" + ;; +zbtlink,zbt-we1026-5g-16m) + ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0" + set_wifi_led "we1026-5g:green:wifi" + ;; +zbtlink,zbt-we1026-h-32m) + set_wifi_led "we1026-h:green:wifi" + ucidef_set_led_switch "lan" "lan" "we1026-h:green:lan" "switch0" "0x8" + ucidef_set_led_switch "wan" "wan" "we1026-h:green:wan" "switch0" "0x10" + ;; +zbtlink,zbt-we2026) + set_wifi_led "$boardname:green:wlan" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network new file mode 100755 index 000000000..20846ef20 --- /dev/null +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -0,0 +1,341 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh +. /lib/functions/system.sh + +ramips_setup_interfaces() +{ + local board="$1" + + case $board in + aigale,ai-br100|\ + alfa-network,ac1200rm|\ + asus,rt-n12p|\ + dlink,dir-810l|\ + dlink,dwr-116-a1|\ + dlink,dwr-921-c1|\ + dlink,dwr-922-e2|\ + ohyeah,oy-0001|\ + phicomm,psg1208|\ + phicomm,psg1218a|\ + planex,db-wrt01|\ + planex,mzk-750dhp|\ + sanlinking,d240|\ + youku,yk1|\ + zbtlink,zbt-ape522ii|\ + zbtlink,zbt-we826-16m|\ + zbtlink,zbt-we826-32m|\ + zbtlink,zbt-we826-e|\ + zbtlink,zbt-wr8305rt|\ + zyxel,keenetic-omni) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" + ;; + alfa-network,r36m-e4g|\ + zbtlink,zbt-we1026-h-32m) + ucidef_add_switch "switch0" \ + "3:lan" "4:wan" "6@eth0" + ;; + alfa-network,tube-e4g|\ + buffalo,wmr-300|\ + dlink,dch-m225|\ + elecom,wrh-300cr|\ + kimax,u25awf-h1|\ + netgear,ex2700|\ + netgear,ex3700|\ + netgear,ex6130|\ + netgear,wn3000rp-v3|\ + planex,cs-qr10|\ + planex,mzk-ex300np|\ + planex,mzk-ex750np|\ + ravpower,wd03|\ + sercomm,na930) + ucidef_set_interface_lan "eth0" + ;; + asus,rp-n53) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" + ;; + asus,rt-ac51u) + ucidef_add_switch "switch0" \ + "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" + ;; + asus,rt-n14u|\ + bdcom,wap2100-sk|\ + glinet,gl-mt300a|\ + glinet,gl-mt300n|\ + glinet,gl-mt750|\ + hiwifi,hc5661|\ + wrtnode,wrtnode|\ + zbtlink,zbt-wa05) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" + ;; + buffalo,whr-300hp2|\ + buffalo,whr-600d) + ucidef_add_switch "switch0" \ + "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:wan:5" "6@eth0" + ;; + buffalo,whr-1166d) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "5:wan" "6@eth0" + ;; + comfast,cf-wr800n|\ + hnet,c108) + ucidef_add_switch "switch0" \ + "4:lan" "6@eth0" + ;; + dlink,dir-510l) + ucidef_add_switch "switch0" \ + "0:lan" "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" + ;; + edimax,br-6478ac-v2|\ + tplink,archer-c2-v1) + ucidef_add_switch "switch1" \ + "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" + ;; + edimax,ew-7476rpc|\ + edimax,ew-7478ac|\ + kimax,u35wf|\ + microduino,microwrt|\ + yukai,bocco|\ + zbtlink,zbt-cpe102|\ + zte,q7) + ucidef_add_switch "switch0" + ucidef_add_switch_attr "switch0" "enable" "false" + ucidef_set_interface_lan "eth0" + ;; + engenius,esr600) + ucidef_add_switch "switch0" \ + "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "0@eth0" + ;; + fon,fon2601) + ucidef_add_switch "switch0" \ + "0:lan" "4:wan" "6@eth0" + ;; + head-weblink,hdrm200) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "5:lan" "0:wan" "6@eth0" + ;; + hiwifi,hc5761) + ucidef_add_switch "switch0" \ + "1:lan" "4:lan" "0:wan" "6@eth0" + ;; + hiwifi,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" + ;; + kingston,mlw221) + ucidef_set_interface_lan "eth0.2" + ;; + kingston,mlwg2) + ucidef_set_interface_lan "eth0.1" + ;; + lava,lr-25g001) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" + ;; + lenovo,newifi-y1|\ + xiaomi,miwifi-mini) + ucidef_add_switch "switch0" \ + "0:lan:2" "1:lan:1" "4:wan" "6@eth0" + ;; + lenovo,newifi-y1s) + ucidef_add_switch "switch0" \ + "1:lan:4" "2:lan:3" "4:lan:2" "5:lan:1" "0:wan" "6@eth0" + ;; + linksys,e1700|\ + ralink,mt7620a-mt7530-evb) + ucidef_add_switch "switch1" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" + ;; + nexx,wt3020-4m|\ + nexx,wt3020-8m) + ucidef_add_switch "switch0" \ + "4:lan" "0: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" + ;; + phicomm,psg1218b) + ucidef_add_switch "switch0" \ + "0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "6@eth0" + ;; + tplink,archer-c20i|\ + tplink,archer-c20-v1|\ + tplink,archer-c50-v1) + ucidef_add_switch "switch0" \ + "1:lan:3" "2:lan:4" "3:lan:1" "4:lan:2" "0:wan" "6@eth0" + ;; + tplink,archer-mr200) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0" + ucidef_set_interface_wan "usb0" + ;; + vonets,var11n-300) + ucidef_add_switch "switch0" \ + "0:lan" "4:wan" "6@eth0" + ;; + zbtlink,zbt-we1026-5g-16m) + ucidef_add_switch "switch0" \ + "0:lan" "6t@eth0" + ;; + zbtlink,zbt-we2026) + ucidef_add_switch "switch0" \ + "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0" + ;; + zyxel,keenetic-omni-ii) + ucidef_add_switch "switch0" \ + "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6@eth0" + ;; + zyxel,keenetic-viva) + ucidef_add_switch "switch1" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "7t@eth0" + ;; + *) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ;; + esac +} + +ramips_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + local label_mac="" + + case $board in + aigale,ai-br100|\ + asus,rt-ac51u|\ + asus,rt-n12p|\ + asus,rt-n14u|\ + bdcom,wap2100-sk|\ + edimax,ew-7478apc|\ + fon,fon2601|\ + head-weblink,hdrm200|\ + nexx,wt3020-4m|\ + nexx,wt3020-8m|\ + phicomm,psg1208|\ + planex,db-wrt01|\ + planex,mzk-750dhp|\ + sanlinking,d240|\ + vonets,var11n-300|\ + wrtnode,wrtnode|\ + youku,yk1|\ + zbtlink,zbt-ape522ii|\ + zbtlink,zbt-wa05|\ + zbtlink,zbt-we2026|\ + zbtlink,zbt-we826-16m|\ + zbtlink,zbt-we826-32m|\ + zbtlink,zbt-we826-e|\ + zbtlink,zbt-wr8305rt) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1) + ;; + alfa-network,ac1200rm|\ + dlink,dir-810l|\ + phicomm,psg1218a|\ + phicomm,psg1218b) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x28)" 1) + ;; + alfa-network,r36m-e4g|\ + zbtlink,zbt-we1026-h-32m) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + label_mac=$(mtd_get_mac_binary factory 0x4) + ;; + dlink,dch-m225) + lan_mac=$(mtd_get_mac_ascii factory lanmac) + ;; + 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) + label_mac=$wan_mac + ;; + dovado,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) + ;; + edimax,br-6478ac-v2) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 2) + ;; + engenius,esr600) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) + wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) + ;; + glinet,gl-mt300a|\ + glinet,gl-mt300n|\ + glinet,gl-mt750) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4000)" 1) + label_mac=$(mtd_get_mac_binary factory 0x4) + ;; + hiwifi,hc5661|\ + hiwifi,hc5761|\ + hiwifi,hc5861) + lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ") + label_mac=$lan_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=$(mtd_get_mac_ascii u-boot-env wanaddr) + ;; + lenovo,newifi-y1|\ + lenovo,newifi-y1s|\ + ohyeah,oy-0001|\ + phicomm,k2g) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + ;; + linksys,e1700) + wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR) + ;; + tplink,archer-c2-v1|\ + tplink,archer-c20-v1|\ + tplink,archer-c20i|\ + tplink,archer-c50-v1|\ + tplink,archer-mr200) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary rom 0xf100)" 1) + ;; + zbtlink,zbt-we1026-5g-16m) + label_mac=$(mtd_get_mac_binary factory 0x4) + ;; + zyxel,keenetic-omni|\ + zyxel,keenetic-omni-ii|\ + zyxel,keenetic-viva) + wan_mac=$(mtd_get_mac_binary factory 0x28) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} + +board_config_update +board=$(board_name) +ramips_setup_interfaces $board +ramips_setup_macs $board +board_config_flush + +exit 0 diff --git a/target/linux/ramips/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt7620/base-files/etc/board.d/03_gpio_switches similarity index 55% rename from target/linux/ramips/base-files/etc/board.d/03_gpio_switches rename to target/linux/ramips/mt7620/base-files/etc/board.d/03_gpio_switches index 1406f91f8..85380d84a 100755 --- a/target/linux/ramips/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/03_gpio_switches @@ -19,22 +19,6 @@ head-weblink,hdrm200) ucidef_add_gpio_switch "io4" "I/O 4" "14" ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "21" "1" ;; -mikrotik,rb750gr3) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "17" - ;; -telco-electronics,x1) - ucidef_add_gpio_switch "modem_reset" "Modem Reset" "16" - ;; -ubnt-erx) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "0" - ;; -ubnt-erx-sfp) - ucidef_add_gpio_switch "poe_power_port0" "PoE Power Port0" "496" - ucidef_add_gpio_switch "poe_power_port1" "PoE Power Port1" "497" - ucidef_add_gpio_switch "poe_power_port2" "PoE Power Port2" "498" - ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "499" - ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "500" - ;; zbtlink,zbt-we826-e) ucidef_add_gpio_switch "sim_switch" "SIM slot switch" "13" ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "14" "1" diff --git a/target/linux/ramips/mt7620/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/ramips/mt7620/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom new file mode 100644 index 000000000..f33ed82f6 --- /dev/null +++ b/target/linux/ramips/mt7620/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom @@ -0,0 +1,47 @@ +#!/bin/sh + +[ -e /lib/firmware/$FIRMWARE ] && exit 0 + +. /lib/functions/caldata.sh + +jboot_eeprom_extract() { + local part=$1 + local offset=$2 + local mtd + + mtd=$(find_mtd_part $part) + [ -n "$mtd" ] || \ + caldata_die "no mtd device found for partition $part" + + jboot_config_read -i $mtd -o $offset -e /lib/firmware/$FIRMWARE 2>/dev/null || \ + caldata_die "failed to extract from $mtd" +} + +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 + caldata_patch_mac $wifi_mac 0x4 + ;; + dovado,tiny-ac) + wifi_mac=$(mtd_get_mac_ascii u-boot-env INIC_MAC_ADDR) + caldata_extract "factory" 0x0 0x200 + caldata_patch_mac $wifi_mac 0x4 + ;; + *) + caldata_die "Please define mtd-eeprom in $board DTS file!" + ;; + esac + ;; +esac diff --git a/target/linux/ramips/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7620/base-files/etc/init.d/bootcount similarity index 69% rename from target/linux/ramips/base-files/etc/init.d/bootcount rename to target/linux/ramips/mt7620/base-files/etc/init.d/bootcount index dd7cf1aed..06316e48c 100755 --- a/target/linux/ramips/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7620/base-files/etc/init.d/bootcount @@ -2,20 +2,13 @@ START=99 -start() { - . /lib/functions.sh - +boot() { case $(board_name) in alfa-network,ac1200rm|\ - alfa-network,awusfree1|\ - alfa-network,quad-e4g|\ alfa-network,r36m-e4g|\ alfa-network,tube-e4g) [ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\ echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s - ;; - sk-wb8) - fw_setenv bootcount 0 - ;; esac } diff --git a/target/linux/ramips/mt7620/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/mt7620/base-files/etc/uci-defaults/04_led_migration new file mode 100644 index 000000000..ba1a0df7e --- /dev/null +++ b/target/linux/ramips/mt7620/base-files/etc/uci-defaults/04_led_migration @@ -0,0 +1,49 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/migrations.sh + +board=$(board_name) + +case "$board" in +lenovo,newifi-y1) + migrate_leds "^y1:=newifi-y1:" + ;; +lenovo,newifi-y1s) + migrate_leds "^y1s:=newifi-y1s:" + ;; +netgear,wn3000rp-v3) + migrate_leds "^wn3000rpv3:=wn3000rp-v3:" + ;; +tplink,archer-c2-v1) + migrate_leds "^c2-v1:=archer-c2-v1:" + ;; +tplink,archer-c20-v1) + migrate_leds "^c20-v1:=archer-c20-v1:" + ;; +tplink,archer-c20i) + migrate_leds "^c20i:=archer-c20i:" + ;; +tplink,archer-c50-v1) + migrate_leds "^c50:=archer-c50-v1:" + ;; +tplink,archer-mr200) + migrate_leds "^mr200:=archer-mr200:" + ;; +youku,yk1) + migrate_leds "^youku-yk1:=yk1:" + ;; +zyxel,keenetic-omni) + migrate_leds "^kn_rc:=keenetic-omni:" + ;; +zyxel,keenetic-omni-ii) + migrate_leds "^kn_rc:=keenetic-omni-ii:" + ;; +zyxel,keenetic-viva) + migrate_leds "^kng_rc:=keenetic-viva:" + ;; +esac + +migrations_apply system + +exit 0 diff --git a/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh new file mode 100755 index 000000000..9f71dc918 --- /dev/null +++ b/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh @@ -0,0 +1,37 @@ +# +# Copyright (C) 2010 OpenWrt.org +# + +PART_NAME=firmware +REQUIRE_IMAGE_METADATA=1 + +RAMFS_COPY_BIN='fw_printenv fw_setenv' +RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' + +platform_check_image() { + return 0 +} + +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + alfa-network,ac1200rm|\ + alfa-network,r36m-e4g|\ + alfa-network,tube-e4g) + [ "$(fw_printenv -n dual_image 2>/dev/null)" = "1" ] &&\ + [ -n "$(find_mtd_part backup)" ] && { + PART_NAME=backup + if [ "$(fw_printenv -n bootactive 2>/dev/null)" = "1" ]; then + fw_setenv bootactive 2 || exit 1 + else + fw_setenv bootactive 1 || exit 1 + fi + } + default_do_upgrade "$1" + ;; + *) + default_do_upgrade "$1" + ;; + esac +} diff --git a/target/linux/ramips/mt7620/config-4.14 b/target/linux/ramips/mt7620/config-4.14 index 74da9ec5a..92a7a2fd3 100644 --- a/target/linux/ramips/mt7620/config-4.14 +++ b/target/linux/ramips/mt7620/config-4.14 @@ -41,7 +41,6 @@ CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS32_R1 is not set CONFIG_CPU_MIPS32_R2=y CONFIG_CPU_MIPSR2=y -CONFIG_CPU_MIPSR2_IRQ_VI=y CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_R4K_FPU=y @@ -86,7 +85,6 @@ CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set # CONFIG_HAVE_ARCH_BITREVERSE is not set -CONFIG_HAVE_ARCH_COMPILER_H=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y @@ -136,11 +134,9 @@ CONFIG_MARVELL_PHY=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MFD_SYSCON=y -CONFIG_MIGRATION=y CONFIG_MIPS=y CONFIG_MIPS_ASID_BITS=8 CONFIG_MIPS_ASID_SHIFT=0 -CONFIG_MIPS_CBPF_JIT=y CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set # CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set diff --git a/target/linux/ramips/mt7620/profiles/00-default.mk b/target/linux/ramips/mt7620/profiles/00-default.mk index 912d28880..736a62819 100644 --- a/target/linux/ramips/mt7620/profiles/00-default.mk +++ b/target/linux/ramips/mt7620/profiles/00-default.mk @@ -7,7 +7,7 @@ define Profile/Default NAME:=Default Profile - PACKAGES:= kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + PACKAGES:= kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport PRIORITY:=1 endef diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds new file mode 100755 index 000000000..ac73729d1 --- /dev/null +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -0,0 +1,90 @@ +#!/bin/sh + +. /lib/functions/leds.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 + +led_wlan="$(get_dt_led wlan)" +[ -n "$led_wlan" ] && ucidef_set_led_wlan "wifi_led" "wifi" "$led_wlan" "phy0tpt" + +case $board in +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" + ;; +d-team,pbr-m1|\ +gehua,ghl-r-001) + ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" + ;; +dlink,dir-860l-b1) + ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2" + ;; +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" + ;; +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" + ;; +mtc,wr1201) + ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x0f" + ;; +netgear,r6220|\ +netgear,r6260|\ +netgear,r6350|\ +netgear,r6850|\ +netgear,wndr3700-v5) + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10" + ;; +netgear,r6800) + ucidef_set_led_switch "wan" "WAN" "$boardname:white:wan" "switch0" "0x10" + ucidef_set_led_switch "lan1" "LAN1" "$boardname:white:lan1" "switch0" "0x08" + ucidef_set_led_switch "lan2" "LAN2" "$boardname:white:lan2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "LAN3" "$boardname:white:lan3" "switch0" "0x02" + ucidef_set_led_switch "lan4" "LAN4" "$boardname:white:lan4" "switch0" "0x01" + ;; +tplink,re350-v1|\ +tplink,re650-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" + ;; +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" + ;; +youhua,wr1200js) + ucidef_set_led_switch "internet" "INTERNET" "$boardname:green:wan" "switch0" "0x01" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network new file mode 100755 index 000000000..eac71f039 --- /dev/null +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -0,0 +1,283 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh +. /lib/functions/system.sh + +ramips_setup_interfaces() +{ + local board="$1" + + case $board in + adslr,g7|\ + afoundry,ew1200|\ + d-team,pbr-m1|\ + firefly,firewrt|\ + hiwifi,hc5962|\ + mediatek,ap-mt7621a-v60|\ + mediatek,mt7621-eval-board|\ + mqmaker,witi|\ + mtc,wr1201|\ + phicomm,k2p|\ + planex,vr500|\ + samknows,whitebox-v8|\ + storylink,sap-g3200u3|\ + telco-electronics,x1|\ + totolink,a7000r|\ + unielec,u7621-06-16m|\ + unielec,u7621-06-64m|\ + xiaoyu,xy-c5|\ + xzwifi,creativebox-v1|\ + youku,yk-l2|\ + zbtlink,zbt-we1326|\ + zbtlink,zbt-we3526|\ + zbtlink,zbt-wg2626|\ + zbtlink,zbt-wg3526-16m|\ + zbtlink,zbt-wg3526-32m) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" + ;; + alfa-network,quad-e4g|\ + netgear,r6220|\ + netgear,r6260|\ + netgear,r6350|\ + netgear,r6800|\ + netgear,r6850|\ + netgear,wndr3700-v5|\ + netis,wf-2881|\ + wevo,11acnas|\ + wevo,w2914ns-v2) + ucidef_add_switch "switch0" \ + "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" + ;; + asiarf,ap7621-001) + ucidef_add_switch "switch0" "0:lan" "4:wan" "6@eth0" + ;; + asiarf,ap7621-nv1) + ucidef_add_switch "switch0" "0:wan" "2:lan" "3:lan" "6@eth0" + ;; + asus,rt-ac65p|\ + asus,rt-ac57u|\ + asus,rt-ac85p|\ + mikrotik,rb750gr3|\ + ubiquiti,edgerouterx|\ + ubiquiti,edgerouterx-sfp|\ + youhua,wr1200js) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" + ;; + dlink,dir-860l-b1|\ + elecom,wrc-1167ghbk2-s|\ + elecom,wrc-1900gst|\ + elecom,wrc-2533gst|\ + iodata,wn-ax1167gr|\ + iodata,wn-gx300gr|\ + iodata,wnpr2600g) + ucidef_add_switch "switch0" \ + "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" + ;; + buffalo,wsr-1166dhp|\ + buffalo,wsr-600dhp) + ucidef_add_switch "switch0" \ + "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:wan:5" "6@eth0" + ;; + d-team,newifi-d2) + ucidef_add_switch "switch0" \ + "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0" + ;; + edimax,rg21s) + ucidef_add_switch "switch0" \ + "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" + ;; + gehua,ghl-r-001) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "4:wan" "6@eth0" + ;; + gnubee,gb-pc1|\ + gnubee,gb-pc2) + ucidef_add_switch "switch0" \ + "0:lan" "4:lan" "6@eth0" + ;; + lenovo,newifi-d1) + ucidef_add_switch "switch0" \ + "1:lan:2" "2:lan:1" "4:wan" "6@eth0" + ;; + linksys,re6500) + ucidef_add_switch "switch0" \ + "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "6@eth0" + ;; + mikrotik,rbm11g|\ + thunder,timecloud) + ucidef_add_switch "switch0" + ucidef_add_switch_attr "switch0" "enable" "false" + ucidef_set_interface_lan "eth0" + ;; + mikrotik,rbm33g) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "0:wan" "6@eth0" + ;; + netgear,ex6150|\ + tplink,re350-v1|\ + tplink,re650-v1) + ucidef_add_switch "switch0" \ + "0:lan" "6@eth0" + ;; + xiaomi,mir3g) + ucidef_add_switch "switch0" \ + "2:lan:2" "3:lan:1" "1:wan" "6t@eth0" + ;; + xiaomi,mir3g-v2) + ucidef_add_switch "switch0" \ + "2:lan:2" "3:lan:1" "4:wan" "6@eth0" + ;; + xiaomi,mir3p) + ucidef_add_switch "switch0" \ + "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" + ;; + *) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ;; + esac +} + +ramips_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + local label_mac="" + + case $board in + adslr,g7) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe00c)" 1) + ;; + afoundry,ew1200|\ + asiarf,ap7621-001|\ + asiarf,ap7621-nv1|\ + firefly,firewrt|\ + gehua,ghl-r-001|\ + mqmaker,witi|\ + totolink,a7000r|\ + unielec,u7621-06-16m|\ + unielec,u7621-06-64m|\ + xzwifi,creativebox-v1|\ + zbtlink,zbt-wg2626) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe000)" 1) + ;; + alfa-network,quad-e4g|\ + asus,rt-ac57u|\ + d-team,newifi-d2|\ + d-team,pbr-m1|\ + elecom,wrc-1167ghbk2-s|\ + elecom,wrc-1900gst|\ + elecom,wrc-2533gst|\ + lenovo,newifi-d1|\ + netis,wf-2881|\ + phicomm,k2p|\ + planex,vr500|\ + samknows,whitebox-v8|\ + youhua,wr1200js|\ + youku,yk-l2|\ + zbtlink,zbt-we3526) + wan_mac=$(mtd_get_mac_binary factory 0xe006) + ;; + asus,rt-ac65p|\ + asus,rt-ac85p) + wan_mac=$(mtd_get_mac_ascii u-boot-env et1macaddr) + label_mac=$(mtd_get_mac_binary factory 0x4) + ;; + buffalo,wsr-1166dhp) + local index="$(find_mtd_index "board_data")" + wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)" + lan_mac=$wan_mac + ;; + dlink,dir-860l-b1) + lan_mac=$(mtd_get_mac_ascii factory lanmac) + wan_mac=$(mtd_get_mac_ascii factory wanmac) + label_mac=$(mtd_get_mac_binary radio 0x4) + ;; + edimax,rg21s) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) + wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) + ;; + hiwifi,hc5962) + lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ") + label_mac=$lan_mac + [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address) + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; + iodata,wn-ax1167gr|\ + iodata,wn-gx300gr|\ + mtc,wr1201|\ + netgear,r6220|\ + netgear,wndr3700-v5|\ + xiaoyu,xy-c5) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1) + ;; + iodata,wnpr2600g) + wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) + label_mac=$wan_mac + ;; + mediatek,ap-mt7621a-v60) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x5)" 1) + ;; + mikrotik,rb750gr3) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary hard_config 0x10)" 2) + ;; + mikrotik,rbm33g) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary hard_config 0x10)" 2) + label_mac=$(mtd_get_mac_binary hard_config 0x10) + ;; + netgear,r6260|\ + netgear,r6350|\ + netgear,r6800|\ + netgear,r6850) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 2) + ;; + storylink,sap-g3200u3|\ + telco-electronics,x1) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe006)" 1) + ;; + ubiquiti,edgerouterx|\ + ubiquiti,edgerouterx-sfp) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x22)" 1) + ;; + wevo,11acnas|\ + wevo,w2914ns-v2) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + label_mac=$wan_mac + ;; + xiaomi,mir3g) + lan_mac=$(mtd_get_mac_binary factory 0xe006) + ;; + xiaomi,mir3g-v2) + wan_mac=$(mtd_get_mac_binary factory 0xe006) + label_mac=$wan_mac + ;; + xiaomi,mir3p) + lan_mac=$(mtd_get_mac_binary factory 0xe006) + label_mac=$lan_mac + ;; + zbtlink,zbt-we1326) + wan_mac=$(mtd_get_mac_binary factory 0xe006) + label_mac=$(mtd_get_mac_binary factory 0x4) + ;; + zbtlink,zbt-wg3526-16m|\ + zbtlink,zbt-wg3526-32m) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe000)" 1) + label_mac=$(mtd_get_mac_binary factory 0x4) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} + +board_config_update +board=$(board_name) +ramips_setup_interfaces $board +ramips_setup_macs $board +board_config_flush + +exit 0 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches new file mode 100755 index 000000000..d3bc85f82 --- /dev/null +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches @@ -0,0 +1,30 @@ +#!/bin/sh + +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) + +case "$board" in +mikrotik,rb750gr3) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "17" + ;; +telco-electronics,x1) + ucidef_add_gpio_switch "modem_reset" "Modem Reset" "16" + ;; +ubiquiti,edgerouterx) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "0" + ;; +ubiquiti,edgerouterx-sfp) + ucidef_add_gpio_switch "poe_power_port0" "PoE Power Port0" "496" + ucidef_add_gpio_switch "poe_power_port1" "PoE Power Port1" "497" + ucidef_add_gpio_switch "poe_power_port2" "PoE Power Port2" "498" + ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "499" + ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "500" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount new file mode 100755 index 000000000..b4d72abaf --- /dev/null +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common + +START=99 + +boot() { + case $(board_name) in + alfa-network,quad-e4g) + [ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\ + echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s - + ;; + samknows,whitebox-v8) + fw_setenv bootcount 0 + ;; + esac +} diff --git a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration new file mode 100644 index 000000000..e745c2c5d --- /dev/null +++ b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration @@ -0,0 +1,16 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/migrations.sh + +board=$(board_name) + +case "$board" in +netgear,wndr3700-v5) + migrate_leds "^wndr3700v5:=wndr3700-v5:" + ;; +esac + +migrations_apply system + +exit 0 diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh similarity index 66% rename from target/linux/ramips/base-files/lib/upgrade/platform.sh rename to target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 3b967aac8..5c6863b1e 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -12,38 +12,11 @@ platform_check_image() { return 0 } -platform_pre_upgrade() { - local board=$(board_name) - - case "$board" in - mikrotik,rb750gr3|\ - mikrotik,rbm11g|\ - mikrotik,rbm33g) - [ -z "$(rootfs_type)" ] && mtd erase firmware - ;; - esac -} - -platform_nand_pre_upgrade() { - local board=$(board_name) - - case "$board" in - ubnt-erx|\ - ubnt-erx-sfp) - platform_upgrade_ubnt_erx "$1" - ;; - esac -} - platform_do_upgrade() { local board=$(board_name) case "$board" in - alfa-network,ac1200rm|\ - alfa-network,awusfree1|\ - alfa-network,quad-e4g|\ - alfa-network,r36m-e4g|\ - alfa-network,tube-e4g) + alfa-network,quad-e4g) [ "$(fw_printenv -n dual_image 2>/dev/null)" = "1" ] &&\ [ -n "$(find_mtd_part backup)" ] && { PART_NAME=backup @@ -53,20 +26,37 @@ platform_do_upgrade() { fw_setenv bootactive 1 || exit 1 fi } - default_do_upgrade "$1" ;; - hc5962|\ - r6220|\ + mikrotik,rb750gr3|\ + mikrotik,rbm11g|\ + mikrotik,rbm33g) + [ -z "$(rootfs_type)" ] && mtd erase firmware + ;; + asus,rt-ac65p|\ + asus,rt-ac85p) + echo "Backing up firmware" + dd if=/dev/mtd4 bs=1024 count=4096 > /tmp/backup_firmware.bin + dd if=/dev/mtd5 bs=1024 count=52224 >> /tmp/backup_firmware.bin + mtd -e firmware2 write /tmp/backup_firmware.bin firmware2 + ;; + esac + + case "$board" in + asus,rt-ac65p|\ + asus,rt-ac85p|\ + hiwifi,hc5962|\ + netgear,r6220|\ + netgear,r6260|\ netgear,r6350|\ - ubnt-erx|\ - ubnt-erx-sfp|\ + netgear,r6800|\ + netgear,r6850|\ xiaomi,mir3g|\ xiaomi,mir3p) nand_do_upgrade "$1" ;; - tplink,c50-v4) - MTD_ARGS="-t romfile" - default_do_upgrade "$1" + ubiquiti,edgerouterx|\ + ubiquiti,edgerouterx-sfp) + platform_upgrade_ubnt_erx "$1" ;; *) default_do_upgrade "$1" diff --git a/target/linux/ramips/base-files/lib/upgrade/ubnt.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/ubnt.sh similarity index 98% rename from target/linux/ramips/base-files/lib/upgrade/ubnt.sh rename to target/linux/ramips/mt7621/base-files/lib/upgrade/ubnt.sh index 316a70444..748ec8e62 100644 --- a/target/linux/ramips/base-files/lib/upgrade/ubnt.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/ubnt.sh @@ -73,4 +73,6 @@ platform_upgrade_ubnt_erx() { fi ubnt_update_target_kernel ${factory_mtd} ${kernel_part} || exit 1 + + nand_do_upgrade "$1" } diff --git a/target/linux/ramips/base-files/sbin/fixup-mac-address b/target/linux/ramips/mt7621/base-files/sbin/fixup-mac-address similarity index 97% rename from target/linux/ramips/base-files/sbin/fixup-mac-address rename to target/linux/ramips/mt7621/base-files/sbin/fixup-mac-address index 309db8ce4..dad15c584 100755 --- a/target/linux/ramips/base-files/sbin/fixup-mac-address +++ b/target/linux/ramips/mt7621/base-files/sbin/fixup-mac-address @@ -9,8 +9,7 @@ YES= board=$(board_name) case $board in - mqmaker,witi-256m|\ - mqmaker,witi-512m) + mqmaker,witi) partname=factory offset=$((0xe000)) ;; diff --git a/target/linux/ramips/mt7621/profiles/00-default.mk b/target/linux/ramips/mt7621/profiles/00-default.mk index bf293d316..dbfd26ed7 100644 --- a/target/linux/ramips/mt7621/profiles/00-default.mk +++ b/target/linux/ramips/mt7621/profiles/00-default.mk @@ -9,7 +9,7 @@ define Profile/Default NAME:=Default Profile PRIORITY:=1 PACKAGES:=\ - kmod-usb-core kmod-usb3 \ + kmod-usb3 \ kmod-usb-ledtrig-usbport endef diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds new file mode 100755 index 000000000..f397da14a --- /dev/null +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -0,0 +1,138 @@ +#!/bin/sh + +. /lib/functions/leds.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 + +led_wlan="$(get_dt_led wlan)" +[ -n "$led_wlan" ] && ucidef_set_led_wlan "wifi_led" "wifi" "$led_wlan" "phy0tpt" + +case $board in +alfa-network,awusfree1) + set_wifi_led "$boardname:blue:wlan" + ;; +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" + ;; +glinet,gl-mt300n-v2) + set_wifi_led "$boardname:red:wlan" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x1" + ;; +hilink,hlk-7628n|\ +skylab,skw92a) + set_wifi_led "$boardname:green:wlan" + ;; +hiwifi,hc5661a|\ +hiwifi,hc5761a) + ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10" + ;; +mediatek,linkit-smart-7688) + ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt" + ;; +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" + ;; +rakwireless,rak633) + set_wifi_led "$boardname:blue:wifi" + ;; +tama,w06) + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" + ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt" + ;; +tplink,archer-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,archer-c50-v3|\ +tplink,archer-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-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-wa801nd-v5) + ucidef_set_led_wlan "wlan" "wlan" "$boardname:green:wlan" "phy0tpt" + ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0" + ;; +tplink,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" + ;; +tplink,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,tl-wr841n-v14) + 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" + ;; +unielec,u7628-01-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" + ;; +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" + ;; +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" + ;; +zyxel,keenetic-extra-ii) + set_wifi_led "$boardname:green:wifi" + ucidef_set_led_switch "internet" "internet" "$boardname:green:internet" "switch0" "0x01" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network new file mode 100755 index 000000000..aeaf29698 --- /dev/null +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -0,0 +1,219 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh +. /lib/functions/system.sh + +ramips_setup_interfaces() +{ + local board="$1" + + case $board in + alfa-network,awusfree1|\ + d-team,pbr-d1|\ + tama,w06|\ + tplink,tl-mr3020-v3|\ + tplink,tl-wr802n-v4) + ucidef_set_interface_lan "eth0" + ;; + buffalo,wcr-1166ds) + ucidef_add_switch "switch0" \ + "3:lan" "4:wan" "6@eth0" + ;; + cudy,wr1000) + ucidef_add_switch "switch0" \ + "2:lan:2" "3:lan:1" "4:wan" "6@eth0" + ;; + duzun,dm06) + ucidef_add_switch "switch0" \ + "1:lan" "0:wan" "6@eth0" + ;; + glinet,gl-mt300n-v2) + ucidef_add_switch "switch0" \ + "1:lan" "0:wan" "6@eth0" + ;; + glinet,vixmini) + ucidef_add_switch "switch0" \ + "0:lan" "6@eth0" + ;; + hilink,hlk-7628n|\ + hiwifi,hc5861b|\ + skylab,skw92a|\ + tplink,archer-c20-v4|\ + tplink,archer-c50-v3|\ + tplink,archer-c50-v4|\ + tplink,tl-mr3420-v5|\ + tplink,tl-wr840n-v4|\ + tplink,tl-wr840n-v5|\ + tplink,tl-wr841n-v13|\ + tplink,tl-wr841n-v14|\ + tplink,tl-wr842n-v5|\ + unielec,u7628-01-16m|\ + wrtnode,wrtnode2p|\ + wrtnode,wrtnode2r|\ + zyxel,keenetic-extra-ii) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" + ;; + hiwifi,hc5661a|\ + hiwifi,hc5761a|\ + mediatek,mt7628an-eval-board|\ + mercury,mac1200r-v2|\ + totolink,lr1200|\ + wavlink,wl-wn570ha1|\ + wavlink,wl-wn575a3|\ + xiaomi,miwifi-nano) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" + ;; + iptime,a3) + ucidef_add_switch "switch0" \ + "2:lan:2" "3:lan:1" "0:wan" "6@eth0" + ;; + iptime,a604m) + ucidef_add_switch "switch0" \ + "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" + ;; + mediatek,linkit-smart-7688|\ + onion,omega2p|\ + onion,omega2|\ + tplink,tl-wa801nd-v5|\ + widora,neo-16m|\ + widora,neo-32m) + ucidef_add_switch "switch0" + ucidef_add_switch_attr "switch0" "enable" "false" + ucidef_set_interface_lan "eth0" + ;; + netgear,r6120) + ucidef_add_switch "switch0" \ + "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" + ;; + rakwireless,rak633) + ucidef_add_switch "switch0" \ + "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" + ;; + tplink,tl-wr902ac-v3) + ucidef_add_switch "switch0" \ + "4:lan" "6@eth0" + ;; + vocore,vocore2|\ + vocore,vocore2-lite) + ucidef_add_switch "switch0" \ + "0:lan" "2:lan" "6t@eth0" + ;; + wiznet,wizfi630s) + ucidef_add_switch "switch0" \ + "0:wan" "3:lan" "4:lan" "6@eth0" + ;; + xiaomi,mir4a-100m) + ucidef_add_switch "switch0" \ + "4:lan:1" "2:lan:2" "0:wan" "6@eth0" + ;; + zbtlink,zbt-we1226) + ucidef_add_switch "switch0" \ + "0:lan:2" "1:lan:1" "4:wan" "6@eth0" + ;; + *) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ;; + esac +} + +ramips_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + local label_mac="" + + case $board in + buffalo,wcr-1166ds) + local index="$(find_mtd_index "board_data")" + wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)" + lan_mac=$wan_mac + ;; + cudy,wr1000) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + label_mac=$(mtd_get_mac_binary factory 0x8) + ;; + duzun,dm06|\ + netgear,r6120|\ + wrtnode,wrtnode2p|\ + wrtnode,wrtnode2r|\ + zyxel,keenetic-extra-ii) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1) + ;; + hilink,hlk-7628n) + lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)") + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; + hiwifi,hc5661a|\ + hiwifi,hc5761a|\ + hiwifi,hc5861b) + lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ") + label_mac=$lan_mac + [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address) + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; + iptime,a3|\ + iptime,a604m) + wan_mac=$(mtd_get_mac_binary u-boot 0x1fc40) + ;; + mediatek,linkit-smart-7688|\ + onion,omega2|\ + onion,omega2p) + wan_mac=$(mtd_get_mac_binary factory 0x4) + lan_mac=$(mtd_get_mac_binary factory 0x2e) + ;; + mercury,mac1200r-v2) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory_info 0xd)" 1) + ;; + rakwireless,rak633|\ + unielec,u7628-01-16m|\ + wavlink,wl-wn575a3|\ + wiznet,wizfi630s|\ + xiaomi,miwifi-nano) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x28)" 1) + ;; + skylab,skw92a|\ + totolink,lr1200) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + ;; + tplink,archer-c20-v4|\ + tplink,archer-c50-v3|\ + tplink,tl-mr3420-v5|\ + tplink,tl-wr840n-v4|\ + tplink,tl-wr840n-v5|\ + tplink,tl-wr841n-v13|\ + tplink,tl-wr841n-v14|\ + tplink,tl-wr842n-v5) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xf100)" 1) + ;; + tplink,archer-c50-v4) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary rom 0xf100)" 1) + ;; + vocore,vocore2|\ + vocore,vocore2-lite) + label_mac=$(mtd_get_mac_binary factory 0x8) + ;; + wavlink,wl-wn570ha1|\ + zbtlink,zbt-we1226) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x2e)" 1) + ;; + xiaomi,mir4a-100m) + wan_mac=$(mtd_get_mac_binary factory 0x4) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} + +board_config_update +board=$(board_name) +ramips_setup_interfaces $board +ramips_setup_macs $board +board_config_flush + +exit 0 diff --git a/target/linux/ramips/mt76x8/base-files/etc/init.d/bootcount b/target/linux/ramips/mt76x8/base-files/etc/init.d/bootcount new file mode 100755 index 000000000..3c21433cc --- /dev/null +++ b/target/linux/ramips/mt76x8/base-files/etc/init.d/bootcount @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common + +START=99 + +boot() { + case $(board_name) in + alfa-network,awusfree1) + [ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\ + echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s - + ;; + xiaomi,miwifi-nano) + fw_setenv flag_boot_success 1 + ;; + esac +} diff --git a/target/linux/ramips/mt76x8/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/mt76x8/base-files/etc/uci-defaults/04_led_migration new file mode 100644 index 000000000..3f9f615c1 --- /dev/null +++ b/target/linux/ramips/mt76x8/base-files/etc/uci-defaults/04_led_migration @@ -0,0 +1,22 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/migrations.sh + +board=$(board_name) + +case "$board" in +tplink,archer-c20-v4) + migrate_leds "^c20-v4:=archer-c20-v4:" + ;; +tplink,archer-c50-v3) + migrate_leds "^c50-v3:=archer-c50-v3:" + ;; +tplink,archer-c50-v4) + migrate_leds "^c50-v4:=archer-c50-v4:" + ;; +esac + +migrations_apply system + +exit 0 diff --git a/target/linux/ramips/mt76x8/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt76x8/base-files/lib/upgrade/platform.sh new file mode 100755 index 000000000..a3de97abf --- /dev/null +++ b/target/linux/ramips/mt76x8/base-files/lib/upgrade/platform.sh @@ -0,0 +1,39 @@ +# +# Copyright (C) 2010 OpenWrt.org +# + +PART_NAME=firmware +REQUIRE_IMAGE_METADATA=1 + +RAMFS_COPY_BIN='fw_printenv fw_setenv' +RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' + +platform_check_image() { + return 0 +} + +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + alfa-network,awusfree1) + [ "$(fw_printenv -n dual_image 2>/dev/null)" = "1" ] &&\ + [ -n "$(find_mtd_part backup)" ] && { + PART_NAME=backup + if [ "$(fw_printenv -n bootactive 2>/dev/null)" = "1" ]; then + fw_setenv bootactive 2 || exit 1 + else + fw_setenv bootactive 1 || exit 1 + fi + } + default_do_upgrade "$1" + ;; + tplink,archer-c50-v4) + MTD_ARGS="-t romfile" + default_do_upgrade "$1" + ;; + *) + default_do_upgrade "$1" + ;; + esac +} diff --git a/target/linux/ramips/mt76x8/config-4.14 b/target/linux/ramips/mt76x8/config-4.14 index 00de57685..21cf07037 100644 --- a/target/linux/ramips/mt76x8/config-4.14 +++ b/target/linux/ramips/mt76x8/config-4.14 @@ -40,7 +40,6 @@ CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS32_R1 is not set CONFIG_CPU_MIPS32_R2=y CONFIG_CPU_MIPSR2=y -CONFIG_CPU_MIPSR2_IRQ_VI=y CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_R4K_FPU=y @@ -84,7 +83,6 @@ CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set # CONFIG_HAVE_ARCH_BITREVERSE is not set -CONFIG_HAVE_ARCH_COMPILER_H=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y @@ -133,11 +131,9 @@ CONFIG_LIBFDT=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MFD_SYSCON=y -CONFIG_MIGRATION=y CONFIG_MIPS=y CONFIG_MIPS_ASID_BITS=8 CONFIG_MIPS_ASID_SHIFT=0 -CONFIG_MIPS_CBPF_JIT=y CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set # CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set diff --git a/target/linux/ramips/mt76x8/profiles/00-default.mk b/target/linux/ramips/mt76x8/profiles/00-default.mk index 162ac1431..83886eee5 100644 --- a/target/linux/ramips/mt76x8/profiles/00-default.mk +++ b/target/linux/ramips/mt76x8/profiles/00-default.mk @@ -8,7 +8,7 @@ define Profile/Default NAME:=Default Profile PRIORITY:=1 - PACKAGES:= kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + PACKAGES:= kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport endef define Profile/Default/Description diff --git a/target/linux/ramips/mt76x8/target.mk b/target/linux/ramips/mt76x8/target.mk index 4fc448915..f8b21eac0 100644 --- a/target/linux/ramips/mt76x8/target.mk +++ b/target/linux/ramips/mt76x8/target.mk @@ -4,7 +4,7 @@ SUBTARGET:=mt76x8 BOARDNAME:=MT76x8 based boards -FEATURES+=usb +FEATURES+=usb ramdisk CPU_TYPE:=24kc DEFAULT_PACKAGES += kmod-mt7603 wpad-basic diff --git a/target/linux/ramips/patches-4.14/0039-mtd-add-mt7621-nand-support.patch b/target/linux/ramips/patches-4.14/0039-mtd-add-mt7621-nand-support.patch index 03b2b36db..3c6a59b86 100644 --- a/target/linux/ramips/patches-4.14/0039-mtd-add-mt7621-nand-support.patch +++ b/target/linux/ramips/patches-4.14/0039-mtd-add-mt7621-nand-support.patch @@ -4256,7 +4256,7 @@ Signed-off-by: John Crispin +#endif /* __NAND_DEF_H__ */ --- /dev/null +++ b/drivers/mtd/nand/nand_device_list.h -@@ -0,0 +1,59 @@ +@@ -0,0 +1,60 @@ +/* Copyright Statement: + * + * This software/firmware and related documentation ("MediaTek Software") are @@ -4308,6 +4308,7 @@ Signed-off-by: John Crispin + {0xC8DC, 0x909554, 5, 8, 512, 128, 2048, 64, 0x30C77fff, "F59L4G81A", 0}, + {0xECD3, 0x519558, 5, 8, 1024, 128, 2048, 64, 0x44333, "K9K8G8000", 0}, + {0xC2F1, 0x801DC2, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "MX30LF1G08AA", 0}, ++ {0xC2F1, 0x809502, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "MX30LF1G18AC", 0}, + {0x98D3, 0x902676, 5, 8, 1024, 256, 4096, 224, 0x00C25332, "TC58NVG3S0F", 0}, + {0x01DA, 0x909546, 5, 8, 256, 128, 2048, 128, 0x30C77fff, "S34ML02G200TF", 0}, + {0x01DC, 0x909556, 5, 8, 512, 128, 2048, 128, 0x30C77fff, "S34ML04G200TF", 0}, diff --git a/target/linux/ramips/patches-4.14/105-mt7621-memory-detect.patch b/target/linux/ramips/patches-4.14/105-mt7621-memory-detect.patch index 13e14f507..b19b57fd6 100644 --- a/target/linux/ramips/patches-4.14/105-mt7621-memory-detect.patch +++ b/target/linux/ramips/patches-4.14/105-mt7621-memory-detect.patch @@ -114,7 +114,7 @@ Signed-off-by: Chuanhong Guo --- a/arch/mips/ralink/of.c +++ b/arch/mips/ralink/of.c -@@ -106,6 +106,8 @@ void __init plat_mem_setup(void) +@@ -89,6 +89,8 @@ void __init plat_mem_setup(void) of_scan_flat_dt(early_init_dt_find_memory, NULL); if (memory_dtb) of_scan_flat_dt(early_init_dt_scan_memory, NULL); diff --git a/target/linux/ramips/rt288x/base-files/etc/board.d/01_leds b/target/linux/ramips/rt288x/base-files/etc/board.d/01_leds new file mode 100755 index 000000000..a042ecfbd --- /dev/null +++ b/target/linux/ramips/rt288x/base-files/etc/board.d/01_leds @@ -0,0 +1,34 @@ +#!/bin/sh + +. /lib/functions/leds.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 + +led_wlan="$(get_dt_led wlan)" +[ -n "$led_wlan" ] && ucidef_set_led_wlan "wifi_led" "wifi" "$led_wlan" "phy0tpt" + +case $board in +airlink101,ar670w|\ +airlink101,ar725w) + set_wifi_led "rt2800soc-phy0::radio" + ;; +belkin,f5d8235-v1) + set_wifi_led "$boardname:blue:wireless" + ;; +ralink,v11st-fe) + set_wifi_led "rt2800pci-phy0::radio" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ramips/rt288x/base-files/etc/board.d/02_network b/target/linux/ramips/rt288x/base-files/etc/board.d/02_network new file mode 100755 index 000000000..0cc0e0b28 --- /dev/null +++ b/target/linux/ramips/rt288x/base-files/etc/board.d/02_network @@ -0,0 +1,67 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh +. /lib/functions/system.sh + +ramips_setup_interfaces() +{ + local board="$1" + + case $board in + airlink101,ar670w|\ + airlink101,ar725w) + ucidef_add_switch "switch0" \ + "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" + ;; + asus,rt-n15) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" + ;; + belkin,f5d8235-v1|\ + buffalo,wzr-agl300nh|\ + ralink,v11st-fe) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0" + ;; + buffalo,wli-tx4-ag300n|\ + dlink,dap-1522-a1) + ucidef_set_interface_lan "eth0" + ;; + *) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ;; + esac +} + +ramips_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + local label_mac="" + + case $board in + airlink101,ar670w) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x2004)" 1) + ;; + airlink101,ar725w|\ + asus,rt-n15|\ + belkin,f5d8235-v1|\ + buffalo,wzr-agl300nh) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} + +board_config_update +board=$(board_name) +ramips_setup_interfaces $board +ramips_setup_macs $board +board_config_flush + +exit 0 diff --git a/target/linux/ramips/rt288x/base-files/lib/upgrade/platform.sh b/target/linux/ramips/rt288x/base-files/lib/upgrade/platform.sh new file mode 100755 index 000000000..786d57fc7 --- /dev/null +++ b/target/linux/ramips/rt288x/base-files/lib/upgrade/platform.sh @@ -0,0 +1,20 @@ +# +# Copyright (C) 2010 OpenWrt.org +# + +PART_NAME=firmware +REQUIRE_IMAGE_METADATA=1 + +platform_check_image() { + return 0 +} + +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + *) + default_do_upgrade "$1" + ;; + esac +} diff --git a/target/linux/ramips/rt288x/config-4.14 b/target/linux/ramips/rt288x/config-4.14 index cbeca7fd1..9c713fd2b 100644 --- a/target/linux/ramips/rt288x/config-4.14 +++ b/target/linux/ramips/rt288x/config-4.14 @@ -75,7 +75,6 @@ CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set # CONFIG_HAVE_ARCH_BITREVERSE is not set -CONFIG_HAVE_ARCH_COMPILER_H=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y @@ -123,11 +122,9 @@ CONFIG_IRQ_WORK=y CONFIG_LIBFDT=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y -CONFIG_MIGRATION=y CONFIG_MIPS=y CONFIG_MIPS_ASID_BITS=8 CONFIG_MIPS_ASID_SHIFT=0 -CONFIG_MIPS_CBPF_JIT=y CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set # CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set diff --git a/target/linux/ramips/rt305x/base-files/etc/board.d/01_leds b/target/linux/ramips/rt305x/base-files/etc/board.d/01_leds new file mode 100755 index 000000000..ae813e85d --- /dev/null +++ b/target/linux/ramips/rt305x/base-files/etc/board.d/01_leds @@ -0,0 +1,109 @@ +#!/bin/sh + +. /lib/functions/leds.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 + +led_wlan="$(get_dt_led wlan)" +[ -n "$led_wlan" ] && ucidef_set_led_wlan "wifi_led" "wifi" "$led_wlan" "phy0tpt" + +case $board in +7links,px-4885-4m|\ +7links,px-4885-8m) + set_wifi_led "px-4885:orange:wifi" + ;; +airlive,air3gii|\ +aximcom,mr-102n|\ +edimax,3g-6200nl|\ +netgear,wnce2001) + set_wifi_led "$boardname:green:wlan" + ;; +alfa-network,w502u|\ +dlink,dir-300-b1|\ +dlink,dir-300-b7|\ +dlink,dir-320-b1|\ +dlink,dir-600-b1|\ +dlink,dir-610-a1|\ +dlink,dir-615-d|\ +dlink,dir-615-h1|\ +dlink,dir-620-a1|\ +engenius,esr-9753|\ +hilink,hlk-rm04|\ +nexx,wt1520-4m|\ +nexx,wt1520-8m|\ +skyline,sl-r7205|\ +tenda,w306r-v2|\ +zyxel,keenetic-start|\ +zyxel,keenetic|\ +zyxel,nbg-419n-v2) + set_wifi_led "rt2800pci-phy0::radio" + ;; +allnet,all0256n-4m|\ +allnet,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" + ;; +alphanetworks,asl26555-8m|\ +alphanetworks,asl26555-16m) + ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0" + set_wifi_led "asl26555:green:wlan" + ;; +asiarf,awapn2403) + set_wifi_led "rt2800soc-phy0::radio" + ;; +dlink,dcs-930l-b1) + ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps" + ;; +dlink,dir-620-d1|\ +trendnet,tew-714tru) + set_wifi_led "$boardname:green:wifi" + ;; +edimax,3g-6200n|\ +planex,mzk-w300nh2) + set_wifi_led "$boardname:amber:wlan" + ;; +fon,fonera-20n) + set_wifi_led "$boardname:orange:wifi" + ;; +hauppauge,broadway) + set_wifi_led "$boardname:red:wps_active" + ;; +hootoo,ht-tm02) + ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:lan" "eth0" + set_wifi_led "$boardname:blue:wlan" + ;; +huawei,hg255d) + set_wifi_led "$boardname:green:wlan" + ucidef_set_led_netdev "internet" "internet" "$boardname:green:internet" "eth0.2" + ;; +intenso,memory2move) + set_wifi_led "$boardname:blue:wifi" + ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:wan" "eth0" + ;; +omnima,miniembplug) + set_wifi_led "$boardname:red:wlan" + ;; +vocore,vocore-8m|\ +vocore,vocore-16m) + ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0" + ;; +zorlik,zl5900v2) + ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" eth0 + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ramips/rt305x/base-files/etc/board.d/02_network b/target/linux/ramips/rt305x/base-files/etc/board.d/02_network new file mode 100755 index 000000000..5efcd5395 --- /dev/null +++ b/target/linux/ramips/rt305x/base-files/etc/board.d/02_network @@ -0,0 +1,290 @@ +#!/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 + accton,wr6202|\ + alfa-network,w502u|\ + netcore,nw718|\ + petatel,psr-680w|\ + skyline,sl-r7205|\ + upvel,ur-336un) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ;; + allnet,all0256n-4m|\ + allnet,all0256n-8m|\ + allnet,all5002|\ + allnet,all5003|\ + dlink,dcs-930l-b1|\ + dlink,dcs-930|\ + hame,mpr-a2|\ + hauppauge,broadway|\ + hootoo,ht-tm02|\ + intenso,memory2move|\ + netgear,wnce2001|\ + tenda,3g150b|\ + tenda,3g300m|\ + tenda,w150m|\ + unbranded,a5-v11|\ + wansview,ncs601w|\ + zorlik,zl5900v2) + ucidef_add_switch "switch0" + ucidef_add_switch_attr "switch0" "enable" "false" + ucidef_set_interface_lan "eth0" + ;; + alphanetworks,asl26555-8m|\ + alphanetworks,asl26555-16m) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" + ;; + argus,atp-52b|\ + asiarf,awm002-evb-4m|\ + asiarf,awm002-evb-8m|\ + jcg,jhr-n805r|\ + jcg,jhr-n825r|\ + jcg,jhr-n926r|\ + planex,mzk-wdpr|\ + upvel,ur-326n4g) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" + ;; + asiarf,awapn2403) + ucidef_add_switch "switch0" \ + "0:lan" "1:wan" "6@eth0" + ;; + asus,wl-330n|\ + easyacc,wizard-8800) + ucidef_set_interface_lan "eth0.1" + ;; + aximcom,mr-102n) + ucidef_set_interface_lan "eth0.2" + ;; + belkin,f5d8235-v2|\ + trendnet,tew-714tru) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0" + ;; + buffalo,whr-g300n|\ + dlink,dir-300-b7|\ + dlink,dir-320-b1|\ + dlink,dir-610-a1|\ + edimax,3g-6200n|\ + hilink,hlk-rm04|\ + nixcore,x1-16m|\ + nixcore,x1-8m|\ + planex,mzk-w300nh2|\ + zyxel,keenetic) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" + ;; + dlink,dir-615-h1) + ucidef_add_switch "switch0" \ + "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0" + ;; + huawei,d105) + ucidef_set_interface_lan "eth0" + ;; + huawei,hg255d) + ucidef_add_switch "switch0" \ + "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" + ;; + nexx,wt1520-4m|\ + nexx,wt1520-8m) + ucidef_add_switch "switch0" \ + "0:lan" "4:wan" "6@eth0" + ;; + planex,mzk-dp150n|\ + vocore,vocore-8m|\ + vocore,vocore-16m) + ucidef_add_switch "switch0" \ + "0:lan" "4:lan" "6t@eth0" + ;; + sitecom,wl-351) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" + ;; + sparklan,wcr-150gn) + ucidef_add_switch "switch0" \ + "0:lan" "6t@eth0" + ;; + trendnet,tew-638apb-v2) + ucidef_add_switch "switch0" \ + "4:lan" "6@eth0" + ;; + wiznet,wizfi630a) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2: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=$(grep -E "(RT3.5|RT5350)" /proc/cpuinfo) + 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="" + local label_mac="" + + case $board in + 7links,px-4885-4m|\ + 7links,px-4885-8m) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary devconf 0x28)" 1) + ;; + 8devices,carambola|\ + alfa-network,w502u|\ + arcwireless,freestation5|\ + netgear,wnce2001) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + ;; + accton,wr6202|\ + asiarf,awm002-evb-4m|\ + asiarf,awm002-evb-8m|\ + asus,rt-n13u|\ + aztech,hw550-3g|\ + fon,fonera-20n|\ + huawei,hg255d|\ + omnima,miniembwifi|\ + planex,mzk-wdpr|\ + poray,ip2202|\ + teltonika,rut5xx|\ + unbranded,xdx-rn502j|\ + zyxel,keenetic|\ + zyxel,nbg-419n|\ + zyxel,nbg-419n-v2) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x28)" 1) + ;; + airlive,air3gii|\ + argus,atp-52b|\ + asus,wl-330n3g|\ + dlink,dir-620-d1|\ + edimax,3g-6200n|\ + edimax,3g-6200nl|\ + netcore,nw718|\ + nexx,wt1520-4m|\ + nexx,wt1520-8m|\ + nixcore,x1-16m|\ + nixcore,x1-8m|\ + olimex,rt5350f-olinuxino|\ + olimex,rt5350f-olinuxino-evb|\ + omnima,miniembplug|\ + planex,mzk-w300nh2|\ + sitecom,wl-351|\ + trendnet,tew-714tru) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1) + ;; + asus,rt-g32-b1|\ + asus,rt-n10-plus) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary devconf 0x4)" 1) + ;; + belkin,f5d8235-v2) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary uboot 0x40004)" 1) + ;; + dlink,dir-300-b7|\ + dlink,dir-320-b1|\ + dlink,dir-620-a1|\ + engenius,esr-9753|\ + hame,mpr-a1|\ + hauppauge,broadway|\ + huawei,d105|\ + hilink,hlk-rm04|\ + nexaira,bc2|\ + petatel,psr-680w|\ + skyline,sl-r7205) + lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)") + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; + dlink,dap-1350) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary devdata 0x2e)" 1) + ;; + dlink,dir-300-b1|\ + dlink,dir-600-b1|\ + dlink,dir-610-a1) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary devdata 0x4004)" 1) + ;; + dlink,dir-615-d) + label_mac=$(mtd_get_mac_binary devdata 0x4004) + ;; + dlink,dir-615-h1) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x28)" 1) + label_mac=$(mtd_get_mac_binary factory 0x4) + ;; + dlink,dwr-512-b) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary config 0xe07e)" 1) + ;; + jcg,jhr-n805r|\ + jcg,jhr-n825r|\ + jcg,jhr-n926r) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x2e)" 1) + ;; + poray,m3|\ + poray,m4-4m|\ + poray,m4-8m|\ + poray,x5|\ + poray,x8) + lan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" -2) + ;; + sparklan,wcr-150gn|\ + wiznet,wizfi630a) + wan_mac=$(mtd_get_mac_binary factory 0x28) + ;; + tenda,w306r-v2) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x28)" 5) + ;; + upvel,ur-326n4g|\ + upvel,ur-336un) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4004)" 1) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} + +board_config_update +board=$(board_name) +ramips_setup_interfaces $board +ramips_setup_macs $board +board_config_flush + +exit 0 diff --git a/target/linux/ramips/rt305x/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/rt305x/base-files/etc/uci-defaults/04_led_migration new file mode 100644 index 000000000..b1a94bf81 --- /dev/null +++ b/target/linux/ramips/rt305x/base-files/etc/uci-defaults/04_led_migration @@ -0,0 +1,19 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/migrations.sh + +board=$(board_name) + +case "$board" in +fon,fonera-20n) + migrate_leds "^fonera20n:=fonera-20n:" + ;; +intenso,memory2move) + migrate_leds "^m2m:=memory2move:" + ;; +esac + +migrations_apply system + +exit 0 diff --git a/target/linux/ramips/base-files/lib/preinit/04_handle_checksumming b/target/linux/ramips/rt305x/base-files/lib/preinit/04_handle_checksumming similarity index 65% rename from target/linux/ramips/base-files/lib/preinit/04_handle_checksumming rename to target/linux/ramips/rt305x/base-files/lib/preinit/04_handle_checksumming index 007abf79f..9a2361d05 100644 --- a/target/linux/ramips/base-files/lib/preinit/04_handle_checksumming +++ b/target/linux/ramips/rt305x/base-files/lib/preinit/04_handle_checksumming @@ -11,7 +11,7 @@ do_checksumming_disable() { local board=$(board_name) case "$board" in - wnce2001) + netgear,wnce2001) echo "Board is WNCE2001, updating checksum partition..." local zeroes=/dev/zero local tmpfile=/tmp/wnce2001_checksum @@ -35,19 +35,6 @@ do_checksumming_disable() { echo "Checksum is already zero, nothing to do." fi ;; - rt-n56u) - echo "Board is ASUS RT-N56U, replacing uImage header..." - local firmware_mtd=$(find_mtd_part firmware) - local rootfs_mtd=$(find_mtd_part rootfs) - local rootfs_data_mtd=$(find_mtd_part rootfs_data) - local rootfs_len=$(grep \"rootfs\" /proc/mtd | awk -F' ' '{print "0x"$2}') - local rootfs_data_len=$(grep \"rootfs_data\" /proc/mtd | awk -F' ' '{print "0x"$2}') - local offset=$(echo "$rootfs_len $rootfs_data_len 0x40" | awk -F' ' '{printf "%i",$1-$2-$3}') - local signature=$(dd if=$rootfs_mtd skip=$offset bs=1 count=4 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"') - if [ "$signature" = "27051956" ]; then - dd conv=notrunc if=$rootfs_mtd skip=$offset of=$firmware_mtd bs=1 count=64 2>/dev/null - fi - ;; esac return 0 diff --git a/target/linux/ramips/rt305x/base-files/lib/upgrade/platform.sh b/target/linux/ramips/rt305x/base-files/lib/upgrade/platform.sh new file mode 100755 index 000000000..786d57fc7 --- /dev/null +++ b/target/linux/ramips/rt305x/base-files/lib/upgrade/platform.sh @@ -0,0 +1,20 @@ +# +# Copyright (C) 2010 OpenWrt.org +# + +PART_NAME=firmware +REQUIRE_IMAGE_METADATA=1 + +platform_check_image() { + return 0 +} + +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + *) + default_do_upgrade "$1" + ;; + esac +} diff --git a/target/linux/ramips/rt305x/config-4.14 b/target/linux/ramips/rt305x/config-4.14 index 76e875dbe..60197a1eb 100644 --- a/target/linux/ramips/rt305x/config-4.14 +++ b/target/linux/ramips/rt305x/config-4.14 @@ -5,26 +5,20 @@ CONFIG_ARCH_HAS_ELF_RANDOMIZE=y # CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set CONFIG_ARCH_HAS_RESET_CONTROLLER=y # CONFIG_ARCH_HAS_SG_CHAIN is not set -# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set -# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y -CONFIG_ARCH_MMAP_RND_BITS_MAX=15 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_QUEUED_RWLOCKS=y -CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_CEVT_R4K=y CONFIG_CEVT_SYSTICK_QUIRK=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKEVT_RT3352=y CONFIG_CLKSRC_MMIO=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="rootfstype=squashfs,jffs2" CONFIG_CMDLINE_BOOL=y @@ -57,10 +51,8 @@ CONFIG_FIXED_PHY=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_GENERIC_CPU_AUTOPROBE=y CONFIG_GENERIC_IO=y CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PCI_IOMAP=y CONFIG_GENERIC_PHY=y @@ -70,7 +62,6 @@ CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y CONFIG_GPIO_RALINK=y CONFIG_GPIO_SYSFS=y -# CONFIG_GRO_CELLS is not set CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y @@ -78,7 +69,6 @@ CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set # CONFIG_HAVE_ARCH_BITREVERSE is not set -CONFIG_HAVE_ARCH_COMPILER_H=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y @@ -88,7 +78,6 @@ CONFIG_HAVE_CBPF_JIT=y CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CLK=y CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_COPY_THREAD_TLS=y CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_HAVE_DEBUG_KMEMLEAK=y CONFIG_HAVE_DEBUG_STACKOVERFLOW=y @@ -122,14 +111,10 @@ CONFIG_IRQ_INTC=y CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y CONFIG_LIBFDT=y -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MFD_SYSCON=y -CONFIG_MIGRATION=y +CONFIG_MDIO_BOARDINFO=y CONFIG_MIPS=y CONFIG_MIPS_ASID_BITS=8 CONFIG_MIPS_ASID_SHIFT=0 -CONFIG_MIPS_CBPF_JIT=y CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set # CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set @@ -180,10 +165,7 @@ CONFIG_PINCTRL_RT2880=y CONFIG_RALINK=y # CONFIG_RALINK_ILL_ACC is not set CONFIG_RALINK_WDT=y -# CONFIG_RCU_NEED_SEGCBLIST is not set # CONFIG_RCU_STALL_COMMON is not set -CONFIG_REGMAP=y -CONFIG_REGMAP_MMIO=y CONFIG_RESET_CONTROLLER=y # CONFIG_SCHED_INFO is not set # CONFIG_SCSI_DMA is not set @@ -211,9 +193,6 @@ CONFIG_SYS_SUPPORTS_ARBIT_HZ=y CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y CONFIG_SYS_SUPPORTS_MIPS16=y CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TINY_SRCU=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_WATCHDOG_CORE=y diff --git a/target/linux/ramips/rt305x/profiles/00-default.mk b/target/linux/ramips/rt305x/profiles/00-default.mk index a8ca71610..cc777a8fe 100644 --- a/target/linux/ramips/rt305x/profiles/00-default.mk +++ b/target/linux/ramips/rt305x/profiles/00-default.mk @@ -9,7 +9,7 @@ define Profile/Default NAME:=Default Profile PRIORITY:=1 PACKAGES:=\ - kmod-usb-core kmod-usb-dwc2 \ + kmod-usb-dwc2 \ kmod-usb-ledtrig-usbport endef diff --git a/target/linux/ramips/rt3883/base-files/etc/board.d/01_leds b/target/linux/ramips/rt3883/base-files/etc/board.d/01_leds new file mode 100755 index 000000000..8502c8f41 --- /dev/null +++ b/target/linux/ramips/rt3883/base-files/etc/board.d/01_leds @@ -0,0 +1,35 @@ +#!/bin/sh + +. /lib/functions/leds.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 + +led_wlan="$(get_dt_led wlan)" +[ -n "$led_wlan" ] && ucidef_set_led_wlan "wifi_led" "wifi" "$led_wlan" "phy0tpt" + +case $board in +belkin,f9k1109v1) + set_usb_led "$boardname:green:usb1" + ucidef_set_led_netdev "lan" "lan" "$boardname:blue:wps" "eth0" + ;; +edimax,br-6475nd) + set_wifi_led "$boardname:amber:wlan" + ;; +omnima,hpm) + ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0" + set_wifi_led "$boardname:green:wifi" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ramips/rt3883/base-files/etc/board.d/02_network b/target/linux/ramips/rt3883/base-files/etc/board.d/02_network new file mode 100755 index 000000000..873c72cea --- /dev/null +++ b/target/linux/ramips/rt3883/base-files/etc/board.d/02_network @@ -0,0 +1,99 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh +. /lib/functions/system.sh + +ramips_setup_interfaces() +{ + local board="$1" + + case $board in + asus,rt-n56u) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "8@eth0" + ;; + belkin,f9k1109v1) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" + ;; + dlink,dir-645) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" + ;; + edimax,br-6475nd) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0" + ;; + loewe,wmdr-143n|\ + omnima,hpm) + ucidef_set_interface_lan "eth0" + ;; + samsung,cy-swr1100) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "9@eth0" + ;; + sitecom,wlr-6000|\ + trendnet,tew-691gr|\ + trendnet,tew-692gr) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" + ;; + *) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ;; + esac +} + +ramips_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + local label_mac="" + + case $board in + asus,rt-n56u) + lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)") + wan_mac=$(mtd_get_mac_binary factory 0x8004) + ;; + belkin,f9k1109v1) + wan_mac=$(mtd_get_mac_ascii uboot-env HW_WAN_MAC) + lan_mac=$(mtd_get_mac_ascii uboot-env HW_LAN_MAC) + label_mac=$wan_mac + ;; + dlink,dir-645) + lan_mac=$(mtd_get_mac_ascii nvram lanmac) + wan_mac=$(mtd_get_mac_ascii nvram wanmac) + ;; + edimax,br-6475nd) + wan_mac=$(mtd_get_mac_binary devdata 0x7) + ;; + samsung,cy-swr1100) + lan_mac=$(mtd_get_mac_ascii nvram lanmac) + wan_mac=$(mtd_get_mac_ascii nvram wanmac) + label_mac=$wan_mac + ;; + sitecom,wlr-6000) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x8004)" 2) + ;; + trendnet,tew-691gr) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 3) + ;; + trendnet,tew-692gr) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} + +board_config_update +board=$(board_name) +ramips_setup_interfaces $board +ramips_setup_macs $board +board_config_flush + +exit 0 diff --git a/target/linux/ramips/rt3883/base-files/lib/preinit/04_handle_checksumming b/target/linux/ramips/rt3883/base-files/lib/preinit/04_handle_checksumming new file mode 100644 index 000000000..e2aef5f1f --- /dev/null +++ b/target/linux/ramips/rt3883/base-files/lib/preinit/04_handle_checksumming @@ -0,0 +1,32 @@ +#!/bin/sh + +# Netgear WNCE2001 has does a checksum check on boot and goes into recovery +# tftp mode when the check fails. Initializing the JFFS2 partition triggers +# this, so we make sure to zero checksum and size to be checksummed before +# that happens, so this needs to run very early during boot. + +do_checksumming_disable() { + . /lib/functions.sh + + local board=$(board_name) + + case "$board" in + asus,rt-n56u) + echo "Board is ASUS RT-N56U, replacing uImage header..." + local firmware_mtd=$(find_mtd_part firmware) + local rootfs_mtd=$(find_mtd_part rootfs) + local rootfs_data_mtd=$(find_mtd_part rootfs_data) + local rootfs_len=$(grep \"rootfs\" /proc/mtd | awk -F' ' '{print "0x"$2}') + local rootfs_data_len=$(grep \"rootfs_data\" /proc/mtd | awk -F' ' '{print "0x"$2}') + local offset=$(echo "$rootfs_len $rootfs_data_len 0x40" | awk -F' ' '{printf "%i",$1-$2-$3}') + local signature=$(dd if=$rootfs_mtd skip=$offset bs=1 count=4 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"') + if [ "$signature" = "27051956" ]; then + dd conv=notrunc if=$rootfs_mtd skip=$offset of=$firmware_mtd bs=1 count=64 2>/dev/null + fi + ;; + esac + + return 0 +} + +boot_hook_add preinit_main do_checksumming_disable diff --git a/target/linux/ramips/rt3883/base-files/lib/upgrade/platform.sh b/target/linux/ramips/rt3883/base-files/lib/upgrade/platform.sh new file mode 100755 index 000000000..786d57fc7 --- /dev/null +++ b/target/linux/ramips/rt3883/base-files/lib/upgrade/platform.sh @@ -0,0 +1,20 @@ +# +# Copyright (C) 2010 OpenWrt.org +# + +PART_NAME=firmware +REQUIRE_IMAGE_METADATA=1 + +platform_check_image() { + return 0 +} + +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + *) + default_do_upgrade "$1" + ;; + esac +} diff --git a/target/linux/ramips/rt3883/config-4.14 b/target/linux/ramips/rt3883/config-4.14 index 4583ec534..f16b09deb 100644 --- a/target/linux/ramips/rt3883/config-4.14 +++ b/target/linux/ramips/rt3883/config-4.14 @@ -79,7 +79,6 @@ CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set # CONFIG_HAVE_ARCH_BITREVERSE is not set -CONFIG_HAVE_ARCH_COMPILER_H=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y @@ -127,11 +126,9 @@ CONFIG_LIBFDT=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MFD_SYSCON=y -CONFIG_MIGRATION=y CONFIG_MIPS=y CONFIG_MIPS_ASID_BITS=8 CONFIG_MIPS_ASID_SHIFT=0 -CONFIG_MIPS_CBPF_JIT=y CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set # CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set diff --git a/target/linux/ramips/rt3883/profiles/00-default.mk b/target/linux/ramips/rt3883/profiles/00-default.mk index c99029d7b..b032fb013 100644 --- a/target/linux/ramips/rt3883/profiles/00-default.mk +++ b/target/linux/ramips/rt3883/profiles/00-default.mk @@ -8,7 +8,7 @@ define Profile/Default NAME:=Default Profile PRIORITY:=1 - PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig + PACKAGES:=kmod-usb-ohci kmod-usb2 swconfig endef define Profile/Default/Description diff --git a/tools/Makefile b/tools/Makefile index 83f60c4ef..ad2006ad8 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -34,7 +34,7 @@ tools-$(CONFIG_TARGET_mxs) += elftosb sdimage tools-$(CONFIG_TARGET_ar71xx) += lzma-old tools-$(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79) += squashfs tools-$(CONFIG_USES_MINOR) += kernel2minor -tools-y += lzma squashfs4 +tools-y += lzma squashfskit4 zip tools-$(BUILD_B43_TOOLS) += b43-tools tools-$(BUILD_ISL) += isl tools-$(CONFIG_USE_SPARSE) += sparse diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 63df63191..2d2c96ce0 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -12,7 +12,13 @@ include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/kernel.mk define cc - $(HOSTCC) $(HOST_CFLAGS) -include endian.h $(HOST_LDFLAGS) -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) $(foreach src,$(1),src/$(src).c) $(2) + $(HOSTCC) \ + $(HOST_CFLAGS) \ + -Wno-unused-parameter \ + -include endian.h $(HOST_LDFLAGS) \ + -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) \ + $(foreach src,$(1),src/$(src).c) \ + $(2) endef define Host/Compile @@ -23,7 +29,7 @@ define Host/Compile $(call cc,otrx) $(call cc,motorola-bin) $(call cc,dgfirmware) - $(call cc,mksenaofw md5) + $(call cc,mksenaofw md5, -Wall --std=gnu99) $(call cc,trx2usr) $(call cc,ptgen) $(call cc,srec2bin) @@ -32,7 +38,7 @@ define Host/Compile $(call cc,mkzynfw) $(call cc,lzma2eva,-lz) $(call cc,mkcasfw) - $(call cc,mkfwimage,-lz -Wall) + $(call cc,mkfwimage,-lz -Wall -Werror -Wextra -D_FILE_OFFSET_BITS=64) $(call cc,mkfwimage2,-lz) $(call cc,imagetag imagetag_cmdline cyg_crc32) $(call cc,add_header) @@ -82,9 +88,11 @@ define Host/Compile $(call cc,mkbuffaloimg, -Wall) $(call cc,zyimage, -Wall) $(call cc,mkdhpimg buffalo-lib, -Wall) - $(call cc,mkdlinkfw mkdlinkfw-lib, -lz -Wall --std=gnu99) + $(call cc,mkdlinkfw mkdlinkfw-lib, -lz -Wall --std=c99) $(call cc,dns313-header, -Wall) - $(call cc,mksercommfw, -Wall --std=gnu99) + $(call cc,mksercommfw, -Wall) + $(call cc,nec-enc, -Wall --std=gnu99) + $(call cc,uimage_padhdr, -Wall -lz) endef define Host/Install diff --git a/tools/firmware-utils/src/fw.h b/tools/firmware-utils/src/fw.h index 44f8d851d..53a92a573 100644 --- a/tools/firmware-utils/src/fw.h +++ b/tools/firmware-utils/src/fw.h @@ -27,6 +27,7 @@ #define MAGIC_ENDS "ENDS" #define MAGIC_LENGTH 4 +#define PART_NAME_LENGTH 16 typedef struct header { char magic[MAGIC_LENGTH]; @@ -37,7 +38,7 @@ typedef struct header { typedef struct part { char magic[MAGIC_LENGTH]; - char name[16]; + char name[PART_NAME_LENGTH]; char pad[12]; u_int32_t memaddr; u_int32_t index; diff --git a/tools/firmware-utils/src/jcgimage.c b/tools/firmware-utils/src/jcgimage.c index 354c26be1..81d9f79f5 100644 --- a/tools/firmware-utils/src/jcgimage.c +++ b/tools/firmware-utils/src/jcgimage.c @@ -2,6 +2,7 @@ * jcgimage - Create a JCG firmware image * * Copyright (C) 2015 Reinhard Max + * Copyright (C) 2019 Davide Fioravanti * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -45,6 +46,11 @@ * requiring JTAG to revive the board. To prevent such bricking from * happening, this tool refuses to build such overlong images. * + * Using -m is possible to set the maximum size of the payload. + * Otherwise the default MAXSIZE will be used. + * For an 8Mb flash, the corresponding maxsize is: + * 8 * 1024 * 1024 - 5 * 64 * 1024 = 8388608 - 327680 = 8060928 + * * Two more conditions have to be met for a JCG image to be accepted * as a valid update by the web interface of the stock firware: * @@ -92,6 +98,7 @@ #include #include #include +#include /* * JCG Firmware image header @@ -148,12 +155,12 @@ opensize(char *name, size_t *size) { struct stat s; int fd = open(name, O_RDONLY); - if (fd < 0) { + if (fd < 0) err(1, "cannot open \"%s\"", name); - } - if (fstat(fd, &s) == -1) { + + if (fstat(fd, &s) == -1) err(1, "cannot stat \"%s\"", name); - } + *size = s.st_size; return fd; } @@ -183,17 +190,15 @@ mkjcgheader(struct jcg_header *h, size_t psize, char *version) void *payload = (void *)h + sizeof(*h); time_t t; - if (source_date_epoch != -1) { + if (source_date_epoch != -1) t = source_date_epoch; - } else if ((time(&t) == (time_t)(-1))) { + else if ((time(&t) == (time_t)(-1))) err(1, "time call failed"); - } - if (version != NULL) { - if (sscanf(version, "%hu.%hu", &major, &minor) != 2) { + + if (version != NULL) + if (sscanf(version, "%hu.%hu", &major, &minor) != 2) err(1, "cannot parse version \"%s\"", version); - } - } memset(h, 0, sizeof(*h)); h->jh_magic = htonl(JH_MAGIC); @@ -267,14 +272,14 @@ craftcrc(uint32_t dcrc, uint8_t *buf, size_t len) a = ~dcrc; for (i = 0; i < 32; i++) { - if (patch & 1) { + if (patch & 1) patch = (patch >> 1) ^ 0xedb88320L; - } else { + else patch >>= 1; - } - if (a & 1) { + + if (a & 1) patch ^= 0x5b358fd3L; - } + a >>= 1; } patch ^= ~crc32(crc, buf, len - 4); @@ -285,17 +290,17 @@ craftcrc(uint32_t dcrc, uint8_t *buf, size_t len) /* Verify that we actually get the desired result */ crc = crc32(0L, Z_NULL, 0); crc = crc32(crc, buf, len); - if (crc != dcrc) { + if (crc != dcrc) errx(1, "CRC patching is broken: wanted %08x, but got %08x.", dcrc, crc); - } + } void usage() { fprintf(stderr, "Usage:\n" - "jcgimage -o outfile -u uImage [-v version]\n" - "jcgimage -o outfile -k kernel -f rootfs [-v version]\n"); + "jcgimage -o outfile -u uImage [-m maxsize] [-v version]\n" + "jcgimage -o outfile -k kernel -f rootfs [-m maxsize] [-v version]\n"); exit(1); } @@ -316,6 +321,8 @@ main(int argc, char **argv) char *file1 = NULL; char *file2 = NULL; char *version = NULL; + size_t maxsize = MAXSIZE; + char *endptr; int mode = MODE_UNKNOWN; int fdo, fd1, fd2; size_t size1, size2, sizeu, sizeo, off1, off2; @@ -326,31 +333,36 @@ main(int argc, char **argv) assert(sizeof(struct uimage_header) == 64); set_source_date_epoch(); - while ((c = getopt(argc, argv, "o:k:f:u:v:h")) != -1) { + while ((c = getopt(argc, argv, "o:k:f:u:v:m:h")) != -1) { switch (c) { case 'o': imagefile = optarg; break; case 'k': - if (mode == MODE_UIMAGE) { + if (mode == MODE_UIMAGE) errx(1,"-k cannot be combined with -u"); - } + mode = MODE_KR; file1 = optarg; break; case 'f': - if (mode == MODE_UIMAGE) { + if (mode == MODE_UIMAGE) errx(1,"-f cannot be combined with -u"); - } + mode = MODE_KR; file2 = optarg; break; case 'u': - if (mode == MODE_KR) { + if (mode == MODE_KR) errx(1,"-u cannot be combined with -k and -r"); - } + mode = MODE_UIMAGE; file1 = optarg; + break; + case 'm': + if (optarg != NULL) + maxsize = strtoimax(optarg, &endptr, 10); + break; case 'v': version = optarg; @@ -360,19 +372,19 @@ main(int argc, char **argv) usage(); } } - if (optind != argc) { + if (optind != argc) errx(1, "illegal arg \"%s\"", argv[optind]); - } - if (imagefile == NULL) { + + if (imagefile == NULL) errx(1, "no output file specified"); - } - if (mode == MODE_UNKNOWN) { + + if (mode == MODE_UNKNOWN) errx(1, "specify either -u or -k and -r"); - } + if (mode == MODE_KR) { - if (file1 == NULL || file2 == NULL) { - errx(1,"need -k and -r"); - } + if (file1 == NULL || file2 == NULL) + errx(1, "need -k and -r"); + fd2 = opensize(file2, &size2); } fd1 = opensize(file1, &size1); @@ -387,37 +399,37 @@ main(int argc, char **argv) sizeo = sizeof(*jh) + sizeu; } - if (sizeo > MAXSIZE) { - errx(1,"payload too large: %zd > %zd\n", sizeo, MAXSIZE); - } + if (sizeo > maxsize) + errx(1, "payload too large: %zd > %zd\n", sizeo, maxsize); + fdo = open(imagefile, O_RDWR | O_CREAT | O_TRUNC, 00644); - if (fdo < 0) { + if (fdo < 0) err(1, "cannot open \"%s\"", imagefile); - } - if (ftruncate(fdo, sizeo) == -1) { + + if (ftruncate(fdo, sizeo) == -1) err(1, "cannot grow \"%s\" to %zd bytes", imagefile, sizeo); - } + map = mmap(NULL, sizeo, PROT_READ|PROT_WRITE, MAP_SHARED, fdo, 0); uh = map + sizeof(*jh); - if (map == MAP_FAILED) { + if (map == MAP_FAILED) err(1, "cannot mmap \"%s\"", imagefile); - } - if (read(fd1, map + off1, size1) != size1) { + + if (read(fd1, map + off1, size1) != size1) err(1, "cannot copy %s", file1); - } + if (mode == MODE_KR) { - if (read(fd2, map+off2, size2) != size2) { + if (read(fd2, map+off2, size2) != size2) err(1, "cannot copy %s", file2); - } + mkuheader(uh, size1, size2); - } else if (mode == MODE_UIMAGE) { + } else if (mode == MODE_UIMAGE) craftcrc(ntohl(uh->ih_dcrc), (void*)uh + sizeof(*uh), sizeu - sizeof(*uh)); - } + mkjcgheader(map, sizeu, version); munmap(map, sizeo); close(fdo); diff --git a/tools/firmware-utils/src/mkdapimg.c b/tools/firmware-utils/src/mkdapimg.c index ed662d8ec..640f42d7c 100644 --- a/tools/firmware-utils/src/mkdapimg.c +++ b/tools/firmware-utils/src/mkdapimg.c @@ -12,7 +12,7 @@ // Usage: mkdapimg [-p] [-m ] -s -i -o // -// e.g.: mkdapimg -s RT3052-AP-DAP1350-3 -i sysupgarde.bin -o factory.bin +// e.g.: mkdapimg -s RT3052-AP-DAP1350-3 -i sysupgrade.bin -o factory.bin // // If the model string is not given, we will assume that // the leading characters upto the first "-" is the model. diff --git a/tools/firmware-utils/src/mkdapimg2.c b/tools/firmware-utils/src/mkdapimg2.c index aef003c28..6b53c959b 100644 --- a/tools/firmware-utils/src/mkdapimg2.c +++ b/tools/firmware-utils/src/mkdapimg2.c @@ -48,7 +48,7 @@ // 0x000000120000-0x000000040000 = 0xE0000 -> 917504 // // e.g.: mkdapimg2 -s HONEYBEE-FIRMWARE-DAP-1330 -v 1.00.21 -r Default -// -k 917504 -i sysupgarde.bin -o factory.bin +// -k 917504 -i sysupgrade.bin -o factory.bin // // // The img_hdr_struct was taken from the D-Link SDK: diff --git a/tools/firmware-utils/src/mkdlinkfw-lib.c b/tools/firmware-utils/src/mkdlinkfw-lib.c index fcab85623..b3f3f4134 100644 --- a/tools/firmware-utils/src/mkdlinkfw-lib.c +++ b/tools/firmware-utils/src/mkdlinkfw-lib.c @@ -32,13 +32,26 @@ extern char *progname; -static unsigned char jffs2_eof_mark[4] = { 0xde, 0xad, 0xc0, 0xde }; - uint32_t jboot_timestamp(void) { - time_t rawtime; - time(&rawtime); - return (((uint32_t) rawtime) - TIMESTAMP_MAGIC) >> 2; + char *env = getenv("SOURCE_DATE_EPOCH"); + char *endptr = env; + time_t fixed_timestamp = -1; + errno = 0; + + if (env && *env) { + fixed_timestamp = strtoull(env, &endptr, 10); + + if (errno || (endptr && *endptr != '\0')) { + fprintf(stderr, "Invalid SOURCE_DATE_EPOCH"); + fixed_timestamp = -1; + } + } + + if (fixed_timestamp == -1) + time(&fixed_timestamp); + + return (((uint32_t) fixed_timestamp) - TIMESTAMP_MAGIC) >> 2; } uint16_t jboot_checksum(uint16_t start_val, uint16_t *data, int size) @@ -84,6 +97,7 @@ int read_to_buf(const struct file_info *fdata, char *buf) { FILE *f; int ret = EXIT_FAILURE; + size_t read; f = fopen(fdata->file_name, "r"); if (f == NULL) { @@ -91,9 +105,8 @@ int read_to_buf(const struct file_info *fdata, char *buf) goto out; } - errno = 0; - fread(buf, fdata->file_size, 1, f); - if (errno != 0) { + read = fread(buf, fdata->file_size, 1, f); + if (ferror(f) || read != 1) { ERRS("unable to read from file \"%s\"", fdata->file_name); goto out_close; } @@ -106,40 +119,6 @@ int read_to_buf(const struct file_info *fdata, char *buf) return ret; } -int pad_jffs2(char *buf, int currlen, int maxlen) -{ - int len; - uint32_t pad_mask; - - len = currlen; - pad_mask = (4 * 1024) | (64 * 1024); /* EOF at 4KB and at 64KB */ - while ((len < maxlen) && (pad_mask != 0)) { - uint32_t mask; - int i; - - for (i = 10; i < 32; i++) { - mask = 1 << i; - if (pad_mask & mask) - break; - } - - len = ALIGN(len, mask); - - for (i = 10; i < 32; i++) { - mask = 1 << i; - if ((len & (mask - 1)) == 0) - pad_mask &= ~mask; - } - - for (i = 0; i < sizeof(jffs2_eof_mark); i++) - buf[len + i] = jffs2_eof_mark[i]; - - len += sizeof(jffs2_eof_mark); - } - - return len; -} - int write_fw(const char *ofname, const char *data, int len) { FILE *f; diff --git a/tools/firmware-utils/src/mkdlinkfw-lib.h b/tools/firmware-utils/src/mkdlinkfw-lib.h index d61124cb6..da4ecf010 100644 --- a/tools/firmware-utils/src/mkdlinkfw-lib.h +++ b/tools/firmware-utils/src/mkdlinkfw-lib.h @@ -33,6 +33,10 @@ #define SCH2_MAGIC 0x2124 #define SCH2_VER 0x02 +/* + * compression type values in the header + * so far onlysupport for LZMA is added + */ #define FLAT 0 #define JZ 1 #define GZIP 2 @@ -49,8 +53,6 @@ #define FACTORY 0 #define SYSUPGRADE 1 -#define ALIGN(x, a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); }) - #define ERR(fmt, ...) do { \ fflush(0); \ fprintf(stderr, "[%s] *** error: " fmt "\n", \ @@ -77,7 +79,6 @@ uint32_t jboot_timestamp(void); uint16_t jboot_checksum(uint16_t start_val, uint16_t *data, int size); int get_file_stat(struct file_info *fdata); int read_to_buf(const struct file_info *fdata, char *buf); -int pad_jffs2(char *buf, int currlen, int maxlen); int write_fw(const char *ofname, const char *data, int len); #endif /* mkdlinkfw_lib_h */ diff --git a/tools/firmware-utils/src/mkdlinkfw.c b/tools/firmware-utils/src/mkdlinkfw.c index 87605004f..3b59a5d2d 100644 --- a/tools/firmware-utils/src/mkdlinkfw.c +++ b/tools/firmware-utils/src/mkdlinkfw.c @@ -99,11 +99,10 @@ struct file_info image_info; char *ofname; char *progname; uint32_t firmware_size; +uint32_t image_offset; uint16_t family_member; char *rom_id[12] = { 0 }; - char image_type; -int add_jffs2_eof; static void usage(int status) { @@ -405,7 +404,7 @@ int fill_sch2(struct sch2_header *header, char *kernel_ptr, char *rootfs_ptr) header->image_crc32 = crc32(0, (uint8_t *) kernel_ptr, kernel_info.file_size); header->start_addr = RAM_ENTRY_ADDR; header->rootfs_addr = - JBOOT_SIZE + STAG_SIZE + SCH2_SIZE + kernel_info.file_size; + image_offset + STAG_SIZE + SCH2_SIZE + kernel_info.file_size; header->rootfs_len = rootfs_info.file_size; header->rootfs_crc32 = crc32(0, (uint8_t *) rootfs_ptr, rootfs_info.file_size); header->header_crc32 = 0; @@ -448,9 +447,9 @@ int fill_auh(struct auh_header *header, uint32_t length) header->lpvs = AUH_LVPS; header->mbz = 0; header->time_stamp = jboot_timestamp(); - header->erase_start = JBOOT_SIZE; + header->erase_start = image_offset; header->erase_length = firmware_size; - header->data_offset = JBOOT_SIZE; + header->data_offset = image_offset; header->data_length = length; header->space4 = 0; header->space5 = 0; @@ -605,11 +604,12 @@ int main(int argc, char *argv[]) image_type = SYSUPGRADE; family_member = 0; firmware_size = 0; + image_offset = JBOOT_SIZE; while (1) { int c; - c = getopt(argc, argv, "f:F:i:hk:m:o:r:s:"); + c = getopt(argc, argv, "f:F:i:hk:m:o:O:r:s:"); if (c == -1) break; @@ -634,6 +634,9 @@ int main(int argc, char *argv[]) case 'r': rootfs_info.file_name = optarg; break; + case 'O': + sscanf(optarg, "0x%x", &image_offset); + break; case 'o': ofname = optarg; break; diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c index 2b84d3db5..c8737386a 100644 --- a/tools/firmware-utils/src/mkfwimage.c +++ b/tools/firmware-utils/src/mkfwimage.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -230,9 +231,10 @@ static int write_part(void* mem, part_data_t* d) memcpy(mem + sizeof(part_t), addr, d->stats.st_size); munmap(addr, d->stats.st_size); - memset(p->name, 0, sizeof(p->name)); - strncpy(p->magic, MAGIC_PART, MAGIC_LENGTH); - strncpy(p->name, d->partition_name, sizeof(p->name)); + memset(p->name, 0, PART_NAME_LENGTH); + memcpy(p->magic, MAGIC_PART, MAGIC_LENGTH); + memcpy(p->name, d->partition_name, PART_NAME_LENGTH); + p->index = htonl(d->partition_index); p->data_size = htonl(d->stats.st_size); p->part_size = htonl(d->partition_length); @@ -262,7 +264,8 @@ static void usage(const char* progname) static void print_image_info(const image_info_t* im) { - int i = 0; + unsigned int i = 0; + INFO("Firmware version: '%s'\n" "Output file: '%s'\n" "Part count: %u\n", @@ -272,15 +275,13 @@ static void print_image_info(const image_info_t* im) for (i = 0; i < im->part_count; ++i) { const part_data_t* d = &im->parts[i]; - INFO(" %10s: %8ld bytes (free: %8ld)\n", + INFO(" %10s: %8" PRId64 " bytes (free: %8" PRId64 ")\n", d->partition_name, d->stats.st_size, d->partition_length - d->stats.st_size); } } - - static u_int32_t filelength(const char* file) { FILE *p; @@ -296,8 +297,9 @@ static u_int32_t filelength(const char* file) return (ret); } -static int create_image_layout(const char* kernelfile, const char* rootfsfile, char* board_name, image_info_t* im) +static int create_image_layout(const char* kernelfile, const char* rootfsfile, image_info_t* im) { + uint32_t rootfs_len = 0; part_data_t* kernel = &im->parts[0]; part_data_t* rootfs = &im->parts[1]; @@ -312,8 +314,13 @@ static int create_image_layout(const char* kernelfile, const char* rootfsfile, c kernel->partition_entryaddr = p->kern_entry; strncpy(kernel->filename, kernelfile, sizeof(kernel->filename)); - if (filelength(rootfsfile) + kernel->partition_length > p->firmware_max_length) + rootfs_len = filelength(rootfsfile); + if (rootfs_len + kernel->partition_length > p->firmware_max_length) { + ERROR("File '%s' too big (0x%08X) - max size: 0x%08X (exceeds %u bytes)\n", + rootfsfile, rootfs_len, p->firmware_max_length, + (rootfs_len + kernel->partition_length) - p->firmware_max_length); return (-2); + } strcpy(rootfs->partition_name, "rootfs"); rootfs->partition_index = 2; @@ -336,7 +343,7 @@ static int create_image_layout(const char* kernelfile, const char* rootfsfile, c */ static int validate_image_layout(image_info_t* im) { - int i; + unsigned int i; if (im->part_count == 0 || im->part_count > MAX_SECTIONS) { @@ -367,7 +374,7 @@ static int validate_image_layout(image_info_t* im) return -3; } if (d->stats.st_size > d->partition_length) { - ERROR("File '%s' too big (%d) - max size: 0x%08X (exceeds %lu bytes)\n", + ERROR("File '%s' too big (%d) - max size: 0x%08X (exceeds %" PRId64 " bytes)\n", d->filename, i, d->partition_length, d->stats.st_size - d->partition_length); return -4; @@ -383,7 +390,7 @@ static int build_image(image_info_t* im) char* ptr; u_int32_t mem_size; FILE* f; - int i; + unsigned int i; // build in-memory buffer mem_size = sizeof(header_t); @@ -469,30 +476,30 @@ int main(int argc, char* argv[]) switch (o) { case 'v': if (optarg) - strncpy(im.version, optarg, sizeof(im.version)); + strncpy(im.version, optarg, sizeof(im.version) - 1); break; case 'o': if (optarg) - strncpy(im.outputfile, optarg, sizeof(im.outputfile)); + strncpy(im.outputfile, optarg, sizeof(im.outputfile) - 1); break; case 'm': if (optarg) - strncpy(im.magic, optarg, sizeof(im.magic)); + strncpy(im.magic, optarg, sizeof(im.magic) - 1); break; case 'h': usage(argv[0]); return -1; case 'k': if (optarg) - strncpy(kernelfile, optarg, sizeof(kernelfile)); + strncpy(kernelfile, optarg, sizeof(kernelfile) - 1); break; case 'r': if (optarg) - strncpy(rootfsfile, optarg, sizeof(rootfsfile)); + strncpy(rootfsfile, optarg, sizeof(rootfsfile) - 1); break; case 'B': if (optarg) - strncpy(board_name, optarg, sizeof(board_name)); + strncpy(board_name, optarg, sizeof(board_name) - 1); break; } } @@ -521,7 +528,7 @@ int main(int argc, char* argv[]) im.fwinfo = fwinfo; - if ((rc = create_image_layout(kernelfile, rootfsfile, board_name, &im)) != 0) + if ((rc = create_image_layout(kernelfile, rootfsfile, &im)) != 0) { ERROR("Failed creating firmware layout description - error code: %d\n", rc); return -3; diff --git a/tools/firmware-utils/src/mkrasimage.c b/tools/firmware-utils/src/mkrasimage.c index 8eee29cc0..cff3a533d 100644 --- a/tools/firmware-utils/src/mkrasimage.c +++ b/tools/firmware-utils/src/mkrasimage.c @@ -70,6 +70,7 @@ static char *progname; static char *board_name = 0; static char *version_name = 0; static unsigned int rootfs_size = 0; +static unsigned int header_length = HEADER_PARTITION_LENGTH; static struct file_info kernel = { NULL, NULL, 0 }; static struct file_info rootfs = { NULL, NULL, 0 }; @@ -144,6 +145,7 @@ void usage(int status) " -v version string\n" " -b name of board to generate image for\n" " -o name of output image\n" + " -l length of header, default 65536\n" " -h show this screen\n" ); @@ -334,7 +336,7 @@ int build_image() board_header = generate_board_header(kernel_header, rootfs_header, board_name); /* Prepare output file */ - out.size = HEADER_PARTITION_LENGTH + rootfs_out.size; + out.size = header_length + rootfs_out.size; if (kernel.name) out.size += kernel.size; out.data = malloc(out.size); @@ -345,7 +347,7 @@ int build_image() memcpy(out.data + ROOTFS_HEADER_LEN, board_header, BOARD_HEADER_LEN); if (kernel.name) memcpy(out.data + ROOTFS_HEADER_LEN + BOARD_HEADER_LEN, kernel_header, KERNEL_HEADER_LEN); - ptr = HEADER_PARTITION_LENGTH; + ptr = header_length; memcpy(out.data + ptr, rootfs_out.data, rootfs_out.size); ptr += rootfs_out.size; if (kernel.name) @@ -410,7 +412,7 @@ int main(int argc, char *argv[]) while (1) { int c; - c = getopt(argc, argv, "b:k:o:r:s:v:h"); + c = getopt(argc, argv, "b:k:o:r:s:v:l:h"); if (c == -1) break; @@ -436,6 +438,9 @@ int main(int argc, char *argv[]) case 'v': version_name = optarg; break; + case 'l': + sscanf(optarg, "%u", &header_length); + break; default: usage(EXIT_FAILURE); break; diff --git a/tools/firmware-utils/src/mksenaofw.c b/tools/firmware-utils/src/mksenaofw.c index 0f10ebdfb..b0fb7203c 100644 --- a/tools/firmware-utils/src/mksenaofw.c +++ b/tools/firmware-utils/src/mksenaofw.c @@ -55,6 +55,7 @@ typedef enum { } op_mode; static firmware_type FIRMWARE_TYPES[] = { + { 0x00, "combo" }, /* Used for new capwap-included style header */ { 0x01, "bootloader" }, { 0x02, "kernel" }, { 0x03, "kernelapp" }, @@ -70,6 +71,21 @@ static firmware_type FIRMWARE_TYPES[] = { { 0x0c, "langpack (D-Link)" } }; +#define MOD_DEFAULT 0x616C6C00 +#define SKU_DEFAULT 0x0 +#define DATECODE_NONE 0xFFFFFFFF +#define FIRMWARE_TYPE_NONE 0xFF + +struct capwap_header { + uint32_t mod; + uint32_t sku; + uint32_t firmware_ver[3]; + uint32_t datecode; + uint32_t capwap_ver[3]; + uint32_t model_size; + uint8_t model[]; +}; + static long get_file_size(const char *filename) { FILE *fp_file; @@ -84,15 +100,14 @@ static long get_file_size(const char *filename) return result; } -static int header_checksum(void *data, int len) +static int header_checksum(void *data, size_t len) { - int i; - int sum; + int sum = 0; /* shouldn't this be unsigned ? */ + size_t i; - sum = 0; - if (data != NULL && len >= 0) { + if (data != NULL && len > 0) { for (i = 0; i < len; ++i) - sum += *(unsigned char *) (data + i); + sum += ((unsigned char *)data)[i]; return sum; } @@ -124,18 +139,20 @@ static int md5_file(const char *filename, uint8_t *dst) } static int encode_image(const char *input_file_name, - const char *output_file_name, img_header *header, int block_size) + const char *output_file_name, img_header *header, + struct capwap_header *cw_header, int block_size) { char buf[BUF_SIZE]; - size_t bytes_read; size_t pad_len = 0; size_t bytes_avail; + size_t bytes_read; - FILE *fp_input; FILE *fp_output; + FILE *fp_input; - int i; + int model_size; long magic; + size_t i; fp_input = fopen(input_file_name, "r+b"); if (!fp_input) { @@ -172,6 +189,11 @@ static int encode_image(const char *input_file_name, } header->zero = 0; header->chksum = header_checksum(header, HDR_LEN); + if (cw_header) { + header->chksum += header_checksum(cw_header, + sizeof(struct capwap_header) + cw_header->model_size); + } + header->head = htonl(header->head); header->vendor_id = htonl(header->vendor_id); header->product_id = htonl(header->product_id); @@ -183,6 +205,22 @@ static int encode_image(const char *input_file_name, fwrite(header, HDR_LEN, 1, fp_output); + if (cw_header) { + model_size = cw_header->model_size; + cw_header->mod = htonl(cw_header->mod); + cw_header->sku = htonl(cw_header->sku); + cw_header->firmware_ver[0] = htonl(cw_header->firmware_ver[0]); + cw_header->firmware_ver[1] = htonl(cw_header->firmware_ver[1]); + cw_header->firmware_ver[2] = htonl(cw_header->firmware_ver[2]); + cw_header->datecode = htonl(cw_header->datecode); + cw_header->capwap_ver[0] = htonl(cw_header->capwap_ver[0]); + cw_header->capwap_ver[1] = htonl(cw_header->capwap_ver[1]); + cw_header->capwap_ver[2] = htonl(cw_header->capwap_ver[2]); + cw_header->model_size = htonl(cw_header->model_size); + fwrite(cw_header, sizeof(struct capwap_header) + model_size, 1, + fp_output); + } + while (!feof(fp_input) || pad_len > 0) { if (!feof(fp_input)) @@ -212,32 +250,33 @@ static int encode_image(const char *input_file_name, int decode_image(const char *input_file_name, const char *output_file_name) { - img_header header; + struct capwap_header cw_header; char buf[BUF_SIZE]; + img_header header; + char *pmodel = NULL; FILE *fp_input; FILE *fp_output; - unsigned int i; size_t bytes_read; size_t bytes_written; + unsigned int i; fp_input = fopen(input_file_name, "r+b"); if (!fp_input) { fprintf(stderr, "Cannot open %s !!\n", input_file_name); - fclose(fp_input); return -1; } fp_output = fopen(output_file_name, "w+b"); if (!fp_output) { fprintf(stderr, "Cannot open %s !!\n", output_file_name); - fclose(fp_output); + fclose(fp_input); return -1; } if (fread(&header, 1, HDR_LEN, fp_input) != HDR_LEN) { - fprintf(stderr, "Incorrect header size!!"); + fprintf(stderr, "Incorrect header size reading base header!!"); fclose(fp_input); fclose(fp_output); return -1; @@ -251,6 +290,44 @@ int decode_image(const char *input_file_name, const char *output_file_name) header.chksum = ntohl(header.chksum); header.magic = ntohl(header.magic); + /* read capwap header if firmware_type is zero */ + if (header.firmware_type == 0) { + if (fread(&cw_header, 1, sizeof(struct capwap_header), + fp_input) != sizeof(struct capwap_header)) { + fprintf(stderr, "Incorrect header size reading capwap_header!!"); + fclose(fp_input); + fclose(fp_output); + return -1; + } + cw_header.mod = ntohl(cw_header.mod); + cw_header.sku = ntohl(cw_header.sku); + cw_header.firmware_ver[0] = ntohl(cw_header.firmware_ver[0]); + cw_header.firmware_ver[1] = ntohl(cw_header.firmware_ver[1]); + cw_header.firmware_ver[2] = ntohl(cw_header.firmware_ver[2]); + cw_header.datecode = ntohl(cw_header.datecode); + cw_header.capwap_ver[0] = ntohl(cw_header.capwap_ver[0]); + cw_header.capwap_ver[1] = ntohl(cw_header.capwap_ver[1]); + cw_header.capwap_ver[2] = ntohl(cw_header.capwap_ver[2]); + cw_header.model_size = ntohl(cw_header.model_size); + + pmodel = malloc(cw_header.model_size + 1); + if (pmodel) { + pmodel[cw_header.model_size] = '\0'; + if (fread(pmodel, 1, cw_header.model_size, fp_input) != + cw_header.model_size) { + fprintf(stderr, "Incorrect header size reading model name!!"); + fclose(fp_input); + fclose(fp_output); + return -1; + } + } else { + fprintf(stderr, "Incorrect header size reading model name!!"); + fclose(fp_input); + fclose(fp_output); + return -1; + } + } + bytes_written = 0; while (!feof(fp_input)) { @@ -281,7 +358,7 @@ int decode_image(const char *input_file_name, const char *output_file_name) static void usage(const char *progname, int status) { FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout; - int i; + size_t i; fprintf(stream, "Usage: %s [OPTIONS...]\n", progname); fprintf(stream, "\n" @@ -301,28 +378,47 @@ static void usage(const char *progname, int status) " -m set encoding magic \n" " -z enable image padding to \n" " -b set image , defaults to %u\n" + " -c add capwap header with (e.g. 171101)\n" + " -w firmware version for capwap header (e.g. 3.0.1)\n" + " -x capwap firmware version for capwap header (e.g. 1.8.53)\n" + " -n model name for capwap header (e.g. ENS620EXT)\n" " -h show this screen\n", DEFAULT_BLOCK_SIZE); exit(status); } int main(int argc, char *argv[]) { - int opt; - char *input_file, *output_file, *progname = NULL; - op_mode mode = NONE; - int tmp, i, pad = 0; - int block_size; + static const char period[2] = "."; + struct capwap_header cw_header; img_header header; + struct capwap_header *pcw_header = NULL; + char *output_file = NULL; + char *input_file = NULL; + char *progname = NULL; + char *mod_name = NULL; + char *token; + + op_mode mode = NONE; + int tmp, pad = 0; + int block_size; + size_t i; + int opt; + block_size = DEFAULT_BLOCK_SIZE; progname = basename(argv[0]); - memset(&header, 0, sizeof( img_header )); + memset(&header, 0, sizeof(img_header)); header.magic = DEFAULT_MAGIC; header.head = DEFAULT_HEAD_VALUE; + header.firmware_type = FIRMWARE_TYPE_NONE; + memset(&cw_header, 0, sizeof(struct capwap_header)); + cw_header.mod = MOD_DEFAULT; + cw_header.sku = SKU_DEFAULT; + cw_header.datecode = DATECODE_NONE; strncpy( (char*)&header.version, DEFAULT_VERSION, VERSION_SIZE - 1); - while ((opt = getopt(argc, argv, ":o:e:d:t:v:r:p:m:b:h?z")) != -1) { + while ((opt = getopt(argc, argv, ":o:e:d:t:v:r:p:m:b:c:w:x:n:h?z")) != -1) { switch (opt) { case 'e': input_file = optarg; @@ -344,7 +440,7 @@ int main(int argc, char *argv[]) break; } } - if (header.firmware_type == 0) { + if (header.firmware_type == FIRMWARE_TYPE_NONE) { fprintf(stderr, "Invalid firmware type \"0\"!\n"); usage(progname, EXIT_FAILURE); } @@ -368,6 +464,31 @@ int main(int argc, char *argv[]) case 'b': block_size = strtol(optarg, 0, 10); break; + case 'c': + cw_header.datecode = strtoul(optarg, 0, 10); + break; + case 'w': + token = strtok(optarg, period); + i = 0; + while (token && (i < 3)) { + cw_header.firmware_ver[i++] = + strtoul(token, 0, 10); + token = strtok(NULL, period); + } + break; + case 'x': + token = strtok(optarg, period); + i = 0; + while (token && (i < 3)) { + cw_header.capwap_ver[i++] = + strtoul(token, 0, 10); + token = strtok(NULL, period); + } + break; + case 'n': + mod_name = optarg; + cw_header.model_size = strlen(mod_name); + break; case 'h': usage(progname, EXIT_SUCCESS); break; @@ -403,17 +524,46 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } - if (header.firmware_type == 0) { - fprintf(stderr, "Firmware type must be defined\n"); + if ((header.firmware_type == 0) && + (cw_header.datecode == DATECODE_NONE)) { + fprintf(stderr, "Firmware type must be non-zero for non-capwap images\n"); usage(progname, EXIT_FAILURE); } if (header.vendor_id == 0 || header.product_id == 0) { - fprintf(stderr, "Vendor ID and Product ID must be defined and non-zero\n"); + fprintf(stderr, "Vendor ID and Product ID must be defined and non-zero\n"); usage(progname, EXIT_FAILURE); } - if (encode_image(input_file, output_file, &header, pad ? block_size : 0) < 0) + /* Check capwap header specific arguments */ + if (cw_header.datecode != DATECODE_NONE) { + if (!mod_name) { + fprintf(stderr, "Capwap header specified: model name must be specified\n"); + usage(progname, EXIT_FAILURE); + } + if (!cw_header.firmware_ver[0] && !cw_header.firmware_ver[1] && + !cw_header.firmware_ver[2]) { + fprintf(stderr, "Capwap header specified, fw_ver must be non-zero\n"); + } + if (!cw_header.capwap_ver[0] && !cw_header.capwap_ver[1] && + !cw_header.capwap_ver[2]) { + fprintf(stderr, "Capwap header specified, cw_ver must be non-zero\n"); + } + pcw_header = malloc(sizeof(struct capwap_header) + + cw_header.model_size); + if (pcw_header) { + memcpy(pcw_header, &cw_header, + sizeof(struct capwap_header)); + memcpy(&(pcw_header->model), mod_name, + cw_header.model_size); + } else { + fprintf(stderr, "Failed to allocate memory\n"); + return EXIT_FAILURE; + } + } + + if (encode_image(input_file, output_file, &header, pcw_header, + pad ? block_size : 0) < 0) return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/tools/firmware-utils/src/mksercommfw.c b/tools/firmware-utils/src/mksercommfw.c index 23e4dd06b..f6f1d93f3 100644 --- a/tools/firmware-utils/src/mksercommfw.c +++ b/tools/firmware-utils/src/mksercommfw.c @@ -5,6 +5,7 @@ #include #include #include +#include #if !defined(__BYTE_ORDER) #error "Unknown byte order" @@ -12,14 +13,8 @@ #if __BYTE_ORDER == __BIG_ENDIAN #define cpu_to_be32(x) (x) -#define be32_to_cpu(x) (x) -#define cpu_to_be16(x) (x) -#define be16_to_cpu(x) (x) #elif __BYTE_ORDER == __LITTLE_ENDIAN #define cpu_to_be32(x) bswap_32(x) -#define be32_to_cpu(x) bswap_32(x) -#define cpu_to_be16(x) bswap_16(x) -#define be16_to_cpu(x) bswap_16(x) #else #error "Unsupported endianness" #endif @@ -33,9 +28,6 @@ #endif #define ERR(...) {printf(__VA_ARGS__); } -#define ALIGN(a,b) ((a) + ((b) - ((a) % (b)))) -#define ROOTFS_ALIGN 128 -#define HEADER_SIZE 71 /* * Fw Header Layout for Netgear / Sercomm devices (bytes) @@ -51,14 +43,12 @@ * magic : 63-69 ASCII * ChkSum : 511 Inverse value of the full image checksum while this location is 0x00 */ - static const char* magic = "sErCoMm"; /* 7 */ - -/* 7-11: version control/download control ? */ static const unsigned char version[4] = { 0x00, 0x01, 0x00, 0x00 }; +static const int header_sz = 512; +static const int footer_sz = 71; - -/* 512 onwards -> ZIP containing rootfs with the same Header */ +static int is_header = 1; struct file_info { char* file_name; /* name of the file */ @@ -68,23 +58,32 @@ struct file_info { static u_int8_t getCheckSum(char* data, int len) { u_int8_t new = 0; + int i; if (!data) { ERR("Invalid pointer provided!\n"); return 0; } - for (int i = 0; i < len; i++) { + for (i = 0; i < len; i++) { new += data[i]; } return new; } -static int bufferFile(struct file_info* finfo) { - int fs = 0; +/* + * read file into buffer + * add space for header/footer + */ +static int copyToOutputBuf(struct file_info* finfo) { FILE* fp = NULL; + int file_sz = 0; + int extra_sz; + int hdr_pos; + int img_pos; + if (!finfo || !finfo->file_name) { ERR("Invalid pointer provided!\n"); return -1; @@ -100,25 +99,39 @@ static int bufferFile(struct file_info* finfo) { /* Get filesize */ rewind(fp); fseek(fp, 0L, SEEK_END); - fs = ftell(fp); + file_sz = ftell(fp); rewind(fp); - if (fs < 0) { + if (file_sz < 1) { ERR("Error getting filesize: %s\n", finfo->file_name); fclose(fp); return -1; } - DBG("Filesize: %i\n", fs); - finfo->file_size = fs; + if (is_header) { + extra_sz = header_sz; + hdr_pos = 0; + img_pos = header_sz; + } else { + extra_sz = footer_sz; + hdr_pos = file_sz; + img_pos = 0; + } - if (!(finfo->file_data = malloc(fs))) { + DBG("Filesize: %i\n", file_sz); + finfo->file_size = file_sz + extra_sz; + + if (!(finfo->file_data = malloc(finfo->file_size))) { ERR("Out of memory!\n"); fclose(fp); return -1; } - if (fread(finfo->file_data, 1, fs, fp) != fs) { + /* init header/footer bytes */ + memset(finfo->file_data + hdr_pos, 0, extra_sz); + + /* read file and take care of leading header if exists */ + if (fread(finfo->file_data + img_pos, 1, file_sz, fp) != file_sz) { ERR("Error reading file %s\n", finfo->file_name); fclose(fp); return -1; @@ -127,7 +140,7 @@ static int bufferFile(struct file_info* finfo) { DBG("File: read successful\n"); fclose(fp); - return 0; + return hdr_pos; } static int writeFile(struct file_info* finfo) { @@ -157,266 +170,92 @@ static int writeFile(struct file_info* finfo) { return 0; } -static void fi_clean(struct file_info* finfo) { - if (!finfo) - return; - - if (finfo->file_name) { - finfo->file_name = NULL; - } - - if (finfo->file_data) { - free(finfo->file_data); - finfo->file_data = NULL; - } - - finfo->file_size = 0; -} - static void usage(char* argv[]) { - printf("Usage: %s \n" - "All are positional arguments ... \n" - " sysupgradefile: File with the kernel uimage at 0\n" - " kernel_offset: Offset where the kernel is located (decimal, hex or octal notation)\n" - " HWID: Hardware ID, ASCII\n" - " HWVER: Hardware Version, ASCII\n" - " SWID: Software Version (decimal, hex or octal notation)\n" - " \n" - , argv[0]); + printf("Usage: %s [OPTIONS...]\n" + "\n" + "Options:\n" + " -f add sercom footer (if absent, header)\n" + " -b use hardware id specified with (ASCII)\n" + " -r use hardware revision specified with (ASCII)\n" + " -v set image version to (decimal, hex or octal notation)\n" + " -i input file\n" + , argv[0]); } int main(int argc, char* argv[]) { - int ret = 1; - int rootfsname_sz; - int zipfsname_sz; - int zipcmd_sz; - u_int32_t kernel_offset = 0x90000; /* offset for the kernel inside the rootfs, default val */ - u_int32_t swVer = 0; - struct file_info sysupgrade = { 0 }; - struct file_info header = { 0 }; - struct file_info rootfs = { 0 }; - struct file_info zippedfs = { 0 }; struct file_info image = { 0 }; + char* hwID = NULL; char* hwVer = NULL; - char* rootfsname = NULL; - char* zipfsname = NULL; - char* zipcmd = NULL; + u_int32_t swVer = 0; u_int8_t chkSum; + int hdr_offset; - if (argc == 2) { - struct file_info myfile = { argv[1], 0, 0 }; + while ( 1 ) { + int c; - if (bufferFile(&myfile)) - return 1; + c = getopt(argc, argv, "b:i:r:v:f"); + if (c == -1) + break; - chkSum = getCheckSum(myfile.file_data, myfile.file_size); - printf("Checksum for File: 0x%hhX\n", chkSum); - - return 0; + switch (c) { + case 'b': + hwID = optarg; + break; + case 'f': + is_header = 0; + break; + case 'i': + image.file_name = optarg; + break; + case 'r': + hwVer = optarg; + break; + case 'v': + swVer = (u_int32_t) strtol(optarg, NULL, 0); + swVer = cpu_to_be32(swVer); + break; + default: + usage(argv); + return EXIT_FAILURE; + } } - if (argc != 6) { - usage(argv); - return 1; + if (!hwID || !hwVer || !image.file_name) { + usage(argv); + return EXIT_FAILURE; } - printf("Building fw image for sercomm devices ..\n"); + /* + * copy input to buffer, add extra space for header/footer and return + * header position + */ + hdr_offset = copyToOutputBuf(&image); + if (hdr_offset < 0) + return EXIT_FAILURE; - /* process args */ - hwID = argv[3]; - hwVer = argv[4]; + DBG("Filling header: %s %s %2X %s\n", hwID, hwVer, swVer, magic); - sysupgrade.file_name = argv[1]; - image.file_name = argv[1]; - kernel_offset = (u_int32_t) strtol(argv[2], NULL, 0); - swVer = (u_int32_t) strtol(argv[5], NULL, 0); - swVer = cpu_to_be32(swVer); + strncpy(image.file_data + hdr_offset + 0, magic, 7); + memcpy(image.file_data + hdr_offset + 7, version, sizeof(version)); + strncpy(image.file_data + hdr_offset + 11, hwID, 34); + strncpy(image.file_data + hdr_offset + 45, hwVer, 10); + memcpy(image.file_data + hdr_offset + 55, &swVer, sizeof(swVer)); + strncpy(image.file_data + hdr_offset + 63, magic, 7); - /* Check if files actually exist */ - if (access(sysupgrade.file_name, (F_OK | R_OK))) { - /* Error */ - ERR("File not found: %s\n", sysupgrade.file_name); - goto cleanup; + /* calculate checksum and invert checksum */ + if (is_header) { + chkSum = getCheckSum(image.file_data, image.file_size); + chkSum = (chkSum ^ 0xFF) + 1; + DBG("Checksum for Image: %hhX\n", chkSum); + + /* write checksum to header */ + image.file_data[511] = (char) chkSum; } - /* Calculate amount of required memory (incl. 0-term) */ - rootfsname_sz = strlen(sysupgrade.file_name) + 7 + 1; - zipfsname_sz = strlen(sysupgrade.file_name) + 7 + 4 + 1; + /* overwrite input file */ + if (writeFile(&image)) + return EXIT_FAILURE; - /* Allocate required memory */ - if (!(rootfsname = (char*) malloc(rootfsname_sz)) || !(zipfsname = - (char*) malloc(zipfsname_sz))) { - /* Error */ - ERR("Out of memory!\n"); - goto cleanup; - } - - /* Create filenames */ - if (snprintf(rootfsname, rootfsname_sz, "%s.rootfs", sysupgrade.file_name) - >= rootfsname_sz - || snprintf(zipfsname, zipfsname_sz, "%s.rootfs.zip", - sysupgrade.file_name) >= zipfsname_sz) { - /* Error */ - ERR("Buffer too small!\n"); - goto cleanup; - } - - /* Buffer all files */ - if (bufferFile(&sysupgrade)) { - /* Error */ - goto cleanup; - } - - DBG("Building header: %s %s %2X %s\n", hwID, hwVer, swVer, magic); - - /* Construct the firmware header/magic */ - header.file_name = NULL; - header.file_size = HEADER_SIZE; - - if (!(header.file_data = (char*) calloc(1, HEADER_SIZE))) { - /* Error */ - ERR("Out of memory!\n"); - goto cleanup; - } - - strncpy(header.file_data + 0, magic, 7); - memcpy(header.file_data + 7, version, sizeof(version)); - strncpy(header.file_data + 11, hwID, 34); - strncpy(header.file_data + 45, hwVer, 10); - memcpy(header.file_data + 55, &swVer, sizeof(swVer)); - strncpy(header.file_data + 63, magic, 7); - - DBG("Creating rootfs ..\n"); - - /* Construct a rootfs */ - rootfs.file_name = rootfsname; - rootfs.file_size = ALIGN( - sysupgrade.file_size + kernel_offset + header.file_size, - ROOTFS_ALIGN); - - if (!(rootfs.file_data = calloc(1, rootfs.file_size))) { - /* Error */ - ERR("Out of memory!\n"); - goto cleanup; - } - - /* copy Owrt image to kernel location */ - memcpy(rootfs.file_data + kernel_offset, sysupgrade.file_data, - sysupgrade.file_size); - - /* Append header after the owrt image. The updater searches for it */ - memcpy(rootfs.file_data + kernel_offset + sysupgrade.file_size, - header.file_data, header.file_size); - - /* Write to file */ - if (writeFile(&rootfs)) { - /* Error */ - goto cleanup; - } - - /* Construct a zip */ - DBG("Preparing to zip ..\n"); - - /* now that we got the rootfs, repeat the whole thing again(sorta): - * 1. zip the rootfs */ - zipcmd_sz = 3 + 1 + strlen(zipfsname) + 1 + strlen(rootfs.file_name) + 1; - - if (!(zipcmd = malloc(zipcmd_sz))) { - /* Error */ - ERR("Out of memory!\n"); - goto cleanup; - } - - if (snprintf(zipcmd, zipcmd_sz, "%s %s %s", "zip", zipfsname, - rootfs.file_name) >= zipcmd_sz) { - /* Error */ - ERR("Buffer too small!\n"); - goto cleanup; - } - - if (system(zipcmd)) { - /* Error */ - ERR("Error creating a zip file!\n"); - goto cleanup; - } - - /* and load zipped fs */ - zippedfs.file_name = zipfsname; - - if (bufferFile(&zippedfs)) { - /* Error */ - goto cleanup; - } - - DBG("Creating Image.\n"); - - /* 2. create new file 512 + rootfs size */ - image.file_size = zippedfs.file_size + 512; - if (!(image.file_data = malloc(zippedfs.file_size + 512))) { - /* Error */ - ERR("Out of memory!\n"); - goto cleanup; - } - - /* 3. add header to file */ - memcpy(image.file_data, header.file_data, header.file_size); - - /* 4. clear remaining space */ - if (header.file_size < 512) - memset(image.file_data + header.file_size, 0, 512 - header.file_size); - - /* 5. copy zipfile at loc 512 */ - memcpy(image.file_data + 512, zippedfs.file_data, zippedfs.file_size); - - /* 6. do a checksum run, and compute checksum */ - chkSum = getCheckSum(image.file_data, image.file_size); - - DBG("Checksum for Image: %hhX\n", chkSum); - - /* 7. write the checksum inverted into byte 511 to bring it to 0 on verification */ - chkSum = (chkSum ^ 0xFF) + 1; - image.file_data[511] = (char) chkSum; - - chkSum = getCheckSum(image.file_data, image.file_size); - DBG("Checksum for after fix: %hhX\n", chkSum); - - if (chkSum != 0) { - ERR("Invalid checksum!\n") - goto cleanup; - } - - /* 8. pray that the updater will accept the file */ - if (writeFile(&image)) { - /* Error */ - goto cleanup; - } - - /* All seems OK */ - ret = 0; - - cleanup: - - if (rootfs.file_name && !access(rootfs.file_name, F_OK | W_OK)) - remove(rootfs.file_name); - - if (zippedfs.file_name && !access(zippedfs.file_name, F_OK | W_OK)) - remove(zippedfs.file_name); - - fi_clean(&sysupgrade); - fi_clean(&header); - fi_clean(&rootfs); - fi_clean(&zippedfs); - fi_clean(&image); - - if (rootfsname) - free(rootfsname); - - if (zipfsname) - free(zipfsname); - - if (zipcmd) - free(zipcmd); - - return ret; + return EXIT_SUCCESS; } diff --git a/tools/firmware-utils/src/mktplinkfw2.c b/tools/firmware-utils/src/mktplinkfw2.c index dead49e7a..102d72b1c 100644 --- a/tools/firmware-utils/src/mktplinkfw2.c +++ b/tools/firmware-utils/src/mktplinkfw2.c @@ -146,12 +146,30 @@ static struct flash_layout layouts[] = { .kernel_la = 0x80000000, .kernel_ep = 0x80000000, .rootfs_ofs = 0x140000, + }, { + .id = "8MSUmtk", /* Split U-Boot OS */ + .fw_max_len = 0x770000, + .kernel_la = 0x80000000, + .kernel_ep = 0x80000000, + .rootfs_ofs = 0x140000, }, { .id = "8MLmtk", .fw_max_len = 0x7b0000, .kernel_la = 0x80000000, .kernel_ep = 0x80000000, .rootfs_ofs = 0x140000, + }, { + .id = "8Mqca", + .fw_max_len = 0x7a0000, + .kernel_la = 0x80060000, + .kernel_ep = 0x80060000, + .rootfs_ofs = 0x140000, + }, { + .id = "16Mqca", + .fw_max_len = 0xf90000, + .kernel_la = 0x80060000, + .kernel_ep = 0x80060000, + .rootfs_ofs = 0x140000, }, { /* terminating entry */ } diff --git a/tools/firmware-utils/src/nec-enc.c b/tools/firmware-utils/src/nec-enc.c new file mode 100644 index 000000000..3c4e38721 --- /dev/null +++ b/tools/firmware-utils/src/nec-enc.c @@ -0,0 +1,129 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * nec-enc.c - encode/decode nec firmware with key + * + * based on xorimage.c in OpenWrt + * + */ + +#include +#include +#include +#include +#include + +#define KEY_LEN 16 +#define PATTERN_LEN 251 + +static int +xor_pattern(uint8_t *data, size_t len, const char *key, int k_len, int k_off) +{ + int offset = k_off; + + while (len--) { + *data ^= key[offset]; + data++; + offset = (offset + 1) % k_len; + } + + return offset; +} + +static void xor_data(uint8_t *data, size_t len, const uint8_t *pattern) +{ + for (int i = 0; i < len; i++) { + *data ^= pattern[i]; + data++; + } +} + +static void __attribute__((noreturn)) usage(void) +{ + fprintf(stderr, "Usage: nec-enc -i infile -o outfile -k \n"); + exit(EXIT_FAILURE); +} + +static unsigned char buf_pattern[4096], buf[4096]; + +int main(int argc, char **argv) +{ + int k_off = 0, ptn = 0, c, ret = EXIT_SUCCESS; + char *ifn = NULL, *ofn = NULL, *key = NULL; + size_t n, k_len; + FILE *out, *in; + + while ((c = getopt(argc, argv, "i:o:k:h")) != -1) { + switch (c) { + case 'i': + ifn = optarg; + break; + case 'o': + ofn = optarg; + break; + case 'k': + key = optarg; + break; + case 'h': + default: + usage(); + } + } + + if (optind != argc || optind == 1) { + fprintf(stderr, "illegal arg \"%s\"\n", argv[optind]); + usage(); + } + + in = fopen(ifn, "r"); + if (!in) { + perror("can not open input file"); + usage(); + } + + out = fopen(ofn, "w"); + if (!out) { + perror("can not open output file"); + usage(); + } + + if (!key) { + fprintf(stderr, "key is not specified\n"); + usage(); + } + + k_len = strnlen(key, KEY_LEN + 1); + if (k_len == 0 || k_len > KEY_LEN) { + fprintf(stderr, "key length is not in range (0,%d)\n", KEY_LEN); + usage(); + } + + while ((n = fread(buf, 1, sizeof(buf), in)) > 0) { + for (int i = 0; i < n; i++) { + buf_pattern[i] = ptn + 1; + ptn++; + + if (ptn > 250) + ptn = 0; + } + + k_off = xor_pattern(buf_pattern, n, key, k_len, k_off); + xor_data(buf, n, buf_pattern); + + if (fwrite(buf, 1, n, out) != n) { + perror("failed to write"); + ret = EXIT_FAILURE; + goto out; + } + } + + if (ferror(in)) { + perror("failed to read"); + ret = EXIT_FAILURE; + goto out; + } + +out: + fclose(in); + fclose(out); + return ret; +} diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c index 13e0eda62..0192bb65e 100644 --- a/tools/firmware-utils/src/ptgen.c +++ b/tools/firmware-utils/src/ptgen.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ int active = 1; int heads = -1; int sectors = -1; int kb_align = 0; +bool ignore_null_sized_partition = false; struct partinfo parts[4]; char *filename = NULL; @@ -140,6 +142,8 @@ static int gen_ptable(uint32_t signature, int nr) memset(pte, 0, sizeof(struct pte) * 4); for (i = 0; i < nr; i++) { if (!parts[i].size) { + if (ignore_null_sized_partition) + continue; fprintf(stderr, "Invalid size in partition %d!\n", i); return -1; } @@ -196,7 +200,7 @@ fail: static void usage(char *prog) { - fprintf(stderr, "Usage: %s [-v] -h -s -o [-a 0..4] [-l ] [[-t ] -p ...] \n", prog); + fprintf(stderr, "Usage: %s [-v] [-n] -h -s -o [-a 0..4] [-l ] [[-t ] -p ...] \n", prog); exit(EXIT_FAILURE); } @@ -207,7 +211,7 @@ int main (int argc, char **argv) int part = 0; uint32_t signature = 0x5452574F; /* 'OWRT' */ - while ((ch = getopt(argc, argv, "h:s:p:a:t:o:vl:S:")) != -1) { + while ((ch = getopt(argc, argv, "h:s:p:a:t:o:vnl:S:")) != -1) { switch (ch) { case 'o': filename = optarg; @@ -215,6 +219,9 @@ int main (int argc, char **argv) case 'v': verbose++; break; + case 'n': + ignore_null_sized_partition = true; + break; case 'h': heads = (int)strtoul(optarg, NULL, 0); break; diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index 74ea69763..29ffae80f 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -118,10 +118,10 @@ static const uint8_t md5_salt[16] = { /** Firmware layout table */ static struct device_info boards[] = { - /** Firmware layout for the CPE210/220 */ + /** Firmware layout for the CPE210/220 V1 */ { - .id = "CPE210", - .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", + .id = "CPE210", + .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", .support_list = "SupportList:\r\n" "CPE210(TP-LINK|UN|N300-2):1.0\r\n" @@ -140,8 +140,8 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x1c0000}, - {"file-system", 0x200000, 0x5b0000}, + {"os-image", 0x40000, 0x200000}, + {"file-system", 0x240000, 0x570000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -182,8 +182,7 @@ static struct device_info boards[] = { {"device-info", 0x31400, 0x00400}, {"signature", 0x32000, 0x00400}, {"device-id", 0x33000, 0x00100}, - {"os-image", 0x40000, 0x1c0000}, - {"file-system", 0x200000, 0x5b0000}, + {"firmware", 0x40000, 0x770000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x01000}, {"user-config", 0x7c0000, 0x10000}, @@ -197,10 +196,126 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "support-list", }, - /** Firmware layout for the CPE510/520 */ + /** Firmware layout for the CPE210 V3 */ { - .id = "CPE510", - .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", + .id = "CPE210V3", + .vendor = "CPE210(TP-LINK|UN|N300-2|00000000):3.0\r\n", + .support_list = + "SupportList:\r\n" + "CPE210(TP-LINK|EU|N300-2|45550000):3.0\r\n" + "CPE210(TP-LINK|UN|N300-2|00000000):3.0\r\n" + "CPE210(TP-LINK|UN|N300-2):3.0\r\n" + "CPE210(TP-LINK|EU|N300-2):3.0\r\n", + .support_trail = '\xff', + .soft_ver = NULL, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x01000}, + {"default-mac", 0x30000, 0x00020}, + {"product-info", 0x31100, 0x00100}, + {"device-info", 0x31400, 0x00400}, + {"signature", 0x32000, 0x00400}, + {"device-id", 0x33000, 0x00100}, + {"firmware", 0x40000, 0x770000}, + {"soft-version", 0x7b0000, 0x00100}, + {"support-list", 0x7b1000, 0x01000}, + {"user-config", 0x7c0000, 0x10000}, + {"default-config", 0x7d0000, 0x10000}, + {"log", 0x7e0000, 0x10000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "support-list", + }, + + /** Firmware layout for the CPE220 V2 */ + { + .id = "CPE220V2", + .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", + .support_list = + "SupportList:\r\n" + "CPE220(TP-LINK|EU|N300-2|00000000):2.0\r\n" + "CPE220(TP-LINK|EU|N300-2|45550000):2.0\r\n" + "CPE220(TP-LINK|EU|N300-2|55530000):2.0\r\n" + "CPE220(TP-LINK|UN|N300-2|00000000):2.0\r\n" + "CPE220(TP-LINK|UN|N300-2|45550000):2.0\r\n" + "CPE220(TP-LINK|UN|N300-2|55530000):2.0\r\n" + "CPE220(TP-LINK|US|N300-2|55530000):2.0\r\n" + "CPE220(TP-LINK|UN|N300-2):2.0\r\n" + "CPE220(TP-LINK|EU|N300-2):2.0\r\n" + "CPE220(TP-LINK|US|N300-2):2.0\r\n", + .support_trail = '\xff', + .soft_ver = NULL, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x00020}, + {"product-info", 0x31100, 0x00100}, + {"signature", 0x32000, 0x00400}, + {"os-image", 0x40000, 0x200000}, + {"file-system", 0x240000, 0x570000}, + {"soft-version", 0x7b0000, 0x00100}, + {"support-list", 0x7b1000, 0x00400}, + {"user-config", 0x7c0000, 0x10000}, + {"default-config", 0x7d0000, 0x10000}, + {"log", 0x7e0000, 0x10000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "support-list", + }, + + /** Firmware layout for the CPE220 V3 */ + { + .id = "CPE220V3", + .vendor = "CPE220(TP-LINK|UN|N300-2|00000000):3.0\r\n", + .support_list = + "SupportList:\r\n" + "CPE220(TP-LINK|EU|N300-2|00000000):3.0\r\n" + "CPE220(TP-LINK|EU|N300-2|45550000):3.0\r\n" + "CPE220(TP-LINK|EU|N300-2|55530000):3.0\r\n" + "CPE220(TP-LINK|UN|N300-2|00000000):3.0\r\n" + "CPE220(TP-LINK|UN|N300-2|45550000):3.0\r\n" + "CPE220(TP-LINK|UN|N300-2|55530000):3.0\r\n" + "CPE220(TP-LINK|US|N300-2|55530000):3.0\r\n" + "CPE220(TP-LINK|UN|N300-2):3.0\r\n" + "CPE220(TP-LINK|EU|N300-2):3.0\r\n" + "CPE220(TP-LINK|US|N300-2):3.0\r\n", + .support_trail = '\xff', + .soft_ver = NULL, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x00020}, + {"product-info", 0x31100, 0x00100}, + {"device-info", 0x31400, 0x00400}, + {"signature", 0x32000, 0x00400}, + {"device-id", 0x33000, 0x00100}, + {"firmware", 0x40000, 0x770000}, + {"soft-version", 0x7b0000, 0x00100}, + {"support-list", 0x7b1000, 0x01000}, + {"user-config", 0x7c0000, 0x10000}, + {"default-config", 0x7d0000, 0x10000}, + {"log", 0x7e0000, 0x10000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "support-list", + }, + + /** Firmware layout for the CPE510/520 V1 */ + { + .id = "CPE510", + .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", .support_list = "SupportList:\r\n" "CPE510(TP-LINK|UN|N300-5):1.0\r\n" @@ -210,13 +325,45 @@ static struct device_info boards[] = { "CPE510(TP-LINK|EU|N300-5):1.1\r\n" "CPE520(TP-LINK|UN|N300-5):1.1\r\n" "CPE520(TP-LINK|US|N300-5):1.1\r\n" - "CPE520(TP-LINK|EU|N300-5):1.1\r\n" + "CPE520(TP-LINK|EU|N300-5):1.1\r\n", + .support_trail = '\xff', + .soft_ver = NULL, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x00020}, + {"product-info", 0x31100, 0x00100}, + {"signature", 0x32000, 0x00400}, + {"os-image", 0x40000, 0x200000}, + {"file-system", 0x240000, 0x570000}, + {"soft-version", 0x7b0000, 0x00100}, + {"support-list", 0x7b1000, 0x00400}, + {"user-config", 0x7c0000, 0x10000}, + {"default-config", 0x7d0000, 0x10000}, + {"log", 0x7e0000, 0x10000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "support-list", + }, + + /** Firmware layout for the CPE510 V2 */ + { + .id = "CPE510V2", + .vendor = "CPE510(TP-LINK|UN|N300-5):2.0\r\n", + .support_list = + "SupportList:\r\n" "CPE510(TP-LINK|EU|N300-5|00000000):2.0\r\n" "CPE510(TP-LINK|EU|N300-5|45550000):2.0\r\n" "CPE510(TP-LINK|EU|N300-5|55530000):2.0\r\n" "CPE510(TP-LINK|UN|N300-5|00000000):2.0\r\n" "CPE510(TP-LINK|UN|N300-5|45550000):2.0\r\n" "CPE510(TP-LINK|UN|N300-5|55530000):2.0\r\n" + "CPE510(TP-LINK|US|N300-5|00000000):2.0\r\n" + "CPE510(TP-LINK|US|N300-5|45550000):2.0\r\n" "CPE510(TP-LINK|US|N300-5|55530000):2.0\r\n" "CPE510(TP-LINK|UN|N300-5):2.0\r\n" "CPE510(TP-LINK|EU|N300-5):2.0\r\n" @@ -230,8 +377,90 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x1c0000}, - {"file-system", 0x200000, 0x5b0000}, + {"os-image", 0x40000, 0x200000}, + {"file-system", 0x240000, 0x570000}, + {"soft-version", 0x7b0000, 0x00100}, + {"support-list", 0x7b1000, 0x00400}, + {"user-config", 0x7c0000, 0x10000}, + {"default-config", 0x7d0000, 0x10000}, + {"log", 0x7e0000, 0x10000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "support-list", + }, + + /** Firmware layout for the CPE510 V3 */ + { + .id = "CPE510V3", + .vendor = "CPE510(TP-LINK|UN|N300-5):3.0\r\n", + .support_list = + "SupportList:\r\n" + "CPE510(TP-LINK|EU|N300-5|00000000):3.0\r\n" + "CPE510(TP-LINK|EU|N300-5|45550000):3.0\r\n" + "CPE510(TP-LINK|EU|N300-5|55530000):3.0\r\n" + "CPE510(TP-LINK|UN|N300-5|00000000):3.0\r\n" + "CPE510(TP-LINK|UN|N300-5|45550000):3.0\r\n" + "CPE510(TP-LINK|UN|N300-5|55530000):3.0\r\n" + "CPE510(TP-LINK|US|N300-5|00000000):3.0\r\n" + "CPE510(TP-LINK|US|N300-5|45550000):3.0\r\n" + "CPE510(TP-LINK|US|N300-5|55530000):3.0\r\n" + "CPE510(TP-LINK|UN|N300-5):3.0\r\n" + "CPE510(TP-LINK|EU|N300-5):3.0\r\n" + "CPE510(TP-LINK|US|N300-5):3.0\r\n", + .support_trail = '\xff', + .soft_ver = NULL, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x00020}, + {"product-info", 0x31100, 0x00100}, + {"signature", 0x32000, 0x00400}, + {"os-image", 0x40000, 0x200000}, + {"file-system", 0x240000, 0x570000}, + {"soft-version", 0x7b0000, 0x00100}, + {"support-list", 0x7b1000, 0x00400}, + {"user-config", 0x7c0000, 0x10000}, + {"default-config", 0x7d0000, 0x10000}, + {"log", 0x7e0000, 0x10000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "support-list", + }, + + /** Firmware layout for the CPE610V1 */ + { + .id = "CPE610V1", + .vendor = "CPE610(TP-LINK|UN|N300-5|00000000):1.0\r\n", + .support_list = + "SupportList:\r\n" + "CPE610(TP-LINK|EU|N300-5|00000000):1.0\r\n" + "CPE610(TP-LINK|EU|N300-5|45550000):1.0\r\n" + "CPE610(TP-LINK|EU|N300-5|55530000):1.0\r\n" + "CPE610(TP-LINK|UN|N300-5|00000000):1.0\r\n" + "CPE610(TP-LINK|UN|N300-5|45550000):1.0\r\n" + "CPE610(TP-LINK|UN|N300-5|55530000):1.0\r\n" + "CPE610(TP-LINK|US|N300-5|55530000):1.0\r\n" + "CPE610(TP-LINK|UN|N300-5):1.0\r\n" + "CPE610(TP-LINK|EU|N300-5):1.0\r\n" + "CPE610(TP-LINK|US|N300-5):1.0\r\n", + .support_trail = '\xff', + .soft_ver = NULL, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x00020}, + {"product-info", 0x31100, 0x00100}, + {"signature", 0x32000, 0x00400}, + {"os-image", 0x40000, 0x200000}, + {"file-system", 0x240000, 0x570000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -246,8 +475,8 @@ static struct device_info boards[] = { }, { - .id = "WBS210", - .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", + .id = "WBS210", + .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", .support_list = "SupportList:\r\n" "WBS210(TP-LINK|UN|N300-2):1.20\r\n" @@ -262,8 +491,8 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x1c0000}, - {"file-system", 0x200000, 0x5b0000}, + {"os-image", 0x40000, 0x200000}, + {"file-system", 0x240000, 0x570000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -278,13 +507,13 @@ static struct device_info boards[] = { }, { - .id = "WBS510", - .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", + .id = "WBS210V2", + .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", .support_list = "SupportList:\r\n" - "WBS510(TP-LINK|UN|N300-5):1.20\r\n" - "WBS510(TP-LINK|US|N300-5):1.20\r\n" - "WBS510(TP-LINK|EU|N300-5):1.20\r\n", + "WBS210(TP-LINK|UN|N300-2|00000000):2.0\r\n" + "WBS210(TP-LINK|US|N300-2|55530000):2.0\r\n" + "WBS210(TP-LINK|EU|N300-2|45550000):2.0\r\n", .support_trail = '\xff', .soft_ver = NULL, @@ -294,8 +523,74 @@ static struct device_info boards[] = { {"default-mac", 0x30000, 0x00020}, {"product-info", 0x31100, 0x00100}, {"signature", 0x32000, 0x00400}, - {"os-image", 0x40000, 0x1c0000}, - {"file-system", 0x200000, 0x5b0000}, + {"os-image", 0x40000, 0x200000}, + {"file-system", 0x240000, 0x570000}, + {"soft-version", 0x7b0000, 0x00100}, + {"support-list", 0x7b1000, 0x00400}, + {"user-config", 0x7c0000, 0x10000}, + {"default-config", 0x7d0000, 0x10000}, + {"log", 0x7e0000, 0x10000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "support-list", + }, + + { + .id = "WBS510", + .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", + .support_list = + "SupportList:\r\n" + "WBS510(TP-LINK|UN|N300-5):1.20\r\n" + "WBS510(TP-LINK|US|N300-5):1.20\r\n" + "WBS510(TP-LINK|EU|N300-5):1.20\r\n" + "WBS510(TP-LINK|CA|N300-5):1.20\r\n", + .support_trail = '\xff', + .soft_ver = NULL, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x00020}, + {"product-info", 0x31100, 0x00100}, + {"signature", 0x32000, 0x00400}, + {"os-image", 0x40000, 0x200000}, + {"file-system", 0x240000, 0x570000}, + {"soft-version", 0x7b0000, 0x00100}, + {"support-list", 0x7b1000, 0x00400}, + {"user-config", 0x7c0000, 0x10000}, + {"default-config", 0x7d0000, 0x10000}, + {"log", 0x7e0000, 0x10000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "support-list", + }, + + { + .id = "WBS510V2", + .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", + .support_list = + "SupportList:\r\n" + "WBS510(TP-LINK|UN|N300-5|00000000):2.0\r\n" + "WBS510(TP-LINK|US|N300-5|55530000):2.0\r\n" + "WBS510(TP-LINK|EU|N300-5|45550000):2.0\r\n" + "WBS510(TP-LINK|CA|N300-5|43410000):2.0\r\n", + .support_trail = '\xff', + .soft_ver = NULL, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x00020}, + {"product-info", 0x31100, 0x00100}, + {"signature", 0x32000, 0x00400}, + {"os-image", 0x40000, 0x200000}, + {"file-system", 0x240000, 0x570000}, {"soft-version", 0x7b0000, 0x00100}, {"support-list", 0x7b1000, 0x00400}, {"user-config", 0x7c0000, 0x10000}, @@ -311,7 +606,7 @@ static struct device_info boards[] = { /** Firmware layout for the C2600 */ { - .id = "C2600", + .id = "C2600", .vendor = "", .support_list = "SupportList:\r\n" @@ -359,7 +654,7 @@ static struct device_info boards[] = { /** Firmware layout for the A7-V5 */ { - .id = "ARCHER-A7-V5", + .id = "ARCHER-A7-V5", .support_list = "SupportList:\n" "{product_name:Archer A7,product_ver:5.0.0,special_id:45550000}\n" @@ -397,9 +692,47 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system", }, + /** Firmware layout for the C2v3 */ + { + .id = "ARCHER-C2-V3", + .support_list = + "SupportList:\n" + "{product_name:ArcherC2,product_ver:3.0.0,special_id:00000000}\n" + "{product_name:ArcherC2,product_ver:3.0.0,special_id:55530000}\n" + "{product_name:ArcherC2,product_ver:3.0.0,special_id:45550000}\n", + .support_trail = '\x00', + .soft_ver = "soft_ver:3.0.1\n", + + /** We're using a dynamic kernel/rootfs split here */ + + .partitions = { + {"factory-boot", 0x00000, 0x20000}, + {"fs-uboot", 0x20000, 0x10000}, + {"firmware", 0x30000, 0x7a0000}, + {"user-config", 0x7d0000, 0x04000}, + {"default-mac", 0x7e0000, 0x00100}, + {"device-id", 0x7e0100, 0x00100}, + {"extra-para", 0x7e0200, 0x00100}, + {"pin", 0x7e0300, 0x00100}, + {"support-list", 0x7e0400, 0x00400}, + {"soft-version", 0x7e0800, 0x00400}, + {"product-info", 0x7e0c00, 0x01400}, + {"partition-table", 0x7e2000, 0x01000}, + {"profile", 0x7e3000, 0x01000}, + {"default-config", 0x7e4000, 0x04000}, + {"merge-config", 0x7ec000, 0x02000}, + {"qos-db", 0x7ee000, 0x02000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system", + }, + /** Firmware layout for the C25v1 */ { - .id = "ARCHER-C25-V1", + .id = "ARCHER-C25-V1", .support_list = "SupportList:\n" "{product_name:ArcherC25,product_ver:1.0.0,special_id:00000000}\n" @@ -437,8 +770,8 @@ static struct device_info boards[] = { /** Firmware layout for the C58v1 */ { - .id = "ARCHER-C58-V1", - .vendor = "", + .id = "ARCHER-C58-V1", + .vendor = "", .support_list = "SupportList:\r\n" "{product_name:Archer C58,product_ver:1.0.0,special_id:00000000}\r\n" @@ -471,8 +804,8 @@ static struct device_info boards[] = { /** Firmware layout for the C59v1 */ { - .id = "ARCHER-C59-V1", - .vendor = "", + .id = "ARCHER-C59-V1", + .vendor = "", .support_list = "SupportList:\r\n" "{product_name:Archer C59,product_ver:1.0.0,special_id:00000000}\r\n" @@ -510,8 +843,8 @@ static struct device_info boards[] = { /** Firmware layout for the C59v2 */ { - .id = "ARCHER-C59-V2", - .vendor = "", + .id = "ARCHER-C59-V2", + .vendor = "", .support_list = "SupportList:\r\n" "{product_name:Archer C59,product_ver:2.0.0,special_id:00000000}\r\n" @@ -548,10 +881,10 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system", }, - /** Firmware layout for the C6v2 */ + /** Firmware layout for the Archer C6 v2 (EU/RU/JP) */ { - .id = "ARCHER-C6-V2", - .vendor = "", + .id = "ARCHER-C6-V2", + .vendor = "", .support_list = "SupportList:\r\n" "{product_name:Archer C6,product_ver:2.0.0,special_id:45550000}\r\n" @@ -583,11 +916,45 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system", }, + /** Firmware layout for the Archer C6 v2 (US) and A6 v2 (US/TW) */ + { + .id = "ARCHER-C6-V2-US", + .vendor = "", + .support_list = + "SupportList:\n" + "{product_name:Archer A6,product_ver:2.0.0,special_id:55530000}\n" + "{product_name:Archer A6,product_ver:2.0.0,special_id:54570000}\n" + "{product_name:Archer C6,product_ver:2.0.0,special_id:55530000}\n", + .support_trail = '\x00', + .soft_ver = "soft_ver:1.1.1\n", + + .partitions = { + {"factory-boot", 0x00000, 0x20000}, + {"default-mac", 0x20000, 0x00200}, + {"pin", 0x20200, 0x00100}, + {"product-info", 0x20300, 0x00200}, + {"device-id", 0x20500, 0x0fb00}, + {"fs-uboot", 0x30000, 0x20000}, + {"firmware", 0x50000, 0xf89400}, + {"soft-version", 0xfd9400, 0x00100}, + {"extra-para", 0xfd9500, 0x00100}, + {"support-list", 0xfd9600, 0x00200}, + {"profile", 0xfd9800, 0x03000}, + {"default-config", 0xfdc800, 0x03000}, + {"partition-table", 0xfdf800, 0x00800}, + {"user-config", 0xfe0000, 0x0c000}, + {"certificate", 0xfec000, 0x04000}, + {"radio", 0xff0000, 0x10000}, + {NULL, 0, 0} + }, + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system", + }, /** Firmware layout for the C60v1 */ { - .id = "ARCHER-C60-V1", - .vendor = "", + .id = "ARCHER-C60-V1", + .vendor = "", .support_list = "SupportList:\r\n" "{product_name:Archer C60,product_ver:1.0.0,special_id:00000000}\r\n" @@ -620,8 +987,8 @@ static struct device_info boards[] = { /** Firmware layout for the C60v2 */ { - .id = "ARCHER-C60-V2", - .vendor = "", + .id = "ARCHER-C60-V2", + .vendor = "", .support_list = "SupportList:\r\n" "{product_name:Archer C60,product_ver:2.0.0,special_id:42520000}\r\n" @@ -656,7 +1023,7 @@ static struct device_info boards[] = { /** Firmware layout for the C5 */ { - .id = "ARCHER-C5-V2", + .id = "ARCHER-C5-V2", .vendor = "", .support_list = "SupportList:\r\n" @@ -691,7 +1058,7 @@ static struct device_info boards[] = { /** Firmware layout for the C7 */ { - .id = "ARCHER-C7-V4", + .id = "ARCHER-C7-V4", .support_list = "SupportList:\n" "{product_name:Archer C7,product_ver:4.0.0,special_id:00000000}\n" @@ -737,7 +1104,7 @@ static struct device_info boards[] = { /** Firmware layout for the C7 v5*/ { - .id = "ARCHER-C7-V5", + .id = "ARCHER-C7-V5", .support_list = "SupportList:\n" "{product_name:Archer C7,product_ver:5.0.0,special_id:00000000}\n" @@ -745,7 +1112,9 @@ static struct device_info boards[] = { "{product_name:Archer C7,product_ver:5.0.0,special_id:55530000}\n" "{product_name:Archer C7,product_ver:5.0.0,special_id:43410000}\n" "{product_name:Archer C7,product_ver:5.0.0,special_id:4A500000}\n" - "{product_name:Archer C7,product_ver:5.0.0,special_id:54570000}\n", + "{product_name:Archer C7,product_ver:5.0.0,special_id:54570000}\n" + "{product_name:Archer C7,product_ver:5.0.0,special_id:52550000}\n" + "{product_name:Archer C7,product_ver:5.0.0,special_id:4B520000}\n", .support_trail = '\x00', .soft_ver = "soft_ver:1.0.0\n", @@ -783,7 +1152,7 @@ static struct device_info boards[] = { /** Firmware layout for the C9 */ { - .id = "ARCHERC9", + .id = "ARCHERC9", .vendor = "", .support_list = "SupportList:\n" @@ -1070,7 +1439,7 @@ static struct device_info boards[] = { /** Firmware layout for the RE350 v1 */ { - .id = "RE350-V1", + .id = "RE350-V1", .vendor = "", .support_list = "SupportList:\n" @@ -1105,9 +1474,41 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system" }, + /** Firmware layout for the RE350K v1 */ + { + .id = "RE350K-V1", + .vendor = "", + .support_list = + "SupportList:\n" + "{product_name:RE350K,product_ver:1.0.0,special_id:00000000,product_region:US}\n", + .support_trail = '\x00', + .soft_ver = NULL, + + /** We're using a dynamic kernel/rootfs split here */ + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"firmware", 0x20000, 0xd70000}, + {"partition-table", 0xd90000, 0x02000}, + {"default-mac", 0xda0000, 0x00020}, + {"pin", 0xda0100, 0x00020}, + {"product-info", 0xda1100, 0x01000}, + {"soft-version", 0xdb0000, 0x01000}, + {"support-list", 0xdb1000, 0x01000}, + {"profile", 0xdb2000, 0x08000}, + {"user-config", 0xdc0000, 0x10000}, + {"default-config", 0xdd0000, 0x10000}, + {"device-id", 0xde0000, 0x00108}, + {"radio", 0xff0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system" + }, + /** Firmware layout for the RE355 */ { - .id = "RE355", + .id = "RE355", .vendor = "", .support_list = "SupportList:\r\n" @@ -1145,7 +1546,7 @@ static struct device_info boards[] = { /** Firmware layout for the RE450 */ { - .id = "RE450", + .id = "RE450", .vendor = "", .support_list = "SupportList:\r\n" @@ -1183,7 +1584,7 @@ static struct device_info boards[] = { /** Firmware layout for the RE450 v2 */ { - .id = "RE450-V2", + .id = "RE450-V2", .vendor = "", .support_list = "SupportList:\r\n" @@ -1221,6 +1622,43 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system" }, + /** Firmware layout for the RE650 */ + { + .id = "RE650-V1", + .vendor = "", + .support_list = + "SupportList:\r\n" + "{product_name:RE650,product_ver:1.0.0,special_id:00000000}\r\n" + "{product_name:RE650,product_ver:1.0.0,special_id:55530000}\r\n" + "{product_name:RE650,product_ver:1.0.0,special_id:45550000}\r\n" + "{product_name:RE650,product_ver:1.0.0,special_id:4A500000}\r\n" + "{product_name:RE650,product_ver:1.0.0,special_id:43410000}\r\n" + "{product_name:RE650,product_ver:1.0.0,special_id:41550000}\r\n" + "{product_name:RE650,product_ver:1.0.0,special_id:41530000}\r\n", + .support_trail = '\x00', + .soft_ver = NULL, + + /* We're using a dynamic kernel/rootfs split here */ + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"firmware", 0x20000, 0xde0000}, + {"partition-table", 0xe00000, 0x02000}, + {"default-mac", 0xe10000, 0x00020}, + {"pin", 0xe10100, 0x00020}, + {"product-info", 0xe11100, 0x01000}, + {"soft-version", 0xe20000, 0x01000}, + {"support-list", 0xe21000, 0x01000}, + {"profile", 0xe22000, 0x08000}, + {"user-config", 0xe30000, 0x10000}, + {"default-config", 0xe40000, 0x10000}, + {"radio", 0xff0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system" + }, + {} }; @@ -1260,13 +1698,13 @@ static void set_source_date_epoch() { char *env = getenv("SOURCE_DATE_EPOCH"); char *endptr = env; errno = 0; - if (env && *env) { + if (env && *env) { source_date_epoch = strtoull(env, &endptr, 10); if (errno || (endptr && *endptr != '\0')) { fprintf(stderr, "Invalid SOURCE_DATE_EPOCH"); exit(1); } - } + } } /** Generates the partition-table partition */ @@ -1377,11 +1815,12 @@ static struct image_partition_entry read_file(const char *part_name, const char size_t len = statbuf.st_size; - if (add_jffs2_eof) + if (add_jffs2_eof) { if (file_system_partition) len = ALIGN(len + file_system_partition->base, 0x10000) + sizeof(jffs2_eof_mark) - file_system_partition->base; else len = ALIGN(len, 0x10000) + sizeof(jffs2_eof_mark); + } struct image_partition_entry entry = alloc_image_partition(part_name, len); @@ -1651,7 +2090,8 @@ static void build_image(const char *output, parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof, file_system_partition); /* Some devices need the extra-para partition to accept the firmware */ - if (strcasecmp(info->id, "ARCHER-C25-V1") == 0 || + if (strcasecmp(info->id, "ARCHER-C2-V3") == 0 || + strcasecmp(info->id, "ARCHER-C25-V1") == 0 || strcasecmp(info->id, "ARCHER-C59-V2") == 0 || strcasecmp(info->id, "ARCHER-C60-V2") == 0 || strcasecmp(info->id, "TLWR1043NV5") == 0) { @@ -1663,6 +2103,9 @@ static void build_image(const char *output, } else if (strcasecmp(info->id, "ARCHER-C6-V2") == 0) { const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00}; parts[5] = put_data("extra-para", mdat, 11); + } else if (strcasecmp(info->id, "ARCHER-C6-V2-US") == 0) { + const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00}; + parts[5] = put_data("extra-para", mdat, 11); } size_t len; @@ -1730,7 +2173,7 @@ static int add_flash_partition( unsigned long base, unsigned long size) { - int ptr; + size_t ptr; /* check if the list has a free entry */ for (ptr = 0; ptr < max_entries; ptr++, part_list++) { if (part_list->name == NULL && @@ -1783,7 +2226,7 @@ static int read_partition_table( if (fseek(file, offset, SEEK_SET) < 0) error(1, errno, "Can not seek in the firmware"); - if (fread(buf, 1, 2048, file) < 0) + if (fread(buf, 2048, 1, file) != 1) error(1, errno, "Can not read fwup-ptn from the firmware"); buf[2047] = '\0'; @@ -1874,18 +2317,18 @@ static void write_partition( fseek(input_file, entry->base + firmware_offset, SEEK_SET); for (offset = 0; sizeof(buf) + offset <= entry->size; offset += sizeof(buf)) { - if (fread(buf, sizeof(buf), 1, input_file) < 0) + if (fread(buf, sizeof(buf), 1, input_file) != 1) error(1, errno, "Can not read partition from input_file"); - if (fwrite(buf, sizeof(buf), 1, output_file) < 0) + if (fwrite(buf, sizeof(buf), 1, output_file) != 1) error(1, errno, "Can not write partition to output_file"); } /* write last chunk smaller than buffer */ if (offset < entry->size) { offset = entry->size - offset; - if (fread(buf, offset, 1, input_file) < 0) + if (fread(buf, offset, 1, input_file) != 1) error(1, errno, "Can not read partition from input_file"); - if (fwrite(buf, offset, 1, output_file) < 0) + if (fwrite(buf, offset, 1, output_file) != 1) error(1, errno, "Can not write partition to output_file"); } } @@ -1938,7 +2381,7 @@ static int extract_firmware(const char *input, const char *output_directory) error(1, 0, "Error can not read the partition table (fwup-ptn)"); } - for (int i = 0; i < max_entries; i++) { + for (size_t i = 0; i < max_entries; i++) { if (entries[i].name == NULL && entries[i].base == 0 && entries[i].size == 0) @@ -1954,7 +2397,7 @@ static struct flash_partition_entry *find_partition( struct flash_partition_entry *entries, size_t max_entries, const char *name, const char *error_msg) { - for (int i = 0; i < max_entries; i++, entries++) { + for (size_t i = 0; i < max_entries; i++, entries++) { if (strcmp(entries->name, name) == 0) return entries; } @@ -1966,19 +2409,19 @@ static struct flash_partition_entry *find_partition( static void write_ff(FILE *output_file, size_t size) { char buf[4096]; - int offset; + size_t offset; memset(buf, 0xff, sizeof(buf)); for (offset = 0; offset + sizeof(buf) < size ; offset += sizeof(buf)) { - if (fwrite(buf, sizeof(buf), 1, output_file) < 0) + if (fwrite(buf, sizeof(buf), 1, output_file) != 1) error(1, errno, "Can not write 0xff to output_file"); } /* write last chunk smaller than buffer */ if (offset < size) { offset = size - offset; - if (fwrite(buf, offset, 1, output_file) < 0) + if (fwrite(buf, offset, 1, output_file) != 1) error(1, errno, "Can not write partition to output_file"); } } diff --git a/tools/firmware-utils/src/uimage_padhdr.c b/tools/firmware-utils/src/uimage_padhdr.c new file mode 100644 index 000000000..d1a1efb57 --- /dev/null +++ b/tools/firmware-utils/src/uimage_padhdr.c @@ -0,0 +1,157 @@ +/* + * uimage_padhdr.c : add zero paddings after the tail of uimage header + * + * Copyright (C) 2019 NOGUCHI Hiroshi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License, + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/* from u-boot/include/image.h */ +#define IH_MAGIC 0x27051956 /* Image Magic Number */ +#define IH_NMLEN 32 /* Image Name Length */ + +/* + * Legacy format image header, + * all data in network byte order (aka natural aka bigendian). + */ +typedef struct image_header { + uint32_t ih_magic; /* Image Header Magic Number */ + uint32_t ih_hcrc; /* Image Header CRC Checksum */ + uint32_t ih_time; /* Image Creation Timestamp */ + uint32_t ih_size; /* Image Data Size */ + uint32_t ih_load; /* Data Load Address */ + uint32_t ih_ep; /* Entry Point Address */ + uint32_t ih_dcrc; /* Image Data CRC Checksum */ + uint8_t ih_os; /* Operating System */ + uint8_t ih_arch; /* CPU architecture */ + uint8_t ih_type; /* Image Type */ + uint8_t ih_comp; /* Compression Type */ + uint8_t ih_name[IH_NMLEN]; /* Image Name */ +} image_header_t; + + +/* default padding size */ +#define IH_PAD_BYTES (32) + + +static void usage(char *prog) +{ + fprintf(stderr, + "%s -i -o [-l ]\n", + prog); +} + +int main(int argc, char *argv[]) +{ + struct stat statbuf; + u_int8_t *filebuf; + int ifd; + int ofd; + ssize_t rsz; + u_int32_t crc_recalc; + image_header_t *imgh; + int opt; + char *infname = NULL; + char *outfname = NULL; + int padsz = IH_PAD_BYTES; + int ltmp; + + while ((opt = getopt(argc, argv, "i:o:l:")) != -1) { + switch (opt) { + case 'i': + infname = optarg; + break; + case 'o': + outfname = optarg; + break; + case 'l': + ltmp = strtol(optarg, NULL, 0); + if (ltmp > 0) + padsz = ltmp; + break; + default: + break; + } + } + + if (!infname || !outfname) { + usage(argv[0]); + exit(1); + } + + ifd = open(infname, O_RDONLY); + if (ifd < 0) { + fprintf(stderr, + "could not open input file. (errno = %d)\n", errno); + exit(1); + } + + ofd = open(outfname, O_WRONLY | O_CREAT, 0644); + if (ofd < 0) { + fprintf(stderr, + "could not open output file. (errno = %d)\n", errno); + exit(1); + } + + if (fstat(ifd, &statbuf) < 0) { + fprintf(stderr, + "could not fstat input file. (errno = %d)\n", errno); + exit(1); + } + + filebuf = malloc(statbuf.st_size + padsz); + if (!filebuf) { + fprintf(stderr, "buffer allocation failed\n"); + exit(1); + } + + rsz = read(ifd, filebuf, sizeof(*imgh)); + if (rsz != sizeof(*imgh)) { + fprintf(stderr, + "could not read input file (errno = %d).\n", errno); + exit(1); + } + + memset(&(filebuf[sizeof(*imgh)]), 0, padsz); + + rsz = read(ifd, &(filebuf[sizeof(*imgh) + padsz]), + statbuf.st_size - sizeof(*imgh)); + if (rsz != (int32_t)(statbuf.st_size - sizeof(*imgh))) { + fprintf(stderr, + "could not read input file (errno = %d).\n", errno); + exit(1); + } + + imgh = (image_header_t *)filebuf; + + imgh->ih_hcrc = 0; + crc_recalc = crc32(0, filebuf, sizeof(*imgh) + padsz); + imgh->ih_hcrc = htonl(crc_recalc); + + rsz = write(ofd, filebuf, statbuf.st_size + padsz); + if (rsz != (int32_t)statbuf.st_size + padsz) { + fprintf(stderr, + "could not write output file (errnor = %d).\n", errno); + exit(1); + } + + return 0; +} diff --git a/tools/squashfskit4/Makefile b/tools/squashfskit4/Makefile new file mode 100644 index 000000000..4808c5607 --- /dev/null +++ b/tools/squashfskit4/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2009-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=squashfskit4 +PKG_VERSION:=4.14 + +PKG_SOURCE:=squashfskit-v$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://github.com/squashfskit/squashfskit/releases/download/v$(PKG_VERSION)/ +PKG_HASH:=5761aaa3aedc4f7112b708367d891c9abdc1ffea972e3fe47923ddba23984d95 + +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/squashfskit-v$(PKG_VERSION) + +include $(INCLUDE_DIR)/host-build.mk + +define Host/Compile + +$(HOST_MAKE_VARS) \ + $(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \ + XZ_SUPPORT=1 \ + LZMA_XZ_SUPPORT=1 \ + XATTR_SUPPORT= \ + LZMA_LIB="$(STAGING_DIR_HOST)/lib/liblzma.a" \ + EXTRA_CFLAGS="-I$(STAGING_DIR_HOST)/include" \ + mksquashfs unsquashfs +endef + +define Host/Install + $(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/mksquashfs $(STAGING_DIR_HOST)/bin/mksquashfs4 + $(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/unsquashfs $(STAGING_DIR_HOST)/bin/unsquashfs4 +endef + +define Host/Clean + rm -f $(STAGING_DIR_HOST)/bin/mksquashfs4 + rm -f $(STAGING_DIR_HOST)/bin/unsquashfs4 +endef + +$(eval $(call HostBuild)) diff --git a/tools/squashfskit4/patches/0001-fix-version.sh.patch b/tools/squashfskit4/patches/0001-fix-version.sh.patch new file mode 100644 index 000000000..5f0894bc1 --- /dev/null +++ b/tools/squashfskit4/patches/0001-fix-version.sh.patch @@ -0,0 +1,21 @@ +--- a/squashfs-tools/version.sh ++++ b/squashfs-tools/version.sh +@@ -27,13 +27,11 @@ if [ -z "$OUTPUT" ] ; then + fi + + our_date() { +-case $(uname) in +-NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin) +- date -r "$1" "$2" +- ;; +-*) +- date -d "@$1" "$2" +-esac ++ if date --version 2>&1 | grep -q "GNU coreutils"; then ++ date -d "@$1" "$2" ++ else ++ date -r "$1" "$2" ++ fi + } + + try_version() { diff --git a/tools/zip/Makefile b/tools/zip/Makefile new file mode 100644 index 000000000..7dd81a1b8 --- /dev/null +++ b/tools/zip/Makefile @@ -0,0 +1,36 @@ +# +# Copyright (C) 2007-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=zip +PKG_REV:=30 +PKG_VERSION:=3.0 + +PKG_SOURCE:=$(PKG_NAME)$(PKG_REV).tar.gz +PKG_SOURCE_URL:=@SF/infozip +PKG_HASH:=f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369 + +PKG_LICENSE:=BSD-4-Clause +PKG_LICENSE_FILES:=LICENSE + +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)/zip$(PKG_REV) +HOST_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/host-build.mk + +define Host/Compile + +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) -I. -f unix/Makefile zip +endef + +define Host/Install + $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ + $(INSTALL_BIN) $(HOST_BUILD_DIR)/zip $(STAGING_DIR_HOST)/bin/ +endef + +$(eval $(call HostBuild)) +#$(eval $(call BuildPackage,zip)) diff --git a/tools/zip/patches/001-unix-configure-borrow-the-LFS-test-from-autotools.patch b/tools/zip/patches/001-unix-configure-borrow-the-LFS-test-from-autotools.patch new file mode 100644 index 000000000..ef0de6fd9 --- /dev/null +++ b/tools/zip/patches/001-unix-configure-borrow-the-LFS-test-from-autotools.patch @@ -0,0 +1,89 @@ +From fc392c939b9a18959482f588aff0afc29dd6d30a Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Fri, 23 Jan 2015 22:20:18 +0100 +Subject: [PATCH 6/6] unix/configure: borrow the LFS test from autotools. + +Infozip's LFS check can't work for cross-compilation +since it try to run a target's binary on the host system. + +Instead, use to LFS test used by autotools which is a +compilation test. +(see autotools/lib/autoconf/specific.m4) + +Reported-by: Richard Genoud +Signed-off-by: Romain Naour +--- + configure | 46 +++++++++++++++------------------------------- + 1 file changed, 15 insertions(+), 31 deletions(-) + +--- a/unix/configure ++++ b/unix/configure +@@ -399,9 +399,8 @@ else + fi + + +-# Now we set the 64-bit file environment and check the size of off_t +-# Added 11/4/2003 EG +-# Revised 8/12/2004 EG ++# LFS check borrowed from autotools sources ++# lib/autoconf/specific.m4 + + echo Check for Large File Support + cat > conftest.c << _EOF_ +@@ -410,23 +409,19 @@ cat > conftest.c << _EOF_ + # define _FILE_OFFSET_BITS 64 /* select default interface as 64 bit */ + # define _LARGE_FILES /* some OSes need this for 64-bit off_t */ + #include +-#include +-#include +-#include ++ ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++ + int main() + { +- off_t offset; +- struct stat s; +- /* see if have 64-bit off_t */ +- if (sizeof(offset) < 8) +- return 1; +- printf(" off_t is %d bytes\n", sizeof(off_t)); +- /* see if have 64-bit stat */ +- if (sizeof(s.st_size) < 8) { +- printf(" s.st_size is %d bytes\n", sizeof(s.st_size)); +- return 2; +- } +- return 3; ++ return 0; + } + _EOF_ + # compile it +@@ -434,19 +429,8 @@ $CC -o conftest conftest.c >/dev/null 2> + if [ $? -ne 0 ]; then + echo -- no Large File Support + else +-# run it +- ./conftest +- r=$? +- if [ $r -eq 1 ]; then +- echo -- no Large File Support - no 64-bit off_t +- elif [ $r -eq 2 ]; then +- echo -- no Large File Support - no 64-bit stat +- elif [ $r -eq 3 ]; then +- echo -- yes we have Large File Support! +- CFLAGS="${CFLAGS} -DLARGE_FILE_SUPPORT" +- else +- echo -- no Large File Support - conftest returned $r +- fi ++ echo -- yes we have Large File Support! ++ CFLAGS="${CFLAGS} -DLARGE_FILE_SUPPORT" + fi + + diff --git a/tools/zip/patches/004-do-not-set-unwanted-cflags.patch b/tools/zip/patches/004-do-not-set-unwanted-cflags.patch new file mode 100644 index 000000000..bfd226077 --- /dev/null +++ b/tools/zip/patches/004-do-not-set-unwanted-cflags.patch @@ -0,0 +1,15 @@ +From: Santiago Vila +Subject: Do not set unwanted CFLAGS, as it breaks DEB_BUILD_OPTIONS +X-Debian-version: 2.32-1 + +--- a/unix/configure ++++ b/unix/configure +@@ -98,7 +98,7 @@ int main() + _EOF_ + $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null + if test $? -eq 0; then +- CFLAGS_OPT='-O3' ++ # CFLAGS_OPT='-O3' + echo " GNU C ($CFLAGS_OPT)" + # Special Mac OS X shared library "ld" option? + if test ` uname -s 2> /dev/null ` = 'Darwin'; then diff --git a/tools/zip/patches/006-stack-markings-to-avoid-executable-stack.patch b/tools/zip/patches/006-stack-markings-to-avoid-executable-stack.patch new file mode 100644 index 000000000..8b479faed --- /dev/null +++ b/tools/zip/patches/006-stack-markings-to-avoid-executable-stack.patch @@ -0,0 +1,21 @@ +From: Kees Cook +Subject: put stack markings in i386 assembly to avoid executable stack +Bug-Debian: http://bugs.debian.org/528280 +X-Debian-version: 3.0-2 + +--- a/crc_i386.S ++++ b/crc_i386.S +@@ -302,3 +302,5 @@ _crc32: /* ulg c + #endif /* i386 || _i386 || _I386 || __i386 */ + + #endif /* !USE_ZLIB && !CRC_TABLE_ONLY */ ++.section .note.GNU-stack, "", @progbits ++.previous +--- a/match.S ++++ b/match.S +@@ -405,3 +405,5 @@ L__return: + #endif /* i386 || _I386 || _i386 || __i386 */ + + #endif /* !USE_ZLIB */ ++.section .note.GNU-stack, "", @progbits ++.previous diff --git a/tools/zip/patches/007-fclose-in-file-not-fclose-x.patch b/tools/zip/patches/007-fclose-in-file-not-fclose-x.patch new file mode 100644 index 000000000..402f90a2d --- /dev/null +++ b/tools/zip/patches/007-fclose-in-file-not-fclose-x.patch @@ -0,0 +1,16 @@ +From: Christian Spieler +Subject: zipnote.c: Close in_file instead of undefined file x +Bug-Debian: http://bugs.debian.org/628594 +X-Debian-version: 3.0-4 + +--- a/zipnote.c ++++ b/zipnote.c +@@ -661,7 +661,7 @@ char **argv; /* command line + if ((r = zipcopy(z)) != ZE_OK) + ziperr(r, "was copying an entry"); + } +- fclose(x); ++ fclose(in_file); + + /* Write central directory and end of central directory with new comments */ + if ((c = zftello(y)) == (zoff_t)-1) /* get start of central */ diff --git a/tools/zip/patches/008-hardening-build-fix-1.patch b/tools/zip/patches/008-hardening-build-fix-1.patch new file mode 100644 index 000000000..a0c3a91ee --- /dev/null +++ b/tools/zip/patches/008-hardening-build-fix-1.patch @@ -0,0 +1,25 @@ +From: Santiago Vila +Subject: Use format specifier %s to print strings, not the string itself +Bug-Debian: http://bugs.debian.org/673476 +X-Debian-version: 3.0-5 + +--- a/zip.c ++++ b/zip.c +@@ -1028,7 +1028,7 @@ local void help_extended() + + for (i = 0; i < sizeof(text)/sizeof(char *); i++) + { +- printf(text[i]); ++ printf("%s", text[i]); + putchar('\n'); + } + #ifdef DOS +@@ -1225,7 +1225,7 @@ local void version_info() + CR_MAJORVER, CR_MINORVER, CR_BETA_VER, CR_VERSION_DATE); + for (i = 0; i < sizeof(cryptnote)/sizeof(char *); i++) + { +- printf(cryptnote[i]); ++ printf("%s", cryptnote[i]); + putchar('\n'); + } + ++i; /* crypt support means there IS at least one compilation option */ diff --git a/tools/zip/patches/009-hardening-build-fix-2.patch b/tools/zip/patches/009-hardening-build-fix-2.patch new file mode 100644 index 000000000..e295ffbc6 --- /dev/null +++ b/tools/zip/patches/009-hardening-build-fix-2.patch @@ -0,0 +1,16 @@ +From: Santiago Vila +Subject: unix/configure: Take linking flags from the environment +Bug-Debian: http://bugs.debian.org/673476 +X-Debian-version: 3.0-5 + +--- a/unix/configure ++++ b/unix/configure +@@ -18,7 +18,7 @@ trap "rm -f conftest* core a.out; exit 1 + + CC=${1-cc} + CFLAGS=${2-"-I. -DUNIX"} +-LFLAGS1='' ++LFLAGS1=${LDFLAGS} + LFLAGS2='' + LN="ln -s" + diff --git a/tools/zip/patches/010-remove-build-date.patch b/tools/zip/patches/010-remove-build-date.patch new file mode 100644 index 000000000..5fc385228 --- /dev/null +++ b/tools/zip/patches/010-remove-build-date.patch @@ -0,0 +1,15 @@ +From: Santiago Vila +Subject: Remove (optional) build date to make the build reproducible +Bug-Debian: http://bugs.debian.org/779042 + +--- a/unix/unix.c ++++ b/unix/unix.c +@@ -1020,7 +1020,7 @@ void version_local() + + + /* Define the compile date string */ +-#ifdef __DATE__ ++#if 0 + # define COMPILE_DATE " on " __DATE__ + #else + # define COMPILE_DATE "" diff --git a/tools/zip/patches/011-add-option-for-reproducible-archives.patch b/tools/zip/patches/011-add-option-for-reproducible-archives.patch new file mode 100644 index 000000000..45b9d67e1 --- /dev/null +++ b/tools/zip/patches/011-add-option-for-reproducible-archives.patch @@ -0,0 +1,145 @@ +From 6d659fc87451c02c8777dc33f750b16834e4c715 Mon Sep 17 00:00:00 2001 +From: Mathias Kresin +Date: Sat, 12 Jan 2019 19:33:33 +0100 +Subject: [PATCH] add option for reproducible archives + +Add the option -mt/--mtime to pass a timestamp which is used as filedate +for the containing files. + +So far, it isn't used for anything written to the extra fields, +therefore requires the -X (eXclude eXtra file attributes) parameter to +be effective. + +Signed-off-by: Mathias Kresin +--- + globals.c | 1 + + util.c | 22 ++++++++++++++++++++++ + zip.c | 6 ++++++ + zip.h | 1 + + zipup.c | 4 +++- + 5 files changed, 33 insertions(+), 1 deletion(-) + +--- a/globals.c ++++ b/globals.c +@@ -205,6 +205,7 @@ uzoff_t bytes_this_split = 0; /* byt + int read_split_archive = 0; /* 1=scanzipf_reg detected spanning signature */ + int split_method = 0; /* 0=no splits, 1=seekable, 2=data desc, -1=no */ + uzoff_t split_size = 0; /* how big each split should be */ ++time_t timestamp = -1; /* fixed timestamp for archive content filedate */ + int split_bell = 0; /* when pause for next split ring bell */ + uzoff_t bytes_prev_splits = 0; /* total bytes written to all splits before this */ + uzoff_t bytes_this_entry = 0; /* bytes written for this entry across all splits */ +--- a/util.c ++++ b/util.c +@@ -1217,6 +1217,7 @@ int DisplayNumString(file, i) + return 0; + } + ++ + /* Read numbers with trailing size multiplier (like 10M) and return number. + 10/30/04 EG */ + +@@ -1279,6 +1280,29 @@ uzoff_t ReadNumString( numstring ) + } + + ++uzoff_t ReadNumStringUL( numstring ) ++ char *numstring; ++{ ++ zoff_t num = 0; ++ ++ /* check if valid number (currently no negatives) */ ++ if (numstring == NULL) { ++ zipwarn("Unable to read empty number in ReadNumString", ""); ++ return (uzoff_t)-1; ++ } ++ if (numstring[0] < '0' || numstring[0] > '9') { ++ zipwarn("Unable to read number (must start with digit): ", numstring); ++ return (uzoff_t)-1; ++ } ++ if (strlen(numstring) > 10) { ++ zipwarn("Number too long to read (10 characters max): ", numstring); ++ return (uzoff_t)-1; ++ } ++ ++ return (uzoff_t)atoll(numstring); ++} ++ ++ + /* Write the number as a string with a multiplier (like 10M) to outstring. + Always writes no more than 3 digits followed maybe by a multiplier and + returns the characters written or -1 if error. +--- a/zip.c ++++ b/zip.c +@@ -1942,6 +1942,7 @@ int set_filetype(out_path) + #ifdef UNICODE_TEST + #define o_sC 0x146 + #endif ++#define o_mt 0x255 + + + /* the below is mainly from the old main command line +@@ -2036,6 +2037,7 @@ struct option_struct far options[] = { + {"m", "move", o_NO_VALUE, o_NOT_NEGATABLE, 'm', "add files to archive then delete files"}, + {"mm", "", o_NO_VALUE, o_NOT_NEGATABLE, o_mm, "not used"}, + {"MM", "must-match", o_NO_VALUE, o_NOT_NEGATABLE, o_MM, "error if in file not matched/not readable"}, ++ {"mt", "mtime", o_REQUIRED_VALUE, o_NOT_NEGATABLE, o_mt, "use fixed timestamp for archive content filedate"}, + {"n", "suffixes", o_REQUIRED_VALUE, o_NOT_NEGATABLE, 'n', "suffixes to not compress: .gz:.zip"}, + {"nw", "no-wild", o_NO_VALUE, o_NOT_NEGATABLE, o_nw, "no wildcards during add or update"}, + #if defined(AMIGA) || defined(MACOS) +@@ -2440,6 +2442,7 @@ char **argv; /* command line + split_method = 0; /* 0=no splits, 1=update LHs, 2=data descriptors */ + split_size = 0; /* how big each split should be */ + split_bell = 0; /* when pause for next split ring bell */ ++ timestamp = -1; /* fixed timestamp for archive content filedate */ + bytes_prev_splits = 0; /* total bytes written to all splits before this */ + bytes_this_entry = 0; /* bytes written for this entry across all splits */ + noisy_splits = 0; /* be verbose about creating splits */ +@@ -2897,6 +2900,9 @@ char **argv; /* command line + dispose = 1; break; + case o_MM: /* Exit with error if input file can't be read */ + bad_open_is_error = 1; break; ++ case o_mt: /* fixed timestamp for archive content filedate */ ++ timestamp = ReadNumStringUL(value); ++ break; + case 'n': /* Don't compress files with a special suffix */ + special = value; + /* special = NULL; */ /* will be set at next argument */ +--- a/zip.h ++++ b/zip.h +@@ -502,6 +502,7 @@ extern uzoff_t bytes_this_split; /* byte + extern int read_split_archive; /* 1=scanzipf_reg detected spanning signature */ + extern int split_method; /* 0=no splits, 1=seekable, 2=data descs, -1=no */ + extern uzoff_t split_size; /* how big each split should be */ ++extern time_t timestamp; /* fixed timestamp for archive content filedate */ + extern int split_bell; /* when pause for next split ring bell */ + extern uzoff_t bytes_prev_splits; /* total bytes written to all splits before this */ + extern uzoff_t bytes_this_entry; /* bytes written for this entry across all splits */ +@@ -789,6 +790,7 @@ char *zip_fzofft OF((zoff_t, char + int DisplayNumString OF ((FILE *file, uzoff_t i)); + int WriteNumString OF((uzoff_t num, char *outstring)); + uzoff_t ReadNumString OF((char *numstring)); ++uzoff_t ReadNumStringUL OF((char *numstring)); + + /* returns true if abbrev is abbreviation for string */ + int abbrevmatch OF((char *, char *, int, int)); +--- a/zipup.c ++++ b/zipup.c +@@ -415,7 +415,6 @@ struct zlist far *z; /* zip entry to + char *tempextra = NULL; + char *tempcextra = NULL; + +- + #ifdef WINDLL + # ifdef ZIP64_SUPPORT + extern _int64 filesize64; +@@ -441,6 +440,9 @@ struct zlist far *z; /* zip entry to + if (tim == 0 || q == (zoff_t) -3) + return ZE_OPEN; + ++ if (timestamp > 0) ++ tim = unix2dostime(×tamp); ++ + /* q is set to -1 if the input file is a device, -2 for a volume label */ + if (q == (zoff_t) -2) { + isdir = 1;