diff --git a/include/kernel-build.mk b/include/kernel-build.mk index 3fdf7efc52..684fbd34d3 100644 --- a/include/kernel-build.mk +++ b/include/kernel-build.mk @@ -163,6 +163,7 @@ define BuildKernel $(LINUX_RECONF_CMD) > $(LINUX_DIR)/.config $(_SINGLE)$(KERNEL_MAKE) \ $(if $(findstring Darwin,$(HOST_OS)),HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib -lncurses") \ + YACC=$(STAGING_DIR_HOST)/bin/bison \ $$@ $(LINUX_RECONF_DIFF) $(LINUX_DIR)/.config > $(LINUX_RECONFIG_TARGET) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 4c59910056..a711ae33f7 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -144,15 +144,17 @@ $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ $(eval $(call CleanupPython2)) $(eval $(call SetupHostCommand,python,Please install Python >= 3.5, \ - python3.7 -V 2>&1 | grep -E 'Python 3\.[5-9]\.?', \ - python3.6 -V 2>&1 | grep -E 'Python 3\.[5-9]\.?', \ - python3.5 -V 2>&1 | grep -E 'Python 3\.[5-9]\.?', \ + python3.8 -V 2>&1 | grep 'Python 3', \ + python3.7 -V 2>&1 | grep 'Python 3', \ + python3.6 -V 2>&1 | grep 'Python 3', \ + python3.5 -V 2>&1 | grep 'Python 3', \ python3 -V 2>&1 | grep -E 'Python 3\.[5-9]\.?')) $(eval $(call SetupHostCommand,python3,Please install Python >= 3.5, \ - python3.7 -V 2>&1 | grep -E 'Python 3\.[5-9]\.?', \ - python3.6 -V 2>&1 | grep -E 'Python 3\.[5-9]\.?', \ - python3.5 -V 2>&1 | grep -E 'Python 3\.[5-9]\.?', \ + python3.8 -V 2>&1 | grep 'Python 3', \ + python3.7 -V 2>&1 | grep 'Python 3', \ + python3.6 -V 2>&1 | grep 'Python 3', \ + python3.5 -V 2>&1 | grep 'Python 3', \ python3 -V 2>&1 | grep -E 'Python 3\.[5-9]\.?')) $(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \ diff --git a/package/base-files/Makefile b/package/base-files/Makefile index b35d00cf94..0ca4d739f3 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=208 +PKG_RELEASE:=209 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index d3fa3be505..dbe26ec3bd 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -109,7 +109,7 @@ ${INIT_TRACE:+set -x} EXTRA_HELP="\ running Check if service is running status Service status - " +${EXTRA_HELP}" . $IPKG_INSTROOT/lib/functions/procd.sh basescript=$(readlink "$initscript") diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index fefbb48801..bab5fa556f 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -19,6 +19,9 @@ engenius,ecb1750|\ glinet,gl-ar300m-lite|\ glinet,gl-ar300m-nand|\ glinet,gl-ar300m-nor|\ +glinet,gl-ar300m16|\ +glinet,gl-ar750s-nor|\ +glinet,gl-ar750s-nor-nand|\ librerouter,librerouter-v1|\ netgear,ex6400|\ netgear,ex7300|\ @@ -39,6 +42,7 @@ buffalo,wzr-hp-ag300h) netgear,wndr3700) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000" ;; +netgear,wndr3700-v4|\ netgear,wndr4300) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000" ;; diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index 5e2484cec5..232dbd1d34 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -151,7 +151,7 @@ define KernelPackage/fb-sys-fops DEPENDS:=+kmod-fb KCONFIG:=CONFIG_FB_SYS_FOPS FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/fb_sys_fops.ko - AUTOLOAD:=$(call AutoLoad,07,fbsysfops) + AUTOLOAD:=$(call AutoLoad,07,fb_sys_fops) endef define KernelPackage/fb-sys-fops/description diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 5b174cded6..2b8b2d4677 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -814,6 +814,13 @@ mac80211_interface_cleanup() { mac80211_vap_cleanup hostapd "${primary_ap}" mac80211_vap_cleanup wpa_supplicant "$(uci -q -P /var/state get wireless._${phy}.splist)" + for wdev in $(list_phy_interfaces "$phy"); do + local wdev_phy="$(readlink /sys/class/net/${wdev}/phy80211)" + wdev_phy="$(basename "$wdev_phy")" + [ -n "$wdev_phy" -a "$wdev_phy" != "$phy" ] && continue + ip link set dev "$wdev" down 2>/dev/null + iw dev "$wdev" del + done } mac80211_set_noscan() { @@ -945,6 +952,15 @@ drv_mac80211_setup() { wireless_set_up } +list_phy_interfaces() { + local phy="$1" + if [ -d "/sys/class/ieee80211/${phy}/device/net" ]; then + ls "/sys/class/ieee80211/${phy}/device/net" 2>/dev/null; + else + ls "/sys/class/ieee80211/${phy}/device" 2>/dev/null | grep net: | sed -e 's,net:,,g' + fi +} + drv_mac80211_teardown() { wireless_process_kill_all diff --git a/package/libs/libnl-tiny/Makefile b/package/libs/libnl-tiny/Makefile index 4fde17a365..3c5f6d79f4 100644 --- a/package/libs/libnl-tiny/Makefile +++ b/package/libs/libnl-tiny/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/libnl-tiny.git -PKG_SOURCE_DATE:=2019-10-04 -PKG_SOURCE_VERSION:=0230d0698e596ab2e836abd2459d970b14bacb25 -PKG_MIRROR_HASH:=a2543a577a91fbf9ee7fe662a1e2675da1d65d2f56bba8471a2cfe2ddd1cd46a +PKG_SOURCE_DATE:=2019-10-29 +PKG_SOURCE_VERSION:=0219008cc8767655d7e747497e8e1133a3e8f840 +PKG_MIRROR_HASH:=b84fab21374c6ddbf992acc4ec1c9c6896b32af97603027ca5c866d69d95780f CMAKE_INSTALL:=1 PKG_LICENSE:=LGPL-2.1 diff --git a/package/system/fwtool/Makefile b/package/system/fwtool/Makefile index 8397282392..00f0339b02 100644 --- a/package/system/fwtool/Makefile +++ b/package/system/fwtool/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/fwtool.git -PKG_SOURCE_DATE:=2019-11-09 -PKG_SOURCE_VERSION:=9d9d4c2847862adec2f474d4126213c17f98e024 -PKG_MIRROR_HASH:=4a72a48cbc7cda4c1860ec8328c049b4b84f7f00273d82ee98175937b63af1f8 +PKG_SOURCE_DATE:=2019-11-12 +PKG_SOURCE_VERSION:=8f7fe925ca205c8e8e2d0d1b16218c1e148d5173 +PKG_MIRROR_HASH:=ff68e77397a7ba8f497aae9a6d1f89e196c89391a8d5ed0b81c4eafb889ba744 CMAKE_INSTALL:=1 PKG_FLAGS:=nonshared diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile index d3169e01fa..dd08c43d29 100644 --- a/package/system/uci/Makefile +++ b/package/system/uci/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=3 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE=2019-11-08 -PKG_SOURCE_VERSION:=fc417e808087f96466d9ce18819e16476af9527b -PKG_MIRROR_HASH:=9d9f4756633e4b011ae68138793723c6443d0d81c7f626580881dc0cae77eceb +PKG_SOURCE_DATE=2019-11-14 +PKG_SOURCE_VERSION:=8dd50da20de0ece65118b2b4b71f8df8ac3a1f6d +PKG_MIRROR_HASH:=6c74d7dc777a64fd833c207fb7c7107f55d7b42ba7184ebaef5fc34f686c4a25 PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:= diff --git a/target/linux/ath79/config-4.19 b/target/linux/ath79/config-4.19 index 42843a1858..be5e46ac76 100644 --- a/target/linux/ath79/config-4.19 +++ b/target/linux/ath79/config-4.19 @@ -179,7 +179,6 @@ CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y -CONFIG_OF_ADDRESS_PCI=y CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y @@ -187,8 +186,6 @@ CONFIG_OF_IRQ=y CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y CONFIG_OF_NET=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y CONFIG_PCI=y CONFIG_PCI_AR71XX=y CONFIG_PCI_AR724X=y diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi new file mode 100644 index 0000000000..16a4e3f6e8 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi @@ -0,0 +1,290 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9344.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power_amber; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_amber; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + + rfkill { + label = "rfkill"; + linux,code = ; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&enable_gpio_11>; + + led_power_green: power_green { + label = "netgear:green:power"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + led_power_amber: power_amber { + label = "netgear:amber:power"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + wan_green { + label = "netgear:green:wan"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + wan_amber { + label = "netgear:amber:wan"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wlan2g_green { + label = "netgear:green:wlan2g"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g_blue { + label = "netgear:blue:wlan5g"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wps_green { + label = "netgear:green:wps"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wps_amber { + label = "netgear:amber:wps"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + usb_green { + label = "netgear:green:usb"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port>; + linux,default-trigger = "usbport"; + }; + }; +}; + +&pinmux { + enable_gpio_11: pinmux_enable_gpio_11 { + pinctrl-single,bits = <0x8 0x0 0xff000000>; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x40000>; + }; + + art: partition@80000 { + label = "caldata"; + reg = <0x80000 0x40000>; + read-only; + }; + + partition@c0000 { + label = "pot"; + reg = <0xc0000 0x80000>; + }; + + partition@140000 { + label = "language"; + reg = <0x140000 0x200000>; + }; + + partition@340000 { + label = "config"; + reg = <0x340000 0x80000>; + }; + + partition@3c0000 { + label = "traffic_meter"; + reg = <0x3c0000 0x300000>; + }; + + kernel@6c0000 { + label = "kernel"; + reg = <0x6c0000 0x200000>; + }; + + ubi@8c0000 { + label = "ubi"; + reg = <0x8c0000 0x1700000>; + }; + + partition@6c0000 { + label = "firmware"; + reg = <0x6c0000 0x1900000>; + compatible = "netgear,uimage"; + }; + + partition@1fc0000 { + label = "caldata_backup"; + reg = <0x1fc0000 0x40000>; + read-only; + }; + + partition@2000000 { + label = "reserved"; + reg = <0x2000000 0x6000000>; + read-only; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&builtin_switch { + resets = <&rst 8>, <&rst 12>; + reset-names = "switch", "switch-analog"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "rgmii"; + qca,mib-poll-interval = <500>; + + qca,ar8327-initvals = < + 0x04 0x07600000 + 0x0c 0x01000000 + 0x10 0xc1000000 + 0x50 0xcc35cc35 + 0x54 0xcb37cb37 + 0x58 0x00000000 + 0x5c 0x00f3cf00 + 0x7c 0x0000007e + 0x94 0x0000007e + >; + }; +}; + +ð0 { + status = "okay"; + + /* default for ar934x, except for 1000M */ + pll-data = <0x06000000 0x00000101 0x00001616>; + + mtd-mac-address = <&art 0x0>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; +}; + +&gpio { + status = "okay"; + + lna0 { + gpio-hog; + line-name = "netgear:ext:lna0"; + gpios = <18 GPIO_ACTIVE_HIGH>; + output-high; + }; + + lna1 { + gpio-hog; + line-name = "netgear:ext:lna1"; + gpios = <19 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +&wmac { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + qca,no-eeprom; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + mtd-mac-address = <&art 0xc>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + + usb_power { + gpio-hog; + line-name = "netgear:power:usb"; + gpios = <0 GPIO_ACTIVE_HIGH>; + output-high; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&usb { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + hub_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&uart { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts b/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts new file mode 100644 index 0000000000..8a38aeab59 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_netgear_wndr.dtsi" + +/ { + compatible = "netgear,wndr3700-v4", "qca,ar9344"; + model = "Netgear WNDR3700 v4"; +}; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts b/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts index 08cd84e51e..9b57bb88a6 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts +++ b/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts @@ -1,293 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - -#include "ar9344.dtsi" +#include "ar9344_netgear_wndr.dtsi" / { compatible = "netgear,wndr4300", "qca,ar9344"; model = "Netgear WNDR4300"; - - chosen { - bootargs = "console=ttyS0,115200n8"; - }; - - aliases { - led-boot = &led_power_amber; - led-failsafe = &led_power_amber; - led-running = &led_power_green; - led-upgrade = &led_power_amber; - label-mac-device = ð0; - }; - - keys { - compatible = "gpio-keys"; - - wps { - label = "wps"; - linux,code = ; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; - - reset { - label = "reset"; - linux,code = ; - gpios = <&gpio 21 GPIO_ACTIVE_LOW>; - }; - - rfkill { - label = "rfkill"; - linux,code = ; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - }; - }; - - leds { - compatible = "gpio-leds"; - - pinctrl-names = "default"; - pinctrl-0 = <&enable_gpio_11>; - - led_power_green: power_green { - label = "netgear:green:power"; - gpios = <&gpio 0 GPIO_ACTIVE_LOW>; - }; - - led_power_amber: power_amber { - label = "netgear:amber:power"; - gpios = <&gpio 2 GPIO_ACTIVE_LOW>; - default-state = "keep"; - }; - - wan_green { - label = "netgear:green:wan"; - gpios = <&gpio 1 GPIO_ACTIVE_LOW>; - }; - - wan_amber { - label = "netgear:amber:wan"; - gpios = <&gpio 3 GPIO_ACTIVE_LOW>; - }; - - wlan2g_green { - label = "netgear:green:wlan2g"; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - wlan5g_blue { - label = "netgear:blue:wlan5g"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - - wps_green { - label = "netgear:green:wps"; - gpios = <&gpio 16 GPIO_ACTIVE_LOW>; - }; - - wps_amber { - label = "netgear:amber:wps"; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - }; - - usb_green { - label = "netgear:green:usb"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - trigger-sources = <&hub_port>; - linux,default-trigger = "usbport"; - }; - }; -}; - -&pinmux { - enable_gpio_11: pinmux_enable_gpio_11 { - pinctrl-single,bits = <0x8 0x0 0xff000000>; - }; -}; - -&nand { - status = "okay"; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x40000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x40000 0x40000>; - }; - - art: partition@80000 { - label = "caldata"; - reg = <0x80000 0x40000>; - read-only; - }; - - partition@c0000 { - label = "pot"; - reg = <0xc0000 0x80000>; - }; - - partition@140000 { - label = "language"; - reg = <0x140000 0x200000>; - }; - - partition@340000 { - label = "config"; - reg = <0x340000 0x80000>; - }; - - partition@3c0000 { - label = "traffic_meter"; - reg = <0x3c0000 0x300000>; - }; - - kernel@6c0000 { - label = "kernel"; - reg = <0x6c0000 0x200000>; - }; - - ubi@8c0000 { - label = "ubi"; - reg = <0x8c0000 0x1700000>; - }; - - partition@6c0000 { - label = "firmware"; - reg = <0x6c0000 0x1900000>; - compatible = "netgear,uimage"; - }; - - partition@1fc0000 { - label = "caldata_backup"; - reg = <0x1fc0000 0x40000>; - read-only; - }; - - partition@2000000 { - label = "reserved"; - reg = <0x2000000 0x6000000>; - read-only; - }; - }; -}; - -&ref { - clock-frequency = <40000000>; -}; - -&builtin_switch { - resets = <&rst 8>, <&rst 12>; - reset-names = "switch", "switch-analog"; -}; - -&mdio0 { - status = "okay"; - - phy-mask = <0>; - - phy0: ethernet-phy@0 { - reg = <0>; - phy-mode = "rgmii"; - qca,mib-poll-interval = <500>; - - qca,ar8327-initvals = < - 0x04 0x07600000 - 0x0c 0x01000000 - 0x10 0xc1000000 - 0x50 0xcc35cc35 - 0x54 0xcb37cb37 - 0x58 0x00000000 - 0x5c 0x00f3cf00 - 0x7c 0x0000007e - 0x94 0x0000007e - >; - }; -}; - -ð0 { - status = "okay"; - - /* default for ar934x, except for 1000M */ - pll-data = <0x06000000 0x00000101 0x00001616>; - - mtd-mac-address = <&art 0x0>; - - phy-mode = "rgmii"; - phy-handle = <&phy0>; -}; - -&gpio { - status = "okay"; - - lna0 { - gpio-hog; - line-name = "netgear:ext:lna0"; - gpios = <18 GPIO_ACTIVE_HIGH>; - output-high; - }; - - lna1 { - gpio-hog; - line-name = "netgear:ext:lna1"; - gpios = <19 GPIO_ACTIVE_HIGH>; - output-high; - }; -}; - -&wmac { - status = "okay"; - - mtd-mac-address = <&art 0x0>; - qca,no-eeprom; -}; - -&pcie { - status = "okay"; - - ath9k: wifi@0,0 { - compatible = "pci168c,0033"; - reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0xc>; - qca,no-eeprom; - #gpio-cells = <2>; - gpio-controller; - - usb_power { - gpio-hog; - line-name = "netgear:power:usb"; - gpios = <0 GPIO_ACTIVE_HIGH>; - output-high; - }; - }; -}; - -&usb_phy { - status = "okay"; -}; - -&usb { - status = "okay"; - #address-cells = <1>; - #size-cells = <0>; - - hub_port: port@1 { - reg = <1>; - #trigger-source-cells = <0>; - }; -}; - -&uart { - status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts index 148d017540..ed00cdb585 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /dts-v1/; #include "qca9531_glinet_gl-ar300m.dtsi" @@ -7,6 +9,8 @@ model = "GL.iNet GL-AR300M-Lite"; }; +/delete-node/ &nand_flash; + // "Disable" unpopulated GMAC1 ð1 { diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts index 26c30f2b72..00f9f5c82d 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /dts-v1/; #include "qca9531_glinet_gl-ar300m.dtsi" @@ -7,28 +9,10 @@ model = "GL.iNet GL-AR300M (NAND)"; }; -&spi { - num-cs = <1>; - - flash@1 { - compatible = "spinand,mt29f"; - reg = <1>; - spi-max-frequency = <25000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "kernel"; - reg = <0x000000 0x0200000>; - }; - - partition@1 { - label = "ubi"; - reg = <0x200000 0x7e00000>; - }; - }; - }; +&nand_kernel { + label = "kernel"; +}; + +&nand_ubi { + label = "ubi"; }; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts index 22e5ae4e74..34f48f5f61 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts @@ -6,3 +6,8 @@ compatible = "glinet,gl-ar300m-nor", "qca,qca9531"; model = "GL.iNet GL-AR300M (NOR)"; }; + +&nor_firmware { + compatible = "denx,uimage"; + label = "firmware"; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi index 78961bf71b..72bc2a6466 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi @@ -42,7 +42,7 @@ leds { compatible = "gpio-leds"; - // Colors from non-Lite versions + // Colors for non-Lite versions led_status: status { label = "gl-ar300m:green:status"; @@ -75,10 +75,12 @@ &spi { status = "okay"; - num-cs = <0>; + + num-cs = <2>; + cs-gpios = <0>, <0>; flash@0 { - compatible = "winbond,w25q128", "jedec,spi-nor"; + compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <25000000>; @@ -93,24 +95,45 @@ read-only; }; - partition@1 { + partition@40000 { label = "u-boot-env"; reg = <0x040000 0x010000>; }; - partition@2 { - compatible = "denx,uimage"; - label = "firmware"; + nor_firmware: partition@50000 { + label = "nor_firmware"; reg = <0x050000 0xfa0000>; }; - art: partition@3 { + art: partition@ff0000 { label = "art"; reg = <0xff0000 0x010000>; read-only; }; }; }; + + nand_flash: flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + nand_kernel: partition@0 { + label = "nand_kernel"; + reg = <0x000000 0x400000>; + }; + + nand_ubi: partition@400000 { + label = "nand_ubi"; + reg = <0x400000 0x7c00000>; + }; + }; + }; }; &uart { diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts new file mode 100644 index 0000000000..ad491286ec --- /dev/null +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "qca9531_glinet_gl-ar300m.dtsi" + +/ { + compatible = "glinet,gl-ar300m16", "qca,qca9531"; + model = "GL.iNet GL-AR300M16"; +}; + +/delete-node/ &nand_flash; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c7.dtsi b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi similarity index 100% rename from target/linux/ath79/dts/qca9558_tplink_archer-c7.dtsi rename to target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts index 960d80eee2..261f655756 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "qca9558_tplink_archer-c7.dtsi" +#include "qca9558_tplink_archer-c.dtsi" / { compatible = "tplink,archer-c5-v1", "qca,qca9558"; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts index fda519439a..0988359984 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "qca9558_tplink_archer-c7.dtsi" +#include "qca9558_tplink_archer-c.dtsi" / { compatible = "tplink,archer-c7-v1", "qca,qca9558"; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts index 7cdfa56dfd..7040d9b52b 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "qca9558_tplink_archer-c7.dtsi" +#include "qca9558_tplink_archer-c.dtsi" / { compatible = "tplink,archer-c7-v2", "qca,qca9558"; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts index f32e9ff125..4f6d39e92e 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts @@ -57,7 +57,7 @@ }; }; - ath9k-leds { + ath9k-leds { compatible = "gpio-leds"; wlan5g { diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor-nand.dts b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor-nand.dts new file mode 100644 index 0000000000..92d1fb9ba2 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor-nand.dts @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "qca9563_glinet_gl-ar750s.dtsi" + +/ { + compatible = "glinet,gl-ar750s-nor-nand", "qca,qca9563"; + model = "GL.iNet GL-AR750S (NOR/NAND)"; +}; + +&nor_kernel { + label = "kernel"; +}; + +&nand_ubi { + label = "ubi"; +}; diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts new file mode 100644 index 0000000000..bb33abd630 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "qca9563_glinet_gl-ar750s.dtsi" + +/ { + compatible = "glinet,gl-ar750s-nor", "qca,qca9563"; + model = "GL.iNet GL-AR750S (NOR)"; +}; + +/delete-node/ &nor_kernel; +/delete-node/ &nor_reserved; + +&nor_firmware { + compatible = "denx,uimage"; + label = "firmware"; +}; diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi similarity index 74% rename from target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts rename to target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi index 3f9a091824..8250db55ad 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /dts-v1/; #include @@ -19,6 +20,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; + label-mac-device = ð0; }; keys { @@ -50,13 +52,13 @@ default-state = "keep"; }; - wlan2g { + led_wlan2g: wlan2g { label = "gl-ar750s:green:wlan2g"; gpios = <&gpio 19 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy1tpt"; }; - wlan5g { + led_wlan5g: wlan5g { label = "gl-ar750s:green:wlan5g"; gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy0tpt"; @@ -69,32 +71,20 @@ sda-gpios = <&gpio 5 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; scl-gpios = <&gpio 21 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; }; - - usb_vbus: regulator-usb-vbus { - compatible = "regulator-fixed"; - - regulator-name = "USB_VBUS"; - - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-always-on; - - gpio = <&gpio 7 GPIO_ACTIVE_HIGH>; - enable-active-high; - }; }; &spi { status = "okay"; - num-cs = <0>; + num-cs = <2>; + cs-gpios = <0>, <0>; - flash@0 { + flash_nor: flash@0 { compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <25000000>; - partitions { + nor_partitions: partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; @@ -116,38 +106,55 @@ read-only; }; - partition@60000 { - compatible = "denx,uimage"; - label = "firmware"; + nor_firmware: partition@60000 { + label = "nor_firmware"; reg = <0x060000 0xfa0000>; }; + + nor_kernel: partition_alt@60000 { + label = "nor_kernel"; + reg = <0x060000 0x400000>; + }; + + nor_reserved: parition_alt@460000 { + label = "nor_reserved"; + reg = <0x460000 0xba0000>; + }; + }; + }; + + flash_nand: flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <25000000>; + + nand_partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + nand_ubi: partition@0 { + label = "nand_ubi"; + reg = <0x000000 0x8000000>; + }; }; }; }; -&pcie { +ð0 { status = "okay"; + + phy-handle = <&phy0>; + mtd-mac-address = <&art 0x0>; }; -&uart { - status = "okay"; -}; - -&usb0 { - status = "okay"; - vbus-supply = <&usb_vbus>; -}; - -&usb_phy0 { - status = "okay"; -}; - -&usb1 { - status = "okay"; -}; - -&usb_phy1 { - status = "okay"; +&gpio { + usb_vbus { + gpio-hog; + gpios = <7 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "usb-vbus"; + }; }; &mdio0 { @@ -165,11 +172,28 @@ }; }; -ð0 { +&pcie { status = "okay"; +}; - mtd-mac-address = <&art 0x0>; - phy-handle = <&phy0>; +&uart { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb_phy1 { + status = "okay"; }; &wmac { diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index de2c8e9197..d54e770240 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -94,12 +94,12 @@ glinet,gl-ar150) ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x02" ;; -glinet,gl-ar300m-nor) - ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0" - ;; glinet,gl-ar300m-lite) ucidef_set_led_netdev "lan" "LAN" "gl-ar300m-lite:green:lan" "eth0" ;; +glinet,gl-ar300m16) + ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0" + ;; glinet,gl-x750) ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" ;; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 3a896b55b0..07f3c4e83c 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -144,10 +144,6 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" ;; - glinet,gl-ar750s) - ucidef_add_switch "switch0" \ - "0@eth0" "2:lan:2" "3:lan:1" "1:wan" - ;; iodata,etg3-r|\ iodata,wn-ac1167dgr|\ iodata,wn-ac1600dgr|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index b2ec803a72..f128e8759f 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -46,8 +46,7 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) ;; - glinet,gl-ar750|\ - glinet,gl-ar750s) + glinet,gl-ar750) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1) ;; diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index 727025ba67..19dbe2eb8b 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -64,7 +64,7 @@ endef define Device/ubnt-xm $(Device/ubnt) DEVICE_VARIANT := XM - DEVICE_PACKAGES += kmod-usb-ohci rssileds + DEVICE_PACKAGES += kmod-usb-ohci IMAGE_SIZE := 7448k UBNT_TYPE := XM UBNT_CHIP := ar7240 @@ -106,6 +106,7 @@ TARGET_DEVICES += ubnt_airrouter define Device/ubnt_bullet-m $(Device/ubnt-xm) DEVICE_MODEL := Bullet-M + DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += bullet-m endef TARGET_DEVICES += ubnt_bullet-m @@ -113,6 +114,7 @@ TARGET_DEVICES += ubnt_bullet-m define Device/ubnt_bullet-m-xw $(Device/ubnt-xw) DEVICE_MODEL := Bullet-M + DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += bullet-m-xw endef TARGET_DEVICES += ubnt_bullet-m-xw @@ -129,7 +131,7 @@ TARGET_DEVICES += ubnt_lap-120 define Device/ubnt_nanobeam-ac $(Device/ubnt-wa) DEVICE_MODEL := NanoBeam AC - DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct rssileds IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split endef TARGET_DEVICES += ubnt_nanobeam-ac @@ -137,7 +139,7 @@ TARGET_DEVICES += ubnt_nanobeam-ac define Device/ubnt_nanostation-ac $(Device/ubnt-wa) DEVICE_MODEL := Nanostation AC - DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct rssileds IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split endef TARGET_DEVICES += ubnt_nanostation-ac @@ -153,6 +155,7 @@ TARGET_DEVICES += ubnt_nanostation-ac-loco define Device/ubnt_nanostation-m $(Device/ubnt-xm) DEVICE_MODEL := Nanostation M + DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += nanostation-m endef TARGET_DEVICES += ubnt_nanostation-m @@ -160,6 +163,7 @@ TARGET_DEVICES += ubnt_nanostation-m define Device/ubnt_nanostation-m-xw $(Device/ubnt-xw) DEVICE_MODEL := Nanostation M + DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += nanostation-m-xw endef TARGET_DEVICES += ubnt_nanostation-m-xw @@ -167,6 +171,7 @@ TARGET_DEVICES += ubnt_nanostation-m-xw define Device/ubnt_rocket-m $(Device/ubnt-xm) DEVICE_MODEL := Rocket-M + DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += rocket-m endef TARGET_DEVICES += ubnt_rocket-m diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 70631c20d0..2396219b00 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -562,11 +562,11 @@ define Device/glinet_gl-ar300m-lite endef TARGET_DEVICES += glinet_gl-ar300m-lite -define Device/glinet_gl-ar300m-nor +define Device/glinet_gl-ar300m16 $(Device/glinet_gl-ar300m-common-nor) - DEVICE_MODEL := GL-AR300M + DEVICE_MODEL := GL-AR300M16 endef -TARGET_DEVICES += glinet_gl-ar300m-nor +TARGET_DEVICES += glinet_gl-ar300m16 define Device/glinet_gl-ar750 ATH_SOC := qca9531 @@ -578,16 +578,6 @@ define Device/glinet_gl-ar750 endef TARGET_DEVICES += glinet_gl-ar750 -define Device/glinet_gl-ar750s - ATH_SOC := qca9563 - DEVICE_VENDOR := GL.iNet - DEVICE_MODEL := GL-AR750S - DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca9887-ct block-mount - IMAGE_SIZE := 16000k - SUPPORTED_DEVICES += gl-ar750s -endef -TARGET_DEVICES += glinet_gl-ar750s - define Device/glinet_gl-x750 ATH_SOC := qca9531 DEVICE_VENDOR := GL.iNet @@ -768,7 +758,7 @@ define Device/netgear_wndr3700v2 NETGEAR_BOARD_ID := WNDR3700v2 NETGEAR_HW_ID := 29763654+16+64 IMAGE_SIZE := 15872k - SUPPORTED_DEVICES += wndr3700v2 + SUPPORTED_DEVICES += wndr3700 endef TARGET_DEVICES += netgear_wndr3700v2 @@ -779,7 +769,7 @@ define Device/netgear_wndr3800 NETGEAR_BOARD_ID := WNDR3800 NETGEAR_HW_ID := 29763654+16+128 IMAGE_SIZE := 15872k - SUPPORTED_DEVICES += wndr3800 + SUPPORTED_DEVICES += wndr3700 endef TARGET_DEVICES += netgear_wndr3800 @@ -790,7 +780,7 @@ define Device/netgear_wndr3800ch NETGEAR_BOARD_ID := WNDR3800CH NETGEAR_HW_ID := 29763654+16+128 IMAGE_SIZE := 15872k - SUPPORTED_DEVICES += wndr3800ch + SUPPORTED_DEVICES += wndr3700 endef TARGET_DEVICES += netgear_wndr3800ch diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index ef6b607002..19c2d42142 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -45,22 +45,67 @@ define Device/aerohive_hiveap-121 endef TARGET_DEVICES += aerohive_hiveap-121 -define Device/glinet_gl-ar300m-nand +define Device/glinet_gl-ar300m-common-nand ATH_SOC := qca9531 DEVICE_VENDOR := GL.iNet DEVICE_MODEL := GL-AR300M - DEVICE_VARIANT := NAND - DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage kmod-usb-ledtrig-usbport - KERNEL_SIZE := 2048k - BLOCKSIZE := 128k + DEVICE_PACKAGES := kmod-usb2 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 16000k PAGESIZE := 2048 - VID_HDR_OFFSET := 512 - IMAGES += factory.ubi - IMAGE/sysupgrade.bin := sysupgrade-tar - IMAGE/factory.ubi := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + VID_HDR_OFFSET := 2048 +endef + +define Device/glinet_gl-ar300m-nand + $(Device/glinet_gl-ar300m-common-nand) + DEVICE_VARIANT := NAND + BLOCKSIZE := 128k + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + SUPPORTED_DEVICES += glinet,gl-ar300m-nor endef TARGET_DEVICES += glinet_gl-ar300m-nand +define Device/glinet_gl-ar300m-nor + $(Device/glinet_gl-ar300m-common-nand) + DEVICE_VARIANT := NOR + BLOCKSIZE := 64k + SUPPORTED_DEVICES += glinet,gl-ar300m-nand gl-ar300m +endef +TARGET_DEVICES += glinet_gl-ar300m-nor + +define Device/glinet_gl-ar750s-common + ATH_SOC := qca9563 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-AR750S + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct \ + kmod-usb2 kmod-usb-storage block-mount + KERNEL_SIZE := 4096k + IMAGE_SIZE := 16000k + PAGESIZE := 2048 + VID_HDR_OFFSET := 2048 +endef + +define Device/glinet_gl-ar750s-nor-nand + $(Device/glinet_gl-ar750s-common) + DEVICE_VARIANT := NOR/NAND + BLOCKSIZE := 128k + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + SUPPORTED_DEVICES += glinet,gl-ar750s-nor +endef +TARGET_DEVICES += glinet_gl-ar750s-nor-nand + +define Device/glinet_gl-ar750s-nor + $(Device/glinet_gl-ar750s-common) + DEVICE_VARIANT := NOR + BLOCKSIZE := 64k + SUPPORTED_DEVICES += gl-ar750s glinet,gl-ar750s glinet,gl-ar750s-nor-nand +endef +TARGET_DEVICES += glinet_gl-ar750s-nor + # fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff) define Device/netgear_ath79_nand DEVICE_VENDOR := NETGEAR @@ -80,6 +125,18 @@ define Device/netgear_ath79_nand UBINIZE_OPTS := -E 5 endef +define Device/netgear_wndr3700-v4 + ATH_SOC := ar9344 + DEVICE_MODEL := WNDR3700 + DEVICE_VARIANT := v4 + NETGEAR_KERNEL_MAGIC := 0x33373033 + NETGEAR_BOARD_ID := WNDR3700v4 + NETGEAR_HW_ID := 29763948+128+128 + SUPPORTED_DEVICES += wndr3700v4 + $(Device/netgear_ath79_nand) +endef +TARGET_DEVICES += netgear_wndr3700-v4 + define Device/netgear_wndr4300 ATH_SOC := ar9344 DEVICE_MODEL := WNDR4300 diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds index f851b3d886..49d4005495 100755 --- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds @@ -8,9 +8,11 @@ board=$(board_name) boardname="${board##*,}" case "$board" in -glinet,gl-ar300m-nand) +glinet,gl-ar300m-nand|\ +glinet,gl-ar300m-nor) ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0" ;; +netgear,wndr3700-v4|\ netgear,wndr4300) ucidef_set_led_switch "wan-amber" "WAN (amber)" "netgear:amber:wan" "switch0" "0x20" ;; diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index 9d7a19c2eb..f7e43addc1 100755 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -11,6 +11,12 @@ ath79_setup_interfaces() aerohive,hiveap-121) ucidef_set_interface_lan "eth0" ;; + glinet,gl-ar750s-nor|\ + glinet,gl-ar750s-nor-nand) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:2" "3:lan:1" "1:wan" + ;; + netgear,wndr3700-v4|\ netgear,wndr4300) ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" @@ -30,6 +36,7 @@ ath79_setup_macs() local board="$1" case "$board" in + netgear,wndr3700-v4|\ netgear,wndr4300) wan_mac=$(mtd_get_mac_binary caldata 0x6) ;; diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index ae1d3572a8..25bafe67ac 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -9,6 +9,7 @@ board=$(board_name) case "$FIRMWARE" in "ath9k-eeprom-ahb-18100000.wmac.bin") case $board in + netgear,wndr3700-v4|\ netgear,wndr4300) caldata_extract "caldata" 0x1000 0x440 ;; @@ -23,6 +24,7 @@ case "$FIRMWARE" in ;; "ath9k-eeprom-pci-0000:00:00.0.bin") case $board in + netgear,wndr3700-v4|\ netgear,wndr4300) caldata_extract "caldata" 0x5000 0x440 ;; diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 433d6475dd..9305f061fe 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -9,6 +9,11 @@ board=$(board_name) case "$FIRMWARE" in "ath10k/cal-pci-0000:00:00.0.bin") case $board in + glinet,gl-ar750s-nor|\ + glinet,gl-ar750s-nor-nand) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1) + ;; zyxel,nbg6716) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1) diff --git a/target/linux/ath79/nand/base-files/etc/init.d/bootcount b/target/linux/ath79/nand/base-files/etc/init.d/bootcount new file mode 100755 index 0000000000..c82386b55f --- /dev/null +++ b/target/linux/ath79/nand/base-files/etc/init.d/bootcount @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common + +# SPDX-License-Identifier: GPL-2.0 + +START=99 + +boot() { + case $(board_name) in + glinet,gl-ar300m-nand) + fw_setenv bootcount 0 + ;; + esac +} diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/glinet.sh b/target/linux/ath79/nand/base-files/lib/upgrade/glinet.sh new file mode 100644 index 0000000000..86729f8f2a --- /dev/null +++ b/target/linux/ath79/nand/base-files/lib/upgrade/glinet.sh @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2019 Jeff Kletsky +# + +glinet_using_boot_dev_switch() { + if [ "$(fw_printenv -n boot_dev 2>/dev/null)" = "on" ] ; then + >&2 echo "NOTE: boot_dev=on; use switch to control boot partition" + true + else + false + fi +} + +glinet_set_next_boot_nand() { + mkdir -p /var/lock + ! glinet_using_boot_dev_switch && \ + fw_setenv bootcount 0 && \ + >&2 echo "Next boot set for NAND" +} + +glinet_set_next_boot_nor() { + mkdir -p /var/lock + ! glinet_using_boot_dev_switch && \ + fw_setenv bootcount 3 && \ + >&2 echo "Next boot set for NOR" +} + +glinet_nand_nor_do_upgrade() { + set_next_boot_nand() { glinet_set_next_boot_nand; } + set_next_boot_nor() { glinet_set_next_boot_nor; } + nand_nor_do_upgrade "$1" +} + +nand_nor_do_upgrade() { + local upgrade_file="$1" + + local pn + local found="" + local err + + case "$(get_magic_long "$upgrade_file")" in + + "27051956") # U-Boot Image Magic + + for pn in "nor_${PART_NAME}" "$PART_NAME" ; do # firmware + if [ "$(find_mtd_index "$pn")" ] ; then + PART_NAME="$pn" + found="yes" + break + fi + done + if [ "$found" = "yes" ] ; then + >&2 echo "Running NOR upgrade" + default_do_upgrade "$upgrade_file" + # At this time, default_do_upgrade() exits on error + type set_next_boot_nor >/dev/null && set_next_boot_nor + else + >&2 echo "ERROR: UPGRADE FAILED: Unable to locate '$PART_NAME' or 'nor_${PART_NAME}'" + exit 1 + fi + ;; + + *) # otherwise a file that nand_do_upgrade can process + + for pn in "nand_${CI_KERNPART}" "$CI_KERNPART" ; do # kernel + if [ "$(find_mtd_index "$pn")" ] ; then + CI_KERNPART="$pn" + break + fi + done + for pn in "nand_${CI_UBIPART}" "$CI_UBIPART" ; do # ubi + if [ "$(find_mtd_index "$pn")" ] ; then + CI_UBIPART="$pn" + break + fi + done + for pn in "nand_${CI_ROOTPART}" "$CI_ROOTPART" ; do #rootfs + if [ "$(find_mtd_index "$pn")" ] ; then + CI_ROOTPART="$pn" + break + fi + done + >&2 echo "Running NAND upgrade" + # TODO: change order when NAND upgrade offers return + type set_next_boot_nand >/dev/null && set_next_boot_nand + nand_do_upgrade "$upgrade_file" + ;; + esac +} diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh index 3956d5d73f..15d88a361e 100644 --- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh @@ -1,20 +1,26 @@ -# # Copyright (C) 2011 OpenWrt.org -# PART_NAME=firmware -REQUIRE_IMAGE_METADATA=1 +REQUIRE_IMAGE_METADATA=1 platform_check_image() { return 0 } +RAMFS_COPY_BIN='fw_printenv fw_setenv' +RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' + platform_do_upgrade() { local board=$(board_name) case "$board" in - glinet,gl-ar300m-nand) - default_do_upgrade "$1" + glinet,gl-ar300m-nand|\ + glinet,gl-ar300m-nor) + glinet_nand_nor_do_upgrade "$1" + ;; + glinet,gl-ar750s-nor|\ + glinet,gl-ar750s-nor-nand) + nand_nor_do_upgrade "$1" ;; *) nand_do_upgrade "$1" diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default index 84e6748a20..4742ad52d0 100644 --- a/target/linux/ath79/nand/config-default +++ b/target/linux/ath79/nand/config-default @@ -1,18 +1,17 @@ -CONFIG_AT803X_PHY=y -CONFIG_BCH=y CONFIG_MTD_NAND=y CONFIG_MTD_NAND_AR934X=y -CONFIG_MTD_NAND_BCH=y +CONFIG_MTD_NAND_CORE=y CONFIG_MTD_NAND_ECC=y -CONFIG_MTD_NAND_ECC_BCH=y -CONFIG_MTD_SPINAND_MT29F=y -CONFIG_MTD_SPINAND_ONDIEECC=y +CONFIG_MTD_SPI_NAND=y CONFIG_MTD_UBI=y -CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_LIMIT=20 # CONFIG_MTD_UBI_FASTMAP is not set # CONFIG_MTD_UBI_GLUEBI is not set -CONFIG_MTD_UBI_WL_THRESHOLD=4096 +# CONFIG_PCI_AR71XX is not set +# CONFIG_PHY_AR7100_USB is not set +CONFIG_PHY_AR7200_USB=y CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y diff --git a/target/linux/ath79/nand/target.mk b/target/linux/ath79/nand/target.mk index 91afe675c5..c565c9b2b8 100644 --- a/target/linux/ath79/nand/target.mk +++ b/target/linux/ath79/nand/target.mk @@ -1,9 +1,10 @@ BOARDNAME := Generic devices with NAND flash -FEATURES += squashfs nand rtc + +FEATURES += squashfs nand DEFAULT_PACKAGES += wpad-basic define Target/Description - Build firmware for Atheros AR71xx/AR913x based boards with - NAND flash, e.g. Netgear WNDR4300. + Firmware for boards using Qualcomm Atheros, MIPS-based SoCs + in the ar72xx and subsequent series, with support for NAND flash endef diff --git a/target/linux/mediatek/mt7629/config-4.19 b/target/linux/mediatek/mt7629/config-4.19 index e43f758cdf..f32d9d1919 100644 --- a/target/linux/mediatek/mt7629/config-4.19 +++ b/target/linux/mediatek/mt7629/config-4.19 @@ -232,8 +232,10 @@ CONFIG_MODULES_USE_ELF_REL=y CONFIG_MT753X_GSW=y CONFIG_MTD_MT81xx_NOR=y CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_CORE=y CONFIG_MTD_NAND_ECC=y CONFIG_MTD_NAND_MTK=y ++CONFIG_MTD_SPI_NAND=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_FIT_FW=y @@ -330,6 +332,11 @@ CONFIG_SGL_ALLOC=y CONFIG_SG_POOL=y CONFIG_SMP=y CONFIG_SMP_ON_UP=y +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +# CONFIG_SPI_MT65XX is not set +CONFIG_SPI_MTK_SNFI=y CONFIG_SPARSE_IRQ=y CONFIG_SRCU=y CONFIG_STACKTRACE=y diff --git a/target/linux/mediatek/patches-4.19/0307-spi-mem-Mediatek-Add-SPI-Nand-support-for-MT7629.patch b/target/linux/mediatek/patches-4.19/0307-spi-mem-Mediatek-Add-SPI-Nand-support-for-MT7629.patch new file mode 100644 index 0000000000..72e56945d9 --- /dev/null +++ b/target/linux/mediatek/patches-4.19/0307-spi-mem-Mediatek-Add-SPI-Nand-support-for-MT7629.patch @@ -0,0 +1,187 @@ +From c813fbe806257c574240770ef716fbee19f7dbfa Mon Sep 17 00:00:00 2001 +From: Xiangsheng Hou +Date: Thu, 6 Jun 2019 16:29:04 +0800 +Subject: [PATCH] spi: spi-mem: Mediatek: Add SPI Nand support for MT7629 + +Signed-off-by: Xiangsheng Hou +--- + arch/arm/boot/dts/mt7629-rfb.dts | 45 ++++++++++++++++++++++++++++++++ + arch/arm/boot/dts/mt7629-lynx-rfb.dts | 45 ++++++++++++++++++++++++++++++++ + arch/arm/boot/dts/mt7629.dtsi | 22 ++++++++++++++++ + drivers/spi/spi-mtk-snfi.c | 12 +++++++++ + 3 files changed, 79 insertions(+) + +diff --git a/arch/arm/boot/dts/mt7629-rfb.dts b/arch/arm/boot/dts/mt7629-rfb.dts +index 8043238fe..ef140623e 100755 +--- a/arch/arm/boot/dts/mt7629-rfb.dts ++++ b/arch/arm/boot/dts/mt7629-rfb.dts +@@ -258,6 +258,51 @@ + }; + }; + ++&bch { ++ status = "okay"; ++}; ++ ++&snfi { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&serial_nand_pins>; ++ status = "okay"; ++ ++ spi_nand@0 { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ compatible = "spi-nand"; ++ spi-max-frequency = <104000000>; ++ reg = <0>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "Bootloader"; ++ reg = <0x00000 0x0100000>; ++ read-only; ++ }; ++ ++ partition@100000 { ++ label = "Config"; ++ reg = <0x100000 0x0040000>; ++ }; ++ ++ partition@140000 { ++ label = "factory"; ++ reg = <0x140000 0x0080000>; ++ }; ++ ++ partition@1c0000 { ++ label = "firmware"; ++ reg = <0x1c0000 0x1000000>; ++ }; ++ }; ++ }; ++}; ++ + &spi { + pinctrl-names = "default"; + pinctrl-0 = <&spi_pins>; +diff --git a/arch/arm/boot/dts/mt7629.dtsi b/arch/arm/boot/dts/mt7629.dtsi +index 53f47796b..c7bd5fc9b 100755 +--- a/arch/arm/boot/dts/mt7629.dtsi ++++ b/arch/arm/boot/dts/mt7629.dtsi +@@ -259,6 +259,28 @@ + status = "disabled"; + }; + ++ bch: ecc@1100e000 { ++ compatible = "mediatek,mt7622-ecc"; ++ reg = <0x1100e000 0x1000>; ++ interrupts = ; ++ clocks = <&pericfg CLK_PERI_NFIECC_PD>; ++ clock-names = "nfiecc_clk"; ++ status = "disabled"; ++ }; ++ ++ snfi: spi@1100d000 { ++ compatible = "mediatek,mt7629-snfi"; ++ reg = <0x1100d000 0x1000>; ++ interrupts = ; ++ clocks = <&pericfg CLK_PERI_NFI_PD>, ++ <&pericfg CLK_PERI_SNFI_PD>; ++ clock-names = "nfi_clk", "spi_clk"; ++ ecc-engine = <&bch>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "disabled"; ++ }; ++ + spi: spi@1100a000 { + compatible = "mediatek,mt7629-spi", + "mediatek,mt7622-spi"; +diff --git a/drivers/spi/spi-mtk-snfi.c b/drivers/spi/spi-mtk-snfi.c +index cd600d9fb..113f541e6 100644 +--- a/drivers/spi/spi-mtk-snfi.c ++++ b/drivers/spi/spi-mtk-snfi.c +@@ -1029,8 +1029,20 @@ static const struct mtk_snfi_caps snfi_mt7622 = { + .bad_mark_swap = 0, + }; + ++static const struct mtk_snfi_caps snfi_mt7629 = { ++ .spare_size = spare_size_mt7622, ++ .num_spare_size = 4, ++ .nand_sec_size = 512, ++ .nand_fdm_size = 8, ++ .nand_fdm_ecc_size = 1, ++ .ecc_parity_bits = 13, ++ .pageformat_spare_shift = 4, ++ .bad_mark_swap = 1, ++}; ++ + static const struct of_device_id mtk_snfi_id_table[] = { + { .compatible = "mediatek,mt7622-snfi", .data = &snfi_mt7622, }, ++ { .compatible = "mediatek,mt7629-snfi", .data = &snfi_mt7629, }, + { /* sentinel */ } + }; + +-- +2.21.0 + +diff --git a/arch/arm/boot/dts/mt7629-lynx-rfb.dts b/arch/arm/boot/dts/mt7629-lynx-rfb.dts +index f3fadd3..895d6c4 100755 +--- a/arch/arm/boot/dts/mt7629-lynx-rfb.dts ++++ b/arch/arm/boot/dts/mt7629-lynx-rfb.dts +@@ -278,6 +278,52 @@ + }; + }; + ++&bch { ++ status = "okay"; ++}; ++ ++&snfi { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&serial_nand_pins>; ++ status = "okay"; ++ ++ spi_nand@0 { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ compatible = "spi-nand"; ++ spi-max-frequency = <104000000>; ++ reg = <0>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "Bootloader"; ++ reg = <0x00000 0x0100000>; ++ read-only; ++ }; ++ ++ partition@100000 { ++ label = "Config"; ++ reg = <0x100000 0x0040000>; ++ }; ++ ++ partition@140000 { ++ label = "factory"; ++ reg = <0x140000 0x0080000>; ++ }; ++ ++ partition@1c0000 { ++ label = "firmware"; ++ reg = <0x1c0000 0x1000000>; ++ }; ++ ++ }; ++ }; ++}; ++ + &spi { + pinctrl-names = "default"; + pinctrl-0 = <&spi_pins>;