diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 22e2286b8d..e22fcf6382 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -35,6 +35,10 @@ config KERNEL_SWAP bool "Support for paging of anonymous memory (swap)" default y if !SMALL_FLASH +config KERNEL_PROC_STRIPPED + bool "Strip non-essential /proc functionality to reduce code size" + default y if SMALL_FLASH + config KERNEL_DEBUG_FS bool "Compile the kernel with debug filesystem enabled" default y @@ -373,6 +377,11 @@ config KERNEL_AIO bool "Compile the kernel with asynchronous IO support" default y if !SMALL_FLASH +config KERNEL_IO_URING + bool "Compile the kernel with io_uring support" + default y if !SMALL_FLASH + depends on LINUX_5_4 + config KERNEL_FHANDLE bool "Compile the kernel with support for fhandle syscalls" default y if !SMALL_FLASH diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 89bae2e8b3..3dd2496cb8 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .83 +LINUX_VERSION-5.4 = .85 -LINUX_KERNEL_HASH-5.4.83 = beec970bbb93de8ab839f27930f7ab00c7bd65af0ffa07a50e765affdc2561c6 +LINUX_KERNEL_HASH-5.4.85 = 1de3586d8e7a9a814726610745d80907a267590d2770ec1079ef2875c4984008 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index fb1267ea5b..47d4e73b42 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:=241 +PKG_RELEASE:=242 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ @@ -202,6 +202,9 @@ define Package/base-files/install $(VERSION_SED_SCRIPT) $(1)/etc/opkg/distfeeds.conf) $(if $(CONFIG_IPK_FILES_CHECKSUMS),, \ rm -f $(1)/sbin/pkg_check) + + $(if $(CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE), \ + rm -f $(1)/etc/banner.failsafe,) endef ifneq ($(DUMP),1) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index a5c27dc2fb..b44a5998f4 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -297,6 +297,7 @@ indicate_upgrade() { # $(2): (optional) pipe command to extract firmware, e.g. dd bs=n skip=m default_do_upgrade() { sync + echo 3 > /proc/sys/vm/drop_caches if [ -n "$UPGRADE_BACKUP" ]; then get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$UPGRADE_BACKUP" write - "${PART_NAME:-image}" else diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 index c7629c383f..23d356a447 100755 --- a/package/base-files/files/lib/upgrade/stage2 +++ b/package/base-files/files/lib/upgrade/stage2 @@ -123,6 +123,7 @@ kill_remaining KILL 1 sleep 1 +echo 3 > /proc/sys/vm/drop_caches if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then platform_pre_upgrade "$IMAGE" diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 259c52c770..1eaaa06f0e 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -24,9 +24,15 @@ arduino,yun|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ engenius,eap300-v2|\ +engenius,eap350-v1|\ +engenius,eap600|\ +engenius,ecb1200|\ engenius,ecb1750|\ +engenius,ecb350-v1|\ +engenius,ecb600|\ engenius,enh202-v1|\ engenius,ens202ext-v1|\ +engenius,enstationac-v1|\ etactica,eg200|\ glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand|\ @@ -79,6 +85,10 @@ netgear,wndr4300tn|\ netgear,wndr4300sw) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000" ;; +plasmacloud,pa300|\ +plasmacloud,pa300e) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" + ;; qihoo,c301) ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" ;; diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx index 27aab6b286..8a0de7a548 100644 --- a/package/boot/uboot-envtools/files/ipq40xx +++ b/package/boot/uboot-envtools/files/ipq40xx @@ -32,11 +32,15 @@ ubootenv_mtdinfo () { case "$board" in alfa-network,ap120c-ac |\ +devolo,magic-2-wifi-next |\ edgecore,ecw5211 |\ +glinet,gl-ap1300 |\ glinet,gl-b1300 |\ luma,wrtq-329acn |\ openmesh,a42 |\ -openmesh,a62) +openmesh,a62 |\ +plasmacloud,pa1200 |\ +plasmacloud,pa2200) ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000" ;; buffalo,wtr-m2133hp) diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 4319832e11..0568f1fa69 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -17,7 +17,8 @@ alfa-network,ac1200rm|\ alfa-network,awusfree1|\ alfa-network,quad-e4g|\ alfa-network,r36m-e4g|\ -alfa-network,tube-e4g) +alfa-network,tube-e4g|\ +engenius,esr600h) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000" ;; allnet,all0256n-4m|\ diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index e1493bf0e8..1ed1743e21 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -59,6 +59,11 @@ define U-Boot/l-50 BUILD_DEVICES:=checkpoint_l-50 endef +define U-Boot/nas220 + NAME:=Seagate Blackarmor NAS220 + BUILD_DEVICES:=seagate_blackarmor-nas220 +endef + define U-Boot/nsa310 NAME:=Zyxel NSA310 BUILD_DEVICES:=zyxel_nsa310b @@ -95,6 +100,7 @@ UBOOT_TARGETS := \ ib62x0 ib62x0_second_stage \ iconnect iconnect_second_stage \ l-50 \ + nas220 \ nsa310 \ nsa310s \ nsa325 \ diff --git a/package/boot/uboot-kirkwood/patches/201-blackarmor-nas220.patch b/package/boot/uboot-kirkwood/patches/201-blackarmor-nas220.patch new file mode 100644 index 0000000000..50de4e7b82 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/201-blackarmor-nas220.patch @@ -0,0 +1,29 @@ +--- a/include/configs/nas220.h ++++ b/include/configs/nas220.h +@@ -54,17 +54,22 @@ + /* + * Default environment variables + */ +-#define CONFIG_BOOTCOMMAND "" ++#define CONFIG_BOOTCOMMAND \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" + + #define CONFIG_EXTRA_ENV_SETTINGS \ + "bootargs=console=ttyS0,115200\0" \ + "mtdparts=mtdparts=orion_nand:0xa0000@0x0(uboot),"\ + "0x010000@0xa0000(env),"\ +- "0x500000@0xc0000(uimage),"\ +- "0x1a40000@0x5c0000(rootfs)\0" \ ++ "0x1e80000@0xc0000(ubi)\0"\ + "mtdids=nand0=orion_nand\0"\ + "autostart=no\0"\ +- "autoload=no\0" ++ "autoload=no\0"\ ++ "ipaddr=10.4.50.165\0"\ ++ "serverip=10.4.50.5\0"\ ++ "bootdelay=3" + + /* + * Ethernet Driver configuration diff --git a/package/boot/uboot-tegra/Makefile b/package/boot/uboot-tegra/Makefile index 778019257d..a3d66900db 100644 --- a/package/boot/uboot-tegra/Makefile +++ b/package/boot/uboot-tegra/Makefile @@ -6,10 +6,10 @@ # include $(TOPDIR)/rules.mk -PKG_VERSION := 2019.04 +PKG_VERSION := 2020.04 PKG_RELEASE := 1 -PKG_HASH := 76b7772d156b3ddd7644c8a1736081e55b78828537ff714065d21dbade229bef +PKG_HASH := fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372 PKG_MAINTAINER := Tomasz Maciej Nowak diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index 9f7a0724f4..23f1ea9c25 100644 --- a/package/devel/binutils/Makefile +++ b/package/devel/binutils/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=binutils -PKG_VERSION:=2.34 +PKG_VERSION:=2.35.1 PKG_RELEASE:=1 PKG_SOURCE_URL:=@GNU/binutils PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_VERSION:=$(PKG_VERSION) -PKG_HASH:=f00b0e8803dc9bab1e2165bd568528135be734df3fabf8d0161828cd56028952 +PKG_HASH:=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607 PKG_FIXUP:=autoreconf PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 8d518e8849..6176cb2972 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -30,6 +30,7 @@ ALLWIFIBOARDS:= \ avm_fritzrepeater-1200 \ buffalo_wtr-m2133hp \ cellc_rtl30vw \ + devolo_magic-2-wifi-next \ dlink_dap2610 \ edgecore_ecw5410 \ edgecore_oap100 \ @@ -37,12 +38,16 @@ ALLWIFIBOARDS:= \ engenius_emd1 \ engenius_emr3500 \ ezviz_cs-w3-wd1200g-eup \ + glinet_gl-ap1300 \ glinet_gl-s1300 \ linksys_ea8300 \ linksys_mr8300-v0 \ luma_wrtq-329acn \ mobipromo_cm520-79f \ p2w_r619ac \ + nec_wg2600hp3 \ + plasmacloud_pa1200 \ + plasmacloud_pa2200 \ qxwlan_e2600ac ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD)) @@ -109,6 +114,7 @@ $(eval $(call generate-ipq-wifi-package,aruba_ap-303,Aruba AP-303)) $(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-1200,AVM FRITZRepeater 1200)) $(eval $(call generate-ipq-wifi-package,buffalo_wtr-m2133hp,Buffalo WTR-M2133HP)) $(eval $(call generate-ipq-wifi-package,cellc_rtl30vw, Cell C RTL30VW)) +$(eval $(call generate-ipq-wifi-package,devolo_magic-2-wifi-next,devolo Magic 2 WiFi next)) $(eval $(call generate-ipq-wifi-package,dlink_dap2610,D-Link DAP-2610)) $(eval $(call generate-ipq-wifi-package,edgecore_ecw5410,Edgecore ECW5410)) $(eval $(call generate-ipq-wifi-package,edgecore_oap100,Edgecore OAP100)) @@ -116,12 +122,16 @@ $(eval $(call generate-ipq-wifi-package,engenius_eap2200,EnGenius EAP2200)) $(eval $(call generate-ipq-wifi-package,engenius_emd1,EnGenius EMD1)) $(eval $(call generate-ipq-wifi-package,engenius_emr3500,EnGenius EMR3500)) $(eval $(call generate-ipq-wifi-package,ezviz_cs-w3-wd1200g-eup,EZVIZ CS-W3-WD1200G EUP)) +$(eval $(call generate-ipq-wifi-package,glinet_gl-ap1300,GL.iNet GL-AP1300)) $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300)) $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) $(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300)) $(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN)) $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F)) $(eval $(call generate-ipq-wifi-package,p2w_r619ac,P&W R619AC)) +$(eval $(call generate-ipq-wifi-package,nec_wg2600hp3,NEC Platforms WG2600HP3)) +$(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200)) +$(eval $(call generate-ipq-wifi-package,plasmacloud_pa2200,Plasma Cloud PA2200)) $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC)) $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE)))) diff --git a/package/firmware/ipq-wifi/board-devolo_magic-2-wifi-next.qca4019 b/package/firmware/ipq-wifi/board-devolo_magic-2-wifi-next.qca4019 new file mode 100644 index 0000000000..cf86721fea Binary files /dev/null and b/package/firmware/ipq-wifi/board-devolo_magic-2-wifi-next.qca4019 differ diff --git a/package/firmware/ipq-wifi/board-glinet_gl-ap1300.qca4019 b/package/firmware/ipq-wifi/board-glinet_gl-ap1300.qca4019 new file mode 100644 index 0000000000..481dd81b5b Binary files /dev/null and b/package/firmware/ipq-wifi/board-glinet_gl-ap1300.qca4019 differ diff --git a/package/firmware/ipq-wifi/board-nec_wg2600hp3.qca9984 b/package/firmware/ipq-wifi/board-nec_wg2600hp3.qca9984 new file mode 100644 index 0000000000..f95ccd251e Binary files /dev/null and b/package/firmware/ipq-wifi/board-nec_wg2600hp3.qca9984 differ diff --git a/package/firmware/ipq-wifi/board-plasmacloud_pa1200.qca4019 b/package/firmware/ipq-wifi/board-plasmacloud_pa1200.qca4019 new file mode 100644 index 0000000000..99d6df8c8c Binary files /dev/null and b/package/firmware/ipq-wifi/board-plasmacloud_pa1200.qca4019 differ diff --git a/package/firmware/ipq-wifi/board-plasmacloud_pa2200.qca4019 b/package/firmware/ipq-wifi/board-plasmacloud_pa2200.qca4019 new file mode 100644 index 0000000000..d1db0f5f4b Binary files /dev/null and b/package/firmware/ipq-wifi/board-plasmacloud_pa2200.qca4019 differ diff --git a/package/firmware/ipq-wifi/board-plasmacloud_pa2200.qca9888 b/package/firmware/ipq-wifi/board-plasmacloud_pa2200.qca9888 new file mode 100644 index 0000000000..6c3f083eb2 Binary files /dev/null and b/package/firmware/ipq-wifi/board-plasmacloud_pa2200.qca9888 differ diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index e38c7e0b10..b02c6389e7 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-ct -PKG_RELEASE=2 +PKG_RELEASE=3 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= @@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk define KernelPackage/ath10k-ct SUBMENU:=Wireless Drivers TITLE:=ath10k-ct driver optimized for CT ath10k firmware - DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT @PCI_SUPPORT +kmod-hwmon-core + DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +kmod-hwmon-core FILES:=\ $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \ $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index 18976a7941..d43542b17e 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -90,19 +90,22 @@ define KernelPackage/fs-cifs KCONFIG:= \ CONFIG_CIFS \ CONFIG_CIFS_DFS_UPCALL=n \ - CONFIG_CIFS_UPCALL=n \ - CONFIG_CIFS_SMB311=n + CONFIG_CIFS_UPCALL=n FILES:=$(LINUX_DIR)/fs/cifs/cifs.ko AUTOLOAD:=$(call AutoLoad,30,cifs) $(call AddDepends/nls) DEPENDS+= \ - +kmod-crypto-arc4 \ - +kmod-crypto-hmac \ - +kmod-crypto-md5 \ +kmod-crypto-md4 \ - +kmod-crypto-des \ + +kmod-crypto-md5 \ + +kmod-crypto-sha256 \ + +kmod-crypto-sha512 \ + +kmod-crypto-cmac \ + +kmod-crypto-hmac \ + +kmod-crypto-arc4 \ + +kmod-crypto-aead \ + +kmod-crypto-ccm \ +kmod-crypto-ecb \ - +kmod-crypto-sha256 + +kmod-crypto-des endef define KernelPackage/fs-cifs/description diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 396b9c4bb8..e2e5b59825 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 PKG_VERSION:=5.8.18-1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.8.18/ PKG_HASH:=f04a8172423c6a945fc7d9844b04f33fda9ae574e552f8f18ee3bdfcfb494563 @@ -265,7 +265,7 @@ endef define KernelPackage/mac80211-hwsim $(call KernelPackage/mac80211/Default) TITLE:=mac80211 HW simulation device - DEPENDS+= +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS+= +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) endef @@ -274,7 +274,7 @@ endef define KernelPackage/mt7601u $(call KernelPackage/mac80211/Default) TITLE:=MT7601U-based USB dongles Wireless Driver - DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT @USB_SUPPORT +kmod-usb-core +mt7601u-firmware + DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core +mt7601u-firmware FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko AUTOLOAD:=$(call AutoProbe,mt7601u) endef @@ -290,7 +290,7 @@ endef define KernelPackage/p54-common $(call KernelPackage/p54/Default) - DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +kmod-lib-crc-ccitt +@DRIVER_11W_SUPPORT + DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +kmod-lib-crc-ccitt TITLE+= (COMMON) FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54common.ko endef @@ -388,7 +388,7 @@ $(eval $(call Download,zd1211rw)) define KernelPackage/zd1211rw $(call KernelPackage/mac80211/Default) TITLE:=Zydas ZD1211 support - DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211 +@DRIVER_11W_SUPPORT + DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zydas/zd1211rw/zd1211rw.ko AUTOLOAD:=$(call AutoProbe,zd1211rw) endef diff --git a/package/kernel/mac80211/ath.mk b/package/kernel/mac80211/ath.mk index e522b566b9..23e24ce2a5 100644 --- a/package/kernel/mac80211/ath.mk +++ b/package/kernel/mac80211/ath.mk @@ -134,7 +134,7 @@ define KernelPackage/ath5k $(call KernelPackage/mac80211/Default) TITLE:=Atheros 5xxx wireless cards support URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k - DEPENDS+= @(PCI_SUPPORT||TARGET_ath25) +kmod-ath +@DRIVER_11W_SUPPORT + DEPENDS+= @(PCI_SUPPORT||TARGET_ath25) +kmod-ath FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko AUTOLOAD:=$(call AutoProbe,ath5k) endef @@ -186,7 +186,7 @@ define KernelPackage/ath9k-common TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc) URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k HIDDEN:=1 - DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ath79 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ath79 +kmod-ath +@DRIVER_11N_SUPPORT FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko @@ -250,7 +250,7 @@ define KernelPackage/ath10k $(call KernelPackage/mac80211/Default) TITLE:=Atheros 802.11ac wireless cards support URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath10k - DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT \ + DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT \ +ATH10K_THERMAL:kmod-hwmon-core +ATH10K_THERMAL:kmod-thermal FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \ @@ -281,7 +281,7 @@ endef define KernelPackage/carl9170 $(call KernelPackage/mac80211/Default) TITLE:=Driver for Atheros AR9170 USB sticks - DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT +carl9170-firmware + DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core +@DRIVER_11N_SUPPORT +carl9170-firmware FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko AUTOLOAD:=$(call AutoProbe,carl9170) endef diff --git a/package/kernel/mac80211/broadcom.mk b/package/kernel/mac80211/broadcom.mk index 59d0bcc8e2..d951390ada 100644 --- a/package/kernel/mac80211/broadcom.mk +++ b/package/kernel/mac80211/broadcom.mk @@ -105,7 +105,7 @@ define KernelPackage/b43 CONFIG_HW_RANDOM=y # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb DEPENDS += \ - @PCI_SUPPORT +@DRIVER_11W_SUPPORT +kmod-mac80211 +kmod-lib-cordic \ + @PCI_SUPPORT +kmod-mac80211 +kmod-lib-cordic \ $(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \ $(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma) FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43/b43.ko @@ -347,7 +347,7 @@ define KernelPackage/b43legacy URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 KCONFIG:= \ CONFIG_HW_RANDOM=y - DEPENDS+= +kmod-mac80211 +!(TARGET_bcm47xx||TARGET_bcm63xx):kmod-ssb @!TARGET_bcm47xx_mips74k +b43legacy-firmware +@DRIVER_11W_SUPPORT + DEPENDS+= +kmod-mac80211 +!(TARGET_bcm47xx||TARGET_bcm63xx):kmod-ssb @!TARGET_bcm47xx_mips74k +b43legacy-firmware FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43legacy/b43legacy.ko AUTOLOAD:=$(call AutoProbe,b43legacy) MENU:=1 @@ -433,7 +433,7 @@ define KernelPackage/brcmfmac $(call KernelPackage/mac80211/Default) TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211 - DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT \ + DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT \ +kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc @!TARGET_uml \ +BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 3f7896ca88..3cab490708 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -409,7 +409,7 @@ mac80211_generate_mac() { [ "$mask" = "00:00:00:00:00:00" ] && { mask="ff:ff:ff:ff:ff:ff"; - [ "$(wc -l < /sys/class/ieee80211/${phy}/addresses)" -gt 1 ] && { + [ "$(wc -l < /sys/class/ieee80211/${phy}/addresses)" -gt $id ] && { addr="$(mac80211_get_addr "$phy" "$id")" [ -n "$addr" ] && { echo "$addr" @@ -429,7 +429,7 @@ mac80211_generate_mac() { [ "$((0x$mask1))" -gt 0 ] && { b1="0x$1" [ "$id" -gt 0 ] && \ - b1=$(($b1 ^ ((($id - !($b1 & 2)) << 2) | 0x2))) + b1=$(($b1 ^ ((($id - !($b1 & 2)) << 2)) | 0x2)) printf "%02x:%s:%s:%s:%s:%s" $b1 $2 $3 $4 $5 $6 return } diff --git a/package/kernel/mac80211/intel.mk b/package/kernel/mac80211/intel.mk index a8ae4ff7c7..8bab727a41 100644 --- a/package/kernel/mac80211/intel.mk +++ b/package/kernel/mac80211/intel.mk @@ -15,7 +15,7 @@ config-$(call config_package,ipw2200) += IPW2200 define KernelPackage/iwlwifi $(call KernelPackage/mac80211/Default) - DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT TITLE:=Intel AGN Wireless support FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko \ diff --git a/package/kernel/mac80211/ralink.mk b/package/kernel/mac80211/ralink.mk index 6aca170773..7bbdc1c22c 100644 --- a/package/kernel/mac80211/ralink.mk +++ b/package/kernel/mac80211/ralink.mk @@ -90,7 +90,7 @@ endef define KernelPackage/rt2800-lib $(call KernelPackage/rt2x00/Default) - DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt +@DRIVER_11N_SUPPORT HIDDEN:=1 TITLE+= (rt2800 LIB) FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800lib.ko diff --git a/package/kernel/mac80211/realtek.mk b/package/kernel/mac80211/realtek.mk index bcf35e35c4..75cb94d7b6 100644 --- a/package/kernel/mac80211/realtek.mk +++ b/package/kernel/mac80211/realtek.mk @@ -63,7 +63,7 @@ endef define KernelPackage/rtlwifi $(call KernelPackage/mac80211/Default) TITLE:=Realtek common driver part - DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +@DRIVER_11N_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtlwifi.ko HIDDEN:=1 endef @@ -178,7 +178,7 @@ endef define KernelPackage/rtw88 $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822BE/RTL8822CE/RTL8723DE - DEPENDS+= @(PCI_SUPPORT) +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS+= @(PCI_SUPPORT) +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT FILES:=\ $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko \ diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 8e971f2ada..d22cf8d2ce 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mt76 -PKG_RELEASE=3 +PKG_RELEASE=4 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= @@ -39,7 +39,7 @@ define KernelPackage/mt76-default SUBMENU:=Wireless Drivers DEPENDS:= \ +kmod-mac80211 \ - +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT endef define KernelPackage/mt76 diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 79addeda8a..ebd88bb352 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_RELEASE=1 +PKG_RELEASE=2 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= @@ -28,7 +28,7 @@ include $(INCLUDE_DIR)/package.mk define KernelPackage/mwlwifi SUBMENU:=Wireless Drivers TITLE:=Marvell 88W8864/88W8897/88W8964/88W8997 wireless driver - DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT @PCI_SUPPORT @TARGET_mvebu + DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT @TARGET_mvebu FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko AUTOLOAD:=$(call AutoLoad,50,mwlwifi) endef diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index e6868c56f4..f2b25d2c36 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=elfutils -PKG_VERSION:=0.179 +PKG_VERSION:=0.180 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION) -PKG_HASH:=25a545566cbacaa37ae6222e58f1c48ea4570f53ba991886e2f5ce96e22a23a2 +PKG_HASH:=b827b6e35c59d188ba97d7cf148fa8dc6f5c68eb6c5981888dfdbb758c0b569d PKG_MAINTAINER:=Luiz Angelo Daros de Luca PKG_LICENSE:=GPL-3.0-or-later diff --git a/package/libs/elfutils/patches/100-musl-compat.patch b/package/libs/elfutils/patches/100-musl-compat.patch index 374e832d3f..508ff9e946 100644 --- a/package/libs/elfutils/patches/100-musl-compat.patch +++ b/package/libs/elfutils/patches/100-musl-compat.patch @@ -24,7 +24,7 @@ https://sourceware.org/bugzilla/show_bug.cgi?id=21002 #include --- a/libdw/libdw_alloc.c +++ b/libdw/libdw_alloc.c -@@ -147,5 +147,5 @@ __attribute ((noreturn)) attribute_hidde +@@ -152,5 +152,5 @@ __attribute ((noreturn)) attribute_hidde __libdw_oom (void) { while (1) diff --git a/package/libs/elfutils/patches/110-no-cdefs.patch b/package/libs/elfutils/patches/110-no-cdefs.patch index a7216c141e..f95625a913 100644 --- a/package/libs/elfutils/patches/110-no-cdefs.patch +++ b/package/libs/elfutils/patches/110-no-cdefs.patch @@ -39,9 +39,9 @@ Signed-off-by: Rosen Penev /* Standard ELF types. */ -@@ -4007,6 +4007,8 @@ enum - #define R_NDS32_TLS_TPOFF 102 - #define R_NDS32_TLS_DESC 119 +@@ -4103,6 +4103,8 @@ enum + #define R_ARC_TLS_LE_S9 0x4a + #define R_ARC_TLS_LE_32 0x4b -__END_DECLS +#ifdef __cplusplus diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index 1a2cdcdd98..35ceb18c29 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libpcap PKG_VERSION:=1.9.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \ @@ -18,7 +18,6 @@ PKG_HASH:=635237637c5b619bcceba91900666b64d56ecb7be63f298f601ec786ce087094 PKG_MAINTAINER:=Felix Fietkau -CMAKE_INSTALL:=1 PKG_ASLR_PIE_REGULAR:=1 PKG_BUILD_PARALLEL:=1 @@ -71,6 +70,15 @@ CMAKE_OPTIONS += $(if $(CONFIG_PCAP_HAS_NETFILTER) ,,-DPCAP_SUPPORT_NETFILTER=OF CMAKE_OPTIONS += $(if $(CONFIG_IPV6),-DINET6=ON,-DINET6=OFF) +define Build/InstallDev + $(call Build/InstallDev/cmake,$(1)) + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(1)/usr/bin/pcap-config + $(INSTALL_DIR) $(2)/bin + $(LN) ../../usr/bin/pcap-config $(2)/bin/pcap-config +endef + define Package/libpcap/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/ diff --git a/package/libs/nettle/Makefile b/package/libs/nettle/Makefile index b9324e4793..b15ea0fa07 100644 --- a/package/libs/nettle/Makefile +++ b/package/libs/nettle/Makefile @@ -8,17 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nettle -PKG_VERSION:=3.5.1 -PKG_RELEASE:=2 +PKG_VERSION:=3.6 +PKG_RELEASE:=1 PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/nettle -PKG_HASH:=75cca1998761b02e16f2db56da52992aef622bf55a3b45ec538bc2eedadc9419 +PKG_HASH:=d24c0d0f2abffbc8f4f34dcf114b0f131ec3774895f3555922fe2f40f3d5e3f1 -PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING -PKG_BUILD_PARALLEL:=0 +PKG_BUILD_PARALLEL:=1 PKG_CONFIG_DEPENDS := CONFIG_LIBNETTLE_MINI @@ -30,7 +30,7 @@ define Package/libnettle TITLE:=GNU crypto library URL:=http://www.lysator.liu.se/~nisse/nettle/ DEPENDS+= +!LIBNETTLE_MINI:libgmp - ABI_VERSION:=7 + ABI_VERSION:=8 endef define Package/libnettle/config diff --git a/package/libs/pcre/Makefile b/package/libs/pcre/Makefile index bf3f733a5c..37d939da7f 100644 --- a/package/libs/pcre/Makefile +++ b/package/libs/pcre/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pcre PKG_VERSION:=8.44 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/$(PKG_NAME) @@ -87,6 +87,7 @@ MAKE_FLAGS += \ define Build/InstallDev $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pcre-config $(1)/usr/bin/ + $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr/bin/pcre-config $(INSTALL_DIR) $(2)/bin $(LN) $(STAGING_DIR)/usr/bin/pcre-config $(2)/bin diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile index 6853d95997..52a4cda19f 100644 --- a/package/libs/toolchain/Makefile +++ b/package/libs/toolchain/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=toolchain -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-3.0-with-GCC-exception @@ -458,11 +458,6 @@ LIBGCC_A=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a)) LIBGCC_MAP=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map)) LIBGCC_SO=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*)) -define Build/Compile/uClibc - $(CP) \ - $(TOOLCHAIN_DIR)/lib/libuClibc-*.so \ - $(PKG_BUILD_DIR)/ -endef ifneq ($(LIBGCC_SO),) define Build/Compile/libgcc $(CP) $(LIBGCC_SO) $(PKG_BUILD_DIR)/ @@ -535,21 +530,6 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) done endef - define Package/uClibc/install - $(INSTALL_DIR) $(1)/lib - $(CP) \ - $(TOOLCHAIN_DIR)/lib/ld*-uClibc.so.* \ - $(TOOLCHAIN_DIR)/lib/ld*-uClibc-$(LIBC_SO_VERSION).so \ - $(1)/lib/ - $(CP) \ - $(TOOLCHAIN_DIR)/lib/libc.so.* \ - $(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \ - $(1)/lib/ - $(CP) \ - $(PKG_BUILD_DIR)/libuClibc-* \ - $(1)/lib/ - endef - LD_MUSL_NAME = $(notdir $(firstword $(wildcard $(TOOLCHAIN_DIR)/lib/libc.so*))) define Package/musl/install @@ -578,7 +558,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) define Package/libpthread/install $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y) + ifneq ($(CONFIG_USE_MUSL),y) $(CP) \ $(TOOLCHAIN_DIR)/lib/libpthread.so.* \ $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \ @@ -590,11 +570,6 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) $(INSTALL_DIR) $(1)/lib $(CP) \ $(TOOLCHAIN_DIR)/lib/libthread_db.so.* $(1)/lib - ifeq ($(CONFIG_USE_UCLIBC),y) - $(CP) \ - $(TOOLCHAIN_DIR)/lib/libthread_db-$(LIBC_SO_VERSION).so \ - $(1)/lib/ - endif endef define Package/libpthread/install_lib @@ -603,7 +578,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) define Package/librt/install $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y) + ifneq ($(CONFIG_USE_MUSL),y) $(CP) \ $(TOOLCHAIN_DIR)/lib/librt.so.* \ $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \ diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index ed35719aaa..b25ce559b9 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2020-12-13 -PKG_SOURCE_VERSION:=458b1a7e9473c150a40cae5d8be174f4bb03bd39 -PKG_MIRROR_HASH:=424aefb55aedebfcffd540a2c02a42aeb574b7ebb1a6b546ca9965d9280d82e5 +PKG_SOURCE_DATE:=2020-12-14 +PKG_SOURCE_VERSION:=88c6003e2b4fdc0c990045ff140bf19b37ba745a +PKG_MIRROR_HASH:=6b4c98f1dfff65e4e2bc5aee7c7ad9a48ad530a4acac69ee3cd6809974305900 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/hostapd/Config.in b/package/network/services/hostapd/Config.in index 8aa878d207..5c00f3e24e 100644 --- a/package/network/services/hostapd/Config.in +++ b/package/network/services/hostapd/Config.in @@ -79,10 +79,6 @@ config DRIVER_11AX_SUPPORT bool default n -config DRIVER_11W_SUPPORT - bool - default n - config WPA_ENABLE_WEP bool "Enable support for unsecure and obsolete WEP" help diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 61b2a548ef..deb1d565bb 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=18 +PKG_RELEASE:=20 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git @@ -94,10 +94,6 @@ DRIVER_MAKEOPTS= \ CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \ CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \ -ifneq ($(LOCAL_VARIANT),mini) - DRIVER_MAKEOPTS += CONFIG_IEEE80211W=$(CONFIG_DRIVER_11W_SUPPORT) -endif - ifeq ($(SSL_VARIANT),openssl) DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y TARGET_LDFLAGS += -lcrypto -lssl diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 681c47216a..7609432fe3 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -231,7 +231,7 @@ hostapd_common_add_bss_config() { config_add_boolean wds wmm uapsd hidden utf8_ssid config_add_int maxassoc max_inactivity - config_add_boolean disassoc_low_ack isolate short_preamble + config_add_boolean disassoc_low_ack isolate short_preamble skip_inactivity_poll config_add_int \ wep_rekey eap_reauth_period \ @@ -479,7 +479,7 @@ hostapd_set_bss_options() { iapp_interface eapol_version dynamic_vlan ieee80211w nasid \ acct_server acct_secret acct_port acct_interval \ bss_load_update_period chan_util_avg_period sae_require_mfp \ - multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key \ + multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \ airtime_bss_weight airtime_bss_limit airtime_sta_weight set_default isolate 0 @@ -487,12 +487,13 @@ hostapd_set_bss_options() { set_default max_inactivity 0 set_default short_preamble 1 set_default disassoc_low_ack 1 + set_default skip_inactivity_poll 0 set_default hidden 0 set_default wmm 1 set_default uapsd 1 set_default wpa_disable_eapol_key_retries 0 set_default tdls_prohibit 0 - set_default eapol_version 0 + set_default eapol_version $((wpa & 1)) set_default acct_port 1813 set_default bss_load_update_period 60 set_default chan_util_avg_period 600 @@ -519,6 +520,7 @@ hostapd_set_bss_options() { append bss_conf "bss_load_update_period=$bss_load_update_period" "$N" append bss_conf "chan_util_avg_period=$chan_util_avg_period" "$N" append bss_conf "disassoc_low_ack=$disassoc_low_ack" "$N" + append bss_conf "skip_inactivity_poll=$skip_inactivity_poll" "$N" append bss_conf "preamble=$short_preamble" "$N" append bss_conf "wmm_enabled=$wmm" "$N" append bss_conf "ignore_broadcast_ssid=$hidden" "$N" diff --git a/package/network/services/hostapd/files/wpad.init b/package/network/services/hostapd/files/wpad.init index 3198e9801f..8471796774 100644 --- a/package/network/services/hostapd/files/wpad.init +++ b/package/network/services/hostapd/files/wpad.init @@ -11,7 +11,7 @@ start_service() { mkdir -p /var/run/hostapd procd_open_instance hostapd procd_set_param command /usr/sbin/hostapd -s -g /var/run/hostapd/global - procd_set_param respawn + procd_set_param respawn 3600 1 0 procd_close_instance fi @@ -19,7 +19,7 @@ start_service() { mkdir -p /var/run/wpa_supplicant procd_open_instance supplicant procd_set_param command /usr/sbin/wpa_supplicant -n -s -g /var/run/wpa_supplicant/global - procd_set_param respawn + procd_set_param respawn 3600 1 0 procd_close_instance fi } diff --git a/package/network/services/hostapd/src/src/utils/build_features.h b/package/network/services/hostapd/src/src/utils/build_features.h index 7ca65fa391..c7fccad413 100644 --- a/package/network/services/hostapd/src/src/utils/build_features.h +++ b/package/network/services/hostapd/src/src/utils/build_features.h @@ -23,10 +23,8 @@ static inline int has_feature(const char *feat) if (!strcmp(feat, "11r")) return 1; #endif -#ifdef CONFIG_IEEE80211W if (!strcmp(feat, "11w")) return 1; -#endif #ifdef CONFIG_ACS if (!strcmp(feat, "acs")) return 1; diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 1ab68ec33b..66263ba51d 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2020-12-13 -PKG_SOURCE_VERSION:=2cf6232fd170a24b801d71d497947d7aabd12015 -PKG_MIRROR_HASH:=097a6b186bc85cc8ff95a611e23ab50a6d8025988f19e0d48520e12a1020274d +PKG_SOURCE_DATE:=2020-12-24 +PKG_SOURCE_VERSION:=b75bcad7bd5fd03f64011a532b9960d78e4aac22 +PKG_MIRROR_HASH:=f795e0268b6fe09eaf15b5701a236c3a74c11deb8436af6b6ab0a59d251fc3fd PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/tcpdump/Makefile b/package/network/utils/tcpdump/Makefile index 3e4d9d2d73..f333cf98d2 100644 --- a/package/network/utils/tcpdump/Makefile +++ b/package/network/utils/tcpdump/Makefile @@ -9,20 +9,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tcpdump PKG_VERSION:=4.9.3 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \ http://www.tcpdump.org/release/ PKG_HASH:=2cd47cb3d460b6ff75f4a9940f594317ad456cfbf2bd2c8e5151e16559db6410 -PKG_BUILD_PARALLEL:=1 - PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause PKG_CPE_ID:=cpe:/a:tcpdump:tcpdump PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk @@ -47,36 +46,18 @@ endef CONFIGURE_ARGS += \ --without-cap-ng \ - --without-crypto - -ifeq ($(CONFIG_IPV6),y) -CONFIGURE_ARGS += \ - --enable-ipv6 -endif + --without-crypto \ + $(call autoconf_bool,CONFIG_IPV6,ipv6) TARGET_CFLAGS += -ffunction-sections -fdata-sections TARGET_LDFLAGS += -Wl,--gc-sections -CONFIGURE_VARS += \ - BUILD_CC="$(TARGET_CC)" \ - HOSTCC="$(HOSTCC)" \ - td_cv_buggygetaddrinfo="no" \ - ac_cv_linux_vers=$(LINUX_VERSION) \ - ac_cv_header_rpc_rpcent_h=no \ - ac_cv_lib_rpc_main=no \ - ac_cv_path_PCAP_CONFIG="" - -MAKE_FLAGS := - ifeq ($(BUILD_VARIANT),mini) TARGET_CFLAGS += -DTCPDUMP_MINI CONFIGURE_ARGS += --disable-smb MAKE_FLAGS += TCPDUMP_MINI=1 endif -MAKE_FLAGS += \ - CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)" - define Package/tcpdump/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/ diff --git a/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch b/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch deleted file mode 100644 index fdebfcc6d8..0000000000 --- a/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch +++ /dev/null @@ -1,92 +0,0 @@ ---- a/configure -+++ b/configure -@@ -5395,37 +5395,6 @@ $as_echo "Using $pfopen" >&6; } - LIBS="$LIBS $pfopen" - fi - fi -- libpcap=FAIL -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local pcap library" >&5 --$as_echo_n "checking for local pcap library... " >&6; } -- --# Check whether --with-system-libpcap was given. --if test "${with_system_libpcap+set}" = set; then : -- withval=$with_system_libpcap; --fi -- -- if test "x$with_system_libpcap" != xyes ; then -- lastdir=FAIL -- places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ -- egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'` -- places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \ -- egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'` -- for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do -- basedir=`echo $dir | sed -e 's/[ab][0-9]*$//' | \ -- sed -e 's/-PRE-GIT$//' ` -- if test $lastdir = $basedir ; then -- continue; -- fi -- lastdir=$dir -- if test -r $dir/libpcap.a ; then -- libpcap=$dir/libpcap.a -- d=$dir -- fi -- done -- fi -- if test $libpcap = FAIL ; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 --$as_echo "not found" >&6; } - - # - # Look for pcap-config. -@@ -5581,51 +5550,6 @@ if test "x$ac_cv_lib_pcap_main" = xyes; - libpcap="-lpcap" - fi - -- if test $libpcap = FAIL ; then -- as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5 -- fi -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extraneous pcap header directories" >&5 --$as_echo_n "checking for extraneous pcap header directories... " >&6; } -- if test \( ! -r /usr/local/include/pcap.h \) -a \ -- \( ! -r /usr/include/pcap.h \); then -- if test -r /usr/local/include/pcap/pcap.h; then -- d="/usr/local/include/pcap" -- elif test -r /usr/include/pcap/pcap.h; then -- d="/usr/include/pcap" -- fi -- fi -- if test -z "$d" ; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 --$as_echo "not found" >&6; } -- else -- V_INCLS="-I$d $V_INCLS" -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: found -- -I$d added" >&5 --$as_echo "found -- -I$d added" >&6; } -- fi -- fi -- else -- V_PCAPDEP=$libpcap -- places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ -- egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'` -- places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \ -- egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'` -- pcapH=FAIL -- if test -r $d/pcap.h; then -- pcapH=$d -- else -- for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do -- if test -r $dir/pcap.h ; then -- pcapH=$dir -- fi -- done -- fi -- -- if test $pcapH = FAIL ; then -- as_fn_error $? "cannot find pcap.h: see INSTALL" "$LINENO" 5 -- fi -- V_INCLS="-I$pcapH $V_INCLS" -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libpcap" >&5 --$as_echo "$libpcap" >&6; } - # Extract the first word of "pcap-config", so it can be a program name with args. - set dummy pcap-config; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index 4a7288d2e4..ffcb15a369 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -14,9 +14,9 @@ PKG_FLAGS:=essential PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git -PKG_SOURCE_DATE:=2020-12-05 -PKG_SOURCE_VERSION:=efb26a35e4e5446f135307c4ff7df9e9563c23a9 -PKG_MIRROR_HASH:=9294140567f1b122a7229fc80ab1b70e167b478c1a3062e0b64631c189beeda5 +PKG_SOURCE_DATE:=2020-12-24 +PKG_SOURCE_VERSION:=9bbc7eae91edc3dbb020e2a50d51d9a3fbbf31ca +PKG_MIRROR_HASH:=baa32d1b381d0eb2e224f4742974581c6705c13814662442ebd1288a91c2d577 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING diff --git a/scripts/functions.sh b/scripts/functions.sh index 9a7fcde627..ec0618c272 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -5,6 +5,19 @@ get_magic_word() { dd if=$1 bs=4 count=1 2>/dev/null | od -A n -N 4 -t x1 | tr -d ' ' } +get_post_padding_word() { + local rootfs_length="$(stat -c%s "$1")" + [ "$rootfs_length" -ge 4 ] || return + rootfs_length=$((rootfs_length-4)) + + # the JFFS2 end marker must be on a 4K boundary (often 64K or 256K) + local unaligned_bytes=$((rootfs_length%4096)) + [ "$unaligned_bytes" = 0 ] || return + + # skip rootfs data except the potential EOF marker + dd if="$1" bs=1 skip="$rootfs_length" 2>/dev/null | od -A n -N 4 -t x1 | tr -d ' ' +} + get_fs_type() { local magic_word="$(get_magic_word "$1")" @@ -13,7 +26,16 @@ get_fs_type() { echo "ubifs" ;; "68737173") - echo "squashfs" + local post_padding_word="$(get_post_padding_word "$1")" + + case "$post_padding_word" in + "deadc0de") + echo "squashfs-jffs2" + ;; + *) + echo "squashfs" + ;; + esac ;; *) echo "unknown" diff --git a/scripts/mkhash.c b/scripts/mkhash.c index 3292433213..ed3d42d4c3 100644 --- a/scripts/mkhash.c +++ b/scripts/mkhash.c @@ -747,6 +747,7 @@ static int usage(const char *progname) fprintf(stderr, "Usage: %s [options] [...]\n" "Options:\n" " -n Print filename(s)\n" + " -N Suppress trailing newline\n" "\n" "Supported hash types:", progname); @@ -771,7 +772,8 @@ static struct hash_type *get_hash_type(const char *name) } -static int hash_file(struct hash_type *t, const char *filename, bool add_filename) +static int hash_file(struct hash_type *t, const char *filename, bool add_filename, + bool no_newline) { const char *str; @@ -801,9 +803,10 @@ static int hash_file(struct hash_type *t, const char *filename, bool add_filenam } if (add_filename) - printf("%s %s\n", str, filename ? filename : "-"); + printf("%s %s%s", str, filename ? filename : "-", + no_newline ? "" : "\n"); else - printf("%s\n", str); + printf("%s%s", str, no_newline ? "" : "\n"); return 0; } @@ -813,13 +816,16 @@ int main(int argc, char **argv) struct hash_type *t; const char *progname = argv[0]; int i, ch; - bool add_filename = false; + bool add_filename = false, no_newline = false; - while ((ch = getopt(argc, argv, "n")) != -1) { + while ((ch = getopt(argc, argv, "nN")) != -1) { switch (ch) { case 'n': add_filename = true; break; + case 'N': + no_newline = true; + break; default: return usage(progname); } @@ -836,10 +842,10 @@ int main(int argc, char **argv) return usage(progname); if (argc < 2) - return hash_file(t, NULL, add_filename); + return hash_file(t, NULL, add_filename, no_newline); for (i = 0; i < argc - 1; i++) { - int ret = hash_file(t, argv[1 + i], add_filename); + int ret = hash_file(t, argv[1 + i], add_filename, no_newline); if (ret) return ret; } diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh index 4a7094055f..bf7c047c5b 100755 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -7,7 +7,7 @@ # usage() { - echo "Usage: $0 " + echo "Usage: $0 " rm -f $CFG_OUT exit 1 } @@ -20,35 +20,28 @@ KERNEL_PATH=$3 ROOTFS_PATH=$4 case $CE_TYPE in + PA300|\ OM2P) MAX_PART_SIZE=7168 KERNEL_FLASH_ADDR=0x1c0000 - FLASH_BS=262144 - MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1 SIZE_FORMAT="%d" ;; OM5P|OM5PAC|MR600|MR900|MR1750|A60) MAX_PART_SIZE=7808 KERNEL_FLASH_ADDR=0xb0000 - FLASH_BS=65536 - MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1 SIZE_FORMAT="%d" ;; - A42) + A42|PA1200) MAX_PART_SIZE=15616 KERNEL_FLASH_ADDR=0x180000 - FLASH_BS=65536 - MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1024 SIZE_FORMAT="0x%08x" ;; - A62) + A62|PA2200) MAX_PART_SIZE=15552 KERNEL_FLASH_ADDR=0x1a0000 - FLASH_BS=65536 - MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1024 SIZE_FORMAT="0x%08x" ;; @@ -63,16 +56,17 @@ CHECK_BS=65536 KERNEL_SIZE=$(stat -c%s "$KERNEL_PATH") KERNEL_MD5=$(mkhash md5 $KERNEL_PATH) KERNEL_SHA256=$(mkhash sha256 $KERNEL_PATH) -KERNEL_PART_SIZE_KB=$(size=$(($KERNEL_SIZE / $FLASH_BS)); [ $(($size * $FLASH_BS)) -lt $KERNEL_SIZE ] && size=$(($size + 1)); echo $(($size * $FLASH_BS / 1024))) +KERNEL_PART_SIZE_KB=$((KERNEL_SIZE / 1024)) KERNEL_PART_SIZE=$(printf $SIZE_FORMAT $(($KERNEL_PART_SIZE_KB * $SIZE_FACTOR))) ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE_KB * 1024))); printf "0x%x" $addr) ROOTFS_SIZE=$(stat -c%s "$ROOTFS_PATH") -ROOTFS_CHECK_BLOCKS=$((($ROOTFS_SIZE / $CHECK_BS) - $MD5_SKIP_BLOCKS)) +ROOTFS_SQUASHFS_SIZE=$((ROOTFS_SIZE-4)) +ROOTFS_CHECK_BLOCKS=$((ROOTFS_SQUASHFS_SIZE / CHECK_BS)) ROOTFS_MD5=$(dd if=$ROOTFS_PATH bs=$CHECK_BS count=$ROOTFS_CHECK_BLOCKS 2>&- | mkhash md5) ROOTFS_MD5_FULL=$(mkhash md5 $ROOTFS_PATH) ROOTFS_SHA256_FULL=$(mkhash sha256 $ROOTFS_PATH) -ROOTFS_CHECK_SIZE=$(printf '0x%x' $(($ROOTFS_CHECK_BLOCKS * $CHECK_BS))) +ROOTFS_CHECK_SIZE=$(printf '0x%x' $ROOTFS_SQUASHFS_SIZE) ROOTFS_PART_SIZE_KB=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE_KB)) ROOTFS_PART_SIZE=$(printf $SIZE_FORMAT $(($ROOTFS_PART_SIZE_KB * $SIZE_FACTOR))) diff --git a/target/linux/apm821xx/image/nand.mk b/target/linux/apm821xx/image/nand.mk index 845770b89f..26676c8d8b 100644 --- a/target/linux/apm821xx/image/nand.mk +++ b/target/linux/apm821xx/image/nand.mk @@ -106,7 +106,7 @@ define Device/netgear_wndr4700 KERNEL_SIZE := 3584k # append a fake/empty rootfs to fool netgear's uboot # CHECK_DNI_FIRMWARE_ROOTFS_INTEGRITY in do_chk_dniimg() - KERNEL := kernel-bin | lzma | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | \ + KERNEL := kernel-bin | lzma -d16 | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | \ append-uImage-fakehdr filesystem | dtb | create-uImage-dtb | prepend-dtb KERNEL_INITRAMFS := kernel-bin | gzip | dtb | MuImage-initramfs gzip IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ @@ -117,6 +117,5 @@ define Device/netgear_wndr4700 NETGEAR_HW_ID := 29763875+128+256 UBINIZE_OPTS := -E 5 SUPPORTED_DEVICES += wndr4700 - DEFAULT := n endef TARGET_DEVICES += netgear_wndr4700 diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default index e1874f6164..db60838cf3 100644 --- a/target/linux/apm821xx/nand/config-default +++ b/target/linux/apm821xx/nand/config-default @@ -37,8 +37,6 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_UBIFS_FS=y # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set diff --git a/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index eb216aeb69..cba8062f55 100644 --- a/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -48,7 +48,7 @@ Signed-off-by: Vinod Koul #include "xhci.h" #include "xhci-trace.h" -@@ -62,6 +64,44 @@ +@@ -63,6 +65,44 @@ #define PCI_DEVICE_ID_ASMEDIA_1142_XHCI 0x1242 #define PCI_DEVICE_ID_ASMEDIA_2142_XHCI 0x2142 @@ -93,7 +93,7 @@ Signed-off-by: Vinod Koul static const char hcd_name[] = "xhci_hcd"; static struct hc_driver __read_mostly xhci_pci_hc_driver; -@@ -296,6 +336,873 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -298,6 +338,873 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -967,7 +967,7 @@ Signed-off-by: Vinod Koul /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -337,6 +1244,27 @@ static int xhci_pci_probe(struct pci_dev +@@ -339,6 +1246,27 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -995,7 +995,7 @@ Signed-off-by: Vinod Koul driver = (struct hc_driver *)id->driver_data; /* Prevent runtime suspending between USB-2 and USB-3 initialization */ -@@ -398,6 +1326,16 @@ static void xhci_pci_remove(struct pci_d +@@ -400,6 +1328,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; @@ -1012,7 +1012,7 @@ Signed-off-by: Vinod Koul xhci = hcd_to_xhci(pci_get_drvdata(dev)); xhci->xhc_state |= XHCI_STATE_REMOVING; -@@ -537,6 +1475,11 @@ static int xhci_pci_resume(struct usb_hc +@@ -539,6 +1477,11 @@ static int xhci_pci_resume(struct usb_hc if (pdev->vendor == PCI_VENDOR_ID_INTEL) usb_enable_intel_xhci_ports(pdev); diff --git a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch index be32823fee..53f4aae7f1 100644 --- a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch @@ -13,7 +13,7 @@ produce a noisy warning. --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -283,6 +283,7 @@ static void xhci_pci_quirks(struct devic +@@ -285,6 +285,7 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x0015) { xhci->quirks |= XHCI_RESET_ON_RESUME; xhci->quirks |= XHCI_ZERO_64B_REGS; diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default index 1f49678508..d64aa1e2c6 100644 --- a/target/linux/at91/sama5/config-default +++ b/target/linux/at91/sama5/config-default @@ -360,7 +360,6 @@ CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 # CONFIG_MTD_UBI_BLOCK is not set CONFIG_MTD_UBI_FASTMAP=y -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts new file mode 100644 index 0000000000..b530f6aa8a --- /dev/null +++ b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7242.dtsi" + +#include +#include + +/ { + compatible = "engenius,eap350-v1", "qca,ar7242"; + model = "EnGenius EAP350 v1"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "blue:power"; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wlan { + label = "blue:wlan"; + gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <20000000>; + + 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 0x10000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x50000 0x50000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0xa0000 0x10000>; + read-only; + }; + + firmware2: partition@b0000 { + label = "firmware2"; + reg = <0xb0000 0xf0000>; + }; + + partition@1a0000 { + label = "fakeroot"; + reg = <0x1a0000 0x10000>; + read-only; + }; + + firmware1: partition@1b0000 { + label = "firmware1"; + reg = <0x1b0000 0x4c0000>; + }; + + partition@670000 { + label = "failsafe"; + reg = <0x670000 0x180000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + phy-handle = <&phy4>; + phy-mode = "rgmii-id"; + + pll-data = <0x02000000 0x00000101 0x00001313>; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0,0 { + compatible = "pci168c,002a"; + reg = <0x0 0 0 0 0>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; diff --git a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts new file mode 100644 index 0000000000..8931a206ba --- /dev/null +++ b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7242.dtsi" + +#include +#include + +/ { + compatible = "engenius,ecb350-v1", "qca,ar7242"; + model = "EnGenius ECB350 v1"; + + aliases { + label-mac-device = &ath9k; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wlan { + label = "green:wlan"; + gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <20000000>; + + 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 0x10000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x50000 0x50000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0xa0000 0x10000>; + read-only; + }; + + firmware2: partition@b0000 { + label = "firmware2"; + reg = <0xb0000 0xf0000>; + }; + + partition@1a0000 { + label = "fakeroot"; + reg = <0x1a0000 0x10000>; + read-only; + }; + + firmware1: partition@1b0000 { + label = "firmware1"; + reg = <0x1b0000 0x4c0000>; + }; + + partition@670000 { + label = "failsafe"; + reg = <0x670000 0x180000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + phy-handle = <&phy4>; + phy-mode = "rgmii-id"; + + pll-data = <0x02000000 0x00000101 0x00001313>; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0,0 { + compatible = "pci168c,002a"; + reg = <0x0 0 0 0 0>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-1)>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts new file mode 100644 index 0000000000..c75684be04 --- /dev/null +++ b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9331.dtsi" + +#include +#include + +/ { + compatible = "glinet,gl-usb150", "qca,ar9331"; + model = "GL.iNet GL-USB150"; + + aliases { + serial0 = &uart; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + wlan { + label = "green:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + led_power: power { + label = "green:power"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_lan_reset { + gpio-export,name = "lan:reset"; + gpio-export,output = <0>; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + gmac-config { + device = <&gmac>; + switch-phy-addr-swap = <0>; + switch-phy-swap = <0>; + }; +}; + +ð1 { + status = "okay"; + + compatible = "syscon", "simple-mfd"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <33000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xfa0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts new file mode 100644 index 0000000000..8e0955e182 --- /dev/null +++ b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + compatible = "ubnt,aircube-ac", "qca,ar9342"; + model = "Ubiquiti airCube AC"; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xf60000>; + }; + + partition@fb0000 { + label = "cfg"; + reg = <0xfb0000 0x040000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <4>; + phy0: ethernet-phy@0 { + phy-mode = "rgmii"; + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + /* default for ar934x, except for 1000M and 10M */ + pll-data = <0x06000000 0x00000101 0x00001313>; + + mtd-mac-address = <&art 0x0>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; + + gmac-config { + device = <&gmac>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/ar9344_engenius_eap600.dts b/target/linux/ath79/dts/ar9344_engenius_eap600.dts new file mode 100644 index 0000000000..c6961f636e --- /dev/null +++ b/target/linux/ath79/dts/ar9344_engenius_eap600.dts @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_engenius_exx600.dtsi" + +/ { + model = "EnGenius EAP600"; + compatible = "engenius,eap600", "qca,ar9344"; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wps { + label = "blue:wps"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + wifi5g { + label = "green:wifi5g"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +ð0 { + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-2)>; +}; + +&pcie { + wifi@0,0,0 { + mtd-mac-address = <&art 0x0>; + }; +}; + +&wmac { + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-1)>; +}; diff --git a/target/linux/ath79/dts/ar9344_engenius_ecb600.dts b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts new file mode 100644 index 0000000000..13167adc4d --- /dev/null +++ b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_engenius_exx600.dtsi" + +/ { + model = "EnGenius ECB600"; + compatible = "engenius,ecb600", "qca,ar9344"; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +ð0 { + mtd-mac-address = <&art 0x0>; +}; + +&pcie { + wifi@0,0,0 { + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-2)>; + }; +}; + +&wmac { + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-1)>; +}; diff --git a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi new file mode 100644 index 0000000000..5ae2ea66ef --- /dev/null +++ b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + serial0 = &uart; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&spi { + 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 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x050000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0x0a0000 0x010000>; + read-only; + }; + + fwconcat1: partition@b0000 { + label = "fwconcat1"; + reg = <0x0b0000 0x170000>; + }; + + partition@220000 { + label = "fakeroot"; + reg = <0x220000 0x010000>; + read-only; + }; + + fwconcat0: partition@230000 { + label = "fwconcat0"; + reg = <0x230000 0xbc0000>; + }; + + partition@df0000 { + label = "failsafe"; + reg = <0xdf0000 0x200000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy0>; + phy-mode = "rgmii-id"; + + pll-data = <0x02000000 0x00000101 0x00001313>; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + rxdv-delay = <3>; + rxd-delay = <3>; + }; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0,0 { + compatible = "pci168c,0030"; + reg = <0x0 0 0 0 0>; + qca,disable-5ghz; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&wmac { + status = "okay"; + + qca,disable-2ghz; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts new file mode 100644 index 0000000000..ba674c13d8 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_mikrotik_routerboard-16m.dtsi" + +/ { + compatible = "mikrotik,routerboard-wapr-2nd", "qca,qca9533"; + model = "MikroTik RouterBOARD wAPR-2nD (wAP R)"; + + aliases { + led-boot = &led_rssilow; + led-failsafe = &led_rssilow; + led-upgrade = &led_rssilow; + led-running = &led_rssilow; + serial0 = &uart; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + + led_rssilow: rssilow { + label = "green:rssilow"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + rssimedium { + label = "green:rssimedium"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "green:rssihigh"; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + minipcie { + gpio-export,name = "minipcie"; + gpio-export,output = <1>; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + compatible = "syscon", "simple-mfd"; +}; + +&pcie0 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dts b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dts new file mode 100644 index 0000000000..8de89292ea --- /dev/null +++ b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_plasmacloud_pa300.dtsi" + +/ { + compatible = "plasmacloud,pa300", "qca,qca9533"; + model = "Plasma Cloud PA300"; +}; diff --git a/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi new file mode 100644 index 0000000000..0bc6d4fa28 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi @@ -0,0 +1,140 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include + +/ { + chosen { + /delete-property/ bootargs; + }; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_green; + led-running = &led_status_green; + led-upgrade = &led_status_green; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + status_red { + label = "red:status"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + + led_status_green: status_green { + label = "green:status"; + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + }; + + status_blue { + label = "blue:status"; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + /* partitions are passed via bootloader */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x040000>; + }; + + partition@80000 { + label = "custom"; + reg = <0x080000 0x140000>; + read-only; + }; + + partition@1c0000 { + label = "inactive"; + reg = <0x1c0000 0x700000>; + }; + + partition@8c0000 { + label = "inactive2"; + reg = <0x8c0000 0x700000>; + }; + + art: partition@fc0000 { + label = "ART"; + reg = <0xfc0000 0x040000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + /* Workaround: keep the Ethernet interfaces order/mapping correct + * (GMAC0 -> eth0, GMAC1 -> eth1, same as in old ar71xx target) + */ + compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; + + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <2>; +}; diff --git a/target/linux/ath79/dts/qca9533_plasmacloud_pa300e.dts b/target/linux/ath79/dts/qca9533_plasmacloud_pa300e.dts new file mode 100644 index 0000000000..1527a796bb --- /dev/null +++ b/target/linux/ath79/dts/qca9533_plasmacloud_pa300e.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_plasmacloud_pa300.dtsi" + +/ { + compatible = "plasmacloud,pa300e", "qca,qca9533"; + model = "Plasma Cloud PA300E"; +}; diff --git a/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts new file mode 100644 index 0000000000..1a2974a688 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" +#include "qca95xx_dlink_dap-2xxx.dtsi" + +/ { + compatible = "dlink,dap-2660-a1", "qca,qca9557"; + model = "D-Link DAP-2660 A1"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_red; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_red: power_red { + label = "red:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led_power_green: power_green { + label = "green:power"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; +}; + +&partitions { + partition@70000 { + label = "firmware"; + reg = <0x70000 0xee0000>; + compatible = "wrg"; + }; + + partition@f50000 { + label = "dlink"; + reg = <0xf50000 0xa0000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@4 { + reg = <0x4>; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x82000000 0x80000101 0x80001313>; + + phy-handle = <&phy0>; + phy-mode = "rgmii-id"; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + rxd-delay = <3>; + rxdv-delay = <3>; + }; +}; + +&pcie0 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts b/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts new file mode 100644 index 0000000000..955f17f0f3 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x_engenius_ecb1xxx.dtsi" + +/ { + compatible = "engenius,ecb1200", "qca,qca9557"; + model = "EnGenius ECB1200"; +}; diff --git a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts new file mode 100644 index 0000000000..952747ade0 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + compatible = "engenius,enstationac-v1", "qca,qca9557"; + model = "EnGenius EnStationAC v1"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + rssilow { + label = "red:rssilow"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + rssimedium { + label = "amber:rssimedium"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "green:rssihigh"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + 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 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x050000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0x0a0000 0x010000>; + read-only; + }; + + firmware2: partition@b0000 { + label = "firmware2"; + reg = <0x0b0000 0x170000>; + }; + + partition@220000 { + label = "fakeroot"; + reg = <0x220000 0x010000>; + read-only; + }; + + firmware1: partition@230000 { + label = "firmware1"; + reg = <0x230000 0xb40000>; + }; + + partition@d70000 { + label = "failsafe"; + reg = <0xd70000 0x280000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy1: ethernet-phy@1 { + reg = <1>; + eee-broken-100tx; + eee-broken-1000t; + }; + + phy2: ethernet-phy@2 { + reg = <2>; + eee-broken-100tx; + eee-broken-1000t; + at803x-override-sgmii-link-check; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + phy-handle = <&phy1>; + phy-mode = "rgmii-id"; + + pll-data = <0x82000000 0x80000101 0x80001313>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; + + phy-handle = <&phy2>; + + pll-data = <0x03000000 0x00000101 0x00001313>; + + qca955x-sgmii-fixup; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0,0 { + compatible = "qcom,ath10k"; + reg = <0x0 0 0 0 0>; + qca,no-eeprom; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts b/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts index 159ccc1872..4ee4c8ea69 100644 --- a/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts +++ b/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts @@ -1,139 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca955x.dtsi" - -#include -#include +#include "qca955x_engenius_ecb1xxx.dtsi" / { compatible = "engenius,ecb1750", "qca,qca9558"; model = "EnGenius ECB1750"; - - aliases { - led-boot = &led_power_orange; - led-failsafe = &led_power_orange; - led-running = &led_power_orange; - led-upgrade = &led_power_orange; - }; - - leds { - compatible = "gpio-leds"; - - led_power_orange: power_orange { - label = "orange:power"; - gpios = <&gpio 22 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - wlan2g { - label = "blue:wlan2g"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - - wlan5g { - label = "blue:wlan5g"; - gpios = <&gpio 23 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - lan { - label = "blue:lan"; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&pcie0 { - status = "okay"; -}; - -&uart { - status = "okay"; -}; - -&spi { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <25000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - uboot: partition@0 { - label = "u-boot"; - reg = <0x000000 0x040000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x040000 0x010000>; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x050000 0xf50000>; - }; - - partition@fa0000 { - label = "userconfig"; - reg = <0xfa0000 0x050000>; - read-only; - }; - - art: partition@ff0000 { - label = "art"; - reg = <0xff0000 0x010000>; - read-only; - }; - }; - }; -}; - -&wmac { - status = "okay"; - - qca,no-eeprom; -}; - -&mdio0 { - status = "okay"; - - phy5: ethernet-phy@5 { - reg = <5>; - eee-broken-100tx; - eee-broken-1000t; - }; -}; - -ð0 { - status = "okay"; - - pll-data = <0x9a000000 0x80000101 0x80001313>; - - phy-handle = <&phy5>; - - gmac-config { - device = <&gmac>; - rgmii-gmac0 = <1>; - rxd-delay = <3>; - rxdv-delay = <3>; - }; }; diff --git a/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts b/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts index ccc08c39f1..96269c4418 100644 --- a/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts +++ b/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts @@ -153,10 +153,10 @@ qca,ar8327-initvals = < 0x04 0x87600000 /* PORT0 PAD MODE CTRL */ - 0x50 0xc437c437 /* LED Control Register 0 */ - 0x54 0xc337c337 /* LED Control Register 1 */ + 0x50 0xcf37cf37 /* LED Control Register 0 */ + 0x54 0x00000000 /* LED Control Register 1 */ 0x58 0x00000000 /* LED Control Register 2 */ - 0x5c 0x03ffff00 /* LED Control Register 3 */ + 0x5c 0x0030c300 /* LED Control Register 3 */ 0x7c 0x0000007e /* PORT0_STATUS */ >; }; diff --git a/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi b/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi new file mode 100644 index 0000000000..0051eb2508 --- /dev/null +++ b/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + debounce-interval = <60>; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + 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 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xf50000>; + }; + + partition@fa0000 { + label = "userconfig"; + reg = <0xfa0000 0x050000>; + read-only; + }; + + partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy5: ethernet-phy@5 { + reg = <5>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy5>; + phy-mode = "rgmii-id"; + + pll-data = <0x82000000 0x80000101 0x80001313>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0,0 { + compatible = "qcom,ath10k"; + reg = <0x0 0 0 0 0>; + qca,no-eeprom; + }; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; diff --git a/target/linux/ath79/dts/qca95xx_dlink_dap-2xxx.dtsi b/target/linux/ath79/dts/qca95xx_dlink_dap-2xxx.dtsi new file mode 100644 index 0000000000..82d50b85e8 --- /dev/null +++ b/target/linux/ath79/dts/qca95xx_dlink_dap-2xxx.dtsi @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "bdcfg"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "rgdb"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "unused"; + reg = <0x60000 0x10000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; 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 16d1b90369..86213cf496 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 @@ -151,7 +151,6 @@ telco,t1) ;; comfast,cf-wr752ac-v1|\ engenius,eap300-v2|\ -engenius,ecb1750|\ enterasys,ws-ap3705i) ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" ;; @@ -185,7 +184,8 @@ engenius,enh202-v1) ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "amber:rssimedium" "wlan0" "33" "100" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:rssihigh" "wlan0" "67" "100" ;; -engenius,ens202ext-v1) +engenius,ens202ext-v1|\ +engenius,enstationac-v1) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "RSSILOW" "red:rssilow" "wlan0" "1" "100" ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "amber:rssimedium" "wlan0" "33" "100" 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 8aff8bdbfe..e920b356cc 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 @@ -29,9 +29,15 @@ ath79_setup_interfaces() dlink,dap-1365-a1|\ dlink,dir-505|\ engenius,eap300-v2|\ + engenius,eap350-v1|\ + engenius,eap600|\ + engenius,ecb1200|\ engenius,ecb1750|\ + engenius,ecb350-v1|\ + engenius,ecb600|\ enterasys,ws-ap3705i|\ glinet,gl-ar300m-lite|\ + glinet,gl-usb150|\ hak5,wifi-pineapple-nano|\ meraki,mr16|\ netgear,ex6400|\ @@ -146,6 +152,8 @@ ath79_setup_interfaces() comfast,cf-e120a-v3|\ comfast,cf-e314n-v2|\ compex,wpj531-16m|\ + plasmacloud,pa300|\ + plasmacloud,pa300e|\ tplink,cpe210-v1|\ tplink,cpe220-v2|\ tplink,cpe220-v3|\ @@ -372,6 +380,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0" ;; + ubnt,aircube-ac) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:1" "3:lan:2" "5:lan:3" "4:wan" + ;; ubnt,aircube-isp) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ @@ -468,6 +480,10 @@ ath79_setup_macs() lan_mac=$(mtd_get_mac_text "mp" 0x1) label_mac=$lan_mac ;; + dlink,dap-2660-a1) + lan_mac=$(mtd_get_mac_ascii bdcfg "lanmac") + label_mac=$lan_mac + ;; dlink,dap-2695-a1) label_mac=$(mtd_get_mac_ascii bdcfg "wlanmac") ;; @@ -501,9 +517,10 @@ ath79_setup_macs() elecom,wrc-300ghbk2-i) wan_mac=$(macaddr_add "$(mtd_get_mac_binary art 0x1002)" -2) ;; + engenius,ecb1200|\ engenius,ecb1750) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) - label_mac=$(mtd_get_mac_ascii u-boot-env athaddr) + label_mac=$lan_mac ;; engenius,enh202-v1|\ ubnt,airrouter|\ diff --git a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches index 8ec0af53d4..b3e0d0dd31 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches @@ -73,6 +73,7 @@ tplink,wbs510-v1|\ tplink,wbs510-v2) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20" ;; +ubnt,aircube-ac|\ ubnt,aircube-isp) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" ;; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 194df74292..28ac38e1d4 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -37,9 +37,10 @@ case "$FIRMWARE" in caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac") ;; + engenius,ecb1200|\ engenius,ecb1750) caldata_extract "art" 0x1000 0x440 - ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env "athaddr") +1) + ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) +1) ;; engenius,epg5000|\ iodata,wn-ac1167dgr|\ @@ -74,6 +75,8 @@ case "$FIRMWARE" in caldata_extract_reverse "urloader" 0x1541 0x440 ;; buffalo,wzr-hp-g302h-a1a0|\ + engenius,eap350-v1|\ + engenius,ecb350-v1|\ engenius,enh202-v1) caldata_extract "art" 0x1000 0xeb8 ;; @@ -86,10 +89,8 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x440 ath9k_patch_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1) ;; - enterasys,ws-ap3705i) - caldata_extract "calibrate" 0x5000 0x440 - ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0) - ;; + engenius,eap600|\ + engenius,ecb600|\ mercury,mw4530r-v1|\ ocedo,raccoon|\ tplink,tl-wdr3500-v1|\ @@ -102,6 +103,10 @@ case "$FIRMWARE" in winchannel,wb2000) caldata_extract "art" 0x5000 0x440 ;; + enterasys,ws-ap3705i) + caldata_extract "calibrate" 0x5000 0x440 + ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0) + ;; netgear,wnr2200-8m|\ netgear,wnr2200-16m|\ pcs,cap324|\ 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 a72cad05c3..82b121b68a 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 @@ -11,6 +11,7 @@ case "$FIRMWARE" in "ath10k/cal-pci-0000:00:00.0.bin") case $board in allnet,all-wap02860ac|\ + engenius,enstationac-v1|\ glinet,gl-x750) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2) @@ -26,6 +27,7 @@ case "$FIRMWARE" in qxwlan,e1700ac-v2-16m|\ qxwlan,e600gac-v2-8m|\ qxwlan,e600gac-v2-16m|\ + ubnt,aircube-ac|\ ubnt,unifiac-lite|\ ubnt,unifiac-lr|\ ubnt,unifiac-mesh|\ @@ -51,6 +53,7 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) -1) ;; + dlink,dap-2660-a1|\ dlink,dap-2695-a1) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a) @@ -62,6 +65,7 @@ case "$FIRMWARE" in elecom,wrc-1750ghbk2-i) caldata_extract "art" 0x5000 0x844 ;; + engenius,ecb1200|\ engenius,ecb1750) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_ascii u-boot-env athaddr) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index b592da00e3..f382e255f1 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -22,6 +22,10 @@ case "$board" in dlink,dch-g020-a1) mtd_get_mac_text "mp" 0x13 > /sys${DEVPATH}/macaddress ;; + dlink,dap-2660-a1) + [ "$PHYNBR" -eq 1 ] && \ + mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress + ;; iodata,wn-ac1600dgr) # There is no eeprom data for 5 GHz wlan in "art" partition # which would allow to patch the macaddress diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum index 74c608b96d..9a2cca79a1 100644 --- a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum @@ -13,6 +13,7 @@ fixwrgg() { board=$(board_name) case "$board" in +dlink,dap-2660-a1|\ dlink,dap-2695-a1) fixwrgg ;; diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/dualboot_datachk.sh b/target/linux/ath79/generic/base-files/lib/upgrade/dualboot_datachk.sh new file mode 100644 index 0000000000..002f5f9668 --- /dev/null +++ b/target/linux/ath79/generic/base-files/lib/upgrade/dualboot_datachk.sh @@ -0,0 +1,105 @@ +# The U-Boot loader with the datachk patchset for dualbooting requires image +# sizes and checksums to be provided in the U-Boot environment. +# The devices come with 2 main partitions - while one is active +# sysupgrade will flash the other. The boot order is changed to boot the +# newly flashed partition. If the new partition can't be booted due to +# upgrade failures the previously used partition is loaded. + +platform_do_upgrade_dualboot_datachk() { + local tar_file="$1" + local restore_backup + local primary_kernel_mtd + + local setenv_script="/tmp/fw_env_upgrade" + + local inactive_mtd="$(find_mtd_index $PART_NAME)" + local inactive_offset="$(cat /sys/class/mtd/mtd${inactive_mtd}/offset)" + local total_size="$(cat /sys/class/mtd/mtd${inactive_mtd}/size)" + local flash_start_mem=0x9f000000 + + # detect to which flash region the new image is written to. + # + # 1. check what is the mtd index for the first flash region on this + # device + # 2. check if the target partition ("inactive") has the mtd index of + # the first flash region + # + # - when it is: the new bootseq will be 1,2 and the first region is + # modified + # - when it isnt: bootseq will be 2,1 and the second region is + # modified + # + # The detection has to be done via the hardcoded mtd partition because + # the current boot might be done with the fallback region. Let us + # assume that the current bootseq is 1,2. The bootloader detected that + # the image in flash region 1 is corrupt and thus switches to flash + # region 2. The bootseq in the u-boot-env is now still the same and + # the sysupgrade code can now only rely on the actual mtd indexes and + # not the bootseq variable to detect the currently booted flash + # region/image. + # + # In the above example, an implementation which uses bootseq ("1,2") to + # detect the currently booted image would assume that region 1 is booted + # and then overwrite the variables for the wrong flash region (aka the + # one which isn't modified). This could result in a device which doesn't + # boot anymore to Linux until it was reflashed with ap51-flash. + local next_boot_part="1" + case "$(board_name)" in + plasmacloud,pa300|\ + plasmacloud,pa300e) + primary_kernel_mtd=3 + ;; + *) + echo "failed to detect primary kernel mtd partition for board" + return 1 + ;; + esac + [ "$inactive_mtd" = "$primary_kernel_mtd" ] || next_boot_part="2" + + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + local kernel_length=$(tar xf $tar_file ${board_dir}/kernel -O | wc -c) + local rootfs_length=$(tar xf $tar_file ${board_dir}/root -O | wc -c) + # rootfs without EOF marker + rootfs_length=$((rootfs_length-4)) + + local kernel_md5=$(tar xf $tar_file ${board_dir}/kernel -O | md5sum); kernel_md5="${kernel_md5%% *}" + # md5 checksum of rootfs with EOF marker + local rootfs_md5=$(tar xf $tar_file ${board_dir}/root -O | dd bs=1 count=$rootfs_length | md5sum); rootfs_md5="${rootfs_md5%% *}" + + # + # add tar support to get_image() to use default_do_upgrade() instead? + # + + # take care of restoring a saved config + [ -n "$UPGRADE_BACKUP" ] && restore_backup="${MTD_CONFIG_ARGS} -j ${UPGRADE_BACKUP}" + + mtd -q erase inactive + tar xf $tar_file ${board_dir}/root -O | mtd -n -p $kernel_length $restore_backup write - $PART_NAME + tar xf $tar_file ${board_dir}/kernel -O | mtd -n write - $PART_NAME + + # prepare new u-boot env + if [ "$next_boot_part" = "1" ]; then + echo "bootseq 1,2" > $setenv_script + else + echo "bootseq 2,1" > $setenv_script + fi + + printf "kernel_size_%i %i\n" $next_boot_part $((kernel_length / 1024)) >> $setenv_script + printf "vmlinux_start_addr 0x%08x\n" $((flash_start_mem + inactive_offset)) >> $setenv_script + printf "vmlinux_size 0x%08x\n" ${kernel_length} >> $setenv_script + printf "vmlinux_checksum %s\n" ${kernel_md5} >> $setenv_script + + printf "rootfs_size_%i %i\n" $next_boot_part $(((total_size-kernel_length) / 1024)) >> $setenv_script + printf "rootfs_start_addr 0x%08x\n" $((flash_start_mem+inactive_offset+kernel_length)) >> $setenv_script + printf "rootfs_size 0x%08x\n" ${rootfs_length} >> $setenv_script + printf "rootfs_checksum %s\n" ${rootfs_md5} >> $setenv_script + + # store u-boot env changes + mkdir -p /var/lock + fw_setenv -s $setenv_script || { + echo "failed to update U-Boot environment" + return 1 + } +} diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index f4fca06384..98861685dc 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -5,6 +5,9 @@ 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' + redboot_fis_do_upgrade() { local append local sysup_file="$1" @@ -47,6 +50,11 @@ platform_do_upgrade() { jjplus,ja76pf2) redboot_fis_do_upgrade "$1" linux ;; + plasmacloud,pa300|\ + plasmacloud,pa300e) + PART_NAME="inactive" + platform_do_upgrade_dualboot_datachk "$1" + ;; ubnt,routerstation|\ ubnt,routerstation-pro) redboot_fis_do_upgrade "$1" kernel diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index c347bd1cf1..710ab54772 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -110,15 +110,28 @@ define Device/ubnt-xw UBNT_VERSION := 6.0.4 endef -define Device/ubnt_aircube-isp +define Device/ubnt-acb $(Device/ubnt) - SOC := qca9533 - DEVICE_MODEL := airCube ISP IMAGE_SIZE := 15744k - UBNT_BOARD := ACB-ISP - UBNT_CHIP := qca9533 + UBNT_BOARD := ACB UBNT_TYPE := ACB UBNT_VERSION := 2.5.0 +endef + +define Device/ubnt_aircube-ac + $(Device/ubnt-acb) + SOC := ar9342 + DEVICE_MODEL := airCube AC + UBNT_CHIP := ar9342 + DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct +endef +TARGET_DEVICES += ubnt_aircube-ac + +define Device/ubnt_aircube-isp + $(Device/ubnt-acb) + SOC := qca9533 + DEVICE_MODEL := airCube ISP + UBNT_CHIP := qca9533 SUPPORTED_DEVICES += ubnt,acb-isp endef TARGET_DEVICES += ubnt_aircube-isp diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 9b8c16e2e3..c798c420f9 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -75,6 +75,7 @@ endef define Build/engenius-tar-gz -[ -f "$@" ] && \ mkdir -p $@.tmp && \ + touch $@.tmp/failsafe.bin && \ echo '#!/bin/sh' > $@.tmp/before-upgrade.sh && \ echo ': > /tmp/_sys/sysupgrade.tgz' >> $@.tmp/before-upgrade.sh && \ $(CP) $(KDIR)/loader-$(DEVICE_NAME).uImage \ @@ -765,6 +766,28 @@ define Device/dlink_dap-1365-a1 endef TARGET_DEVICES += dlink_dap-1365-a1 +define Device/dlink_dap-2xxx + IMAGES += factory.img sysupgrade.bin + IMAGE/factory.img := append-kernel | pad-offset 6144k 160 | \ + append-rootfs | wrgg-pad-rootfs | mkwrggimg | check-size + IMAGE/sysupgrade.bin := append-kernel | mkwrggimg | \ + pad-to $$$$(BLOCKSIZE) | append-rootfs | append-metadata | check-size + KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma + KERNEL_INITRAMFS := $$(KERNEL) | mkwrggimg +endef + +define Device/dlink_dap-2660-a1 + $(Device/dlink_dap-2xxx) + SOC := qca9557 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DAP-2660 + DEVICE_VARIANT := A1 + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct + IMAGE_SIZE := 15232k + DAP_SIGNATURE := wapac09_dkbs_dap2660 +endef +TARGET_DEVICES += dlink_dap-2660-a1 + define Device/dlink_dap-2695-a1 SOC := qca9558 DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct @@ -969,20 +992,74 @@ define Device/engenius_eap300-v2 endef TARGET_DEVICES += engenius_eap300-v2 +define Device/engenius_eap350-v1 + $(Device/engenius_loader_okli) + SOC := ar7242 + DEVICE_MODEL := EAP350 + DEVICE_VARIANT := v1 + IMAGE_SIZE := 4864k + LOADER_FLASH_OFFS := 0x1b0000 + ENGENIUS_IMGNAME := senao-eap350 +endef +TARGET_DEVICES += engenius_eap350-v1 + +define Device/engenius_eap600 + $(Device/engenius_loader_okli) + SOC := ar9344 + DEVICE_MODEL := EAP600 + IMAGE_SIZE := 12032k + LOADER_FLASH_OFFS := 0x230000 + ENGENIUS_IMGNAME := senao-eap600 +endef +TARGET_DEVICES += engenius_eap600 + +define Device/engenius_ecb1200 + SOC := qca9557 + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := ECB1200 + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct + IMAGE_SIZE := 15680k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | \ + senao-header -r 0x101 -p 0x6e -t 2 +endef +TARGET_DEVICES += engenius_ecb1200 + define Device/engenius_ecb1750 SOC := qca9558 DEVICE_VENDOR := EnGenius DEVICE_MODEL := ECB1750 - DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct IMAGE_SIZE := 15680k + IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | check-size | \ senao-header -r 0x101 -p 0x6d -t 2 - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ - append-metadata | check-size endef TARGET_DEVICES += engenius_ecb1750 +define Device/engenius_ecb350-v1 + $(Device/engenius_loader_okli) + SOC := ar7242 + DEVICE_MODEL := ECB350 + DEVICE_VARIANT := v1 + IMAGE_SIZE := 4864k + LOADER_FLASH_OFFS := 0x1b0000 + ENGENIUS_IMGNAME := senao-ecb350 +endef +TARGET_DEVICES += engenius_ecb350-v1 + +define Device/engenius_ecb600 + $(Device/engenius_loader_okli) + SOC := ar9344 + DEVICE_MODEL := ECB600 + IMAGE_SIZE := 12032k + LOADER_FLASH_OFFS := 0x230000 + ENGENIUS_IMGNAME := senao-ecb600 +endef +TARGET_DEVICES += engenius_ecb600 + define Device/engenius_enh202-v1 $(Device/engenius_loader_okli) SOC := ar7240 @@ -1007,6 +1084,18 @@ define Device/engenius_ens202ext-v1 endef TARGET_DEVICES += engenius_ens202ext-v1 +define Device/engenius_enstationac-v1 + $(Device/engenius_loader_okli) + SOC := qca9557 + DEVICE_MODEL := EnStationAC + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct rssileds + IMAGE_SIZE := 11520k + LOADER_FLASH_OFFS := 0x230000 + ENGENIUS_IMGNAME := ar71xx-generic-enstationac +endef +TARGET_DEVICES += engenius_enstationac-v1 + define Device/engenius_epg5000 SOC := qca9558 DEVICE_VENDOR := EnGenius @@ -1126,6 +1215,15 @@ define Device/glinet_gl-mifi endef TARGET_DEVICES += glinet_gl-mifi +define Device/glinet_gl-usb150 + SOC := ar9331 + DEVICE_VENDOR := GL.iNET + DEVICE_MODEL := GL-USB150 + IMAGE_SIZE := 16000k + SUPPORTED_DEVICES += gl-usb150 +endef +TARGET_DEVICES += glinet_gl-usb150 + define Device/glinet_gl-x750 SOC := qca9531 DEVICE_VENDOR := GL.iNet @@ -1574,6 +1672,30 @@ define Device/pisen_wmm003n endef TARGET_DEVICES += pisen_wmm003n +define Device/plasmacloud_pa300-common + SOC := qca9533 + DEVICE_VENDOR := Plasma Cloud + DEVICE_PACKAGES := uboot-envtools + IMAGE_SIZE := 7168k + BLOCKSIZE := 64k + IMAGES += factory.bin + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-to $$(BLOCKSIZE) + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA300 + IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata +endef + +define Device/plasmacloud_pa300 + $(Device/plasmacloud_pa300-common) + DEVICE_MODEL := PA300 +endef +TARGET_DEVICES += plasmacloud_pa300 + +define Device/plasmacloud_pa300e + $(Device/plasmacloud_pa300-common) + DEVICE_MODEL := PA300E +endef +TARGET_DEVICES += plasmacloud_pa300e + define Device/qihoo_c301 $(Device/seama) SOC := ar9344 diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk index 3752c891a7..b7d745bc77 100644 --- a/target/linux/ath79/image/mikrotik.mk +++ b/target/linux/ath79/image/mikrotik.mk @@ -53,3 +53,12 @@ define Device/mikrotik_routerboard-wap-g-5hact2hnd SUPPORTED_DEVICES += rb-wapg-5hact2hnd endef TARGET_DEVICES += mikrotik_routerboard-wap-g-5hact2hnd + +define Device/mikrotik_routerboard-wapr-2nd + $(Device/mikrotik_nor) + SOC := qca9533 + DEVICE_MODEL := RouterBOARD wAPR-2nD (wAP R) + DEVICE_PACKAGES += rssileds + IMAGE_SIZE := 16256k +endef +TARGET_DEVICES += mikrotik_routerboard-wapr-2nd diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds index 60dcef4ff6..0d3209c2e3 100755 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds @@ -10,6 +10,12 @@ case "$board" in mikrotik,routerboard-lhg-2nd) ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0" ;; +mikrotik,routerboard-wapr-2nd) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimedium" "rssimedium" "green:rssimedium" "wlan0" "33" "100" + ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "66" "100" + ;; mikrotik,routerboard-sxt-5nd-r2) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100" diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index 6bc4822551..584acc0feb 100755 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -19,7 +19,8 @@ ath79_setup_interfaces() mikrotik,routerboard-922uags-5hpacd|\ mikrotik,routerboard-lhg-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ - mikrotik,routerboard-wap-g-5hact2hnd) + mikrotik,routerboard-wap-g-5hact2hnd|\ + mikrotik,routerboard-wapr-2nd) ucidef_set_interface_lan "eth0" ;; *) @@ -40,7 +41,8 @@ ath79_setup_macs() mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-lhg-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ - mikrotik,routerboard-wap-g-5hact2hnd) + mikrotik,routerboard-wap-g-5hact2hnd|\ + mikrotik,routerboard-wapr-2nd) label_mac="$mac_base" lan_mac="$mac_base" ;; diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index f2cb1f774f..7ef6fdbe0f 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -24,7 +24,8 @@ case "$FIRMWARE" in "ath9k-eeprom-ahb-18100000.wmac.bin") case $board in mikrotik,routerboard-lhg-2nd|\ - mikrotik,routerboard-sxt-5nd-r2) + mikrotik,routerboard-sxt-5nd-r2|\ + mikrotik,routerboard-wapr-2nd) caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +1) ;; mikrotik,routerboard-wap-g-5hact2hnd) diff --git a/target/linux/ath79/mikrotik/config-default b/target/linux/ath79/mikrotik/config-default index 5c42368ea9..f713fc36cf 100644 --- a/target/linux/ath79/mikrotik/config-default +++ b/target/linux/ath79/mikrotik/config-default @@ -24,8 +24,6 @@ CONFIG_MTD_UBI=y 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_NET_SWITCHDEV=y CONFIG_PCI_AR71XX=y CONFIG_PHY_AR7100_USB=y @@ -37,7 +35,6 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_WATCHDOG_CORE=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default index 738f2f0a5e..9ae059508f 100644 --- a/target/linux/ath79/nand/config-default +++ b/target/linux/ath79/nand/config-default @@ -13,8 +13,6 @@ CONFIG_MTD_SPI_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# 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_AR7200_USB=y @@ -23,6 +21,5 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/ath79/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch b/target/linux/ath79/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch new file mode 100644 index 0000000000..4cadd5a86f --- /dev/null +++ b/target/linux/ath79/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch @@ -0,0 +1,194 @@ +From: Paul Burton +Date: Wed, 9 Oct 2019 23:09:45 +0000 +Subject: MIPS: cmdline: Clean up boot_command_line initialization + +Our current code to initialize boot_command_line is a mess. Some of this +is due to the addition of too many options over the years, and some of +this is due to workarounds for early_init_dt_scan_chosen() performing +actions specific to options from other architectures that probably +shouldn't be in generic code. + +Clean this up by introducing a new bootcmdline_init() function that +simplifies the initialization somewhat. The major changes are: + +- Because bootcmdline_init() is a function it can return early in the + CONFIG_CMDLINE_OVERRIDE case. + +- We clear boot_command_line rather than inheriting whatever + early_init_dt_scan_chosen() may have left us. This means we no longer + need to set boot_command_line to a space character in an attempt to + prevent early_init_dt_scan_chosen() from copying CONFIG_CMDLINE into + boot_command_line without us knowing about it. + +- Indirection via USE_PROM_CMDLINE, USE_DTB_CMDLINE, EXTEND_WITH_PROM & + BUILTIN_EXTEND_WITH_PROM macros is removed; they seemingly served only + to obfuscate the code. + +- The logic is cleaner, clearer & commented. + +Two minor drawbacks of this approach are: + +1) We call of_scan_flat_dt(), which means we scan through the DT again. + The overhead is fairly minimal & shouldn't be noticeable. + +2) cmdline_scan_chosen() duplicates a small amount of the logic from + early_init_dt_scan_chosen(). Alternatives might be to allow the + generic FDT code to keep & expose a copy of the arguments taken from + the /chosen node's bootargs property, or to introduce a function like + early_init_dt_scan_chosen() that retrieves them without modification + to handle CONFIG_CMDLINE. Neither of these sounds particularly + cleaner though, and this way we at least keep the extra work in + arch/mips. + +Origin: upstream, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7784cac697351f0cc0a4bb619594c0c99348c5aa +Signed-off-by: Paul Burton +Cc: linux-mips@vger.kernel.org + +diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c +index b8884de89c81e1b444b218a15519556b4a374089..e56dd6c25d46336fcb9af21326f697d0c37aac1c 100644 +--- a/arch/mips/kernel/setup.c ++++ b/arch/mips/kernel/setup.c +@@ -538,11 +538,88 @@ static void __init check_kernel_sections_mem(void) + } + } + +-#define USE_PROM_CMDLINE IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER) +-#define USE_DTB_CMDLINE IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_DTB) +-#define EXTEND_WITH_PROM IS_ENABLED(CONFIG_MIPS_CMDLINE_DTB_EXTEND) +-#define BUILTIN_EXTEND_WITH_PROM \ +- IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND) ++static void __init bootcmdline_append(const char *s, size_t max) ++{ ++ if (!s[0] || !max) ++ return; ++ ++ if (boot_command_line[0]) ++ strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); ++ ++ strlcat(boot_command_line, s, max); ++} ++ ++static int __init bootcmdline_scan_chosen(unsigned long node, const char *uname, ++ int depth, void *data) ++{ ++ bool *dt_bootargs = data; ++ const char *p; ++ int l; ++ ++ if (depth != 1 || !data || ++ (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) ++ return 0; ++ ++ p = of_get_flat_dt_prop(node, "bootargs", &l); ++ if (p != NULL && l > 0) { ++ bootcmdline_append(p, min(l, COMMAND_LINE_SIZE)); ++ *dt_bootargs = true; ++ } ++ ++ return 1; ++} ++ ++static void __init bootcmdline_init(char **cmdline_p) ++{ ++ bool dt_bootargs = false; ++ ++ /* ++ * If CMDLINE_OVERRIDE is enabled then initializing the command line is ++ * trivial - we simply use the built-in command line unconditionally & ++ * unmodified. ++ */ ++ if (IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) { ++ strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); ++ return; ++ } ++ ++ /* ++ * If the user specified a built-in command line & ++ * MIPS_CMDLINE_BUILTIN_EXTEND, then the built-in command line is ++ * prepended to arguments from the bootloader or DT so we'll copy them ++ * to the start of boot_command_line here. Otherwise, empty ++ * boot_command_line to undo anything early_init_dt_scan_chosen() did. ++ */ ++ if (IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND)) ++ strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); ++ else ++ boot_command_line[0] = 0; ++ ++ /* ++ * If we're configured to take boot arguments from DT, look for those ++ * now. ++ */ ++ if (IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_DTB)) ++ of_scan_flat_dt(bootcmdline_scan_chosen, &dt_bootargs); ++ ++ /* ++ * If we didn't get any arguments from DT (regardless of whether that's ++ * because we weren't configured to look for them, or because we looked ++ * & found none) then we'll take arguments from the bootloader. ++ * plat_mem_setup() should have filled arcs_cmdline with arguments from ++ * the bootloader. ++ */ ++ if (IS_ENABLED(CONFIG_MIPS_CMDLINE_DTB_EXTEND) || !dt_bootargs) ++ bootcmdline_append(arcs_cmdline, COMMAND_LINE_SIZE); ++ ++ /* ++ * If the user specified a built-in command line & we didn't already ++ * prepend it, we append it to boot_command_line here. ++ */ ++ if (IS_ENABLED(CONFIG_CMDLINE_BOOL) && ++ !IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND)) ++ bootcmdline_append(builtin_cmdline, COMMAND_LINE_SIZE); ++} + + /* + * arch_mem_init - initialize memory management subsystem +@@ -570,48 +647,12 @@ static void __init arch_mem_init(char **cmdline_p) + { + extern void plat_mem_setup(void); + +- /* +- * Initialize boot_command_line to an innocuous but non-empty string in +- * order to prevent early_init_dt_scan_chosen() from copying +- * CONFIG_CMDLINE into it without our knowledge. We handle +- * CONFIG_CMDLINE ourselves below & don't want to duplicate its +- * content because repeating arguments can be problematic. +- */ +- strlcpy(boot_command_line, " ", COMMAND_LINE_SIZE); +- + /* call board setup routine */ + plat_mem_setup(); + memblock_set_bottom_up(true); + +-#if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE) +- strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); +-#else +- if ((USE_PROM_CMDLINE && arcs_cmdline[0]) || +- (USE_DTB_CMDLINE && !boot_command_line[0])) +- strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE); +- +- if (EXTEND_WITH_PROM && arcs_cmdline[0]) { +- if (boot_command_line[0]) +- strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); +- strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE); +- } +- +-#if defined(CONFIG_CMDLINE_BOOL) +- if (builtin_cmdline[0]) { +- if (boot_command_line[0]) +- strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); +- strlcat(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); +- } +- +- if (BUILTIN_EXTEND_WITH_PROM && arcs_cmdline[0]) { +- if (boot_command_line[0]) +- strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); +- strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE); +- } +-#endif +-#endif ++ bootcmdline_init(cmdline_p); + strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); +- + *cmdline_p = command_line; + + parse_early_param(); diff --git a/target/linux/ath79/patches-5.4/450-fix-block-protection-clearing.patch b/target/linux/ath79/patches-5.4/450-fix-block-protection-clearing.patch index a7ed62302d..dc76161892 100644 --- a/target/linux/ath79/patches-5.4/450-fix-block-protection-clearing.patch +++ b/target/linux/ath79/patches-5.4/450-fix-block-protection-clearing.patch @@ -17,12 +17,12 @@ Signed-off-by: Nick Hainke --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1981,7 +1981,7 @@ static int sr2_bit7_quad_enable(struct s +@@ -1985,7 +1985,7 @@ static int sr2_bit7_quad_enable(struct s static int spi_nor_clear_sr_bp(struct spi_nor *nor) { int ret; - u8 mask = SR_BP2 | SR_BP1 | SR_BP0; + u8 mask = SR_TB | SR_BP2 | SR_BP1 | SR_BP0; - ret = read_sr(nor); - if (ret < 0) { + if (nor->flags & SNOR_F_HAS_4BIT_BP) + mask |= SR_BP3; diff --git a/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch index 16317114dc..923eac92f8 100644 --- a/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch @@ -706,7 +706,7 @@ EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -3971,14 +3971,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -3972,14 +3972,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch b/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch index 754a639853..b2a8279da2 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch @@ -10,7 +10,7 @@ Signed-off-by: Phil Elwell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -252,6 +252,10 @@ static void xhci_pci_quirks(struct devic +@@ -254,6 +254,10 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x3432) xhci->quirks |= XHCI_BROKEN_STREAMS; diff --git a/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch b/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch index 45a03fd81a..e3c7c30389 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch @@ -23,7 +23,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -253,8 +253,10 @@ static void xhci_pci_quirks(struct devic +@@ -255,8 +255,10 @@ static void xhci_pci_quirks(struct devic xhci->quirks |= XHCI_BROKEN_STREAMS; if (pdev->vendor == PCI_VENDOR_ID_VIA && diff --git a/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch b/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch index 18b6260672..0fb5c12ac3 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch @@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell --- a/Makefile +++ b/Makefile -@@ -1264,6 +1264,9 @@ ifneq ($(dtstree),) +@@ -1267,6 +1267,9 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ diff --git a/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch b/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch index 0e35d756ed..a33cfe7142 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch @@ -15,7 +15,7 @@ Signed-off-by: Nataliya Korovkina --- a/Makefile +++ b/Makefile -@@ -1264,7 +1264,7 @@ ifneq ($(dtstree),) +@@ -1267,7 +1267,7 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ diff --git a/target/linux/bcm53xx/config-5.4 b/target/linux/bcm53xx/config-5.4 index 8c7cdf45d5..f0c54bbd8e 100644 --- a/target/linux/bcm53xx/config-5.4 +++ b/target/linux/bcm53xx/config-5.4 @@ -265,8 +265,6 @@ CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NEED_DMA_MAP_STATE=y diff --git a/target/linux/bcm63xx/config-5.4 b/target/linux/bcm63xx/config-5.4 index dd4d67224c..9aec004921 100644 --- a/target/linux/bcm63xx/config-5.4 +++ b/target/linux/bcm63xx/config-5.4 @@ -211,7 +211,6 @@ CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y CONFIG_OF_NET=y CONFIG_PCI=y -# CONFIG_PCIEAER is not set CONFIG_PCIEPORTBUS=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_DRIVERS_LEGACY=y diff --git a/target/linux/bcm63xx/smp/config-default b/target/linux/bcm63xx/smp/config-default index cc43bb2023..127c42e253 100644 --- a/target/linux/bcm63xx/smp/config-default +++ b/target/linux/bcm63xx/smp/config-default @@ -22,8 +22,6 @@ CONFIG_MTD_SPLIT_BCM_WFI_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NET_FLOW_LIMIT=y CONFIG_NR_CPUS=2 diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 8e6746491e..c6e673276e 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -833,7 +833,7 @@ CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y # CONFIG_CIFS_NFSD_EXPORT is not set CONFIG_CIFS_POSIX=y # CONFIG_CIFS_SMB2 is not set -CONFIG_CIFS_STATS=y +# CONFIG_CIFS_STATS is not set # CONFIG_CIFS_STATS2 is not set # CONFIG_CIFS_WEAK_PW_HASH is not set CONFIG_CIFS_XATTR=y @@ -3272,6 +3272,8 @@ CONFIG_MTD_SPLIT_SUPPORT=y # CONFIG_MTD_SWAP is not set # CONFIG_MTD_TESTS is not set # CONFIG_MTD_UBI is not set +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set # CONFIG_MTD_UIMAGE_SPLIT is not set # CONFIG_MTD_VIRT_CONCAT is not set # CONFIG_MTK_MMC is not set @@ -3920,6 +3922,7 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_PCH_PHUB is not set # CONFIG_PCI is not set # CONFIG_PCI200SYN is not set +# CONFIG_PCIEAER is not set # CONFIG_PCIEAER_INJECT is not set # CONFIG_PCIEASPM is not set # CONFIG_PCIEPORTBUS is not set @@ -4121,7 +4124,6 @@ CONFIG_PRINT_STACK_DEPTH=64 CONFIG_PROC_FS=y # CONFIG_PROC_KCORE is not set # CONFIG_PROC_PAGE_MONITOR is not set -CONFIG_PROC_STRIPPED=y CONFIG_PROC_SYSCTL=y # CONFIG_PROC_VMCORE_DEVICE_DUMP is not set # CONFIG_PROFILE_ALL_BRANCHES is not set @@ -5824,6 +5826,8 @@ CONFIG_TTY=y # CONFIG_UBIFS_FS_AUTHENTICATION is not set # CONFIG_UBIFS_FS_ENCRYPTION is not set # CONFIG_UBIFS_FS_SECURITY is not set +# CONFIG_UBIFS_FS_ZLIB is not set +# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_UBIFS_FS_XATTR=y # CONFIG_UBSAN is not set CONFIG_UBSAN_ALIGNMENT=y diff --git a/target/linux/generic/pending-5.4/190-rtc-rs5c372-support_alarms_up_to_1_week.patch b/target/linux/generic/pending-5.4/190-rtc-rs5c372-support_alarms_up_to_1_week.patch new file mode 100644 index 0000000000..83cab4e6d7 --- /dev/null +++ b/target/linux/generic/pending-5.4/190-rtc-rs5c372-support_alarms_up_to_1_week.patch @@ -0,0 +1,96 @@ +From: Daniel González Cabanelas +Subject: [PATCH 1/2] rtc: rs5c372: support alarms up to 1 week + +The Ricoh R2221x, R2223x, RS5C372, RV5C387A chips can handle 1 week +alarms. + +Read the "wday" alarm register and convert it to a date to support up 1 +week in our driver. + +Signed-off-by: Daniel González Cabanelas +--- + drivers/rtc/rtc-rs5c372.c | 48 ++++++++++++++++++++++++++++++++++----- + 1 file changed, 42 insertions(+), 6 deletions(-) + +diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c +index 3bd6eaa0d..94b778c6e 100644 +--- a/drivers/rtc/rtc-rs5c372.c ++++ b/drivers/rtc/rtc-rs5c372.c +@@ -393,7 +393,9 @@ static int rs5c_read_alarm(struct device *dev, struct rtc_wkalrm *t) + { + struct i2c_client *client = to_i2c_client(dev); + struct rs5c372 *rs5c = i2c_get_clientdata(client); +- int status; ++ int status, wday_offs; ++ struct rtc_time rtc; ++ unsigned long alarm_secs; + + status = rs5c_get_regs(rs5c); + if (status < 0) +@@ -403,6 +405,30 @@ static int rs5c_read_alarm(struct device *dev, struct rtc_wkalrm *t) + t->time.tm_sec = 0; + t->time.tm_min = bcd2bin(rs5c->regs[RS5C_REG_ALARM_A_MIN] & 0x7f); + t->time.tm_hour = rs5c_reg2hr(rs5c, rs5c->regs[RS5C_REG_ALARM_A_HOURS]); ++ t->time.tm_wday = ffs(rs5c->regs[RS5C_REG_ALARM_A_WDAY] & 0x7f) - 1; ++ ++ /* determine the day, month and year based on alarm wday, taking as a ++ * reference the current time from the rtc ++ */ ++ status = rs5c372_rtc_read_time(dev, &rtc); ++ if (status < 0) ++ return status; ++ ++ wday_offs = t->time.tm_wday - rtc.tm_wday; ++ alarm_secs = mktime64(rtc.tm_year + 1900, ++ rtc.tm_mon + 1, ++ rtc.tm_mday + wday_offs, ++ t->time.tm_hour, ++ t->time.tm_min, ++ t->time.tm_sec); ++ ++ if (wday_offs < 0 || (wday_offs == 0 && ++ (t->time.tm_hour < rtc.tm_hour || ++ (t->time.tm_hour == rtc.tm_hour && ++ t->time.tm_min <= rtc.tm_min)))) ++ alarm_secs += 7 * 86400; ++ ++ rtc_time64_to_tm(alarm_secs, &t->time); + + /* ... and status */ + t->enabled = !!(rs5c->regs[RS5C_REG_CTRL1] & RS5C_CTRL1_AALE); +@@ -417,12 +443,20 @@ static int rs5c_set_alarm(struct device *dev, struct rtc_wkalrm *t) + struct rs5c372 *rs5c = i2c_get_clientdata(client); + int status, addr, i; + unsigned char buf[3]; ++ struct rtc_time rtc_tm; ++ unsigned long rtc_secs, alarm_secs; + +- /* only handle up to 24 hours in the future, like RTC_ALM_SET */ +- if (t->time.tm_mday != -1 +- || t->time.tm_mon != -1 +- || t->time.tm_year != -1) ++ /* chip only can handle alarms up to one week in the future*/ ++ status = rs5c372_rtc_read_time(dev, &rtc_tm); ++ if (status) ++ return status; ++ rtc_secs = rtc_tm_to_time64(&rtc_tm); ++ alarm_secs = rtc_tm_to_time64(&t->time); ++ if (alarm_secs >= rtc_secs + 7 * 86400) { ++ dev_err(dev, "%s: alarm maximum is one week in the future (%d)\n", ++ __func__, status); + return -EINVAL; ++ } + + /* REVISIT: round up tm_sec */ + +@@ -443,7 +477,9 @@ static int rs5c_set_alarm(struct device *dev, struct rtc_wkalrm *t) + /* set alarm */ + buf[0] = bin2bcd(t->time.tm_min); + buf[1] = rs5c_hr2reg(rs5c, t->time.tm_hour); +- buf[2] = 0x7f; /* any/all days */ ++ /* each bit is the day of the week, 0x7f means all days */ ++ buf[2] = (t->time.tm_wday >= 0 && t->time.tm_wday < 7) ? ++ BIT(t->time.tm_wday) : 0x7f; + + for (i = 0; i < sizeof(buf); i++) { + addr = RS5C_ADDR(RS5C_REG_ALARM_A_MIN + i); diff --git a/target/linux/generic/pending-5.4/191-rtc-rs5c372-let_the_alarm_to_be_used_as_wakeup_source.patch b/target/linux/generic/pending-5.4/191-rtc-rs5c372-let_the_alarm_to_be_used_as_wakeup_source.patch new file mode 100644 index 0000000000..d5c8c23f65 --- /dev/null +++ b/target/linux/generic/pending-5.4/191-rtc-rs5c372-let_the_alarm_to_be_used_as_wakeup_source.patch @@ -0,0 +1,72 @@ +From: Daniel González Cabanelas +Subject: [PATCH 2/2] rtc: rs5c372: let the alarm to be used as wakeup source + +Currently there is no use for the interrupts on the rs5c372 RTC and the +wakealarm isn't enabled. There are some devices like NASes which use this +RTC to wake up from the power off state when the INTR pin is activated by +the alarm clock. + +Enable the alarm and let to be used as a wakeup source. + +Tested on a Buffalo LS421DE NAS. + +Signed-off-by: Daniel González Cabanelas +--- + drivers/rtc/rtc-rs5c372.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c +index 94b778c6e..76775d66e 100644 +--- a/drivers/rtc/rtc-rs5c372.c ++++ b/drivers/rtc/rtc-rs5c372.c +@@ -654,6 +654,7 @@ static int rs5c372_probe(struct i2c_client *client, + int err = 0; + int smbus_mode = 0; + struct rs5c372 *rs5c372; ++ bool rs5c372_can_wakeup_device = false; + + dev_dbg(&client->dev, "%s\n", __func__); + +@@ -689,6 +690,12 @@ static int rs5c372_probe(struct i2c_client *client, + else + rs5c372->type = id->driver_data; + ++#ifdef CONFIG_OF ++ if(of_property_read_bool(client->dev.of_node, ++ "wakeup-source")) ++ rs5c372_can_wakeup_device = true; ++#endif ++ + /* we read registers 0x0f then 0x00-0x0f; skip the first one */ + rs5c372->regs = &rs5c372->buf[1]; + rs5c372->smbus = smbus_mode; +@@ -722,6 +729,8 @@ static int rs5c372_probe(struct i2c_client *client, + goto exit; + } + ++ rs5c372->has_irq = 1; ++ + /* if the oscillator lost power and no other software (like + * the bootloader) set it up, do it here. + * +@@ -748,6 +757,10 @@ static int rs5c372_probe(struct i2c_client *client, + ); + + /* REVISIT use client->irq to register alarm irq ... */ ++ if (rs5c372_can_wakeup_device) { ++ device_init_wakeup(&client->dev, true); ++ } ++ + rs5c372->rtc = devm_rtc_device_register(&client->dev, + rs5c372_driver.driver.name, + &rs5c372_rtc_ops, THIS_MODULE); +@@ -761,6 +774,9 @@ static int rs5c372_probe(struct i2c_client *client, + if (err) + goto exit; + ++ /* the rs5c372 alarm only supports a minute accuracy */ ++ rs5c372->rtc->uie_unsupported = 1; ++ + return 0; + + exit: diff --git a/target/linux/generic/pending-5.4/643-net-bridge-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-5.4/643-net-bridge-support-hardware-flow-table-offload.patch index 4e27452477..d47482dc67 100644 --- a/target/linux/generic/pending-5.4/643-net-bridge-support-hardware-flow-table-offload.patch +++ b/target/linux/generic/pending-5.4/643-net-bridge-support-hardware-flow-table-offload.patch @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau #include #include "br_private.h" -@@ -376,6 +380,28 @@ static const struct ethtool_ops br_ethto +@@ -382,6 +386,28 @@ static const struct ethtool_ops br_ethto .get_link = ethtool_op_get_link, }; @@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops br_netdev_ops = { .ndo_open = br_dev_open, .ndo_stop = br_dev_stop, -@@ -404,6 +430,9 @@ static const struct net_device_ops br_ne +@@ -410,6 +436,9 @@ static const struct net_device_ops br_ne .ndo_bridge_setlink = br_setlink, .ndo_bridge_dellink = br_dellink, .ndo_features_check = passthru_features_check, diff --git a/target/linux/imx6/config-5.4 b/target/linux/imx6/config-5.4 index 26b718e28d..fe380f587b 100644 --- a/target/linux/imx6/config-5.4 +++ b/target/linux/imx6/config-5.4 @@ -353,8 +353,6 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y # CONFIG_MX3_IPU is not set diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 02c03205dc..74f9673809 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -17,7 +17,9 @@ ipq40xx_setup_interfaces() alfa-network,ap120c-ac|\ engenius,emr3500|\ engenius,ens620ext|\ - luma,wrtq-329acn) + luma,wrtq-329acn|\ + plasmacloud,pa1200|\ + plasmacloud,pa2200) ucidef_set_interfaces_lan_wan "eth0" "eth1" ;; aruba,ap-303|\ @@ -84,11 +86,15 @@ ipq40xx_setup_interfaces() ucidef_add_switch "switch0" \ "0u@eth0" "3:lan" "4:lan" ;; + devolo,magic-2-wifi-next) + ucidef_set_interface_lan "eth0 eth1 eth2" + ;; ezviz,cs-w3-wd1200g-eup) ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ "0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "0u@eth1" "5:wan" ;; + glinet,gl-ap1300 |\ glinet,gl-b1300 |\ glinet,gl-s1300) ucidef_set_interfaces_lan_wan "eth0" "eth1" @@ -137,6 +143,10 @@ ipq40xx_setup_macs() cilab,meshpoint-one) label_mac=$(mtd_get_mac_binary "ART" 0x1006) ;; + devolo,magic-2-wifi-next) + lan_mac=$(mtd_get_mac_ascii APPSBLENV MacAddress0) + label_mac=$lan_mac + ;; dlink,dap-2610) lan_mac=$(mtd_get_mac_ascii bdcfg lanmac) label_mac=$lan_mac diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 1ccbea4482..9432505fc7 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -36,7 +36,8 @@ case "$FIRMWARE" in ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x32) ;; engenius,eap2200 |\ - openmesh,a62) + openmesh,a62 |\ + plasmacloud,pa2200) caldata_extract "0:ART" 0x9000 0x2f20 ;; linksys,ea8300 |\ @@ -57,6 +58,7 @@ case "$FIRMWARE" in alfa-network,ap120c-ac |\ cilab,meshpoint-one |\ ezviz,cs-w3-wd1200g-eup |\ + glinet,gl-ap1300 |\ glinet,gl-b1300 |\ glinet,gl-s1300 |\ linksys,ea6350v3 |\ @@ -106,11 +108,17 @@ case "$FIRMWARE" in luma,wrtq-329acn|\ openmesh,a42 |\ openmesh,a62 |\ + plasmacloud,pa1200 |\ + plasmacloud,pa2200 |\ qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2 |\ unielec,u4019-32m) caldata_extract "0:ART" 0x1000 0x2f20 ;; + devolo,magic-2-wifi-next) + caldata_extract "ART" 0x1000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_ascii APPSBLENV WiFiMacAddress0) + ;; dlink,dap-2610) caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac) @@ -156,6 +164,7 @@ case "$FIRMWARE" in alfa-network,ap120c-ac |\ cilab,meshpoint-one |\ ezviz,cs-w3-wd1200g-eup |\ + glinet,gl-ap1300 |\ glinet,gl-b1300 |\ glinet,gl-s1300 |\ linksys,ea6350v3 |\ @@ -205,11 +214,17 @@ case "$FIRMWARE" in luma,wrtq-329acn|\ openmesh,a42 |\ openmesh,a62 |\ + plasmacloud,pa1200 |\ + plasmacloud,pa2200 |\ qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2 |\ unielec,u4019-32m) caldata_extract "0:ART" 0x5000 0x2f20 ;; + devolo,magic-2-wifi-next) + caldata_extract "ART" 0x5000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_ascii APPSBLENV WiFiMacAddress1) + ;; dlink,dap-2610) caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a) diff --git a/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh index 0311922f08..e97133f105 100644 --- a/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh +++ b/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh @@ -13,6 +13,9 @@ set_preinit_iface() { zyxel,nbg6617) ifname=eth0 ;; + devolo,magic-2-wifi-next) + ifname=eth1 + ;; esac } diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh similarity index 93% rename from target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh rename to target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh index 8e02186eb8..81418fe0ba 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh @@ -1,11 +1,11 @@ -# The U-Boot loader of the OpenMesh devices requires image sizes and -# checksums to be provided in the U-Boot environment. -# The OpenMesh devices come with 2 main partitions - while one is active +# The U-Boot loader with the datachk patchset for dualbooting requires image +# sizes and checksums to be provided in the U-Boot environment. +# The devices come with 2 main partitions - while one is active # sysupgrade will flash the other. The boot order is changed to boot the # newly flashed partition. If the new partition can't be booted due to # upgrade failures the previously used partition is loaded. -platform_do_upgrade_openmesh() { +platform_do_upgrade_dualboot_datachk() { local tar_file="$1" local restore_backup local primary_kernel_mtd @@ -44,9 +44,11 @@ platform_do_upgrade_openmesh() { # boot anymore to Linux until it was reflashed with ap51-flash. local next_boot_part="1" case "$(board_name)" in + plasmacloud,pa1200|\ openmesh,a42) primary_kernel_mtd=8 ;; + plasmacloud,pa2200|\ openmesh,a62) primary_kernel_mtd=10 ;; diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index c2da643152..09a1e7568e 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -69,6 +69,7 @@ platform_do_upgrade() { edgecore,ecw5211 |\ edgecore,oap100 |\ engenius,eap2200 |\ + glinet,gl-ap1300 |\ luma,wrtq-329acn |\ mobipromo,cm520-79f |\ qxwlan,e2600ac-c2) @@ -113,9 +114,11 @@ platform_do_upgrade() { nand_do_upgrade "$1" ;; openmesh,a42 |\ - openmesh,a62) + openmesh,a62 |\ + plasmacloud,pa1200 |\ + plasmacloud,pa2200) PART_NAME="inactive" - platform_do_upgrade_openmesh "$1" + platform_do_upgrade_dualboot_datachk "$1" ;; zyxel,nbg6617) zyxel_do_upgrade "$1" diff --git a/target/linux/ipq40xx/config-5.4 b/target/linux/ipq40xx/config-5.4 index b442f73fbc..01c51006d6 100644 --- a/target/linux/ipq40xx/config-5.4 +++ b/target/linux/ipq40xx/config-5.4 @@ -4,22 +4,6 @@ CONFIG_ALIGNMENT_TRAP=y CONFIG_AR40XX_PHY=y CONFIG_ARCH_32BIT_OFF_T=y CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_ARCH_HAS_BINFMT_FLAT=y -CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_ARCH_HAS_FORTIFY_SOURCE=y -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_ARCH_HAS_KCOV=y -CONFIG_ARCH_HAS_KEEPINITRD=y -CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y -CONFIG_ARCH_HAS_PHYS_TO_DMA=y -CONFIG_ARCH_HAS_SETUP_DMA_OPS=y -CONFIG_ARCH_HAS_SET_MEMORY=y -CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y -CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y -CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y -CONFIG_ARCH_HAS_TICK_BROADCAST=y -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_IPQ40XX=y CONFIG_ARCH_KEEP_MEMBLOCK=y @@ -35,15 +19,7 @@ CONFIG_ARCH_NR_GPIO=0 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y CONFIG_ARCH_QCOM=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y -CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_ARM=y CONFIG_ARM_AMBA=y CONFIG_ARM_APPENDED_DTB=y @@ -73,7 +49,6 @@ CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y # CONFIG_CACHE_L2X0 is not set -CONFIG_CC_HAS_KASAN_GENERIC=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y @@ -214,48 +189,7 @@ CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_PFN_VALID=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_ARM_ARCH_TIMER=y -CONFIG_HAVE_ARM_SMCCC=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_COPY_THREAD_TLS=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_DEBUG_KMEMLEAK=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y -CONFIG_HAVE_EBPF_JIT=y -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_IDE=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_OPTPROBES=y -CONFIG_HAVE_PCI=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_RSEQ=y CONFIG_HAVE_SMP=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_UID16=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HIGHMEM=y # CONFIG_HIGHPTE is not set CONFIG_HWSPINLOCK=y @@ -299,7 +233,7 @@ CONFIG_MDIO_BITBANG=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MDIO_GPIO=y -CONFIG_MDIO_IPQ40XX=y +CONFIG_MDIO_IPQ4019=y # CONFIG_MDM_GCC_9615 is not set # CONFIG_MDM_LCC_9615 is not set CONFIG_MEMFD_CREATE=y @@ -342,8 +276,6 @@ CONFIG_MTD_SPLIT_WRGG_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NEED_DMA_MAP_STATE=y @@ -421,6 +353,7 @@ CONFIG_POWER_SUPPLY=y CONFIG_PPS=y CONFIG_PRINTK_TIME=y CONFIG_PTP_1588_CLOCK=y +CONFIG_QCA807X_PHY=y CONFIG_QCOM_A53PLL=y CONFIG_QCOM_BAM_DMA=y # CONFIG_QCOM_COMMAND_DB is not set diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts index 28d27d9959..c35ce5ccc4 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts @@ -37,7 +37,7 @@ wan { label = "amber:wan"; - gpios = <&qca8075 19 GPIO_ACTIVE_HIGH>; + gpios = <ðphy4 1 GPIO_ACTIVE_HIGH>; }; wlan2g { @@ -119,14 +119,11 @@ status = "okay"; }; - qca8075: ess-switch@c000000 { + ess-switch@c000000 { status = "okay"; switch_lan_bmp = <0x10>; switch_wan_bmp = <0x20>; - - #gpio-cells = <2>; - gpio-controller; }; edma@c080000 { @@ -264,6 +261,11 @@ status = "okay"; }; +ðphy4 { + gpio-controller; + #gpio-cells = <2>; +}; + &gmac0 { qcom,forced_duplex = <1>; qcom,forced_speed = <1000>; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts index fb1762cc05..77b1810f09 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts @@ -70,18 +70,8 @@ status = "okay"; }; - qca8075: ess-switch@c000000 { + ess-switch@c000000 { status = "okay"; - - #gpio-cells = <2>; - gpio-controller; - - enable-usb-power { - gpio-hog; - line-name = "enable USB3 power"; - gpios = <7 GPIO_ACTIVE_HIGH>; - output-high; - }; }; edma@c080000 { @@ -110,33 +100,33 @@ wlan { label = "green:wlan"; - gpios = <&qca8075 1 GPIO_ACTIVE_HIGH>; + gpios = <ðphy0 0 GPIO_ACTIVE_HIGH>; }; panic: info_red { label = "red:info"; - gpios = <&qca8075 3 GPIO_ACTIVE_HIGH>; + gpios = <ðphy0 1 GPIO_ACTIVE_HIGH>; panic-indicator; }; wan { label = "green:wan"; - gpios = <&qca8075 5 GPIO_ACTIVE_HIGH>; + gpios = <ðphy1 0 GPIO_ACTIVE_HIGH>; }; power: power { label = "green:power"; - gpios = <&qca8075 11 GPIO_ACTIVE_HIGH>; + gpios = <ðphy2 1 GPIO_ACTIVE_HIGH>; }; lan { label = "green:lan"; - gpios = <&qca8075 13 GPIO_ACTIVE_HIGH>; + gpios = <ðphy3 0 GPIO_ACTIVE_HIGH>; }; flash: info_amber { label = "amber:info"; - gpios = <&qca8075 15 GPIO_ACTIVE_HIGH>; + gpios = <ðphy3 1 GPIO_ACTIVE_HIGH>; }; }; }; @@ -269,6 +259,33 @@ status = "okay"; }; +ðphy0 { + gpio-controller; + #gpio-cells = <2>; +}; + +ðphy1 { + gpio-controller; + #gpio-cells = <2>; + + enable-usb-power { + gpio-hog; + line-name = "enable USB3 power"; + gpios = <1 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +ðphy2 { + gpio-controller; + #gpio-cells = <2>; +}; + +ðphy3 { + gpio-controller; + #gpio-cells = <2>; +}; + &usb3_ss_phy { status = "okay"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts new file mode 100644 index 0000000000..3fd5406d39 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts @@ -0,0 +1,269 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "GL.iNet GL-AP1300"; + compatible = "glinet,gl-ap1300"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + chosen { + bootargs-append = " ubi.mtd=ubi root=/dev/ubiblock0_1 clk_ignore_unused"; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + switch_lan_bmp = <0x18>; + switch_wan_bmp = <0x20>; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + wan { + label = "green:wan"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, <&tlmm 5 GPIO_ACTIVE_HIGH>; + + flash@0 { + status = "okay"; + + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + + partition@40000 { + label = "MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + + partition@60000 { + label = "QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + + partition@c0000 { + label = "CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + + partition@d0000 { + label = "DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + + partition@e0000 { + label = "APPSBLENV"; /* uboot env*/ + reg = <0x000e0000 0x00010000>; + }; + + partition@f0000 { + label = "APPSBL"; /* uboot */ + reg = <0x000f0000 0x00080000>; + read-only; + }; + + partition@170000 { + label = "ART"; + reg = <0x00170000 0x00010000>; + read-only; + }; + }; + }; + + spi-nand@1 { + status = "okay"; + + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x00000000 0x08000000>; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi0_pins: spi0_pinmux { + mux_spi { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + mux_cs { + function = "gpio"; + pins = "gpio54", "gpio5"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "GL-AP1300"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "GL-AP1300"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-magic-2-wifi-next.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-magic-2-wifi-next.dts new file mode 100644 index 0000000000..2709aef502 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-magic-2-wifi-next.dts @@ -0,0 +1,268 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include + +/ { + model = "devolo Magic 2 WiFi next"; + compatible = "devolo,magic-2-wifi-next"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 59 GPIO_ACTIVE_LOW>; + reset-delay-us = <2000>; + + /delete-node/ ethernet-phy@0; + /delete-node/ ethernet-phy@1; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + switch_lan_bmp = <0x3e>; + switch_wan_bmp = <0x0>; + }; + + edma@c080000 { + status = "okay"; + qcom,num_gmac = <3>; + + gmac0 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + /delete-property/ qcom,forced_speed; + /delete-property/ qcom,forced_duplex; + vlan_tag = <1 0x10>; + }; + + gmac1 { + qcom,phy_mdio_addr = <2>; + qcom,poll_required = <1>; + /delete-property/ qcom,forced_speed; + /delete-property/ qcom,forced_duplex; + vlan_tag = <1 0x08>; + }; + + gmac2 { + local-mac-address = [00 00 00 00 00 00]; + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + /delete-property/ qcom,forced_speed; + /delete-property/ qcom,forced_duplex; + vlan_tag = <1 0x20>; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + plc { + gpio-export,name = "plc-enable"; + gpio-export,output = <1>; + gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; + }; + }; + + }; + + keys { + compatible = "gpio-keys"; + + wlan { + label = "WLAN"; + gpios = <&tlmm 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "Reset"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + status_dlan { + label = "white:dlan"; + gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + status_wlan { + label = "white:wlan"; + gpios = <&tlmm 58 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + error_dlan { + label = "red:dlan"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + }; + }; +}; + +&tlmm { + spi_0_pins: spi_0_pinmux { + mux { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + mux_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio53"; + function = "mdio"; + bias-pull-up; + }; + mux_2 { + pins = "gpio52"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio61", "gpio60"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + button_pins: button_pinmux { + mux { + function = "gpio"; + pins = "gpio0", "gpio5"; + bias-disable; + input; + }; + }; +}; + +&cryptobam { + status = "okay"; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "devolo,magic-2-wifi-next"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "devolo,magic-2-wifi-next"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + linux,modalias = "n25q128a11"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + partition@40000 { + label = "MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + partition@60000 { + label = "QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + partition@c0000 { + label = "CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + partition@d0000 { + label = "DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + partition@e0000 { + label = "APPSBLENV"; /* uboot env*/ + reg = <0x000e0000 0x00010000>; + }; + partition@f0000 { + label = "APPSBL"; /* uboot */ + reg = <0x000f0000 0x00080000>; + read-only; + }; + partition@170000 { + label = "ART"; + reg = <0x00170000 0x00010000>; + read-only; + }; + firmware@180000 { + compatible = "denx,fit"; + label = "firmware"; + reg = <0x00180000 0x01a80000>; + }; + }; + }; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts new file mode 100644 index 0000000000..bcb9552ce7 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts @@ -0,0 +1,197 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2017-2020, Sven Eckelmann + * Copyright (c) 2018, Marek Lindner + */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Plasma Cloud PA1200"; + compatible = "plasmacloud,pa1200"; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2: usb2@60f8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 59 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + aliases { + led-boot = &led_status_purple; + led-failsafe = &led_status_yellow; + led-running = &led_status_cyan; + led-upgrade = &led_status_yellow; + }; + + leds { + compatible = "gpio-leds"; + + led_status_cyan: status_cyan { + label = "cyan:status"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + }; + + led_status_purple: status_purple { + label = "purple:status"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + led_status_yellow: status_yellow { + label = "yellow:status"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + }; + +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + /* partitions are passed via bootloader */ + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <2 0x20>; +}; + +&gmac1 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x10>; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA1200"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA1200"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts new file mode 100644 index 0000000000..2d0655114b --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts @@ -0,0 +1,210 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2017-2020, Sven Eckelmann + * Copyright (c) 2018, Marek Lindner + */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Plasma Cloud PA2200"; + compatible = "plasmacloud,pa2200"; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + switch_lan_bmp = <0x10>; + switch_wan_bmp = <0x20>; + + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + aliases { + led-boot = &led_power_orange; + led-failsafe = &led_status_blue; + led-running = &led_power_orange; + led-upgrade = &led_status_blue; + }; + + leds { + compatible = "gpio-leds"; + + led_power_orange: power_orange { + label = "orange:power"; + gpios = <&tlmm 43 GPIO_ACTIVE_LOW>; + }; + + 2g_blue { + label = "blue:2g"; + gpios = <&tlmm 46 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + 2g_green { + label = "green:5g1"; + gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + 5g2_green { + label = "green:5g2"; + gpios = <&tlmm 48 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy2tpt"; + }; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + /* partitions are passed via bootloader */ + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x10>; +}; + +&pcie0 { + status = "okay"; + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi2: wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; + ieee80211-freq-limit = <5170000 5350000>; + }; + }; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; + ieee80211-freq-limit = <5470000 5875000>; +}; diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c index 5f2630ae50..80db1f0acb 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c @@ -1310,7 +1310,7 @@ void edma_adjust_link(struct net_device *netdev) status = edma_check_link(adapter); if (status == __EDMA_LINKUP && adapter->link_state == __EDMA_LINKDOWN) { - dev_info(&adapter->pdev->dev, "%s: GMAC Link is up with phy_speed=%d\n", netdev->name, phydev->speed); + phy_print_status(phydev); adapter->link_state = __EDMA_LINKUP; if (adapter->edma_cinfo->is_single_phy) { ess_set_port_status_speed(adapter->edma_cinfo, phydev, @@ -1320,7 +1320,7 @@ void edma_adjust_link(struct net_device *netdev) if (netif_running(netdev)) netif_tx_wake_all_queues(netdev); } else if (status == __EDMA_LINKDOWN && adapter->link_state == __EDMA_LINKUP) { - dev_info(&adapter->pdev->dev, "%s: GMAC Link is down\n", netdev->name); + phy_print_status(phydev); adapter->link_state = __EDMA_LINKDOWN; netif_carrier_off(netdev); netif_tx_stop_all_queues(netdev); @@ -2023,6 +2023,10 @@ int edma_open(struct net_device *netdev) */ if (adapter->poll_required) { if (!IS_ERR(adapter->phydev)) { + /* AR40xx calibration will leave the PHY in unwanted state, + * so a soft reset is required before phy_start() + */ + genphy_soft_reset(adapter->phydev); phy_start(adapter->phydev); phy_start_aneg(adapter->phydev); adapter->link_state = __EDMA_LINKDOWN; diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c index 68718de9f4..af55ee4dd5 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -713,9 +714,7 @@ static int edma_axi_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct device_node *pnp; struct device_node *mdio_node = NULL; - struct platform_device *mdio_plat = NULL; struct mii_bus *miibus = NULL; - struct edma_mdio_data *mdio_data = NULL; int i, j, k, err = 0; int portid_bmp; int idx = 0, idx_mac = 0; @@ -889,25 +888,9 @@ static int edma_axi_probe(struct platform_device *pdev) goto err_mdiobus_init_fail; } - mdio_plat = of_find_device_by_node(mdio_node); - if (!mdio_plat) { - dev_err(&pdev->dev, - "cannot find platform device from mdio node"); - of_node_put(mdio_node); - err = -EIO; - goto err_mdiobus_init_fail; - } - - mdio_data = dev_get_drvdata(&mdio_plat->dev); - if (!mdio_data) { - dev_err(&pdev->dev, - "cannot get mii bus reference from device data"); - of_node_put(mdio_node); - err = -EIO; - goto err_mdiobus_init_fail; - } - - miibus = mdio_data->mii_bus; + miibus = of_mdio_find_bus(mdio_node); + if (!miibus) + return -EINVAL; } if (of_property_read_bool(np, "qcom,single-phy") && diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c index 1270e20a90..ac5cb50961 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c @@ -186,55 +186,15 @@ static int edma_get_settings(struct net_device *netdev, struct edma_adapter *adapter = netdev_priv(netdev); if (adapter->poll_required) { - struct phy_device *phydev = NULL; - uint16_t phyreg; - if ((adapter->forced_speed != SPEED_UNKNOWN) && !(adapter->poll_required)) return -EPERM; - phydev = adapter->phydev; - - linkmode_copy(cmd->link_modes.advertising, phydev->advertising); - linkmode_copy(cmd->link_modes.supported, phydev->supported); - - cmd->base.autoneg = phydev->autoneg; - - if (adapter->link_state == __EDMA_LINKDOWN) { - cmd->base.speed = SPEED_UNKNOWN; - cmd->base.duplex = DUPLEX_UNKNOWN; - } else { - cmd->base.speed = phydev->speed; - cmd->base.duplex = phydev->duplex; - } - - cmd->base.phy_address = adapter->phy_mdio_addr; - - phyreg = (uint16_t)phy_read(adapter->phydev, MII_LPA); - if (phyreg & LPA_10HALF) - linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, - cmd->link_modes.lp_advertising); - - if (phyreg & LPA_10FULL) - linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, - cmd->link_modes.lp_advertising); - - if (phyreg & LPA_100HALF) - linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, - cmd->link_modes.lp_advertising); - - if (phyreg & LPA_100FULL) - linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, - cmd->link_modes.lp_advertising); - - phyreg = (uint16_t)phy_read(adapter->phydev, MII_STAT1000); - if (phyreg & LPA_1000HALF) - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, - cmd->link_modes.lp_advertising); - - if (phyreg & LPA_1000FULL) - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, - cmd->link_modes.lp_advertising); + phy_ethtool_ksettings_get(adapter->phydev, cmd); + if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, adapter->phydev->advertising)) + cmd->base.port = PORT_FIBRE; + else + cmd->base.port = PORT_TP; } else { /* If the speed/duplex for this GMAC is forced and we * are not polling for link state changes, return the @@ -272,22 +232,12 @@ static int edma_set_settings(struct net_device *netdev, const struct ethtool_link_ksettings *cmd) { struct edma_adapter *adapter = netdev_priv(netdev); - struct phy_device *phydev = NULL; if ((adapter->forced_speed != SPEED_UNKNOWN) && !adapter->poll_required) return -EPERM; - phydev = adapter->phydev; - linkmode_copy(phydev->advertising, cmd->link_modes.advertising); - linkmode_copy(phydev->supported, cmd->link_modes.supported); - phydev->autoneg = cmd->base.autoneg; - phydev->speed = cmd->base.speed; - phydev->duplex = cmd->base.duplex; - - genphy_config_aneg(phydev); - - return 0; + return phy_ethtool_ksettings_set(adapter->phydev, cmd); } /* edma_get_coalesce diff --git a/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.c b/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.c index 084a8d9116..a25820f20d 100644 --- a/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.c +++ b/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -1277,42 +1278,6 @@ ar40xx_init_globals(struct ar40xx_priv *priv) ar40xx_write(priv, AR40XX_REG_PORT_FLOWCTRL_THRESH(0), t); } -static void -ar40xx_malibu_init(struct ar40xx_priv *priv) -{ - int i; - struct mii_bus *bus; - u16 val; - - bus = priv->mii_bus; - - /* war to enable AZ transmitting ability */ - ar40xx_phy_mmd_write(priv, AR40XX_PSGMII_ID, 1, - AR40XX_MALIBU_PSGMII_MODE_CTRL, - AR40XX_MALIBU_PHY_PSGMII_MODE_CTRL_ADJUST_VAL); - for (i = 0; i < AR40XX_NUM_PORTS - 1; i++) { - /* change malibu control_dac */ - val = ar40xx_phy_mmd_read(priv, i, 7, - AR40XX_MALIBU_PHY_MMD7_DAC_CTRL); - val &= ~AR40XX_MALIBU_DAC_CTRL_MASK; - val |= AR40XX_MALIBU_DAC_CTRL_VALUE; - ar40xx_phy_mmd_write(priv, i, 7, - AR40XX_MALIBU_PHY_MMD7_DAC_CTRL, val); - if (i == AR40XX_MALIBU_PHY_LAST_ADDR) { - /* to avoid goes into hibernation */ - val = ar40xx_phy_mmd_read(priv, i, 3, - AR40XX_MALIBU_PHY_RLP_CTRL); - val &= (~(1<<1)); - ar40xx_phy_mmd_write(priv, i, 3, - AR40XX_MALIBU_PHY_RLP_CTRL, val); - } - } - - /* adjust psgmii serdes tx amp */ - mdiobus_write(bus, AR40XX_PSGMII_ID, AR40XX_PSGMII_TX_DRIVER_1_CTRL, - AR40XX_MALIBU_PHY_PSGMII_REDUCE_SERDES_TX_AMP); -} - static int ar40xx_hw_init(struct ar40xx_priv *priv) { @@ -1320,9 +1285,7 @@ ar40xx_hw_init(struct ar40xx_priv *priv) ar40xx_ess_reset(priv); - if (priv->mii_bus) - ar40xx_malibu_init(priv); - else + if (!priv->mii_bus) return -1; ar40xx_psgmii_self_test(priv); @@ -1796,183 +1759,13 @@ static const struct switch_dev_ops ar40xx_sw_ops = { .get_port_stats = ar40xx_sw_get_port_stats, }; -/* Start of phy driver support */ - -static const u32 ar40xx_phy_ids[] = { - 0x004dd0b1, - 0x004dd0b2, /* AR40xx */ -}; - -static bool -ar40xx_phy_match(u32 phy_id) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(ar40xx_phy_ids); i++) - if (phy_id == ar40xx_phy_ids[i]) - return true; - - return false; -} - -static bool -is_ar40xx_phy(struct mii_bus *bus) -{ - unsigned i; - - for (i = 0; i < 4; i++) { - u32 phy_id; - - phy_id = mdiobus_read(bus, i, MII_PHYSID1) << 16; - phy_id |= mdiobus_read(bus, i, MII_PHYSID2); - if (!ar40xx_phy_match(phy_id)) - return false; - } - - return true; -} - -static int -ar40xx_phy_probe(struct phy_device *phydev) -{ - if (!is_ar40xx_phy(phydev->mdio.bus)) - return -ENODEV; - - ar40xx_priv->mii_bus = phydev->mdio.bus; - phydev->priv = ar40xx_priv; - if (phydev->mdio.addr == 0) - ar40xx_priv->phy = phydev; - - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->supported); - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->advertising); - return 0; -} - -static void -ar40xx_phy_remove(struct phy_device *phydev) -{ - ar40xx_priv->mii_bus = NULL; - phydev->priv = NULL; -} - -static int -ar40xx_phy_config_init(struct phy_device *phydev) -{ - return 0; -} - -static int -ar40xx_phy_read_status(struct phy_device *phydev) -{ - if (phydev->mdio.addr != 0) - return genphy_read_status(phydev); - - return 0; -} - -static int -ar40xx_phy_config_aneg(struct phy_device *phydev) -{ - if (phydev->mdio.addr == 0) - return 0; - - return genphy_config_aneg(phydev); -} - -static struct phy_driver ar40xx_phy_driver = { - .phy_id = 0x004d0000, - .name = "QCA Malibu", - .phy_id_mask = 0xffff0000, - .features = PHY_GBIT_FEATURES, - .probe = ar40xx_phy_probe, - .remove = ar40xx_phy_remove, - .config_init = ar40xx_phy_config_init, - .config_aneg = ar40xx_phy_config_aneg, - .read_status = ar40xx_phy_read_status, -}; - -static uint16_t ar40xx_gpio_get_phy(unsigned int offset) -{ - return offset / 4; -} - -static uint16_t ar40xx_gpio_get_reg(unsigned int offset) -{ - return 0x8074 + offset % 4; -} - -static void ar40xx_gpio_set(struct gpio_chip *gc, unsigned int offset, - int value) -{ - struct ar40xx_priv *priv = gpiochip_get_data(gc); - - ar40xx_phy_mmd_write(priv, ar40xx_gpio_get_phy(offset), 0x7, - ar40xx_gpio_get_reg(offset), - value ? 0xA000 : 0x8000); -} - -static int ar40xx_gpio_get(struct gpio_chip *gc, unsigned offset) -{ - struct ar40xx_priv *priv = gpiochip_get_data(gc); - - return ar40xx_phy_mmd_read(priv, ar40xx_gpio_get_phy(offset), 0x7, - ar40xx_gpio_get_reg(offset)) == 0xA000; -} - -static int ar40xx_gpio_get_dir(struct gpio_chip *gc, unsigned offset) -{ - return 0; /* only out direction */ -} - -static int ar40xx_gpio_dir_out(struct gpio_chip *gc, unsigned offset, - int value) -{ - /* - * the direction out value is used to set the initial value. - * support of this function is required by leds-gpio.c - */ - ar40xx_gpio_set(gc, offset, value); - return 0; -} - -static void ar40xx_register_gpio(struct device *pdev, - struct ar40xx_priv *priv, - struct device_node *switch_node) -{ - struct gpio_chip *gc; - int err; - - gc = devm_kzalloc(pdev, sizeof(*gc), GFP_KERNEL); - if (!gc) - return; - - gc->label = "ar40xx_gpio", - gc->base = -1, - gc->ngpio = 5 /* mmd 0 - 4 */ * 4 /* 0x8074 - 0x8077 */, - gc->parent = pdev; - gc->owner = THIS_MODULE; - - gc->get_direction = ar40xx_gpio_get_dir; - gc->direction_output = ar40xx_gpio_dir_out; - gc->get = ar40xx_gpio_get; - gc->set = ar40xx_gpio_set; - gc->can_sleep = true; - gc->label = priv->dev.name; - gc->of_node = switch_node; - - err = devm_gpiochip_add_data(pdev, gc, priv); - if (err != 0) - dev_err(pdev, "Failed to register gpio %d.\n", err); -} - -/* End of phy driver support */ - /* Platform driver probe function */ static int ar40xx_probe(struct platform_device *pdev) { struct device_node *switch_node; struct device_node *psgmii_node; + struct device_node *mdio_node; const __be32 *mac_mode; struct clk *ess_clk; struct switch_dev *swdev; @@ -2043,12 +1836,6 @@ static int ar40xx_probe(struct platform_device *pdev) return -EIO; } - ret = phy_driver_register(&ar40xx_phy_driver, THIS_MODULE); - if (ret) { - dev_err(&pdev->dev, "Failed to register ar40xx phy driver!\n"); - return -EIO; - } - mutex_init(&priv->reg_mutex); mutex_init(&priv->mib_lock); INIT_DELAYED_WORK(&priv->mib_work, ar40xx_mib_work_func); @@ -2056,6 +1843,15 @@ static int ar40xx_probe(struct platform_device *pdev) /* register switch */ swdev = &priv->dev; + mdio_node = of_find_compatible_node(NULL, NULL, "qcom,ipq4019-mdio"); + if (!mdio_node) { + dev_err(&pdev->dev, "Probe failed - Cannot find mdio node by phandle!\n"); + ret = -ENODEV; + goto err_missing_phy; + } + + priv->mii_bus = of_mdio_find_bus(mdio_node); + if (priv->mii_bus == NULL) { dev_err(&pdev->dev, "Probe failed - Missing PHYs!\n"); ret = -ENODEV; @@ -2070,8 +1866,10 @@ static int ar40xx_probe(struct platform_device *pdev) swdev->ports = AR40XX_NUM_PORTS; swdev->ops = &ar40xx_sw_ops; ret = register_switch(swdev, NULL); - if (ret) - goto err_unregister_phy; + if (ret < 0) { + dev_err(&pdev->dev, "Switch registration failed!\n"); + return ret; + } num_mibs = ARRAY_SIZE(ar40xx_mibs); len = priv->dev.ports * num_mibs * @@ -2084,15 +1882,10 @@ static int ar40xx_probe(struct platform_device *pdev) ar40xx_start(priv); - if (of_property_read_bool(switch_node, "gpio-controller")) - ar40xx_register_gpio(&pdev->dev, ar40xx_priv, switch_node); - return 0; err_unregister_switch: unregister_switch(&priv->dev); -err_unregister_phy: - phy_driver_unregister(&ar40xx_phy_driver); err_missing_phy: platform_set_drvdata(pdev, NULL); return ret; @@ -2107,8 +1900,6 @@ static int ar40xx_remove(struct platform_device *pdev) unregister_switch(&priv->dev); - phy_driver_unregister(&ar40xx_phy_driver); - return 0; } diff --git a/target/linux/ipq40xx/files/drivers/net/phy/qca807x.c b/target/linux/ipq40xx/files/drivers/net/phy/qca807x.c new file mode 100644 index 0000000000..10d38d94a6 --- /dev/null +++ b/target/linux/ipq40xx/files/drivers/net/phy/qca807x.c @@ -0,0 +1,828 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2020 Sartura Ltd. + * + * Author: Robert Marko + * + * Qualcomm QCA8072 and QCA8075 PHY driver + */ + +#include +#include +#include +#include +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) +#include +#endif +#include +#include + +#include + +#define PHY_ID_QCA8072 0x004dd0b2 +#define PHY_ID_QCA8075 0x004dd0b1 +#define PHY_ID_QCA807X_PSGMII 0x06820805 + +/* Downshift */ +#define QCA807X_SMARTSPEED_EN BIT(5) +#define QCA807X_SMARTSPEED_RETRY_LIMIT_MASK GENMASK(4, 2) +#define QCA807X_SMARTSPEED_RETRY_LIMIT_DEFAULT 5 +#define QCA807X_SMARTSPEED_RETRY_LIMIT_MIN 2 +#define QCA807X_SMARTSPEED_RETRY_LIMIT_MAX 9 + +/* Cable diagnostic test (CDT) */ +#define QCA807X_CDT 0x16 +#define QCA807X_CDT_ENABLE BIT(15) +#define QCA807X_CDT_ENABLE_INTER_PAIR_SHORT BIT(13) +#define QCA807X_CDT_STATUS BIT(11) +#define QCA807X_CDT_MMD3_STATUS 0x8064 +#define QCA807X_CDT_MDI0_STATUS_MASK GENMASK(15, 12) +#define QCA807X_CDT_MDI1_STATUS_MASK GENMASK(11, 8) +#define QCA807X_CDT_MDI2_STATUS_MASK GENMASK(7, 4) +#define QCA807X_CDT_MDI3_STATUS_MASK GENMASK(3, 0) +#define QCA807X_CDT_RESULTS_INVALID 0x0 +#define QCA807X_CDT_RESULTS_OK 0x1 +#define QCA807X_CDT_RESULTS_OPEN 0x2 +#define QCA807X_CDT_RESULTS_SAME_SHORT 0x3 +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OK 0x4 +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OK 0x8 +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OK 0xc +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OPEN 0x6 +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OPEN 0xa +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OPEN 0xe +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_SHORT 0x7 +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_SHORT 0xb +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_SHORT 0xf +#define QCA807X_CDT_RESULTS_BUSY 0x9 +#define QCA807X_CDT_MMD3_MDI0_LENGTH 0x8065 +#define QCA807X_CDT_MMD3_MDI1_LENGTH 0x8066 +#define QCA807X_CDT_MMD3_MDI2_LENGTH 0x8067 +#define QCA807X_CDT_MMD3_MDI3_LENGTH 0x8068 +#define QCA807X_CDT_SAME_SHORT_LENGTH_MASK GENMASK(15, 8) +#define QCA807X_CDT_CROSS_SHORT_LENGTH_MASK GENMASK(7, 0) + +#define QCA807X_CHIP_CONFIGURATION 0x1f +#define QCA807X_BT_BX_REG_SEL BIT(15) +#define QCA807X_CHIP_CONFIGURATION_MODE_CFG_MASK GENMASK(3, 0) +#define QCA807X_CHIP_CONFIGURATION_MODE_QSGMII_SGMII 4 +#define QCA807X_CHIP_CONFIGURATION_MODE_PSGMII_FIBER 3 +#define QCA807X_CHIP_CONFIGURATION_MODE_PSGMII_ALL_COPPER 0 + +#define QCA807X_MEDIA_SELECT_STATUS 0x1a +#define QCA807X_MEDIA_DETECTED_COPPER BIT(5) +#define QCA807X_MEDIA_DETECTED_1000_BASE_X BIT(4) +#define QCA807X_MEDIA_DETECTED_100_BASE_FX BIT(3) + +#define QCA807X_MMD7_FIBER_MODE_AUTO_DETECTION 0x807e +#define QCA807X_MMD7_FIBER_MODE_AUTO_DETECTION_EN BIT(0) + +#define QCA807X_MMD7_1000BASE_T_POWER_SAVE_PER_CABLE_LENGTH 0x801a +#define QCA807X_CONTROL_DAC_MASK GENMASK(2, 0) + +#define QCA807X_MMD7_LED_100N_1 0x8074 +#define QCA807X_MMD7_LED_100N_2 0x8075 +#define QCA807X_MMD7_LED_1000N_1 0x8076 +#define QCA807X_MMD7_LED_1000N_2 0x8077 +#define QCA807X_LED_TXACT_BLK_EN_2 BIT(10) +#define QCA807X_LED_RXACT_BLK_EN_2 BIT(9) +#define QCA807X_LED_GT_ON_EN_2 BIT(6) +#define QCA807X_LED_HT_ON_EN_2 BIT(5) +#define QCA807X_LED_BT_ON_EN_2 BIT(4) +#define QCA807X_GPIO_FORCE_EN BIT(15) +#define QCA807X_GPIO_FORCE_MODE_MASK GENMASK(14, 13) + +#define QCA807X_INTR_ENABLE 0x12 +#define QCA807X_INTR_STATUS 0x13 +#define QCA807X_INTR_ENABLE_AUTONEG_ERR BIT(15) +#define QCA807X_INTR_ENABLE_SPEED_CHANGED BIT(14) +#define QCA807X_INTR_ENABLE_DUPLEX_CHANGED BIT(13) +#define QCA807X_INTR_ENABLE_LINK_FAIL BIT(11) +#define QCA807X_INTR_ENABLE_LINK_SUCCESS BIT(10) + +#define QCA807X_FUNCTION_CONTROL 0x10 +#define QCA807X_FC_MDI_CROSSOVER_MODE_MASK GENMASK(6, 5) +#define QCA807X_FC_MDI_CROSSOVER_AUTO 3 +#define QCA807X_FC_MDI_CROSSOVER_MANUAL_MDIX 1 +#define QCA807X_FC_MDI_CROSSOVER_MANUAL_MDI 0 + +#define QCA807X_PHY_SPECIFIC_STATUS 0x11 +#define QCA807X_SS_SPEED_AND_DUPLEX_RESOLVED BIT(11) +#define QCA807X_SS_SPEED_MASK GENMASK(15, 14) +#define QCA807X_SS_SPEED_1000 2 +#define QCA807X_SS_SPEED_100 1 +#define QCA807X_SS_SPEED_10 0 +#define QCA807X_SS_DUPLEX BIT(13) +#define QCA807X_SS_MDIX BIT(6) + +/* PSGMII PHY specific */ +#define PSGMII_QSGMII_DRIVE_CONTROL_1 0xb +#define PSGMII_QSGMII_TX_DRIVER_MASK GENMASK(7, 4) +#define PSGMII_MODE_CTRL 0x6d +#define PSGMII_MODE_CTRL_AZ_WORKAROUND_MASK GENMASK(3, 0) +#define PSGMII_MMD3_SERDES_CONTROL 0x805a + +struct qca807x_gpio_priv { + struct phy_device *phy; +}; + +static int qca807x_get_downshift(struct phy_device *phydev, u8 *data) +{ + int val, cnt, enable; + + val = phy_read(phydev, MII_NWAYTEST); + if (val < 0) + return val; + + enable = FIELD_GET(QCA807X_SMARTSPEED_EN, val); + cnt = FIELD_GET(QCA807X_SMARTSPEED_RETRY_LIMIT_MASK, val) + 2; + + *data = enable ? cnt : DOWNSHIFT_DEV_DISABLE; + + return 0; +} + +static int qca807x_set_downshift(struct phy_device *phydev, u8 cnt) +{ + int ret, val; + + if (cnt > QCA807X_SMARTSPEED_RETRY_LIMIT_MAX || + (cnt < QCA807X_SMARTSPEED_RETRY_LIMIT_MIN && cnt != DOWNSHIFT_DEV_DISABLE)) + return -EINVAL; + + if (!cnt) { + ret = phy_clear_bits(phydev, MII_NWAYTEST, QCA807X_SMARTSPEED_EN); + } else { + val = QCA807X_SMARTSPEED_EN; + val |= FIELD_PREP(QCA807X_SMARTSPEED_RETRY_LIMIT_MASK, cnt - 2); + + phy_modify(phydev, MII_NWAYTEST, + QCA807X_SMARTSPEED_EN | + QCA807X_SMARTSPEED_RETRY_LIMIT_MASK, + val); + } + + ret = genphy_soft_reset(phydev); + + return ret; +} + +static int qca807x_get_tunable(struct phy_device *phydev, + struct ethtool_tunable *tuna, void *data) +{ + switch (tuna->id) { + case ETHTOOL_PHY_DOWNSHIFT: + return qca807x_get_downshift(phydev, data); + default: + return -EOPNOTSUPP; + } +} + +static int qca807x_set_tunable(struct phy_device *phydev, + struct ethtool_tunable *tuna, const void *data) +{ + switch (tuna->id) { + case ETHTOOL_PHY_DOWNSHIFT: + return qca807x_set_downshift(phydev, *(const u8 *)data); + default: + return -EOPNOTSUPP; + } +} + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) +static bool qca807x_distance_valid(int result) +{ + switch (result) { + case QCA807X_CDT_RESULTS_OPEN: + case QCA807X_CDT_RESULTS_SAME_SHORT: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_SHORT: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_SHORT: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_SHORT: + return true; + } + return false; +} + +static int qca807x_report_length(struct phy_device *phydev, + int pair, int result) +{ + int length; + int ret; + + ret = phy_read_mmd(phydev, MDIO_MMD_PCS, QCA807X_CDT_MMD3_MDI0_LENGTH + pair); + if (ret < 0) + return ret; + + switch (result) { + case ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT: + length = (FIELD_GET(QCA807X_CDT_SAME_SHORT_LENGTH_MASK, ret) * 800) / 10; + break; + case ETHTOOL_A_CABLE_RESULT_CODE_OPEN: + case ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT: + length = (FIELD_GET(QCA807X_CDT_CROSS_SHORT_LENGTH_MASK, ret) * 800) / 10; + break; + } + + ethnl_cable_test_fault_length(phydev, pair, length); + + return 0; +} + +static int qca807x_cable_test_report_trans(int result) +{ + switch (result) { + case QCA807X_CDT_RESULTS_OK: + return ETHTOOL_A_CABLE_RESULT_CODE_OK; + case QCA807X_CDT_RESULTS_OPEN: + return ETHTOOL_A_CABLE_RESULT_CODE_OPEN; + case QCA807X_CDT_RESULTS_SAME_SHORT: + return ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT; + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_SHORT: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_SHORT: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_SHORT: + return ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT; + default: + return ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC; + } +} + +static int qca807x_cable_test_report(struct phy_device *phydev) +{ + int pair0, pair1, pair2, pair3; + int ret; + + ret = phy_read_mmd(phydev, MDIO_MMD_PCS, QCA807X_CDT_MMD3_STATUS); + if (ret < 0) + return ret; + + pair0 = FIELD_GET(QCA807X_CDT_MDI0_STATUS_MASK, ret); + pair1 = FIELD_GET(QCA807X_CDT_MDI1_STATUS_MASK, ret); + pair2 = FIELD_GET(QCA807X_CDT_MDI2_STATUS_MASK, ret); + pair3 = FIELD_GET(QCA807X_CDT_MDI3_STATUS_MASK, ret); + + ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_A, + qca807x_cable_test_report_trans(pair0)); + ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_B, + qca807x_cable_test_report_trans(pair1)); + ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_C, + qca807x_cable_test_report_trans(pair2)); + ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_D, + qca807x_cable_test_report_trans(pair3)); + + if (qca807x_distance_valid(pair0)) + qca807x_report_length(phydev, 0, qca807x_cable_test_report_trans(pair0)); + if (qca807x_distance_valid(pair1)) + qca807x_report_length(phydev, 1, qca807x_cable_test_report_trans(pair1)); + if (qca807x_distance_valid(pair2)) + qca807x_report_length(phydev, 2, qca807x_cable_test_report_trans(pair2)); + if (qca807x_distance_valid(pair3)) + qca807x_report_length(phydev, 3, qca807x_cable_test_report_trans(pair3)); + + return 0; +} + +static int qca807x_cable_test_get_status(struct phy_device *phydev, + bool *finished) +{ + int val; + + *finished = false; + + val = phy_read(phydev, QCA807X_CDT); + if (!((val & QCA807X_CDT_ENABLE) && (val & QCA807X_CDT_STATUS))) { + *finished = true; + + return qca807x_cable_test_report(phydev); + } + + return 0; +} + +static int qca807x_cable_test_start(struct phy_device *phydev) +{ + int val, ret; + + val = phy_read(phydev, QCA807X_CDT); + /* Enable inter-pair short check as well */ + val &= ~QCA807X_CDT_ENABLE_INTER_PAIR_SHORT; + val |= QCA807X_CDT_ENABLE; + ret = phy_write(phydev, QCA807X_CDT, val); + + return ret; +} +#endif + +#ifdef CONFIG_GPIOLIB +static int qca807x_gpio_get_direction(struct gpio_chip *gc, unsigned int offset) +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) + return GPIO_LINE_DIRECTION_OUT; +#else + return GPIOF_DIR_OUT; +#endif +} + +static int qca807x_gpio_get_reg(unsigned int offset) +{ + return QCA807X_MMD7_LED_100N_2 + (offset % 2) * 2; +} + +static int qca807x_gpio_get(struct gpio_chip *gc, unsigned int offset) +{ + struct qca807x_gpio_priv *priv = gpiochip_get_data(gc); + int val; + + val = phy_read_mmd(priv->phy, MDIO_MMD_AN, qca807x_gpio_get_reg(offset)); + + return FIELD_GET(QCA807X_GPIO_FORCE_MODE_MASK, val); +} + +static void qca807x_gpio_set(struct gpio_chip *gc, unsigned int offset, int value) +{ + struct qca807x_gpio_priv *priv = gpiochip_get_data(gc); + int val; + + val = phy_read_mmd(priv->phy, MDIO_MMD_AN, qca807x_gpio_get_reg(offset)); + val &= ~QCA807X_GPIO_FORCE_MODE_MASK; + val |= FIELD_PREP(QCA807X_GPIO_FORCE_MODE_MASK, value); + + phy_write_mmd(priv->phy, MDIO_MMD_AN, qca807x_gpio_get_reg(offset), val); +} + +static int qca807x_gpio_dir_out(struct gpio_chip *gc, unsigned int offset, int value) +{ + qca807x_gpio_set(gc, offset, value); + + return 0; +} + +static int qca807x_gpio(struct phy_device *phydev) +{ + struct device *dev = &phydev->mdio.dev; + struct qca807x_gpio_priv *priv; + struct gpio_chip *gc; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->phy = phydev; + + gc = devm_kzalloc(dev, sizeof(*gc), GFP_KERNEL); + if (!gc) + return -ENOMEM; + + gc->label = dev_name(dev); + gc->base = -1; + gc->ngpio = 2; + gc->parent = dev; + gc->owner = THIS_MODULE; + gc->can_sleep = true; + gc->get_direction = qca807x_gpio_get_direction; + gc->direction_output = qca807x_gpio_dir_out; + gc->get = qca807x_gpio_get; + gc->set = qca807x_gpio_set; + + return devm_gpiochip_add_data(dev, gc, priv); +} +#endif + +static int qca807x_read_copper_status(struct phy_device *phydev, bool combo_port) +{ + int ss, err, page, old_link = phydev->link; + + /* Only combo port has dual pages */ + if (combo_port) { + /* Check whether copper page is set and set if needed */ + page = phy_read(phydev, QCA807X_CHIP_CONFIGURATION); + if (!(page & QCA807X_BT_BX_REG_SEL)) { + page |= QCA807X_BT_BX_REG_SEL; + phy_write(phydev, QCA807X_CHIP_CONFIGURATION, page); + } + } + + /* Update the link, but return if there was an error */ + err = genphy_update_link(phydev); + if (err) + return err; + + /* why bother the PHY if nothing can have changed */ + if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link) + return 0; + + phydev->speed = SPEED_UNKNOWN; + phydev->duplex = DUPLEX_UNKNOWN; + phydev->pause = 0; + phydev->asym_pause = 0; + + err = genphy_read_lpa(phydev); + if (err < 0) + return err; + + /* Read the QCA807x PHY-Specific Status register copper page, + * which indicates the speed and duplex that the PHY is actually + * using, irrespective of whether we are in autoneg mode or not. + */ + ss = phy_read(phydev, QCA807X_PHY_SPECIFIC_STATUS); + if (ss < 0) + return ss; + + if (ss & QCA807X_SS_SPEED_AND_DUPLEX_RESOLVED) { + int sfc; + + sfc = phy_read(phydev, QCA807X_FUNCTION_CONTROL); + if (sfc < 0) + return sfc; + + switch (FIELD_GET(QCA807X_SS_SPEED_MASK, ss)) { + case QCA807X_SS_SPEED_10: + phydev->speed = SPEED_10; + break; + case QCA807X_SS_SPEED_100: + phydev->speed = SPEED_100; + break; + case QCA807X_SS_SPEED_1000: + phydev->speed = SPEED_1000; + break; + } + if (ss & QCA807X_SS_DUPLEX) + phydev->duplex = DUPLEX_FULL; + else + phydev->duplex = DUPLEX_HALF; + + if (ss & QCA807X_SS_MDIX) + phydev->mdix = ETH_TP_MDI_X; + else + phydev->mdix = ETH_TP_MDI; + + switch (FIELD_GET(QCA807X_FC_MDI_CROSSOVER_MODE_MASK, sfc)) { + case QCA807X_FC_MDI_CROSSOVER_MANUAL_MDI: + phydev->mdix_ctrl = ETH_TP_MDI; + break; + case QCA807X_FC_MDI_CROSSOVER_MANUAL_MDIX: + phydev->mdix_ctrl = ETH_TP_MDI_X; + break; + case QCA807X_FC_MDI_CROSSOVER_AUTO: + phydev->mdix_ctrl = ETH_TP_MDI_AUTO; + break; + } + } + + if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) + phy_resolve_aneg_pause(phydev); + + return 0; +} + +static int qca807x_read_fiber_status(struct phy_device *phydev, bool combo_port) +{ + int ss, err, page, lpa, old_link = phydev->link; + + /* Check whether fiber page is set and set if needed */ + page = phy_read(phydev, QCA807X_CHIP_CONFIGURATION); + if (page & QCA807X_BT_BX_REG_SEL) { + page &= ~QCA807X_BT_BX_REG_SEL; + phy_write(phydev, QCA807X_CHIP_CONFIGURATION, page); + } + + /* Update the link, but return if there was an error */ + err = genphy_update_link(phydev); + if (err) + return err; + + /* why bother the PHY if nothing can have changed */ + if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link) + return 0; + + phydev->speed = SPEED_UNKNOWN; + phydev->duplex = DUPLEX_UNKNOWN; + phydev->pause = 0; + phydev->asym_pause = 0; + + if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) { + lpa = phy_read(phydev, MII_LPA); + if (lpa < 0) + return lpa; + + linkmode_mod_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, + phydev->lp_advertising, lpa & LPA_LPACK); + linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, + phydev->lp_advertising, lpa & LPA_1000XFULL); + linkmode_mod_bit(ETHTOOL_LINK_MODE_Pause_BIT, + phydev->lp_advertising, lpa & LPA_1000XPAUSE); + linkmode_mod_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, + phydev->lp_advertising, + lpa & LPA_1000XPAUSE_ASYM); + + phy_resolve_aneg_linkmode(phydev); + } + + /* Read the QCA807x PHY-Specific Status register fiber page, + * which indicates the speed and duplex that the PHY is actually + * using, irrespective of whether we are in autoneg mode or not. + */ + ss = phy_read(phydev, QCA807X_PHY_SPECIFIC_STATUS); + if (ss < 0) + return ss; + + if (ss & QCA807X_SS_SPEED_AND_DUPLEX_RESOLVED) { + switch (FIELD_GET(QCA807X_SS_SPEED_MASK, ss)) { + case QCA807X_SS_SPEED_100: + phydev->speed = SPEED_100; + break; + case QCA807X_SS_SPEED_1000: + phydev->speed = SPEED_1000; + break; + } + + if (ss & QCA807X_SS_DUPLEX) + phydev->duplex = DUPLEX_FULL; + else + phydev->duplex = DUPLEX_HALF; + } + + return 0; +} + +static int qca807x_read_status(struct phy_device *phydev) +{ + int val; + + /* Check for Combo port */ + if (phy_read(phydev, QCA807X_CHIP_CONFIGURATION)) { + /* Check for fiber mode first */ + if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported)) { + /* Check for actual detected media */ + val = phy_read(phydev, QCA807X_MEDIA_SELECT_STATUS); + if (val & QCA807X_MEDIA_DETECTED_COPPER) { + qca807x_read_copper_status(phydev, true); + } else if ((val & QCA807X_MEDIA_DETECTED_1000_BASE_X) || + (val & QCA807X_MEDIA_DETECTED_100_BASE_FX)) { + qca807x_read_fiber_status(phydev, true); + } + } else { + qca807x_read_copper_status(phydev, true); + } + } else { + qca807x_read_copper_status(phydev, false); + } + + return 0; +} + +static int qca807x_config_intr(struct phy_device *phydev) +{ + int ret, val; + + val = phy_read(phydev, QCA807X_INTR_ENABLE); + + if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { + /* Check for combo port as it has fewer interrupts */ + if (phy_read(phydev, QCA807X_CHIP_CONFIGURATION)) { + val |= QCA807X_INTR_ENABLE_SPEED_CHANGED; + val |= QCA807X_INTR_ENABLE_LINK_FAIL; + val |= QCA807X_INTR_ENABLE_LINK_SUCCESS; + } else { + val |= QCA807X_INTR_ENABLE_AUTONEG_ERR; + val |= QCA807X_INTR_ENABLE_SPEED_CHANGED; + val |= QCA807X_INTR_ENABLE_DUPLEX_CHANGED; + val |= QCA807X_INTR_ENABLE_LINK_FAIL; + val |= QCA807X_INTR_ENABLE_LINK_SUCCESS; + } + ret = phy_write(phydev, QCA807X_INTR_ENABLE, val); + } else { + ret = phy_write(phydev, QCA807X_INTR_ENABLE, 0); + } + + return ret; +} + +static int qca807x_ack_intr(struct phy_device *phydev) +{ + int ret; + + ret = phy_read(phydev, QCA807X_INTR_STATUS); + + return (ret < 0) ? ret : 0; +} + +static int qca807x_led_config(struct phy_device *phydev) +{ + struct device_node *node = phydev->mdio.dev.of_node; + bool led_config = false; + int val; + + val = phy_read_mmd(phydev, MDIO_MMD_AN, QCA807X_MMD7_LED_1000N_1); + if (val < 0) + return val; + + if (of_property_read_bool(node, "qcom,single-led-1000")) { + val |= QCA807X_LED_TXACT_BLK_EN_2; + val |= QCA807X_LED_RXACT_BLK_EN_2; + val |= QCA807X_LED_GT_ON_EN_2; + + led_config = true; + } + + if (of_property_read_bool(node, "qcom,single-led-100")) { + val |= QCA807X_LED_HT_ON_EN_2; + + led_config = true; + } + + if (of_property_read_bool(node, "qcom,single-led-10")) { + val |= QCA807X_LED_BT_ON_EN_2; + + led_config = true; + } + + if (led_config) + return phy_write_mmd(phydev, MDIO_MMD_AN, QCA807X_MMD7_LED_1000N_1, val); + else + return 0; +} + +static const struct sfp_upstream_ops qca807x_sfp_ops = { + .attach = phy_sfp_attach, + .detach = phy_sfp_detach, +}; + +static int qca807x_config(struct phy_device *phydev) +{ + struct device_node *node = phydev->mdio.dev.of_node; + int control_dac, ret = 0; + u32 of_control_dac; + + /* Check for Combo port */ + if (phy_read(phydev, QCA807X_CHIP_CONFIGURATION)) { + int fiber_mode_autodect; + int psgmii_serdes; + int chip_config; + + if (of_property_read_bool(node, "qcom,fiber-enable")) { + /* Enable fiber mode autodection (1000Base-X or 100Base-FX) */ + fiber_mode_autodect = phy_read_mmd(phydev, MDIO_MMD_AN, + QCA807X_MMD7_FIBER_MODE_AUTO_DETECTION); + fiber_mode_autodect |= QCA807X_MMD7_FIBER_MODE_AUTO_DETECTION_EN; + phy_write_mmd(phydev, MDIO_MMD_AN, QCA807X_MMD7_FIBER_MODE_AUTO_DETECTION, + fiber_mode_autodect); + + /* Enable 4 copper + combo port mode */ + chip_config = phy_read(phydev, QCA807X_CHIP_CONFIGURATION); + chip_config &= ~QCA807X_CHIP_CONFIGURATION_MODE_CFG_MASK; + chip_config |= FIELD_PREP(QCA807X_CHIP_CONFIGURATION_MODE_CFG_MASK, + QCA807X_CHIP_CONFIGURATION_MODE_PSGMII_FIBER); + phy_write(phydev, QCA807X_CHIP_CONFIGURATION, chip_config); + + linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported); + linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->advertising); + } + + /* Prevent PSGMII going into hibernation via PSGMII self test */ + psgmii_serdes = phy_read_mmd(phydev, MDIO_MMD_PCS, PSGMII_MMD3_SERDES_CONTROL); + psgmii_serdes &= ~BIT(1); + ret = phy_write_mmd(phydev, MDIO_MMD_PCS, + PSGMII_MMD3_SERDES_CONTROL, + psgmii_serdes); + } + + if (!of_property_read_u32(node, "qcom,control-dac", &of_control_dac)) { + control_dac = phy_read_mmd(phydev, MDIO_MMD_AN, + QCA807X_MMD7_1000BASE_T_POWER_SAVE_PER_CABLE_LENGTH); + control_dac &= ~QCA807X_CONTROL_DAC_MASK; + control_dac |= FIELD_PREP(QCA807X_CONTROL_DAC_MASK, of_control_dac); + ret = phy_write_mmd(phydev, MDIO_MMD_AN, + QCA807X_MMD7_1000BASE_T_POWER_SAVE_PER_CABLE_LENGTH, + control_dac); + } + + /* Optionally configure LED-s */ + if (IS_ENABLED(CONFIG_GPIOLIB)) { + /* Check whether PHY-s pins are used as GPIO-s */ + if (!of_property_read_bool(node, "gpio-controller")) + ret = qca807x_led_config(phydev); + } else { + ret = qca807x_led_config(phydev); + } + + return ret; +} + +static int qca807x_probe(struct phy_device *phydev) +{ + struct device_node *node = phydev->mdio.dev.of_node; + int ret = 0; + + if (IS_ENABLED(CONFIG_GPIOLIB)) { + /* Do not register a GPIO controller unless flagged for it */ + if (of_property_read_bool(node, "gpio-controller")) + ret = qca807x_gpio(phydev); + } + + /* Attach SFP bus on combo port*/ + if (of_property_read_bool(node, "qcom,fiber-enable")) { + if (phy_read(phydev, QCA807X_CHIP_CONFIGURATION)) + ret = phy_sfp_probe(phydev, &qca807x_sfp_ops); + } + + return ret; +} + +static int qca807x_psgmii_config(struct phy_device *phydev) +{ + struct device_node *node = phydev->mdio.dev.of_node; + int psgmii_az, tx_amp, ret = 0; + u32 tx_driver_strength; + + /* Workaround to enable AZ transmitting ability */ + if (of_property_read_bool(node, "qcom,psgmii-az")) { + psgmii_az = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, PSGMII_MODE_CTRL); + psgmii_az &= ~PSGMII_MODE_CTRL_AZ_WORKAROUND_MASK; + psgmii_az |= FIELD_PREP(PSGMII_MODE_CTRL_AZ_WORKAROUND_MASK, 0xc); + ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, PSGMII_MODE_CTRL, psgmii_az); + psgmii_az = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, PSGMII_MODE_CTRL); + } + + /* PSGMII/QSGMII TX amp set to DT defined value instead of default 600mV */ + if (!of_property_read_u32(node, "qcom,tx-driver-strength", &tx_driver_strength)) { + tx_amp = phy_read(phydev, PSGMII_QSGMII_DRIVE_CONTROL_1); + tx_amp &= ~PSGMII_QSGMII_TX_DRIVER_MASK; + tx_amp |= FIELD_PREP(PSGMII_QSGMII_TX_DRIVER_MASK, tx_driver_strength); + ret = phy_write(phydev, PSGMII_QSGMII_DRIVE_CONTROL_1, tx_amp); + } + + return ret; +} + +static struct phy_driver qca807x_drivers[] = { + { + PHY_ID_MATCH_EXACT(PHY_ID_QCA8072), + .name = "Qualcomm QCA8072", +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) + .flags = PHY_POLL_CABLE_TEST, +#endif + /* PHY_GBIT_FEATURES */ + .probe = qca807x_probe, + .config_init = qca807x_config, + .read_status = qca807x_read_status, + .config_intr = qca807x_config_intr, + .ack_interrupt = qca807x_ack_intr, + .soft_reset = genphy_soft_reset, + .get_tunable = qca807x_get_tunable, + .set_tunable = qca807x_set_tunable, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) + .cable_test_start = qca807x_cable_test_start, + .cable_test_get_status = qca807x_cable_test_get_status, +#endif + }, + { + PHY_ID_MATCH_EXACT(PHY_ID_QCA8075), + .name = "Qualcomm QCA8075", +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) + .flags = PHY_POLL_CABLE_TEST, +#endif + /* PHY_GBIT_FEATURES */ + .probe = qca807x_probe, + .config_init = qca807x_config, + .read_status = qca807x_read_status, + .config_intr = qca807x_config_intr, + .ack_interrupt = qca807x_ack_intr, + .soft_reset = genphy_soft_reset, + .get_tunable = qca807x_get_tunable, + .set_tunable = qca807x_set_tunable, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) + .cable_test_start = qca807x_cable_test_start, + .cable_test_get_status = qca807x_cable_test_get_status, +#endif + }, + { + PHY_ID_MATCH_EXACT(PHY_ID_QCA807X_PSGMII), + .name = "Qualcomm QCA807x PSGMII", + .probe = qca807x_psgmii_config, + }, +}; +module_phy_driver(qca807x_drivers); + +static struct mdio_device_id __maybe_unused qca807x_tbl[] = { + { PHY_ID_MATCH_EXACT(PHY_ID_QCA8072) }, + { PHY_ID_MATCH_EXACT(PHY_ID_QCA8075) }, + { PHY_ID_MATCH_MODEL(PHY_ID_QCA807X_PSGMII) }, + { } +}; + +MODULE_AUTHOR("Robert Marko"); +MODULE_DESCRIPTION("Qualcomm QCA807x PHY driver"); +MODULE_DEVICE_TABLE(mdio, qca807x_tbl); +MODULE_LICENSE("GPL"); diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 0fdbda8e53..53e5ed3472 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -317,6 +317,25 @@ define Device/compex_wpj428 endef TARGET_DEVICES += compex_wpj428 +define Device/devolo_magic-2-wifi-next + $(call Device/FitImage) + DEVICE_VENDOR := devolo + DEVICE_MODEL := Magic 2 WiFi next + SOC := qcom-ipq4018 + KERNEL_SIZE := 4096k + + # If the bootloader sees 0xDEADC0DE and this trailer at the 64k boundary of a TFTP image + # it will bootm it, just like we want for the initramfs. + KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to 64k |\ + append-string -e '\xDE\xAD\xC0\xDE{"fl_initramfs":""}\x00' + + IMAGE_SIZE := 26624k + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next uboot-envtools +endef +TARGET_DEVICES += devolo_magic-2-wifi-next + define Device/dlink_dap-2610 $(call Device/FitImageLzma) DEVICE_VENDOR := D-Link @@ -463,6 +482,21 @@ define Device/ezviz_cs-w3-wd1200g-eup endef TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup +define Device/glinet_gl-ap1300 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-AP1300 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 131072k + KERNEL_INSTALL := 1 + DEVICE_PACKAGES := ipq-wifi-glinet_gl-ap1300 +endef +TARGET_DEVICES += glinet_gl-ap1300 + define Device/glinet_gl-b1300 $(call Device/FitImage) DEVICE_VENDOR := GL.iNet @@ -677,6 +711,38 @@ define Device/p2w_r619ac-128m endef TARGET_DEVICES += p2w_r619ac-128m +define Device/plasmacloud_pa1200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := Plasma Cloud + DEVICE_MODEL := PA1200 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@pc.pa1200 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15616k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := uboot-envtools ipq-wifi-plasmacloud-pa1200 +endef +TARGET_DEVICES += plasmacloud_pa1200 + +define Device/plasmacloud_pa2200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := Plasma Cloud + DEVICE_MODEL := PA2200 + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@pc.pa2200 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15552k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA2200 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200 uboot-envtools +endef +TARGET_DEVICES += plasmacloud_pa2200 + define Device/qcom_ap-dk01.1-c1 DEVICE_VENDOR := Qualcomm Atheros DEVICE_MODEL := AP-DK01.1 diff --git a/target/linux/ipq40xx/patches-5.4/0005-01-v5.8-net-phy-mdio-add-IPQ4019-MDIO-driver.patch b/target/linux/ipq40xx/patches-5.4/0005-01-v5.8-net-phy-mdio-add-IPQ4019-MDIO-driver.patch new file mode 100644 index 0000000000..d678f761f5 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/0005-01-v5.8-net-phy-mdio-add-IPQ4019-MDIO-driver.patch @@ -0,0 +1,210 @@ +From 466ed24fb22342f3ae1c10758a6a0c6a8c081b2d Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Thu, 30 Apr 2020 11:07:05 +0200 +Subject: [PATCH] net: phy: mdio: add IPQ4019 MDIO driver + +This patch adds the driver for the MDIO interface +inside of Qualcomm IPQ40xx series SoC-s. + +Signed-off-by: Christian Lamparter +Signed-off-by: Robert Marko +Reviewed-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Cc: Luka Perkov +Signed-off-by: David S. Miller +--- + drivers/net/phy/Kconfig | 7 ++ + drivers/net/phy/Makefile | 1 + + drivers/net/phy/mdio-ipq4019.c | 160 +++++++++++++++++++++++++++++++++ + 3 files changed, 168 insertions(+) + create mode 100644 drivers/net/phy/mdio-ipq4019.c + +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig +@@ -156,6 +156,13 @@ config MDIO_I2C + + This is library mode. + ++config MDIO_IPQ4019 ++ tristate "Qualcomm IPQ4019 MDIO interface support" ++ depends on HAS_IOMEM && OF_MDIO ++ help ++ This driver supports the MDIO interface found in Qualcomm ++ IPQ40xx series Soc-s. ++ + config MDIO_MOXART + tristate "MOXA ART MDIO interface support" + depends on ARCH_MOXART || COMPILE_TEST +--- a/drivers/net/phy/Makefile ++++ b/drivers/net/phy/Makefile +@@ -50,6 +50,7 @@ obj-$(CONFIG_MDIO_CAVIUM) += mdio-cavium + obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o + obj-$(CONFIG_MDIO_HISI_FEMAC) += mdio-hisi-femac.o + obj-$(CONFIG_MDIO_I2C) += mdio-i2c.o ++obj-$(CONFIG_MDIO_IPQ4019) += mdio-ipq4019.o + obj-$(CONFIG_MDIO_MOXART) += mdio-moxart.o + obj-$(CONFIG_MDIO_MSCC_MIIM) += mdio-mscc-miim.o + obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o +--- /dev/null ++++ b/drivers/net/phy/mdio-ipq4019.c +@@ -0,0 +1,160 @@ ++// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause ++/* Copyright (c) 2015, The Linux Foundation. All rights reserved. */ ++/* Copyright (c) 2020 Sartura Ltd. */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define MDIO_ADDR_REG 0x44 ++#define MDIO_DATA_WRITE_REG 0x48 ++#define MDIO_DATA_READ_REG 0x4c ++#define MDIO_CMD_REG 0x50 ++#define MDIO_CMD_ACCESS_BUSY BIT(16) ++#define MDIO_CMD_ACCESS_START BIT(8) ++#define MDIO_CMD_ACCESS_CODE_READ 0 ++#define MDIO_CMD_ACCESS_CODE_WRITE 1 ++ ++#define ipq4019_MDIO_TIMEOUT 10000 ++#define ipq4019_MDIO_SLEEP 10 ++ ++struct ipq4019_mdio_data { ++ void __iomem *membase; ++}; ++ ++static int ipq4019_mdio_wait_busy(struct mii_bus *bus) ++{ ++ struct ipq4019_mdio_data *priv = bus->priv; ++ unsigned int busy; ++ ++ return readl_poll_timeout(priv->membase + MDIO_CMD_REG, busy, ++ (busy & MDIO_CMD_ACCESS_BUSY) == 0, ++ ipq4019_MDIO_SLEEP, ipq4019_MDIO_TIMEOUT); ++} ++ ++static int ipq4019_mdio_read(struct mii_bus *bus, int mii_id, int regnum) ++{ ++ struct ipq4019_mdio_data *priv = bus->priv; ++ unsigned int cmd; ++ ++ /* Reject clause 45 */ ++ if (regnum & MII_ADDR_C45) ++ return -EOPNOTSUPP; ++ ++ if (ipq4019_mdio_wait_busy(bus)) ++ return -ETIMEDOUT; ++ ++ /* issue the phy address and reg */ ++ writel((mii_id << 8) | regnum, priv->membase + MDIO_ADDR_REG); ++ ++ cmd = MDIO_CMD_ACCESS_START | MDIO_CMD_ACCESS_CODE_READ; ++ ++ /* issue read command */ ++ writel(cmd, priv->membase + MDIO_CMD_REG); ++ ++ /* Wait read complete */ ++ if (ipq4019_mdio_wait_busy(bus)) ++ return -ETIMEDOUT; ++ ++ /* Read and return data */ ++ return readl(priv->membase + MDIO_DATA_READ_REG); ++} ++ ++static int ipq4019_mdio_write(struct mii_bus *bus, int mii_id, int regnum, ++ u16 value) ++{ ++ struct ipq4019_mdio_data *priv = bus->priv; ++ unsigned int cmd; ++ ++ /* Reject clause 45 */ ++ if (regnum & MII_ADDR_C45) ++ return -EOPNOTSUPP; ++ ++ if (ipq4019_mdio_wait_busy(bus)) ++ return -ETIMEDOUT; ++ ++ /* issue the phy address and reg */ ++ writel((mii_id << 8) | regnum, priv->membase + MDIO_ADDR_REG); ++ ++ /* issue write data */ ++ writel(value, priv->membase + MDIO_DATA_WRITE_REG); ++ ++ cmd = MDIO_CMD_ACCESS_START | MDIO_CMD_ACCESS_CODE_WRITE; ++ /* issue write command */ ++ writel(cmd, priv->membase + MDIO_CMD_REG); ++ ++ /* Wait write complete */ ++ if (ipq4019_mdio_wait_busy(bus)) ++ return -ETIMEDOUT; ++ ++ return 0; ++} ++ ++static int ipq4019_mdio_probe(struct platform_device *pdev) ++{ ++ struct ipq4019_mdio_data *priv; ++ struct mii_bus *bus; ++ int ret; ++ ++ bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*priv)); ++ if (!bus) ++ return -ENOMEM; ++ ++ priv = bus->priv; ++ ++ priv->membase = devm_platform_ioremap_resource(pdev, 0); ++ if (IS_ERR(priv->membase)) ++ return PTR_ERR(priv->membase); ++ ++ bus->name = "ipq4019_mdio"; ++ bus->read = ipq4019_mdio_read; ++ bus->write = ipq4019_mdio_write; ++ bus->parent = &pdev->dev; ++ snprintf(bus->id, MII_BUS_ID_SIZE, "%s%d", pdev->name, pdev->id); ++ ++ ret = of_mdiobus_register(bus, pdev->dev.of_node); ++ if (ret) { ++ dev_err(&pdev->dev, "Cannot register MDIO bus!\n"); ++ return ret; ++ } ++ ++ platform_set_drvdata(pdev, bus); ++ ++ return 0; ++} ++ ++static int ipq4019_mdio_remove(struct platform_device *pdev) ++{ ++ struct mii_bus *bus = platform_get_drvdata(pdev); ++ ++ mdiobus_unregister(bus); ++ ++ return 0; ++} ++ ++static const struct of_device_id ipq4019_mdio_dt_ids[] = { ++ { .compatible = "qcom,ipq4019-mdio" }, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, ipq4019_mdio_dt_ids); ++ ++static struct platform_driver ipq4019_mdio_driver = { ++ .probe = ipq4019_mdio_probe, ++ .remove = ipq4019_mdio_remove, ++ .driver = { ++ .name = "ipq4019-mdio", ++ .of_match_table = ipq4019_mdio_dt_ids, ++ }, ++}; ++ ++module_platform_driver(ipq4019_mdio_driver); ++ ++MODULE_DESCRIPTION("ipq4019 MDIO interface driver"); ++MODULE_AUTHOR("Qualcomm Atheros"); ++MODULE_LICENSE("Dual BSD/GPL"); diff --git a/target/linux/ipq40xx/patches-5.4/0005-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch b/target/linux/ipq40xx/patches-5.4/0005-02-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/0005-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch rename to target/linux/ipq40xx/patches-5.4/0005-02-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch diff --git a/target/linux/ipq40xx/patches-5.4/700-net-add-qualcomm-mdio.patch b/target/linux/ipq40xx/patches-5.4/700-net-add-qualcomm-mdio.patch deleted file mode 100644 index 3345d84fb8..0000000000 --- a/target/linux/ipq40xx/patches-5.4/700-net-add-qualcomm-mdio.patch +++ /dev/null @@ -1,225 +0,0 @@ ---- a/drivers/net/phy/Kconfig -+++ b/drivers/net/phy/Kconfig -@@ -577,6 +577,13 @@ config XILINX_GMII2RGMII - the Reduced Gigabit Media Independent Interface(RGMII) between - Ethernet physical media devices and the Gigabit Ethernet controller. - -+config MDIO_IPQ40XX -+ tristate "Qualcomm Atheros ipq40xx MDIO interface" -+ depends on HAS_IOMEM && OF -+ ---help--- -+ This driver supports the MDIO interface found in Qualcomm -+ Atheros ipq40xx Soc chip. -+ - endif # PHYLIB - - config MICREL_KS8995MA ---- a/drivers/net/phy/Makefile -+++ b/drivers/net/phy/Makefile -@@ -50,6 +50,7 @@ obj-$(CONFIG_MDIO_CAVIUM) += mdio-cavium - obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o - obj-$(CONFIG_MDIO_HISI_FEMAC) += mdio-hisi-femac.o - obj-$(CONFIG_MDIO_I2C) += mdio-i2c.o -+obj-$(CONFIG_MDIO_IPQ40XX) += mdio-ipq40xx.o - obj-$(CONFIG_MDIO_MOXART) += mdio-moxart.o - obj-$(CONFIG_MDIO_MSCC_MIIM) += mdio-mscc-miim.o - obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o ---- /dev/null -+++ b/drivers/net/phy/mdio-ipq40xx.c -@@ -0,0 +1,196 @@ -+/* -+ * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. -+ * -+ * Permission to use, copy, modify, and/or distribute this software for -+ * any purpose with or without fee is hereby granted, provided that the -+ * above copyright notice and this permission notice appear in all copies. -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define MDIO_CTRL_0_REG 0x40 -+#define MDIO_CTRL_1_REG 0x44 -+#define MDIO_CTRL_2_REG 0x48 -+#define MDIO_CTRL_3_REG 0x4c -+#define MDIO_CTRL_4_REG 0x50 -+#define MDIO_CTRL_4_ACCESS_BUSY BIT(16) -+#define MDIO_CTRL_4_ACCESS_START BIT(8) -+#define MDIO_CTRL_4_ACCESS_CODE_READ 0 -+#define MDIO_CTRL_4_ACCESS_CODE_WRITE 1 -+#define CTRL_0_REG_DEFAULT_VALUE 0x150FF -+ -+#define IPQ40XX_MDIO_RETRY 1000 -+#define IPQ40XX_MDIO_DELAY 10 -+ -+struct ipq40xx_mdio_data { -+ struct mii_bus *mii_bus; -+ void __iomem *membase; -+ struct device *dev; -+}; -+ -+static int ipq40xx_mdio_wait_busy(struct ipq40xx_mdio_data *am) -+{ -+ int i; -+ -+ for (i = 0; i < IPQ40XX_MDIO_RETRY; i++) { -+ unsigned int busy; -+ -+ busy = readl(am->membase + MDIO_CTRL_4_REG) & -+ MDIO_CTRL_4_ACCESS_BUSY; -+ if (!busy) -+ return 0; -+ -+ /* BUSY might take to be cleard by 15~20 times of loop */ -+ udelay(IPQ40XX_MDIO_DELAY); -+ } -+ -+ dev_err(am->dev, "%s: MDIO operation timed out\n", am->mii_bus->name); -+ -+ return -ETIMEDOUT; -+} -+ -+static int ipq40xx_mdio_read(struct mii_bus *bus, int mii_id, int regnum) -+{ -+ struct ipq40xx_mdio_data *am = bus->priv; -+ int value = 0; -+ unsigned int cmd = 0; -+ -+ lockdep_assert_held(&bus->mdio_lock); -+ -+ if (ipq40xx_mdio_wait_busy(am)) -+ return -ETIMEDOUT; -+ -+ /* issue the phy address and reg */ -+ writel((mii_id << 8) | regnum, am->membase + MDIO_CTRL_1_REG); -+ -+ cmd = MDIO_CTRL_4_ACCESS_START|MDIO_CTRL_4_ACCESS_CODE_READ; -+ -+ /* issue read command */ -+ writel(cmd, am->membase + MDIO_CTRL_4_REG); -+ -+ /* Wait read complete */ -+ if (ipq40xx_mdio_wait_busy(am)) -+ return -ETIMEDOUT; -+ -+ /* Read data */ -+ value = readl(am->membase + MDIO_CTRL_3_REG); -+ -+ return value; -+} -+ -+static int ipq40xx_mdio_write(struct mii_bus *bus, int mii_id, int regnum, -+ u16 value) -+{ -+ struct ipq40xx_mdio_data *am = bus->priv; -+ unsigned int cmd = 0; -+ -+ lockdep_assert_held(&bus->mdio_lock); -+ -+ if (ipq40xx_mdio_wait_busy(am)) -+ return -ETIMEDOUT; -+ -+ /* issue the phy address and reg */ -+ writel((mii_id << 8) | regnum, am->membase + MDIO_CTRL_1_REG); -+ -+ /* issue write data */ -+ writel(value, am->membase + MDIO_CTRL_2_REG); -+ -+ cmd = MDIO_CTRL_4_ACCESS_START|MDIO_CTRL_4_ACCESS_CODE_WRITE; -+ /* issue write command */ -+ writel(cmd, am->membase + MDIO_CTRL_4_REG); -+ -+ /* Wait write complete */ -+ if (ipq40xx_mdio_wait_busy(am)) -+ return -ETIMEDOUT; -+ -+ return 0; -+} -+ -+static int ipq40xx_mdio_probe(struct platform_device *pdev) -+{ -+ struct ipq40xx_mdio_data *am; -+ struct resource *res; -+ int i; -+ -+ am = devm_kzalloc(&pdev->dev, sizeof(*am), GFP_KERNEL); -+ if (!am) -+ return -ENOMEM; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (!res) { -+ dev_err(&pdev->dev, "no iomem resource found\n"); -+ return -ENXIO; -+ } -+ -+ am->membase = devm_ioremap_resource(&pdev->dev, res); -+ if (IS_ERR(am->membase)) { -+ dev_err(&pdev->dev, "unable to ioremap registers\n"); -+ return PTR_ERR(am->membase); -+ } -+ -+ am->mii_bus = devm_mdiobus_alloc(&pdev->dev); -+ if (!am->mii_bus) -+ return -ENOMEM; -+ -+ writel(CTRL_0_REG_DEFAULT_VALUE, am->membase + MDIO_CTRL_0_REG); -+ -+ am->mii_bus->name = "ipq40xx_mdio"; -+ am->mii_bus->read = ipq40xx_mdio_read; -+ am->mii_bus->write = ipq40xx_mdio_write; -+ am->mii_bus->priv = am; -+ am->mii_bus->parent = &pdev->dev; -+ snprintf(am->mii_bus->id, MII_BUS_ID_SIZE, "%s", dev_name(&pdev->dev)); -+ -+ am->dev = &pdev->dev; -+ platform_set_drvdata(pdev, am); -+ -+ return of_mdiobus_register(am->mii_bus, pdev->dev.of_node); -+} -+ -+static int ipq40xx_mdio_remove(struct platform_device *pdev) -+{ -+ struct ipq40xx_mdio_data *am = platform_get_drvdata(pdev); -+ -+ mdiobus_unregister(am->mii_bus); -+ -+ return 0; -+} -+ -+static const struct of_device_id ipq40xx_mdio_dt_ids[] = { -+ { .compatible = "qcom,ipq4019-mdio" }, -+ { } -+}; -+MODULE_DEVICE_TABLE(of, ipq40xx_mdio_dt_ids); -+ -+static struct platform_driver ipq40xx_mdio_driver = { -+ .probe = ipq40xx_mdio_probe, -+ .remove = ipq40xx_mdio_remove, -+ .driver = { -+ .name = "ipq40xx-mdio", -+ .of_match_table = ipq40xx_mdio_dt_ids, -+ }, -+}; -+ -+module_platform_driver(ipq40xx_mdio_driver); -+ -+#define DRV_VERSION "1.0" -+ -+MODULE_DESCRIPTION("IPQ40XX MDIO interface driver"); -+MODULE_AUTHOR("Qualcomm Atheros"); -+MODULE_VERSION(DRV_VERSION); -+MODULE_LICENSE("Dual BSD/GPL"); diff --git a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch b/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch index 6f080892d5..9adddcabc3 100644 --- a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch +++ b/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch @@ -1,12 +1,12 @@ --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -584,6 +584,13 @@ config MDIO_IPQ40XX - This driver supports the MDIO interface found in Qualcomm - Atheros ipq40xx Soc chip. +@@ -584,6 +584,13 @@ config XILINX_GMII2RGMII + the Reduced Gigabit Media Independent Interface(RGMII) between + Ethernet physical media devices and the Gigabit Ethernet controller. +config AR40XX_PHY + tristate "Driver for Qualcomm Atheros IPQ40XX switches" -+ depends on HAS_IOMEM && OF ++ depends on HAS_IOMEM && OF && OF_MDIO + select SWCONFIG + help + This is the driver for Qualcomm Atheros IPQ40XX ESS switches. diff --git a/target/linux/ipq40xx/patches-5.4/706-dt-bindings-net-add-QCA807x-PHY.patch b/target/linux/ipq40xx/patches-5.4/706-dt-bindings-net-add-QCA807x-PHY.patch new file mode 100644 index 0000000000..dfb8d692ab --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/706-dt-bindings-net-add-QCA807x-PHY.patch @@ -0,0 +1,61 @@ +From c66863c1ba8995b61e6d727d78a241c734f5bb57 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Thu, 1 Oct 2020 15:05:35 +0200 +Subject: [PATCH] dt-bindings: net: add QCA807x PHY + +Add DT bindings for Qualcomm QCA807x PHY series. + +Signed-off-by: Robert Marko +--- + include/dt-bindings/net/qcom-qca807x.h | 45 ++++++++++++++++++++++++++ + 1 file changed, 45 insertions(+) + create mode 100644 include/dt-bindings/net/qcom-qca807x.h + +--- /dev/null ++++ b/include/dt-bindings/net/qcom-qca807x.h +@@ -0,0 +1,45 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Device Tree constants for the Qualcomm QCA807X PHYs ++ */ ++ ++#ifndef _DT_BINDINGS_QCOM_QCA807X_H ++#define _DT_BINDINGS_QCOM_QCA807X_H ++ ++#define PSGMII_QSGMII_TX_DRIVER_140MV 0 ++#define PSGMII_QSGMII_TX_DRIVER_160MV 1 ++#define PSGMII_QSGMII_TX_DRIVER_180MV 2 ++#define PSGMII_QSGMII_TX_DRIVER_200MV 3 ++#define PSGMII_QSGMII_TX_DRIVER_220MV 4 ++#define PSGMII_QSGMII_TX_DRIVER_240MV 5 ++#define PSGMII_QSGMII_TX_DRIVER_260MV 6 ++#define PSGMII_QSGMII_TX_DRIVER_280MV 7 ++#define PSGMII_QSGMII_TX_DRIVER_300MV 8 ++#define PSGMII_QSGMII_TX_DRIVER_320MV 9 ++#define PSGMII_QSGMII_TX_DRIVER_400MV 10 ++#define PSGMII_QSGMII_TX_DRIVER_500MV 11 ++/* Default value */ ++#define PSGMII_QSGMII_TX_DRIVER_600MV 12 ++ ++/* Full amplitude, full bias current */ ++#define QCA807X_CONTROL_DAC_FULL_VOLT_BIAS 0 ++/* Amplitude follow DSP (amplitude is adjusted based on cable length), half bias current */ ++#define QCA807X_CONTROL_DAC_DSP_VOLT_HALF_BIAS 1 ++/* Full amplitude, bias current follow DSP (bias current is adjusted based on cable length) */ ++#define QCA807X_CONTROL_DAC_FULL_VOLT_DSP_BIAS 2 ++/* Both amplitude and bias current follow DSP */ ++#define QCA807X_CONTROL_DAC_DSP_VOLT_BIAS 3 ++/* Full amplitude, half bias current */ ++#define QCA807X_CONTROL_DAC_FULL_VOLT_HALF_BIAS 4 ++/* Amplitude follow DSP setting; 1/4 bias current when cable<10m, ++ * otherwise half bias current ++ */ ++#define QCA807X_CONTROL_DAC_DSP_VOLT_QUARTER_BIAS 5 ++/* Full amplitude; same bias current setting with “010” and “011”, ++ * but half more bias is reduced when cable <10m ++ */ ++#define QCA807X_CONTROL_DAC_FULL_VOLT_HALF_BIAS_SHORT 6 ++/* Amplitude follow DSP; same bias current setting with “110”, default value */ ++#define QCA807X_CONTROL_DAC_DSP_VOLT_HALF_BIAS_SHORT 7 ++ ++#endif diff --git a/target/linux/ipq40xx/patches-5.4/707-net-phy-Add-Qualcom-QCA807x-driver.patch b/target/linux/ipq40xx/patches-5.4/707-net-phy-Add-Qualcom-QCA807x-driver.patch new file mode 100644 index 0000000000..b71b28d941 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/707-net-phy-Add-Qualcom-QCA807x-driver.patch @@ -0,0 +1,50 @@ +From f825cdc8bfde7616a14e2163f16303a8973031d2 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Wed, 7 Oct 2020 17:38:48 +0200 +Subject: [PATCH] net: phy: Add Qualcom QCA807x driver + +This adds driver for the Qualcomm QCA8072 and QCA8075 PHY-s. + +They are 2 or 5 port IEEE 802.3 clause 22 compliant 10BASE-Te, 100BASE-TX and 1000BASE-T PHY-s. + +They feature 2 SerDes, one for PSGMII or QSGMII connection with MAC, while second one is SGMII for connection to MAC or fiber. + +Both models have a combo port that supports 1000BASE-X and 100BASE-FX fiber. + +Each PHY inside of QCA807x series has 4 digitally controlled output only pins that natively drive LED-s. +But some vendors used these to driver generic LED-s controlled by userspace, +so lets enable registering each PHY as GPIO controller and add driver for it. + +These are commonly used in Qualcomm IPQ40xx, IPQ60xx and IPQ807x boards. + +Signed-off-by: Robert Marko +--- + drivers/net/phy/Kconfig | 6 ++++++ + drivers/net/phy/Makefile | 1 + + 2 files changed, 7 insertions(+) + +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig +@@ -537,6 +537,12 @@ config NXP_TJA11XX_PHY + ---help--- + Currently supports the NXP TJA1100 and TJA1101 PHY. + ++config QCA807X_PHY ++ tristate "Qualcomm QCA807X PHYs" ++ depends on OF_MDIO ++ help ++ Currently supports the QCA8072 and QCA8075 models. ++ + config QSEMI_PHY + tristate "Quality Semiconductor PHYs" + ---help--- +--- a/drivers/net/phy/Makefile ++++ b/drivers/net/phy/Makefile +@@ -103,6 +103,7 @@ obj-$(CONFIG_MICROSEMI_PHY) += mscc.o + obj-$(CONFIG_NATIONAL_PHY) += national.o + obj-$(CONFIG_NXP_TJA11XX_PHY) += nxp-tja11xx.o + obj-$(CONFIG_QSEMI_PHY) += qsemi.o ++obj-$(CONFIG_QCA807X_PHY) += qca807x.o + obj-$(CONFIG_REALTEK_PHY) += realtek.o + obj-$(CONFIG_RENESAS_PHY) += uPD60620.o + obj-$(CONFIG_ROCKCHIP_PHY) += rockchip.o diff --git a/target/linux/ipq40xx/patches-5.4/708-arm-dts-ipq4019-QCA807x-properties.patch b/target/linux/ipq40xx/patches-5.4/708-arm-dts-ipq4019-QCA807x-properties.patch new file mode 100644 index 0000000000..4b04a3ce9a --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/708-arm-dts-ipq4019-QCA807x-properties.patch @@ -0,0 +1,62 @@ +From e0fa88eaa3c176b71e563da68949ac2ab45aaa61 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Fri, 2 Oct 2020 10:43:26 +0200 +Subject: [PATCH] arm: dts: ipq4019: QCA807x properties + +This adds necessary DT properties for QCA807x PHY-s to IPQ4019 DTSI. + +Signed-off-by: Robert Marko +--- + arch/arm/boot/dts/qcom-ipq4019.dtsi | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + / { + #address-cells = <1>; +@@ -597,22 +598,39 @@ + + ethphy0: ethernet-phy@0 { + reg = <0>; ++ ++ qcom,control-dac = ; + }; + + ethphy1: ethernet-phy@1 { + reg = <1>; ++ ++ qcom,control-dac = ; + }; + + ethphy2: ethernet-phy@2 { + reg = <2>; ++ ++ qcom,control-dac = ; + }; + + ethphy3: ethernet-phy@3 { + reg = <3>; ++ ++ qcom,control-dac = ; + }; + + ethphy4: ethernet-phy@4 { + reg = <4>; ++ ++ qcom,control-dac = ; ++ }; ++ ++ psgmiiphy: psgmii-phy@5 { ++ reg = <5>; ++ ++ qcom,tx-driver-strength = ; ++ qcom,psgmii-az; + }; + }; + diff --git a/target/linux/ipq40xx/patches-5.4/710-net-add-qualcomm-essedma-ethernet-driver.patch b/target/linux/ipq40xx/patches-5.4/710-net-add-qualcomm-essedma-ethernet-driver.patch index 87037eb3a8..1a6be0d175 100644 --- a/target/linux/ipq40xx/patches-5.4/710-net-add-qualcomm-essedma-ethernet-driver.patch +++ b/target/linux/ipq40xx/patches-5.4/710-net-add-qualcomm-essedma-ethernet-driver.patch @@ -11,13 +11,14 @@ Signed-off-by: Christian Lamparter --- a/drivers/net/ethernet/qualcomm/Kconfig +++ b/drivers/net/ethernet/qualcomm/Kconfig -@@ -62,4 +62,13 @@ config QCOM_EMAC +@@ -62,4 +62,14 @@ config QCOM_EMAC source "drivers/net/ethernet/qualcomm/rmnet/Kconfig" +config ESSEDMA + tristate "Qualcomm Atheros ESS Edma support" -+ ---help--- ++ depends on OF_MDIO ++ help + This driver supports ethernet edma adapter. + Say Y to build this driver. + diff --git a/target/linux/ipq40xx/patches-5.4/711-dts-ipq4019-add-ethernet-essedma-node.patch b/target/linux/ipq40xx/patches-5.4/711-dts-ipq4019-add-ethernet-essedma-node.patch index 6db4241234..7b2ddfe00d 100644 --- a/target/linux/ipq40xx/patches-5.4/711-dts-ipq4019-add-ethernet-essedma-node.patch +++ b/target/linux/ipq40xx/patches-5.4/711-dts-ipq4019-add-ethernet-essedma-node.patch @@ -16,7 +16,7 @@ Signed-off-by: Christian Lamparter --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -38,6 +38,8 @@ +@@ -39,6 +39,8 @@ spi1 = &blsp1_spi2; i2c0 = &blsp1_i2c3; i2c1 = &blsp1_i2c4; @@ -25,7 +25,7 @@ Signed-off-by: Christian Lamparter }; cpus { -@@ -639,6 +641,64 @@ +@@ -657,6 +659,64 @@ status = "disabled"; }; diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index 62c367bda5..e5d4de2d14 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,56 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,60 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -18,6 +18,7 @@ Signed-off-by: John Crispin + qcom-ipq4018-ap120c-ac.dtb \ + qcom-ipq4018-dap-2610.dtb \ + qcom-ipq4018-cs-w3-wd1200g-eup.dtb \ ++ qcom-ipq4018-magic-2-wifi-next.dtb \ + qcom-ipq4018-ea6350v3.dtb \ + qcom-ipq4018-eap1300.dtb \ + qcom-ipq4018-ecw5211.dtb \ @@ -27,9 +28,12 @@ Signed-off-by: John Crispin + qcom-ipq4018-ex6100v2.dtb \ + qcom-ipq4018-ex6150v2.dtb \ + qcom-ipq4018-fritzbox-4040.dtb \ ++ qcom-ipq4018-gl-ap1300.dtb \ + qcom-ipq4018-jalapeno.dtb \ + qcom-ipq4018-meshpoint-one.dtb \ + qcom-ipq4018-nbg6617.dtb \ ++ qcom-ipq4019-oap100.dtb \ ++ qcom-ipq4018-pa1200.dtb \ + qcom-ipq4018-rt-ac58u.dtb \ + qcom-ipq4018-wre6606.dtb \ + qcom-ipq4018-wrtq-329acn.dtb \ @@ -52,7 +56,7 @@ Signed-off-by: John Crispin + qcom-ipq4019-r619ac.dtb \ + qcom-ipq4019-r619ac-128m.dtb \ + qcom-ipq4019-habanero-dvk.dtb \ -+ qcom-ipq4019-oap100.dtb \ ++ qcom-ipq4019-pa2200.dtb \ + qcom-ipq4019-rtl30vw.dtb \ + qcom-ipq4019-u4019-32m.dtb \ + qcom-ipq4019-wpj419.dtb \ diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index c23f25540b..fed821663a 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -27,6 +27,9 @@ nec,wg2600hp) ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy0tpt" ucidef_set_led_switch "wan" "WAN" "green:active" "switch0" "0x2" ;; +nec,wg2600hp3) + ucidef_set_led_switch "wan" "WAN" "green:active" "switch0" "0x2" + ;; netgear,d7800 |\ netgear,r7500 |\ netgear,r7500v2 |\ diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 3f9d96881d..10b2ec0148 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -12,6 +12,11 @@ board_config_update board=$(board_name) case "$board" in +asrock,g10 |\ +nec,wg2600hp) + ucidef_add_switch "switch0" \ + "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "1:wan" "0@eth0" + ;; buffalo,wxr-2533dhp |\ compex,wpq864 |\ netgear,d7800 |\ @@ -41,9 +46,9 @@ linksys,ea8500) ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "wan" "$hw_mac_addr" ;; -nec,wg2600hp) +nec,wg2600hp3) ucidef_add_switch "switch0" \ - "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "1:wan" "0@eth0" + "2:lan" "3:lan" "4:lan" "5:lan" "0@eth1" "1:wan" "6@eth0" ;; netgear,r7800 |\ tplink,c2600) diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 74ad00c5ce..8788fc92f6 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -9,6 +9,9 @@ board=$(board_name) case "$FIRMWARE" in "ath10k/pre-cal-pci-0000:01:00.0.bin") case $board in + asrock,g10) + caldata_extract "0:ART" 0x1000 0x2f20 + ;; buffalo,wxr-2533dhp) caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary ART 0x1e) @@ -21,7 +24,8 @@ case "$FIRMWARE" in caldata_extract "art" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +1) ;; - nec,wg2600hp) + nec,wg2600hp |\ + nec,wg2600hp3) caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0x12) ;; @@ -47,6 +51,9 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-pci-0001:01:00.0.bin") case $board in + asrock,g10) + caldata_extract "0:ART" 0x5000 0x2f20 + ;; buffalo,wxr-2533dhp) caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary ART 0x18) @@ -56,7 +63,8 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +2) ;; - nec,wg2600hp) + nec,wg2600hp |\ + nec,wg2600hp3) caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0xc) ;; diff --git a/target/linux/ipq806x/base-files/etc/init.d/bootcount b/target/linux/ipq806x/base-files/etc/init.d/bootcount index 77965e647b..7a54c34dba 100755 --- a/target/linux/ipq806x/base-files/etc/init.d/bootcount +++ b/target/linux/ipq806x/base-files/etc/init.d/bootcount @@ -2,8 +2,16 @@ START=99 +. /lib/upgrade/asrock.sh + boot() { case $(board_name) in + asrock,g10) + asrock_bootconfig_mangle "bootcheck" + if [ $? -eq 0 ]; then + reboot + fi + ;; edgecore,ecw5410) fw_setenv bootcount 0 ;; diff --git a/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh b/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh new file mode 100644 index 0000000000..ca8d0b1555 --- /dev/null +++ b/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh @@ -0,0 +1,14 @@ +. /lib/functions.sh + +preinit_set_mac_address() { + case $(board_name) in + asrock,g10) + lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address) + wan_mac=$(mtd_get_mac_ascii hwconfig HW.WAN.MAC.Address) + ip link set dev eth0 address "${lan_mac}" + ip link set dev eth1 address "${wan_mac}" + ;; + esac +} + +boot_hook_add preinit_main preinit_set_mac_address diff --git a/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh new file mode 100644 index 0000000000..9e1376a578 --- /dev/null +++ b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh @@ -0,0 +1,54 @@ +. /lib/functions.sh + +asrock_bootconfig_mangle() { + local mtdnum="$( find_mtd_index 0:BOOTCONFIG )" + + if [ -z "$mtdnum" ]; then + echo "cannot find bootconfig mtd partition" + return 1 + fi + dd if=/dev/mtd$mtdnum of=/tmp/mtd$mtdnum bs=1k + + local partition_byte="$(dd if=/tmp/mtd$mtdnum bs=1 skip=52 count=1)" + local upgrade_byte="$(dd if=/tmp/mtd$mtdnum bs=1 skip=4 count=1)" + + if [ $1 = "bootcheck" ]; then + if [ ! -s $upgrade_byte ]; then + dd if=/dev/mtd$mtdnum of=/tmp/mtd$mtdnum bs=1k + printf '\x00' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=4 + printf '\x00' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=56 + else + return 1 + fi + elif [ $1 = "sysupgrade" ]; then + printf '\x01' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=4 + printf '\x01' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=56 + fi + + if [ -s $partition_byte ]; then + printf '\x01' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=52 + else + printf '\x00' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=52 + fi + + mtd write /tmp/mtd$mtdnum /dev/mtd$mtdnum + return 0 +} + +asrock_upgrade_prepare() { + local ubidev="$( nand_find_ubi ubi )" + + #Set upgrade flag. If something goes wrong, router will boot with + #factory firmware. + asrock_bootconfig_mangle 'sysupgrade' + + if [ $? -ne 0 ]; then + echo "cannot find bootconfig mtd partition" + exit 1 + fi + + # Just delete these partitions if present and use + # OpenWrt's standard names for those. + ubirmvol /dev/$ubidev -N ubi_rootfs &> /dev/null || true + ubirmvol /dev/$ubidev -N ubi_rootfs_data &> /dev/null || true +} diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index f61e8ee878..f5d6c5d55d 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -10,6 +10,10 @@ platform_check_image() { platform_do_upgrade() { case "$(board_name)" in + asrock,g10) + asrock_upgrade_prepare + nand_do_upgrade "$1" + ;; buffalo,wxr-2533dhp) buffalo_upgrade_prepare_ubi CI_ROOTPART="ubi_rootfs" diff --git a/target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory b/target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory new file mode 100755 index 0000000000..0ab6f176d0 --- /dev/null +++ b/target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory @@ -0,0 +1,15 @@ +#!/bin/sh + +. /lib/upgrade/asrock.sh + +case $(board_name) in +asrock,g10) + asrock_bootconfig_mangle "factory" + if [ $? -eq 0 ]; then + reboot + fi + ;; +*) + echo "Unsupported hardware." + ;; +esac diff --git a/target/linux/ipq806x/config-5.4 b/target/linux/ipq806x/config-5.4 index 20870f75c0..e6160bd455 100644 --- a/target/linux/ipq806x/config-5.4 +++ b/target/linux/ipq806x/config-5.4 @@ -78,6 +78,7 @@ CONFIG_CC_HAS_KASAN_GENERIC=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE_OVERRIDE=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y CONFIG_COMPAT_32BIT_TIME=y @@ -324,8 +325,6 @@ CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NEED_DMA_MAP_STATE=y diff --git a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-g10.dts b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-g10.dts new file mode 100644 index 0000000000..15ed5b4773 --- /dev/null +++ b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-g10.dts @@ -0,0 +1,242 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "qcom-ipq8064-v2.0.dtsi" + +#include +#include + +/ { + compatible = "asrock,g10", "qcom,ipq8064"; + model = "ASRock G10"; + + aliases { + ethernet0 = &gmac1; + ethernet1 = &gmac0; + + led-boot = &led_status_blue; + led-failsafe = &led_status_amber; + led-running = &led_status_blue; + led-upgrade = &led_status_amber; + }; + + chosen { + bootargs-override = "console=ttyMSM0,115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; + + /* + * this is a bit misleading. Because there are about seven + * multicolor LEDs connected all wired together in parallel. + */ + + status_yellow { + label = "yellow:status"; + gpios = <&qcom_pinmux 8 GPIO_ACTIVE_HIGH>; + }; + + led_status_amber: status_amber { + label = "amber:status"; + gpios = <&qcom_pinmux 7 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&qcom_pinmux 9 GPIO_ACTIVE_HIGH>; + }; + + /* + * LED is declared in vendors boardfile but it's not + * working and the manual doesn't mention anything + * about the LED being white. + + status_white { + label = "white:status"; + gpios = <&qcom_pinmux 26 GPIO_ACTIVE_HIGH>; + }; + */ + }; + + i2c-gpio { + #address-cells = <1>; + #size-cells = <0>; + + compatible = "i2c-gpio"; + gpios = <&qcom_pinmux 53 GPIO_ACTIVE_HIGH>, /* sda */ + <&qcom_pinmux 54 GPIO_ACTIVE_HIGH>; /* scl */ + i2c-gpio,delay-us = <5>; + i2c-gpio,scl-output-only; + + mcu@50 { + reg = <0x50>; + compatible = "sonix,sn8f25e21"; + }; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + ir-remote { + label = "ir-remote"; + gpios = <&qcom_pinmux 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps5g { + label = "wps5g"; + gpios = <&qcom_pinmux 64 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps2g { + label = "wps2g"; + gpios = <&qcom_pinmux 65 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&adm_dma { + status = "okay"; +}; + +&gmac1 { + status = "okay"; + + pinctrl-0 = <&rgmii2_pins>; + pinctrl-names = "default"; + + phy-mode = "rgmii"; + qcom,id = <1>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gmac2 { + status = "okay"; + + phy-mode = "sgmii"; + qcom,id = <2>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gsbi4_serial { + pinctrl-0 = <&uart0_pins>; + pinctrl-names = "default"; +}; + +&mdio0 { + status = "okay"; + + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + ethernet-phy@0 { + reg = <0>; + qca,ar8327-initvals = < + 0x00004 0x7600000 /* PAD0_MODE */ + 0x00008 0x1000000 /* PAD5_MODE */ + 0x0000c 0x80 /* PAD6_MODE */ + 0x000e4 0x6a545 /* MAC_POWER_SEL */ + 0x000e0 0xc74164de /* SGMII_CTRL */ + 0x0007c 0x4e /* PORT0_STATUS */ + 0x00094 0x4e /* PORT6_STATUS */ + >; + }; +}; + +&nand_controller { + status = "okay"; + + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + nand@0 { + reg = <0>; + compatible = "qcom,nandcs"; + + nand-ecc-strength = <4>; + nand-bus-width = <8>; + nand-ecc-step-size = <512>; + + partitions { + compatible = "qcom,smem"; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&pcie1 { + status = "okay"; +}; + +&qcom_pinmux { + led_pins: led_pins { + mux { + pins = "gpio7", "gpio8", "gpio9", "gpio26"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + button_pins: button_pins { + mux { + pins = "gpio15", "gpio16", "gpio64", "gpio65"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + uart0_pins: uart0_pins { + mux { + pins = "gpio10", "gpio11"; + function = "gsbi4"; + drive-strength = <10>; + bias-disable; + }; + }; +}; + +&rpm { + pinctrl-0 = <&i2c4_pins>; + pinctrl-names = "default"; +}; + +&usb3_0 { + status = "okay"; +}; + +&usb3_1 { + status = "okay"; +}; + +&tcsr { + qcom,usb-ctrl-select = ; +}; + +/delete-node/ &pcie2_pins; +/delete-node/ &pcie2; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts new file mode 100644 index 0000000000..d234b94a46 --- /dev/null +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts @@ -0,0 +1,430 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq8062.dtsi" +#include + +/delete-node/ &nand_pins; + +/ { + model = "NEC Platforms Aterm WG2600HP3"; + compatible = "nec,wg2600hp3", "qcom,ipq8062", "qcom,ipq8064"; + + memory { + device_type = "memory"; + reg = <0x42000000 0x1e000000>; + }; + + aliases { + label-mac-device = &gmac2; + + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_red; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-0 = <&buttons_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 24 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&qcom_pinmux 22 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + mode0 { + label = "mode0"; + gpios = <&qcom_pinmux 40 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + mode1 { + label = "mode1"; + gpios = <&qcom_pinmux 41 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-0 = <&leds_pins>; + pinctrl-names = "default"; + + led_power_green: power_green { + label = "green:power"; + gpios = <&qcom_pinmux 14 GPIO_ACTIVE_HIGH>; + }; + + led_power_red: power_red { + label = "red:power"; + gpios = <&qcom_pinmux 35 GPIO_ACTIVE_HIGH>; + }; + + active_green { + label = "green:active"; + gpios = <&qcom_pinmux 42 GPIO_ACTIVE_HIGH>; + }; + + active_red { + label = "red:active"; + gpios = <&qcom_pinmux 38 GPIO_ACTIVE_HIGH>; + }; + + wlan2g_green { + label = "green:wlan2g"; + gpios = <&qcom_pinmux 55 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + + wlan2g_red { + label = "red:wlan2g"; + gpios = <&qcom_pinmux 56 GPIO_ACTIVE_HIGH>; + }; + + wlan5g_green { + label = "green:wlan5g"; + gpios = <&qcom_pinmux 57 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g_red { + label = "red:wlan5g"; + gpios = <&qcom_pinmux 58 GPIO_ACTIVE_HIGH>; + }; + + tv_green { + label = "green:tv"; + gpios = <&qcom_pinmux 46 GPIO_ACTIVE_HIGH>; + }; + + tv_red { + label = "red:tv"; + gpios = <&qcom_pinmux 36 GPIO_ACTIVE_HIGH>; + }; + + converter_green { + label = "green:converter"; + gpios = <&qcom_pinmux 43 GPIO_ACTIVE_HIGH>; + }; + + converter_red { + label = "red:converter"; + gpios = <&qcom_pinmux 15 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&qcom_pinmux { + pinctrl-0 = <&akro_pins>; + pinctrl-names = "default"; + + spi_pins: spi_pins { + mux { + pins = "gpio18", "gpio19", "gpio21"; + function = "gsbi5"; + bias-pull-down; + }; + + data { + pins = "gpio18", "gpio19"; + drive-strength = <10>; + }; + + cs { + pins = "gpio20"; + drive-strength = <10>; + }; + + clk { + pins = "gpio21"; + drive-strength = <12>; + }; + }; + + buttons_pins: buttons_pins { + mux { + pins = "gpio22", "gpio24", "gpio40", + "gpio41"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + leds_pins: leds_pins { + mux { + pins = "gpio14", "gpio15", "gpio35", + "gpio36", "gpio38", "gpio42", + "gpio43", "gpio46", "gpio55", + "gpio56", "gpio57", "gpio58"; + function = "gpio"; + bias-pull-down; + }; + + akro2 { + pins = "gpio15", "gpio35", "gpio38", + "gpio42", "gpio43", "gpio46", + "gpio55", "gpio56", "gpio57", + "gpio58"; + drive-strength = <2>; + }; + + akro4 { + pins = "gpio14", "gpio36"; + drive-strength = <4>; + }; + }; + + /* + * Stock firmware has the following settings, so let's do the same. + * I don't sure why these are required. + */ + akro_pins: akro_pinmux { + akro { + pins = "gpio17", "gpio26", "gpio47"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + reset { + pins = "gpio45"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + output-low; + }; + + gmac0_rgmii { + pins = "gpio25"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + }; + }; +}; + +&gsbi5 { + status = "okay"; + qcom,mode = ; + + spi@1a280000 { + status = "okay"; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; + + 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 = "SBL1"; + reg = <0x0000000 0x0020000>; + read-only; + }; + + partition@20000 { + label = "MIBIB"; + reg = <0x0020000 0x0020000>; + read-only; + }; + + partition@40000 { + label = "SBL2"; + reg = <0x0040000 0x0040000>; + read-only; + }; + + partition@80000 { + label = "SBL3"; + reg = <0x0080000 0x0080000>; + read-only; + }; + + partition@100000 { + label = "DDRCONFIG"; + reg = <0x0100000 0x0010000>; + read-only; + }; + + partition@110000 { + label = "SSD"; + reg = <0x0110000 0x0010000>; + read-only; + }; + + partition@120000 { + label = "TZ"; + reg = <0x0120000 0x0080000>; + read-only; + }; + + partition@1a0000 { + label = "RPM"; + reg = <0x01a0000 0x0080000>; + read-only; + }; + + partition@220000 { + label = "APPSBL"; + reg = <0x0220000 0x0080000>; + read-only; + }; + + partition@2a0000 { + label = "APPSBLENV"; + reg = <0x02a0000 0x0010000>; + read-only; + }; + + factory: partition@2b0000 { + label = "PRODUCTDATA"; + reg = <0x02b0000 0x0030000>; + read-only; + }; + + partition@2e0000 { + label = "ART"; + reg = <0x02e0000 0x0040000>; + read-only; + }; + + partition@320000 { + label = "TP"; + reg = <0x0320000 0x0040000>; + read-only; + }; + + partition@360000 { + label = "TINY"; + reg = <0x0360000 0x0500000>; + read-only; + }; + + partition@860000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0860000 0x17a0000>; + }; + }; + }; + }; +}; + +&adm_dma { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + reg = <0x00010000 0 0 0 0>; + + qcom,ath10k-calibration-variant = "NEC-Platforms-WG2600HP3"; + }; + }; +}; + +&pcie1 { + status = "okay"; + force_gen1 = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + reg = <0x00010000 0 0 0 0>; + + ieee80211-freq-limit = <2400000 2483000>; + qcom,ath10k-calibration-variant = "NEC-Platforms-WG2600HP3"; + }; + }; +}; + +&mdio0 { + status = "okay"; + + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + phy0: ethernet-phy@0 { + reg = <0>; + qca,ar8327-initvals = < + 0x04 0x80080080 /* PAD0_MODE */ + 0x0c 0x06000000 /* PAD6_MODE */ + 0x10 0x002613a0 /* PWS_REG */ + 0x50 0xcc36cc36 /* LED_CTRL0 */ + 0x54 0xca36ca36 /* LED_CTRL1 */ + 0x58 0xc936c936 /* LED_CTRL2 */ + 0x5c 0x03ffff00 /* LED_CTRL3 */ + 0x7c 0x0000004e /* PORT0_STATUS */ + 0x94 0x0000004e /* PORT6_STATUS */ + 0xe0 0xc74164de /* SGMII_CTRL */ + 0xe4 0x0006a545 /* MAC_PWR_SEL */ + >; + }; +}; + +&gmac1 { + status = "okay"; + + pinctrl-0 = <&rgmii2_pins>; + pinctrl-names = "default"; + + phy-mode = "rgmii"; + qcom,id = <1>; + mdiobus = <&mdio0>; + mtd-mac-address = <&factory 0x0>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gmac2 { + status = "okay"; + phy-mode = "sgmii"; + qcom,id = <2>; + mdiobus = <&mdio0>; + mtd-mac-address = <&factory 0x6>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062.dtsi new file mode 100644 index 0000000000..caef2bc824 --- /dev/null +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062.dtsi @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include "qcom-ipq8064.dtsi" + +/ { + model = "Qualcomm IPQ8062"; + compatible = "qcom,ipq8062", "qcom,ipq8064"; + + aliases { + serial0 = &gsbi4_serial; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + cpus { + qcom,l2 { + qcom,l2-rates = <384000000 1000000000 1000000000>; + qcom,l2-cpufreq = <384000000 600000000 1000000000>; + qcom,l2-volt = <1100000 1100000 1100000>; + }; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + rsvd@41200000 { + reg = <0x41200000 0x300000>; + no-map; + }; + }; +}; + +&gsbi4 { + qcom,mode = ; + status = "okay"; + + serial@16340000 { + status = "okay"; + }; + /* + * The i2c device on gsbi4 should not be enabled. + * On ipq806x designs gsbi4 i2c is meant for exclusive + * RPM usage. Turning this on in kernel manifests as + * i2c failure for the RPM. + */ +}; + +&opp_table0 { + /delete-node/opp-1200000000; + /delete-node/opp-1400000000; + + opp-384000000 { + opp-microvolt-speed0-pvs0-v0 = <950000>; + opp-microvolt-speed0-pvs1-v0 = <900000>; + opp-microvolt-speed0-pvs2-v0 = <850000>; + opp-microvolt-speed0-pvs3-v0 = <800000>; + }; + + opp-600000000 { + opp-microvolt-speed0-pvs0-v0 = <1000000>; + opp-microvolt-speed0-pvs1-v0 = <950000>; + opp-microvolt-speed0-pvs2-v0 = <900000>; + opp-microvolt-speed0-pvs3-v0 = <850000>; + }; + + opp-800000000 { + opp-microvolt-speed0-pvs0-v0 = <1050000>; + opp-microvolt-speed0-pvs1-v0 = <1000000>; + opp-microvolt-speed0-pvs2-v0 = <950000>; + opp-microvolt-speed0-pvs3-v0 = <900000>; + }; + + opp-1000000000 { + opp-microvolt-speed0-pvs0-v0 = <1100000>; + opp-microvolt-speed0-pvs1-v0 = <1050000>; + opp-microvolt-speed0-pvs2-v0 = <1000000>; + opp-microvolt-speed0-pvs3-v0 = <950000>; + }; +}; + +&pcie0 { + compatible = "qcom,pcie-ipq8064-v2"; +}; + +&pcie1 { + compatible = "qcom,pcie-ipq8064-v2"; +}; + +&pcie2 { + compatible = "qcom,pcie-ipq8064-v2"; +}; + +&smb208_s2a { + regulator-max-microvolt = <1150000>; +}; + +&smb208_s2b { + regulator-max-microvolt = <1150000>; +}; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts index 7fb871be78..229596b082 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts @@ -283,13 +283,17 @@ &gmac1 { status = "okay"; phy-mode = "rgmii"; - phy-handle = <&phy4>; qcom,id = <1>; pinctrl-0 = <&rgmii2_pins>; pinctrl-names = "default"; mtd-mac-address = <&art 6>; + + fixed-link { + speed = <1000>; + full-duplex; + }; }; &gmac2 { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts index 1a6b7eb4d6..23898e0221 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts @@ -119,6 +119,10 @@ }; }; +&CPU_SPC { + status = "disabled"; +}; + &adm_dma { status = "okay"; }; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index ec73630ae5..80bfec5ad9 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -13,6 +13,16 @@ define Build/buffalo-rootfs-cksum ) >> $@ endef +define Build/edimax-header + $(eval edimax_model=$(word 1,$(1))) + + $(STAGING_DIR_HOST)/bin/mkedimaximg \ + -b -s CSYS -m $(edimax_model) \ + -f 0x70000 -S 0x1200000 \ + -i $@ -o $@.new + @mv $@.new $@ +endef + define Device/Default PROFILES := Default KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) @@ -82,6 +92,20 @@ define Device/ZyXELImage IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata endef +define Device/asrock_g10 + $(call Device/FitImage) + $(call Device/UbiFit) + SOC := qcom-ipq8064 + DEVICE_VENDOR := ASRock + DEVICE_MODEL := G10 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 5332k + DEVICE_PACKAGES := kmod-i2c-gpio ath10k-firmware-qca99x0-ct + IMAGE/nand-factory.bin := append-ubi | edimax-header RN67 +endef +TARGET_DEVICES += asrock_g10 + define Device/buffalo_wxr-2533dhp $(call Device/LegacyImage) SOC := qcom-ipq8064 @@ -169,6 +193,20 @@ define Device/nec_wg2600hp endef TARGET_DEVICES += nec_wg2600hp +define Device/nec_wg2600hp3 + $(call Device/LegacyImage) + DEVICE_VENDOR := NEC Platforms + DEVICE_MODEL := Aterm WG2600HP3 + SOC := qcom-ipq8062 + BLOCKSIZE := 64k + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := -kmod-ata-ahci -kmod-ata-ahci-platform -kmod-usb-ohci -kmod-usb2 \ + -kmod-usb-ledtrig-usbport -kmod-usb-phy-qcom-dwc3 -kmod-usb3 -kmod-usb-dwc3-qcom \ + ath10k-firmware-qca9984-ct ipq-wifi-nec_wg2600hp3 +endef +TARGET_DEVICES += nec_wg2600hp3 + define Device/netgear_d7800 $(call Device/DniImage) DEVICE_VENDOR := NETGEAR diff --git a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch index 7e15b87e39..795684cdf5 100644 --- a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch @@ -10,9 +10,10 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -843,6 +843,20 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -843,6 +843,22 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-ipq4019-ap.dk07.1-c1.dtb \ qcom-ipq4019-ap.dk07.1-c2.dtb \ ++ qcom-ipq8062-wg2600hp3.dtb \ qcom-ipq8064-ap148.dtb \ + qcom-ipq8064-c2600.dtb \ + qcom-ipq8064-d7800.dtb \ @@ -20,6 +21,7 @@ Signed-off-by: John Crispin + qcom-ipq8064-ap161.dtb \ + qcom-ipq8064-ea7500-v1.dtb \ + qcom-ipq8064-ea8500.dtb \ ++ qcom-ipq8064-g10.dtb \ + qcom-ipq8064-r7500.dtb \ + qcom-ipq8064-r7500v2.dtb \ + qcom-ipq8064-wg2600hp.dtb \ diff --git a/target/linux/ipq806x/patches-5.4/900-arm-add-cmdline-override.patch b/target/linux/ipq806x/patches-5.4/900-arm-add-cmdline-override.patch new file mode 100644 index 0000000000..bb3aa2622c --- /dev/null +++ b/target/linux/ipq806x/patches-5.4/900-arm-add-cmdline-override.patch @@ -0,0 +1,37 @@ +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -1836,6 +1836,14 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGL + Only command line ATAG will be processed, the rest of the ATAGs + sent by bootloader will be ignored. + ++config CMDLINE_OVERRIDE ++ bool "Use alternative cmdline from device tree" ++ help ++ Some bootloaders may have uneditable bootargs. While CMDLINE_FORCE can ++ be used, this is not a good option for kernels that are shared across ++ devices. This setting enables using "chosen/cmdline-override" as the ++ cmdline if it exists in the device tree. ++ + endchoice + + config CMDLINE +--- a/drivers/of/fdt.c ++++ b/drivers/of/fdt.c +@@ -1060,6 +1060,17 @@ int __init early_init_dt_scan_chosen(uns + if (p != NULL && l > 0) + strlcpy(data, p, min(l, COMMAND_LINE_SIZE)); + ++ /* CONFIG_CMDLINE_OVERRIDE is used to fallback to a different ++ * device tree option of chosen/bootargs-override. This is ++ * helpful on boards where u-boot sets bootargs, and is unable ++ * to be modified. ++ */ ++#ifdef CONFIG_CMDLINE_OVERRIDE ++ p = of_get_flat_dt_prop(node, "bootargs-override", &l); ++ if (p != NULL && l > 0) ++ strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); ++#endif ++ + /* + * CONFIG_CMDLINE is meant to be a default in case nothing else + * managed to set the command line, unless CONFIG_CMDLINE_FORCE diff --git a/target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch b/target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch index 3cc032fdd2..b6b1b04765 100644 --- a/target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch +++ b/target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch @@ -8,5 +8,5 @@ + if (p != NULL && l > 0) + strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE)); - /* - * CONFIG_CMDLINE is meant to be a default in case nothing else + /* CONFIG_CMDLINE_OVERRIDE is used to fallback to a different + * device tree option of chosen/bootargs-override. This is diff --git a/target/linux/ipq807x/config-default b/target/linux/ipq807x/config-default index 1f60ccfecb..337e660cdf 100644 --- a/target/linux/ipq807x/config-default +++ b/target/linux/ipq807x/config-default @@ -416,7 +416,6 @@ CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set CONFIG_MTD_UBI_GLUEBI=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network index a60b87c912..c3d31affda 100755 --- a/target/linux/kirkwood/base-files/etc/board.d/02_network +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -22,6 +22,7 @@ case "$board" in "iom,iconnect-1.1"|\ "iom,ix2-200"|\ "raidsonic,ib-nas62x0"|\ +"seagate,blackarmor-nas220"|\ "seagate,dockstar"|\ "seagate,goflexhome"|\ "seagate,goflexnet"|\ diff --git a/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol b/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol index a0e3de062b..c64ed1100c 100755 --- a/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol +++ b/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol @@ -11,6 +11,20 @@ boot() { path_to_hwmon='/sys/class/hwmon/hwmon0' echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1 ;; + seagate,blackarmor-nas220) + path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0' + # adt7476 fan control chip. 3 temp sensors. Set to 1/4 speed at 35C and max speed at 48C. + echo 7 > "$path_to_hwmon/pwm1_auto_channels_temp" + echo 64 > "$path_to_hwmon/pwm1_auto_point1_pwm" + echo 255 > "$path_to_hwmon/pwm1_auto_point2_pwm" + echo 35000 > "$path_to_hwmon/temp1_auto_point1_temp" + echo 48000 > "$path_to_hwmon/temp1_auto_point2_temp" + echo 35000 > "$path_to_hwmon/temp2_auto_point1_temp" + echo 48000 > "$path_to_hwmon/temp2_auto_point2_temp" + echo 35000 > "$path_to_hwmon/temp3_auto_point1_temp" + echo 48000 > "$path_to_hwmon/temp3_auto_point2_temp" + echo 2 > "$path_to_hwmon/pwm1_enable" + ;; zyxel,nsa310b) path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0' echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1 diff --git a/target/linux/kirkwood/config-5.4 b/target/linux/kirkwood/config-5.4 index a39137a29f..dcf6a1e327 100644 --- a/target/linux/kirkwood/config-5.4 +++ b/target/linux/kirkwood/config-5.4 @@ -227,8 +227,6 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MV643XX_ETH=y CONFIG_MVEBU_CLK_COMMON=y @@ -331,7 +329,6 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNWINDER_ARM=y CONFIG_USB=y diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 0816add474..a9aad01f7f 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -145,6 +145,18 @@ define Device/raidsonic_ib-nas62x0 endef TARGET_DEVICES += raidsonic_ib-nas62x0 +define Device/seagate_blackarmor-nas220 + DEVICE_VENDOR := Seagate + DEVICE_MODEL := Blackarmor NAS220 + DEVICE_PACKAGES := kmod-hwmon-adt7475 kmod-fs-ext4 kmod-ata-marvell-sata \ + mdadm kmod-gpio-button-hotplug + PAGESIZE := 512 + SUBPAGESIZE := 256 + BLOCKSIZE := 16k + UBINIZE_OPTS := -e 1 +endef +TARGET_DEVICES += seagate_blackarmor-nas220 + define Device/seagate_dockstar DEVICE_VENDOR := Seagate DEVICE_MODEL := FreeAgent Dockstar diff --git a/target/linux/kirkwood/patches-5.4/203-blackarmor-nas220.patch b/target/linux/kirkwood/patches-5.4/203-blackarmor-nas220.patch new file mode 100644 index 0000000000..e04a28206a --- /dev/null +++ b/target/linux/kirkwood/patches-5.4/203-blackarmor-nas220.patch @@ -0,0 +1,99 @@ +--- a/arch/arm/boot/dts/kirkwood-blackarmor-nas220.dts ++++ b/arch/arm/boot/dts/kirkwood-blackarmor-nas220.dts +@@ -17,6 +17,13 @@ + compatible = "seagate,blackarmor-nas220","marvell,kirkwood-88f6192", + "marvell,kirkwood"; + ++ aliases { ++ led-boot = &led_status_amber; ++ led-failsafe = &led_status_amber; ++ led-running = &led_status_blue; ++ led-upgrade = &led_status_amber; ++ }; ++ + memory { /* 128 MB */ + device_type = "memory"; + reg = <0x00000000 0x8000000>; +@@ -36,14 +43,14 @@ + compatible = "gpio-keys"; + + reset { +- label = "Reset"; +- linux,code = ; ++ label = "Reset Button"; ++ linux,code = ; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + +- button { +- label = "Power"; +- linux,code = ; ++ power { ++ label = "Power Button"; ++ linux,code = ; + gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; + }; + }; +@@ -51,11 +58,27 @@ + gpio-leds { + compatible = "gpio-leds"; + +- blue-power { ++ led_power_blue: power_blue { + label = "nas220:blue:power"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "default-on"; + }; ++ ++ disk_blue { ++ label = "nas220:blue:disk"; ++ gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "disk-activity"; ++ }; ++ ++ led_status_blue: status_blue { ++ label = "nas220:blue:status"; ++ gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led_status_amber: status_amber { ++ label = "nas220:amber:status"; ++ gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; ++ }; + }; + + regulators { +@@ -153,6 +176,33 @@ + + &nand { + status = "okay"; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ ++ partition@0 { ++ label = "uboot"; ++ reg = <0x0 0xa0000>; ++ read-only; ++ }; ++ ++ partition@a0000 { ++ label = "uboot-env"; ++ reg = <0xa0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@b0000 { ++ label = "reserved"; ++ reg = <0xb0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@c0000 { ++ label = "ubi"; ++ reg = <0xc0000 0x1e80000>; ++ }; ++ }; + }; + + &mdio { diff --git a/target/linux/lantiq/xrx200/config-5.4 b/target/linux/lantiq/xrx200/config-5.4 index 7fc008b5c5..45406cf9de 100644 --- a/target/linux/lantiq/xrx200/config-5.4 +++ b/target/linux/lantiq/xrx200/config-5.4 @@ -47,15 +47,12 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NET_FLOW_LIMIT=y CONFIG_NLS=y CONFIG_NR_CPUS=2 CONFIG_PADATA=y CONFIG_PCI=y -# CONFIG_PCIEAER is not set CONFIG_PCIEPORTBUS=y CONFIG_PCIE_LANTIQ=y CONFIG_PCI_DOMAINS=y diff --git a/target/linux/lantiq/xway/config-5.4 b/target/linux/lantiq/xway/config-5.4 index 89b96d3863..ae73ae147d 100644 --- a/target/linux/lantiq/xway/config-5.4 +++ b/target/linux/lantiq/xway/config-5.4 @@ -21,8 +21,6 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NLS=y CONFIG_PCI=y @@ -42,8 +40,6 @@ CONFIG_SGL_ALLOC=y CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y -# CONFIG_UBIFS_FS_ZLIB is not set -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_USB=y CONFIG_USB_COMMON=y CONFIG_USB_SUPPORT=y diff --git a/target/linux/layerscape/armv7/config-5.4 b/target/linux/layerscape/armv7/config-5.4 index 1b969afd85..15c3492349 100644 --- a/target/linux/layerscape/armv7/config-5.4 +++ b/target/linux/layerscape/armv7/config-5.4 @@ -479,8 +479,6 @@ CONFIG_MTD_SST25L=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 # CONFIG_MTD_UBI_BLOCK is not set -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_MX3_IPU=y diff --git a/target/linux/layerscape/armv8_64b/config-5.4 b/target/linux/layerscape/armv8_64b/config-5.4 index 026cf15673..dd9abca986 100644 --- a/target/linux/layerscape/armv8_64b/config-5.4 +++ b/target/linux/layerscape/armv8_64b/config-5.4 @@ -663,8 +663,6 @@ CONFIG_MTD_SST25L=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 # CONFIG_MTD_UBI_BLOCK is not set -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MULTIPLEXER=y CONFIG_MUTEX_SPIN_ON_OWNER=y diff --git a/target/linux/layerscape/patches-5.4/701-net-0149-soc-fsl-dpio-change-CENA-regs-to-be-cacheable.patch b/target/linux/layerscape/patches-5.4/701-net-0149-soc-fsl-dpio-change-CENA-regs-to-be-cacheable.patch index 34655487df..eba8a12007 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0149-soc-fsl-dpio-change-CENA-regs-to-be-cacheable.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0149-soc-fsl-dpio-change-CENA-regs-to-be-cacheable.patch @@ -32,7 +32,7 @@ Signed-off-by: Haiying Wang struct dpio_priv { struct dpaa2_io *io; }; -@@ -200,13 +205,11 @@ static int dpaa2_dpio_probe(struct fsl_m +@@ -197,13 +202,11 @@ static int dpaa2_dpio_probe(struct fsl_m if (dpio_dev->obj_desc.region_count < 3) { /* No support for DDR backed portals, use classic mapping */ /* @@ -50,7 +50,7 @@ Signed-off-by: Haiying Wang } else { desc.regs_cena = devm_memremap(dev, dpio_dev->regions[2].start, resource_size(&dpio_dev->regions[2]), -@@ -214,7 +217,7 @@ static int dpaa2_dpio_probe(struct fsl_m +@@ -211,7 +214,7 @@ static int dpaa2_dpio_probe(struct fsl_m } if (IS_ERR(desc.regs_cena)) { diff --git a/target/linux/layerscape/patches-5.4/701-net-0225-enetc-Configure-the-Time-Aware-Scheduler-via-tc-tapr.patch b/target/linux/layerscape/patches-5.4/701-net-0225-enetc-Configure-the-Time-Aware-Scheduler-via-tc-tapr.patch index 37ed557c32..c210e5b71e 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0225-enetc-Configure-the-Time-Aware-Scheduler-via-tc-tapr.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0225-enetc-Configure-the-Time-Aware-Scheduler-via-tc-tapr.patch @@ -141,7 +141,7 @@ Signed-off-by: David S. Miller #define ENETC_SIPCAPR0_RSS BIT(8) #define ENETC_SIPCAPR1 0x24 #define ENETC_SITGTGR 0x30 -@@ -440,22 +441,6 @@ union enetc_rx_bd { +@@ -444,22 +445,6 @@ union enetc_rx_bd { #define EMETC_MAC_ADDR_FILT_RES 3 /* # of reserved entries at the beginning */ #define ENETC_MAX_NUM_VFS 2 @@ -164,7 +164,7 @@ Signed-off-by: David S. Miller #define ENETC_CBD_FLAGS_SF BIT(7) /* short format */ #define ENETC_CBD_STATUS_MASK 0xf -@@ -554,3 +539,70 @@ static inline void enetc_set_bdr_prio(st +@@ -558,3 +543,70 @@ static inline void enetc_set_bdr_prio(st val |= ENETC_TBMR_SET_PRIO(prio); enetc_txbdr_wr(hw, bdr_idx, ENETC_TBMR, val); } diff --git a/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch b/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch index 5f24a60690..82fde98823 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch @@ -254,7 +254,7 @@ Signed-off-by: Alex Marginean rx_frm_cnt++; --- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h -@@ -321,8 +321,15 @@ struct enetc_hw { +@@ -325,8 +325,15 @@ struct enetc_hw { }; /* general register accessors */ @@ -272,7 +272,7 @@ Signed-off-by: Alex Marginean #ifdef ioread64 #define enetc_rd_reg64(reg) ioread64((reg)) #else -@@ -341,12 +348,102 @@ static inline u64 enetc_rd_reg64(void __ +@@ -345,12 +352,102 @@ static inline u64 enetc_rd_reg64(void __ } #endif diff --git a/target/linux/layerscape/patches-5.4/701-net-0235-enetc-Clean-up-of-ehtool-stats-len.patch b/target/linux/layerscape/patches-5.4/701-net-0235-enetc-Clean-up-of-ehtool-stats-len.patch index b085ea3a17..1602feb3bd 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0235-enetc-Clean-up-of-ehtool-stats-len.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0235-enetc-Clean-up-of-ehtool-stats-len.patch @@ -13,7 +13,7 @@ Signed-off-by: Claudiu Manoil --- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c -@@ -195,15 +195,21 @@ static const char tx_ring_stats[][ETH_GS +@@ -199,15 +199,21 @@ static const char tx_ring_stats[][ETH_GS static int enetc_get_sset_count(struct net_device *ndev, int sset) { struct enetc_ndev_priv *priv = netdev_priv(ndev); diff --git a/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch b/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch index ca79c43848..7f78e1d043 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch @@ -259,7 +259,7 @@ Signed-off-by: Claudiu Manoil --- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h -@@ -325,7 +325,7 @@ struct enetc_hw { +@@ -329,7 +329,7 @@ struct enetc_hw { #define enetc_wr_reg(reg, val) enetc_wr_reg_wa((reg), (val)) /* accessors for data-path, due to MDIO issue on LS1028 these should be called @@ -268,7 +268,7 @@ Signed-off-by: Claudiu Manoil */ #define enetc_rd_reg_hot(reg) ioread32((reg)) #define enetc_wr_reg_hot(reg, val) iowrite32((val), (reg)) -@@ -348,90 +348,45 @@ static inline u64 enetc_rd_reg64(void __ +@@ -352,90 +352,45 @@ static inline u64 enetc_rd_reg64(void __ } #endif diff --git a/target/linux/layerscape/patches-5.4/701-net-0336-enetc-add-support-Credit-Based-Shaper-CBS-for-hardwa.patch b/target/linux/layerscape/patches-5.4/701-net-0336-enetc-add-support-Credit-Based-Shaper-CBS-for-hardwa.patch index fd89174d59..e8b9e98247 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0336-enetc-add-support-Credit-Based-Shaper-CBS-for-hardwa.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0336-enetc-add-support-Credit-Based-Shaper-CBS-for-hardwa.patch @@ -79,7 +79,7 @@ Signed-off-by: David S. Miller #define ENETC_PTCCBSR1(n) (0x1114 + (n) * 8) /* n = 0 to 7*/ #define ENETC_RSSHASH_KEY_SIZE 40 #define ENETC_PRSSK(n) (0x1410 + (n) * 4) /* n = [0..9] */ -@@ -673,6 +675,8 @@ struct enetc_cbd { +@@ -677,6 +679,8 @@ struct enetc_cbd { u8 status_flags; }; diff --git a/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch b/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch index e54631f71f..ba71805275 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch @@ -192,7 +192,7 @@ Signed-off-by: Po Liu +#endif --- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c -@@ -183,6 +183,21 @@ static const struct { +@@ -187,6 +187,21 @@ static const struct { { ENETC_PICDR(3), "ICM DR3 discarded frames" }, }; @@ -214,7 +214,7 @@ Signed-off-by: Po Liu static const char rx_ring_stats[][ETH_GSTRING_LEN] = { "Rx ring %2d frames", "Rx ring %2d alloc errors", -@@ -192,6 +207,10 @@ static const char tx_ring_stats[][ETH_GS +@@ -196,6 +211,10 @@ static const char tx_ring_stats[][ETH_GS "Tx ring %2d frames", }; @@ -225,7 +225,7 @@ Signed-off-by: Po Liu static int enetc_get_sset_count(struct net_device *ndev, int sset) { struct enetc_ndev_priv *priv = netdev_priv(ndev); -@@ -209,6 +228,12 @@ static int enetc_get_sset_count(struct n +@@ -213,6 +232,12 @@ static int enetc_get_sset_count(struct n len += ARRAY_SIZE(enetc_port_counters); @@ -238,7 +238,7 @@ Signed-off-by: Po Liu return len; } -@@ -247,6 +272,28 @@ static void enetc_get_strings(struct net +@@ -251,6 +276,28 @@ static void enetc_get_strings(struct net ETH_GSTRING_LEN); p += ETH_GSTRING_LEN; } @@ -267,7 +267,7 @@ Signed-off-by: Po Liu break; } } -@@ -274,6 +321,18 @@ static void enetc_get_ethtool_stats(stru +@@ -278,6 +325,18 @@ static void enetc_get_ethtool_stats(stru for (i = 0; i < ARRAY_SIZE(enetc_port_counters); i++) data[o++] = enetc_port_rd(hw, enetc_port_counters[i].reg); @@ -317,7 +317,7 @@ Signed-off-by: Po Liu /* MAC counters */ #define ENETC_PM0_REOCT 0x8100 -@@ -294,6 +305,15 @@ enum enetc_bdr_type {TX, RX}; +@@ -298,6 +309,15 @@ enum enetc_bdr_type {TX, RX}; #define ENETC_PM0_TSCOL 0x82E0 #define ENETC_PM0_TLCOL 0x82E8 #define ENETC_PM0_TECOL 0x82F0 @@ -333,7 +333,7 @@ Signed-off-by: Po Liu /* Port counters */ #define ENETC_PICDR(n) (0x0700 + (n) * 8) /* n = [0..3] */ -@@ -452,6 +472,7 @@ union enetc_tx_bd { +@@ -456,6 +476,7 @@ union enetc_tx_bd { #define ENETC_TXBD_FLAGS_CSUM BIT(3) #define ENETC_TXBD_FLAGS_EX BIT(6) #define ENETC_TXBD_FLAGS_F BIT(7) @@ -341,7 +341,7 @@ Signed-off-by: Po Liu static inline void enetc_clear_tx_bd(union enetc_tx_bd *txbd) { -@@ -479,6 +500,8 @@ static inline __le16 enetc_txbd_l3_csoff +@@ -483,6 +504,8 @@ static inline __le16 enetc_txbd_l3_csoff #define ENETC_TXBD_L4_UDP BIT(5) #define ENETC_TXBD_L4_TCP BIT(6) @@ -350,7 +350,7 @@ Signed-off-by: Po Liu union enetc_rx_bd { struct { __le64 addr; -@@ -625,21 +648,307 @@ enum bdcr_cmd_class { +@@ -629,21 +652,307 @@ enum bdcr_cmd_class { BDCR_CMD_RFS, BDCR_CMD_PORT_GCL, BDCR_CMD_RECV_CLASSIFIER, @@ -662,7 +662,7 @@ Signed-off-by: Po Liu /* gate control list entry */ struct gce { __le32 period; -@@ -656,13 +965,55 @@ struct tgs_gcl_data { +@@ -660,13 +969,55 @@ struct tgs_gcl_data { struct gce entry[0]; }; @@ -719,7 +719,7 @@ Signed-off-by: Po Liu }; }; /* Long format */ __le32 data[6]; -@@ -677,11 +1028,88 @@ struct enetc_cbd { +@@ -681,11 +1032,88 @@ struct enetc_cbd { #define ENETC_CLK 400000000ULL diff --git a/target/linux/layerscape/patches-5.4/817-spi-0003-MLK-21960-1-spi-fspi-enable-fspi-on-imx8qxp-and-imx8.patch b/target/linux/layerscape/patches-5.4/817-spi-0003-MLK-21960-1-spi-fspi-enable-fspi-on-imx8qxp-and-imx8.patch index 59906dd93d..07fac213ce 100644 --- a/target/linux/layerscape/patches-5.4/817-spi-0003-MLK-21960-1-spi-fspi-enable-fspi-on-imx8qxp-and-imx8.patch +++ b/target/linux/layerscape/patches-5.4/817-spi-0003-MLK-21960-1-spi-fspi-enable-fspi-on-imx8qxp-and-imx8.patch @@ -35,7 +35,7 @@ Signed-off-by: Han Xu struct nxp_fspi { void __iomem *iobase; void __iomem *ahb_addr; -@@ -1076,6 +1092,8 @@ static int nxp_fspi_resume(struct device +@@ -1083,6 +1099,8 @@ static int nxp_fspi_resume(struct device static const struct of_device_id nxp_fspi_dt_ids[] = { { .compatible = "nxp,lx2160a-fspi", .data = (void *)&lx2160a_data, }, diff --git a/target/linux/layerscape/patches-5.4/817-spi-0004-MLK-21960-2-spi-fspi-dynamically-alloc-AHB-memory.patch b/target/linux/layerscape/patches-5.4/817-spi-0004-MLK-21960-2-spi-fspi-dynamically-alloc-AHB-memory.patch index ed8dc301f7..a8db23cebb 100644 --- a/target/linux/layerscape/patches-5.4/817-spi-0004-MLK-21960-2-spi-fspi-dynamically-alloc-AHB-memory.patch +++ b/target/linux/layerscape/patches-5.4/817-spi-0004-MLK-21960-2-spi-fspi-dynamically-alloc-AHB-memory.patch @@ -76,7 +76,7 @@ Signed-off-by: Han Xu } else { if (op->data.nbytes && op->data.dir == SPI_MEM_DATA_OUT) nxp_fspi_fill_txfifo(f, op); -@@ -992,9 +1018,8 @@ static int nxp_fspi_probe(struct platfor +@@ -999,9 +1025,8 @@ static int nxp_fspi_probe(struct platfor /* find the resources - controller memory mapped space */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_mmap"); @@ -88,7 +88,7 @@ Signed-off-by: Han Xu goto err_put_ctrl; } -@@ -1073,6 +1098,9 @@ static int nxp_fspi_remove(struct platfo +@@ -1080,6 +1105,9 @@ static int nxp_fspi_remove(struct platfo mutex_destroy(&f->lock); diff --git a/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch b/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch index b31c695794..fd64f2f10b 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch @@ -16,7 +16,7 @@ Signed-off-by: Li Jun --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c -@@ -1733,7 +1733,8 @@ static bool xhci_port_missing_cas_quirk( +@@ -1737,7 +1737,8 @@ static bool xhci_port_missing_cas_quirk( return false; if (((portsc & PORT_PLS_MASK) != XDEV_POLLING) && diff --git a/target/linux/mediatek/mt7622/config-5.4 b/target/linux/mediatek/mt7622/config-5.4 index 3861704eaa..929a04ce07 100755 --- a/target/linux/mediatek/mt7622/config-5.4 +++ b/target/linux/mediatek/mt7622/config-5.4 @@ -399,8 +399,6 @@ CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_MTK_CMDQ is not set # CONFIG_MTK_CQDMA is not set @@ -568,7 +566,6 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set # CONFIG_UCLAMP_TASK is not set # CONFIG_UNMAP_KERNEL_AT_EL0 is not set CONFIG_USB=y diff --git a/target/linux/mediatek/mt7623/config-5.4 b/target/linux/mediatek/mt7623/config-5.4 index a6b32ce33b..06312ac03c 100644 --- a/target/linux/mediatek/mt7623/config-5.4 +++ b/target/linux/mediatek/mt7623/config-5.4 @@ -337,8 +337,6 @@ CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_MTK_CMDQ is not set # CONFIG_MTK_CQDMA is not set diff --git a/target/linux/mediatek/mt7629/config-5.4 b/target/linux/mediatek/mt7629/config-5.4 index a291b9a263..7dd04b4e2e 100644 --- a/target/linux/mediatek/mt7629/config-5.4 +++ b/target/linux/mediatek/mt7629/config-5.4 @@ -247,8 +247,6 @@ CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_MTK_CMDQ is not set # CONFIG_MTK_EFUSE is not set diff --git a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch index 424061ef5e..b6734a38dc 100644 --- a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch +++ b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch @@ -111,7 +111,7 @@ Signed-off-by: David S. Miller struct mvpp2_port *port = netdev_priv(dev); --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -448,9 +448,10 @@ static void mtk_mac_link_down(struct phy +@@ -449,9 +449,10 @@ static void mtk_mac_link_down(struct phy mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id)); } diff --git a/target/linux/mpc85xx/p1010/config-default b/target/linux/mpc85xx/p1010/config-default index e25d51aeb1..12fe598223 100644 --- a/target/linux/mpc85xx/p1010/config-default +++ b/target/linux/mpc85xx/p1010/config-default @@ -5,8 +5,6 @@ CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_REALTEK_PHY=y CONFIG_RED_15W_REV1=y diff --git a/target/linux/mpc85xx/p1020/config-default b/target/linux/mpc85xx/p1020/config-default index fae155828d..c4c102ca45 100644 --- a/target/linux/mpc85xx/p1020/config-default +++ b/target/linux/mpc85xx/p1020/config-default @@ -26,8 +26,6 @@ CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NET_FLOW_LIMIT=y diff --git a/target/linux/mvebu/config-5.4 b/target/linux/mvebu/config-5.4 index 4f38954b37..2858408064 100644 --- a/target/linux/mvebu/config-5.4 +++ b/target/linux/mvebu/config-5.4 @@ -334,8 +334,6 @@ CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_MVEBU_CLK_COMMON=y @@ -471,7 +469,6 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNWINDER_ARM=y CONFIG_USB=y diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts index e804665792..dee271541e 100644 --- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts @@ -209,6 +209,10 @@ }; }; +&coherencyfab { + broken-idle; +}; + ð1 { pinctrl-0 = <&ge1_rgmii_pins>; pinctrl-names = "default"; @@ -226,6 +230,7 @@ rs5c372a: rs5c372a@32 { compatible = "ricoh,rs5c372a"; reg = <0x32>; + wakeup-source; }; }; diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 67f68b1770..ea20a25a29 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -32,7 +32,8 @@ define Device/cznic_turris-omnia DEVICE_VENDOR := CZ.NIC DEVICE_MODEL := Turris Omnia KERNEL_INSTALL := 1 - KERNEL := kernel-bin | append-dtb + KERNEL := kernel-bin + KERNEL_INITRAMFS := kernel-bin DEVICE_PACKAGES := \ mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \ wpad-basic-wolfssl kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \ diff --git a/target/linux/mvebu/patches-5.4/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch b/target/linux/mvebu/patches-5.4/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch new file mode 100644 index 0000000000..8ef2897c97 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch @@ -0,0 +1,33 @@ +From 525b0858ff2fdb78defec2d4d6d63baaa423d5fd Mon Sep 17 00:00:00 2001 +From: Chris Packham +Date: Fri, 13 Mar 2020 16:42:44 +1300 +Subject: [PATCH] gpio: mvebu: avoid error message for optional IRQ + +platform_get_irq() will generate an error message if the requested irq +is not present + + mvebu-gpio f1010140.gpio: IRQ index 3 not found + +use platform_get_irq_optional() to avoid the error message being +generated. + +Signed-off-by: Chris Packham +Acked-by: Uwe Kleine-König +Signed-off-by: Bartosz Golaszewski +--- + drivers/gpio/gpio-mvebu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c +index d2b999c7987f1..3c9f4fb3d5a28 100644 +--- a/drivers/gpio/gpio-mvebu.c ++++ b/drivers/gpio/gpio-mvebu.c +@@ -1245,7 +1245,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev) + * pins. + */ + for (i = 0; i < 4; i++) { +- int irq = platform_get_irq(pdev, i); ++ int irq = platform_get_irq_optional(pdev, i); + + if (irq < 0) + continue; diff --git a/target/linux/omap/config-5.4 b/target/linux/omap/config-5.4 index a797abaae6..9e156f69e7 100644 --- a/target/linux/omap/config-5.4 +++ b/target/linux/omap/config-5.4 @@ -432,8 +432,6 @@ CONFIG_MTD_SPI_NOR=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 # CONFIG_MTD_UBI_BLOCK is not set -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_MUSB_PIO_ONLY is not set CONFIG_MUTEX_SPIN_ON_OWNER=y diff --git a/target/linux/oxnas/image/ox820.mk b/target/linux/oxnas/image/ox820.mk index f00cfe8608..a52e09786b 100644 --- a/target/linux/oxnas/image/ox820.mk +++ b/target/linux/oxnas/image/ox820.mk @@ -68,10 +68,6 @@ define Device/shuttle_kd20 DEVICE_VENDOR := Shuttle DEVICE_MODEL := KD20 SUPPORTED_DEVICES += kd20 - KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-factory - KERNEL_INITRAMFS_SUFFIX := .tar.gz - KERNEL_INITRAMFS = kernel-bin | append-dtb | uImage none | omninas-factory | \ - encrypt-3des sohmuntitnlaes DEVICE_PACKAGES := kmod-usb2-oxnas kmod-usb3 kmod-usb-ledtrig-usbport \ kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper kmod-hwmon-drivetemp \ kmod-hwmon-gpiofan kmod-ata-oxnas-sata kmod-md-mod kmod-md-raid0 \ diff --git a/target/linux/oxnas/ox820/config-default b/target/linux/oxnas/ox820/config-default index 25758a7ef5..b94ca29aaf 100644 --- a/target/linux/oxnas/ox820/config-default +++ b/target/linux/oxnas/ox820/config-default @@ -59,8 +59,6 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NET_FLOW_LIMIT=y diff --git a/target/linux/pistachio/config-5.4 b/target/linux/pistachio/config-5.4 index d1e1acaead..890bb57ff9 100644 --- a/target/linux/pistachio/config-5.4 +++ b/target/linux/pistachio/config-5.4 @@ -244,7 +244,6 @@ CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_FASTMAP=y -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NAMESPACES=y CONFIG_NEED_DMA_MAP_STATE=y diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts index bc2c6dfe86..cef0705393 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts @@ -1,24 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "mt7621_dlink_dir-8xx-a1.dtsi" +#include "mt7621_dlink_dir-882-x1.dtsi" / { compatible = "dlink,dir-882-a1", "mediatek,mt7621-soc"; model = "D-Link DIR-882 A1"; }; - -&leds { - usb2 { - label = "green:usb2"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - trigger-sources = <&ehci_port2>; - linux,default-trigger = "usbport"; - }; - - usb3 { - label = "green:usb3"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - trigger-sources = <&xhci_ehci_port1>; - linux,default-trigger = "usbport"; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts new file mode 100644 index 0000000000..26b6f34707 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_dlink_dir-8xx-r1.dtsi" +#include "mt7621_dlink_dir-882-x1.dtsi" + +/ { + compatible = "dlink,dir-882-r1", "mediatek,mt7621-soc"; + model = "D-Link DIR-882 R1"; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-x1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-882-x1.dtsi new file mode 100644 index 0000000000..cafb1df964 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-x1.dtsi @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +&leds { + usb2 { + label = "green:usb2"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + trigger-sources = <&ehci_port2>; + linux,default-trigger = "usbport"; + }; + + usb3 { + label = "green:usb3"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + trigger-sources = <&xhci_ehci_port1>; + linux,default-trigger = "usbport"; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi index e451d6a39f..c43cc49aa1 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi @@ -1,65 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621.dtsi" - -#include -#include - -/ { - aliases { - label-mac-device = &gmac0; - led-boot = &led_power_orange; - led-failsafe = &led_power_green; - led-running = &led_power_green; - led-upgrade = &led_net_orange; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wps { - label = "wps"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wifi { - label = "wifi"; - gpios = <&gpio 7 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - leds: leds { - compatible = "gpio-leds"; - - led_power_orange: power_orange { - label = "orange:power"; - gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - }; - - led_power_green: power_green { - label = "green:power"; - gpios = <&gpio 16 GPIO_ACTIVE_LOW>; - }; - - led_net_orange: net_orange { - label = "orange:net"; - gpios = <&gpio 4 GPIO_ACTIVE_LOW>; - }; - - net_green { - label = "green:net"; - gpios = <&gpio 3 GPIO_ACTIVE_LOW>; - }; - }; -}; +#include "mt7621_dlink_dir-8xx-x1.dtsi" &spi0 { status = "okay"; @@ -100,74 +41,3 @@ }; }; }; - -&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>; - - led { - led-active-low; - }; - }; -}; - -&pcie1 { - wifi@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - ieee80211-freq-limit = <5000000 6000000>; - - led { - led-active-low; - }; - }; -}; - -&gmac0 { - mtd-mac-address = <&factory 0xe000>; -}; - -&switch0 { - ports { - port@0 { - status = "okay"; - label = "lan4"; - }; - - port@1 { - status = "okay"; - label = "lan3"; - }; - - port@2 { - status = "okay"; - label = "lan2"; - }; - - port@3 { - status = "okay"; - label = "lan1"; - }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; - }; -}; - -&state_default { - gpio { - groups = "i2c", "uart3", "jtag", "wdt"; - function = "gpio"; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-r1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-r1.dtsi new file mode 100644 index 0000000000..e93a06d9fe --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-r1.dtsi @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_dlink_dir-8xx-x1.dtsi" + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 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>; + }; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-x1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-x1.dtsi new file mode 100644 index 0000000000..7ab0e8bd5d --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-x1.dtsi @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + aliases { + label-mac-device = &gmac0; + led-boot = &led_power_orange; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_net_orange; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wifi { + label = "wifi"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds: leds { + compatible = "gpio-leds"; + + led_power_orange: power_orange { + label = "orange:power"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_power_green: power_green { + label = "green:power"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + led_net_orange: net_orange { + label = "orange:net"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + net_green { + label = "green:net"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&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>; + + led { + led-active-low; + }; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-active-low; + }; + }; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xe000>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan4"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + + port@4 { + status = "okay"; + label = "wan"; + mtd-mac-address = <&factory 0xe006>; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts new file mode 100644 index 0000000000..6349fd487e --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_elecom_wrc-gs-1pci.dtsi" + +/ { + compatible = "elecom,wrc-1167gs2-b", "mediatek,mt7621-soc"; + model = "ELECOM WRC-1167GS2-B"; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xfff4>; +}; + +&wan { + mtd-mac-address = <&factory 0xfffa>; +}; + +&partitions { + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xb00000>; + }; + + partition@b50000 { + label = "tm_pattern"; + reg = <0xb50000 0x380000>; + read-only; + }; + + partition@ed0000 { + label = "tm_key"; + reg = <0xed0000 0x80000>; + read-only; + }; + + partition@f50000 { + label = "nvram"; + reg = <0xf50000 0x30000>; + read-only; + }; + + partition@f80000 { + label = "user_data"; + reg = <0xf80000 0x80000>; + read-only; + }; +}; + +&wifi { + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <(-1)>; +}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts new file mode 100644 index 0000000000..11b782488a --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_elecom_wrc-gs-1pci.dtsi" + +/ { + compatible = "elecom,wrc-1167gst2", "mediatek,mt7621-soc"; + model = "ELECOM WRC-1167GST2"; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xe000>; +}; + +&wan { + mtd-mac-address = <&factory 0xe006>; +}; + +&partitions { + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x1800000>; + }; + + partition@1850000 { + label = "tm_pattern"; + reg = <0x1850000 0x400000>; + read-only; + }; + + partition@1c50000 { + label = "tm_key"; + reg = <0x1c50000 0x100000>; + read-only; + }; + + partition@1d50000 { + label = "nvram"; + reg = <0x1d50000 0xb0000>; + read-only; + }; + + partition@1e00000 { + label = "user_data"; + reg = <0x1e00000 0x200000>; + read-only; + }; +}; + +&wifi { + mtd-mac-address = <&factory 0xe006>; + mtd-mac-address-increment = <1>; +}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts index 320a15d162..71e4c16ddd 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621_elecom_wrc-gs.dtsi" +#include "mt7621_elecom_wrc-gs-2pci.dtsi" / { compatible = "elecom,wrc-1750gs", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts index 5d637dc5fe..6719c347f1 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621_elecom_wrc-gs.dtsi" +#include "mt7621_elecom_wrc-gs-2pci.dtsi" / { compatible = "elecom,wrc-1750gsv", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts index 00a7d5b1e4..675e086a82 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only -#include "mt7621_elecom_wrc-gs.dtsi" +#include "mt7621_elecom_wrc-gs-2pci.dtsi" / { compatible = "elecom,wrc-1900gst", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts index 5026778fdc..dacd540b28 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts @@ -1,4 +1,4 @@ -#include "mt7621_elecom_wrc-gs.dtsi" +#include "mt7621_elecom_wrc-gs-2pci.dtsi" / { compatible = "elecom,wrc-2533gst", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts index 1fa2986bc7..a998b61b73 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621_elecom_wrc-gs.dtsi" +#include "mt7621_elecom_wrc-gs-2pci.dtsi" / { compatible = "elecom,wrc-2533gst2", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi new file mode 100644 index 0000000000..7495453d45 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include "mt7621_elecom_wrc-gs.dtsi" + +&leds { + wlan2g { + label = "white:wlan2g"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + label = "white:wlan5g"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart3", "jtag", "wdt", "sdhci"; + function = "gpio"; + }; +}; + +&pcie0 { + wifi: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi new file mode 100644 index 0000000000..642724da10 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include "mt7621_elecom_wrc-gs.dtsi" + +&gmac0 { + mtd-mac-address = <&factory 0xe000>; +}; + +&wan { + mtd-mac-address = <&factory 0xe006>; +}; + +&state_default { + gpio { + groups = "uart3", "jtag", "wdt", "sdhci"; + function = "gpio"; + }; +}; + +&pcie0 { + 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 = <0>; + led-active-low; + }; + }; +}; + +&pcie1 { + 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 = <0>; + led-active-low; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi index fd54ead0bc..9cf2b666b4 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi @@ -14,7 +14,7 @@ label-mac-device = &wan; }; - leds { + leds: leds { compatible = "gpio-leds"; led_power_green: power_green { @@ -83,16 +83,11 @@ }; }; -&gmac0 { - mtd-mac-address = <&factory 0xe000>; -}; - &switch0 { ports { wan: port@0 { status = "okay"; label = "wan"; - mtd-mac-address = <&factory 0xe006>; }; port@1 { @@ -151,45 +146,10 @@ }; }; -&state_default { - gpio { - groups = "uart3", "jtag", "wdt", "sdhci"; - function = "gpio"; - }; -}; - &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>; - - led { - led-sources = <0>; - led-active-low; - }; - }; -}; - -&pcie1 { - 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 = <0>; - led-active-low; - }; - }; -}; - &xhci { status = "disabled"; }; diff --git a/target/linux/ramips/dts/rt3662_engenius_esr600h.dts b/target/linux/ramips/dts/rt3662_engenius_esr600h.dts new file mode 100644 index 0000000000..cce44ed4c3 --- /dev/null +++ b/target/linux/ramips/dts/rt3662_engenius_esr600h.dts @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rt3883.dtsi" + +#include +#include + +/ { + compatible = "engenius,esr600h", "ralink,rt3662-soc", "ralink,rt3883-soc"; + model = "EnGenius ESR600H"; + + 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 = "blue:power"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wps { + label = "blue:wps"; + gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + reset-wps { + label = "reset-wps"; + gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + usb { + gpio-export,name = "usb"; + gpio-export,output = <1>; + gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <20000000>; + + 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 0x1000>; + }; + + partition@32000 { + label = "config"; + reg = <0x32000 0xe000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "jtag", "uartf"; + function = "gpio"; + }; +}; + +ðernet { + status = "okay"; + + port@0 { + phy-handle = <&phy0>; + phy-mode = "rgmii"; + }; + + mdio-bus { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "rgmii"; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */ + 0x10 0x40000000 /* Power-on Strapping: 176-pin interface configuration */ + 0x50 0xc437c437 /* LED Control Register 0 */ + 0x54 0xc337c337 /* LED Control Register 1 */ + 0x58 0x00000000 /* LED Control Register 2 */ + 0x5c 0x03ffff00 /* LED Control Register 3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6 STATUS */ + >; + }; + }; +}; + +&pci { + status = "okay"; +}; + +&pci1 { + status = "okay"; + + wifi@0,1,0 { + compatible = "pci1814,3091"; + reg = <0x0 1 0 0 0>; + ralink,5ghz = <0>; + ralink,mtd-eeprom = <&factory 0x8000>; + }; +}; + +&wmac { + status = "okay"; + + ralink,2ghz = <0>; + ralink,mtd-eeprom = <&factory 0x0>; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 309ccbdf90..4274c24884 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -148,6 +148,11 @@ define Build/sercom-seal $(1) endef +define Build/sign-dlink-ru + sign_dlink_ru $@ $1 $2 + mv $@.new $@ +endef + define Build/trx $(STAGING_DIR_HOST)/bin/trx $(1) \ -o $@ \ diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 96a63d8916..3814dd84a7 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -12,20 +12,8 @@ DEVICE_VARS += ELECOM_HWNAME LINKSYS_HWNAME define Build/elecom-wrc-gs-factory $(eval product=$(word 1,$(1))) $(eval version=$(word 2,$(1))) - ( $(STAGING_DIR_HOST)/bin/mkhash md5 $@ | tr -d '\n' ) >> $@ - ( \ - echo -n "ELECOM $(product) v$(version)" | \ - dd bs=32 count=1 conv=sync; \ - dd if=$@; \ - ) > $@.new - mv $@.new $@ - echo -n "MT7621_ELECOM_$(product)" >> $@ -endef - -define Build/elecom-wrc-factory - $(eval product=$(word 1,$(1))) - $(eval version=$(word 2,$(1))) - $(STAGING_DIR_HOST)/bin/mkhash md5 $@ >> $@ + $(eval hash_opt=$(word 3,$(1))) + $(STAGING_DIR_HOST)/bin/mkhash md5 $(hash_opt) $@ >> $@ ( \ echo -n "ELECOM $(product) v$(version)" | \ dd bs=32 count=1 conv=sync; \ @@ -247,6 +235,17 @@ define Device/dlink_dir-8xx-a1 check-size endef +define Device/dlink_dir-8xx-r1 + $(Device/dsa-migration) + IMAGE_SIZE := 16064k + DEVICE_VENDOR := D-Link + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware + KERNEL_INITRAMFS := $$(KERNEL) + IMAGES += factory.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs |\ + pad-rootfs | append-metadata | check-size +endef + define Device/dlink_dir-xx60-a1 $(Device/dsa-migration) BLOCKSIZE := 128k @@ -324,6 +323,17 @@ define Device/dlink_dir-882-a1 endef TARGET_DEVICES += dlink_dir-882-a1 +define Device/dlink_dir-882-r1 + $(Device/dlink_dir-8xx-r1) + DEVICE_MODEL := DIR-882 + DEVICE_VARIANT := R1 + DEVICE_PACKAGES += kmod-usb3 kmod-usb-ledtrig-usbport + IMAGE/factory.bin := append-kernel | append-rootfs | check-size | \ + sign-dlink-ru 57c5375741c30ca9ebcb36713db4ba51 \ + ab0dff19af8842cdb70a86b4b68d23f7 +endef +TARGET_DEVICES += dlink_dir-882-r1 + define Device/d-team_newifi-d2 $(Device/dsa-migration) $(Device/uimage-lzma-loader) @@ -400,7 +410,7 @@ define Device/elecom_wrc-1167ghbk2-s DEVICE_MODEL := WRC-1167GHBK2-S IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ - elecom-wrc-factory WRC-1167GHBK2-S 0.00 + elecom-wrc-gs-factory WRC-1167GHBK2-S 0.00 DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware endef TARGET_DEVICES += elecom_wrc-1167ghbk2-s @@ -411,10 +421,27 @@ define Device/elecom_wrc-gs DEVICE_VENDOR := ELECOM IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ - elecom-wrc-gs-factory $$$$(ELECOM_HWNAME) 0.00 + elecom-wrc-gs-factory $$$$(ELECOM_HWNAME) 0.00 -N | \ + append-string MT7621_ELECOM_$$$$(ELECOM_HWNAME) DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware endef +define Device/elecom_wrc-1167gs2-b + $(Device/elecom_wrc-gs) + IMAGE_SIZE := 11264k + DEVICE_MODEL := WRC-1167GS2-B + ELECOM_HWNAME := WRC-1167GS2 +endef +TARGET_DEVICES += elecom_wrc-1167gs2-b + +define Device/elecom_wrc-1167gst2 + $(Device/elecom_wrc-gs) + IMAGE_SIZE := 24576k + DEVICE_MODEL := WRC-1167GST2 + ELECOM_HWNAME := WRC-1167GST2 +endef +TARGET_DEVICES += elecom_wrc-1167gst2 + define Device/elecom_wrc-1750gs $(Device/elecom_wrc-gs) IMAGE_SIZE := 11264k diff --git a/target/linux/ramips/image/rt3883.mk b/target/linux/ramips/image/rt3883.mk index f434172c50..1b46d570fd 100644 --- a/target/linux/ramips/image/rt3883.mk +++ b/target/linux/ramips/image/rt3883.mk @@ -59,6 +59,20 @@ define Device/edimax_br-6475nd endef TARGET_DEVICES += edimax_br-6475nd +define Device/engenius_esr600h + $(Device/uimage-lzma-loader) + SOC := rt3662 + BLOCKSIZE := 4k + IMAGE_SIZE := 7872k + IMAGES += factory.dlf + IMAGE/factory.dlf := $$(sysupgrade_bin) | check-size | \ + senao-header -r 0x101 -p 0x44 -t 2 + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := ESR600H + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 uboot-envtools +endef +TARGET_DEVICES += engenius_esr600h + define Device/loewe_wmdr-143n SOC := rt3662 BLOCKSIZE := 64k 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 index cd1814cc2b..8d91b36346 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -30,7 +30,8 @@ dlink,dir-2660-a1) dlink,dir-860l-b1|\ dlink,dir-867-a1|\ dlink,dir-878-a1|\ -dlink,dir-882-a1) +dlink,dir-882-a1|\ +dlink,dir-882-r1) ucidef_set_led_netdev "wan" "wan" "green:net" "wan" ;; gnubee,gb-pc1|\ diff --git a/target/linux/ramips/mt7621/config-5.4 b/target/linux/ramips/mt7621/config-5.4 index b4c8ab1f1c..fbfb5b09f1 100644 --- a/target/linux/ramips/mt7621/config-5.4 +++ b/target/linux/ramips/mt7621/config-5.4 @@ -217,8 +217,6 @@ CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MTD_VIRT_CONCAT=y # CONFIG_MTK_HSDMA is not set @@ -326,7 +324,6 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_WATCHDOG_CORE=y diff --git a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch index babd3d833c..6583fca60b 100644 --- a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch +++ b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch @@ -14,7 +14,7 @@ Signed-off-by: René van Dorst --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2919,6 +2919,7 @@ static const struct net_device_ops mtk_n +@@ -2922,6 +2922,7 @@ static const struct net_device_ops mtk_n static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { @@ -22,7 +22,7 @@ Signed-off-by: René van Dorst const __be32 *_id = of_get_property(np, "reg", NULL); struct phylink *phylink; int phy_mode, id, err; -@@ -3011,6 +3012,9 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3014,6 +3015,9 @@ static int mtk_add_mac(struct mtk_eth *e eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN; 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 index 7b73f93944..f26199611e 100755 --- a/target/linux/ramips/rt3883/base-files/etc/board.d/02_network +++ b/target/linux/ramips/rt3883/base-files/etc/board.d/02_network @@ -25,6 +25,13 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0" ;; + engenius,esr600h|\ + 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" + ;; loewe,wmdr-143n|\ omnima,hpm) ucidef_set_interface_lan "eth0" @@ -33,12 +40,6 @@ ramips_setup_interfaces() 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" - ;; esac } @@ -66,6 +67,11 @@ ramips_setup_macs() edimax,br-6475nd) wan_mac=$(mtd_get_mac_binary devdata 0x7) ;; + engenius,esr600h) + wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) + lan_mac=$(macaddr_add "$wan_mac" 1) + label_mac=$wan_mac + ;; samsung,cy-swr1100) lan_mac=$(mtd_get_mac_ascii nvram lanmac) wan_mac=$(mtd_get_mac_ascii nvram wanmac) diff --git a/target/linux/realtek/files-5.4/arch/mips/rtl838x/setup.c b/target/linux/realtek/files-5.4/arch/mips/rtl838x/setup.c index dbabb0354b..24c70b8274 100644 --- a/target/linux/realtek/files-5.4/arch/mips/rtl838x/setup.c +++ b/target/linux/realtek/files-5.4/arch/mips/rtl838x/setup.c @@ -59,19 +59,12 @@ static void rtl838x_restart(char *command) sw_w32(1, RTL838X_RST_GLB_CTRL_1); } -static void rtl838x_halt(void) -{ - pr_info("System halted.\n"); - while(1); -} - void __init plat_mem_setup(void) { void *dtb; set_io_port_base(KSEG1); _machine_restart = rtl838x_restart; - _machine_halt = rtl838x_halt; if (fw_passed_dtb) /* UHI interface */ dtb = (void *)fw_passed_dtb; diff --git a/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch b/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch index cc90bad691..8a33b4bc14 100644 --- a/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch +++ b/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch @@ -44,7 +44,7 @@ Signed-off-by: Heiko Stuebner mdio { --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -@@ -288,6 +288,7 @@ +@@ -291,6 +291,7 @@ resets = <&cru SRST_A_GMAC>; reset-names = "stmmaceth"; rockchip,grf = <&grf>; diff --git a/target/linux/rockchip/patches-5.4/104-rockchip-use-USB-host-by-default-on-rk3399-rock-pi-4.patch b/target/linux/rockchip/patches-5.4/104-rockchip-use-USB-host-by-default-on-rk3399-rock-pi-4.patch new file mode 100644 index 0000000000..1abab5e2eb --- /dev/null +++ b/target/linux/rockchip/patches-5.4/104-rockchip-use-USB-host-by-default-on-rk3399-rock-pi-4.patch @@ -0,0 +1,32 @@ +From e12f67fe83446432ef16704c22ec23bd1dbcd094 Mon Sep 17 00:00:00 2001 +From: Vicente Bergas +Date: Tue, 1 Dec 2020 16:41:32 +0100 +Subject: arm64: dts: rockchip: use USB host by default on rk3399-rock-pi-4 + +Based on the board schematics at +https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi_4c_v12_sch_20200620.pdf +on page 19 there is an USB Type-A receptacle being used as an USB-OTG port. + +But the Type-A connector is not valid for OTG operation, for this reason +there is a switch to select host or device role. +This is non-compliant and error prone because switching is manual. +So, use host mode as it corresponds for a Type-A receptacle. + +Signed-off-by: Vicente Bergas +Link: https://lore.kernel.org/r/20201201154132.1286-4-vicencb@gmail.com +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts +@@ -684,7 +684,7 @@ + + &usbdrd_dwc3_0 { + status = "okay"; +- dr_mode = "otg"; ++ dr_mode = "host"; + }; + + &usbdrd3_1 { diff --git a/target/linux/tegra/base-files/lib/upgrade/platform.sh b/target/linux/tegra/base-files/lib/upgrade/platform.sh index 3e6ea8a44f..170bc11ba7 100644 --- a/target/linux/tegra/base-files/lib/upgrade/platform.sh +++ b/target/linux/tegra/base-files/lib/upgrade/platform.sh @@ -3,8 +3,6 @@ REQUIRE_IMAGE_METADATA=1 platform_check_image() { local diskdev partdev diff - [ "$#" -gt 1 ] && return 1 - export_bootdevice && export_partdevice diskdev 0 || { v "Unable to determine upgrade device" return 1 diff --git a/target/linux/tegra/image/Makefile b/target/linux/tegra/image/Makefile index aa0083f9ae..71a5fc581d 100644 --- a/target/linux/tegra/image/Makefile +++ b/target/linux/tegra/image/Makefile @@ -14,13 +14,9 @@ define Build/tegra-sdcard $(if $(DEVICE_DTS),\ $(foreach dtb,$(DEVICE_DTS),$(CP) $(DTS_DIR)/$(dtb).dtb $@.boot), \ $(CP) $(DTS_DIR)/*.dtb $@.boot) - sed \ - -e 's#@ROOT@#$(IMG_PART_SIGNATURE)#g' \ - -e 's#@KERNEL@#$(KERNEL_NAME)#g' \ - $(BOOT_SCRIPT) > $@-boot.scr mkimage -A arm -O linux -T script -C none -a 0 -e 0 \ -n '$(DEVICE_TITLE) OpenWrt bootscript' \ - -d $@-boot.scr \ + -d $(BOOT_SCRIPT) \ $@.boot/boot.scr SIGNATURE="$(IMG_PART_SIGNATURE)" \ diff --git a/target/linux/tegra/image/generic-bootscript b/target/linux/tegra/image/generic-bootscript index 7e86afdf5f..0e7816490d 100644 --- a/target/linux/tegra/image/generic-bootscript +++ b/target/linux/tegra/image/generic-bootscript @@ -1,6 +1,8 @@ -setenv bootargs "root=PARTUUID=@ROOT@-02 rw rootwait console=ttyS0,115200 console=tty0" +part uuid ${devtype} ${devnum}:2 ptuuid -load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /@KERNEL@ -load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /${soc}-${board}.dtb +setenv bootargs "root=PARTUUID=${ptuuid} rw rootwait console=ttyS0,115200 console=tty0" + +load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} zImage +load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${soc}-${board}.dtb bootz ${kernel_addr_r} - ${fdt_addr_r} diff --git a/toolchain/Config.in b/toolchain/Config.in index cb557d4ad3..6dda9af92d 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -110,11 +110,6 @@ menuconfig EXTERNAL_TOOLCHAIN bool "glibc" select USE_GLIBC - config EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC - bool "uClibc" - select USE_UCLIBC - depends on !(aarch64 || aarch64_be) - config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL bool "musl" select USE_MUSL @@ -125,7 +120,6 @@ menuconfig EXTERNAL_TOOLCHAIN string depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC - default "uclibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL config TOOLCHAIN_BIN_PATH @@ -237,7 +231,7 @@ comment "C Library" choice prompt "C Library implementation" if TOOLCHAINOPTS - default LIBC_USE_UCLIBC if arc + default LIBC_USE_GLIBC if arc default LIBC_USE_MUSL help Select the C library implementation. @@ -245,12 +239,6 @@ choice config LIBC_USE_GLIBC bool "Use glibc" select USE_GLIBC - depends on !arc - - config LIBC_USE_UCLIBC - select USE_UCLIBC - bool "Use uClibc" - depends on BROKEN || arc config LIBC_USE_MUSL select USE_MUSL @@ -259,7 +247,6 @@ choice endchoice -source "toolchain/uClibc/Config.in" source "toolchain/musl/Config.in" comment "Debuggers" @@ -273,9 +260,6 @@ config GDB Enable if you want to build the gdb. config USE_GLIBC - bool - -config USE_UCLIBC default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc) bool @@ -297,15 +281,12 @@ source "toolchain/gcc/Config.version" config LIBC string default "glibc" if USE_GLIBC - default "uClibc" if USE_UCLIBC default "musl" if USE_MUSL config TARGET_SUFFIX string default "gnueabi" if USE_GLIBC && (arm || armeb) default "gnu" if USE_GLIBC && !(arm || armeb) - default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb) - default "uclibc" if USE_UCLIBC && !(arm || armeb) default "muslgnueabi" if USE_MUSL && (arm || armeb) default "musl" if USE_MUSL && !(arm || armeb) diff --git a/toolchain/Makefile b/toolchain/Makefile index 23a5529eed..5dccf8f829 100644 --- a/toolchain/Makefile +++ b/toolchain/Makefile @@ -30,9 +30,6 @@ curdir:=toolchain # subdirectories to descend into $(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/initial gcc/final $(LIBC) fortify-headers) $(if $(CONFIG_NASM),nasm) -ifdef CONFIG_USE_UCLIBC - $(curdir)/builddirs += $(LIBC)/utils -endif # builddir dependencies ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in deleted file mode 100644 index 3bcb0037e9..0000000000 --- a/toolchain/uClibc/Config.in +++ /dev/null @@ -1,6 +0,0 @@ -# Debug version. - -config UCLIBC_ENABLE_DEBUG - bool "Build with debug information" - depends on TOOLCHAINOPTS && USE_UCLIBC && !EXTERNAL_TOOLCHAIN - default n diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile deleted file mode 100644 index 4764f2fa1d..0000000000 --- a/toolchain/uClibc/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -PATH_PREFIX=. - -include ./common.mk - -HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built -HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_installed - -HOST_BUILD_PARALLEL:=1 - -define Host/SetToolchainInfo - $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.uclibc.org/,' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk -endef - -define Host/Compile - $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak - $(UCLIBC_MAKE) PREFIX= all -endef - -define Host/Install - $(call Host/SetToolchainInfo) - $(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev - $(CP) $(HOST_BUILD_DIR)/libc/libc_so.a $(TOOLCHAIN_DIR)/lib/ - ( cd $(TOOLCHAIN_DIR) ; \ - for d in lib usr/lib ; do \ - for f in libc.so libgcc_s.so ; do \ - if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \ - $(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \ - fi \ - done \ - done \ - ) -endef - -$(eval $(call HostBuild)) diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk deleted file mode 100644 index bb093b1dc7..0000000000 --- a/toolchain/uClibc/common.mk +++ /dev/null @@ -1,98 +0,0 @@ -# -# Copyright (C) 2006-2020 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/target.mk - -PKG_VERSION:=1.0.34 -PKG_RELEASE:=1 - -PKG_NAME:=uClibc-ng -PKG_SOURCE_URL = http://downloads.uclibc-ng.org/releases/$(PKG_VERSION)/ -PATCH_DIR:=$(PATH_PREFIX)/patches -CONFIG_DIR:=$(PATH_PREFIX)/config -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -LIBC_SO_VERSION:=$(PKG_VERSION) - -PKG_HASH:=e6776229eee8d3f5a1cd29fb4286630e3cb9e97dded4e8f4a3a9bb4fa8c0d5e3 - -HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION) - -include $(INCLUDE_DIR)/toolchain-build.mk - -UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \ - -e 's/arc.*/arc/' \ - -e 's/i.86/i386/' \ - -e 's/sparc.*/sparc/' \ - -e 's/arm.*/arm/g' \ - -e 's/m68k.*/m68k/' \ - -e 's/ppc/powerpc/g' \ - -e 's/v850.*/v850/g' \ - -e 's/sh64/sh/' \ - -e 's/sh[234].*/sh/' \ - -e 's/mips.*/mips/' \ - -e 's/mipsel.*/mips/' \ -) - -GEN_CONFIG=$(SCRIPT_DIR)/kconfig.pl -n \ - $(if $(wildcard $(CONFIG_DIR)/common),'+' $(CONFIG_DIR)/common) \ - $(if $(CONFIG_UCLIBC_ENABLE_DEBUG),$(if $(wildcard $(CONFIG_DIR)/debug),'+' $(CONFIG_DIR)/debug)) \ - $(CONFIG_DIR)/$(ARCH)$(strip \ - $(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD), \ - $(if $(filter archs,$(subst ",,$(CONFIG_CPU_TYPE))),hs, \ - $(if $(CONFIG_MIPS64_ABI),.$(subst ",,$(CONFIG_MIPS64_ABI)), \ - $(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard $(CONFIG_DIR)/$(ARCH).e500),.e500)))))) - -CPU_CFLAGS = \ - -funsigned-char -fno-builtin -fno-asm \ - --std=gnu99 -ffunction-sections -fdata-sections \ - -Wno-unused-but-set-variable \ - $(TARGET_CFLAGS) -ggdb - -UCLIBC_MAKE = PATH='$(TOOLCHAIN_DIR)/initial/bin:$(TARGET_PATH)' $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ - $(TARGET_CONFIGURE_OPTS) \ - DEVEL_PREFIX=/ \ - RUNTIME_PREFIX=/ \ - HOSTCC="$(HOSTCC)" \ - CPU_CFLAGS="$(CPU_CFLAGS)" \ - ARCH="$(CONFIG_ARCH)" \ - LIBGCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))" \ - DOSTRIP="" - -define Host/Prepare - $(call Host/Prepare/Default) - $(if $(strip $(QUILT)), \ - cd $(HOST_BUILD_DIR); \ - if $(QUILT_CMD) next >/dev/null 2>&1; then \ - $(QUILT_CMD) push -a; \ - fi - ) - ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) -endef - -define Host/Configure - $(GEN_CONFIG) > $(HOST_BUILD_DIR)/.config.new - $(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/include\",g' \ - -e 's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \ - -e 's,^.*UCLIBC_HAS_SOFT_FLOAT.*,UCLIBC_HAS_SOFT_FLOAT=$(if $(CONFIG_SOFT_FLOAT),y,n),g' \ - -e 's,^.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \ - -e 's,^.*UCLIBC_BUILD_ALL_LOCALE.*,UCLIBC_BUILD_ALL_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \ - -e 's,^.*UCLIBC_HAS_SSP[^_].*,UCLIBC_HAS_SSP=$(if $(or $(CONFIG_PKG_CC_STACKPROTECTOR_REGULAR),$(CONFIG_PKG_CC_STACKPROTECTOR_STRONG)),y,n),g' \ - $(HOST_BUILD_DIR)/.config.new - cmp -s $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config.last || { \ - cp $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config && \ - $(MAKE) -C $(HOST_BUILD_DIR) olddefconfig KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" && \ - $(MAKE) -C $(HOST_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" && \ - cp $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config.last; \ - } -endef - -define Host/Clean - rm -rf \ - $(HOST_BUILD_DIR) \ - $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ - $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev -endef diff --git a/toolchain/uClibc/config/arc b/toolchain/uClibc/config/arc deleted file mode 100644 index f92328b7ed..0000000000 --- a/toolchain/uClibc/config/arc +++ /dev/null @@ -1,8 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -TARGET_ARCH="arc" -TARGET_arc=y -CONFIG_ARC_PAGE_SIZE_8K=y -# CONFIG_ARC_PAGE_SIZE_16K is not set -# CONFIG_ARC_PAGE_SIZE_4K is not set diff --git a/toolchain/uClibc/config/archs b/toolchain/uClibc/config/archs deleted file mode 100644 index f92328b7ed..0000000000 --- a/toolchain/uClibc/config/archs +++ /dev/null @@ -1,8 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -TARGET_ARCH="arc" -TARGET_arc=y -CONFIG_ARC_PAGE_SIZE_8K=y -# CONFIG_ARC_PAGE_SIZE_16K is not set -# CONFIG_ARC_PAGE_SIZE_4K is not set diff --git a/toolchain/uClibc/config/arm b/toolchain/uClibc/config/arm deleted file mode 100644 index 9544f144d1..0000000000 --- a/toolchain/uClibc/config/arm +++ /dev/null @@ -1,7 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -TARGET_ARCH="arm" -TARGET_arm=y -CONFIG_ARM_EABI=y - diff --git a/toolchain/uClibc/config/armeb b/toolchain/uClibc/config/armeb deleted file mode 100644 index e329c7e369..0000000000 --- a/toolchain/uClibc/config/armeb +++ /dev/null @@ -1,7 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_WANTS_BIG_ENDIAN=y -TARGET_ARCH="arm" -TARGET_arm=y -CONFIG_ARM_EABI=y - diff --git a/toolchain/uClibc/config/common b/toolchain/uClibc/config/common deleted file mode 100644 index d88d5bf473..0000000000 --- a/toolchain/uClibc/config/common +++ /dev/null @@ -1,199 +0,0 @@ -# ARCH_ANY_ENDIAN is not set -ARCH_HAS_MMU=y -# ARCH_HAS_NO_LDSO is not set -# ARCH_HAS_NO_SHARED is not set -# ARCH_LITTLE_ENDIAN is not set -ARCH_USE_MMU=y -# ARCH_WANTS_BIG_ENDIAN is not set -# ARCH_WANTS_LITTLE_ENDIAN is not set -ASSUME_DEVPTS=y -CROSS_COMPILER_PREFIX="" -DEVEL_PREFIX="/usr/" -# DOASSERTS is not set -# DODEBUG is not set -# DODEBUG_PT is not set -DOPIC=y -DOSTRIP=y -DO_C99_MATH=y -# DO_XSI_MATH is not set -# EXTRA_WARNINGS is not set -FORCE_OPTIONS_FOR_ARCH=y -# FORCE_SHAREABLE_TEXT_SEGMENTS is not set -# HARDWIRED_ABSPATH is not set -# HAS_NO_THREADS is not set -HAVE_DOT_CONFIG=y -# HAVE_NO_PIC is not set -# HAVE_NO_SSP is not set -HAVE_SHARED=y -KERNEL_HEADERS="." -LDSO_BASE_FILENAME="ld.so" -LDSO_CACHE_SUPPORT=y -# LDSO_GNU_HASH_SUPPORT is not set -LDSO_LD_LIBRARY_PATH=y -LDSO_LDD_SUPPORT=y -# LDSO_PRELINK_SUPPORT is not set -# LDSO_PRELOAD_FILE_SUPPORT is not set -LDSO_PRELOAD_ENV_SUPPORT=y -LDSO_RUNPATH=y -LDSO_SAFE_RUNPATH=y -# LDSO_RUNPATH_OF_EXECUTABLE is not set -# LDSO_SEARCH_INTERP_PATH is not set -# LDSO_STANDALONE_SUPPORT is not set -# UCLIBC_HAS_BACKTRACE is not set -UCLIBC_HAS_THREADS_NATIVE=y -# MALLOC is not set -# MALLOC_SIMPLE is not set -MALLOC_STANDARD=y -MULTILIB_DIR="lib" -PTHREADS_DEBUG_SUPPORT=y -RUNTIME_PREFIX="/" -# SUPPORT_LD_DEBUG is not set -# SUPPORT_LD_DEBUG_EARLY is not set -TARGET_SUBARCH="" -# TARGET_alpha is not set -# TARGET_arc is not set -# TARGET_arm is not set -# TARGET_avr32 is not set -# TARGET_bfin is not set -# TARGET_c6x is not set -# TARGET_cris is not set -# TARGET_frv is not set -# TARGET_h8300 is not set -# TARGET_hppa is not set -# TARGET_i386 is not set -# TARGET_ia64 is not set -# TARGET_lm32 is not set -# TARGET_m68k is not set -# TARGET_metag is not set -# TARGET_microblaze is not set -# TARGET_mips is not set -# TARGET_nios is not set -# TARGET_nios2 is not set -# TARGET_or1k is not set -# TARGET_powerpc is not set -# TARGET_sh is not set -# TARGET_sparc is not set -# TARGET_x86_64 is not set -# TARGET_xtensa is not set -UCLIBC_BSD_SPECIFIC=y -UCLIBC_BUILD_NOEXECSTACK=y -# UCLIBC_BUILD_NOW is not set -# UCLIBC_BUILD_PIE is not set -UCLIBC_BUILD_RELRO=y -UCLIBC_CTOR_DTOR=y -UCLIBC_DYNAMIC_ATEXIT=y -UCLIBC_EXTRA_CFLAGS="" -UCLIBC_GRP_BUFFER_SIZE=256 -UCLIBC_HAS_ADVANCED_REALTIME=y -# UCLIBC_HAS_ARGP is not set -UCLIBC_HAS_BSD_ERR=y -# UCLIBC_HAS_BSD_RES_CLOSE is not set -# UCLIBC_HAS_COMPAT_RES_STATE is not set -UCLIBC_HAS_CRYPT=y -UCLIBC_HAS_CRYPT_IMPL=y -UCLIBC_HAS_CTYPE_CHECKED=y -# UCLIBC_HAS_CTYPE_ENFORCED is not set -UCLIBC_HAS_CTYPE_SIGNED=y -UCLIBC_HAS_CTYPE_TABLES=y -# UCLIBC_HAS_CTYPE_UNSAFE is not set -UCLIBC_HAS_EPOLL=y -UCLIBC_HAS_ERRNO_MESSAGES=y -# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set -# UCLIBC_HAS_FENV is not set -UCLIBC_HAS_FLOATS=y -UCLIBC_HAS_FNMATCH=y -# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set -UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y -# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set -# UCLIBC_HAS_FPU is not set -UCLIBC_HAS_FTS=y -# UCLIBC_HAS_FTW is not set -UCLIBC_HAS_GETPT=y -UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y -UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y -# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set -UCLIBC_HAS_GLOB=y -UCLIBC_HAS_GNU_ERROR=y -UCLIBC_HAS_GNU_GETOPT=y -UCLIBC_HAS_GNU_GETSUBOPT=y -UCLIBC_HAS_GNU_GLOB=y -UCLIBC_HAS_HEXADECIMAL_FLOATS=y -UCLIBC_HAS_IPV4=y -UCLIBC_HAS_IPV6=y -UCLIBC_HAS_LFS=y -UCLIBC_HAS_LIBUTIL=y -# UCLIBC_HAS_LOCALE is not set -# UCLIBC_BUILD_ALL_LOCALE is not set -# UCLIBC_BUILD_MINIMAL_LOCALE is not set -UCLIBC_HAS_LONG_DOUBLE_MATH=y -UCLIBC_HAS_NETWORK_SUPPORT=y -UCLIBC_HAS_NFTW=y -# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set -# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set -UCLIBC_HAS_PRINTF_M_SPEC=y -# UCLIBC_HAS_PROFILING is not set -UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y -UCLIBC_HAS_PTY=y -UCLIBC_HAS_REALTIME=y -UCLIBC_HAS_REGEX=y -UCLIBC_HAS_RESOLVER_SUPPORT=y -# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set -# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set -UCLIBC_HAS_SHADOW=y -UCLIBC_HAS_SIGNUM_MESSAGES=y -UCLIBC_HAS_SOCKET=y -UCLIBC_HAS_SOFT_FLOAT=y -# UCLIBC_HAS_SSP is not set -UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y -# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set -UCLIBC_HAS_STDIO_BUFSIZ_4096=y -# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set -# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set -# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set -UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y -UCLIBC_HAS_STDIO_GETC_MACRO=y -UCLIBC_HAS_STDIO_PUTC_MACRO=y -# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set -UCLIBC_HAS_STRING_ARCH_OPT=y -UCLIBC_HAS_STRING_GENERIC_OPT=y -# UCLIBC_HAS_STUBS is not set -UCLIBC_HAS_SYSLOG=y -# UCLIBC_HAS_SYS_ERRLIST is not set -# UCLIBC_HAS_SYS_SIGLIST is not set -UCLIBC_HAS_THREADS=y -UCLIBC_HAS_TM_EXTENSIONS=y -UCLIBC_HAS_TZ_CACHING=y -UCLIBC_HAS_TZ_FILE=y -UCLIBC_HAS_TZ_FILE_READ_MANY=y -UCLIBC_HAS_UTMPX=y -UCLIBC_HAS_UTMP=y -UCLIBC_HAS_WCHAR=y -UCLIBC_HAS_WORDEXP=y -UCLIBC_HAS_XATTR=y -# UCLIBC_HAS_XLOCALE is not set -UCLIBC_HAS___PROGNAME=y -UCLIBC_LINUX_SPECIFIC=y -# UCLIBC_MALLOC_DEBUGGING is not set -# UCLIBC_NTP_LEGACY is not set -# USE_OLD_VFPRINTF is not set -UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9 -UCLIBC_PWD_BUFFER_SIZE=256 -# UCLIBC_STATIC_LDCONFIG is not set -# UCLIBC_STRICT_HEADERS is not set -UCLIBC_SUPPORT_AI_ADDRCONFIG=y -UCLIBC_SUSV3_LEGACY=y -# UCLIBC_SUSV3_LEGACY_MACROS is not set -UCLIBC_SUSV4_LEGACY=y -# UCLIBC_SV4_DEPRECATED is not set -UCLIBC_TZ_FILE_PATH="/etc/TZ" -# UCLIBC_FALLBACK_TO_ETC_LOCALTIME is not set -UCLIBC_USE_NETLINK=y -# UNIX98PTY_ONLY is not set -WARNINGS="-Wall" -# UCLIBC_SUSV2_LEGACY is not set -# UCLIBC_HAS_CONTEXT_FUNCS is not set -UCLIBC_HAS_GETOPT_LONG=y diff --git a/toolchain/uClibc/config/debug b/toolchain/uClibc/config/debug deleted file mode 100644 index b366e66e39..0000000000 --- a/toolchain/uClibc/config/debug +++ /dev/null @@ -1,6 +0,0 @@ -DODEBUG=y -DODEBUG_PT=y -PTHREADS_DEBUG_SUPPORT=y -SUPPORT_LD_DEBUG=y -SUPPORT_LD_DEBUG_EARLY=y -UCLIBC_MALLOC_DEBUGGING=y diff --git a/toolchain/uClibc/config/i386 b/toolchain/uClibc/config/i386 deleted file mode 100644 index cddb709630..0000000000 --- a/toolchain/uClibc/config/i386 +++ /dev/null @@ -1,8 +0,0 @@ -ARCH_LITTLE_ENDIAN=y -# CONFIG_386 is not set -CONFIG_486=y -# CONFIG_586 is not set -# CONFIG_686 is not set -TARGET_ARCH="i386" -TARGET_i386=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/i686 b/toolchain/uClibc/config/i686 deleted file mode 100644 index 8a25f41e23..0000000000 --- a/toolchain/uClibc/config/i686 +++ /dev/null @@ -1,8 +0,0 @@ -ARCH_LITTLE_ENDIAN=y -# CONFIG_386 is not set -# CONFIG_486 is not set -# CONFIG_586 is not set -CONFIG_686=y -TARGET_ARCH="i386" -TARGET_i386=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/m68k b/toolchain/uClibc/config/m68k deleted file mode 100644 index 0675bb9080..0000000000 --- a/toolchain/uClibc/config/m68k +++ /dev/null @@ -1,5 +0,0 @@ -ARCH_BIG_ENDIAN=y -TARGET_ARCH="m68k" -TARGET_SUBARCH="" -TARGET_m68k=y -# UCLIBC_HAS_THREADS_NATIVE is not set diff --git a/toolchain/uClibc/config/mips b/toolchain/uClibc/config/mips deleted file mode 100644 index c8f71f03c9..0000000000 --- a/toolchain/uClibc/config/mips +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64 b/toolchain/uClibc/config/mips64 deleted file mode 100644 index 453293def3..0000000000 --- a/toolchain/uClibc/config/mips64 +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64.32 b/toolchain/uClibc/config/mips64.32 deleted file mode 100644 index 4e98968633..0000000000 --- a/toolchain/uClibc/config/mips64.32 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64.64 b/toolchain/uClibc/config/mips64.64 deleted file mode 100644 index bf4ecca704..0000000000 --- a/toolchain/uClibc/config/mips64.64 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64.n32 b/toolchain/uClibc/config/mips64.n32 deleted file mode 100644 index c26ecec4c2..0000000000 --- a/toolchain/uClibc/config/mips64.n32 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -CONFIG_MIPS_N32_ABI=y -# CONFIG_MIPS_N64_ABI is not set -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64el b/toolchain/uClibc/config/mips64el deleted file mode 100644 index 98d9bb4569..0000000000 --- a/toolchain/uClibc/config/mips64el +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64el.32 b/toolchain/uClibc/config/mips64el.32 deleted file mode 100644 index 03ab17c24f..0000000000 --- a/toolchain/uClibc/config/mips64el.32 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64el.64 b/toolchain/uClibc/config/mips64el.64 deleted file mode 100644 index 884640c756..0000000000 --- a/toolchain/uClibc/config/mips64el.64 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64el.n32 b/toolchain/uClibc/config/mips64el.n32 deleted file mode 100644 index 9a8bb3d3fb..0000000000 --- a/toolchain/uClibc/config/mips64el.n32 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -CONFIG_MIPS_N32_ABI=y -# CONFIG_MIPS_N64_ABI is not set -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mipsel b/toolchain/uClibc/config/mipsel deleted file mode 100644 index 2a79c16bdb..0000000000 --- a/toolchain/uClibc/config/mipsel +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mipsel.cobalt b/toolchain/uClibc/config/mipsel.cobalt deleted file mode 100644 index 2a79c16bdb..0000000000 --- a/toolchain/uClibc/config/mipsel.cobalt +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/powerpc b/toolchain/uClibc/config/powerpc deleted file mode 100644 index 5b1292d12e..0000000000 --- a/toolchain/uClibc/config/powerpc +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_BIG_ENDIAN=y -CONFIG_CLASSIC=y -# CONFIG_E500 is not set -TARGET_ARCH="powerpc" -TARGET_SUBARCH="classic" -TARGET_powerpc=y diff --git a/toolchain/uClibc/config/powerpc.e500 b/toolchain/uClibc/config/powerpc.e500 deleted file mode 100644 index a835c3d5e7..0000000000 --- a/toolchain/uClibc/config/powerpc.e500 +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_BIG_ENDIAN=y -# CONFIG_CLASSIC is not set -CONFIG_E500=y -TARGET_ARCH="powerpc" -TARGET_SUBARCH="classic" -TARGET_powerpc=y diff --git a/toolchain/uClibc/config/sparc b/toolchain/uClibc/config/sparc deleted file mode 100644 index 3630b24a7e..0000000000 --- a/toolchain/uClibc/config/sparc +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_BIG_ENDIAN=y -# CONFIG_SPARC_V7 is not set -# CONFIG_SPARC_V8 is not set -TARGET_ARCH="sparc" -TARGET_sparc=y -UCLIBC_HAS_LONG_DOUBLE_MATH=y diff --git a/toolchain/uClibc/config/sparc.leon b/toolchain/uClibc/config/sparc.leon deleted file mode 100644 index 3deb5148d9..0000000000 --- a/toolchain/uClibc/config/sparc.leon +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_BIG_ENDIAN=y -# CONFIG_SPARC_V7 is not set -CONFIG_SPARC_V8=y -TARGET_ARCH="sparc" -TARGET_sparc=y -UCLIBC_HAS_LONG_DOUBLE_MATH=y diff --git a/toolchain/uClibc/config/x86_64 b/toolchain/uClibc/config/x86_64 deleted file mode 100644 index a13d659ba1..0000000000 --- a/toolchain/uClibc/config/x86_64 +++ /dev/null @@ -1,5 +0,0 @@ -ARCH_LITTLE_ENDIAN=y -TARGET_ARCH="x86_64" -TARGET_x86_64=y -UCLIBC_BSD_SPECIFIC=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/headers/Makefile b/toolchain/uClibc/headers/Makefile deleted file mode 100644 index abd3620d33..0000000000 --- a/toolchain/uClibc/headers/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -PATH_PREFIX:=.. - -include ../common.mk - -HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.headers_built -HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_headers_installed - -define Host/Compile - -endef - -define Host/Install - PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \ - PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ - DEVEL_PREFIX=/ \ - RUNTIME_PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ - HOSTCC="$(HOSTCC)" \ - CC="$(TARGET_CC)" \ - CPU_CFLAGS="$(TARGET_CFLAGS)" \ - ARCH="$(CONFIG_ARCH)" \ - pregen \ - install_headers - $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/ -endef - -$(eval $(call HostBuild)) - diff --git a/toolchain/uClibc/utils/Makefile b/toolchain/uClibc/utils/Makefile deleted file mode 100644 index 83100d70c1..0000000000 --- a/toolchain/uClibc/utils/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -PATH_PREFIX=.. - -include ../common.mk - -HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.utils_built -HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_utils_installed - -define Host/Compile - $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak - $(UCLIBC_MAKE) PREFIX= utils -endef - -define Host/Install - $(INSTALL_DIR) $(TOOLCHAIN_DIR)/bin - $(INSTALL_BIN) \ - $(HOST_BUILD_DIR)/utils/ldd \ - $(TOOLCHAIN_DIR)/bin/ - $(INSTALL_DIR) $(TOOLCHAIN_DIR)/sbin - $(INSTALL_BIN) \ - $(HOST_BUILD_DIR)/utils/ldconfig \ - $(TOOLCHAIN_DIR)/sbin/ -endef - -$(eval $(call HostBuild)) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 9a68b80c71..6074ecc608 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -84,6 +84,7 @@ define Host/Compile $(call cc,pc1crypt) $(call cc,ptgen cyg_crc32) $(call cc,seama md5) + $(call cc,sign_dlink_ru md5,-Wall) $(call cc,spw303v) $(call cc,srec2bin) $(call cc,tplink-safeloader md5,-Wall --std=gnu99) diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c index 591ce44a78..5b749a3f66 100644 --- a/tools/firmware-utils/src/mkfwimage.c +++ b/tools/firmware-utils/src/mkfwimage.c @@ -148,7 +148,7 @@ struct fw_info fw_info[] = { .sign = true, }, { - .name = "ACB-ISP", + .name = "ACB", .fw_layout = { .kern_start = 0x9f050000, .kern_entry = 0x80002000, diff --git a/tools/firmware-utils/src/sign_dlink_ru.c b/tools/firmware-utils/src/sign_dlink_ru.c new file mode 100644 index 0000000000..9c02ed50af --- /dev/null +++ b/tools/firmware-utils/src/sign_dlink_ru.c @@ -0,0 +1,225 @@ +/* + * This program is designed to sign firmware images so they are accepted + * by D-Link DIR-882 R1 WebUIs. + * + * Copyright (C) 2020 Andrew Pikler + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "md5.h" + +#define BUF_SIZE 4096 +#define MD5_HASH_LEN 16 + + +typedef struct _md5_digest_t { + uint8_t digest[MD5_HASH_LEN]; +} md5_digest_t; + +typedef struct _salt_t { + char* salt_ascii; + uint8_t* salt_bin; + size_t salt_bin_len; +} salt_t; + +void read_file_bytes(FILE* f, MD5_CTX* md5_ctx) { + uint8_t buf[BUF_SIZE]; + size_t bytes_read; + rewind(f); + + while (0 != (bytes_read = fread(buf, sizeof(uint8_t), BUF_SIZE, f))) { + MD5_Update(md5_ctx, buf, bytes_read); + } + + if (!feof(f)) { + printf("Error: expected to be at EOF\n"); + exit(-1); + } +} + +void add_magic_bytes(FILE* f) { + char magic_bytes[] = { 0x00, 0xc0, 0xff, 0xee }; + size_t magic_bytes_len = 4; + fwrite(magic_bytes, magic_bytes_len, 1, f); +} + +/** + * Add the signature produced by this salt to the file + * The signature consists by creating an MD5 digest wht the salt bytes plus + * all of the bytes in the firmware file, then adding the magic bytes to the + * file + */ +void add_signature(FILE* f, salt_t* salt) { + md5_digest_t digest; + MD5_CTX md5_context; + + MD5_Init(&md5_context); + MD5_Update(&md5_context, salt->salt_bin, salt->salt_bin_len); + read_file_bytes(f, &md5_context); + MD5_Final(digest.digest, &md5_context); + + fwrite(&digest.digest, sizeof(uint8_t), MD5_HASH_LEN, f); + add_magic_bytes(f); +} + +void add_version_suffix(FILE* f) { + char* version_suffix = "c0ffeef0rge"; + fseek(f, 0, SEEK_END); + fwrite(version_suffix, sizeof(char), strlen(version_suffix), f); +} + +int asciihex_to_int(char c) { + if(c >= '0' && c <= 'F') + return c - '0'; + + if(c >= 'a' && c <= 'f') + return 10 + c - 'a'; + return -1; +} + +/** + * Verify this is a valid hex string to convert + */ +void verify_valid_hex_str(char* s) { + int i; + int s_len = strlen(s); + if (s_len == 0) { + printf("invalid empty salt: %s\n", s); + exit(-1); + } + + if (s_len % 2 != 0) { + printf("invalid odd len salt: %s\n", s); + exit(-1); + } + + for (i = 0; i < s_len; ++i) { + if (asciihex_to_int(s[i]) < 0) { + printf("invalid salt (invalid hex char): %s\n", s); + exit(-1); + } + } +} + +/** + * Convert a hex ascii string to an allocated binary array. This array must be free'd + */ +uint8_t* convert_hex_to_bin(char * s) { + int i; + int s_len = strlen(s); + + uint8_t* ret = malloc(s_len / 2); + for (i = 0; i < s_len; i += 2) { + ret[i / 2] = (asciihex_to_int(s[i]) << 4) | asciihex_to_int(s[i + 1]); + } + + return ret; +} + +void init_salt(salt_t* salt, char * salt_ascii) { + salt->salt_ascii = salt_ascii; + salt->salt_bin = convert_hex_to_bin(salt_ascii); + salt->salt_bin_len = strlen(salt_ascii) / 2; +} + +void free_salt(salt_t* salt) { + free(salt->salt_bin); +} + +/** + * Verify that the arguments are valid, or exit with failure + */ +void verify_args(int argc, char** argv) { + int i; + + if (argc < 3) { + printf("Usage: %s ... \n", argv[0]); + exit(1); + } + + for (i = 2; i < argc; i++) { + verify_valid_hex_str(argv[i]); + } +} + +FILE* make_out_file(char* filename) { + uint8_t buf[BUF_SIZE]; + int bytes_read; + char* suffix = ".new"; + int new_filename_len = strlen(filename) + strlen(suffix) + 1; + char* new_filename = malloc(new_filename_len); + strcpy(new_filename, filename); + strcat(new_filename, suffix); + + FILE* f = fopen(filename, "r+"); + if (!f) { + printf("cannot open file %s\n", filename); + exit(2); + } + + FILE* out = fopen(new_filename, "w+"); + free(new_filename); + if (!out) { + printf("cannot open file %s\n", filename); + exit(2); + } + + while (0 != (bytes_read = fread(buf, sizeof(uint8_t), BUF_SIZE, f))) { + fwrite(buf, sizeof(uint8_t), bytes_read, out); + } + fclose(f); + return out; +} + +/** + * Sign the firmware file after all of our checks have completed + */ +void sign_firmware(char* filename, char** salts, int num_salts) { + int i; + salt_t salt; + FILE* f = make_out_file(filename); + + // add a version suffix string - dlink versions do something similar before the first signature + add_version_suffix(f); + + //for each of the salts we are supplied with + for (i = 0; i < num_salts; i++) { + char* salt_str = salts[i]; + // convert this str to binary + init_salt(&salt, salt_str); + + // add the signature to the firmware file produced from this salt + add_signature(f, &salt); + free_salt(&salt); + printf("Signed with salt: %s\n", salt_str); + } + + fclose(f); +} + + +int main(int argc, char ** argv) { + verify_args(argc, argv); + sign_firmware(argv[1], argv+2, argc-2); + return 0; +} diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile index cefee1edf0..7d785aae39 100644 --- a/tools/pkgconf/Makefile +++ b/tools/pkgconf/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pkgconf -PKG_VERSION:=1.6.3 +PKG_VERSION:=1.7.3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf -PKG_HASH:=61f0b31b0d5ea0e862b454a80c170f57bad47879c0c42bd8de89200ff62ea210 +PKG_HASH:=b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0 HOST_BUILD_PARALLEL:=1 diff --git a/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch b/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch deleted file mode 100644 index b2c538d24e..0000000000 --- a/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 62bbd3b664d4b03011a4b382ed20353a91c30406 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Tue, 21 Jan 2020 10:32:36 -0600 -Subject: [PATCH] cli: remove --version to --modversion remapping - -This has been a source of frequent complaints, so we drop it. -Resolves: https://todo.sr.ht/~kaniini/pkgconf/6 ---- - cli/main.c | 14 ++------------ - 1 file changed, 2 insertions(+), 12 deletions(-) - -diff --git a/cli/main.c b/cli/main.c -index 563ec8f0cfcd..fc698a4f9191 100644 ---- a/cli/main.c -+++ b/cli/main.c -@@ -1005,18 +1005,8 @@ main(int argc, char *argv[]) - - if ((want_flags & PKG_VERSION) == PKG_VERSION) - { -- if (argc > 2) -- { -- fprintf(stderr, "%s: --version specified with other options or module names, assuming --modversion.\n", argv[0]); -- -- want_flags &= ~PKG_VERSION; -- want_flags |= PKG_MODVERSION; -- } -- else -- { -- version(); -- return EXIT_SUCCESS; -- } -+ version(); -+ return EXIT_SUCCESS; - } - - if ((want_flags & PKG_HELP) == PKG_HELP)