diff --git a/README.md b/README.md index 39eb8041c1..9d0b1983d8 100644 --- a/README.md +++ b/README.md @@ -34,12 +34,12 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens sudo apt update -y sudo apt full-upgrade -y sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ - bzip2 ccache cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext gcc-multilib g++-multilib \ - git gperf haveged help2man intltool lib32gcc-s1 libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \ - libmpc-dev libmpfr-dev libncurses5-dev libncursesw5 libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \ - mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip python3-ply \ - python-docutils qemu-utils re2c rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \ - vim wget xmlto xxd zlib1g-dev + bzip2 ccache clang clangd cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext gcc-multilib \ + g++-multilib git gperf haveged help2man intltool lib32gcc-s1 libc6-dev-i386 libelf-dev libglib2.0-dev \ + libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5 libncursesw5-dev libreadline-dev \ + libssl-dev libtool lld lldb lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 \ + python3 python3-pip python3-ply python-docutils qemu-utils re2c rsync scons squashfs-tools subversion swig \ + texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev ``` - Method 2: diff --git a/config/Config-build.in b/config/Config-build.in index ab4cc54136..9a5cc6c5bb 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -164,7 +164,6 @@ menu "Global build settings" choice prompt "Binary stripping method" - default USE_STRIP if EXTERNAL_TOOLCHAIN default USE_STRIP if USE_GLIBC default USE_SSTRIP help diff --git a/include/depends.mk b/include/depends.mk index 0080b97876..7b87f2643f 100644 --- a/include/depends.mk +++ b/include/depends.mk @@ -12,6 +12,7 @@ DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp" -x "*/.pkgdir*" find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -printf "%p%T@\n" | sort | mkhash md5 +find_md5_reproducible=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -print0 | xargs -0 mkhash md5 | sort | mkhash md5 define rdep .PRECIOUS: $(2) diff --git a/include/download.mk b/include/download.mk index 4b419851d0..99a3e0140d 100644 --- a/include/download.mk +++ b/include/download.mk @@ -27,7 +27,7 @@ define dl_method $(strip \ $(if $(filter git,$(2)),$(call dl_method_git,$(1),$(2)), $(if $(2),$(2), \ - $(if $(filter @OPENWRT @IMMORTALWRT @APACHE/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \ + $(if $(filter @OPENWRT @IMMORTALWRT @APACHE/% @DEBIAN/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \ $(if $(filter git://%,$(1)),$(call dl_method_git,$(1),$(2)), \ $(if $(filter svn://%,$(1)),svn, \ $(if $(filter cvs://%,$(1)),cvs, \ diff --git a/include/host-build.mk b/include/host-build.mk index e4a5c48e72..c3e0c26e6a 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/depends.mk include $(INCLUDE_DIR)/quilt.mk BUILD_TYPES += host -HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS))) +HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS))) HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built HOST_BUILD_PREFIX?=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST)) @@ -197,8 +197,8 @@ ifndef DUMP ifneq ($(CONFIG_AUTOREMOVE),) host-compile: - $(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' | \ - $(XARGS) rm -rf + $(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -print0 | \ + $(XARGS) -0 rm -rf endif endef endif diff --git a/include/kernel-5.4 b/include/kernel-5.4 new file mode 100644 index 0000000000..cd7de7b8fc --- /dev/null +++ b/include/kernel-5.4 @@ -0,0 +1,2 @@ +LINUX_VERSION-5.4 = .225 +LINUX_KERNEL_HASH-5.4.225 = 59f596f6714317955cf481590babcf015aff2bc1900bd8e8dc8f7af73bc560aa diff --git a/include/kernel-build.mk b/include/kernel-build.mk index 66a9f64c80..1f440f9ee0 100644 --- a/include/kernel-build.mk +++ b/include/kernel-build.mk @@ -10,7 +10,7 @@ ifneq ($(DUMP),1) endif KERNEL_FILE_DEPENDS=$(GENERIC_BACKPORT_DIR) $(GENERIC_PATCH_DIR) $(GENERIC_HACK_DIR) $(PATCH_DIR) $(GENERIC_FILES_DIR) $(FILES_DIR) -STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,$(KERNEL_FILE_DEPENDS),))) +STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),$(KERNEL_FILE_DEPENDS),))) STAMP_CONFIGURED:=$(LINUX_DIR)/.configured include $(INCLUDE_DIR)/download.mk include $(INCLUDE_DIR)/quilt.mk diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 9b8325db0a..1edb01df27 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,9 +6,12 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .224 +KERNEL_DETAILS_FILE=$(INCLUDE_DIR)/kernel-$(KERNEL_PATCHVER) +ifeq ($(wildcard $(KERNEL_DETAILS_FILE)),) + $(error Missing kernel version/hash file for $(KERNEL_PATCHVER). Please create $(KERNEL_DETAILS_FILE)) +endif -LINUX_KERNEL_HASH-5.4.224 = 8b7df25b5560620eb2776d7b7c67569764b3916ff2f596767f72567b38d13d36 +include $(KERNEL_DETAILS_FILE) remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/include/package.mk b/include/package.mk index db0a869dab..225fdfc771 100644 --- a/include/package.mk +++ b/include/package.mk @@ -84,7 +84,7 @@ ifneq ($(PREV_STAMP_PREPARED),) STAMP_PREPARED:=$(PREV_STAMP_PREPARED) CONFIG_AUTOREBUILD:= else - STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS))) + STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS))) endif STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS))) STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_* @@ -258,8 +258,8 @@ define Build/CoreTargets ifneq ($(CONFIG_AUTOREMOVE),) compile: -touch -r $(PKG_BUILD_DIR)/.built $(PKG_BUILD_DIR)/.autoremove 2>/dev/null >/dev/null - $(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \ - $(XARGS) rm -rf + $(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' -print0 | \ + $(XARGS) -0 rm -rf endif endef diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 2f63f10143..a2d967a83f 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -96,7 +96,7 @@ generate_network() { json_select network json_select "$1" - json_get_vars device macaddr protocol ipaddr netmask vlan + json_get_vars device macaddr metric protocol ipaddr netmask vlan json_get_values ports ports json_select .. json_select .. @@ -154,6 +154,7 @@ generate_network() { set network.$1='interface' set network.$1.type='$type' set network.$1.device='$device' + set network.$1.metric='$metric' set network.$1.proto='none' EOF diff --git a/package/kernel/exfat/Makefile b/package/kernel/exfat/Makefile index d8f451a35a..31bf49df33 100644 --- a/package/kernel/exfat/Makefile +++ b/package/kernel/exfat/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=exfat -PKG_VERSION:=5.19.1 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=6.0.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/namjaejeon/linux-exfat-oot/tar.gz/$(PKG_VERSION)? -PKG_HASH:=80750bfa3bcdf743ca0d027be8244cc7b6ccd78f20304c2cabbb4011c88e4f0a +PKG_HASH:=08513c4ad7bceda6570435f54e76fc91369cbf404968838bdd3f566495f20f36 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-exfat-oot-$(PKG_VERSION) PKG_MAINTAINER:= diff --git a/package/kernel/i40e/Makefile b/package/kernel/i40e/Makefile new file mode 100644 index 0000000000..113fd1ef9d --- /dev/null +++ b/package/kernel/i40e/Makefile @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2022 ImmortalWrt.org + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=i40e +PKG_VERSION:=2.22.8 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@IMMORTALWRT +PKG_HASH:=938eac24067e385d6e7e47788c7a1c47987bbe0ed36f3360809cbaa8caf85c6b + +PKG_MAINTAINER:=Tianling Shen +PKG_LICENSE:=GPL-2.0-only +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/i40e-vendor + SUBMENU:=Network Devices + TITLE:=Intel(R) Ethernet Controller XL710 Family support (vendor driver) + VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) + DEPENDS:=@PCI_SUPPORT +kmod-mdio +kmod-ptp +kmod-libphy + CONFLICTS:=kmod-i40e + FILES:= \ + $(PKG_BUILD_DIR)/src/intel_auxiliary.ko \ + $(PKG_BUILD_DIR)/src/i40e.ko + AUTOLOAD:=$(call AutoProbe,i40e) +endef + +define KernelPackage/i40e-vendor/description + Kernel modules for Intel(R) Ethernet Controller XL710 Family 40 Gigabit Ethernet adapters. +endef + +define Build/Compile + +$(KERNEL_MAKE) $(PKG_JOBS) \ + M=$(PKG_BUILD_DIR)/src \ + NEED_AUX_BUS=2 \ + modules +endef + +$(eval $(call KernelPackage,i40e-vendor)) diff --git a/package/kernel/igb/Makefile b/package/kernel/igb/Makefile new file mode 100644 index 0000000000..42321305ec --- /dev/null +++ b/package/kernel/igb/Makefile @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2022 ImmortalWrt.org + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=igb +PKG_VERSION:=5.13.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@IMMORTALWRT +PKG_HASH:=4ccae73110f3c871a17b7cc6df7dbdf6295fc90f4941e8b2978a471c2fec83cb + +PKG_MAINTAINER:=Tianling Shen +PKG_LICENSE:=GPL-2.0-only +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/igb-vendor + SUBMENU:=Network Devices + TITLE:=Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support (vendor driver) + VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) + DEPENDS:=@PCI_SUPPORT +kmod-i2c-core +kmod-i2c-algo-bit +kmod-ptp +kmod-hwmon-core + CONFLICTS:=kmod-igb + FILES:=$(PKG_BUILD_DIR)/src/igb.ko + AUTOLOAD:=$(call AutoProbe,igb) +endef + +define KernelPackage/igb-vendor/description + Kernel modules for Intel(R) 82575/82576 PCI-Express Gigabit Ethernet adapters. +endef + +define Build/Compile + +$(KERNEL_MAKE) $(PKG_JOBS) \ + M=$(PKG_BUILD_DIR)/src \ + CONFIG_IGB=m \ + modules +endef + +$(eval $(call KernelPackage,igb-vendor)) diff --git a/package/kernel/igb/patches/100-headers.patch b/package/kernel/igb/patches/100-headers.patch new file mode 100644 index 0000000000..af2114b978 --- /dev/null +++ b/package/kernel/igb/patches/100-headers.patch @@ -0,0 +1,10 @@ +--- a/src/igb_main.c ++++ b/src/igb_main.c +@@ -25,6 +25,7 @@ + #ifdef CONFIG_PM_RUNTIME + #include + #endif /* CONFIG_PM_RUNTIME */ ++#include + + #include + #include "igb.h" diff --git a/package/kernel/linux/files/sysctl-nf-conntrack.conf b/package/kernel/linux/files/sysctl-nf-conntrack.conf index 45fa5381bf..13738655a1 100644 --- a/package/kernel/linux/files/sysctl-nf-conntrack.conf +++ b/package/kernel/linux/files/sysctl-nf-conntrack.conf @@ -3,7 +3,6 @@ net.netfilter.nf_conntrack_acct=1 net.netfilter.nf_conntrack_checksum=0 -net.netfilter.nf_conntrack_max=65536 net.netfilter.nf_conntrack_tcp_timeout_established=7440 net.netfilter.nf_conntrack_udp_timeout=60 net.netfilter.nf_conntrack_udp_timeout_stream=180 diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index d2e43369c6..a6c8233bf4 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -462,7 +462,7 @@ $(eval $(call KernelPackage,fs-nfsd)) define KernelPackage/fs-ntfs SUBMENU:=$(FS_MENU) - TITLE:=NTFS filesystem support + TITLE:=NTFS filesystem read-only (old driver) support KCONFIG:=CONFIG_NTFS_FS FILES:=$(LINUX_DIR)/fs/ntfs/ntfs.ko AUTOLOAD:=$(call AutoLoad,30,ntfs) @@ -470,7 +470,8 @@ define KernelPackage/fs-ntfs endef define KernelPackage/fs-ntfs/description - Kernel module for NTFS filesystem support + Kernel module for limited NTFS filesystem support. Support for writing + is extremely limited and disabled as a result. endef $(eval $(call KernelPackage,fs-ntfs)) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index d2e0f0fe36..975d639816 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1083,6 +1083,26 @@ endef $(eval $(call KernelPackage,bnx2x)) +define KernelPackage/bnxt-en + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=BCM 574xx/575xx 10/25/50-Gigabit ethernet adapter driver + DEPENDS:=@PCI_SUPPORT +kmod-lib-crc32c +kmod-mdio +kmod-ptp +kmod-lib-zlib-inflate +kmod-hwmon-core + FILES:=$(LINUX_DIR)/drivers/net/ethernet/broadcom/bnxt/bnxt_en.ko + KCONFIG:= \ + CONFIG_BNXT \ + CONFIG_BNXT_SRIOV=y \ + CONFIG_BNXT_FLOWER_OFFLOAD=y \ + CONFIG_BNXT_DCB=n \ + CONFIG_BNXT_HWMON=y + AUTOLOAD:=$(call AutoProbe,bnxt_en) +endef + +define KernelPackage/bnxt-en/description + Broadcom 573xx/574xx/575xx 10/25/40/50-Gigabit ethernet adapter Driver +endef + +$(eval $(call KernelPackage,bnxt-en)) + define KernelPackage/be2net SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Broadcom Emulex OneConnect 10Gbps NIC diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index a94a696fc5..d1376a3fb9 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -162,38 +162,6 @@ endef $(eval $(call KernelPackage,misdn)) -define KernelPackage/isdn4linux - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Old ISDN4Linux (deprecated) - DEPENDS:=+kmod-ppp - KCONFIG:= \ - CONFIG_ISDN=y \ - CONFIG_ISDN_I4L \ - CONFIG_ISDN_PPP=y \ - CONFIG_ISDN_PPP_VJ=y \ - CONFIG_ISDN_MPP=y \ - CONFIG_IPPP_FILTER=y \ - CONFIG_ISDN_PPP_BSDCOMP \ - CONFIG_ISDN_CAPI_MIDDLEWARE=y \ - CONFIG_ISDN_CAPI_CAPIFS_BOOL=y \ - CONFIG_ISDN_AUDIO=y \ - CONFIG_ISDN_TTY_FAX=y \ - CONFIG_ISDN_X25=y \ - CONFIG_ISDN_DIVERSION - FILES:= \ - $(LINUX_DIR)/drivers/isdn/divert/dss1_divert.ko \ - $(LINUX_DIR)/drivers/isdn/i4l/isdn.ko \ - $(LINUX_DIR)/drivers/isdn/i4l/isdn_bsdcomp.ko - AUTOLOAD:=$(call AutoLoad,40,isdn isdn_bsdcomp dss1_divert) -endef - -define KernelPackage/isdn4linux/description - This driver allows you to use an ISDN adapter for networking -endef - -$(eval $(call KernelPackage,isdn4linux)) - - define KernelPackage/ipip SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=IP-in-IP encapsulation diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 83d998c83a..1b7e382a15 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -665,22 +665,6 @@ endef $(eval $(call KernelPackage,rtc-pcf2127)) -define KernelPackage/rtc-pt7c4338 - SUBMENU:=$(OTHER_MENU) - TITLE:=Pericom PT7C4338 RTC support - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core - KCONFIG:=CONFIG_RTC_DRV_PT7C4338 \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-pt7c4338.ko - AUTOLOAD:=$(call AutoProbe,rtc-pt7c4338) -endef - -define KernelPackage/rtc-pt7c4338/description - Kernel module for Pericom PT7C4338 i2c RTC chip -endef - -$(eval $(call KernelPackage,rtc-pt7c4338)) define KernelPackage/rtc-rs5c372a SUBMENU:=$(OTHER_MENU) diff --git a/package/kernel/linux/modules/w1.mk b/package/kernel/linux/modules/w1.mk index 6ac7458e42..dba2898e47 100644 --- a/package/kernel/linux/modules/w1.mk +++ b/package/kernel/linux/modules/w1.mk @@ -160,23 +160,6 @@ endef $(eval $(call KernelPackage,w1-slave-ds2433)) -define KernelPackage/w1-slave-ds2760 - TITLE:=Dallas 2760 battery monitor chip (HP iPAQ & others) - KCONFIG:= \ - CONFIG_W1_SLAVE_DS2760 \ - CONFIG_W1_SLAVE_DS2433_CRC=n - FILES:=$(W1_SLAVES_DIR)/w1_ds2760.ko - AUTOLOAD:=$(call AutoProbe,w1_ds2760) - $(call AddDepends/w1) -endef - -define KernelPackage/w1-slave-ds2760/description - Kernel module for 1-wire DS2760 battery monitor chip support -endef - -$(eval $(call KernelPackage,w1-slave-ds2760)) - - define KernelPackage/w1-slave-ds2413 TITLE:=DS2413 2 Ch. Addressable Switch KCONFIG:= \ diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index d188962c81..61d04544a4 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=5.15.74-1 +PKG_VERSION:=5.15.81-1 PKG_RELEASE:=1 -PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.74/ -PKG_HASH:=98098d0cab24cc76a04db738dc746a0c8d38d180398805481224f141cca06423 +PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.81/ +PKG_HASH:=5227d3c35ccebacfaee6b8180b3a87b9910f3c94ee768ebc5c0fef3c86b6146d PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch index 02281adf4a..c66301efa7 100644 --- a/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch +++ b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch @@ -1,6 +1,6 @@ --- a/net/wireless/reg.c +++ b/net/wireless/reg.c -@@ -3309,6 +3309,8 @@ void regulatory_hint_country_ie(struct w +@@ -3315,6 +3315,8 @@ void regulatory_hint_country_ie(struct w enum environment_cap env = ENVIRON_ANY; struct regulatory_request *request = NULL, *lr; @@ -9,7 +9,7 @@ /* IE len must be evenly divisible by 2 */ if (country_ie_len & 0x01) return; -@@ -3560,6 +3562,7 @@ static bool is_wiphy_all_set_reg_flag(en +@@ -3566,6 +3568,7 @@ static bool is_wiphy_all_set_reg_flag(en void regulatory_hint_disconnect(void) { diff --git a/package/kernel/mac80211/patches/ath10k/081-04-ath10k-add-encapsulation-offloading-support.patch b/package/kernel/mac80211/patches/ath10k/081-04-ath10k-add-encapsulation-offloading-support.patch index abca7aac9e..e45a3ba860 100644 --- a/package/kernel/mac80211/patches/ath10k/081-04-ath10k-add-encapsulation-offloading-support.patch +++ b/package/kernel/mac80211/patches/ath10k/081-04-ath10k-add-encapsulation-offloading-support.patch @@ -50,7 +50,7 @@ Link: https://lore.kernel.org/r/20220516032519.29831-5-ryazanov.s.a@gmail.com --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -3710,6 +3710,9 @@ ath10k_mac_tx_h_get_txmode(struct ath10k +@@ -3717,6 +3717,9 @@ ath10k_mac_tx_h_get_txmode(struct ath10k const struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb); __le16 fc = hdr->frame_control; @@ -60,7 +60,7 @@ Link: https://lore.kernel.org/r/20220516032519.29831-5-ryazanov.s.a@gmail.com if (!vif || vif->type == NL80211_IFTYPE_MONITOR) return ATH10K_HW_TXRX_RAW; -@@ -3870,6 +3873,12 @@ static void ath10k_mac_tx_h_fill_cb(stru +@@ -3877,6 +3880,12 @@ static void ath10k_mac_tx_h_fill_cb(stru bool noack = false; cb->flags = 0; @@ -73,7 +73,7 @@ Link: https://lore.kernel.org/r/20220516032519.29831-5-ryazanov.s.a@gmail.com if (!ath10k_tx_h_use_hwcrypto(vif, skb)) cb->flags |= ATH10K_SKB_F_NO_HWCRYPT; -@@ -3908,6 +3917,7 @@ static void ath10k_mac_tx_h_fill_cb(stru +@@ -3915,6 +3924,7 @@ static void ath10k_mac_tx_h_fill_cb(stru cb->flags |= ATH10K_SKB_F_RAW_TX; } @@ -81,7 +81,7 @@ Link: https://lore.kernel.org/r/20220516032519.29831-5-ryazanov.s.a@gmail.com cb->vif = vif; cb->txq = txq; cb->airtime_est = airtime; -@@ -4031,7 +4041,11 @@ static int ath10k_mac_tx(struct ath10k * +@@ -4038,7 +4048,11 @@ static int ath10k_mac_tx(struct ath10k * ath10k_tx_h_seq_no(vif, skb); break; case ATH10K_HW_TXRX_ETHERNET: @@ -94,7 +94,7 @@ Link: https://lore.kernel.org/r/20220516032519.29831-5-ryazanov.s.a@gmail.com break; case ATH10K_HW_TXRX_RAW: if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags) && -@@ -4643,12 +4657,10 @@ static void ath10k_mac_op_tx(struct ieee +@@ -4650,12 +4664,10 @@ static void ath10k_mac_op_tx(struct ieee struct ieee80211_vif *vif = info->control.vif; struct ieee80211_sta *sta = control->sta; struct ieee80211_txq *txq = NULL; @@ -107,7 +107,7 @@ Link: https://lore.kernel.org/r/20220516032519.29831-5-ryazanov.s.a@gmail.com int ret; u16 airtime; -@@ -4662,8 +4674,14 @@ static void ath10k_mac_op_tx(struct ieee +@@ -4669,8 +4681,14 @@ static void ath10k_mac_op_tx(struct ieee is_mgmt = (txpath == ATH10K_MAC_TX_HTT_MGMT); if (is_htt) { @@ -123,7 +123,7 @@ Link: https://lore.kernel.org/r/20220516032519.29831-5-ryazanov.s.a@gmail.com ret = ath10k_htt_tx_inc_pending(htt); if (ret) { -@@ -5463,6 +5481,30 @@ static int ath10k_mac_set_txbf_conf(stru +@@ -5470,6 +5488,30 @@ static int ath10k_mac_set_txbf_conf(stru ar->wmi.vdev_param->txbf, value); } @@ -154,7 +154,7 @@ Link: https://lore.kernel.org/r/20220516032519.29831-5-ryazanov.s.a@gmail.com /* * TODO: * Figure out how to handle WMI_VDEV_SUBTYPE_P2P_DEVICE, -@@ -5672,15 +5714,7 @@ static int ath10k_add_interface(struct i +@@ -5679,15 +5721,7 @@ static int ath10k_add_interface(struct i arvif->def_wep_key_idx = -1; @@ -171,7 +171,7 @@ Link: https://lore.kernel.org/r/20220516032519.29831-5-ryazanov.s.a@gmail.com /* Configuring number of spatial stream for monitor interface is causing * target assert in qca9888 and qca6174. -@@ -9368,6 +9402,7 @@ static const struct ieee80211_ops ath10k +@@ -9372,6 +9406,7 @@ static const struct ieee80211_ops ath10k .stop = ath10k_stop, .config = ath10k_config, .add_interface = ath10k_add_interface, @@ -179,7 +179,7 @@ Link: https://lore.kernel.org/r/20220516032519.29831-5-ryazanov.s.a@gmail.com .remove_interface = ath10k_remove_interface, .configure_filter = ath10k_configure_filter, .bss_info_changed = ath10k_bss_info_changed, -@@ -10037,6 +10072,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -10041,6 +10076,12 @@ int ath10k_mac_register(struct ath10k *a if (test_bit(WMI_SERVICE_TDLS_UAPSD_BUFFER_STA, ar->wmi.svc_map)) ieee80211_hw_set(ar->hw, SUPPORTS_TDLS_BUFFER_STA); diff --git a/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch index 9dfde4385e..bc6f5dbc5c 100644 --- a/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -9894,6 +9894,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -9898,6 +9898,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -10252,6 +10267,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -10256,6 +10271,12 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; diff --git a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch index 842853ddf4..253fe96ddf 100644 --- a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -10269,7 +10269,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -10273,7 +10273,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch b/package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch index a45addf119..424985f114 100644 --- a/package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch +++ b/package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch @@ -28,7 +28,7 @@ Forwarded: no --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -1021,6 +1021,40 @@ static inline int ath10k_vdev_setup_sync +@@ -1028,6 +1028,40 @@ static inline int ath10k_vdev_setup_sync return ar->last_wmi_vdev_start_status; } @@ -69,7 +69,7 @@ Forwarded: no static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id) { struct cfg80211_chan_def *chandef = NULL; -@@ -1053,7 +1087,8 @@ static int ath10k_monitor_vdev_start(str +@@ -1060,7 +1094,8 @@ static int ath10k_monitor_vdev_start(str arg.channel.min_power = 0; arg.channel.max_power = channel->max_power * 2; arg.channel.max_reg_power = channel->max_reg_power * 2; @@ -79,7 +79,7 @@ Forwarded: no reinit_completion(&ar->vdev_setup_done); reinit_completion(&ar->vdev_delete_done); -@@ -1499,7 +1534,8 @@ static int ath10k_vdev_start_restart(str +@@ -1506,7 +1541,8 @@ static int ath10k_vdev_start_restart(str arg.channel.min_power = 0; arg.channel.max_power = chandef->chan->max_power * 2; arg.channel.max_reg_power = chandef->chan->max_reg_power * 2; @@ -89,7 +89,7 @@ Forwarded: no if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { arg.ssid = arvif->u.ap.ssid; -@@ -3427,7 +3463,8 @@ static int ath10k_update_channel_list(st +@@ -3434,7 +3470,8 @@ static int ath10k_update_channel_list(st ch->min_power = 0; ch->max_power = channel->max_power * 2; ch->max_reg_power = channel->max_reg_power * 2; diff --git a/package/kernel/mac80211/patches/brcm/001-brcmfmac-allow-setting-wlan-MAC-address-using-device.patch b/package/kernel/mac80211/patches/brcm/001-brcmfmac-allow-setting-wlan-MAC-address-using-device.patch index 03d9f8ecd8..e06e350b62 100644 --- a/package/kernel/mac80211/patches/brcm/001-brcmfmac-allow-setting-wlan-MAC-address-using-device.patch +++ b/package/kernel/mac80211/patches/brcm/001-brcmfmac-allow-setting-wlan-MAC-address-using-device.patch @@ -72,7 +72,7 @@ Link: https://lore.kernel.org/r/20220506044246.67146-1-pavel@loebl.cz #include #include #include -@@ -1226,7 +1227,8 @@ static int brcmf_bus_started(struct brcm +@@ -1227,7 +1228,8 @@ static int brcmf_bus_started(struct brcm brcmf_dbg(TRACE, "\n"); /* add primary networking interface */ diff --git a/package/kernel/mac80211/patches/brcm/998-survey.patch b/package/kernel/mac80211/patches/brcm/998-survey.patch index d194e25177..234a97b7bf 100644 --- a/package/kernel/mac80211/patches/brcm/998-survey.patch +++ b/package/kernel/mac80211/patches/brcm/998-survey.patch @@ -100,7 +100,7 @@ .add_key = brcmf_cfg80211_add_key, --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -@@ -1363,6 +1363,8 @@ int brcmf_attach(struct device *dev) +@@ -1364,6 +1364,8 @@ int brcmf_attach(struct device *dev) /* Link to bus module */ drvr->hdrlen = 0; @@ -109,7 +109,7 @@ /* Attach and link in the protocol */ ret = brcmf_proto_attach(drvr); -@@ -1445,6 +1447,12 @@ void brcmf_detach(struct device *dev) +@@ -1446,6 +1448,12 @@ void brcmf_detach(struct device *dev) if (drvr == NULL) return; diff --git a/package/kernel/mac80211/patches/rt2x00/001-rt2x00-define-RF5592-in-init_eeprom-routine.patch b/package/kernel/mac80211/patches/rt2x00/001-v6.1-rt2x00-define-RF5592-in-init_eeprom-routine.patch similarity index 96% rename from package/kernel/mac80211/patches/rt2x00/001-rt2x00-define-RF5592-in-init_eeprom-routine.patch rename to package/kernel/mac80211/patches/rt2x00/001-v6.1-rt2x00-define-RF5592-in-init_eeprom-routine.patch index 351e24a4d5..4d5b670279 100644 --- a/package/kernel/mac80211/patches/rt2x00/001-rt2x00-define-RF5592-in-init_eeprom-routine.patch +++ b/package/kernel/mac80211/patches/rt2x00/001-v6.1-rt2x00-define-RF5592-in-init_eeprom-routine.patch @@ -41,7 +41,7 @@ Acked-by: Stanislaw Gruszka --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -9435,6 +9435,8 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9461,6 +9461,8 @@ static int rt2800_init_eeprom(struct rt2 rf = RF3853; else if (rt2x00_rt(rt2x00dev, RT5350)) rf = RF5350; diff --git a/package/kernel/mac80211/patches/rt2x00/002-rt2x00-add-throughput-LED-trigger.patch b/package/kernel/mac80211/patches/rt2x00/002-v6.1-rt2x00-add-throughput-LED-trigger.patch similarity index 100% rename from package/kernel/mac80211/patches/rt2x00/002-rt2x00-add-throughput-LED-trigger.patch rename to package/kernel/mac80211/patches/rt2x00/002-v6.1-rt2x00-add-throughput-LED-trigger.patch diff --git a/package/kernel/mac80211/patches/rt2x00/003-rt2x00-add-support-for-external-PA-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/003-v6.1-rt2x00-add-support-for-external-PA-on-MT7620.patch similarity index 94% rename from package/kernel/mac80211/patches/rt2x00/003-rt2x00-add-support-for-external-PA-on-MT7620.patch rename to package/kernel/mac80211/patches/rt2x00/003-v6.1-rt2x00-add-support-for-external-PA-on-MT7620.patch index 216f583063..26c2020918 100644 --- a/package/kernel/mac80211/patches/rt2x00/003-rt2x00-add-support-for-external-PA-on-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/003-v6.1-rt2x00-add-support-for-external-PA-on-MT7620.patch @@ -50,8 +50,8 @@ Acked-by: Stanislaw Gruszka * EEPROM LNA --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -4368,6 +4368,43 @@ static void rt2800_config_channel(struct - rt2800_iq_calibrate(rt2x00dev, rf->channel); +@@ -4372,6 +4372,43 @@ static void rt2800_config_channel(struct + rt2800_iq_calibrate(rt2x00dev, rf->channel); } + if (rt2x00_rt(rt2x00dev, RT6352)) { @@ -94,7 +94,7 @@ Acked-by: Stanislaw Gruszka bbp = rt2800_bbp_read(rt2x00dev, 4); rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2 * conf_is_ht40(conf)); rt2800_bbp_write(rt2x00dev, 4, bbp); -@@ -9566,7 +9603,8 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9592,7 +9629,8 @@ static int rt2800_init_eeprom(struct rt2 */ eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1); @@ -104,7 +104,7 @@ Acked-by: Stanislaw Gruszka if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352)) __set_bit(CAPABILITY_EXTERNAL_PA_TX0, -@@ -9577,6 +9615,18 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9603,6 +9641,18 @@ static int rt2800_init_eeprom(struct rt2 &rt2x00dev->cap_flags); } diff --git a/package/kernel/mac80211/patches/rt2x00/004-rt2x00-move-up-and-reuse-busy-wait-functions.patch b/package/kernel/mac80211/patches/rt2x00/004-v6.1-rt2x00-move-up-and-reuse-busy-wait-functions.patch similarity index 97% rename from package/kernel/mac80211/patches/rt2x00/004-rt2x00-move-up-and-reuse-busy-wait-functions.patch rename to package/kernel/mac80211/patches/rt2x00/004-v6.1-rt2x00-move-up-and-reuse-busy-wait-functions.patch index da453074a1..c9b0d82b64 100644 --- a/package/kernel/mac80211/patches/rt2x00/004-rt2x00-move-up-and-reuse-busy-wait-functions.patch +++ b/package/kernel/mac80211/patches/rt2x00/004-v6.1-rt2x00-move-up-and-reuse-busy-wait-functions.patch @@ -120,7 +120,7 @@ Acked-by: Stanislaw Gruszka if (chan->center_freq > 2457) { bbp = rt2800_bbp_read(rt2x00dev, 30); -@@ -6249,46 +6282,6 @@ static int rt2800_init_registers(struct +@@ -6275,46 +6308,6 @@ static int rt2800_init_registers(struct return 0; } @@ -167,7 +167,7 @@ Acked-by: Stanislaw Gruszka static void rt2800_bbp4_mac_if_ctrl(struct rt2x00_dev *rt2x00dev) { -@@ -9110,7 +9103,7 @@ int rt2800_enable_radio(struct rt2x00_de +@@ -9136,7 +9129,7 @@ int rt2800_enable_radio(struct rt2x00_de /* * Wait BBP/RF to wake up. */ diff --git a/package/kernel/mac80211/patches/rt2x00/005-rt2x00-add-RF-self-TXDC-calibration-for-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/005-v6.1-rt2x00-add-RF-self-TXDC-calibration-for-MT7620.patch similarity index 96% rename from package/kernel/mac80211/patches/rt2x00/005-rt2x00-add-RF-self-TXDC-calibration-for-MT7620.patch rename to package/kernel/mac80211/patches/rt2x00/005-v6.1-rt2x00-add-RF-self-TXDC-calibration-for-MT7620.patch index 4e98d6a375..9ba16bee12 100644 --- a/package/kernel/mac80211/patches/rt2x00/005-rt2x00-add-RF-self-TXDC-calibration-for-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/005-v6.1-rt2x00-add-RF-self-TXDC-calibration-for-MT7620.patch @@ -42,7 +42,7 @@ v2: use ++i instead of i = i + 1 in loops --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8428,6 +8428,53 @@ static void rt2800_init_rfcsr_5592(struc +@@ -8454,6 +8454,53 @@ static void rt2800_init_rfcsr_5592(struc rt2800_led_open_drain_enable(rt2x00dev); } @@ -96,7 +96,7 @@ v2: use ++i instead of i = i + 1 in loops static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9035,6 +9082,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9061,6 +9108,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); diff --git a/package/kernel/mac80211/patches/rt2x00/006-rt2x00-add-r-calibration-for-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/006-v6.1-rt2x00-add-r-calibration-for-MT7620.patch similarity index 98% rename from package/kernel/mac80211/patches/rt2x00/006-rt2x00-add-r-calibration-for-MT7620.patch rename to package/kernel/mac80211/patches/rt2x00/006-v6.1-rt2x00-add-r-calibration-for-MT7620.patch index 7c69970166..e15de28ea0 100644 --- a/package/kernel/mac80211/patches/rt2x00/006-rt2x00-add-r-calibration-for-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/006-v6.1-rt2x00-add-r-calibration-for-MT7620.patch @@ -54,7 +54,7 @@ v2: use rt2800_wait_bbp_rf_ready() * PWR_PIN_CFG: --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8475,6 +8475,138 @@ static void rt2800_rf_self_txdc_cal(stru +@@ -8501,6 +8501,138 @@ static void rt2800_rf_self_txdc_cal(stru rt2800_register_write(rt2x00dev, RF_BYPASS2, mac052c); } @@ -193,7 +193,7 @@ v2: use rt2800_wait_bbp_rf_ready() static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9082,6 +9214,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9108,6 +9240,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); diff --git a/package/kernel/mac80211/patches/rt2x00/007-rt2x00-add-RXDCOC-calibration-for-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/007-v6.1-rt2x00-add-RXDCOC-calibration-for-MT7620.patch similarity index 96% rename from package/kernel/mac80211/patches/rt2x00/007-rt2x00-add-RXDCOC-calibration-for-MT7620.patch rename to package/kernel/mac80211/patches/rt2x00/007-v6.1-rt2x00-add-RXDCOC-calibration-for-MT7620.patch index 8da41e875a..a09d0abed0 100644 --- a/package/kernel/mac80211/patches/rt2x00/007-rt2x00-add-RXDCOC-calibration-for-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/007-v6.1-rt2x00-add-RXDCOC-calibration-for-MT7620.patch @@ -41,7 +41,7 @@ Acked-by: Stanislaw Gruszka --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8607,6 +8607,65 @@ static void rt2800_r_calibration(struct +@@ -8633,6 +8633,65 @@ static void rt2800_r_calibration(struct rt2800_register_write(rt2x00dev, PWR_PIN_CFG, MAC_PWR_PIN_CFG); } @@ -107,7 +107,7 @@ Acked-by: Stanislaw Gruszka static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9216,6 +9275,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9242,6 +9301,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_r_calibration(rt2x00dev); rt2800_rf_self_txdc_cal(rt2x00dev); diff --git a/package/kernel/mac80211/patches/rt2x00/008-rt2x00-add-RXIQ-calibration-for-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/008-v6.1-rt2x00-add-RXIQ-calibration-for-MT7620.patch similarity index 99% rename from package/kernel/mac80211/patches/rt2x00/008-rt2x00-add-RXIQ-calibration-for-MT7620.patch rename to package/kernel/mac80211/patches/rt2x00/008-v6.1-rt2x00-add-RXIQ-calibration-for-MT7620.patch index dc516da43a..c532ba512b 100644 --- a/package/kernel/mac80211/patches/rt2x00/008-rt2x00-add-RXIQ-calibration-for-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/008-v6.1-rt2x00-add-RXIQ-calibration-for-MT7620.patch @@ -43,7 +43,7 @@ v2: use rt2800_wait_bbp_rf_ready(), fix indentation --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8666,6 +8666,380 @@ static void rt2800_rxdcoc_calibration(st +@@ -8692,6 +8692,380 @@ static void rt2800_rxdcoc_calibration(st rt2800_rfcsr_write_bank(rt2x00dev, 0, 2, saverfb0r2); } @@ -424,7 +424,7 @@ v2: use rt2800_wait_bbp_rf_ready(), fix indentation static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9278,6 +9652,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9304,6 +9678,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rxdcoc_calibration(rt2x00dev); rt2800_bw_filter_calibration(rt2x00dev, true); rt2800_bw_filter_calibration(rt2x00dev, false); diff --git a/package/kernel/mac80211/patches/rt2x00/009-rt2x00-don-t-run-Rt5592-IQ-calibration-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/009-rt2x00-don-t-run-Rt5592-IQ-calibration-on-MT7620.patch deleted file mode 100644 index 6b27f6a705..0000000000 --- a/package/kernel/mac80211/patches/rt2x00/009-rt2x00-don-t-run-Rt5592-IQ-calibration-on-MT7620.patch +++ /dev/null @@ -1,52 +0,0 @@ -From patchwork Sat Sep 17 20:28:29 2022 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Daniel Golle -X-Patchwork-Id: 12979250 -X-Patchwork-Delegate: kvalo@adurom.com -Return-Path: -Date: Sat, 17 Sep 2022 21:28:29 +0100 -From: Daniel Golle -To: linux-wireless@vger.kernel.org, Stanislaw Gruszka , - Helmut Schaa -Cc: Kalle Valo , - "David S. Miller" , - Eric Dumazet , - Jakub Kicinski , - Paolo Abeni , - Johannes Berg -Subject: [PATCH v3 09/16] rt2x00: don't run Rt5592 IQ calibration on MT7620 -Message-ID: - <31a1c34ddbd296b82f38c18c9ae7339059215fdc.1663445157.git.daniel@makrotopia.org> -References: -MIME-Version: 1.0 -Content-Disposition: inline -In-Reply-To: -Precedence: bulk -List-ID: -X-Mailing-List: linux-wireless@vger.kernel.org - -The function rt2800_iq_calibrate is intended for Rt5592 only. -Don't call it for MT7620 which has it's own calibration functions. - -Reported-by: Serge Vasilugin -Signed-off-by: Daniel Golle ---- -v2: test for RT5592 instead of !RT6352 - - drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -4398,7 +4398,8 @@ static void rt2800_config_channel(struct - reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain; - rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg); - -- rt2800_iq_calibrate(rt2x00dev, rf->channel); -+ if (rt2x00_rt(rt2x00dev, RT5592)) -+ rt2800_iq_calibrate(rt2x00dev, rf->channel); - } - - if (rt2x00_rt(rt2x00dev, RT6352)) { diff --git a/package/kernel/mac80211/patches/rt2x00/010-rt2x00-add-TX-LOFT-calibration-for-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/010-v6.1-rt2x00-add-TX-LOFT-calibration-for-MT7620.patch similarity index 99% rename from package/kernel/mac80211/patches/rt2x00/010-rt2x00-add-TX-LOFT-calibration-for-MT7620.patch rename to package/kernel/mac80211/patches/rt2x00/010-v6.1-rt2x00-add-TX-LOFT-calibration-for-MT7620.patch index bb01ff1dca..092d91afb6 100644 --- a/package/kernel/mac80211/patches/rt2x00/010-rt2x00-add-TX-LOFT-calibration-for-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/010-v6.1-rt2x00-add-TX-LOFT-calibration-for-MT7620.patch @@ -45,7 +45,7 @@ Reported-by: kernel test robot --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -9041,6 +9041,907 @@ restore_value: +@@ -9066,6 +9066,907 @@ restore_value: rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, savemacsysctrl); } @@ -953,7 +953,7 @@ Reported-by: kernel test robot static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9653,6 +10554,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9678,6 +10579,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rxdcoc_calibration(rt2x00dev); rt2800_bw_filter_calibration(rt2x00dev, true); rt2800_bw_filter_calibration(rt2x00dev, false); diff --git a/package/kernel/mac80211/patches/rt2x00/011-rt2x00-move-helper-functions-up-in-file.patch b/package/kernel/mac80211/patches/rt2x00/011-v6.1-rt2x00-move-helper-functions-up-in-file.patch similarity index 97% rename from package/kernel/mac80211/patches/rt2x00/011-rt2x00-move-helper-functions-up-in-file.patch rename to package/kernel/mac80211/patches/rt2x00/011-v6.1-rt2x00-move-helper-functions-up-in-file.patch index 07a32b17be..b07d449d6d 100644 --- a/package/kernel/mac80211/patches/rt2x00/011-rt2x00-move-helper-functions-up-in-file.patch +++ b/package/kernel/mac80211/patches/rt2x00/011-v6.1-rt2x00-move-helper-functions-up-in-file.patch @@ -65,7 +65,7 @@ Acked-by: Stanislaw Gruszka static u8 rt2800_rfcsr_read(struct rt2x00_dev *rt2x00dev, const unsigned int word) { -@@ -6947,26 +6967,6 @@ static void rt2800_init_bbp_5592(struct +@@ -6972,26 +6992,6 @@ static void rt2800_init_bbp_5592(struct rt2800_bbp_write(rt2x00dev, 103, 0xc0); } diff --git a/package/kernel/mac80211/patches/rt2x00/012-rt2x00-fix-HT20-HT40-bandwidth-switch-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/012-v6.1-rt2x00-fix-HT20-HT40-bandwidth-switch-on-MT7620.patch similarity index 100% rename from package/kernel/mac80211/patches/rt2x00/012-rt2x00-fix-HT20-HT40-bandwidth-switch-on-MT7620.patch rename to package/kernel/mac80211/patches/rt2x00/012-v6.1-rt2x00-fix-HT20-HT40-bandwidth-switch-on-MT7620.patch diff --git a/package/kernel/mac80211/patches/rt2x00/013-rt2x00-set-correct-TX_SW_CFG1-MAC-register-for-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/013-rt2x00-set-correct-TX_SW_CFG1-MAC-register-for-MT7620.patch deleted file mode 100644 index 3d7af17b16..0000000000 --- a/package/kernel/mac80211/patches/rt2x00/013-rt2x00-set-correct-TX_SW_CFG1-MAC-register-for-MT7620.patch +++ /dev/null @@ -1,52 +0,0 @@ -From patchwork Sat Sep 17 20:29:26 2022 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Daniel Golle -X-Patchwork-Id: 12979254 -X-Patchwork-Delegate: kvalo@adurom.com -Return-Path: -Date: Sat, 17 Sep 2022 21:29:26 +0100 -From: Daniel Golle -To: linux-wireless@vger.kernel.org, Stanislaw Gruszka , - Helmut Schaa -Cc: Kalle Valo , - "David S. Miller" , - Eric Dumazet , - Jakub Kicinski , - Paolo Abeni , - Johannes Berg -Subject: [PATCH v3 13/16] rt2x00: set correct TX_SW_CFG1 MAC register for - MT7620 -Message-ID: - <4be38975ce600a34249e12d09a3cb758c6e71071.1663445157.git.daniel@makrotopia.org> -References: -MIME-Version: 1.0 -Content-Disposition: inline -In-Reply-To: -Precedence: bulk -List-ID: -X-Mailing-List: linux-wireless@vger.kernel.org - -Set correct TX_SW_CFG1 MAC register as it is done also in v3 of the -vendor driver[1]. - -[1]: https://gitlab.com/dm38/padavan-ng/-/blob/master/trunk/proprietary/rt_wifi/rtpci/3.0.X.X/mt76x2/chips/rt6352.c#L531 -Reported-by: Serge Vasilugin -Signed-off-by: Daniel Golle -Acked-by: Stanislaw Gruszka ---- - drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -5966,7 +5966,7 @@ static int rt2800_init_registers(struct - rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); - } else if (rt2x00_rt(rt2x00dev, RT6352)) { - rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401); -- rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000); -+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0001); - rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); - rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000); - rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0); diff --git a/package/kernel/mac80211/patches/rt2x00/014-rt2x00-set-VGC-gain-for-both-chains-of-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/014-rt2x00-set-VGC-gain-for-both-chains-of-MT7620.patch deleted file mode 100644 index 27b8d92cd2..0000000000 --- a/package/kernel/mac80211/patches/rt2x00/014-rt2x00-set-VGC-gain-for-both-chains-of-MT7620.patch +++ /dev/null @@ -1,50 +0,0 @@ -From patchwork Sat Sep 17 20:29:40 2022 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Daniel Golle -X-Patchwork-Id: 12979255 -X-Patchwork-Delegate: kvalo@adurom.com -Return-Path: -Date: Sat, 17 Sep 2022 21:29:40 +0100 -From: Daniel Golle -To: linux-wireless@vger.kernel.org, Stanislaw Gruszka , - Helmut Schaa -Cc: Kalle Valo , - "David S. Miller" , - Eric Dumazet , - Jakub Kicinski , - Paolo Abeni , - Johannes Berg -Subject: [PATCH v3 14/16] rt2x00: set VGC gain for both chains of MT7620 -Message-ID: - <29e161397e5c9d9399da0fe87d44458aa2b90a78.1663445157.git.daniel@makrotopia.org> -References: -MIME-Version: 1.0 -Content-Disposition: inline -In-Reply-To: -Precedence: bulk -List-ID: -X-Mailing-List: linux-wireless@vger.kernel.org - -Set bbp66 for all chains of the MT7620. - -Reported-by: Serge Vasilugin -Signed-off-by: Daniel Golle -Acked-by: Stanislaw Gruszka ---- - drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -5743,7 +5743,8 @@ static inline void rt2800_set_vgc(struct - if (qual->vgc_level != vgc_level) { - if (rt2x00_rt(rt2x00dev, RT3572) || - rt2x00_rt(rt2x00dev, RT3593) || -- rt2x00_rt(rt2x00dev, RT3883)) { -+ rt2x00_rt(rt2x00dev, RT3883) || -+ rt2x00_rt(rt2x00dev, RT6352)) { - rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, - vgc_level); - } else if (rt2x00_rt(rt2x00dev, RT5592)) { diff --git a/package/kernel/mac80211/patches/rt2x00/015-rt2x00-set-SoC-wmac-clock-register.patch b/package/kernel/mac80211/patches/rt2x00/015-rt2x00-set-SoC-wmac-clock-register.patch deleted file mode 100644 index 3cadc91da6..0000000000 --- a/package/kernel/mac80211/patches/rt2x00/015-rt2x00-set-SoC-wmac-clock-register.patch +++ /dev/null @@ -1,70 +0,0 @@ -From patchwork Sat Sep 17 20:29:55 2022 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Daniel Golle -X-Patchwork-Id: 12979256 -X-Patchwork-Delegate: kvalo@adurom.com -Return-Path: -Date: Sat, 17 Sep 2022 21:29:55 +0100 -From: Daniel Golle -To: linux-wireless@vger.kernel.org, Stanislaw Gruszka , - Helmut Schaa -Cc: Kalle Valo , - "David S. Miller" , - Eric Dumazet , - Jakub Kicinski , - Paolo Abeni , - Johannes Berg -Subject: [PATCH v3 15/16] rt2x00: set SoC wmac clock register -Message-ID: - <3e275d259f476f597dab91a9c395015ef3fe3284.1663445157.git.daniel@makrotopia.org> -References: -MIME-Version: 1.0 -Content-Disposition: inline -In-Reply-To: -Precedence: bulk -List-ID: -X-Mailing-List: linux-wireless@vger.kernel.org - -Instead of using the default value 33 (pci), set US_CYC_CNT init based -on Programming guide: -If available, set chipset bus clock with fallback to cpu clock/3. - -Reported-by: Serge Vasilugin -Signed-off-by: Daniel Golle -Acked-by: Stanislaw Gruszka ---- - .../net/wireless/ralink/rt2x00/rt2800lib.c | 21 +++++++++++++++++++ - 1 file changed, 21 insertions(+) - ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -6229,6 +6229,27 @@ static int rt2800_init_registers(struct - reg = rt2800_register_read(rt2x00dev, US_CYC_CNT); - rt2x00_set_field32(®, US_CYC_CNT_CLOCK_CYCLE, 125); - rt2800_register_write(rt2x00dev, US_CYC_CNT, reg); -+ } else if (rt2x00_is_soc(rt2x00dev)) { -+ struct clk *clk = clk_get_sys("bus", NULL); -+ int rate; -+ -+ if (IS_ERR(clk)) { -+ clk = clk_get_sys("cpu", NULL); -+ -+ if (IS_ERR(clk)) { -+ rate = 125; -+ } else { -+ rate = clk_get_rate(clk) / 3000000; -+ clk_put(clk); -+ } -+ } else { -+ rate = clk_get_rate(clk) / 1000000; -+ clk_put(clk); -+ } -+ -+ reg = rt2800_register_read(rt2x00dev, US_CYC_CNT); -+ rt2x00_set_field32(®, US_CYC_CNT_CLOCK_CYCLE, rate); -+ rt2800_register_write(rt2x00dev, US_CYC_CNT, reg); - } - - reg = rt2800_register_read(rt2x00dev, HT_FBK_CFG0); diff --git a/package/kernel/mac80211/patches/rt2x00/016-rt2x00-correctly-set-BBP-register-86-for-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/016-rt2x00-correctly-set-BBP-register-86-for-MT7620.patch deleted file mode 100644 index 5ddbbf1dd6..0000000000 --- a/package/kernel/mac80211/patches/rt2x00/016-rt2x00-correctly-set-BBP-register-86-for-MT7620.patch +++ /dev/null @@ -1,79 +0,0 @@ -From patchwork Sat Sep 17 20:30:09 2022 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Daniel Golle -X-Patchwork-Id: 12979257 -X-Patchwork-Delegate: kvalo@adurom.com -Return-Path: -X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on - aws-us-west-2-korg-lkml-1.web.codeaurora.org -Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) - by smtp.lore.kernel.org (Postfix) with ESMTP id E9118ECAAA1 - for ; - Sat, 17 Sep 2022 20:30:22 +0000 (UTC) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S229639AbiIQUaV (ORCPT - ); - Sat, 17 Sep 2022 16:30:21 -0400 -Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53912 "EHLO - lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S229628AbiIQUaT (ORCPT - ); - Sat, 17 Sep 2022 16:30:19 -0400 -Received: from fudo.makrotopia.org (fudo.makrotopia.org - [IPv6:2a07:2ec0:3002::71]) - by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AEA822B27 - for ; - Sat, 17 Sep 2022 13:30:16 -0700 (PDT) -Received: from local - by fudo.makrotopia.org with esmtpsa - (TLS1.3:TLS_AES_256_GCM_SHA384:256) - (Exim 4.96) - (envelope-from ) - id 1oZeS7-0003ra-0k; - Sat, 17 Sep 2022 22:30:15 +0200 -Date: Sat, 17 Sep 2022 21:30:09 +0100 -From: Daniel Golle -To: linux-wireless@vger.kernel.org, Stanislaw Gruszka , - Helmut Schaa -Cc: Kalle Valo , - "David S. Miller" , - Eric Dumazet , - Jakub Kicinski , - Paolo Abeni , - Johannes Berg -Subject: [PATCH v3 16/16] rt2x00: correctly set BBP register 86 for MT7620 -Message-ID: - <257267247ee4fa7ebc6a5d0c4948b3f8119c0d77.1663445157.git.daniel@makrotopia.org> -References: -MIME-Version: 1.0 -Content-Disposition: inline -In-Reply-To: -Precedence: bulk -List-ID: -X-Mailing-List: linux-wireless@vger.kernel.org - -Instead of 0 set the correct value for BBP register 86 for MT7620. - -Reported-by: Serge Vasilugin -Signed-off-by: Daniel Golle -Acked-by: Stanislaw Gruszka ---- - drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -4225,7 +4225,10 @@ static void rt2800_config_channel(struct - rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain); - rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain); - rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain); -- rt2800_bbp_write(rt2x00dev, 86, 0); -+ if (rt2x00_rt(rt2x00dev, RT6352)) -+ rt2800_bbp_write(rt2x00dev, 86, 0x38); -+ else -+ rt2800_bbp_write(rt2x00dev, 86, 0); - } - - if (rf->channel <= 14) { diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch index 2dc6ab3601..5a7da84506 100644 --- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch @@ -52,7 +52,7 @@ fail_ifa: #endif wiphy_unregister(local->hw.wiphy); -@@ -1371,10 +1371,10 @@ void ieee80211_unregister_hw(struct ieee +@@ -1373,10 +1373,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/package/kernel/mac80211/patches/subsys/307-mac80211_hwsim-make-6-GHz-channels-usable.patch b/package/kernel/mac80211/patches/subsys/307-mac80211_hwsim-make-6-GHz-channels-usable.patch index 80c86e3d92..9c3b38adbf 100644 --- a/package/kernel/mac80211/patches/subsys/307-mac80211_hwsim-make-6-GHz-channels-usable.patch +++ b/package/kernel/mac80211/patches/subsys/307-mac80211_hwsim-make-6-GHz-channels-usable.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c -@@ -3003,15 +3003,19 @@ static void mac80211_hwsim_he_capab(stru +@@ -3008,15 +3008,19 @@ static void mac80211_hwsim_he_capab(stru { u16 n_iftype_data; @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau return; } -@@ -3301,6 +3305,12 @@ static int mac80211_hwsim_new_radio(stru +@@ -3306,6 +3310,12 @@ static int mac80211_hwsim_new_radio(stru sband->vht_cap.vht_mcs.tx_mcs_map = sband->vht_cap.vht_mcs.rx_mcs_map; break; @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau case NL80211_BAND_S1GHZ: memcpy(&sband->s1g_cap, &hwsim_s1g_cap, sizeof(sband->s1g_cap)); -@@ -3311,6 +3321,13 @@ static int mac80211_hwsim_new_radio(stru +@@ -3316,6 +3326,13 @@ static int mac80211_hwsim_new_radio(stru continue; } @@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau sband->ht_cap.ht_supported = true; sband->ht_cap.cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_GRN_FLD | -@@ -3324,10 +3341,6 @@ static int mac80211_hwsim_new_radio(stru +@@ -3329,10 +3346,6 @@ static int mac80211_hwsim_new_radio(stru sband->ht_cap.mcs.rx_mask[0] = 0xff; sband->ht_cap.mcs.rx_mask[1] = 0xff; sband->ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; diff --git a/package/kernel/mac80211/patches/subsys/319-mac80211-introduce-set_radar_offchan-callback.patch b/package/kernel/mac80211/patches/subsys/319-mac80211-introduce-set_radar_offchan-callback.patch index eb80afbccb..6197abda56 100644 --- a/package/kernel/mac80211/patches/subsys/319-mac80211-introduce-set_radar_offchan-callback.patch +++ b/package/kernel/mac80211/patches/subsys/319-mac80211-introduce-set_radar_offchan-callback.patch @@ -40,7 +40,7 @@ Signed-off-by: Johannes Berg struct ieee80211_vif *vif, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -4344,6 +4344,18 @@ out: +@@ -4341,6 +4341,18 @@ out: return err; } @@ -59,7 +59,7 @@ Signed-off-by: Johannes Berg const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, -@@ -4448,4 +4460,5 @@ const struct cfg80211_ops mac80211_confi +@@ -4445,4 +4457,5 @@ const struct cfg80211_ops mac80211_confi .reset_tid_config = ieee80211_reset_tid_config, .set_sar_specs = ieee80211_set_sar_specs, .color_change = ieee80211_color_change, diff --git a/package/kernel/mac80211/patches/subsys/320-cfg80211-rename-offchannel_chain-structs-to-backgrou.patch b/package/kernel/mac80211/patches/subsys/320-cfg80211-rename-offchannel_chain-structs-to-backgrou.patch index 483b87cd88..608e72468d 100644 --- a/package/kernel/mac80211/patches/subsys/320-cfg80211-rename-offchannel_chain-structs-to-backgrou.patch +++ b/package/kernel/mac80211/patches/subsys/320-cfg80211-rename-offchannel_chain-structs-to-backgrou.patch @@ -156,7 +156,7 @@ Signed-off-by: Johannes Berg NUM_NL80211_EXT_FEATURES, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -4345,15 +4345,15 @@ out: +@@ -4342,15 +4342,15 @@ out: } static int @@ -176,7 +176,7 @@ Signed-off-by: Johannes Berg } const struct cfg80211_ops mac80211_config_ops = { -@@ -4460,5 +4460,5 @@ const struct cfg80211_ops mac80211_confi +@@ -4457,5 +4457,5 @@ const struct cfg80211_ops mac80211_confi .reset_tid_config = ieee80211_reset_tid_config, .set_sar_specs = ieee80211_set_sar_specs, .color_change = ieee80211_color_change, diff --git a/package/kernel/mac80211/patches/subsys/324-mac80211-MBSSID-beacon-handling-in-AP-mode.patch b/package/kernel/mac80211/patches/subsys/324-mac80211-MBSSID-beacon-handling-in-AP-mode.patch index e2b05719db..a8fc02f92d 100644 --- a/package/kernel/mac80211/patches/subsys/324-mac80211-MBSSID-beacon-handling-in-AP-mode.patch +++ b/package/kernel/mac80211/patches/subsys/324-mac80211-MBSSID-beacon-handling-in-AP-mode.patch @@ -195,7 +195,7 @@ Signed-off-by: Johannes Berg return err; } *changed |= err; -@@ -3463,8 +3528,11 @@ static int ieee80211_set_csa_beacon(stru +@@ -3460,8 +3525,11 @@ static int ieee80211_set_csa_beacon(stru static void ieee80211_color_change_abort(struct ieee80211_sub_if_data *sdata) { sdata->vif.color_change_active = false; @@ -209,7 +209,7 @@ Signed-off-by: Johannes Berg cfg80211_color_change_aborted_notify(sdata->dev); } -@@ -4202,8 +4270,11 @@ ieee80211_set_after_color_change_beacon( +@@ -4199,8 +4267,11 @@ ieee80211_set_after_color_change_beacon( ret = ieee80211_assign_beacon(sdata, sdata->u.ap.next_beacon, NULL, NULL); @@ -223,7 +223,7 @@ Signed-off-by: Johannes Berg if (ret < 0) return ret; -@@ -4246,7 +4317,11 @@ ieee80211_set_color_change_beacon(struct +@@ -4243,7 +4314,11 @@ ieee80211_set_color_change_beacon(struct err = ieee80211_assign_beacon(sdata, ¶ms->beacon_color_change, NULL, &color_change); if (err < 0) { diff --git a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch index 0e83e9bd8e..962ae93cc7 100644 --- a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch @@ -77,7 +77,7 @@ static void ieee80211_rfkill_poll(struct wiphy *wiphy) { struct ieee80211_local *local = wiphy_priv(wiphy); -@@ -4516,6 +4529,7 @@ const struct cfg80211_ops mac80211_confi +@@ -4513,6 +4526,7 @@ const struct cfg80211_ops mac80211_confi .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index b85a3dc39a..b3efdab23e 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2022-10-01 -PKG_SOURCE_VERSION:=72b87836d368685a093b927229209b61d8272541 -PKG_MIRROR_HASH:=ea4dfe93f7632d5063ac2ccf0f5a3698e2bfeadbbef45910381b5ef07e334cfc +PKG_SOURCE_DATE:=2022-11-12 +PKG_SOURCE_VERSION:=4bf2607362fc64fc4cb7d662feb736b7536c0811 +PKG_MIRROR_HASH:=fd4291ac89e14750073cc8c345772883d756bf32cf19fc7205fa344b5b3b91d0 PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 diff --git a/package/kernel/mt76/patches/0001-mt76-allow-VHT-rate-on-2.4GHz.patch b/package/kernel/mt76/patches/0001-mt76-allow-VHT-rate-on-2.4GHz.patch index 0a40968a98..27110f1870 100644 --- a/package/kernel/mt76/patches/0001-mt76-allow-VHT-rate-on-2.4GHz.patch +++ b/package/kernel/mt76/patches/0001-mt76-allow-VHT-rate-on-2.4GHz.patch @@ -1,4 +1,4 @@ -From ed0b9c38becdbf9379787ca0b4db557f03a31dd7 Mon Sep 17 00:00:00 2001 +From fcddb155b538beb0ca7614260a1323d64bfc656a Mon Sep 17 00:00:00 2001 From: DENG Qingfang Date: Mon, 23 Nov 2020 10:46:37 +0800 Subject: [PATCH] mt76: allow VHT rate on 2.4GHz @@ -7,14 +7,13 @@ Allow chips that support 11ac to use 256QAM on 2.4GHz Signed-off-by: DENG Qingfang --- - mac80211.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) + mac80211.c | 10 +++++----- + mt7615/init.c | 2 ++ + 2 files changed, 7 insertions(+), 5 deletions(-) -diff --git a/mac80211.c b/mac80211.c -index 766681a4..06aa4228 100644 --- a/mac80211.c +++ b/mac80211.c -@@ -264,7 +264,7 @@ static void mt76_init_stream_cap(struct mt76_phy *phy, +@@ -275,7 +275,7 @@ static void mt76_init_stream_cap(struct void mt76_set_stream_caps(struct mt76_phy *phy, bool vht) { if (phy->cap.has_2ghz) @@ -23,7 +22,7 @@ index 766681a4..06aa4228 100644 if (phy->cap.has_5ghz) mt76_init_stream_cap(phy, &phy->sband_5g.sband, vht); if (phy->cap.has_6ghz) -@@ -333,13 +333,13 @@ mt76_init_sband(struct mt76_phy *phy, struct mt76_sband *msband, +@@ -342,13 +342,13 @@ mt76_init_sband(struct mt76_phy *phy, st static int mt76_init_sband_2g(struct mt76_phy *phy, struct ieee80211_rate *rates, @@ -39,8 +38,8 @@ index 766681a4..06aa4228 100644 } static int -@@ -475,7 +475,7 @@ int mt76_register_phy(struct mt76_phy *phy, bool vht, - mt76_phy_init(phy, phy->hw); +@@ -496,7 +496,7 @@ int mt76_register_phy(struct mt76_phy *p + return ret; if (phy->cap.has_2ghz) { - ret = mt76_init_sband_2g(phy, rates, n_rates); @@ -48,8 +47,8 @@ index 766681a4..06aa4228 100644 if (ret) return ret; } -@@ -594,7 +594,7 @@ int mt76_register_device(struct mt76_dev *dev, bool vht, - mt76_phy_init(phy, hw); +@@ -621,7 +621,7 @@ int mt76_register_device(struct mt76_dev + return ret; if (phy->cap.has_2ghz) { - ret = mt76_init_sband_2g(phy, rates, n_rates); @@ -57,3 +56,14 @@ index 766681a4..06aa4228 100644 if (ret) return ret; } +--- a/mt7615/init.c ++++ b/mt7615/init.c +@@ -409,6 +409,8 @@ mt7615_init_wiphy(struct ieee80211_hw *h + hw->max_tx_fragments = MT_HW_TXP_MAX_BUF_NUM; + + phy->mt76->sband_2g.sband.ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING; ++ phy->mt76->sband_2g.sband.vht_cap.cap |= ++ IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK; + phy->mt76->sband_5g.sband.ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING; + phy->mt76->sband_5g.sband.vht_cap.cap |= + IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK; diff --git a/package/kernel/mt76/patches/100-aggregation-definitions.patch b/package/kernel/mt76/patches/100-aggregation-definitions.patch deleted file mode 100644 index a88d57133f..0000000000 --- a/package/kernel/mt76/patches/100-aggregation-definitions.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/mt7915/init.c -+++ b/mt7915/init.c -@@ -327,8 +327,8 @@ mt7915_init_wiphy(struct ieee80211_hw *h - struct mt7915_dev *dev = phy->dev; - - hw->queues = 4; -- hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; -- hw->max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; -+ hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE; -+ hw->max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE; - hw->netdev_features = NETIF_F_RXCSUM; - - hw->radiotap_timestamp.units_pos = diff --git a/package/kernel/r8101/Makefile b/package/kernel/r8101/Makefile index 2f09117a9f..2f0ecd14a0 100644 --- a/package/kernel/r8101/Makefile +++ b/package/kernel/r8101/Makefile @@ -28,7 +28,7 @@ define KernelPackage/r8101 AUTOLOAD:=$(call AutoProbe,r8101) endef -define Package/r8101/description +define KernelPackage/r8101/description This package contains a driver for Realtek r8101 chipsets. endef diff --git a/package/kernel/r8125/Makefile b/package/kernel/r8125/Makefile index 082ba4038b..08adf34913 100644 --- a/package/kernel/r8125/Makefile +++ b/package/kernel/r8125/Makefile @@ -29,7 +29,7 @@ define KernelPackage/r8125 AUTOLOAD:=$(call AutoProbe,r8125) endef -define Package/r8125/description +define KernelPackage/r8125/description This package contains a driver for Realtek r8125 chipsets. endef diff --git a/package/kernel/r8152/Makefile b/package/kernel/r8152/Makefile index 394200b77d..4e5e16081a 100644 --- a/package/kernel/r8152/Makefile +++ b/package/kernel/r8152/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=r8152 -PKG_VERSION:=2.16.3.20220914 +PKG_VERSION:=2.16.3.20221209 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/wget/realtek-r8152-linux/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=61ed7af34c8882c6028ddd1a27bb78fb5bfba41211f84dd7a06e4dc84dbe9a9a +PKG_HASH:=82f0a86519e6e185623009190bb85f3a8f3de2bf9e67222c43c1265e773c9f9c PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/realtek-$(PKG_NAME)-linux-$(PKG_VERSION) PKG_LICENSE:=GPL-2.0-only diff --git a/package/kernel/r8168/Makefile b/package/kernel/r8168/Makefile index 8440202eaa..1c1bf84b87 100644 --- a/package/kernel/r8168/Makefile +++ b/package/kernel/r8168/Makefile @@ -29,7 +29,7 @@ define KernelPackage/r8168 CONFLICTS:=kmod-r8169 endef -define Package/r8168/description +define KernelPackage/r8168/description This package contains a driver for Realtek r8168 chipsets. endef diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile index 4f474978db..c2f046318f 100644 --- a/package/libs/ustream-ssl/Makefile +++ b/package/libs/ustream-ssl/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ustream-ssl -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git -PKG_SOURCE_DATE:=2022-01-16 -PKG_SOURCE_VERSION:=868fd8812f477c110f9c6c5252c0bd172167b94c -PKG_MIRROR_HASH:=dd28d5e846b391917cf83d66176653bdfa4e8a0d5b11144b65a012fe7693ddeb +PKG_SOURCE_DATE:=2022-12-08 +PKG_SOURCE_VERSION:=9217ab46536353c7c792951b57163063f5ec7a3b +PKG_MIRROR_HASH:=cd4dc6a6c18290348b1f8b1c01df3320e4954dc46d714c797bef066f7a91248d CMAKE_INSTALL:=1 PKG_LICENSE:=ISC diff --git a/package/libs/wolfssl/Config.in b/package/libs/wolfssl/Config.in index a212d1fb8a..7c154ccb31 100644 --- a/package/libs/wolfssl/Config.in +++ b/package/libs/wolfssl/Config.in @@ -81,7 +81,7 @@ if PACKAGE_libwolfssl bool "AF_ALG" config WOLFSSL_HAS_DEVCRYPTO_CBC - bool "/dev/crytpo - AES-CBC-only" + bool "/dev/crypto - AES-CBC-only" select WOLFSSL_HAS_DEVCRYPTO config WOLFSSL_HAS_DEVCRYPTO_AES diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index 08a1ca7401..869c8a3d5d 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=5.5.1-stable +PKG_VERSION:=5.5.3-stable PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) -PKG_HASH:=97339e6956c90e7c881ba5c748dd04f7c30e5dbe0c06da765418c51375a6dee3 +PKG_HASH:=fd3135b8657d09fb96a8aad16585da850b96ea420ae8ce5ac4d5fdfc614c2683 PKG_FIXUP:=libtool libtool-abiver PKG_INSTALL:=1 diff --git a/package/libs/wolfssl/patches/001-Fix-enable-devcrypto-build-error.patch b/package/libs/wolfssl/patches/001-Fix-enable-devcrypto-build-error.patch new file mode 100644 index 0000000000..bcdaf2b7a2 --- /dev/null +++ b/package/libs/wolfssl/patches/001-Fix-enable-devcrypto-build-error.patch @@ -0,0 +1,33 @@ +From dc9f46a3be00b5e82684a158605189d1278e324c Mon Sep 17 00:00:00 2001 +From: Eric Blankenhorn +Date: Wed, 12 Oct 2022 16:05:17 -0500 +Subject: [PATCH] Fix --enable-devcrypto build error for sys without u_int8_t + type + +--- + wolfcrypt/src/port/devcrypto/README.md | 2 +- + wolfcrypt/src/port/devcrypto/wc_devcrypto.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/wolfcrypt/src/port/devcrypto/README.md ++++ b/wolfcrypt/src/port/devcrypto/README.md +@@ -22,7 +22,7 @@ modprobe cryptodev + For default build with all supported features use: + + ``` +-./configure --enable-cryptodev ++./configure --enable-devcrypto + ``` + + Or for more control over features used: +--- a/wolfcrypt/src/port/devcrypto/wc_devcrypto.c ++++ b/wolfcrypt/src/port/devcrypto/wc_devcrypto.c +@@ -122,7 +122,7 @@ int wc_DevCryptoCreate(WC_CRYPTODEV* ctx + case CRYPTO_SHA2_512_HMAC: + ctx->sess.cipher = 0; + ctx->sess.mac = type; +- ctx->sess.mackey = (u_int8_t*)key; ++ ctx->sess.mackey = (byte*)key; + ctx->sess.mackeylen = keySz; + break; + diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch index 01bb5974ba..904b424fa0 100644 --- a/package/libs/wolfssl/patches/100-disable-hardening-check.patch +++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch @@ -1,6 +1,6 @@ --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h -@@ -2445,7 +2445,7 @@ extern void uITRON4_free(void *p) ; +@@ -2455,7 +2455,7 @@ extern void uITRON4_free(void *p) ; #endif /* warning for not using harden build options (default with ./configure) */ diff --git a/package/libs/wolfssl/patches/110-build-with-libtool-2.4.patch b/package/libs/wolfssl/patches/110-build-with-libtool-2.4.patch index 206c6dac6a..f773df7a89 100644 --- a/package/libs/wolfssl/patches/110-build-with-libtool-2.4.patch +++ b/package/libs/wolfssl/patches/110-build-with-libtool-2.4.patch @@ -1,5 +1,3 @@ -diff --git a/configure.ac b/configure.ac -index 144c857e4..de7f6b45a 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ AC_ARG_PROGRAM @@ -10,4 +8,4 @@ index 144c857e4..de7f6b45a 100644 +LT_PREREQ([2.4]) LT_INIT([disable-static win32-dll]) - #shared library versioning + AC_ARG_VAR(EXTRA_CFLAGS, [Extra CFLAGS to add to autoconf-computed arg list. Can also supply directly to make.]) diff --git a/package/libs/wolfssl/patches/200-ecc-rng.patch b/package/libs/wolfssl/patches/200-ecc-rng.patch deleted file mode 100644 index d68ef7f385..0000000000 --- a/package/libs/wolfssl/patches/200-ecc-rng.patch +++ /dev/null @@ -1,50 +0,0 @@ -Since commit 6467de5a8840 ("Randomize z ordinates in scalar -mult when timing resistant") wolfssl requires a RNG for an EC -key when the hardened built option is selected. - -wc_ecc_set_rng is only available when built hardened, so there -is no safe way to install the RNG to the key regardless whether -or not wolfssl is compiled hardened. - -Always export wc_ecc_set_rng so tools such as hostapd can install -RNG regardless of the built settings for wolfssl. - ---- a/wolfcrypt/src/ecc.c -+++ b/wolfcrypt/src/ecc.c -@@ -12348,21 +12348,21 @@ void wc_ecc_fp_free(void) - - #endif /* FP_ECC */ - --#ifdef ECC_TIMING_RESISTANT - int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng) - { - int err = 0; - -+#ifdef ECC_TIMING_RESISTANT - if (key == NULL) { - err = BAD_FUNC_ARG; - } - else { - key->rng = rng; - } -+#endif - - return err; - } --#endif - - #ifdef HAVE_ECC_ENCRYPT - ---- a/wolfssl/wolfcrypt/ecc.h -+++ b/wolfssl/wolfcrypt/ecc.h -@@ -650,10 +650,8 @@ WOLFSSL_ABI WOLFSSL_API - void wc_ecc_fp_free(void); - WOLFSSL_LOCAL - void wc_ecc_fp_init(void); --#ifdef ECC_TIMING_RESISTANT - WOLFSSL_API - int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng); --#endif - - WOLFSSL_API - int wc_ecc_set_curve(ecc_key* key, int keysize, int curve_id); diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index 23d6007c60..d7470f23b3 100644 --- a/package/network/config/firewall/Makefile +++ b/package/network/config/firewall/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=firewall -PKG_RELEASE:=1.1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index b1ac0be4e8..4e63cfdb09 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=iptables PKG_VERSION:=1.8.7 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=https://netfilter.org/projects/iptables/files PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 diff --git a/package/network/utils/shortcut-fe/Makefile b/package/network/utils/shortcut-fe/Makefile index 27fbdbfbe2..eba327668c 100644 --- a/package/network/utils/shortcut-fe/Makefile +++ b/package/network/utils/shortcut-fe/Makefile @@ -71,7 +71,7 @@ endef define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include/shortcut-fe - $(CP) $(PKG_BUILD_DIR)/sfe.h $(1)/usr/include/shortcut-fe + $(CP) $(PKG_BUILD_DIR)/sfe*.h $(1)/usr/include/shortcut-fe endef define KernelPackage/shortcut-fe/install diff --git a/package/system/procd/patches/0001-uxc-fix-compilation-error-caused-by-unused-variable.patch b/package/system/procd/patches/0001-uxc-fix-compilation-error-caused-by-unused-variable.patch new file mode 100644 index 0000000000..6c1a21ebea --- /dev/null +++ b/package/system/procd/patches/0001-uxc-fix-compilation-error-caused-by-unused-variable.patch @@ -0,0 +1,36 @@ +From 2ddf0005298e08ba1e358d95be6b826c56a7d1fc Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Tue, 29 Nov 2022 16:33:23 +0100 +Subject: [PATCH] uxc: fix compilation error caused by unused variable + +Fix compilation error caused by unused verbose variable. + +Signed-off-by: Christian Marangi +--- + uxc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/uxc.c b/uxc.c +index eb40eb2..b22d838 100644 +--- a/uxc.c ++++ b/uxc.c +@@ -80,6 +80,8 @@ static struct blob_buf conf; + static struct blob_buf state; + static struct ubus_context *ctx; + ++static bool verbose = false; ++ + static int usage(void) { + printf("syntax: uxc [parameters ...]\n"); + printf("commands:\n"); +@@ -724,7 +726,6 @@ int main(int argc, char **argv) + char *pidfile = NULL; + bool autostart = false; + bool force = false; +- bool verbose = false; + int signal = SIGTERM; + int c; + +-- +2.37.2 + diff --git a/package/utils/nvram/Makefile b/package/utils/nvram/Makefile index 863b304d0d..b957211283 100644 --- a/package/utils/nvram/Makefile +++ b/package/utils/nvram/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nvram -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -44,7 +44,11 @@ define Package/nvram/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/nvram $(1)/usr/sbin/ ifneq ($(CONFIG_TARGET_bcm47xx),) $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/nvram.init $(1)/etc/init.d/nvram + $(INSTALL_BIN) ./files/nvram-bcm47xx.init $(1)/etc/init.d/nvram +endif +ifneq ($(CONFIG_TARGET_bcm53xx),) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/nvram-bcm53xx.init $(1)/etc/init.d/nvram endif endef diff --git a/package/utils/nvram/files/nvram.init b/package/utils/nvram/files/nvram-bcm47xx.init similarity index 97% rename from package/utils/nvram/files/nvram.init rename to package/utils/nvram/files/nvram-bcm47xx.init index 467ab28195..4a2bcd16fe 100755 --- a/package/utils/nvram/files/nvram.init +++ b/package/utils/nvram/files/nvram-bcm47xx.init @@ -1,7 +1,7 @@ #!/bin/sh /etc/rc.common # NVRAM setup # -# This file handles the NVRAM quirks of various hardware. +# This file handles the NVRAM quirks of various hardware of the bcm47xx target. START=02 alias debug=${DEBUG:-:} @@ -71,7 +71,7 @@ fixup_linksys() { esac } -start() { +boot() { # Don't do any fixups on the WGT634U [ "$(cat /proc/diag/model)" = "Netgear WGT634U" ] && return diff --git a/package/utils/nvram/files/nvram-bcm53xx.init b/package/utils/nvram/files/nvram-bcm53xx.init new file mode 100755 index 0000000000..0502cd28b6 --- /dev/null +++ b/package/utils/nvram/files/nvram-bcm53xx.init @@ -0,0 +1,40 @@ +#!/bin/sh /etc/rc.common +# NVRAM setup +# +# This file handles the NVRAM quirks of various hardware of the bcm53xx target. + +START=02 + +clear_partialboots() { + # clear partialboots + + case $(board_name) in + linksys,panamera) + COMMIT=1 + nvram set partialboots=0 + ;; + esac +} + +set_wireless_led_behaviour() { + # set Broadcom wireless LED behaviour for both radios + # 0:ledbh9 -> Behaviour of 2.4GHz LED + # 1:ledbh9 -> Behaviour of 5GHz LED + # 0x7 makes the wireless LEDs on, when radios are enabled, and blink when there's activity + + case $(board_name) in + asus,rt-ac88u) + COMMIT=1 + nvram set 0:ledbh9=0x7 set 1:ledbh9=0x7 + ;; + esac +} + +boot() { + . /lib/functions.sh + + clear_partialboots + set_wireless_led_behaviour + + [ "$COMMIT" = "1" ] && nvram commit +} diff --git a/rules.mk b/rules.mk index 1ef6bb0aa2..e69673f396 100644 --- a/rules.mk +++ b/rules.mk @@ -212,7 +212,6 @@ ifndef DUMP ifneq ($(TOOLCHAIN_LIB_DIRS),) TARGET_LDFLAGS+= $(patsubst %,-L%,$(TOOLCHAIN_LIB_DIRS)) endif - TARGET_PATH:=$(TOOLCHAIN_DIR)/bin:$(TARGET_PATH) endif endif endif @@ -246,20 +245,13 @@ HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include $(if $(IS_PACKAGE_BUILD),-I$(STAGIN HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS) HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib) -ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) - TARGET_AR:=$(TARGET_CROSS)gcc-ar - TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib - TARGET_NM:=$(TARGET_CROSS)gcc-nm -else - TARGET_AR:=$(TARGET_CROSS)ar - TARGET_RANLIB:=$(TARGET_CROSS)ranlib - TARGET_NM:=$(TARGET_CROSS)nm -endif - BUILD_KEY=$(TOPDIR)/key-build FAKEROOT:=$(STAGING_DIR_HOST)/bin/fakeroot +TARGET_AR:=$(TARGET_CROSS)gcc-ar +TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib +TARGET_NM:=$(TARGET_CROSS)gcc-nm TARGET_CC:=$(TARGET_CROSS)gcc TARGET_CXX:=$(TARGET_CROSS)g++ KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 81b1ffcb56..2adc5efec5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4697,7 +4697,7 @@ sub process { ## $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) { ## ## # Remove any bracketed sections to ensure we do not -## # falsly report the parameters of functions. +## # falsely report the parameters of functions. ## my $ln = $line; ## while ($ln =~ s/\([^\(\)]*\)//g) { ## } diff --git a/scripts/dl_github_archive.py b/scripts/dl_github_archive.py index 59fd7067be..b992227dc9 100755 --- a/scripts/dl_github_archive.py +++ b/scripts/dl_github_archive.py @@ -207,7 +207,7 @@ class GitHubCommitTsCache(object): class DownloadGitHubTarball(object): - """Download and repack archive tarabll from GitHub. + """Download and repack archive tarball from GitHub. Compared with the method of packing after cloning the whole repo, this method is more friendly to users with fragile internet connection. @@ -220,7 +220,7 @@ class DownloadGitHubTarball(object): - GitHub archives do not contain source codes for submodules. - - GitHub archives seem to respect .gitattributes and ignore pathes with + - GitHub archives seem to respect .gitattributes and ignore paths with export-ignore attributes. For the first two issues, the method will fail loudly to allow fallback to diff --git a/scripts/download.pl b/scripts/download.pl index 9ec6d1a869..a7865f285c 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -206,11 +206,21 @@ foreach my $mirror (@ARGV) { # use OpenWrt source server directly } elsif ($mirror =~ /^\@IMMORTALWRT$/) { # use ImmortalWrt source server directly + } elsif ($mirror =~ /^\@DEBIAN\/(.+)$/) { + push @mirrors, "https://mirrors.tencent.com/debian/$1"; + push @mirrors, "https://mirrors.aliyun.com/debian/$1"; + push @mirrors, "https://mirrors.tuna.tsinghua.edu.cn/debian/$1"; + push @mirrors, "https://mirrors.ustc.edu.cn/debian/$1"; + push @mirrors, "https://ftp.debian.org/debian/$1"; + push @mirrors, "https://mirror.leaseweb.com/debian/$1"; + push @mirrors, "https://mirror.netcologne.de/debian/$1"; + push @mirrors, "https://mirrors.tuna.tsinghua.edu.cn/debian/$1"; + push @mirrors, "https://mirrors.ustc.edu.cn/debian/$1" } elsif ($mirror =~ /^\@APACHE\/(.+)$/) { push @mirrors, "https://mirrors.tencent.com/apache/$1"; push @mirrors, "https://mirrors.aliyun.com/apache/$1"; - # push @mirrors, "https://mirrors.tuna.tsinghua.edu.cn/apache/$1"; - # push @mirrors, "https://mirrors.ustc.edu.cn/apache/$1"; + push @mirrors, "https://mirrors.tuna.tsinghua.edu.cn/apache/$1"; + push @mirrors, "https://mirrors.ustc.edu.cn/apache/$1"; push @mirrors, "https://mirror.netcologne.de/apache.org/$1"; push @mirrors, "https://mirror.aarnet.edu.au/pub/apache/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/apache/$1"; @@ -234,9 +244,8 @@ foreach my $mirror (@ARGV) { } elsif ($mirror =~ /^\@GNU\/(.+)$/) { push @mirrors, "https://mirrors.tencent.com/gnu/$1"; push @mirrors, "https://mirrors.aliyun.com/gnu/$1"; - # push @mirrors, "https://mirrors.tuna.tsinghua.edu.cn/gnu/$1"; - # push @mirrors, "https://mirrors.cqu.edu.cn/gnu/$1"; - # push @mirrors, "https://mirrors.ustc.edu.cn/gnu/$1"; + push @mirrors, "https://mirrors.tuna.tsinghua.edu.cn/gnu/$1"; + push @mirrors, "https://mirrors.ustc.edu.cn/gnu/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnu/$1"; push @mirrors, "https://mirror.netcologne.de/gnu/$1"; push @mirrors, "http://ftp.kddilabs.jp/GNU/gnu/$1"; @@ -261,8 +270,11 @@ foreach my $mirror (@ARGV) { push @extra, "$extra[0]/longterm/v$1"; } foreach my $dir (@extra) { - # push @mirrors, "https://mirrors.ustc.edu.cn/kernel.org/$dir"; + push @mirrors, "https://mirror.iscas.ac.cn/kernel.org/$dir"; + push @mirrors, "https://mirrors.ustc.edu.cn/kernel.org/$dir"; + push @mirrors, "https://mirror.nju.edu.cn/kernel.org/$dir"; push @mirrors, "https://cdn.kernel.org/pub/$dir"; + push @mirrors, "https://ftp.jaist.ac.jp/pub/Linux/kernel.org/$dir"; push @mirrors, "https://download.xs4all.nl/ftp.kernel.org/pub/$dir"; push @mirrors, "https://mirrors.mit.edu/kernel/$dir"; push @mirrors, "http://ftp.nara.wide.ad.jp/pub/kernel.org/$dir"; @@ -271,7 +283,9 @@ foreach my $mirror (@ARGV) { push @mirrors, "ftp://www.mirrorservice.org/sites/ftp.kernel.org/pub/$dir"; } } elsif ($mirror =~ /^\@GNOME\/(.+)$/) { - push @mirrors, "https://mirrors.ustc.edu.cn/gnome/sources/$1"; + push @mirrors, "https://mirrors.ustc.edu.cn/gnome/sources/$1"; + push @mirrors, "https://mirror.nju.edu.cn/gnome/$1"; + push @mirrors, "https://download.gnome.org/sources/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnome/sources/$1"; push @mirrors, "http://ftp.acc.umu.se/pub/GNOME/sources/$1"; push @mirrors, "http://ftp.kaist.ac.kr/gnome/sources/$1"; @@ -286,6 +300,7 @@ foreach my $mirror (@ARGV) { } # push @mirrors, 'https://mirror01.download.immortalwrt.eu.org'; +push @mirrors, 'https://mirror2.immortalwrt.org/sources'; push @mirrors, 'https://mirror.immortalwrt.org/sources'; push @mirrors, 'https://sources.immortalwrt.org'; push @mirrors, 'https://sources.cdn.immortalwrt.org'; diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index ee7d9532f5..fe1024c18e 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -50,6 +50,7 @@ BIN_SPECS=" gdbserver: gdbserver " +OVERWRITE_CONFIG="" test_c() { cat <<-EOT | "${CC:-false}" $CFLAGS -o /dev/null -x c - 2>/dev/null @@ -281,8 +282,11 @@ print_config() { local mksubtarget local target="$("$CC" $CFLAGS -dumpmachine)" + local version="$("$CC" $CFLAGS -dumpversion)" local cpuarch="${target%%-*}" - local prefix="${CC##*/}"; prefix="${prefix%-*}-" + + # get CC; strip version; strip gcc and add - suffix + local prefix="${CC##*/}"; prefix="${prefix%-$version}"; prefix="${prefix%-*}-" local config="${0%/scripts/*}/.config" # if no target specified, print choice list and exit @@ -317,9 +321,13 @@ print_config() { fi # bail out if there is a .config already - if [ -f "${0%/scripts/*}/.config" ]; then - echo "There already is a .config file, refusing to overwrite!" >&2 - return 1 + if [ -f "$config" ]; then + if [ "$OVERWRITE_CONFIG" == "" ]; then + echo "There already is a .config file, refusing to overwrite!" >&2 + return 1 + else + echo "There already is a .config file, trying to overwrite!" + fi fi case "$mktarget" in */*) @@ -327,8 +335,11 @@ print_config() { mktarget="${mktarget%/*}" ;; esac + if [ ! -f "$config" ]; then + touch "$config" + fi - echo "CONFIG_TARGET_${mktarget}=y" > "$config" + echo "CONFIG_TARGET_${mktarget}=y" >> "$config" if [ -n "$mksubtarget" ]; then echo "CONFIG_TARGET_${mktarget}_${mksubtarget}=y" >> "$config" @@ -358,8 +369,18 @@ print_config() { echo "CONFIG_TOOLCHAIN_PREFIX=\"$prefix\"" >> "$config" echo "CONFIG_TARGET_NAME=\"$target\"" >> "$config" - if [ "$LIBC_TYPE" != glibc ]; then - echo "CONFIG_TOOLCHAIN_LIBC=\"$LIBC_TYPE\"" >> "$config" + if [ -f "$config" ]; then + sed -i '/CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL/d' "$config" + sed -i '/CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC/d' "$config" + fi + + if [ "$LIBC_TYPE" == glibc ]; then + echo "CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC=y" >> "$config" + elif [ "$LIBC_TYPE" == musl ]; then + echo "CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL=y" >> "$config" + else + echo "Can't detect LIBC type. Aborting!" >&2 + return 1 fi local lib @@ -452,6 +473,13 @@ probe_cpp() { } probe_libc() { + if [ -f $TOOLCHAIN/info.mk ]; then + LIBC_TYPE=$(grep LIBC_TYPE $TOOLCHAIN/info.mk | sed 's/LIBC_TYPE=//') + return 0 + fi + + echo "Warning! Can't find info.mk, trying to detect with alternative way." + if [ -z "$LIBC_TYPE" ]; then if test_uclibc; then LIBC_TYPE="uclibc" @@ -529,8 +557,13 @@ while [ -n "$1" ]; do exit $? ;; + --overwrite-config) + OVERWRITE_CONFIG=y + ;; + --config) if probe_cc; then + probe_libc print_config "$1" exit $? fi @@ -569,7 +602,9 @@ while [ -n "$1" ]; do echo -e " Most commands also take a --cflags parameter which " >&2 echo -e " is used to specify C flags to be passed to the " >&2 echo -e " cross compiler when performing tests." >&2 - echo -e " This paremter may be repeated multiple times." >&2 + echo -e " This parameter may be repeated multiple times." >&2 + echo -e " Use --overwrite-config before --config to overwrite" >&2 + echo -e " an already present config with the required changes.">&2 exit 1 ;; diff --git a/scripts/ext-tools.sh b/scripts/ext-tools.sh new file mode 100755 index 0000000000..bf56f4d9ed --- /dev/null +++ b/scripts/ext-tools.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash + +TOOLS_TAR="" +HOST_BUILD_DIR=$(pwd)/"build_dir/host" +HOST_STAGING_DIR_STAMP=$(pwd)/"staging_dir/host/stamp" + +refresh_timestamps() { + find "$1" -not -type l -print0 | xargs -0 touch +} + +extract_prebuilt_tar() { + tar -xf "$1" +} + +install_prebuilt_tools() { + extract_prebuilt_tar "$TOOLS_TAR" + + if [ ! -d "$HOST_BUILD_DIR" ]; then + echo "Can't find Host Build Dir "$HOST_BUILD_DIR"" >&2 + exit 1 + fi + + refresh_timestamps "$HOST_BUILD_DIR" + sleep 1 + + if [ ! -d "$HOST_STAGING_DIR_STAMP" ]; then + echo "Can't find Host Staging Dir Stamp "$HOST_STAGING_DIR_STAMP"" >&2 + exit 1 + fi + + refresh_timestamps "$HOST_STAGING_DIR_STAMP" + + return 0 +} + +while [ -n "$1" ]; do + arg="$1"; shift + case "$arg" in + --host-build-dir) + [ -d "$1" ] || { + echo "Directory '$1' does not exist." >&2 + exit 1 + } + HOST_BUILD_DIR="$(cd "$1"; pwd)"; shift + ;; + + --host-staging-dir-stamp) + [ -d "$1" ] || { + echo "Directory '$1' does not exist." >&2 + exit 1 + } + HOST_STAGING_DIR_STAMP="$(cd "$1"; pwd)"; shift + ;; + + --tools) + [ -f "$1" ] || { + echo "Tools tar file '$1' does not exist." >&2 + exit 1 + } + TOOLS_TAR="$1"; shift + install_prebuilt_tools + + exit $? + ;; + + -h|--help) + me="$(basename "$0")" + echo -e "\nUsage:\n" >&2 + echo -e " $me --host-build-dir {directory}" >&2 + echo -e " Set to refresh timestamp of this build directory" >&2 + echo -e " with --tools." >&2 + echo -e " THIS OPTION MUST BE SET BEFORE --tools." >&2 + echo -e " If not provided the default directory is:" >&2 + echo -e " $(pwd)/build_dir/host\n" >&2 + echo -e " $me --host-staging-dir-stamp {directory}" >&2 + echo -e " Set to refresh staging timestamp present in this" >&2 + echo -e " directory with --tools." >&2 + echo -e " THIS OPTION MUST BE SET BEFORE --tools." >&2 + echo -e " If not provided the default directory is:" >&2 + echo -e " $(pwd)/staging_dir/host/stamp\n" >&2 + echo -e " $me --tools {tar}" >&2 + echo -e " Install the prebuilt tools present in the passed" >&2 + echo -e " tar and prepare them." >&2 + echo -e " To correctly use them it's needed to update the." >&2 + echo -e " timestamp of each tools to skip recompilation.\n" >&2 + echo -e " $me --help" >&2 + echo -e " Display this help text and exit.\n\n" >&2 + exit 1 + ;; + + *) + echo "Unknown argument '$arg'" >&2 + exec $0 --help + ;; + esac +done + +exec $0 --help diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py index db47fd9e42..89b7d4fe20 100755 --- a/scripts/json_overview_image_info.py +++ b/scripts/json_overview_image_info.py @@ -7,7 +7,7 @@ from sys import argv import json if len(argv) != 2: - print("JSON info files script requires ouput file as argument") + print("JSON info files script requires output file as argument") exit(1) output_path = Path(argv[1]) diff --git a/scripts/linksys-image.sh b/scripts/linksys-image.sh index 36a676d964..c3baf44844 100755 --- a/scripts/linksys-image.sh +++ b/scripts/linksys-image.sh @@ -11,11 +11,11 @@ # This is appended to the factory image and is tested by the Linksys Upgrader - as observed in civic. # The footer is 256 bytes. The format is: # .LINKSYS. This is detected by the Linksys upgrader before continuing with upgrade. (9 bytes) -# The version number of upgrade. Not checked so use arbitary value (8 bytes) +# The version number of upgrade. Not checked so use arbitrary value (8 bytes) # Model of target device, padded (0x20) to (15 bytes) # CRC checksum of the image to flash (8 byte) # Padding (0x20) (7 bytes) -# Signature of signer. Not checked so use Arbitary value (16 bytes) +# Signature of signer. Not checked so use arbitrary value (16 bytes) # Padding (0x00) (192 bytes) # 0x0A (1 byte) diff --git a/scripts/pad_image b/scripts/pad_image index b1941a28d8..871063af34 100755 --- a/scripts/pad_image +++ b/scripts/pad_image @@ -2,7 +2,7 @@ function usage { echo "Usage: prepare_image image_type kernel_image rootfs_image header_size" - echo "Padd root and kernel image to the correct size and append the jffs2 start marker as needed" + echo "Pad root and kernel image to the correct size and append the jffs2 start marker as needed" exit 1 } diff --git a/scripts/sign_images.sh b/scripts/sign_images.sh index c41b21e091..f37c2f5016 100755 --- a/scripts/sign_images.sh +++ b/scripts/sign_images.sh @@ -3,12 +3,12 @@ # directory where search for images TOP_DIR="${TOP_DIR:-./bin/targets}" # key to sign images -BUILD_KEY="${BUILD_KEY:-key-build}" # TODO unifiy naming? +BUILD_KEY="${BUILD_KEY:-key-build}" # TODO unify naming? # remove other signatures (added e.g. by buildbot) REMOVE_OTER_SIGNATURES="${REMOVE_OTER_SIGNATURES:-1}" # find all sysupgrade images in TOP_DIR -# factory images don't need signatures as non OpenWrt system doen't check them anyway +# factory images don't need signatures as non OpenWrt system doesn't check them anyway for image in $(find $TOP_DIR -type f -name "*-sysupgrade.bin"); do # check if image actually support metadata if fwtool -i /dev/null "$image"; then diff --git a/scripts/size_compare.sh b/scripts/size_compare.sh index 8c790e36d9..985169ce9e 100755 --- a/scripts/size_compare.sh +++ b/scripts/size_compare.sh @@ -7,9 +7,9 @@ ### ### The script compares locally compiled package with the package indexes ### available upstream. This way the storage impact of optimizations or -### feature modifiactions is easy to see. +### feature modifications is easy to see. ### -### If no environmental variables are set the scritp reads the current +### If no environmental variables are set the script reads the current ### .config file. The evaluated env variables are the following: ### ### TARGET SUBTARGET ARCH PACKAGES BIN_DIR BASE_URL CHECK_INSTALLED diff --git a/scripts/slugimage.pl b/scripts/slugimage.pl index 8c0654d4f6..366b239e96 100755 --- a/scripts/slugimage.pl +++ b/scripts/slugimage.pl @@ -772,7 +772,7 @@ sub writeOutFirmware { $_->{'name'}, $filename); } - # If the next parition is before the end of the current image, then rewind. + # If the next partition is before the end of the current image, then rewind. elsif ($_->{'offset'} < $end_point) { $debug and printf("Rewound %s before <%s> in \"%s\"\n", (($end_point - $_->{'offset'}) >= $block_size ? @@ -971,7 +971,7 @@ if (!GetOptions("d|debug" => \$debug, print " [-b|--redboot] Input/Output RedBoot filename\n"; print " [-s|--sysconf] Input/Output SysConf filename\n"; print " [-L|--loader] Second stage boot loader filename\n"; - print " [-k|--kernel] Input/Ouptut Kernel filename\n"; + print " [-k|--kernel] Input/Output Kernel filename\n"; print " [-r|--ramdisk] Input/Output Ramdisk filename(s)\n"; print " [-f|--fisdir] Input/Output FIS directory filename\n"; print " [-m|--microcode] Input/Output Microcode filename\n"; diff --git a/target/linux/bcm27xx/patches-5.4/950-0043-MMC-added-alternative-MMC-driver.patch b/target/linux/bcm27xx/patches-5.4/950-0043-MMC-added-alternative-MMC-driver.patch index 34ad1be438..e688302597 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0043-MMC-added-alternative-MMC-driver.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0043-MMC-added-alternative-MMC-driver.patch @@ -267,7 +267,7 @@ Signed-off-by: Yaroslav Rosomakho goto out; --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c -@@ -1925,7 +1925,8 @@ EXPORT_SYMBOL(mmc_erase); +@@ -1931,7 +1931,8 @@ EXPORT_SYMBOL(mmc_erase); int mmc_can_erase(struct mmc_card *card) { if ((card->host->caps & MMC_CAP_ERASE) && diff --git a/target/linux/bcm4908/config-5.4 b/target/linux/bcm4908/config-5.4 index 2c80ec9fcf..2667844a23 100644 --- a/target/linux/bcm4908/config-5.4 +++ b/target/linux/bcm4908/config-5.4 @@ -1,5 +1,6 @@ CONFIG_64BIT=y CONFIG_ARCH_BCM4908=y +CONFIG_ARCH_BCMBCA=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y CONFIG_ARCH_KEEP_MEMBLOCK=y @@ -211,7 +212,6 @@ CONFIG_QUEUED_SPINLOCKS=y CONFIG_RATIONAL=y CONFIG_RCU_NEED_SEGCBLIST=y CONFIG_RCU_STALL_COMMON=y -CONFIG_REFCOUNT_FULL=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y CONFIG_RFS_ACCEL=y diff --git a/target/linux/bcm4908/image/Makefile b/target/linux/bcm4908/image/Makefile index aba4d377f8..cdb6f3ea1f 100644 --- a/target/linux/bcm4908/image/Makefile +++ b/target/linux/bcm4908/image/Makefile @@ -77,7 +77,7 @@ endef define Device/asus_gt-ac5300 DEVICE_VENDOR := Asus DEVICE_MODEL := GT-AC5300 - DEVICE_DTS := broadcom/bcm4908/bcm4908-asus-gt-ac5300 + DEVICE_DTS := broadcom/bcmbca/bcm4908-asus-gt-ac5300 IMAGES := bin IMAGE/bin := append-ubi | bcm4908img | bcm4908asus ASUS_PRODUCTID := GT-AC5300 @@ -90,7 +90,7 @@ TARGET_DEVICES += asus_gt-ac5300 define Device/asus_gt-ax6000 DEVICE_VENDOR := Asus DEVICE_MODEL := GT-AX6000 - DEVICE_DTS := broadcom/bcmbca/bcm4912-asus-gt-ax6000 + KERNEL := kernel-bin | bootfs IMAGES := pkgtb IMAGE/pkgtb := append-rootfs | pkgtb SOC := bcm4912 @@ -100,7 +100,7 @@ endef define Device/netgear_r8000p DEVICE_VENDOR := Netgear DEVICE_MODEL := R8000P - DEVICE_DTS := broadcom/bcm4908/bcm4906-netgear-r8000p + DEVICE_DTS := broadcom/bcmbca/bcm4906-netgear-r8000p IMAGES := bin IMAGE/chk := append-ubi | bcm4908img | netgear-chk NETGEAR_BOARD_ID := U12H359T00_NETGEAR @@ -112,7 +112,7 @@ define Device/tplink_archer-c2300-v1 DEVICE_VENDOR := TP-Link DEVICE_MODEL := Archer C2300 DEVICE_VARIANT := v1 - DEVICE_DTS := broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1 + DEVICE_DTS := broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1 IMAGES := bin IMAGE/bin := append-ubi | bcm4908img BROKEN := y diff --git a/target/linux/bcm4908/image/bootfs-bcm4908.its b/target/linux/bcm4908/image/bootfs-bcm4908.its index d5ac21fd6a..2086fc7ec9 100644 --- a/target/linux/bcm4908/image/bootfs-bcm4908.its +++ b/target/linux/bcm4908/image/bootfs-bcm4908.its @@ -25,7 +25,7 @@ fdt_linux_RAX220 { description = "dtb"; - data = /incbin/("${dts_dir}/broadcom/bcm4908/bcm4908-netgear-raxe500.dtb"); + data = /incbin/("${dts_dir}/broadcom/bcmbca/bcm4908-netgear-raxe500.dtb"); arch = "arm64"; type = "flat_dt"; compression = "none"; diff --git a/target/linux/bcm4908/image/bootfs-bcm4912.its b/target/linux/bcm4908/image/bootfs-bcm4912.its index 6f4548956c..3d671f9d00 100644 --- a/target/linux/bcm4908/image/bootfs-bcm4912.its +++ b/target/linux/bcm4908/image/bootfs-bcm4912.its @@ -12,9 +12,22 @@ data = /incbin/("${images_dir}/u-boot/u-boot-bcm4912.dtb"); }; - fdt_GTAX6000 { + fdt_uboot_GTAX6000 { description = "dtb"; data = /incbin/("${images_dir}/u-boot/GTAX6000.dtb"); + arch = "arm64"; + type = "flat_dt"; + compression = "none"; + + hash-1 { + algo = "sha256"; + }; + }; + + fdt_linux_GTAX6000 { + description = "dtb"; + data = /incbin/("${dts_dir}/broadcom/bcmbca/bcm4912-asus-gt-ax6000.dtb"); + arch = "arm64"; type = "flat_dt"; compression = "none"; @@ -27,8 +40,26 @@ configurations { conf_ub_GTAX6000 { description = "GTAX6000"; - fdt = "fdt_GTAX6000"; + fdt = "fdt_uboot_GTAX6000"; loadables = "atf", "uboot"; }; + + conf_lx_GTAX6000 { + description = "BRCM 63xxx linux"; + kernel = "kernel"; + fdt = "fdt_linux_GTAX6000"; + }; + + conf_ub_GTAX6000_50991 { + description = "GTAX6000_50991"; + fdt = "fdt_uboot_GTAX6000"; + loadables = "atf", "uboot"; + }; + + conf_lx_GTAX6000_50991 { + description = "BRCM 63xxx linux"; + kernel = "kernel"; + fdt = "fdt_linux_GTAX6000"; + }; }; }; diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0011-arm64-bcmbca-add-arch-bcmbca-machine-entry.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0011-arm64-bcmbca-add-arch-bcmbca-machine-entry.patch new file mode 100644 index 0000000000..1b9a32e30a --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/037-v5.20-0011-arm64-bcmbca-add-arch-bcmbca-machine-entry.patch @@ -0,0 +1,31 @@ +From fdcd652ce2b6b819f5c4dc3cead5215c84ee6933 Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 1 Jun 2022 15:56:50 -0700 +Subject: [PATCH] arm64: bcmbca: add arch bcmbca machine entry + +Add ARCH_BCMBCA config for Broadcom Broadband SoC chipsets + +Signed-off-by: William Zhang +Signed-off-by: Florian Fainelli +--- + arch/arm64/Kconfig.platforms | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/arch/arm64/Kconfig.platforms ++++ b/arch/arm64/Kconfig.platforms +@@ -59,6 +59,15 @@ config ARCH_BCM_IPROC + help + This enables support for Broadcom iProc based SoCs + ++config ARCH_BCMBCA ++ bool "Broadcom Broadband SoC" ++ help ++ Say Y if you intend to run the kernel on a Broadcom Broadband ARM-based ++ BCA chipset. ++ ++ This enables support for Broadcom BCA ARM-based broadband chipsets, ++ including the DSL, PON and Wireless family of chips. ++ + config ARCH_BERLIN + bool "Marvell Berlin SoC Family" + select DW_APB_ICTL diff --git a/target/linux/bcm4908/patches-5.4/130-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch similarity index 91% rename from target/linux/bcm4908/patches-5.4/130-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch rename to target/linux/bcm4908/patches-5.4/038-v6.1-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch index be1efcde86..437249f2cb 100644 --- a/target/linux/bcm4908/patches-5.4/130-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch @@ -1,5 +1,6 @@ +From 456b6dd1baadd2da10e28ffd1717b06d1fa17a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Mon, 18 Jul 2022 13:16:05 +0200 +Date: Mon, 18 Jul 2022 15:20:58 +0200 Subject: [PATCH] arm64: dts: broadcom: bcm4908: add remaining LED pins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -8,6 +9,8 @@ Content-Transfer-Encoding: 8bit Include all 32 pins. Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20220718132100.13277-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli --- .../boot/dts/broadcom/bcm4908/bcm4908.dtsi | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/target/linux/bcm4908/patches-5.4/130-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch similarity index 78% rename from target/linux/bcm4908/patches-5.4/130-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch rename to target/linux/bcm4908/patches-5.4/038-v6.1-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch index 0ba3745798..c890340893 100644 --- a/target/linux/bcm4908/patches-5.4/130-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch @@ -1,5 +1,6 @@ +From 7de56b1dc1149c702d4cc1e89ccc251bfb2bc246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Mon, 18 Jul 2022 13:17:57 +0200 +Date: Mon, 18 Jul 2022 15:20:59 +0200 Subject: [PATCH] arm64: dts: broadcom: bcm4908: add LEDs controller block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -9,6 +10,8 @@ BCM4908 includes LEDs controller that supports multiple brightness levels & hardware blinking. Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20220718132100.13277-2-zajec5@gmail.com +Signed-off-by: Florian Fainelli --- arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/linux/bcm4908/patches-5.4/130-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch similarity index 88% rename from target/linux/bcm4908/patches-5.4/130-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch rename to target/linux/bcm4908/patches-5.4/038-v6.1-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch index 796395a017..3888efb66b 100644 --- a/target/linux/bcm4908/patches-5.4/130-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch @@ -1,5 +1,6 @@ +From 3bcae3396e986b4ab97a69e8de517e32f9691a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Mon, 18 Jul 2022 13:21:54 +0200 +Date: Mon, 18 Jul 2022 15:21:00 +0200 Subject: [PATCH] arm64: dts: broadcom: bcm4908: add Asus GT-AC5300 LEDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -8,6 +9,8 @@ Content-Transfer-Encoding: 8bit There are 5 software-controllable LEDs on PCB. Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20220718132100.13277-3-zajec5@gmail.com +Signed-off-by: Florian Fainelli --- .../bcm4908/bcm4908-asus-gt-ac5300.dts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/target/linux/bcm4908/patches-5.4/038-v6.1-0004-arm64-dts-bcmbca-update-BCM4908-board-dts-files.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0004-arm64-dts-bcmbca-update-BCM4908-board-dts-files.patch new file mode 100644 index 0000000000..d4b7a983de --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0004-arm64-dts-bcmbca-update-BCM4908-board-dts-files.patch @@ -0,0 +1,66 @@ +From 4fdcbde682291fba2c3f45a41decd656d92a314f Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 3 Aug 2022 10:54:49 -0700 +Subject: [PATCH] arm64: dts: bcmbca: update BCM4908 board dts files +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Append "brcm,bcmbca" to compatible strings based on the new bcmbca +binding rule for BCM4908 family based boards. + +Signed-off-by: William Zhang +Acked-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20220803175455.47638-4-william.zhang@broadcom.com +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts | 2 +- + .../dts/broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1.dts | 2 +- + arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts | 2 +- + .../arm64/boot/dts/broadcom/bcm4908/bcm4908-netgear-raxe500.dts | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts ++++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts +@@ -7,7 +7,7 @@ + #include "bcm4906.dtsi" + + / { +- compatible = "netgear,r8000p", "brcm,bcm4906", "brcm,bcm4908"; ++ compatible = "netgear,r8000p", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; + model = "Netgear R8000P"; + + memory@0 { +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1.dts ++++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1.dts +@@ -7,7 +7,7 @@ + #include "bcm4906.dtsi" + + / { +- compatible = "tplink,archer-c2300-v1", "brcm,bcm4906", "brcm,bcm4908"; ++ compatible = "tplink,archer-c2300-v1", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; + model = "TP-Link Archer C2300 V1"; + + memory@0 { +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts ++++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts +@@ -7,7 +7,7 @@ + #include "bcm4908.dtsi" + + / { +- compatible = "asus,gt-ac5300", "brcm,bcm4908"; ++ compatible = "asus,gt-ac5300", "brcm,bcm4908", "brcm,bcmbca"; + model = "Asus GT-AC5300"; + + memory@0 { +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-netgear-raxe500.dts ++++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-netgear-raxe500.dts +@@ -3,7 +3,7 @@ + #include "bcm4908.dtsi" + + / { +- compatible = "netgear,raxe500", "brcm,bcm4908"; ++ compatible = "netgear,raxe500", "brcm,bcm4908", "brcm,bcmbca"; + model = "Netgear RAXE500"; + + memory@0 { diff --git a/target/linux/bcm4908/patches-5.4/038-v6.1-0005-arm64-dts-Move-BCM4908-dts-to-bcmbca-folder.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0005-arm64-dts-Move-BCM4908-dts-to-bcmbca-folder.patch new file mode 100644 index 0000000000..8363b2984c --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0005-arm64-dts-Move-BCM4908-dts-to-bcmbca-folder.patch @@ -0,0 +1,2491 @@ +From ded8f22945899f4e87dd6d952bbc4abce6e64b7e Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 3 Aug 2022 10:54:50 -0700 +Subject: [PATCH] arm64: dts: Move BCM4908 dts to bcmbca folder + +As part of ARCH_BCM4908 to ARCH_BCMBCA migration, move the BCM4908 dts +files to bcmbca folder and use CONFIG_ARCH_BCMBCA to build all the +BCM4908 board dts. Delete bcm4908 folder and its makefile as well. + +Signed-off-by: William Zhang +Link: https://lore.kernel.org/r/20220803175455.47638-5-william.zhang@broadcom.com +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/Makefile | 1 - + arch/arm64/boot/dts/broadcom/bcm4908/Makefile | 5 ----- + arch/arm64/boot/dts/broadcom/bcmbca/Makefile | 4 ++++ + .../broadcom/{bcm4908 => bcmbca}/bcm4906-netgear-r8000p.dts | 0 + .../{bcm4908 => bcmbca}/bcm4906-tplink-archer-c2300-v1.dts | 0 + .../arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4906.dtsi | 0 + .../broadcom/{bcm4908 => bcmbca}/bcm4908-asus-gt-ac5300.dts | 0 + .../broadcom/{bcm4908 => bcmbca}/bcm4908-netgear-raxe500.dts | 0 + .../arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4908.dtsi | 0 + 9 files changed, 4 insertions(+), 6 deletions(-) + delete mode 100644 arch/arm64/boot/dts/broadcom/bcm4908/Makefile + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4906-netgear-r8000p.dts (100%) + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4906-tplink-archer-c2300-v1.dts (100%) + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4906.dtsi (100%) + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4908-asus-gt-ac5300.dts (100%) + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4908-netgear-raxe500.dts (100%) + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4908.dtsi (100%) + +--- a/arch/arm64/boot/dts/broadcom/Makefile ++++ b/arch/arm64/boot/dts/broadcom/Makefile +@@ -4,7 +4,6 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rp + bcm2837-rpi-3-b-plus.dtb \ + bcm2837-rpi-cm3-io3.dtb + +-subdir-y += bcm4908 + subdir-y += bcmbca + subdir-y += northstar2 + subdir-y += stingray +--- a/arch/arm64/boot/dts/broadcom/bcm4908/Makefile ++++ /dev/null +@@ -1,5 +0,0 @@ +-# SPDX-License-Identifier: GPL-2.0 +-dtb-$(CONFIG_ARCH_BCM4908) += bcm4906-netgear-r8000p.dtb +-dtb-$(CONFIG_ARCH_BCM4908) += bcm4906-tplink-archer-c2300-v1.dtb +-dtb-$(CONFIG_ARCH_BCM4908) += bcm4908-asus-gt-ac5300.dtb +-dtb-$(CONFIG_ARCH_BCM4908) += bcm4908-netgear-raxe500.dtb +--- a/arch/arm64/boot/dts/broadcom/bcmbca/Makefile ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile +@@ -1,5 +1,9 @@ + # SPDX-License-Identifier: GPL-2.0 + dtb-$(CONFIG_ARCH_BCMBCA) += \ ++ bcm4906-netgear-r8000p.dtb \ ++ bcm4906-tplink-archer-c2300-v1.dtb \ ++ bcm4908-asus-gt-ac5300.dtb \ ++ bcm4908-netgear-raxe500.dtb \ + bcm4912-asus-gt-ax6000.dtb \ + bcm94912.dtb \ + bcm963158.dtb \ +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts ++++ /dev/null +@@ -1,157 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include +-#include +-#include +- +-#include "bcm4906.dtsi" +- +-/ { +- compatible = "netgear,r8000p", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; +- model = "Netgear R8000P"; +- +- memory@0 { +- device_type = "memory"; +- reg = <0x00 0x00 0x00 0x20000000>; +- }; +- +- leds { +- compatible = "gpio-leds"; +- +- led-power-white { +- function = LED_FUNCTION_POWER; +- color = ; +- gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; +- }; +- +- led-power-amber { +- function = LED_FUNCTION_POWER; +- color = ; +- gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; +- }; +- +- led-wps { +- function = LED_FUNCTION_WPS; +- color = ; +- gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; +- }; +- +- led-2ghz { +- function = "2ghz"; +- color = ; +- gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; +- }; +- +- led-5ghz-1 { +- function = "5ghz-1"; +- color = ; +- gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; +- }; +- +- led-5ghz-2 { +- function = "5ghz-2"; +- color = ; +- gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; +- }; +- +- led-usb2 { +- function = "usb2"; +- color = ; +- gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; +- }; +- +- led-usb3 { +- function = "usb3"; +- color = ; +- gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; +- }; +- +- led-wifi { +- function = "wifi"; +- color = ; +- gpios = <&gpio0 56 GPIO_ACTIVE_LOW>; +- }; +- }; +-}; +- +-&enet { +- nvmem-cells = <&base_mac_addr>; +- nvmem-cell-names = "mac-address"; +-}; +- +-&usb_phy { +- brcm,ioc = <1>; +- status = "okay"; +-}; +- +-&ehci { +- status = "okay"; +-}; +- +-&ohci { +- status = "okay"; +-}; +- +-&xhci { +- status = "okay"; +-}; +- +-&ports { +- port@0 { +- label = "lan4"; +- }; +- +- port@1 { +- label = "lan3"; +- }; +- +- port@2 { +- label = "lan2"; +- }; +- +- port@3 { +- label = "lan1"; +- }; +- +- port@7 { +- reg = <7>; +- phy-mode = "internal"; +- phy-handle = <&phy12>; +- label = "wan"; +- }; +-}; +- +-&nandcs { +- nand-ecc-strength = <4>; +- nand-ecc-step-size = <512>; +- nand-on-flash-bbt; +- +- #address-cells = <1>; +- #size-cells = <0>; +- +- partitions { +- compatible = "fixed-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; +- +- partition@0 { +- compatible = "nvmem-cells"; +- label = "cferom"; +- reg = <0x0 0x100000>; +- +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0 0x0 0x100000>; +- +- base_mac_addr: mac@106a0 { +- reg = <0x106a0 0x6>; +- }; +- }; +- +- partition@100000 { +- compatible = "brcm,bcm4908-firmware"; +- label = "firmware"; +- reg = <0x100000 0x4400000>; +- }; +- }; +-}; +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1.dts ++++ /dev/null +@@ -1,182 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include +-#include +-#include +- +-#include "bcm4906.dtsi" +- +-/ { +- compatible = "tplink,archer-c2300-v1", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; +- model = "TP-Link Archer C2300 V1"; +- +- memory@0 { +- device_type = "memory"; +- reg = <0x00 0x00 0x00 0x20000000>; +- }; +- +- leds { +- compatible = "gpio-leds"; +- +- led-power { +- function = LED_FUNCTION_POWER; +- color = ; +- gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; +- }; +- +- led-2ghz { +- function = "2ghz"; +- color = ; +- gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; +- }; +- +- led-5ghz { +- function = "5ghz"; +- color = ; +- gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; +- }; +- +- led-wan-amber { +- function = LED_FUNCTION_WAN; +- color = ; +- gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; +- }; +- +- led-wan-blue { +- function = LED_FUNCTION_WAN; +- color = ; +- gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; +- }; +- +- led-lan { +- function = LED_FUNCTION_LAN; +- color = ; +- gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; +- }; +- +- led-wps { +- function = LED_FUNCTION_WPS; +- color = ; +- gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; +- }; +- +- led-usb2 { +- function = "usb2"; +- color = ; +- gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; +- }; +- +- led-usb3 { +- function = "usbd3"; +- color = ; +- gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; +- }; +- +- led-brightness { +- function = LED_FUNCTION_BACKLIGHT; +- color = ; +- gpios = <&gpio0 19 GPIO_ACTIVE_LOW>; +- }; +- }; +- +- gpio-keys-polled { +- compatible = "gpio-keys-polled"; +- poll-interval = <100>; +- +- key-brightness { +- label = "LEDs"; +- linux,code = ; +- gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; +- }; +- +- key-wps { +- label = "WPS"; +- linux,code = ; +- gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; +- }; +- +- key-wifi { +- label = "WiFi"; +- linux,code = ; +- gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; +- }; +- +- key-restart { +- label = "Reset"; +- linux,code = ; +- gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; +- }; +- }; +-}; +- +-&usb_phy { +- brcm,ioc = <1>; +- status = "okay"; +-}; +- +-&ehci { +- status = "okay"; +-}; +- +-&ohci { +- status = "okay"; +-}; +- +-&xhci { +- status = "okay"; +-}; +- +-&ports { +- port@0 { +- label = "lan4"; +- }; +- +- port@1 { +- label = "lan3"; +- }; +- +- port@2 { +- label = "lan2"; +- }; +- +- port@3 { +- label = "lan1"; +- }; +- +- port@7 { +- reg = <7>; +- phy-mode = "internal"; +- phy-handle = <&phy12>; +- label = "wan"; +- }; +-}; +- +-&nandcs { +- nand-ecc-strength = <4>; +- nand-ecc-step-size = <512>; +- nand-on-flash-bbt; +- +- #address-cells = <1>; +- #size-cells = <0>; +- +- partitions { +- compatible = "brcm,bcm4908-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; +- +- partition@0 { +- label = "cferom"; +- reg = <0x0 0x100000>; +- }; +- +- partition@100000 { +- compatible = "brcm,bcm4908-firmware"; +- reg = <0x100000 0x3900000>; +- }; +- +- partition@5800000 { +- compatible = "brcm,bcm4908-firmware"; +- reg = <0x3a00000 0x3900000>; +- }; +- }; +-}; +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi ++++ /dev/null +@@ -1,26 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include "bcm4908.dtsi" +- +-/ { +- cpus { +- /delete-node/ cpu@2; +- +- /delete-node/ cpu@3; +- }; +- +- timer { +- compatible = "arm,armv8-timer"; +- interrupts = , +- , +- , +- ; +- }; +- +- pmu { +- compatible = "arm,cortex-a53-pmu"; +- interrupts = , +- ; +- interrupt-affinity = <&cpu0>, <&cpu1>; +- }; +-}; +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts ++++ /dev/null +@@ -1,207 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include +-#include +-#include +- +-#include "bcm4908.dtsi" +- +-/ { +- compatible = "asus,gt-ac5300", "brcm,bcm4908", "brcm,bcmbca"; +- model = "Asus GT-AC5300"; +- +- memory@0 { +- device_type = "memory"; +- reg = <0x00 0x00 0x00 0x40000000>; +- }; +- +- gpio-keys-polled { +- compatible = "gpio-keys-polled"; +- poll-interval = <100>; +- +- key-wifi { +- label = "WiFi"; +- linux,code = ; +- gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; +- }; +- +- key-wps { +- label = "WPS"; +- linux,code = ; +- gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; +- }; +- +- key-restart { +- label = "Reset"; +- linux,code = ; +- gpios = <&gpio0 30 GPIO_ACTIVE_LOW>; +- }; +- +- key-brightness { +- label = "LEDs"; +- linux,code = ; +- gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; +- }; +- }; +-}; +- +-&enet { +- nvmem-cells = <&base_mac_addr>; +- nvmem-cell-names = "mac-address"; +-}; +- +-&usb_phy { +- brcm,ioc = <1>; +- status = "okay"; +-}; +- +-&ehci { +- status = "okay"; +-}; +- +-&ohci { +- status = "okay"; +-}; +- +-&xhci { +- status = "okay"; +-}; +- +-&ports { +- port@0 { +- label = "lan2"; +- }; +- +- port@1 { +- label = "lan1"; +- }; +- +- port@2 { +- label = "lan6"; +- }; +- +- port@3 { +- label = "lan5"; +- }; +- +- /* External BCM53134S switch */ +- port@7 { +- label = "sw"; +- reg = <7>; +- phy-mode = "rgmii"; +- +- fixed-link { +- speed = <1000>; +- full-duplex; +- }; +- }; +-}; +- +-&mdio { +- /* lan8 */ +- ethernet-phy@0 { +- reg = <0>; +- }; +- +- /* lan7 */ +- ethernet-phy@1 { +- reg = <1>; +- }; +- +- /* lan4 */ +- ethernet-phy@2 { +- reg = <2>; +- }; +- +- /* lan3 */ +- ethernet-phy@3 { +- reg = <3>; +- }; +-}; +- +-&leds { +- led-power@11 { +- reg = <0x11>; +- function = LED_FUNCTION_POWER; +- color = ; +- default-state = "on"; +- active-low; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_led_17_a>; +- }; +- +- led-wan-red@12 { +- reg = <0x12>; +- function = LED_FUNCTION_WAN; +- color = ; +- active-low; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_led_18_a>; +- }; +- +- led-wps@14 { +- reg = <0x14>; +- function = LED_FUNCTION_WPS; +- color = ; +- active-low; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_led_20_a>; +- }; +- +- led-wan-white@15 { +- reg = <0x15>; +- function = LED_FUNCTION_WAN; +- color = ; +- active-low; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_led_21_a>; +- }; +- +- led-lan@19 { +- reg = <0x19>; +- function = LED_FUNCTION_LAN; +- color = ; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_led_25_a>; +- }; +-}; +- +-&nandcs { +- nand-ecc-strength = <4>; +- nand-ecc-step-size = <512>; +- nand-on-flash-bbt; +- brcm,nand-has-wp; +- +- #address-cells = <1>; +- #size-cells = <0>; +- +- partitions { +- compatible = "brcm,bcm4908-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; +- +- partition@0 { +- compatible = "nvmem-cells"; +- label = "cferom"; +- reg = <0x0 0x100000>; +- +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0 0x0 0x100000>; +- +- base_mac_addr: mac@106a0 { +- reg = <0x106a0 0x6>; +- }; +- }; +- +- partition@100000 { +- compatible = "brcm,bcm4908-firmware"; +- reg = <0x100000 0x5700000>; +- }; +- +- partition@5800000 { +- compatible = "brcm,bcm4908-firmware"; +- reg = <0x5800000 0x5700000>; +- }; +- }; +-}; +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-netgear-raxe500.dts ++++ /dev/null +@@ -1,50 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include "bcm4908.dtsi" +- +-/ { +- compatible = "netgear,raxe500", "brcm,bcm4908", "brcm,bcmbca"; +- model = "Netgear RAXE500"; +- +- memory@0 { +- device_type = "memory"; +- reg = <0x00 0x00 0x00 0x40000000>; +- }; +-}; +- +-&ehci { +- status = "okay"; +-}; +- +-&ohci { +- status = "okay"; +-}; +- +-&xhci { +- status = "okay"; +-}; +- +-&ports { +- port@0 { +- label = "lan4"; +- }; +- +- port@1 { +- label = "lan3"; +- }; +- +- port@2 { +- label = "lan2"; +- }; +- +- port@3 { +- label = "lan1"; +- }; +- +- port@7 { +- reg = <7>; +- phy-mode = "internal"; +- phy-handle = <&phy12>; +- label = "wan"; +- }; +-}; +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi ++++ /dev/null +@@ -1,575 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include +-#include +-#include +-#include +- +-/dts-v1/; +- +-/ { +- interrupt-parent = <&gic>; +- +- #address-cells = <2>; +- #size-cells = <2>; +- +- aliases { +- serial0 = &uart0; +- }; +- +- chosen { +- stdout-path = "serial0:115200n8"; +- }; +- +- cpus { +- #address-cells = <1>; +- #size-cells = <0>; +- +- cpu0: cpu@0 { +- device_type = "cpu"; +- compatible = "brcm,brahma-b53"; +- reg = <0x0>; +- enable-method = "spin-table"; +- cpu-release-addr = <0x0 0xfff8>; +- next-level-cache = <&l2>; +- }; +- +- cpu1: cpu@1 { +- device_type = "cpu"; +- compatible = "brcm,brahma-b53"; +- reg = <0x1>; +- enable-method = "spin-table"; +- cpu-release-addr = <0x0 0xfff8>; +- next-level-cache = <&l2>; +- }; +- +- cpu2: cpu@2 { +- device_type = "cpu"; +- compatible = "brcm,brahma-b53"; +- reg = <0x2>; +- enable-method = "spin-table"; +- cpu-release-addr = <0x0 0xfff8>; +- next-level-cache = <&l2>; +- }; +- +- cpu3: cpu@3 { +- device_type = "cpu"; +- compatible = "brcm,brahma-b53"; +- reg = <0x3>; +- enable-method = "spin-table"; +- cpu-release-addr = <0x0 0xfff8>; +- next-level-cache = <&l2>; +- }; +- +- l2: l2-cache0 { +- compatible = "cache"; +- }; +- }; +- +- axi@81000000 { +- compatible = "simple-bus"; +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0x00 0x00 0x81000000 0x4000>; +- +- gic: interrupt-controller@1000 { +- compatible = "arm,gic-400"; +- #interrupt-cells = <3>; +- #address-cells = <0>; +- interrupt-controller; +- reg = <0x1000 0x1000>, +- <0x2000 0x2000>; +- }; +- }; +- +- timer { +- compatible = "arm,armv8-timer"; +- interrupts = , +- , +- , +- ; +- }; +- +- pmu { +- compatible = "arm,cortex-a53-pmu"; +- interrupts = , +- , +- , +- ; +- interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>; +- }; +- +- clocks { +- periph_clk: periph_clk { +- compatible = "fixed-clock"; +- #clock-cells = <0>; +- clock-frequency = <50000000>; +- clock-output-names = "periph"; +- }; +- }; +- +- soc { +- compatible = "simple-bus"; +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0x00 0x00 0x80000000 0x281000>; +- +- enet: ethernet@2000 { +- compatible = "brcm,bcm4908-enet"; +- reg = <0x2000 0x1000>; +- +- interrupts = , +- ; +- interrupt-names = "rx", "tx"; +- }; +- +- usb_phy: usb-phy@c200 { +- compatible = "brcm,bcm4908-usb-phy"; +- reg = <0xc200 0x100>; +- reg-names = "ctrl"; +- power-domains = <&pmb BCM_PMB_HOST_USB>; +- dr_mode = "host"; +- brcm,has-xhci; +- brcm,has-eohci; +- #phy-cells = <1>; +- status = "disabled"; +- }; +- +- ehci: usb@c300 { +- compatible = "generic-ehci"; +- reg = <0xc300 0x100>; +- interrupts = ; +- phys = <&usb_phy PHY_TYPE_USB2>; +- status = "disabled"; +- }; +- +- ohci: usb@c400 { +- compatible = "generic-ohci"; +- reg = <0xc400 0x100>; +- interrupts = ; +- phys = <&usb_phy PHY_TYPE_USB2>; +- status = "disabled"; +- }; +- +- xhci: usb@d000 { +- compatible = "generic-xhci"; +- reg = <0xd000 0x8c8>; +- interrupts = ; +- phys = <&usb_phy PHY_TYPE_USB3>; +- status = "disabled"; +- }; +- +- bus@80000 { +- compatible = "simple-bus"; +- #size-cells = <1>; +- #address-cells = <1>; +- ranges = <0 0x80000 0x50000>; +- +- ethernet-switch@0 { +- compatible = "brcm,bcm4908-switch"; +- reg = <0x0 0x40000>, +- <0x40000 0x110>, +- <0x40340 0x30>, +- <0x40380 0x30>, +- <0x40600 0x34>, +- <0x40800 0x208>; +- reg-names = "core", "reg", "intrl2_0", +- "intrl2_1", "fcb", "acb"; +- interrupts = , +- ; +- brcm,num-gphy = <5>; +- brcm,num-rgmii-ports = <2>; +- +- #address-cells = <1>; +- #size-cells = <0>; +- +- ports: ports { +- #address-cells = <1>; +- #size-cells = <0>; +- +- port@0 { +- reg = <0>; +- phy-mode = "internal"; +- phy-handle = <&phy8>; +- }; +- +- port@1 { +- reg = <1>; +- phy-mode = "internal"; +- phy-handle = <&phy9>; +- }; +- +- port@2 { +- reg = <2>; +- phy-mode = "internal"; +- phy-handle = <&phy10>; +- }; +- +- port@3 { +- reg = <3>; +- phy-mode = "internal"; +- phy-handle = <&phy11>; +- }; +- +- port@8 { +- reg = <8>; +- phy-mode = "internal"; +- ethernet = <&enet>; +- +- fixed-link { +- speed = <1000>; +- full-duplex; +- }; +- }; +- }; +- }; +- +- mdio: mdio@405c0 { +- compatible = "brcm,unimac-mdio"; +- reg = <0x405c0 0x8>; +- reg-names = "mdio"; +- #size-cells = <0>; +- #address-cells = <1>; +- +- phy8: ethernet-phy@8 { +- reg = <8>; +- }; +- +- phy9: ethernet-phy@9 { +- reg = <9>; +- }; +- +- phy10: ethernet-phy@a { +- reg = <10>; +- }; +- +- phy11: ethernet-phy@b { +- reg = <11>; +- }; +- +- phy12: ethernet-phy@c { +- reg = <12>; +- }; +- }; +- }; +- +- procmon: syscon@280000 { +- compatible = "simple-bus"; +- reg = <0x280000 0x1000>; +- ranges; +- +- #address-cells = <1>; +- #size-cells = <1>; +- +- pmb: power-controller@2800c0 { +- compatible = "brcm,bcm4908-pmb"; +- reg = <0x2800c0 0x40>; +- #power-domain-cells = <1>; +- }; +- }; +- }; +- +- bus@ff800000 { +- compatible = "simple-bus"; +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0x00 0x00 0xff800000 0x3000>; +- +- twd: timer-mfd@400 { +- compatible = "brcm,bcm4908-twd", "simple-mfd", "syscon"; +- reg = <0x400 0x4c>; +- ranges = <0x0 0x400 0x4c>; +- +- #address-cells = <1>; +- #size-cells = <1>; +- +- watchdog@28 { +- compatible = "brcm,bcm6345-wdt"; +- reg = <0x28 0x8>; +- }; +- }; +- +- gpio0: gpio-controller@500 { +- compatible = "brcm,bcm6345-gpio"; +- reg-names = "dirout", "dat"; +- reg = <0x500 0x28>, <0x528 0x28>; +- +- #gpio-cells = <2>; +- gpio-controller; +- }; +- +- pinctrl@560 { +- compatible = "brcm,bcm4908-pinctrl"; +- reg = <0x560 0x10>; +- +- pins_led_0_a: led_0-a-pins { +- function = "led_0"; +- groups = "led_0_grp_a"; +- }; +- +- pins_led_1_a: led_1-a-pins { +- function = "led_1"; +- groups = "led_1_grp_a"; +- }; +- +- pins_led_2_a: led_2-a-pins { +- function = "led_2"; +- groups = "led_2_grp_a"; +- }; +- +- pins_led_3_a: led_3-a-pins { +- function = "led_3"; +- groups = "led_3_grp_a"; +- }; +- +- pins_led_4_a: led_4-a-pins { +- function = "led_4"; +- groups = "led_4_grp_a"; +- }; +- +- pins_led_5_a: led_5-a-pins { +- function = "led_5"; +- groups = "led_5_grp_a"; +- }; +- +- pins_led_6_a: led_6-a-pins { +- function = "led_6"; +- groups = "led_6_grp_a"; +- }; +- +- pins_led_7_a: led_7-a-pins { +- function = "led_7"; +- groups = "led_7_grp_a"; +- }; +- +- pins_led_8_a: led_8-a-pins { +- function = "led_8"; +- groups = "led_8_grp_a"; +- }; +- +- pins_led_9_a: led_9-a-pins { +- function = "led_9"; +- groups = "led_9_grp_a"; +- }; +- +- pins_led_10_a: led_10-a-pins { +- function = "led_10"; +- groups = "led_10_grp_a"; +- }; +- +- pins_led_11_a: led_11-a-pins { +- function = "led_11"; +- groups = "led_11_grp_a"; +- }; +- +- pins_led_12_a: led_12-a-pins { +- function = "led_12"; +- groups = "led_12_grp_a"; +- }; +- +- pins_led_13_a: led_13-a-pins { +- function = "led_13"; +- groups = "led_13_grp_a"; +- }; +- +- pins_led_14_a: led_14-a-pins { +- function = "led_14"; +- groups = "led_14_grp_a"; +- }; +- +- pins_led_15_a: led_15-a-pins { +- function = "led_15"; +- groups = "led_15_grp_a"; +- }; +- +- pins_led_16_a: led_16-a-pins { +- function = "led_16"; +- groups = "led_16_grp_a"; +- }; +- +- pins_led_17_a: led_17-a-pins { +- function = "led_17"; +- groups = "led_17_grp_a"; +- }; +- +- pins_led_18_a: led_18-a-pins { +- function = "led_18"; +- groups = "led_18_grp_a"; +- }; +- +- pins_led_19_a: led_19-a-pins { +- function = "led_19"; +- groups = "led_19_grp_a"; +- }; +- +- pins_led_20_a: led_20-a-pins { +- function = "led_20"; +- groups = "led_20_grp_a"; +- }; +- +- pins_led_21_a: led_21-a-pins { +- function = "led_21"; +- groups = "led_21_grp_a"; +- }; +- +- pins_led_22_a: led_22-a-pins { +- function = "led_22"; +- groups = "led_22_grp_a"; +- }; +- +- pins_led_23_a: led_23-a-pins { +- function = "led_23"; +- groups = "led_23_grp_a"; +- }; +- +- pins_led_24_a: led_24-a-pins { +- function = "led_24"; +- groups = "led_24_grp_a"; +- }; +- +- pins_led_25_a: led_25-a-pins { +- function = "led_25"; +- groups = "led_25_grp_a"; +- }; +- +- pins_led_26_a: led_26-a-pins { +- function = "led_26"; +- groups = "led_26_grp_a"; +- }; +- +- pins_led_27_a: led_27-a-pins { +- function = "led_27"; +- groups = "led_27_grp_a"; +- }; +- +- pins_led_28_a: led_28-a-pins { +- function = "led_28"; +- groups = "led_28_grp_a"; +- }; +- +- pins_led_29_a: led_29-a-pins { +- function = "led_29"; +- groups = "led_29_grp_a"; +- }; +- +- pins_led_30_a: led_30-a-pins { +- function = "led_30"; +- groups = "led_30_grp_a"; +- }; +- +- pins_led_31_a: led_31-a-pins { +- function = "led_31"; +- groups = "led_31_grp_a"; +- }; +- +- pins_hs_uart: hs_uart-pins { +- function = "hs_uart"; +- groups = "hs_uart_grp"; +- }; +- +- pins_i2c_a: i2c-a-pins { +- function = "i2c"; +- groups = "i2c_grp_a"; +- }; +- +- pins_i2c_b: i2c-b-pins { +- function = "i2c"; +- groups = "i2c_grp_b"; +- }; +- +- pins_i2s: i2s-pins { +- function = "i2s"; +- groups = "i2s_grp"; +- }; +- +- pins_nand_ctrl: nand_ctrl-pins { +- function = "nand_ctrl"; +- groups = "nand_ctrl_grp"; +- }; +- +- pins_nand_data: nand_data-pins { +- function = "nand_data"; +- groups = "nand_data_grp"; +- }; +- +- pins_emmc_ctrl: emmc_ctrl-pins { +- function = "emmc_ctrl"; +- groups = "emmc_ctrl_grp"; +- }; +- +- pins_usb0_pwr: usb0_pwr-pins { +- function = "usb0_pwr"; +- groups = "usb0_pwr_grp"; +- }; +- +- pins_usb1_pwr: usb1_pwr-pins { +- function = "usb1_pwr"; +- groups = "usb1_pwr_grp"; +- }; +- }; +- +- uart0: serial@640 { +- compatible = "brcm,bcm6345-uart"; +- reg = <0x640 0x18>; +- interrupts = ; +- clocks = <&periph_clk>; +- clock-names = "refclk"; +- status = "okay"; +- }; +- +- leds: leds@800 { +- compatible = "brcm,bcm4908-leds", "brcm,bcm63138-leds"; +- reg = <0x800 0xdc>; +- +- #address-cells = <1>; +- #size-cells = <0>; +- }; +- +- nand-controller@1800 { +- #address-cells = <1>; +- #size-cells = <0>; +- compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; +- reg = <0x1800 0x600>, <0x2000 0x10>; +- reg-names = "nand", "nand-int-base"; +- interrupts = ; +- interrupt-names = "nand"; +- status = "okay"; +- +- nandcs: nand@0 { +- compatible = "brcm,nandcs"; +- reg = <0>; +- }; +- }; +- +- i2c@2100 { +- compatible = "brcm,brcmper-i2c"; +- reg = <0x2100 0x58>; +- clock-frequency = <97500>; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_i2c_a>; +- status = "disabled"; +- }; +- +- misc@2600 { +- compatible = "brcm,misc", "simple-mfd"; +- reg = <0x2600 0xe4>; +- +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0x00 0x2600 0xe4>; +- +- reset-controller@2644 { +- compatible = "brcm,bcm4908-misc-pcie-reset"; +- reg = <0x44 0x04>; +- #reset-cells = <1>; +- }; +- }; +- }; +- +- reboot { +- compatible = "syscon-reboot"; +- regmap = <&twd>; +- offset = <0x34>; +- mask = <1>; +- }; +-}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts +@@ -0,0 +1,157 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include ++#include ++#include ++ ++#include "bcm4906.dtsi" ++ ++/ { ++ compatible = "netgear,r8000p", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; ++ model = "Netgear R8000P"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00 0x00 0x00 0x20000000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-power-white { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-power-amber { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-wps { ++ function = LED_FUNCTION_WPS; ++ color = ; ++ gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-2ghz { ++ function = "2ghz"; ++ color = ; ++ gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-5ghz-1 { ++ function = "5ghz-1"; ++ color = ; ++ gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-5ghz-2 { ++ function = "5ghz-2"; ++ color = ; ++ gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-usb2 { ++ function = "usb2"; ++ color = ; ++ gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-usb3 { ++ function = "usb3"; ++ color = ; ++ gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-wifi { ++ function = "wifi"; ++ color = ; ++ gpios = <&gpio0 56 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&enet { ++ nvmem-cells = <&base_mac_addr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&usb_phy { ++ brcm,ioc = <1>; ++ status = "okay"; ++}; ++ ++&ehci { ++ status = "okay"; ++}; ++ ++&ohci { ++ status = "okay"; ++}; ++ ++&xhci { ++ status = "okay"; ++}; ++ ++&ports { ++ port@0 { ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ label = "lan1"; ++ }; ++ ++ port@7 { ++ reg = <7>; ++ phy-mode = "internal"; ++ phy-handle = <&phy12>; ++ label = "wan"; ++ }; ++}; ++ ++&nandcs { ++ nand-ecc-strength = <4>; ++ nand-ecc-step-size = <512>; ++ nand-on-flash-bbt; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ compatible = "nvmem-cells"; ++ label = "cferom"; ++ reg = <0x0 0x100000>; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0 0x0 0x100000>; ++ ++ base_mac_addr: mac@106a0 { ++ reg = <0x106a0 0x6>; ++ }; ++ }; ++ ++ partition@100000 { ++ compatible = "brcm,bcm4908-firmware"; ++ label = "firmware"; ++ reg = <0x100000 0x4400000>; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1.dts +@@ -0,0 +1,182 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include ++#include ++#include ++ ++#include "bcm4906.dtsi" ++ ++/ { ++ compatible = "tplink,archer-c2300-v1", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; ++ model = "TP-Link Archer C2300 V1"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00 0x00 0x00 0x20000000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-power { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-2ghz { ++ function = "2ghz"; ++ color = ; ++ gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-5ghz { ++ function = "5ghz"; ++ color = ; ++ gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-wan-amber { ++ function = LED_FUNCTION_WAN; ++ color = ; ++ gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-wan-blue { ++ function = LED_FUNCTION_WAN; ++ color = ; ++ gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-lan { ++ function = LED_FUNCTION_LAN; ++ color = ; ++ gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-wps { ++ function = LED_FUNCTION_WPS; ++ color = ; ++ gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-usb2 { ++ function = "usb2"; ++ color = ; ++ gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-usb3 { ++ function = "usbd3"; ++ color = ; ++ gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-brightness { ++ function = LED_FUNCTION_BACKLIGHT; ++ color = ; ++ gpios = <&gpio0 19 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-keys-polled { ++ compatible = "gpio-keys-polled"; ++ poll-interval = <100>; ++ ++ key-brightness { ++ label = "LEDs"; ++ linux,code = ; ++ gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-wifi { ++ label = "WiFi"; ++ linux,code = ; ++ gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&usb_phy { ++ brcm,ioc = <1>; ++ status = "okay"; ++}; ++ ++&ehci { ++ status = "okay"; ++}; ++ ++&ohci { ++ status = "okay"; ++}; ++ ++&xhci { ++ status = "okay"; ++}; ++ ++&ports { ++ port@0 { ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ label = "lan1"; ++ }; ++ ++ port@7 { ++ reg = <7>; ++ phy-mode = "internal"; ++ phy-handle = <&phy12>; ++ label = "wan"; ++ }; ++}; ++ ++&nandcs { ++ nand-ecc-strength = <4>; ++ nand-ecc-step-size = <512>; ++ nand-on-flash-bbt; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ partitions { ++ compatible = "brcm,bcm4908-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "cferom"; ++ reg = <0x0 0x100000>; ++ }; ++ ++ partition@100000 { ++ compatible = "brcm,bcm4908-firmware"; ++ reg = <0x100000 0x3900000>; ++ }; ++ ++ partition@5800000 { ++ compatible = "brcm,bcm4908-firmware"; ++ reg = <0x3a00000 0x3900000>; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906.dtsi +@@ -0,0 +1,26 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include "bcm4908.dtsi" ++ ++/ { ++ cpus { ++ /delete-node/ cpu@2; ++ ++ /delete-node/ cpu@3; ++ }; ++ ++ timer { ++ compatible = "arm,armv8-timer"; ++ interrupts = , ++ , ++ , ++ ; ++ }; ++ ++ pmu { ++ compatible = "arm,cortex-a53-pmu"; ++ interrupts = , ++ ; ++ interrupt-affinity = <&cpu0>, <&cpu1>; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts +@@ -0,0 +1,207 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include ++#include ++#include ++ ++#include "bcm4908.dtsi" ++ ++/ { ++ compatible = "asus,gt-ac5300", "brcm,bcm4908", "brcm,bcmbca"; ++ model = "Asus GT-AC5300"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00 0x00 0x00 0x40000000>; ++ }; ++ ++ gpio-keys-polled { ++ compatible = "gpio-keys-polled"; ++ poll-interval = <100>; ++ ++ key-wifi { ++ label = "WiFi"; ++ linux,code = ; ++ gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&gpio0 30 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-brightness { ++ label = "LEDs"; ++ linux,code = ; ++ gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&enet { ++ nvmem-cells = <&base_mac_addr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&usb_phy { ++ brcm,ioc = <1>; ++ status = "okay"; ++}; ++ ++&ehci { ++ status = "okay"; ++}; ++ ++&ohci { ++ status = "okay"; ++}; ++ ++&xhci { ++ status = "okay"; ++}; ++ ++&ports { ++ port@0 { ++ label = "lan2"; ++ }; ++ ++ port@1 { ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ label = "lan6"; ++ }; ++ ++ port@3 { ++ label = "lan5"; ++ }; ++ ++ /* External BCM53134S switch */ ++ port@7 { ++ label = "sw"; ++ reg = <7>; ++ phy-mode = "rgmii"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++}; ++ ++&mdio { ++ /* lan8 */ ++ ethernet-phy@0 { ++ reg = <0>; ++ }; ++ ++ /* lan7 */ ++ ethernet-phy@1 { ++ reg = <1>; ++ }; ++ ++ /* lan4 */ ++ ethernet-phy@2 { ++ reg = <2>; ++ }; ++ ++ /* lan3 */ ++ ethernet-phy@3 { ++ reg = <3>; ++ }; ++}; ++ ++&leds { ++ led-power@11 { ++ reg = <0x11>; ++ function = LED_FUNCTION_POWER; ++ color = ; ++ default-state = "on"; ++ active-low; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_led_17_a>; ++ }; ++ ++ led-wan-red@12 { ++ reg = <0x12>; ++ function = LED_FUNCTION_WAN; ++ color = ; ++ active-low; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_led_18_a>; ++ }; ++ ++ led-wps@14 { ++ reg = <0x14>; ++ function = LED_FUNCTION_WPS; ++ color = ; ++ active-low; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_led_20_a>; ++ }; ++ ++ led-wan-white@15 { ++ reg = <0x15>; ++ function = LED_FUNCTION_WAN; ++ color = ; ++ active-low; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_led_21_a>; ++ }; ++ ++ led-lan@19 { ++ reg = <0x19>; ++ function = LED_FUNCTION_LAN; ++ color = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_led_25_a>; ++ }; ++}; ++ ++&nandcs { ++ nand-ecc-strength = <4>; ++ nand-ecc-step-size = <512>; ++ nand-on-flash-bbt; ++ brcm,nand-has-wp; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ partitions { ++ compatible = "brcm,bcm4908-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ compatible = "nvmem-cells"; ++ label = "cferom"; ++ reg = <0x0 0x100000>; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0 0x0 0x100000>; ++ ++ base_mac_addr: mac@106a0 { ++ reg = <0x106a0 0x6>; ++ }; ++ }; ++ ++ partition@100000 { ++ compatible = "brcm,bcm4908-firmware"; ++ reg = <0x100000 0x5700000>; ++ }; ++ ++ partition@5800000 { ++ compatible = "brcm,bcm4908-firmware"; ++ reg = <0x5800000 0x5700000>; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-netgear-raxe500.dts +@@ -0,0 +1,50 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include "bcm4908.dtsi" ++ ++/ { ++ compatible = "netgear,raxe500", "brcm,bcm4908", "brcm,bcmbca"; ++ model = "Netgear RAXE500"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00 0x00 0x00 0x40000000>; ++ }; ++}; ++ ++&ehci { ++ status = "okay"; ++}; ++ ++&ohci { ++ status = "okay"; ++}; ++ ++&xhci { ++ status = "okay"; ++}; ++ ++&ports { ++ port@0 { ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ label = "lan1"; ++ }; ++ ++ port@7 { ++ reg = <7>; ++ phy-mode = "internal"; ++ phy-handle = <&phy12>; ++ label = "wan"; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -0,0 +1,575 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include ++#include ++#include ++#include ++ ++/dts-v1/; ++ ++/ { ++ interrupt-parent = <&gic>; ++ ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ cpus { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ cpu0: cpu@0 { ++ device_type = "cpu"; ++ compatible = "brcm,brahma-b53"; ++ reg = <0x0>; ++ enable-method = "spin-table"; ++ cpu-release-addr = <0x0 0xfff8>; ++ next-level-cache = <&l2>; ++ }; ++ ++ cpu1: cpu@1 { ++ device_type = "cpu"; ++ compatible = "brcm,brahma-b53"; ++ reg = <0x1>; ++ enable-method = "spin-table"; ++ cpu-release-addr = <0x0 0xfff8>; ++ next-level-cache = <&l2>; ++ }; ++ ++ cpu2: cpu@2 { ++ device_type = "cpu"; ++ compatible = "brcm,brahma-b53"; ++ reg = <0x2>; ++ enable-method = "spin-table"; ++ cpu-release-addr = <0x0 0xfff8>; ++ next-level-cache = <&l2>; ++ }; ++ ++ cpu3: cpu@3 { ++ device_type = "cpu"; ++ compatible = "brcm,brahma-b53"; ++ reg = <0x3>; ++ enable-method = "spin-table"; ++ cpu-release-addr = <0x0 0xfff8>; ++ next-level-cache = <&l2>; ++ }; ++ ++ l2: l2-cache0 { ++ compatible = "cache"; ++ }; ++ }; ++ ++ axi@81000000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x00 0x00 0x81000000 0x4000>; ++ ++ gic: interrupt-controller@1000 { ++ compatible = "arm,gic-400"; ++ #interrupt-cells = <3>; ++ #address-cells = <0>; ++ interrupt-controller; ++ reg = <0x1000 0x1000>, ++ <0x2000 0x2000>; ++ }; ++ }; ++ ++ timer { ++ compatible = "arm,armv8-timer"; ++ interrupts = , ++ , ++ , ++ ; ++ }; ++ ++ pmu { ++ compatible = "arm,cortex-a53-pmu"; ++ interrupts = , ++ , ++ , ++ ; ++ interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>; ++ }; ++ ++ clocks { ++ periph_clk: periph_clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <50000000>; ++ clock-output-names = "periph"; ++ }; ++ }; ++ ++ soc { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x00 0x00 0x80000000 0x281000>; ++ ++ enet: ethernet@2000 { ++ compatible = "brcm,bcm4908-enet"; ++ reg = <0x2000 0x1000>; ++ ++ interrupts = , ++ ; ++ interrupt-names = "rx", "tx"; ++ }; ++ ++ usb_phy: usb-phy@c200 { ++ compatible = "brcm,bcm4908-usb-phy"; ++ reg = <0xc200 0x100>; ++ reg-names = "ctrl"; ++ power-domains = <&pmb BCM_PMB_HOST_USB>; ++ dr_mode = "host"; ++ brcm,has-xhci; ++ brcm,has-eohci; ++ #phy-cells = <1>; ++ status = "disabled"; ++ }; ++ ++ ehci: usb@c300 { ++ compatible = "generic-ehci"; ++ reg = <0xc300 0x100>; ++ interrupts = ; ++ phys = <&usb_phy PHY_TYPE_USB2>; ++ status = "disabled"; ++ }; ++ ++ ohci: usb@c400 { ++ compatible = "generic-ohci"; ++ reg = <0xc400 0x100>; ++ interrupts = ; ++ phys = <&usb_phy PHY_TYPE_USB2>; ++ status = "disabled"; ++ }; ++ ++ xhci: usb@d000 { ++ compatible = "generic-xhci"; ++ reg = <0xd000 0x8c8>; ++ interrupts = ; ++ phys = <&usb_phy PHY_TYPE_USB3>; ++ status = "disabled"; ++ }; ++ ++ bus@80000 { ++ compatible = "simple-bus"; ++ #size-cells = <1>; ++ #address-cells = <1>; ++ ranges = <0 0x80000 0x50000>; ++ ++ ethernet-switch@0 { ++ compatible = "brcm,bcm4908-switch"; ++ reg = <0x0 0x40000>, ++ <0x40000 0x110>, ++ <0x40340 0x30>, ++ <0x40380 0x30>, ++ <0x40600 0x34>, ++ <0x40800 0x208>; ++ reg-names = "core", "reg", "intrl2_0", ++ "intrl2_1", "fcb", "acb"; ++ interrupts = , ++ ; ++ brcm,num-gphy = <5>; ++ brcm,num-rgmii-ports = <2>; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ports: ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ phy-mode = "internal"; ++ phy-handle = <&phy8>; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ phy-mode = "internal"; ++ phy-handle = <&phy9>; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ phy-mode = "internal"; ++ phy-handle = <&phy10>; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ phy-mode = "internal"; ++ phy-handle = <&phy11>; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ phy-mode = "internal"; ++ ethernet = <&enet>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++ ++ mdio: mdio@405c0 { ++ compatible = "brcm,unimac-mdio"; ++ reg = <0x405c0 0x8>; ++ reg-names = "mdio"; ++ #size-cells = <0>; ++ #address-cells = <1>; ++ ++ phy8: ethernet-phy@8 { ++ reg = <8>; ++ }; ++ ++ phy9: ethernet-phy@9 { ++ reg = <9>; ++ }; ++ ++ phy10: ethernet-phy@a { ++ reg = <10>; ++ }; ++ ++ phy11: ethernet-phy@b { ++ reg = <11>; ++ }; ++ ++ phy12: ethernet-phy@c { ++ reg = <12>; ++ }; ++ }; ++ }; ++ ++ procmon: syscon@280000 { ++ compatible = "simple-bus"; ++ reg = <0x280000 0x1000>; ++ ranges; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ pmb: power-controller@2800c0 { ++ compatible = "brcm,bcm4908-pmb"; ++ reg = <0x2800c0 0x40>; ++ #power-domain-cells = <1>; ++ }; ++ }; ++ }; ++ ++ bus@ff800000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x00 0x00 0xff800000 0x3000>; ++ ++ twd: timer-mfd@400 { ++ compatible = "brcm,bcm4908-twd", "simple-mfd", "syscon"; ++ reg = <0x400 0x4c>; ++ ranges = <0x0 0x400 0x4c>; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ watchdog@28 { ++ compatible = "brcm,bcm6345-wdt"; ++ reg = <0x28 0x8>; ++ }; ++ }; ++ ++ gpio0: gpio-controller@500 { ++ compatible = "brcm,bcm6345-gpio"; ++ reg-names = "dirout", "dat"; ++ reg = <0x500 0x28>, <0x528 0x28>; ++ ++ #gpio-cells = <2>; ++ gpio-controller; ++ }; ++ ++ pinctrl@560 { ++ compatible = "brcm,bcm4908-pinctrl"; ++ reg = <0x560 0x10>; ++ ++ pins_led_0_a: led_0-a-pins { ++ function = "led_0"; ++ groups = "led_0_grp_a"; ++ }; ++ ++ pins_led_1_a: led_1-a-pins { ++ function = "led_1"; ++ groups = "led_1_grp_a"; ++ }; ++ ++ pins_led_2_a: led_2-a-pins { ++ function = "led_2"; ++ groups = "led_2_grp_a"; ++ }; ++ ++ pins_led_3_a: led_3-a-pins { ++ function = "led_3"; ++ groups = "led_3_grp_a"; ++ }; ++ ++ pins_led_4_a: led_4-a-pins { ++ function = "led_4"; ++ groups = "led_4_grp_a"; ++ }; ++ ++ pins_led_5_a: led_5-a-pins { ++ function = "led_5"; ++ groups = "led_5_grp_a"; ++ }; ++ ++ pins_led_6_a: led_6-a-pins { ++ function = "led_6"; ++ groups = "led_6_grp_a"; ++ }; ++ ++ pins_led_7_a: led_7-a-pins { ++ function = "led_7"; ++ groups = "led_7_grp_a"; ++ }; ++ ++ pins_led_8_a: led_8-a-pins { ++ function = "led_8"; ++ groups = "led_8_grp_a"; ++ }; ++ ++ pins_led_9_a: led_9-a-pins { ++ function = "led_9"; ++ groups = "led_9_grp_a"; ++ }; ++ ++ pins_led_10_a: led_10-a-pins { ++ function = "led_10"; ++ groups = "led_10_grp_a"; ++ }; ++ ++ pins_led_11_a: led_11-a-pins { ++ function = "led_11"; ++ groups = "led_11_grp_a"; ++ }; ++ ++ pins_led_12_a: led_12-a-pins { ++ function = "led_12"; ++ groups = "led_12_grp_a"; ++ }; ++ ++ pins_led_13_a: led_13-a-pins { ++ function = "led_13"; ++ groups = "led_13_grp_a"; ++ }; ++ ++ pins_led_14_a: led_14-a-pins { ++ function = "led_14"; ++ groups = "led_14_grp_a"; ++ }; ++ ++ pins_led_15_a: led_15-a-pins { ++ function = "led_15"; ++ groups = "led_15_grp_a"; ++ }; ++ ++ pins_led_16_a: led_16-a-pins { ++ function = "led_16"; ++ groups = "led_16_grp_a"; ++ }; ++ ++ pins_led_17_a: led_17-a-pins { ++ function = "led_17"; ++ groups = "led_17_grp_a"; ++ }; ++ ++ pins_led_18_a: led_18-a-pins { ++ function = "led_18"; ++ groups = "led_18_grp_a"; ++ }; ++ ++ pins_led_19_a: led_19-a-pins { ++ function = "led_19"; ++ groups = "led_19_grp_a"; ++ }; ++ ++ pins_led_20_a: led_20-a-pins { ++ function = "led_20"; ++ groups = "led_20_grp_a"; ++ }; ++ ++ pins_led_21_a: led_21-a-pins { ++ function = "led_21"; ++ groups = "led_21_grp_a"; ++ }; ++ ++ pins_led_22_a: led_22-a-pins { ++ function = "led_22"; ++ groups = "led_22_grp_a"; ++ }; ++ ++ pins_led_23_a: led_23-a-pins { ++ function = "led_23"; ++ groups = "led_23_grp_a"; ++ }; ++ ++ pins_led_24_a: led_24-a-pins { ++ function = "led_24"; ++ groups = "led_24_grp_a"; ++ }; ++ ++ pins_led_25_a: led_25-a-pins { ++ function = "led_25"; ++ groups = "led_25_grp_a"; ++ }; ++ ++ pins_led_26_a: led_26-a-pins { ++ function = "led_26"; ++ groups = "led_26_grp_a"; ++ }; ++ ++ pins_led_27_a: led_27-a-pins { ++ function = "led_27"; ++ groups = "led_27_grp_a"; ++ }; ++ ++ pins_led_28_a: led_28-a-pins { ++ function = "led_28"; ++ groups = "led_28_grp_a"; ++ }; ++ ++ pins_led_29_a: led_29-a-pins { ++ function = "led_29"; ++ groups = "led_29_grp_a"; ++ }; ++ ++ pins_led_30_a: led_30-a-pins { ++ function = "led_30"; ++ groups = "led_30_grp_a"; ++ }; ++ ++ pins_led_31_a: led_31-a-pins { ++ function = "led_31"; ++ groups = "led_31_grp_a"; ++ }; ++ ++ pins_hs_uart: hs_uart-pins { ++ function = "hs_uart"; ++ groups = "hs_uart_grp"; ++ }; ++ ++ pins_i2c_a: i2c-a-pins { ++ function = "i2c"; ++ groups = "i2c_grp_a"; ++ }; ++ ++ pins_i2c_b: i2c-b-pins { ++ function = "i2c"; ++ groups = "i2c_grp_b"; ++ }; ++ ++ pins_i2s: i2s-pins { ++ function = "i2s"; ++ groups = "i2s_grp"; ++ }; ++ ++ pins_nand_ctrl: nand_ctrl-pins { ++ function = "nand_ctrl"; ++ groups = "nand_ctrl_grp"; ++ }; ++ ++ pins_nand_data: nand_data-pins { ++ function = "nand_data"; ++ groups = "nand_data_grp"; ++ }; ++ ++ pins_emmc_ctrl: emmc_ctrl-pins { ++ function = "emmc_ctrl"; ++ groups = "emmc_ctrl_grp"; ++ }; ++ ++ pins_usb0_pwr: usb0_pwr-pins { ++ function = "usb0_pwr"; ++ groups = "usb0_pwr_grp"; ++ }; ++ ++ pins_usb1_pwr: usb1_pwr-pins { ++ function = "usb1_pwr"; ++ groups = "usb1_pwr_grp"; ++ }; ++ }; ++ ++ uart0: serial@640 { ++ compatible = "brcm,bcm6345-uart"; ++ reg = <0x640 0x18>; ++ interrupts = ; ++ clocks = <&periph_clk>; ++ clock-names = "refclk"; ++ status = "okay"; ++ }; ++ ++ leds: leds@800 { ++ compatible = "brcm,bcm4908-leds", "brcm,bcm63138-leds"; ++ reg = <0x800 0xdc>; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ ++ nand-controller@1800 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; ++ reg = <0x1800 0x600>, <0x2000 0x10>; ++ reg-names = "nand", "nand-int-base"; ++ interrupts = ; ++ interrupt-names = "nand"; ++ status = "okay"; ++ ++ nandcs: nand@0 { ++ compatible = "brcm,nandcs"; ++ reg = <0>; ++ }; ++ }; ++ ++ i2c@2100 { ++ compatible = "brcm,brcmper-i2c"; ++ reg = <0x2100 0x58>; ++ clock-frequency = <97500>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_i2c_a>; ++ status = "disabled"; ++ }; ++ ++ misc@2600 { ++ compatible = "brcm,misc", "simple-mfd"; ++ reg = <0x2600 0xe4>; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x00 0x2600 0xe4>; ++ ++ reset-controller@2644 { ++ compatible = "brcm,bcm4908-misc-pcie-reset"; ++ reg = <0x44 0x04>; ++ #reset-cells = <1>; ++ }; ++ }; ++ }; ++ ++ reboot { ++ compatible = "syscon-reboot"; ++ regmap = <&twd>; ++ offset = <0x34>; ++ mask = <1>; ++ }; ++}; diff --git a/target/linux/bcm4908/patches-5.4/038-v6.1-0006-arm64-dts-Add-BCM4908-generic-board-dts.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0006-arm64-dts-Add-BCM4908-generic-board-dts.patch new file mode 100644 index 0000000000..b19c5d33b4 --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0006-arm64-dts-Add-BCM4908-generic-board-dts.patch @@ -0,0 +1,62 @@ +From 72e0bdb6d7edb1785d58f2e8e7c80e1d2f93a319 Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 3 Aug 2022 10:54:51 -0700 +Subject: [PATCH] arm64: dts: Add BCM4908 generic board dts + +Add generic bare bone bcm94908.dts file to support any 4908 based +design. It supports cpu subsystem, memory and an uart console. This can +be useful for board bring-up and cpu subsystem and memory related kernel +test as well. + +Signed-off-by: William Zhang +Link: https://lore.kernel.org/r/20220803175455.47638-6-william.zhang@broadcom.com +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/Makefile | 1 + + .../boot/dts/broadcom/bcmbca/bcm94908.dts | 30 +++++++++++++++++++ + 2 files changed, 31 insertions(+) + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dts + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/Makefile ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile +@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_BCMBCA) += \ + bcm4906-tplink-archer-c2300-v1.dtb \ + bcm4908-asus-gt-ac5300.dtb \ + bcm4908-netgear-raxe500.dtb \ ++ bcm94908.dtb \ + bcm4912-asus-gt-ax6000.dtb \ + bcm94912.dtb \ + bcm963158.dtb \ +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dts +@@ -0,0 +1,30 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++/dts-v1/; ++ ++#include "bcm4908.dtsi" ++ ++/ { ++ model = "Broadcom BCM94908 Reference Board"; ++ compatible = "brcm,bcm94908", "brcm,bcm4908", "brcm,bcmbca"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0x08000000>; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm4908/patches-5.4/039-v6.2-0001-arm64-dts-broadcom-bcmbca-bcm4908-add-TWD-block-time.patch b/target/linux/bcm4908/patches-5.4/039-v6.2-0001-arm64-dts-broadcom-bcmbca-bcm4908-add-TWD-block-time.patch new file mode 100644 index 0000000000..a3f49ca440 --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/039-v6.2-0001-arm64-dts-broadcom-bcmbca-bcm4908-add-TWD-block-time.patch @@ -0,0 +1,31 @@ +From 68064196cffea33f090bd2e8d81cd5e20107ecf1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 3 Nov 2022 11:53:16 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add TWD block timer +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +BCM4908 TWD contains block with 4 timers. Add binding for it. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20221103105316.21294-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -283,6 +283,11 @@ + #address-cells = <1>; + #size-cells = <1>; + ++ timer@0 { ++ compatible = "brcm,bcm63138-timer"; ++ reg = <0x0 0x28>; ++ }; ++ + watchdog@28 { + compatible = "brcm,bcm6345-wdt"; + reg = <0x28 0x8>; diff --git a/target/linux/bcm4908/patches-5.4/039-v6.2-0002-arm64-dts-broadcom-bcmbca-bcm6858-add-TWD-block.patch b/target/linux/bcm4908/patches-5.4/039-v6.2-0002-arm64-dts-broadcom-bcmbca-bcm6858-add-TWD-block.patch new file mode 100644 index 0000000000..e8e81ae544 --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/039-v6.2-0002-arm64-dts-broadcom-bcmbca-bcm6858-add-TWD-block.patch @@ -0,0 +1,46 @@ +From 4f9fb09175e87a233787a2dee1e5dabb14deb022 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 3 Nov 2022 12:00:15 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm6858: add TWD block +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +BCM6858 contains TWD block with timers, watchdog, and reset subblocks. +Describe it. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20221103110015.21761-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../boot/dts/broadcom/bcmbca/bcm6858.dtsi | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi +@@ -109,6 +109,25 @@ + #size-cells = <1>; + ranges = <0x0 0x0 0xff800000 0x62000>; + ++ twd: timer-mfd@400 { ++ compatible = "brcm,bcm4908-twd", "simple-mfd", "syscon"; ++ reg = <0x400 0x4c>; ++ ranges = <0x0 0x400 0x4c>; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ timer@0 { ++ compatible = "brcm,bcm63138-timer"; ++ reg = <0x0 0x28>; ++ }; ++ ++ watchdog@28 { ++ compatible = "brcm,bcm6345-wdt"; ++ reg = <0x28 0x8>; ++ }; ++ }; ++ + uart0: serial@640 { + compatible = "brcm,bcm6345-uart"; + reg = <0x640 0x18>; diff --git a/target/linux/bcm4908/patches-5.4/070-v5.10-0001-net-dsa-b53-Use-dev_-err-info-instead-of-pr_.patch b/target/linux/bcm4908/patches-5.4/070-v5.10-0001-net-dsa-b53-Use-dev_-err-info-instead-of-pr_.patch index be09ab9e7d..83a9b9345f 100644 --- a/target/linux/bcm4908/patches-5.4/070-v5.10-0001-net-dsa-b53-Use-dev_-err-info-instead-of-pr_.patch +++ b/target/linux/bcm4908/patches-5.4/070-v5.10-0001-net-dsa-b53-Use-dev_-err-info-instead-of-pr_.patch @@ -26,7 +26,7 @@ Signed-off-by: David S. Miller #include #include #include -@@ -2475,8 +2473,9 @@ int b53_switch_detect(struct b53_device +@@ -2616,8 +2614,9 @@ int b53_switch_detect(struct b53_device dev->chip_id = id32; break; default: @@ -38,7 +38,7 @@ Signed-off-by: David S. Miller return -ENODEV; } } -@@ -2506,7 +2505,8 @@ int b53_switch_register(struct b53_devic +@@ -2647,7 +2646,8 @@ int b53_switch_register(struct b53_devic if (ret) return ret; diff --git a/target/linux/bcm4908/patches-5.4/070-v5.10-0002-net-dsa-b53-Print-err-message-on-SW_RST-timeout.patch b/target/linux/bcm4908/patches-5.4/070-v5.10-0002-net-dsa-b53-Print-err-message-on-SW_RST-timeout.patch index 2661b0918e..a83cec3950 100644 --- a/target/linux/bcm4908/patches-5.4/070-v5.10-0002-net-dsa-b53-Print-err-message-on-SW_RST-timeout.patch +++ b/target/linux/bcm4908/patches-5.4/070-v5.10-0002-net-dsa-b53-Print-err-message-on-SW_RST-timeout.patch @@ -15,7 +15,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c -@@ -755,8 +755,11 @@ static int b53_switch_reset(struct b53_d +@@ -783,8 +783,11 @@ static int b53_switch_reset(struct b53_d usleep_range(1000, 2000); } while (timeout-- > 0); diff --git a/target/linux/bcm4908/patches-5.4/071-v5.12-0001-net-dsa-bcm_sf2-support-BCM4908-s-integrated-switch.patch b/target/linux/bcm4908/patches-5.4/071-v5.12-0001-net-dsa-bcm_sf2-support-BCM4908-s-integrated-switch.patch index 766db3e641..5c698a342f 100644 --- a/target/linux/bcm4908/patches-5.4/071-v5.12-0001-net-dsa-bcm_sf2-support-BCM4908-s-integrated-switch.patch +++ b/target/linux/bcm4908/patches-5.4/071-v5.12-0001-net-dsa-bcm_sf2-support-BCM4908-s-integrated-switch.patch @@ -23,7 +23,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c -@@ -2271,6 +2271,22 @@ static const struct b53_chip_data b53_sw +@@ -2409,6 +2409,22 @@ static const struct b53_chip_data b53_sw .jumbo_pm_reg = B53_JUMBO_PORT_MASK, .jumbo_size_reg = B53_JUMBO_MAX_SIZE, }, @@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski offset = CORE_STS_OVERRIDE_IMP; else offset = CORE_STS_OVERRIDE_IMP2; -@@ -543,7 +544,8 @@ static void bcm_sf2_sw_mac_config(struct +@@ -563,7 +564,8 @@ static void bcm_sf2_sw_mac_config(struct if (port == core_readl(priv, CORE_IMP0_PRT_ID)) return; @@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski offset = CORE_STS_OVERRIDE_GMIIP_PORT(port); else offset = CORE_STS_OVERRIDE_GMIIP2_PORT(port); -@@ -990,6 +992,30 @@ struct bcm_sf2_of_data { +@@ -1013,6 +1015,30 @@ struct bcm_sf2_of_data { unsigned int num_cfp_rules; }; @@ -109,7 +109,7 @@ Signed-off-by: Jakub Kicinski /* Register offsets for the SWITCH_REG_* block */ static const u16 bcm_sf2_7445_reg_offsets[] = { [REG_SWITCH_CNTRL] = 0x00, -@@ -1038,6 +1064,9 @@ static const struct bcm_sf2_of_data bcm_ +@@ -1061,6 +1087,9 @@ static const struct bcm_sf2_of_data bcm_ }; static const struct of_device_id bcm_sf2_of_match[] = { diff --git a/target/linux/bcm4908/patches-5.4/075-v5.13-0001-net-dsa-bcm_sf2-store-PHY-interface-mode-in-port-str.patch b/target/linux/bcm4908/patches-5.4/075-v5.13-0001-net-dsa-bcm_sf2-store-PHY-interface-mode-in-port-str.patch index 69bf2d0d2f..a4bab32f95 100644 --- a/target/linux/bcm4908/patches-5.4/075-v5.13-0001-net-dsa-bcm_sf2-store-PHY-interface-mode-in-port-str.patch +++ b/target/linux/bcm4908/patches-5.4/075-v5.13-0001-net-dsa-bcm_sf2-store-PHY-interface-mode-in-port-str.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c -@@ -380,8 +380,9 @@ static void bcm_sf2_intr_disable(struct +@@ -400,8 +400,9 @@ static void bcm_sf2_intr_disable(struct static void bcm_sf2_identify_ports(struct bcm_sf2_priv *priv, struct device_node *dn) { @@ -29,7 +29,7 @@ Signed-off-by: David S. Miller unsigned int port_num; priv->moca_port = -1; -@@ -390,19 +391,26 @@ static void bcm_sf2_identify_ports(struc +@@ -410,19 +411,26 @@ static void bcm_sf2_identify_ports(struc if (of_property_read_u32(port, "reg", &port_num)) continue; @@ -62,7 +62,7 @@ Signed-off-by: David S. Miller if (of_property_read_bool(port, "brcm,use-bcm-hdr")) --- a/drivers/net/dsa/bcm_sf2.h +++ b/drivers/net/dsa/bcm_sf2.h -@@ -43,6 +43,7 @@ struct bcm_sf2_hw_params { +@@ -44,6 +44,7 @@ struct bcm_sf2_hw_params { #define BCM_SF2_REGS_NUM 6 struct bcm_sf2_port_status { diff --git a/target/linux/bcm4908/patches-5.4/075-v5.13-0002-net-dsa-bcm_sf2-setup-BCM4908-internal-crossbar.patch b/target/linux/bcm4908/patches-5.4/075-v5.13-0002-net-dsa-bcm_sf2-setup-BCM4908-internal-crossbar.patch index 09fb5dbd15..e13be23a65 100644 --- a/target/linux/bcm4908/patches-5.4/075-v5.13-0002-net-dsa-bcm_sf2-setup-BCM4908-internal-crossbar.patch +++ b/target/linux/bcm4908/patches-5.4/075-v5.13-0002-net-dsa-bcm_sf2-setup-BCM4908-internal-crossbar.patch @@ -37,7 +37,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c -@@ -369,6 +369,44 @@ static int bcm_sf2_sw_rst(struct bcm_sf2 +@@ -389,6 +389,44 @@ static int bcm_sf2_sw_rst(struct bcm_sf2 return 0; } @@ -82,7 +82,7 @@ Signed-off-by: David S. Miller static void bcm_sf2_intr_disable(struct bcm_sf2_priv *priv) { intrl2_0_mask_set(priv, 0xffffffff); -@@ -739,6 +777,8 @@ static int bcm_sf2_sw_resume(struct dsa_ +@@ -759,6 +797,8 @@ static int bcm_sf2_sw_resume(struct dsa_ return ret; } @@ -91,7 +91,7 @@ Signed-off-by: David S. Miller ret = bcm_sf2_cfp_resume(ds); if (ret) return ret; -@@ -1001,6 +1041,7 @@ struct bcm_sf2_of_data { +@@ -1024,6 +1064,7 @@ struct bcm_sf2_of_data { const u16 *reg_offsets; unsigned int core_reg_align; unsigned int num_cfp_rules; @@ -99,7 +99,7 @@ Signed-off-by: David S. Miller }; static const u16 bcm_sf2_4908_reg_offsets[] = { -@@ -1025,6 +1066,7 @@ static const struct bcm_sf2_of_data bcm_ +@@ -1048,6 +1089,7 @@ static const struct bcm_sf2_of_data bcm_ .core_reg_align = 0, .reg_offsets = bcm_sf2_4908_reg_offsets, .num_cfp_rules = 0, /* FIXME */ @@ -107,15 +107,15 @@ Signed-off-by: David S. Miller }; /* Register offsets for the SWITCH_REG_* block */ -@@ -1135,6 +1177,7 @@ static int bcm_sf2_sw_probe(struct platf +@@ -1158,6 +1200,7 @@ static int bcm_sf2_sw_probe(struct platf priv->reg_offsets = data->reg_offsets; priv->core_reg_align = data->core_reg_align; priv->num_cfp_rules = data->num_cfp_rules; + priv->num_crossbar_int_ports = data->num_crossbar_int_ports; - /* Auto-detection using standard registers will not work, so - * provide an indication of what kind of device we are for -@@ -1189,6 +1232,8 @@ static int bcm_sf2_sw_probe(struct platf + priv->rcdev = devm_reset_control_get_optional_exclusive(&pdev->dev, + "switch"); +@@ -1217,6 +1260,8 @@ static int bcm_sf2_sw_probe(struct platf return ret; } @@ -126,7 +126,7 @@ Signed-off-by: David S. Miller ret = bcm_sf2_mdio_register(ds); --- a/drivers/net/dsa/bcm_sf2.h +++ b/drivers/net/dsa/bcm_sf2.h -@@ -70,6 +70,7 @@ struct bcm_sf2_priv { +@@ -73,6 +73,7 @@ struct bcm_sf2_priv { const u16 *reg_offsets; unsigned int core_reg_align; unsigned int num_cfp_rules; diff --git a/target/linux/bcm4908/patches-5.4/075-v5.13-0003-net-dsa-bcm_sf2-Fill-in-BCM4908-CFP-entries.patch b/target/linux/bcm4908/patches-5.4/075-v5.13-0003-net-dsa-bcm_sf2-Fill-in-BCM4908-CFP-entries.patch index 8b5332cdda..da27963bf8 100644 --- a/target/linux/bcm4908/patches-5.4/075-v5.13-0003-net-dsa-bcm_sf2-Fill-in-BCM4908-CFP-entries.patch +++ b/target/linux/bcm4908/patches-5.4/075-v5.13-0003-net-dsa-bcm_sf2-Fill-in-BCM4908-CFP-entries.patch @@ -14,7 +14,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c -@@ -1065,7 +1065,7 @@ static const struct bcm_sf2_of_data bcm_ +@@ -1088,7 +1088,7 @@ static const struct bcm_sf2_of_data bcm_ .type = BCM4908_DEVICE_ID, .core_reg_align = 0, .reg_offsets = bcm_sf2_4908_reg_offsets, diff --git a/target/linux/bcm4908/patches-5.4/075-v5.13-0004-net-dsa-bcm_sf2-add-function-finding-RGMII-register.patch b/target/linux/bcm4908/patches-5.4/075-v5.13-0004-net-dsa-bcm_sf2-add-function-finding-RGMII-register.patch index c6b724215f..442e35ad98 100644 --- a/target/linux/bcm4908/patches-5.4/075-v5.13-0004-net-dsa-bcm_sf2-add-function-finding-RGMII-register.patch +++ b/target/linux/bcm4908/patches-5.4/075-v5.13-0004-net-dsa-bcm_sf2-add-function-finding-RGMII-register.patch @@ -57,7 +57,7 @@ Signed-off-by: David S. Miller static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port) { struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); -@@ -588,6 +613,7 @@ static void bcm_sf2_sw_mac_config(struct +@@ -608,6 +633,7 @@ static void bcm_sf2_sw_mac_config(struct { struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); u32 id_mode_dis = 0, port_mode; @@ -65,7 +65,7 @@ Signed-off-by: David S. Miller u32 reg, offset; if (port == core_readl(priv, CORE_IMP0_PRT_ID)) -@@ -617,10 +643,12 @@ static void bcm_sf2_sw_mac_config(struct +@@ -637,10 +663,12 @@ static void bcm_sf2_sw_mac_config(struct goto force_link; } @@ -79,7 +79,7 @@ Signed-off-by: David S. Miller reg &= ~ID_MODE_DIS; reg &= ~(PORT_MODE_MASK << PORT_MODE_SHIFT); reg &= ~(RX_PAUSE_EN | TX_PAUSE_EN); -@@ -635,7 +663,7 @@ static void bcm_sf2_sw_mac_config(struct +@@ -655,7 +683,7 @@ static void bcm_sf2_sw_mac_config(struct reg |= RX_PAUSE_EN; } @@ -88,7 +88,7 @@ Signed-off-by: David S. Miller force_link: /* Force link settings detected from the PHY */ -@@ -666,6 +694,7 @@ static void bcm_sf2_sw_mac_link_set(stru +@@ -686,6 +714,7 @@ static void bcm_sf2_sw_mac_link_set(stru phy_interface_t interface, bool link) { struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); @@ -96,7 +96,7 @@ Signed-off-by: David S. Miller u32 reg; if (!phy_interface_mode_is_rgmii(interface) && -@@ -673,13 +702,15 @@ static void bcm_sf2_sw_mac_link_set(stru +@@ -693,13 +722,15 @@ static void bcm_sf2_sw_mac_link_set(stru interface != PHY_INTERFACE_MODE_REVMII) return; diff --git a/target/linux/bcm4908/patches-5.4/075-v5.13-0005-net-dsa-bcm_sf2-fix-BCM4908-RGMII-reg-s.patch b/target/linux/bcm4908/patches-5.4/075-v5.13-0005-net-dsa-bcm_sf2-fix-BCM4908-RGMII-reg-s.patch index 81f3ff5d4d..1abec90243 100644 --- a/target/linux/bcm4908/patches-5.4/075-v5.13-0005-net-dsa-bcm_sf2-fix-BCM4908-RGMII-reg-s.patch +++ b/target/linux/bcm4908/patches-5.4/075-v5.13-0005-net-dsa-bcm_sf2-fix-BCM4908-RGMII-reg-s.patch @@ -33,7 +33,7 @@ Signed-off-by: David S. Miller break; default: switch (port) { -@@ -1084,9 +1089,7 @@ static const u16 bcm_sf2_4908_reg_offset +@@ -1107,9 +1112,7 @@ static const u16 bcm_sf2_4908_reg_offset [REG_PHY_REVISION] = 0x14, [REG_SPHY_CNTRL] = 0x24, [REG_CROSSBAR] = 0xc8, diff --git a/target/linux/bcm4908/patches-5.4/076-v5.17-net-dsa-bcm_sf2-refactor-LED-regs-access.patch b/target/linux/bcm4908/patches-5.4/076-v5.17-net-dsa-bcm_sf2-refactor-LED-regs-access.patch index 9f67fe71c1..00ea23005b 100644 --- a/target/linux/bcm4908/patches-5.4/076-v5.17-net-dsa-bcm_sf2-refactor-LED-regs-access.patch +++ b/target/linux/bcm4908/patches-5.4/076-v5.17-net-dsa-bcm_sf2-refactor-LED-regs-access.patch @@ -82,7 +82,7 @@ Signed-off-by: Jakub Kicinski } } -@@ -1090,9 +1127,14 @@ static const u16 bcm_sf2_4908_reg_offset +@@ -1113,9 +1150,14 @@ static const u16 bcm_sf2_4908_reg_offset [REG_SPHY_CNTRL] = 0x24, [REG_CROSSBAR] = 0xc8, [REG_RGMII_11_CNTRL] = 0x014c, @@ -102,7 +102,7 @@ Signed-off-by: Jakub Kicinski static const struct bcm_sf2_of_data bcm_sf2_4908_data = { --- a/drivers/net/dsa/bcm_sf2.h +++ b/drivers/net/dsa/bcm_sf2.h -@@ -203,6 +203,16 @@ SF2_IO_MACRO(acb); +@@ -206,6 +206,16 @@ SF2_IO_MACRO(acb); SWITCH_INTR_L2(0); SWITCH_INTR_L2(1); diff --git a/target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcm4908-limit-amount-of-GPIOs.patch b/target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch similarity index 71% rename from target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcm4908-limit-amount-of-GPIOs.patch rename to target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch index 93c89ffa30..bc0743c800 100644 --- a/target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcm4908-limit-amount-of-GPIOs.patch +++ b/target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch @@ -1,6 +1,6 @@ From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 15 Feb 2021 22:01:03 +0100 -Subject: [PATCH] arm64: dts: broadcom: bcm4908: limit amount of GPIOs +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: limit amount of GPIOs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -10,9 +10,9 @@ Linux driver can't handle more than 64 GPIOs Signed-off-by: Rafał Miłecki --- ---- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi -+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi -@@ -292,7 +292,7 @@ +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -297,7 +297,7 @@ gpio0: gpio-controller@500 { compatible = "brcm,bcm6345-gpio"; reg-names = "dirout", "dat"; diff --git a/target/linux/bcm4908/patches-5.4/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch b/target/linux/bcm4908/patches-5.4/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch index ea9089e7ed..39efb11d81 100644 --- a/target/linux/bcm4908/patches-5.4/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch +++ b/target/linux/bcm4908/patches-5.4/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch @@ -29,7 +29,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c -@@ -1368,10 +1368,14 @@ static int bcm_sf2_sw_probe(struct platf +@@ -1396,10 +1396,14 @@ static int bcm_sf2_sw_probe(struct platf rev = reg_readl(priv, REG_PHY_REVISION); priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK; diff --git a/target/linux/bcm4908/patches-5.4/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch b/target/linux/bcm4908/patches-5.4/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch index 2b860f4ed1..d18bfc0dea 100644 --- a/target/linux/bcm4908/patches-5.4/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch +++ b/target/linux/bcm4908/patches-5.4/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch @@ -15,7 +15,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c -@@ -1382,6 +1382,12 @@ static int bcm_sf2_sw_probe(struct platf +@@ -1410,6 +1410,12 @@ static int bcm_sf2_sw_probe(struct platf priv->hw_params.core_rev >> 8, priv->hw_params.core_rev & 0xff, priv->irq0, priv->irq1); diff --git a/target/linux/bcm53xx/base-files/etc/board.d/02_network b/target/linux/bcm53xx/base-files/etc/board.d/02_network index 317e8a5b7c..039b5fe95f 100755 --- a/target/linux/bcm53xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm53xx/base-files/etc/board.d/02_network @@ -31,6 +31,9 @@ bcm53xx_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5t@eth0" ;; + asus,rt-ac88u) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 extsw" "wan" + ;; linksys,panamera) ucidef_add_switch "switch1" \ "0:lan" "1:lan:7" "2:lan:4" "3:lan:8" "4:wan" "5t@eth0" diff --git a/target/linux/bcm53xx/base-files/etc/init.d/clear_partialboot b/target/linux/bcm53xx/base-files/etc/init.d/clear_partialboot deleted file mode 100755 index b3eddf4af0..0000000000 --- a/target/linux/bcm53xx/base-files/etc/init.d/clear_partialboot +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=97 -boot() { - . /lib/functions.sh - - case $(board_name) in - linksys,panamera) - # clear partialboots - nvram set partialboots=0 && nvram commit - ;; - esac -} diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index 9c3a7a9e6f..01a59a7fca 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -167,6 +167,14 @@ define Device/asus_rt-ac87u endef TARGET_DEVICES += asus_rt-ac87u +define Device/asus_rt-ac88u + $(call Device/asus) + DEVICE_MODEL := RT-AC88U + DEVICE_PACKAGES := $(BRCMFMAC_4366B1) $(BRCMFMAC_4366C0) $(USB3_PACKAGES) + ASUS_PRODUCTID := RT-AC88U +endef +TARGET_DEVICES += asus_rt-ac88u + define Device/asus_rt-n18u $(call Device/asus) DEVICE_MODEL := RT-N18U diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0007-ARM-dts-BCM5301X-Move-CRU-devices-to-the-CRU-node.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0007-ARM-dts-BCM5301X-Move-CRU-devices-to-the-CRU-node.patch new file mode 100644 index 0000000000..3c3db540d0 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0007-ARM-dts-BCM5301X-Move-CRU-devices-to-the-CRU-node.patch @@ -0,0 +1,85 @@ +From 776461b1795b4dc4084894cf53399044aafa1d21 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Wed, 11 Nov 2020 15:55:38 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: Move CRU devices to the CRU node +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Clocks and thermal blocks are part of the CRU ("Clock and Reset Unit" or +"Central Resource Unit"). + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm5301x.dtsi | 51 +++++++++++++++++---------------- + 1 file changed, 26 insertions(+), 25 deletions(-) + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -430,6 +430,26 @@ + #address-cells = <1>; + #size-cells = <1>; + ++ lcpll0: lcpll0@100 { ++ #clock-cells = <1>; ++ compatible = "brcm,nsp-lcpll0"; ++ reg = <0x100 0x14>; ++ clocks = <&osc>; ++ clock-output-names = "lcpll0", "pcie_phy", ++ "sdio", "ddr_phy"; ++ }; ++ ++ genpll: genpll@140 { ++ #clock-cells = <1>; ++ compatible = "brcm,nsp-genpll"; ++ reg = <0x140 0x24>; ++ clocks = <&osc>; ++ clock-output-names = "genpll", "phy", ++ "ethernetclk", ++ "usbclk", "iprocfast", ++ "sata1", "sata2"; ++ }; ++ + pinctrl: pin-controller@1c0 { + compatible = "brcm,bcm4708-pinmux"; + reg = <0x1c0 0x24>; +@@ -456,32 +476,13 @@ + function = "uart1"; + }; + }; +- }; +- }; + +- lcpll0: lcpll0@1800c100 { +- #clock-cells = <1>; +- compatible = "brcm,nsp-lcpll0"; +- reg = <0x1800c100 0x14>; +- clocks = <&osc>; +- clock-output-names = "lcpll0", "pcie_phy", "sdio", +- "ddr_phy"; +- }; +- +- genpll: genpll@1800c140 { +- #clock-cells = <1>; +- compatible = "brcm,nsp-genpll"; +- reg = <0x1800c140 0x24>; +- clocks = <&osc>; +- clock-output-names = "genpll", "phy", "ethernetclk", +- "usbclk", "iprocfast", "sata1", +- "sata2"; +- }; +- +- thermal: thermal@1800c2c0 { +- compatible = "brcm,ns-thermal"; +- reg = <0x1800c2c0 0x10>; +- #thermal-sensor-cells = <0>; ++ thermal: thermal@2c0 { ++ compatible = "brcm,ns-thermal"; ++ reg = <0x2c0 0x10>; ++ #thermal-sensor-cells = <0>; ++ }; ++ }; + }; + + srab: srab@18007000 { diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0010-ARM-dts-BCM5301X-Update-Ethernet-switch-node-name.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0010-ARM-dts-BCM5301X-Update-Ethernet-switch-node-name.patch index 00a5d08f0d..b3a774e340 100644 --- a/target/linux/bcm53xx/patches-5.4/034-v5.11-0010-ARM-dts-BCM5301X-Update-Ethernet-switch-node-name.patch +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0010-ARM-dts-BCM5301X-Update-Ethernet-switch-node-name.patch @@ -21,8 +21,8 @@ Signed-off-by: Florian Fainelli --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -484,7 +484,7 @@ - #thermal-sensor-cells = <0>; +@@ -485,7 +485,7 @@ + }; }; - srab: srab@18007000 { diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0011-ARM-dts-BCM5301X-Add-a-default-compatible-for-switch.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0011-ARM-dts-BCM5301X-Add-a-default-compatible-for-switch.patch index 044504796c..677e94f271 100644 --- a/target/linux/bcm53xx/patches-5.4/034-v5.11-0011-ARM-dts-BCM5301X-Add-a-default-compatible-for-switch.patch +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0011-ARM-dts-BCM5301X-Add-a-default-compatible-for-switch.patch @@ -71,7 +71,7 @@ Signed-off-by: Florian Fainelli +}; --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -485,7 +485,7 @@ +@@ -486,7 +486,7 @@ }; srab: ethernet-switch@18007000 { diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0012-ARM-dts-BCM5301X-Provide-defaults-ports-container-no.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0012-ARM-dts-BCM5301X-Provide-defaults-ports-container-no.patch index e05ce88304..6e4f5f7bb8 100644 --- a/target/linux/bcm53xx/patches-5.4/034-v5.11-0012-ARM-dts-BCM5301X-Provide-defaults-ports-container-no.patch +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0012-ARM-dts-BCM5301X-Provide-defaults-ports-container-no.patch @@ -155,7 +155,7 @@ Signed-off-by: Florian Fainelli label = "lan4"; --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -491,6 +491,10 @@ +@@ -492,6 +492,10 @@ status = "disabled"; /* ports are defined in board DTS */ diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0013-ARM-dts-NSP-Update-ethernet-switch-node-name.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0013-ARM-dts-NSP-Update-ethernet-switch-node-name.patch new file mode 100644 index 0000000000..3828bb57c4 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0013-ARM-dts-NSP-Update-ethernet-switch-node-name.patch @@ -0,0 +1,32 @@ +From fd66cd0d79cb836badecb91fdd19afd32afbb443 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 9 Nov 2020 12:02:08 -0800 +Subject: [PATCH 13/16] ARM: dts: NSP: Update ethernet switch node name + +Update the switch unit name from srab to ethernet-switch, allowing us +to fix warnings such as: + + CHECK arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dt.yaml + arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dt.yaml: + srab@18007000: $nodename:0: 'srab@18007000' does not match + '^(ethernet-)?switch(@.*)?$' + From schema: + Documentation/devicetree/bindings/net/dsa/b53.yaml + +Reviewed-by: Vladimir Oltean +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -383,7 +383,7 @@ + clock-names = "apb_pclk"; + }; + +- srab: srab@36000 { ++ srab: ethernet-switch@36000 { + compatible = "brcm,nsp-srab"; + reg = <0x36000 0x1000>, + <0x3f308 0x8>, diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0014-ARM-dts-NSP-Fix-Ethernet-switch-SGMII-register-name.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0014-ARM-dts-NSP-Fix-Ethernet-switch-SGMII-register-name.patch new file mode 100644 index 0000000000..e8313d89b2 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0014-ARM-dts-NSP-Fix-Ethernet-switch-SGMII-register-name.patch @@ -0,0 +1,26 @@ +From 8b0235d1deace8f1bd8cdd149d698fee3974fdf4 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 9 Nov 2020 12:06:15 -0800 +Subject: [PATCH 14/16] ARM: dts: NSP: Fix Ethernet switch SGMII register name + +The register name should be "sgmii_config", not "sgmii", this is not a +functional change since no code is currently looking for that register +by name (or at all). + +Reviewed-by: Vladimir Oltean +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -388,7 +388,7 @@ + reg = <0x36000 0x1000>, + <0x3f308 0x8>, + <0x3f410 0xc>; +- reg-names = "srab", "mux_config", "sgmii"; ++ reg-names = "srab", "mux_config", "sgmii_config"; + interrupts = , + , + , diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0015-ARM-dts-NSP-Add-a-SRAB-compatible-string-for-each-bo.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0015-ARM-dts-NSP-Add-a-SRAB-compatible-string-for-each-bo.patch new file mode 100644 index 0000000000..a0be53ac28 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0015-ARM-dts-NSP-Add-a-SRAB-compatible-string-for-each-bo.patch @@ -0,0 +1,77 @@ +From 42791b317db4cda36751f57bada27857849811d3 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 9 Nov 2020 17:41:32 -0800 +Subject: [PATCH 15/16] ARM: dts: NSP: Add a SRAB compatible string for each + board + +Provide a valid compatible string for the Ethernet switch node based on +the board including the switch. This allows us to have sane defaults and +silences the following warnings: + + arch/arm/boot/dts/bcm958522er.dt.yaml: + ethernet-switch@36000: compatible: 'oneOf' conditional failed, +one + must be fixed: + ['brcm,bcm5301x-srab'] is too short + 'brcm,bcm5325' was expected + 'brcm,bcm53115' was expected + 'brcm,bcm53125' was expected + 'brcm,bcm53128' was expected + 'brcm,bcm5365' was expected + 'brcm,bcm5395' was expected + 'brcm,bcm5389' was expected + 'brcm,bcm5397' was expected + 'brcm,bcm5398' was expected + 'brcm,bcm11360-srab' was expected + 'brcm,bcm5301x-srab' is not one of ['brcm,bcm53010-srab', + 'brcm,bcm53011-srab', 'brcm,bcm53012-srab', 'brcm,bcm53018-srab', + 'brcm,bcm53019-srab'] + 'brcm,bcm5301x-srab' is not one of ['brcm,bcm11404-srab', + 'brcm,bcm11407-srab', 'brcm,bcm11409-srab', 'brcm,bcm58310-srab', + 'brcm,bcm58311-srab', 'brcm,bcm58313-srab'] + 'brcm,bcm5301x-srab' is not one of ['brcm,bcm58522-srab', + 'brcm,bcm58523-srab', 'brcm,bcm58525-srab', 'brcm,bcm58622-srab', + 'brcm,bcm58623-srab', 'brcm,bcm58625-srab', 'brcm,bcm88312-srab'] + 'brcm,bcm5301x-srab' is not one of ['brcm,bcm3384-switch', + 'brcm,bcm6328-switch', 'brcm,bcm6368-switch'] + From schema: + Documentation/devicetree/bindings/net/dsa/b53.yaml + +Reviewed-by: Vladimir Oltean +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958522er.dts | 4 ++++ + arch/arm/boot/dts/bcm958525er.dts | 4 ++++ + arch/arm/boot/dts/bcm958525xmc.dts | 4 ++++ + 3 files changed, 12 insertions(+) + +--- a/arch/arm/boot/dts/bcm958522er.dts ++++ b/arch/arm/boot/dts/bcm958522er.dts +@@ -174,3 +174,7 @@ + &xhci { + status = "okay"; + }; ++ ++&srab { ++ compatible = "brcm,bcm58522-srab", "brcm,nsp-srab"; ++}; +--- a/arch/arm/boot/dts/bcm958525er.dts ++++ b/arch/arm/boot/dts/bcm958525er.dts +@@ -186,3 +186,7 @@ + &xhci { + status = "okay"; + }; ++ ++&srab { ++ compatible = "brcm,bcm58525-srab", "brcm,nsp-srab"; ++}; +--- a/arch/arm/boot/dts/bcm958525xmc.dts ++++ b/arch/arm/boot/dts/bcm958525xmc.dts +@@ -206,3 +206,7 @@ + &xhci { + status = "okay"; + }; ++ ++&srab { ++ compatible = "brcm,bcm58525-srab", "brcm,nsp-srab"; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0016-ARM-dts-NSP-Provide-defaults-ports-container-node.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0016-ARM-dts-NSP-Provide-defaults-ports-container-node.patch new file mode 100644 index 0000000000..714e09ed06 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0016-ARM-dts-NSP-Provide-defaults-ports-container-node.patch @@ -0,0 +1,99 @@ +From 51e40c25aa18d926a8eb1c07289d01611b21123a Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 9 Nov 2020 17:44:33 -0800 +Subject: [PATCH 16/16] ARM: dts: NSP: Provide defaults ports container node + +Provide an empty 'ports' container node with the correct #address-cells +and #size-cells properties. This silences the following warning: + +arch/arm/boot/dts/bcm958522er.dt.yaml: +ethernet-switch@36000: 'oneOf' conditional failed, one must be fixed: + 'ports' is a required property + 'ethernet-ports' is a required property + From schema: +Documentation/devicetree/bindings/net/dsa/b53.yaml + +Reviewed-by: Vladimir Oltean +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 4 ++++ + arch/arm/boot/dts/bcm958622hr.dts | 3 --- + arch/arm/boot/dts/bcm958623hr.dts | 3 --- + arch/arm/boot/dts/bcm958625hr.dts | 3 --- + arch/arm/boot/dts/bcm958625k.dts | 3 --- + arch/arm/boot/dts/bcm988312hr.dts | 3 --- + 6 files changed, 4 insertions(+), 15 deletions(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -418,6 +418,10 @@ + status = "disabled"; + + /* ports are defined in board DTS */ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; + }; + + i2c0: i2c@38000 { +--- a/arch/arm/boot/dts/bcm958622hr.dts ++++ b/arch/arm/boot/dts/bcm958622hr.dts +@@ -172,9 +172,6 @@ + status = "okay"; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + label = "port0"; + reg = <0>; +--- a/arch/arm/boot/dts/bcm958623hr.dts ++++ b/arch/arm/boot/dts/bcm958623hr.dts +@@ -176,9 +176,6 @@ + status = "okay"; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + label = "port0"; + reg = <0>; +--- a/arch/arm/boot/dts/bcm958625hr.dts ++++ b/arch/arm/boot/dts/bcm958625hr.dts +@@ -196,9 +196,6 @@ + status = "okay"; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + label = "port0"; + reg = <0>; +--- a/arch/arm/boot/dts/bcm958625k.dts ++++ b/arch/arm/boot/dts/bcm958625k.dts +@@ -212,9 +212,6 @@ + status = "okay"; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + label = "port0"; + reg = <0>; +--- a/arch/arm/boot/dts/bcm988312hr.dts ++++ b/arch/arm/boot/dts/bcm988312hr.dts +@@ -184,9 +184,6 @@ + status = "okay"; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + label = "port0"; + reg = <0>; diff --git a/target/linux/bcm53xx/patches-5.4/036-v5.14-0001-ARM-dts-BCM5301X-Fix-NAND-nodes-names.patch b/target/linux/bcm53xx/patches-5.4/036-v5.14-0001-ARM-dts-BCM5301X-Fix-NAND-nodes-names.patch index ac45409c63..48cceee743 100644 --- a/target/linux/bcm53xx/patches-5.4/036-v5.14-0001-ARM-dts-BCM5301X-Fix-NAND-nodes-names.patch +++ b/target/linux/bcm53xx/patches-5.4/036-v5.14-0001-ARM-dts-BCM5301X-Fix-NAND-nodes-names.patch @@ -53,7 +53,7 @@ Signed-off-by: Florian Fainelli #address-cells = <1>; --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -502,7 +502,7 @@ +@@ -503,7 +503,7 @@ reg = <0x18004000 0x14>; }; diff --git a/target/linux/bcm53xx/patches-5.4/036-v5.14-0002-ARM-dts-BCM5301X-Fix-pinmux-subnodes-names.patch b/target/linux/bcm53xx/patches-5.4/036-v5.14-0002-ARM-dts-BCM5301X-Fix-pinmux-subnodes-names.patch index aad9aef4a3..d8a4f87c38 100644 --- a/target/linux/bcm53xx/patches-5.4/036-v5.14-0002-ARM-dts-BCM5301X-Fix-pinmux-subnodes-names.patch +++ b/target/linux/bcm53xx/patches-5.4/036-v5.14-0002-ARM-dts-BCM5301X-Fix-pinmux-subnodes-names.patch @@ -28,7 +28,7 @@ Signed-off-by: Florian Fainelli }; --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -440,18 +440,18 @@ +@@ -460,18 +460,18 @@ function = "spi"; }; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0001-ARM-dts-NSP-add-device-names-to-compatible.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0001-ARM-dts-NSP-add-device-names-to-compatible.patch new file mode 100644 index 0000000000..c994953d4d --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0001-ARM-dts-NSP-add-device-names-to-compatible.patch @@ -0,0 +1,97 @@ +From 465078bfdf5271601f098450ae2fc974865c59fd Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Thu, 10 Jun 2021 21:35:10 +0100 +Subject: [PATCH] ARM: dts: NSP: add device names to compatible + +Currently only the SoC type and platform are specified for all NSP +devices. This patch adds the device names. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958522er.dts | 2 +- + arch/arm/boot/dts/bcm958525er.dts | 2 +- + arch/arm/boot/dts/bcm958525xmc.dts | 2 +- + arch/arm/boot/dts/bcm958622hr.dts | 2 +- + arch/arm/boot/dts/bcm958625hr.dts | 2 +- + arch/arm/boot/dts/bcm958625k.dts | 2 +- + arch/arm/boot/dts/bcm988312hr.dts | 2 +- + 7 files changed, 7 insertions(+), 7 deletions(-) + +--- a/arch/arm/boot/dts/bcm958522er.dts ++++ b/arch/arm/boot/dts/bcm958522er.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958522ER)"; +- compatible = "brcm,bcm58522", "brcm,nsp"; ++ compatible = "brcm,bcm958522er", "brcm,bcm58522", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm958525er.dts ++++ b/arch/arm/boot/dts/bcm958525er.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958525ER)"; +- compatible = "brcm,bcm58525", "brcm,nsp"; ++ compatible = "brcm,bcm958525er", "brcm,bcm58525", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm958525xmc.dts ++++ b/arch/arm/boot/dts/bcm958525xmc.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus XMC (BCM958525xmc)"; +- compatible = "brcm,bcm58525", "brcm,nsp"; ++ compatible = "brcm,bcm958525xmc", "brcm,bcm58525", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm958622hr.dts ++++ b/arch/arm/boot/dts/bcm958622hr.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958622HR)"; +- compatible = "brcm,bcm58622", "brcm,nsp"; ++ compatible = "brcm,bcm958622hr", "brcm,bcm58622", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm958625hr.dts ++++ b/arch/arm/boot/dts/bcm958625hr.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958625HR)"; +- compatible = "brcm,bcm58625", "brcm,nsp"; ++ compatible = "brcm,bcm958625hr", "brcm,bcm58625", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm958625k.dts ++++ b/arch/arm/boot/dts/bcm958625k.dts +@@ -36,7 +36,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958625K)"; +- compatible = "brcm,bcm58625", "brcm,nsp"; ++ compatible = "brcm,bcm958625k", "brcm,bcm58625", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm988312hr.dts ++++ b/arch/arm/boot/dts/bcm988312hr.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM988312HR)"; +- compatible = "brcm,bcm88312", "brcm,nsp"; ++ compatible = "brcm,bcm988312hr", "brcm,bcm88312", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0002-ARM-dts-NSP-enable-DMA-on-bcm988312hr.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0002-ARM-dts-NSP-enable-DMA-on-bcm988312hr.patch new file mode 100644 index 0000000000..d84124d2dd --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0002-ARM-dts-NSP-enable-DMA-on-bcm988312hr.patch @@ -0,0 +1,29 @@ +From 1b90dde4278a7b459979706b572785bc3a10bbb5 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Thu, 10 Jun 2021 21:35:12 +0100 +Subject: [PATCH] ARM: dts: NSP: enable DMA on bcm988312hr + +The previous patch "ARM: dts: NSP: Disable PL330 by default, add +dma-coherent property" set the DMAC to disabled by default, requiring it +to be manually enabled on each device. The bcm988312hr was mistakenly +omitted. This patch adds it back. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm988312hr.dts | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/arm/boot/dts/bcm988312hr.dts ++++ b/arch/arm/boot/dts/bcm988312hr.dts +@@ -58,6 +58,10 @@ + + /* USB 3 support needed to be complete */ + ++&dma { ++ status = "okay"; ++}; ++ + &amac0 { + status = "okay"; + }; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0003-ARM-dts-NSP-disable-qspi-node-by-default.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0003-ARM-dts-NSP-disable-qspi-node-by-default.patch new file mode 100644 index 0000000000..df49700829 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0003-ARM-dts-NSP-disable-qspi-node-by-default.patch @@ -0,0 +1,113 @@ +From 091a12b1814142eac16a115dab206f735b5476a9 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 13 Jun 2021 10:46:34 +0100 +Subject: [PATCH] ARM: dts: NSP: disable qspi node by default + +The QSPI bus is enabled by default, however this may not used on all +devices. This patch disables by default, requiring it to be explicitly +enabled where required. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 1 + + arch/arm/boot/dts/bcm958522er.dts | 1 + + arch/arm/boot/dts/bcm958525er.dts | 1 + + arch/arm/boot/dts/bcm958525xmc.dts | 1 + + arch/arm/boot/dts/bcm958622hr.dts | 1 + + arch/arm/boot/dts/bcm958623hr.dts | 1 + + arch/arm/boot/dts/bcm958625hr.dts | 1 + + arch/arm/boot/dts/bcm958625k.dts | 1 + + arch/arm/boot/dts/bcm988312hr.dts | 1 + + 9 files changed, 9 insertions(+) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -308,6 +308,7 @@ + num-cs = <2>; + #address-cells = <1>; + #size-cells = <0>; ++ status = "disabled"; + }; + + xhci: usb@29000 { +--- a/arch/arm/boot/dts/bcm958522er.dts ++++ b/arch/arm/boot/dts/bcm958522er.dts +@@ -130,6 +130,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958525er.dts ++++ b/arch/arm/boot/dts/bcm958525er.dts +@@ -130,6 +130,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958525xmc.dts ++++ b/arch/arm/boot/dts/bcm958525xmc.dts +@@ -146,6 +146,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958622hr.dts ++++ b/arch/arm/boot/dts/bcm958622hr.dts +@@ -134,6 +134,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958623hr.dts ++++ b/arch/arm/boot/dts/bcm958623hr.dts +@@ -138,6 +138,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958625hr.dts ++++ b/arch/arm/boot/dts/bcm958625hr.dts +@@ -150,6 +150,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958625k.dts ++++ b/arch/arm/boot/dts/bcm958625k.dts +@@ -149,6 +149,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm988312hr.dts ++++ b/arch/arm/boot/dts/bcm988312hr.dts +@@ -138,6 +138,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0004-ARM-dts-NSP-add-MDIO-bus-controller-node.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0004-ARM-dts-NSP-add-MDIO-bus-controller-node.patch new file mode 100644 index 0000000000..35f6e801a1 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0004-ARM-dts-NSP-add-MDIO-bus-controller-node.patch @@ -0,0 +1,30 @@ +From 236b31b1d84eb0e4f10c5f113a2675529456f919 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 13 Jun 2021 10:46:36 +0100 +Subject: [PATCH] ARM: dts: NSP: add MDIO bus controller node + +This patch adds the node for the MDIO bus controller, present on the NSP +SoC. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -361,6 +361,13 @@ + status = "disabled"; + }; + ++ mdio: mdio@32000 { ++ compatible = "brcm,iproc-mdio"; ++ reg = <0x32000 0x8>; ++ #size-cells = <0>; ++ #address-cells = <1>; ++ }; ++ + rng: rng@33000 { + compatible = "brcm,bcm-nsp-rng"; + reg = <0x33000 0x14>; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0005-ARM-dts-NSP-Move-USB3-PHY-to-internal-MDIO-bus.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0005-ARM-dts-NSP-Move-USB3-PHY-to-internal-MDIO-bus.patch new file mode 100644 index 0000000000..9b62cb3028 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0005-ARM-dts-NSP-Move-USB3-PHY-to-internal-MDIO-bus.patch @@ -0,0 +1,85 @@ +From 1c615401bddb1be21e1d375aaa071680f40f1ae2 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 13 Jun 2021 10:46:37 +0100 +Subject: [PATCH] ARM: dts: NSP: Move USB3 PHY to internal MDIO bus + +This patch largely replicates Vivek Unune's patch "ARM: dts: +BCM5301X:Make usb3 phy use mdio phy driver"[1] for the NSP platform, +whereby we need to create an mdio-mux to facilitate switches +configured via external MDIO, in this case on the Meraki MX65. + +However in doing so, we are creating an overlap with usb3_phy's +ccb-mii range. To resolve this, usb3_phy should be moved to a child +node of the internal MDIO bus. The result is heavily based upon Vivek's +patch. This has also been cross-referenced with Yendapally Reddy's +earlier work which utilised the subsequently dropped brcm,nsp-usb3-phy +driver: "[PATCH v2 4/4] arm: dts: nsp: Add USB nodes to device tree" +[2]. Finally, this change provides conformance to the bcm-ns-usb3-phy +documentation, utilising the required usb3-dmp-syscon property. Note +that support for the deprecated ccb-mii bindings has been dropped as of +"phy: phy-bcm-ns-usb3: drop support for deprecated DT binding"[3]. + +[1] https://lore.kernel.org/patchwork/patch/933971/ +[2] https://www.spinics.net/lists/arm-kernel/msg555132.html +[3] https://lore.kernel.org/linux-devicetree/20201113113423.9466-1-zajec5@gmail.com/ + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 38 +++++++++++++++++++++++++++------- + 1 file changed, 31 insertions(+), 7 deletions(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -368,6 +368,35 @@ + #address-cells = <1>; + }; + ++ mdio-mux@32000 { ++ compatible = "mdio-mux-mmioreg"; ++ reg = <0x32000 0x4>; ++ mux-mask = <0x200>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mdio-parent-bus = <&mdio>; ++ ++ mdio_int: mdio@0 { ++ reg = <0x0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ usb3_phy: usb3-phy@10 { ++ compatible = "brcm,ns-bx-usb3-phy"; ++ reg = <0x10>; ++ usb3-dmp-syscon = <&usb3_dmp>; ++ #phy-cells = <0>; ++ status = "disabled"; ++ }; ++ }; ++ ++ mdio_ext: mdio@200 { ++ reg = <0x200>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ }; ++ + rng: rng@33000 { + compatible = "brcm,bcm-nsp-rng"; + reg = <0x33000 0x14>; +@@ -526,13 +555,8 @@ + }; + }; + +- usb3_phy: usb3-phy@104000 { +- compatible = "brcm,ns-bx-usb3-phy"; +- reg = <0x104000 0x1000>, +- <0x032000 0x1000>; +- reg-names = "dmp", "ccb-mii"; +- #phy-cells = <0>; +- status = "disabled"; ++ usb3_dmp: syscon@104000 { ++ reg = <0x104000 0x1000>; + }; + }; + diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0006-ARM-dts-NSP-Add-common-bindings-for-MX64-MX65.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0006-ARM-dts-NSP-Add-common-bindings-for-MX64-MX65.patch new file mode 100644 index 0000000000..aebf62af9b --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0006-ARM-dts-NSP-Add-common-bindings-for-MX64-MX65.patch @@ -0,0 +1,148 @@ +From f111016a8293b968f05450fec83020c94d0f88c2 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Fri, 6 Aug 2021 21:44:32 +0100 +Subject: [PATCH] ARM: dts: NSP: Add common bindings for MX64/MX65 + +These bindings are required for all Meraki MX64/MX65 devices. These +common bindings include memory (2GB), PWM LEDs, AMAC, I2C (AT24), NAND +partitions, EHCI, OHCI and pinctrl. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + .../dts/bcm958625-meraki-mx6x-common.dtsi | 129 ++++++++++++++++++ + 1 file changed, 129 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi + +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi +@@ -0,0 +1,129 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Common Bindings for Cisco Meraki MX64 (Kingpin) and MX65 (Alamo) devices. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++#include "bcm-nsp.dtsi" ++#include ++#include ++#include ++ ++/ { ++ pwm-leds { ++ compatible = "pwm-leds"; ++ ++ led-1 { ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ pwms = <&pwm 1 50000>; ++ max-brightness = <255>; ++ }; ++ ++ led-2 { ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ pwms = <&pwm 2 50000>; ++ max-brightness = <255>; ++ }; ++ ++ led-3 { ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ pwms = <&pwm 3 50000>; ++ max-brightness = <255>; ++ }; ++ }; ++}; ++ ++&amac2 { ++ status = "okay"; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ at24@50 { ++ compatible = "atmel,24c64"; ++ reg = <0x50>; ++ pagesize = <32>; ++ read-only; ++ }; ++}; ++ ++&nand_controller { ++ nand@0 { ++ compatible = "brcm,nandcs"; ++ reg = <0>; ++ nand-on-flash-bbt; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ nand-ecc-strength = <24>; ++ nand-ecc-step-size = <1024>; ++ ++ brcm,nand-oob-sector-size = <27>; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x0 0x80000>; ++ read-only; ++ }; ++ ++ partition@80000 { ++ label = "shmoo"; ++ reg = <0x80000 0x80000>; ++ read-only; ++ }; ++ ++ partition@100000 { ++ label = "bootkernel1"; ++ reg = <0x100000 0x300000>; ++ }; ++ ++ partition@400000 { ++ label = "nvram"; ++ reg = <0x400000 0x100000>; ++ }; ++ ++ partition@500000 { ++ label = "bootkernel2"; ++ reg = <0x500000 0x300000>; ++ }; ++ ++ partition@800000 { ++ label = "ubi"; ++ reg = <0x800000 0x3f700000>; ++ }; ++ }; ++}; ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&pinctrl { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm_leds>; ++ ++ pwm_leds: pwm_leds { ++ function = "pwm"; ++ groups = "pwm1_grp", "pwm2_grp", "pwm3_grp"; ++ }; ++}; ++ ++&pwm { ++ status = "okay"; ++ #pwm-cells = <2>; ++}; ++ ++&uart0 { ++ clock-frequency = <62500000>; ++ status = "okay"; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0007-ARM-dts-NSP-Add-Ax-stepping-modifications.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0007-ARM-dts-NSP-Add-Ax-stepping-modifications.patch new file mode 100644 index 0000000000..39a69bd9a8 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0007-ARM-dts-NSP-Add-Ax-stepping-modifications.patch @@ -0,0 +1,90 @@ +From 2addf9266a1d0f4ba59c9868b3effcd50de441a4 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Fri, 6 Aug 2021 21:44:33 +0100 +Subject: [PATCH] ARM: dts: NSP: Add Ax stepping modifications + +While uncommon, some Ax NSP SoCs exist in the wild. This stepping +requires a modified secondary CPU boot-reg and removal of DMA coherency +properties. Without these modifications, the secondary CPU will be +inactive and many peripherals will exhibit undefined behaviour. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp-ax.dtsi | 70 +++++++++++++++++++++++++++++++ + 1 file changed, 70 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm-nsp-ax.dtsi + +--- /dev/null ++++ b/arch/arm/boot/dts/bcm-nsp-ax.dtsi +@@ -0,0 +1,70 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Broadcom Northstar Plus Ax stepping-specific bindings. ++ * Notable differences from B0+ are the secondary-boot-reg and ++ * lack of DMA coherency. ++ */ ++ ++&cpu1 { ++ secondary-boot-reg = <0xffff042c>; ++}; ++ ++&dma { ++ /delete-property/ dma-coherent; ++}; ++ ++&sdio { ++ /delete-property/ dma-coherent; ++}; ++ ++&amac0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&amac1 { ++ /delete-property/ dma-coherent; ++}; ++ ++&amac2 { ++ /delete-property/ dma-coherent; ++}; ++ ++&ehci0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&mailbox { ++ /delete-property/ dma-coherent; ++}; ++ ++&xhci { ++ /delete-property/ dma-coherent; ++}; ++ ++&ehci0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&ohci0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&i2c0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&sata { ++ /delete-property/ dma-coherent; ++}; ++ ++&pcie0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&pcie1 { ++ /delete-property/ dma-coherent; ++}; ++ ++&pcie2 { ++ /delete-property/ dma-coherent; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0008-ARM-dts-NSP-Add-DT-files-for-Meraki-MX64-series.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0008-ARM-dts-NSP-Add-DT-files-for-Meraki-MX64-series.patch new file mode 100644 index 0000000000..1960f90c68 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0008-ARM-dts-NSP-Add-DT-files-for-Meraki-MX64-series.patch @@ -0,0 +1,340 @@ +From 3f902645280baf0d7dab57c227cc14f43edb45ef Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Fri, 6 Aug 2021 21:44:34 +0100 +Subject: [PATCH] ARM: dts: NSP: Add DT files for Meraki MX64 series + +MX64 & MX64W Hardware info: + - CPU: Broadcom BCM58625 Cortex A9 @ 1200Mhz + - RAM: 2 GB (4 x 4Gb SK Hynix H5TC4G83CFR) + - Storage: 1 GB (Micron MT29F8G08ABACA) + - Networking: BCM58625 internal switch (5x 1GbE ports) + - USB: 1x USB2.0 + - Serial: Internal header + - WLAN(MX64W only): 2x Broadcom BCM43520KMLG on the PCI bus + +This patch adds the Meraki MX64 series-specific bindings. Since some +devices make use of the older A0 SoC, changes need to be made to +accommodate this case, including removal of coherency options and +modification to the secondary-boot-reg. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 4 + + .../boot/dts/bcm958625-meraki-kingpin.dtsi | 163 ++++++++++++++++++ + .../arm/boot/dts/bcm958625-meraki-mx64-a0.dts | 25 +++ + arch/arm/boot/dts/bcm958625-meraki-mx64.dts | 24 +++ + .../boot/dts/bcm958625-meraki-mx64w-a0.dts | 33 ++++ + arch/arm/boot/dts/bcm958625-meraki-mx64w.dts | 32 ++++ + 6 files changed, 281 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx64-a0.dts + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx64.dts + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx64w-a0.dts + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx64w.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -148,6 +148,10 @@ dtb-$(CONFIG_ARCH_BCM_NSP) += \ + bcm958525xmc.dtb \ + bcm958622hr.dtb \ + bcm958623hr.dtb \ ++ bcm958625-meraki-mx64.dtb \ ++ bcm958625-meraki-mx64-a0.dtb \ ++ bcm958625-meraki-mx64w.dtb \ ++ bcm958625-meraki-mx64w-a0.dtb \ + bcm958625hr.dtb \ + bcm988312hr.dtb \ + bcm958625k.dtb +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi +@@ -0,0 +1,163 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX64 series (Kingpin). ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++#include "bcm958625-meraki-mx6x-common.dtsi" ++ ++/ { ++ ++ keys { ++ compatible = "gpio-keys-polled"; ++ autorepeat; ++ poll-interval = <20>; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpioa 6 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ /* green:lan1-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <0>; ++ color = ; ++ gpios = <&gpioa 19 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-1 { ++ /* green:lan1-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <1>; ++ color = ; ++ gpios = <&gpioa 18 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-2 { ++ /* green:lan2-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <2>; ++ color = ; ++ gpios = <&gpioa 24 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-3 { ++ /* green:lan2-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <3>; ++ color = ; ++ gpios = <&gpioa 20 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-4 { ++ /* green:lan3-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <4>; ++ color = ; ++ gpios = <&gpioa 26 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-5 { ++ /* green:lan3-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <5>; ++ color = ; ++ gpios = <&gpioa 25 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-6 { ++ /* green:lan4-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <6>; ++ color = ; ++ gpios = <&gpioa 28 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-7 { ++ /* green:lan4-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <7>; ++ color = ; ++ gpios = <&gpioa 27 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-8 { ++ /* green:wan-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <8>; ++ color = ; ++ gpios = <&gpioa 30 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-9 { ++ /* green:wan-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <9>; ++ color = ; ++ gpios = <&gpioa 29 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-a { ++ /* amber:power */ ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; ++ default-state = "on"; ++ }; ++ ++ led-b { ++ /* white:status */ ++ function = LED_FUNCTION_STATUS; ++ color = ; ++ gpios = <&gpioa 31 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++}; ++ ++&srab { ++ compatible = "brcm,bcm58625-srab", "brcm,nsp-srab"; ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ label = "lan1"; ++ reg = <0>; ++ }; ++ ++ port@1 { ++ label = "lan2"; ++ reg = <1>; ++ }; ++ ++ port@2 { ++ label = "lan3"; ++ reg = <2>; ++ }; ++ ++ port@3 { ++ label = "lan4"; ++ reg = <3>; ++ }; ++ ++ port@4 { ++ label = "wan"; ++ reg = <4>; ++ }; ++ ++ port@8 { ++ ethernet = <&amac2>; ++ reg = <8>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx64-a0.dts +@@ -0,0 +1,25 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX64 with A0 SoC. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-kingpin.dtsi" ++#include "bcm-nsp-ax.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX64(A0)"; ++ compatible = "meraki,mx64-a0", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx64.dts +@@ -0,0 +1,24 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX64 with B0+ SoC. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-kingpin.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX64"; ++ compatible = "meraki,mx64", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx64w-a0.dts +@@ -0,0 +1,33 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX64W with A0 SoC. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-kingpin.dtsi" ++#include "bcm-nsp-ax.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX64W(A0)"; ++ compatible = "meraki,mx64w-a0", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&pcie1 { ++ status = "okay"; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx64w.dts +@@ -0,0 +1,32 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX64W with B0+ SoC. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-kingpin.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX64W"; ++ compatible = "meraki,mx64w", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&pcie1 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0009-ARM-dts-NSP-Add-DT-files-for-Meraki-MX65-series.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0009-ARM-dts-NSP-Add-DT-files-for-Meraki-MX65-series.patch new file mode 100644 index 0000000000..aa431b97cc --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0009-ARM-dts-NSP-Add-DT-files-for-Meraki-MX65-series.patch @@ -0,0 +1,386 @@ +From 702a8f4744ed5b480f2b2411858184afdb10f9fd Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Fri, 6 Aug 2021 21:44:35 +0100 +Subject: [PATCH] ARM: dts: NSP: Add DT files for Meraki MX65 series + +MX65 & MX65W Hardware info: + - CPU: Broadcom BCM58625 Cortex A9 @ 1200Mhz + - RAM: 2 GB (4 x 4Gb SK Hynix H5TC4G83CFR) + - Storage: 1 GB (Micron MT29F8G08ABACA) + - Networking: BCM58625 switch (2x 1GbE ports) + 2x Qualcomm QCA8337 switches (10x 1GbE ports total) + - PSE: Broadcom BCM59111KMLG connected to LAN ports 11 & 12 + - USB: 1x USB2.0 + - Serial: Internal header + - WLAN(MX65W Only): 2x Broadcom BCM43520KMLG on the PCI bus. + +Note that a driver and firmware image for the BCM59111 PSE has been +released under GPL, but this is not present in the kernel. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 2 + + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 279 ++++++++++++++++++ + arch/arm/boot/dts/bcm958625-meraki-mx65.dts | 24 ++ + arch/arm/boot/dts/bcm958625-meraki-mx65w.dts | 32 ++ + 4 files changed, 337 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx65.dts + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx65w.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -152,6 +152,8 @@ dtb-$(CONFIG_ARCH_BCM_NSP) += \ + bcm958625-meraki-mx64-a0.dtb \ + bcm958625-meraki-mx64w.dtb \ + bcm958625-meraki-mx64w-a0.dtb \ ++ bcm958625-meraki-mx65.dtb \ ++ bcm958625-meraki-mx65w.dtb \ + bcm958625hr.dtb \ + bcm988312hr.dtb \ + bcm958625k.dtb +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -0,0 +1,279 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX65 series (Alamo). ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++#include "bcm958625-meraki-mx6x-common.dtsi" ++ ++/ { ++ keys { ++ compatible = "gpio-keys-polled"; ++ autorepeat; ++ poll-interval = <20>; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpioa 8 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ /* green:wan1-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <0>; ++ color = ; ++ gpios = <&gpioa 25 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-1 { ++ /* green:wan1-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <1>; ++ color = ; ++ gpios = <&gpioa 24 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-2 { ++ /* green:wan2-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <2>; ++ color = ; ++ gpios = <&gpioa 27 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-3 { ++ /* green:wan2-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <3>; ++ color = ; ++ gpios = <&gpioa 26 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-4 { ++ /* amber:power */ ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpioa 3 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ ++ led-5 { ++ /* white:status */ ++ function = LED_FUNCTION_STATUS; ++ color = ; ++ gpios = <&gpioa 31 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ mdio-mii-mux { ++ compatible = "mdio-mux-mmioreg"; ++ reg = <0x1803f1c0 0x4>; ++ mux-mask = <0x2000>; ++ mdio-parent-bus = <&mdio_ext>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ mdio@0 { ++ reg = <0x0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ phy_port6: phy@0 { ++ reg = <0>; ++ }; ++ ++ phy_port7: phy@1 { ++ reg = <1>; ++ }; ++ ++ phy_port8: phy@2 { ++ reg = <2>; ++ }; ++ ++ phy_port9: phy@3 { ++ reg = <3>; ++ }; ++ ++ phy_port10: phy@4 { ++ reg = <4>; ++ }; ++ ++ switch@10 { ++ compatible = "qca,qca8337"; ++ reg = <0x10>; ++ dsa,member = <1 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ port@0 { ++ reg = <0>; ++ ethernet = <&sgmii1>; ++ phy-mode = "sgmii"; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan8"; ++ phy-handle = <&phy_port6>; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan9"; ++ phy-handle = <&phy_port7>; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan10"; ++ phy-handle = <&phy_port8>; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan11"; ++ phy-handle = <&phy_port9>; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "lan12"; ++ phy-handle = <&phy_port10>; ++ }; ++ }; ++ }; ++ }; ++ ++ mdio-mii@2000 { ++ reg = <0x2000>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ phy_port1: phy@0 { ++ reg = <0>; ++ }; ++ ++ phy_port2: phy@1 { ++ reg = <1>; ++ }; ++ ++ phy_port3: phy@2 { ++ reg = <2>; ++ }; ++ ++ phy_port4: phy@3 { ++ reg = <3>; ++ }; ++ ++ phy_port5: phy@4 { ++ reg = <4>; ++ }; ++ ++ switch@10 { ++ compatible = "qca,qca8337"; ++ reg = <0x10>; ++ dsa,member = <2 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ port@0 { ++ reg = <0>; ++ ethernet = <&sgmii0>; ++ phy-mode = "sgmii"; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan3"; ++ phy-handle = <&phy_port1>; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan4"; ++ phy-handle = <&phy_port2>; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan5"; ++ phy-handle = <&phy_port3>; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan6"; ++ phy-handle = <&phy_port4>; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "lan7"; ++ phy-handle = <&phy_port5>; ++ }; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++&srab { ++ compatible = "brcm,bcm58625-srab", "brcm,nsp-srab"; ++ status = "okay"; ++ dsa,member = <0 0>; ++ ++ ports { ++ port@0 { ++ label = "wan1"; ++ reg = <0>; ++ }; ++ ++ port@1 { ++ label = "wan2"; ++ reg = <1>; ++ }; ++ ++ sgmii0: port@4 { ++ label = "sw0"; ++ reg = <4>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ sgmii1: port@5 { ++ label = "sw1"; ++ reg = <5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@8 { ++ ethernet = <&amac2>; ++ reg = <8>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx65.dts +@@ -0,0 +1,24 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX65. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-alamo.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX65"; ++ compatible = "meraki,mx65", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx65w.dts +@@ -0,0 +1,32 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX65W. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-alamo.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX65W"; ++ compatible = "meraki,mx65w", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&pcie1 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0001-ARM-dts-BCM5301X-Fix-nodes-names.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0010-ARM-dts-BCM5301X-Fix-nodes-names.patch similarity index 100% rename from target/linux/bcm53xx/patches-5.4/037-v5.15-0001-ARM-dts-BCM5301X-Fix-nodes-names.patch rename to target/linux/bcm53xx/patches-5.4/037-v5.15-0010-ARM-dts-BCM5301X-Fix-nodes-names.patch diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0002-ARM-dts-BCM5301X-Fix-MDIO-mux-binding.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0011-ARM-dts-BCM5301X-Fix-MDIO-mux-binding.patch similarity index 100% rename from target/linux/bcm53xx/patches-5.4/037-v5.15-0002-ARM-dts-BCM5301X-Fix-MDIO-mux-binding.patch rename to target/linux/bcm53xx/patches-5.4/037-v5.15-0011-ARM-dts-BCM5301X-Fix-MDIO-mux-binding.patch diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0003-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0012-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch similarity index 100% rename from target/linux/bcm53xx/patches-5.4/037-v5.15-0003-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch rename to target/linux/bcm53xx/patches-5.4/037-v5.15-0012-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0013-ARM-dts-NSP-Add-bcm958623hr-board-name-to-dts.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0013-ARM-dts-NSP-Add-bcm958623hr-board-name-to-dts.patch new file mode 100644 index 0000000000..c5f28474e3 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0013-ARM-dts-NSP-Add-bcm958623hr-board-name-to-dts.patch @@ -0,0 +1,27 @@ +From 695717eb4c61173d05a277e37132b5e2c6531bf1 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 29 Aug 2021 22:37:47 +0000 +Subject: [PATCH] ARM: dts: NSP: Add bcm958623hr board name to dts + +This board was previously added to +Documentation/devicetree/bindings/arm/bcm/brcm,nsp.yaml +however the dts file was not updated to reflect this change. This patch +corrects bcm958623hr.dts by adding the board name to the compatible. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958623hr.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm958623hr.dts ++++ b/arch/arm/boot/dts/bcm958623hr.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958623HR)"; +- compatible = "brcm,bcm58623", "brcm,nsp"; ++ compatible = "brcm,bcm958623hr", "brcm,bcm58623", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0015-ARM-dts-NSP-Fix-MDIO-mux-node-names.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0015-ARM-dts-NSP-Fix-MDIO-mux-node-names.patch new file mode 100644 index 0000000000..0d9311114f --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0015-ARM-dts-NSP-Fix-MDIO-mux-node-names.patch @@ -0,0 +1,47 @@ +From 38f8111369f318a538e9d4d89d8e48030c22fb40 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 29 Aug 2021 22:37:49 +0000 +Subject: [PATCH] ARM: dts: NSP: Fix MDIO mux node names + +While functional, the mdio-mux-mmioreg binding does not conform to +Documentation/devicetree/bindings/net/mdio-mux-mmioreg.yaml in that an +mdio-mux compatible is also required. Without this the following output +is observed when running dtbs_check: + +mdio-mux@32000: compatible: ['mdio-mux-mmioreg'] is too short + +This change brings conformance to this requirement and corresponds +likewise to Rafal Milecki's change to the BCM5301x platform[1]. + +[1] https://lore.kernel.org/linux-arm-kernel/20210822191256.3715003-1-f.fainelli@gmail.com/T/ + +Signed-off-by: Matthew Hagan +Reviewed-by: Andrew Lunn +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 2 +- + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -369,7 +369,7 @@ + }; + + mdio-mux@32000 { +- compatible = "mdio-mux-mmioreg"; ++ compatible = "mdio-mux-mmioreg", "mdio-mux"; + reg = <0x32000 0x4>; + mux-mask = <0x200>; + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -72,7 +72,7 @@ + }; + + mdio-mii-mux { +- compatible = "mdio-mux-mmioreg"; ++ compatible = "mdio-mux-mmioreg", "mdio-mux"; + reg = <0x1803f1c0 0x4>; + mux-mask = <0x2000>; + mdio-parent-bus = <&mdio_ext>; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0016-ARM-dts-NSP-Fix-MX64-MX65-eeprom-node-name.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0016-ARM-dts-NSP-Fix-MX64-MX65-eeprom-node-name.patch new file mode 100644 index 0000000000..4cffad1f4e --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0016-ARM-dts-NSP-Fix-MX64-MX65-eeprom-node-name.patch @@ -0,0 +1,28 @@ +From 56e4e548427240d85fd220460d0ab5987e1dec00 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 29 Aug 2021 22:37:50 +0000 +Subject: [PATCH] ARM: dts: NSP: Fix MX64/MX65 eeprom node name + +Running dtbs_check yields the following message when checking the +MX64/MX65 devicetree: +at24@50: $nodename:0: 'at24@50' does not match '^eeprom@[0-9a-f]{1,2}$' + +This patch fixes the issue by renaming the at24 node appropriately. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi +@@ -48,7 +48,7 @@ + &i2c0 { + status = "okay"; + +- at24@50 { ++ eeprom@50 { + compatible = "atmel,24c64"; + reg = <0x50>; + pagesize = <32>; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0017-ARM-dts-NSP-Fix-MX65-MDIO-mux-warnings.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0017-ARM-dts-NSP-Fix-MX65-MDIO-mux-warnings.patch new file mode 100644 index 0000000000..cad7388685 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0017-ARM-dts-NSP-Fix-MX65-MDIO-mux-warnings.patch @@ -0,0 +1,52 @@ +From f5fc9044e5d45a4d97b5240c8723f4677f647c9f Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 29 Aug 2021 22:37:51 +0000 +Subject: [PATCH] ARM: dts: NSP: Fix MX65 MDIO mux warnings + +The naming of this node is based upon that of the initial EA9500 dts[1]. +However this does not conform with the mdio-mux format, yielding the +following message when running dtbs_check: +mdio-mii-mux: $nodename:0: 'mdio-mii-mux' does not match '^mdio-mux[\\-@]?' + +Secondly, this node should be moved to within the axi node and given the +appropriate unit address. This also requires exposing the axi node via a +label in bcm-nsp.dtsi. This fixes the following warning: +Warning (unit_address_vs_reg): /mdio-mii-mux: node has a reg or ranges property, but no unit name + +[1]https://patchwork.ozlabs.org/project/linux-imx/patch/20180618174159.86150-1-npcomplete13@gmail.com/#1941353 + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 2 +- + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 6 ++++-- + 2 files changed, 5 insertions(+), 3 deletions(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -166,7 +166,7 @@ + }; + }; + +- axi@18000000 { ++ axi: axi@18000000 { + compatible = "simple-bus"; + ranges = <0x00000000 0x18000000 0x0011c40c>; + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -70,10 +70,12 @@ + gpios = <&gpioa 31 GPIO_ACTIVE_HIGH>; + }; + }; ++}; + +- mdio-mii-mux { ++&axi { ++ mdio-mux@3f1c0 { + compatible = "mdio-mux-mmioreg", "mdio-mux"; +- reg = <0x1803f1c0 0x4>; ++ reg = <0x3f1c0 0x4>; + mux-mask = <0x2000>; + mdio-parent-bus = <&mdio_ext>; + #address-cells = <1>; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0018-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0018-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch new file mode 100644 index 0000000000..b309771369 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0018-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch @@ -0,0 +1,290 @@ +From 225ffaf3d0e00daa2d0c7b68e8fd731ebbde3c03 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 7 Sep 2021 08:00:48 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Specify switch ports for more devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Those are remaining models I have that didn't have ports yet. All +tested. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm4708-netgear-r6250.dts | 37 ++++++++++++++++ + .../boot/dts/bcm47081-buffalo-wzr-600dhp2.dts | 37 ++++++++++++++++ + arch/arm/boot/dts/bcm4709-netgear-r8000.dts | 42 +++++++++++++++++++ + arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts | 42 +++++++++++++++++++ + arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts | 37 ++++++++++++++++ + arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts | 37 ++++++++++++++++ + 6 files changed, 232 insertions(+) + +--- a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts +@@ -94,3 +94,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan1"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts +@@ -117,3 +117,40 @@ + }; + }; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -187,3 +187,45 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +@@ -118,3 +118,45 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan1"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts +@@ -68,3 +68,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan4"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan1"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts +@@ -68,3 +68,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan4"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan1"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch new file mode 100644 index 0000000000..3a5438c228 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch @@ -0,0 +1,44 @@ +From 9fb90ae6cae7f8fe4fbf626945f32cd9da2c3892 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 20 Sep 2021 16:10:23 +0200 +Subject: [PATCH] ARM: dts: BCM53573: Describe on-SoC BCM53125 rev 4 switch +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +BCM53573 family SoC have Ethernet switch connected to the first Ethernet +controller (accessible over MDIO). + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm53573.dtsi | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/arch/arm/boot/dts/bcm53573.dtsi ++++ b/arch/arm/boot/dts/bcm53573.dtsi +@@ -180,6 +180,24 @@ + + gmac0: ethernet@5000 { + reg = <0x5000 0x1000>; ++ ++ mdio { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ switch: switch@1e { ++ compatible = "brcm,bcm53125"; ++ reg = <0x1e>; ++ ++ status = "disabled"; ++ ++ /* ports are defined in board DTS */ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ }; ++ }; + }; + + gmac1: ethernet@b000 { diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0020-ARM-dts-BCM53573-Add-Tenda-AC9-switch-ports.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0020-ARM-dts-BCM53573-Add-Tenda-AC9-switch-ports.patch new file mode 100644 index 0000000000..c6d995723c --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0020-ARM-dts-BCM53573-Add-Tenda-AC9-switch-ports.patch @@ -0,0 +1,59 @@ +From 64612828628cca6e3992e421f45c242dc6625647 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 20 Sep 2021 16:10:24 +0200 +Subject: [PATCH] ARM: dts: BCM53573: Add Tenda AC9 switch ports +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This router has 1 WAN and 4 LAN ports. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47189-tenda-ac9.dts | 37 ++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +--- a/arch/arm/boot/dts/bcm47189-tenda-ac9.dts ++++ b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts +@@ -105,3 +105,40 @@ + }; + }; + }; ++ ++&switch { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0021-ARM-BCM53016-Specify-switch-ports-for-Meraki-MR32.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0021-ARM-BCM53016-Specify-switch-ports-for-Meraki-MR32.patch new file mode 100644 index 0000000000..a65b1992ea --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0021-ARM-BCM53016-Specify-switch-ports-for-Meraki-MR32.patch @@ -0,0 +1,57 @@ +From 6abc4ca5a28070945e0d68cb4160b309bfbf4b8b Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 18 Sep 2021 19:29:30 +0200 +Subject: [PATCH] ARM: BCM53016: Specify switch ports for Meraki MR32 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +the switch identifies itself as a BCM53012 (rev 5)... +This patch has been tested & verified on OpenWrt's +snapshot with Linux 5.10 (didn't test any older kernels). +The MR32 is able to "talk to the network" as before with +OpenWrt's SWITCHDEV b53 driver. + +| b53-srab-switch 18007000.ethernet-switch: found switch: BCM53012, rev 5 +| libphy: dsa slave smi: probed +| b53-srab-switch 18007000.ethernet-switch poe (uninitialized): +| PHY [dsa-0.0:00] driver [Generic PHY] (irq=POLL) +| b53-srab-switch 18007000.ethernet-switch: Using legacy PHYLIB callbacks. +| Please migrate to PHYLINK! +| DSA: tree 0 setup + +Reported-by: Rafał Miłecki +Signed-off-by: Christian Lamparter +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -195,3 +195,25 @@ + }; + }; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "poe"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ ++ fixed-link { ++ speed = <1000>; ++ duplex-full; ++ }; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0022-ARM-BCM53016-MR32-get-mac-address-from-nvmem.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0022-ARM-BCM53016-MR32-get-mac-address-from-nvmem.patch new file mode 100644 index 0000000000..70a18822a9 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0022-ARM-BCM53016-MR32-get-mac-address-from-nvmem.patch @@ -0,0 +1,41 @@ +From 477ffdbdf389cc91294d66e251cc6f856da5820c Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 18 Sep 2021 19:29:31 +0200 +Subject: [PATCH] ARM: BCM53016: MR32: get mac-address from nvmem + +The MAC-Address of the MR32's sole ethernet port is +located in offset 0x66 of the attached AT24C64 eeprom. + +Signed-off-by: Christian Lamparter +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -110,6 +110,12 @@ + reg = <0x50>; + pagesize = <32>; + read-only; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ mac_address: mac-address@66 { ++ reg = <0x66 0x6>; ++ }; + }; + }; + }; +@@ -133,6 +139,11 @@ + */ + }; + ++&gmac0 { ++ nvmem-cell-names = "mac-address"; ++ nvmem-cells = <&mac_address>; ++}; ++ + &gmac1 { + status = "disabled"; + }; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0023-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC88U.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0023-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC88U.patch new file mode 100644 index 0000000000..6fc447b602 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0023-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC88U.patch @@ -0,0 +1,242 @@ +From beff77b93452cd2057c859694709dd34a181488f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Tue, 21 Sep 2021 20:19:01 +0800 +Subject: [PATCH] ARM: dts: BCM5301X: Add DT for Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Hardware Info +------------- + +Processor - Broadcom BCM4709C0KFEBG dual-core @ 1.4 GHz +Switch - BCM53012 in BCM4709C0KFEBG & external RTL8365MB +DDR3 RAM - 512 MB +Flash - 128 MB (ESMT F59L1G81LA-25T) +2.4GHz - BCM4366 4×4 2.4/5G single chip 802.11ac SoC +5GHz - BCM4366 4×4 2.4/5G single chip 802.11ac SoC +Ports - 8 Ports, 1 WAN Ports + +Tested on OpenWrt on kernel 5.10 built with DSA driver. + +Signed-off-by: Arınç ÜNAL +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 200 +++++++++++++++++++ + 2 files changed, 201 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -108,6 +108,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4709-netgear-r7000.dtb \ + bcm4709-netgear-r8000.dtb \ + bcm4709-tplink-archer-c9-v1.dtb \ ++ bcm47094-asus-rt-ac88u.dtb \ + bcm47094-dlink-dir-885l.dtb \ + bcm47094-linksys-panamera.dtb \ + bcm47094-luxul-abr-4500.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -0,0 +1,200 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Copyright (C) 2021 Arınç ÜNAL ++ */ ++ ++/dts-v1/; ++ ++#include "bcm47094.dtsi" ++#include "bcm5301x-nand-cs0-bch8.dtsi" ++ ++/ { ++ compatible = "asus,rt-ac88u", "brcm,bcm47094", "brcm,bcm4708"; ++ model = "Asus RT-AC88U"; ++ ++ chosen { ++ bootargs = "earlycon"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x18000000>; ++ }; ++ ++ nvram@1c080000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1c080000 0x00180000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ power { ++ label = "white:power"; ++ gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ wan-red { ++ label = "red:wan"; ++ gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ lan { ++ label = "white:lan"; ++ gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb2 { ++ label = "white:usb2"; ++ gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ehci_port2>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ usb3 { ++ label = "white:usb3"; ++ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ehci_port1>, <&xhci_port1>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ wps { ++ label = "white:wps"; ++ gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>; ++ }; ++ ++ reset { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wifi { ++ label = "Wi-Fi"; ++ linux,code = ; ++ gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led { ++ label = "Backlight"; ++ linux,code = ; ++ gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&srab { ++ compatible = "brcm,bcm53012-srab", "brcm,bcm5301x-srab"; ++ status = "okay"; ++ dsa,member = <0 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan1"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ sw0_p5: port@5 { ++ reg = <5>; ++ label = "extsw"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@7 { ++ reg = <7>; ++ ethernet = <&gmac1>; ++ label = "cpu"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ ethernet = <&gmac2>; ++ label = "cpu"; ++ status = "disabled"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; ++ ++&usb2 { ++ vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; ++ ++&nandcs { ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "boot"; ++ reg = <0x00000000 0x00080000>; ++ read-only; ++ }; ++ ++ partition@80000 { ++ label = "nvram"; ++ reg = <0x00080000 0x00180000>; ++ }; ++ ++ partition@200000 { ++ label = "firmware"; ++ reg = <0x00200000 0x07e00000>; ++ compatible = "brcm,trx"; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0001-ARM-dts-NSP-MX65-add-qca8k-falling-edge-PLL-properti.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0001-ARM-dts-NSP-MX65-add-qca8k-falling-edge-PLL-properti.patch new file mode 100644 index 0000000000..a0be1eda4d --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0001-ARM-dts-NSP-MX65-add-qca8k-falling-edge-PLL-properti.patch @@ -0,0 +1,42 @@ +From 58d3d07985c1adab31a3ed76360d016bb1c5b358 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Fri, 15 Oct 2021 23:50:22 +0100 +Subject: [PATCH] ARM: dts: NSP: MX65: add qca8k falling-edge, PLL properties + +This patch enables two properties for the QCA8337 switches on the MX65. + +Set the SGMII transmit clock to falling edge +"qca,sgmii-txclk-falling-edge" to conform to the OEM configuration [1]. + +The new explicit PLL enable option "qca,sgmii-enable-pll" is required +[2]. + +[1] https://git.kernel.org/netdev/net-next/c/6c43809bf1be +[2] https://git.kernel.org/netdev/net-next/c/bbc4799e8bb6 + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -118,6 +118,8 @@ + reg = <0>; + ethernet = <&sgmii1>; + phy-mode = "sgmii"; ++ qca,sgmii-enable-pll; ++ qca,sgmii-txclk-falling-edge; + fixed-link { + speed = <1000>; + full-duplex; +@@ -194,6 +196,8 @@ + reg = <0>; + ethernet = <&sgmii0>; + phy-mode = "sgmii"; ++ qca,sgmii-enable-pll; ++ qca,sgmii-txclk-falling-edge; + fixed-link { + speed = <1000>; + full-duplex; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0002-ARM-dts-BCM5301X-remove-unnecessary-address-size-cel.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0002-ARM-dts-BCM5301X-remove-unnecessary-address-size-cel.patch new file mode 100644 index 0000000000..3c3725adec --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0002-ARM-dts-BCM5301X-remove-unnecessary-address-size-cel.patch @@ -0,0 +1,29 @@ +From 835992e7eca4b29a87c204cefff2f7863fd087f3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Wed, 27 Oct 2021 00:57:03 +0800 +Subject: [PATCH] ARM: dts: BCM5301X: remove unnecessary address & size cells + from Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Remove the unnecessary #address-cells & #size-cells in the gpio-keys node +from the device tree of Asus RT-AC88U. + +Signed-off-by: Arınç ÜNAL +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 2 -- + 1 file changed, 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -68,8 +68,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + wps { + label = "WPS"; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0003-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0003-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch new file mode 100644 index 0000000000..562d5a22c7 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0003-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch @@ -0,0 +1,104 @@ +From b6c99228c8edc5e67d8229ba1c5f76cce210ddfc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Wed, 27 Oct 2021 00:57:06 +0800 +Subject: [PATCH] ARM: dts: BCM5301X: define RTL8365MB switch on Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Define the Realtek RTL8365MB switch without interrupt support on the device +tree of Asus RT-AC88U. + +Signed-off-by: Arınç ÜNAL +Acked-by: Alvin Šipraga +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 77 ++++++++++++++++++++ + 1 file changed, 77 insertions(+) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -93,6 +93,83 @@ + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + }; ++ ++ switch { ++ compatible = "realtek,rtl8365mb"; ++ /* 7 = MDIO (has input reads), 6 = MDC (clock, output only) */ ++ mdc-gpios = <&chipcommon 6 GPIO_ACTIVE_HIGH>; ++ mdio-gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>; ++ reset-gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>; ++ realtek,disable-leds; ++ dsa,member = <1 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan5"; ++ phy-handle = <ðphy0>; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan6"; ++ phy-handle = <ðphy1>; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan7"; ++ phy-handle = <ðphy2>; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan8"; ++ phy-handle = <ðphy3>; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ ethernet = <&sw0_p5>; ++ phy-mode = "rgmii"; ++ tx-internal-delay-ps = <2000>; ++ rx-internal-delay-ps = <2000>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ pause; ++ }; ++ }; ++ }; ++ ++ mdio { ++ compatible = "realtek,smi-mdio"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ethphy0: ethernet-phy@0 { ++ reg = <0>; ++ }; ++ ++ ethphy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ ++ ethphy2: ethernet-phy@2 { ++ reg = <2>; ++ }; ++ ++ ethphy3: ethernet-phy@3 { ++ reg = <3>; ++ }; ++ }; ++ }; + }; + + &srab { diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0004-ARM-BCM53016-MR32-convert-to-Broadcom-iProc-I2C-Driv.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0004-ARM-BCM53016-MR32-convert-to-Broadcom-iProc-I2C-Driv.patch new file mode 100644 index 0000000000..fae0f02cdf --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0004-ARM-BCM53016-MR32-convert-to-Broadcom-iProc-I2C-Driv.patch @@ -0,0 +1,104 @@ +From de7880016665afe7fa7d40e1fafa859260d53ba1 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 28 Oct 2021 09:03:44 +0200 +Subject: [PATCH] ARM: BCM53016: MR32: convert to Broadcom iProc I2C Driver +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +replaces the bit-banged i2c-gpio provided i2c functionality +with the hardware in the SoC. + +During review of the MR32, Florian Fainelli pointed out that the +SoC has a real I2C-controller. Furthermore, the connected pins +(SDA and SCL) would line up perfectly for use. Back then I couldn't +get it working though and I left it with i2c-gpio (which worked). + +Now we know the reason: the interrupt was incorrectly specified. +(Hence, this patch depends on Florian Fainelli's +"ARM: dts: BCM5301X: Fix I2C controller interrupt" patch). + +Cc: Florian Fainelli +Cc: Rafał Miłecki +Cc: Matthew Hagan +Signed-off-by: Christian Lamparter +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 62 ++++++++++------------ + 1 file changed, 28 insertions(+), 34 deletions(-) + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -84,40 +84,6 @@ + max-brightness = <255>; + }; + }; +- +- i2c { +- /* +- * The platform provided I2C does not budge. +- * This is a replacement until I can figure +- * out what are the missing bits... +- */ +- +- compatible = "i2c-gpio"; +- sda-gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; +- scl-gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>; +- i2c-gpio,delay-us = <10>; /* close to 100 kHz */ +- #address-cells = <1>; +- #size-cells = <0>; +- +- current_sense: ina219@45 { +- compatible = "ti,ina219"; +- reg = <0x45>; +- shunt-resistor = <60000>; /* = 60 mOhms */ +- }; +- +- eeprom: eeprom@50 { +- compatible = "atmel,24c64"; +- reg = <0x50>; +- pagesize = <32>; +- read-only; +- #address-cells = <1>; +- #size-cells = <1>; +- +- mac_address: mac-address@66 { +- reg = <0x66 0x6>; +- }; +- }; +- }; + }; + + &uart0 { +@@ -228,3 +194,31 @@ + }; + }; + }; ++ ++&i2c0 { ++ status = "okay"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinmux_i2c>; ++ ++ clock-frequency = <100000>; ++ ++ current_sense: ina219@45 { ++ compatible = "ti,ina219"; ++ reg = <0x45>; ++ shunt-resistor = <60000>; /* = 60 mOhms */ ++ }; ++ ++ eeprom: eeprom@50 { ++ compatible = "atmel,24c64"; ++ reg = <0x50>; ++ pagesize = <32>; ++ read-only; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ mac_address: mac-address@66 { ++ reg = <0x66 0x6>; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0005-ARM-dts-BCM5301X-update-CRU-block-description.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0005-ARM-dts-BCM5301X-update-CRU-block-description.patch new file mode 100644 index 0000000000..0a817e8fd1 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0005-ARM-dts-BCM5301X-update-CRU-block-description.patch @@ -0,0 +1,60 @@ +From 31fd9b79dc580301c53a001482755ba7e88c2809 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 29 Oct 2021 18:05:23 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: update CRU block description +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This describes CRU in a way matching documentation and fixes: + +arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dt.yaml: cru@100: $nodename:0: 'cru@100' does not match '^([a-z][a-z0-9\\-]+-bus|bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$' + From schema: /lib/python3.6/site-packages/dtschema/schemas/simple-bus.yaml + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm5301x.dtsi | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -423,14 +423,14 @@ + #address-cells = <1>; + #size-cells = <1>; + +- cru@100 { +- compatible = "simple-bus"; ++ cru-bus@100 { ++ compatible = "brcm,ns-cru", "simple-mfd"; + reg = <0x100 0x1a4>; + ranges; + #address-cells = <1>; + #size-cells = <1>; + +- lcpll0: lcpll0@100 { ++ lcpll0: clock-controller@100 { + #clock-cells = <1>; + compatible = "brcm,nsp-lcpll0"; + reg = <0x100 0x14>; +@@ -439,7 +439,7 @@ + "sdio", "ddr_phy"; + }; + +- genpll: genpll@140 { ++ genpll: clock-controller@140 { + #clock-cells = <1>; + compatible = "brcm,nsp-genpll"; + reg = <0x140 0x24>; +@@ -450,6 +450,11 @@ + "sata1", "sata2"; + }; + ++ syscon@180 { ++ compatible = "brcm,cru-clkset", "syscon"; ++ reg = <0x180 0x4>; ++ }; ++ + pinctrl: pin-controller@1c0 { + compatible = "brcm,bcm4708-pinmux"; + reg = <0x1c0 0x24>; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0006-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0006-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch new file mode 100644 index 0000000000..e01927bedf --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0006-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch @@ -0,0 +1,54 @@ +From 1a46061a2a4130a08841941ce6dcaa32be2ce312 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 23 Nov 2021 10:03:33 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: use non-deprecated USB 2.0 PHY binding +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The new binding covers a single reg and uses syscon to reference shared +register. + +References: 55b9b741712d ("dt-bindings: phy: brcm,ns-usb2-phy: bind just a PHY block") +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm5301x.dtsi | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -148,15 +148,6 @@ + }; + }; + +- usb2_phy: usb2-phy@1800c000 { +- compatible = "brcm,ns-usb2-phy"; +- reg = <0x1800c000 0x1000>; +- reg-names = "dmu"; +- #phy-cells = <0>; +- clocks = <&genpll BCM_NSP_GENPLL_USB_PHY_REF_CLK>; +- clock-names = "phy-ref-clk"; +- }; +- + axi@18000000 { + compatible = "brcm,bus-axi"; + reg = <0x18000000 0x1000>; +@@ -450,7 +441,16 @@ + "sata1", "sata2"; + }; + +- syscon@180 { ++ usb2_phy: phy@164 { ++ compatible = "brcm,ns-usb2-phy"; ++ reg = <0x164 0x4>; ++ brcm,syscon-clkset = <&cru_clkset>; ++ clocks = <&genpll BCM_NSP_GENPLL_USB_PHY_REF_CLK>; ++ clock-names = "phy-ref-clk"; ++ #phy-cells = <0>; ++ }; ++ ++ cru_clkset: syscon@180 { + compatible = "brcm,cru-clkset", "syscon"; + reg = <0x180 0x4>; + }; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0007-ARM-dts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0007-ARM-dts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch new file mode 100644 index 0000000000..1d28476bc6 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0007-ARM-dts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch @@ -0,0 +1,42 @@ +From 69c4e53bdd055ecc27761f6971a50c631ff9072e Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 2 Dec 2021 15:16:27 -0800 +Subject: [PATCH] ARM: dts: NSP: Fixed iProc PCIe MSI sub-node + +Rename the msi controller unit name to 'msi' to avoid collisions with +the 'msi-controller' boolean property. + +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -585,7 +585,7 @@ + status = "disabled"; + + msi-parent = <&msi0>; +- msi0: msi-controller { ++ msi0: msi { + compatible = "brcm,iproc-msi"; + msi-controller; + interrupt-parent = <&gic>; +@@ -622,7 +622,7 @@ + status = "disabled"; + + msi-parent = <&msi1>; +- msi1: msi-controller { ++ msi1: msi { + compatible = "brcm,iproc-msi"; + msi-controller; + interrupt-parent = <&gic>; +@@ -659,7 +659,7 @@ + status = "disabled"; + + msi-parent = <&msi2>; +- msi2: msi-controller { ++ msi2: msi { + compatible = "brcm,iproc-msi"; + msi-controller; + interrupt-parent = <&gic>; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0008-ARM-dts-NSP-Rename-SATA-unit-name.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0008-ARM-dts-NSP-Rename-SATA-unit-name.patch new file mode 100644 index 0000000000..887e0da059 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0008-ARM-dts-NSP-Rename-SATA-unit-name.patch @@ -0,0 +1,25 @@ +From 9a68c53f875e88edd3403c001ad85f4ac0ed3486 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Tue, 7 Dec 2021 10:19:09 -0800 +Subject: [PATCH] ARM: dts: NSP: Rename SATA unit name + +Rename the SATA controller unit name from ahci to sata in preparation +for adding the Broadcom SATA3 controller YAML binding which will bring +validation. + +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -532,7 +532,7 @@ + }; + }; + +- sata: ahci@41000 { ++ sata: sata@41000 { + compatible = "brcm,bcm-nsp-ahci"; + reg-names = "ahci", "top-ctrl"; + reg = <0x41000 0x1000>, <0x40020 0x1c>; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0009-ARM-dts-BCM5301X-correct-RX-delay-and-enable-flow-co.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0009-ARM-dts-BCM5301X-correct-RX-delay-and-enable-flow-co.patch new file mode 100644 index 0000000000..e81ec169b9 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0009-ARM-dts-BCM5301X-correct-RX-delay-and-enable-flow-co.patch @@ -0,0 +1,45 @@ +From 5e33f1c4a7cb914a003a304ab8eef705b17aabb7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Fri, 17 Dec 2021 00:03:19 +0800 +Subject: [PATCH] ARM: dts: BCM5301X: correct RX delay and enable flow control + on Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The current 'rx-internal-delay-ps' property value on the Realtek switch +node, 2000, will be divided by 300, resulting in 6.66, which will be +rounded to the closest step value, 7. Change it to 2100 to be accurate. +See ef136837aaf6 ("net: dsa: rtl8365mb: set RGMII RX delay in steps of +0.3 ns") for reference. + +Flow control needs to be enabled on both sides of the internal and +external switch. It is already enabled on the CPU port of the Realtek +switch so we also enable it on the external switch port of the Broadcom +switch as well. + +Signed-off-by: Arınç ÜNAL +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -138,7 +138,7 @@ + ethernet = <&sw0_p5>; + phy-mode = "rgmii"; + tx-internal-delay-ps = <2000>; +- rx-internal-delay-ps = <2000>; ++ rx-internal-delay-ps = <2100>; + + fixed-link { + speed = <1000>; +@@ -213,6 +213,7 @@ + fixed-link { + speed = <1000>; + full-duplex; ++ pause; + }; + }; + diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0010-Revert-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-A.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0010-Revert-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-A.patch new file mode 100644 index 0000000000..3d814b1252 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0010-Revert-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-A.patch @@ -0,0 +1,109 @@ +From 8b0c59c622dc4dab970ec63264fb5b152944ac80 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 23 Dec 2021 00:17:17 +0100 +Subject: [PATCH] Revert "ARM: dts: BCM5301X: define RTL8365MB switch on Asus + RT-AC88U" + +This reverts commit 3d2d52a0d1835b56f6bd67d268f6c39df0e41692, it caused +a build regression: + +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts:109.4-14: Warning (reg_format): /switch/ports:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1) +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts:106.9-149.5: Warning (avoid_default_addr_size): /switch/ports: Relying on default #address-cells value +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts:106.9-149.5: Warning (avoid_default_addr_size): /switch/ports: Relying on default #size-cells value + +Reported-by: Stephen Rothwell +Signed-off-by: Arnd Bergmann +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 77 -------------------- + 1 file changed, 77 deletions(-) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -93,83 +93,6 @@ + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + }; +- +- switch { +- compatible = "realtek,rtl8365mb"; +- /* 7 = MDIO (has input reads), 6 = MDC (clock, output only) */ +- mdc-gpios = <&chipcommon 6 GPIO_ACTIVE_HIGH>; +- mdio-gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>; +- reset-gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>; +- realtek,disable-leds; +- dsa,member = <1 0>; +- +- ports { +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <0>; +- +- port@0 { +- reg = <0>; +- label = "lan5"; +- phy-handle = <ðphy0>; +- }; +- +- port@1 { +- reg = <1>; +- label = "lan6"; +- phy-handle = <ðphy1>; +- }; +- +- port@2 { +- reg = <2>; +- label = "lan7"; +- phy-handle = <ðphy2>; +- }; +- +- port@3 { +- reg = <3>; +- label = "lan8"; +- phy-handle = <ðphy3>; +- }; +- +- port@6 { +- reg = <6>; +- label = "cpu"; +- ethernet = <&sw0_p5>; +- phy-mode = "rgmii"; +- tx-internal-delay-ps = <2000>; +- rx-internal-delay-ps = <2100>; +- +- fixed-link { +- speed = <1000>; +- full-duplex; +- pause; +- }; +- }; +- }; +- +- mdio { +- compatible = "realtek,smi-mdio"; +- #address-cells = <1>; +- #size-cells = <0>; +- +- ethphy0: ethernet-phy@0 { +- reg = <0>; +- }; +- +- ethphy1: ethernet-phy@1 { +- reg = <1>; +- }; +- +- ethphy2: ethernet-phy@2 { +- reg = <2>; +- }; +- +- ethphy3: ethernet-phy@3 { +- reg = <3>; +- }; +- }; +- }; + }; + + &srab { diff --git a/target/linux/bcm53xx/patches-5.4/039-v5.18-0001-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch b/target/linux/bcm53xx/patches-5.4/039-v5.18-0001-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch new file mode 100644 index 0000000000..77d3420ff8 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/039-v5.18-0001-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch @@ -0,0 +1,103 @@ +From 441d531ec9b766f49e01c107a3043235daa4493f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Sun, 2 Jan 2022 23:33:04 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: define RTL8365MB switch on Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Define the Realtek RTL8365MB switch without interrupt support on the device +tree of Asus RT-AC88U. + +Signed-off-by: Arınç ÜNAL +Acked-by: Alvin Šipraga +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 76 ++++++++++++++++++++ + 1 file changed, 76 insertions(+) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -93,6 +93,82 @@ + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + }; ++ ++ switch { ++ compatible = "realtek,rtl8365mb"; ++ /* 7 = MDIO (has input reads), 6 = MDC (clock, output only) */ ++ mdc-gpios = <&chipcommon 6 GPIO_ACTIVE_HIGH>; ++ mdio-gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>; ++ reset-gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>; ++ realtek,disable-leds; ++ dsa,member = <1 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan5"; ++ phy-handle = <ðphy0>; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan6"; ++ phy-handle = <ðphy1>; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan7"; ++ phy-handle = <ðphy2>; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan8"; ++ phy-handle = <ðphy3>; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ ethernet = <&sw0_p5>; ++ phy-mode = "rgmii"; ++ tx-internal-delay-ps = <2000>; ++ rx-internal-delay-ps = <2100>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ pause; ++ }; ++ }; ++ }; ++ ++ mdio { ++ compatible = "realtek,smi-mdio"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ethphy0: ethernet-phy@0 { ++ reg = <0>; ++ }; ++ ++ ethphy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ ++ ethphy2: ethernet-phy@2 { ++ reg = <2>; ++ }; ++ ++ ethphy3: ethernet-phy@3 { ++ reg = <3>; ++ }; ++ }; ++ }; + }; + + &srab { diff --git a/target/linux/bcm53xx/patches-5.4/039-v5.18-0002-ARM-dts-NSP-MX6X-get-mac-address-from-eeprom.patch b/target/linux/bcm53xx/patches-5.4/039-v5.18-0002-ARM-dts-NSP-MX6X-get-mac-address-from-eeprom.patch new file mode 100644 index 0000000000..19cf1fe952 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/039-v5.18-0002-ARM-dts-NSP-MX6X-get-mac-address-from-eeprom.patch @@ -0,0 +1,40 @@ +From 66848aff05f669e95795b5f3a163f4762781333e Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Wed, 23 Feb 2022 23:50:39 +0000 +Subject: [PATCH] ARM: dts: NSP: MX6X: get mac-address from eeprom + +The MAC address on the MX64/MX65 series is located on the AT24 EEPROM. +This is the same as other Meraki devices such as the MR32 [1]. + +[1] https://lore.kernel.org/linux-arm-kernel/fa8271d02ef74a687f365cebe5c55ec846963ab7.1631986106.git.chunkeey@gmail.com/ + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi +@@ -39,6 +39,8 @@ + + &amac2 { + status = "okay"; ++ nvmem-cells = <&mac_address>; ++ nvmem-cell-names = "mac-address"; + }; + + &ehci0 { +@@ -53,6 +55,12 @@ + reg = <0x50>; + pagesize = <32>; + read-only; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ mac_address: mac-address@66 { ++ reg = <0x66 0x6>; ++ }; + }; + }; + diff --git a/target/linux/bcm53xx/patches-5.4/039-v5.18-0003-ARM-dts-NSP-MX6X-correct-LED-function-types.patch b/target/linux/bcm53xx/patches-5.4/039-v5.18-0003-ARM-dts-NSP-MX6X-correct-LED-function-types.patch new file mode 100644 index 0000000000..2da45ff9da --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/039-v5.18-0003-ARM-dts-NSP-MX6X-correct-LED-function-types.patch @@ -0,0 +1,62 @@ +From 482c85c7fc95c572d368b2214b9e9d2c4a2e5789 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Wed, 23 Feb 2022 23:50:40 +0000 +Subject: [PATCH] ARM: dts: NSP: MX6X: correct LED function types + +Currently, the amber LED will remain always on. This is due to a +misinterpretation of the LED sub-node properties, where-by "default-state" +was used to indicate the initial state when powering on the device. When in +use, however, this resulted in the amber LED always being on. Instead change +this to only indicate a fault state. + +Assign LED_FUNCTION_POWER to the green PWM LED. + +These changes bring the MX64/65 in line with the MR32's devicetree. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 3 +-- + arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi | 3 +-- + arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi | 2 +- + 3 files changed, 3 insertions(+), 5 deletions(-) + +--- a/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -57,10 +57,9 @@ + + led-4 { + /* amber:power */ +- function = LED_FUNCTION_POWER; ++ function = LED_FUNCTION_FAULT; + color = ; + gpios = <&gpioa 3 GPIO_ACTIVE_HIGH>; +- default-state = "on"; + }; + + led-5 { +--- a/arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi +@@ -106,10 +106,9 @@ + + led-a { + /* amber:power */ +- function = LED_FUNCTION_POWER; ++ function = LED_FUNCTION_FAULT; + color = ; + gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; +- default-state = "on"; + }; + + led-b { +--- a/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi +@@ -22,7 +22,7 @@ + }; + + led-2 { +- function = LED_FUNCTION_INDICATOR; ++ function = LED_FUNCTION_POWER; + color = ; + pwms = <&pwm 2 50000>; + max-brightness = <255>; diff --git a/target/linux/bcm53xx/patches-5.4/039-v5.18-0004-ARM-dts-BCM5301X-Add-Ethernet-MAC-address-to-Luxul-X.patch b/target/linux/bcm53xx/patches-5.4/039-v5.18-0004-ARM-dts-BCM5301X-Add-Ethernet-MAC-address-to-Luxul-X.patch new file mode 100644 index 0000000000..c70fbc398b --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/039-v5.18-0004-ARM-dts-BCM5301X-Add-Ethernet-MAC-address-to-Luxul-X.patch @@ -0,0 +1,42 @@ +From c8442f0fb09ca3d842b9b23d1d0650f649fd10f8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 28 Feb 2022 10:52:07 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: Add Ethernet MAC address to Luxul + XWR-3150 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Luxul XWR-3150 stores MAC as NVRAM variable. Add NVMEM cell for it and +reference it in the Ethernet interface node. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts +@@ -25,6 +25,9 @@ + nvram@1eff0000 { + compatible = "brcm,nvram"; + reg = <0x1eff0000 0x10000>; ++ ++ et0macaddr: et0macaddr { ++ }; + }; + + leds { +@@ -72,6 +75,11 @@ + }; + }; + ++&gmac0 { ++ nvmem-cells = <&et0macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ + &usb3 { + vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>; + }; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0001-ARM-dts-BCM5301X-Update-pin-controller-node-name.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0001-ARM-dts-BCM5301X-Update-pin-controller-node-name.patch new file mode 100644 index 0000000000..690abb9270 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0001-ARM-dts-BCM5301X-Update-pin-controller-node-name.patch @@ -0,0 +1,32 @@ +From 130b5e32ba9d2d2313e39cf3f6d0729bff02b76a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Wed, 30 Mar 2022 14:05:27 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Update pin controller node name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes: +arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: cru-bus@100: 'pin-controller@1c0' does not match any of the regexes: '^clock-controller@[a-f0-9]+$', '^phy@[a-f0-9]+$', '^pinctrl@[a-f0-9]+$', '^syscon@[a-f0-9]+$', '^thermal@[a-f0-9]+$' + From schema: Documentation/devicetree/bindings/mfd/brcm,cru.yaml +arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: pin-controller@1c0: $nodename:0: 'pin-controller@1c0' does not match '^(pinctrl|pinmux)(@[0-9a-f]+)?$' + From schema: Documentation/devicetree/bindings/pinctrl/brcm,ns-pinmux.yaml + +Ref: e7391b021e3f ("dt-bindings: mfd: brcm,cru: Rename pinctrl node") +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm5301x.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -455,7 +455,7 @@ + reg = <0x180 0x4>; + }; + +- pinctrl: pin-controller@1c0 { ++ pinctrl: pinctrl@1c0 { + compatible = "brcm,bcm4708-pinmux"; + reg = <0x1c0 0x24>; + reg-names = "cru_gpio_control"; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0002-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-node.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0002-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-node.patch new file mode 100644 index 0000000000..e61fef8aab --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0002-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-node.patch @@ -0,0 +1,31 @@ +From 90103611d573c5c238350f9b1d7cb682c62f5681 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Fri, 1 Apr 2022 13:19:58 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Fix DTC warning for NAND node +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Remove the unnecessary #address-cells and #size-cells properties on the +nand@0 node to fix the warning below. + +Warning (avoid_unnecessary_addr_size): /nand-controller@18028000/nand@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property + +Signed-off-by: Arınç ÜNAL +Acked-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi | 2 -- + 1 file changed, 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi ++++ b/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi +@@ -10,8 +10,6 @@ + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; +- #address-cells = <1>; +- #size-cells = <1>; + + partitions { + compatible = "brcm,bcm947xx-cfe-partitions"; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0003-ARM-dts-BCM5301X-Remove-cell-properties-from-srab-po.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0003-ARM-dts-BCM5301X-Remove-cell-properties-from-srab-po.patch new file mode 100644 index 0000000000..6ef8720b1d --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0003-ARM-dts-BCM5301X-Remove-cell-properties-from-srab-po.patch @@ -0,0 +1,40 @@ +From e5ff0a7aab3ef5dd8ec7636b936c95179aa5ddfa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Fri, 1 Apr 2022 13:19:59 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Remove cell properties from srab ports on + Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Remove #address-cells and #size-cells properties from the ports node of +&srab. They are already defined on bcm5301x.dtsi, there's no need to define +them again. + +Signed-off-by: Arınç ÜNAL +Acked-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* +- * Copyright (C) 2021 Arınç ÜNAL ++ * Copyright (C) 2021-2022 Arınç ÜNAL + */ + + /dts-v1/; +@@ -177,9 +177,6 @@ + dsa,member = <0 0>; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + reg = <0>; + label = "lan4"; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0004-ARM-dts-BCM5301X-Add-rgmii-to-port-5-of-Broadcom-swi.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0004-ARM-dts-BCM5301X-Add-rgmii-to-port-5-of-Broadcom-swi.patch new file mode 100644 index 0000000000..aa192b3a11 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0004-ARM-dts-BCM5301X-Add-rgmii-to-port-5-of-Broadcom-swi.patch @@ -0,0 +1,29 @@ +From 4b7a67420a34ebd8fbf0111221a8bfd8001d418d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Fri, 1 Apr 2022 13:20:00 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Add rgmii to port@5 of Broadcom switch on + Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Define phy-mode of the Broadcom switch's port@5 as rgmii. This doesn't seem +to matter but let's explicitly define it since phy-mode as rgmii is defined +on the other side which is port@6 of the Realtek switch. + +Signed-off-by: Arınç ÜNAL +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -205,6 +205,7 @@ + sw0_p5: port@5 { + reg = <5>; + label = "extsw"; ++ phy-mode = "rgmii"; + + fixed-link { + speed = <1000>; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0005-ARM-dts-BCM5301X-Retrieve-gmac1-MAC-address-from-NVR.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0005-ARM-dts-BCM5301X-Retrieve-gmac1-MAC-address-from-NVR.patch new file mode 100644 index 0000000000..4c0858be0a --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0005-ARM-dts-BCM5301X-Retrieve-gmac1-MAC-address-from-NVR.patch @@ -0,0 +1,43 @@ +From 7f7f8c7b9f3cbae1355fb3b0ce4ea9d6f1552521 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Fri, 1 Apr 2022 13:20:01 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Retrieve gmac1 MAC address from NVRAM on + Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The et1macaddr NVRAM variable contains a MAC address for gmac1 on Asus +RT-AC88U. Add NVMEM cell for it and reference it in the gmac1 node. + +Signed-off-by: Arınç ÜNAL +Acked-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -25,6 +25,9 @@ + nvram@1c080000 { + compatible = "brcm,nvram"; + reg = <0x1c080000 0x00180000>; ++ ++ et1macaddr: et1macaddr { ++ }; + }; + + leds { +@@ -239,6 +242,11 @@ + }; + }; + ++&gmac1 { ++ nvmem-cells = <&et1macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ + &usb2 { + vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>; + }; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0006-ARM-dts-BCM5301X-Fix-compatible-strings-for-BCM53012.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0006-ARM-dts-BCM5301X-Fix-compatible-strings-for-BCM53012.patch new file mode 100644 index 0000000000..59e99dae62 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0006-ARM-dts-BCM5301X-Fix-compatible-strings-for-BCM53012.patch @@ -0,0 +1,65 @@ +From 69bb5c6f3f41fe6baa86a775c8a3e69dd27f85d6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Sat, 2 Apr 2022 23:46:21 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Fix compatible strings for BCM53012 and + BCM53016 SoC +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fix compatible strings for devicetrees using the BCM53012 and BCM53016 SoC. + +Signed-off-by: Arınç ÜNAL +Acked-by: Krzysztof Kozlowski +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 2 +- + arch/arm/boot/dts/bcm953012er.dts | 2 +- + arch/arm/boot/dts/bcm953012hr.dts | 2 +- + arch/arm/boot/dts/bcm953012k.dts | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -13,7 +13,7 @@ + #include + + / { +- compatible = "meraki,mr32", "brcm,brcm53016", "brcm,bcm4708"; ++ compatible = "meraki,mr32", "brcm,bcm53016", "brcm,bcm4708"; + model = "Meraki MR32"; + + chosen { +--- a/arch/arm/boot/dts/bcm953012er.dts ++++ b/arch/arm/boot/dts/bcm953012er.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Enterprise Router (BCM953012ER)"; +- compatible = "brcm,bcm953012er", "brcm,brcm53012", "brcm,bcm4708"; ++ compatible = "brcm,bcm953012er", "brcm,bcm53012", "brcm,bcm4708"; + + memory@0 { + device_type = "memory"; +--- a/arch/arm/boot/dts/bcm953012hr.dts ++++ b/arch/arm/boot/dts/bcm953012hr.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar HR (BCM953012HR)"; +- compatible = "brcm,bcm953012hr", "brcm,brcm53012", "brcm,bcm4708"; ++ compatible = "brcm,bcm953012hr", "brcm,bcm53012", "brcm,bcm4708"; + + aliases { + ethernet0 = &gmac0; +--- a/arch/arm/boot/dts/bcm953012k.dts ++++ b/arch/arm/boot/dts/bcm953012k.dts +@@ -36,7 +36,7 @@ + + / { + model = "NorthStar SVK (BCM953012K)"; +- compatible = "brcm,bcm953012k", "brcm,brcm53012", "brcm,bcm4708"; ++ compatible = "brcm,bcm953012k", "brcm,bcm53012", "brcm,bcm4708"; + + aliases { + serial0 = &uart0; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0007-ARM-dts-BCM5301X-Disable-gmac0-and-enable-port-8-on-.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0007-ARM-dts-BCM5301X-Disable-gmac0-and-enable-port-8-on-.patch new file mode 100644 index 0000000000..f75a53777f --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0007-ARM-dts-BCM5301X-Disable-gmac0-and-enable-port-8-on-.patch @@ -0,0 +1,39 @@ +From b9cff8783439ff1803709128af3a0e04c5f5f047 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Sun, 10 Apr 2022 12:44:55 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Disable gmac0 and enable port@8 on Asus + RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Disable gmac0 which is not connected to any switch MAC. Enable port@8 of +the Broadcom switch which is connected to gmac2. + +Signed-off-by: Arınç ÜNAL +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -232,7 +232,6 @@ + reg = <8>; + ethernet = <&gmac2>; + label = "cpu"; +- status = "disabled"; + + fixed-link { + speed = <1000>; +@@ -242,6 +241,10 @@ + }; + }; + ++&gmac0 { ++ status = "disabled"; ++}; ++ + &gmac1 { + nvmem-cells = <&et1macaddr>; + nvmem-cell-names = "mac-address"; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0008-ARM-dts-BCM5301X-Add-DT-for-WZR-1166DHP-DHP2.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0008-ARM-dts-BCM5301X-Add-DT-for-WZR-1166DHP-DHP2.patch new file mode 100644 index 0000000000..959dda35b8 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0008-ARM-dts-BCM5301X-Add-DT-for-WZR-1166DHP-DHP2.patch @@ -0,0 +1,300 @@ +From 417aea4436bb658d8c5c4dcd0e3c255931d0ee96 Mon Sep 17 00:00:00 2001 +From: SHIMAMOTO Takayoshi +Date: Fri, 22 Apr 2022 00:10:54 +0900 +Subject: [PATCH] ARM: dts: BCM5301X: Add DT for WZR-1166DHP,DHP2 + +Buffalo WZR-1166DHP/WZR-1166DHP2 wireless router with + + - BCM4708A0 + - 128MiB NAND flash + - 2T2R 11ac/a/b/g/n Wi-Fi + - 4x 10/100/1000M ethernet switch + - 1x USB 3.0 port + + WZR-1166DHP and WZR-1166DHP2 have different memory capacity. + + WZR-1166DHP + - 512 MiB DDR2 SDRAM + + WZR-1166DHP2 + - 256 MiB DDR2 SDRAM + + These hardware components are very similar to the WZR-1750DHP + except for the number of antennas. + +Signed-off-by: SHIMAMOTO Takayoshi +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 2 + + .../bcm4708-buffalo-wzr-1166dhp-common.dtsi | 192 ++++++++++++++++++ + .../boot/dts/bcm4708-buffalo-wzr-1166dhp.dts | 26 +++ + .../boot/dts/bcm4708-buffalo-wzr-1166dhp2.dts | 26 +++ + 4 files changed, 246 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi + create mode 100644 arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp.dts + create mode 100644 arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp2.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -89,6 +89,8 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4708-asus-rt-ac56u.dtb \ + bcm4708-asus-rt-ac68u.dtb \ + bcm4708-buffalo-wzr-1750dhp.dtb \ ++ bcm4708-buffalo-wzr-1166dhp.dtb \ ++ bcm4708-buffalo-wzr-1166dhp2.dtb \ + bcm4708-linksys-ea6300-v1.dtb \ + bcm4708-linksys-ea6500-v2.dtb \ + bcm4708-luxul-xap-1510.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi +@@ -0,0 +1,192 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Broadcom BCM470X / BCM5301X ARM platform code. ++ * DTS for Buffalo WZR-1166DHP and WZR-1166DHP2 ++ * ++ * Copyright (C) 2014 Rafał Miłecki ++ * Copyright (C) 2022 SHIMAMOTO Takayoshi ++ */ ++ ++ ++#include "bcm4708.dtsi" ++#include "bcm5301x-nand-cs0-bch8.dtsi" ++#include ++ ++/ { ++ spi { ++ compatible = "spi-gpio"; ++ num-chipselects = <1>; ++ gpio-sck = <&chipcommon 7 0>; ++ gpio-mosi = <&chipcommon 4 0>; ++ cs-gpios = <&chipcommon 6 0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ hc595: gpio_spi@0 { ++ compatible = "fairchild,74hc595"; ++ reg = <0>; ++ registers-number = <1>; ++ spi-max-frequency = <100000>; ++ ++ gpio-controller; ++ #gpio-cells = <2>; ++ ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ usb { ++ /* label = "bcm53xx:blue:usb"; */ ++ function = LED_FUNCTION_USB; ++ color = ; ++ gpios = <&hc595 0 GPIO_ACTIVE_HIGH>; ++ trigger-sources = <&ohci_port1>, <&ehci_port1>, ++ <&xhci_port1>, <&ohci_port2>, ++ <&ehci_port2>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ power0 { ++ /* label = "bcm53xx:red:power"; */ ++ function = LED_FUNCTION_FAULT; ++ color = ; ++ gpios = <&hc595 1 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ power1 { ++ /* label = "bcm53xx:white:power"; */ ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&hc595 2 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ router0 { ++ /* label = "bcm53xx:blue:router"; */ ++ function = LED_FUNCTION_STATUS; ++ color = ; ++ gpios = <&hc595 3 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ router1 { ++ /* label = "bcm53xx:amber:router"; */ ++ function = LED_FUNCTION_STATUS; ++ color = ; ++ gpios = <&hc595 4 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wan { ++ /* label = "bcm53xx:blue:wan"; */ ++ function = LED_FUNCTION_WAN; ++ color = ; ++ gpios = <&hc595 5 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ wireless0 { ++ /* label = "bcm53xx:blue:wireless"; */ ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&hc595 6 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wireless1 { ++ /* label = "bcm53xx:amber:wireless"; */ ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&hc595 7 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; ++ }; ++ ++ aoss { ++ label = "AOSS"; ++ linux,code = ; ++ gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>; ++ }; ++ ++ /* Commit mode set by switch? */ ++ mode { ++ label = "Mode"; ++ linux,code = ; ++ gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>; ++ }; ++ ++ /* Switch: AP mode */ ++ sw_ap { ++ label = "AP"; ++ linux,code = ; ++ gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; ++ }; ++ ++ eject { ++ label = "USB eject"; ++ linux,code = ; ++ gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&usb2 { ++ vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3 { ++ vcc-gpio = <&chipcommon 10 GPIO_ACTIVE_LOW>; ++}; ++ ++&spi_nor { ++ status = "okay"; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp.dts +@@ -0,0 +1,26 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindigs for Buffalo WZR-1166DHP ++ * ++ * Copyright (C) 2022 SHIMAMOTO Takayoshi ++ */ ++ ++/dts-v1/; ++ ++#include "bcm4708-buffalo-wzr-1166dhp-common.dtsi" ++ ++/ { ++ compatible = "buffalo,wzr-1166dhp", "brcm,bcm4708"; ++ model = "Buffalo WZR-1166DHP"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x18000000>; ++ }; ++ ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp2.dts +@@ -0,0 +1,26 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindigs for Buffalo WZR-1166DHP2 ++ * ++ * Copyright (C) 2022 SHIMAMOTO Takayoshi ++ */ ++ ++/dts-v1/; ++ ++#include "bcm4708-buffalo-wzr-1166dhp-common.dtsi" ++ ++/ { ++ compatible = "buffalo,wzr-1166dhp2", "brcm,bcm4708"; ++ model = "Buffalo WZR-1166DHP2"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x08000000>; ++ }; ++ ++}; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0009-Revert-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-nod.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0009-Revert-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-nod.patch new file mode 100644 index 0000000000..cc7e9741a7 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0009-Revert-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-nod.patch @@ -0,0 +1,32 @@ +From 18176b9d82eebaf4408dc0440f54d57a8cbced83 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 13 May 2022 11:11:07 +0200 +Subject: [PATCH] Revert "ARM: dts: BCM5301X: Fix DTC warning for NAND node" + +This reverts commit 90103611d573, which caused a new DTC warning + +arch/arm/boot/dts/bcm953012hr.dts:57.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@0:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) +arch/arm/boot/dts/bcm953012hr.dts:62.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@200000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) +arch/arm/boot/dts/bcm953012hr.dts:66.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@600000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) +arch/arm/boot/dts/bcm953012hr.dts:70.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@1000000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) +arch/arm/boot/dts/bcm953012hr.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm953012hr.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm953012hr.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm953012hr.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format' + +Signed-off-by: Arnd Bergmann +--- + arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi ++++ b/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi +@@ -10,6 +10,8 @@ + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; ++ #address-cells = <1>; ++ #size-cells = <1>; + + partitions { + compatible = "brcm,bcm947xx-cfe-partitions"; diff --git a/target/linux/bcm53xx/patches-5.4/041-v6.0-0001-ARM-dts-broadcom-align-gpio-key-node-names-with-dtsc.patch b/target/linux/bcm53xx/patches-5.4/041-v6.0-0001-ARM-dts-broadcom-align-gpio-key-node-names-with-dtsc.patch new file mode 100644 index 0000000000..33d675297e --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/041-v6.0-0001-ARM-dts-broadcom-align-gpio-key-node-names-with-dtsc.patch @@ -0,0 +1,912 @@ +From c5aec5611aec8fb1ca68f68e41acaefccfc93c16 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Thu, 9 Jun 2022 13:39:30 +0200 +Subject: [PATCH] ARM: dts: broadcom: align gpio-key node names with dtschema + +The node names should be generic and DT schema expects certain pattern +(e.g. with key/button/switch). + +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts | 6 +++--- + arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts | 8 ++++---- + .../boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi | 10 +++++----- + arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts | 10 +++++----- + arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts | 4 ++-- + arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts | 4 ++-- + arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts | 2 +- + arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts | 2 +- + arch/arm/boot/dts/bcm4708-netgear-r6250.dts | 6 +++--- + arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts | 6 +++--- + arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts | 6 +++--- + arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts | 4 ++-- + arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts | 8 ++++---- + arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts | 2 +- + arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts | 2 +- + arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts | 2 +- + arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts | 4 ++-- + arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts | 4 ++-- + arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts | 12 ++++++------ + arch/arm/boot/dts/bcm4709-linksys-ea9200.dts | 4 ++-- + arch/arm/boot/dts/bcm4709-netgear-r7000.dts | 6 +++--- + arch/arm/boot/dts/bcm4709-netgear-r8000.dts | 8 ++++---- + arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts | 4 ++-- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 8 ++++---- + arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts | 6 +++--- + arch/arm/boot/dts/bcm47094-linksys-panamera.dts | 6 +++--- + arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts | 2 +- + arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts | 2 +- + arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts | 2 +- + arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts | 2 +- + arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts | 2 +- + arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts | 2 +- + arch/arm/boot/dts/bcm47094-netgear-r8500.dts | 8 ++++---- + arch/arm/boot/dts/bcm47094-phicomm-k3.dts | 2 +- + arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts | 2 +- + arch/arm/boot/dts/bcm47189-luxul-xap-810.dts | 2 +- + arch/arm/boot/dts/bcm47189-tenda-ac9.dts | 6 +++--- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 2 +- + arch/arm/boot/dts/bcm911360_entphn.dts | 4 ++-- + arch/arm/boot/dts/bcm947189acdbmr.dts | 4 ++-- + arch/arm/boot/dts/bcm953012er.dts | 4 ++-- + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 2 +- + arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi | 2 +- + 43 files changed, 97 insertions(+), 97 deletions(-) + +--- a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts ++++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts +@@ -70,19 +70,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts ++++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts +@@ -54,25 +54,25 @@ + gpio-keys { + compatible = "gpio-keys"; + +- brightness { ++ button-brightness { + label = "Backlight"; + linux,code = ; + gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi +@@ -104,33 +104,33 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + +- aoss { ++ button-aoss { + label = "AOSS"; + linux,code = ; + gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>; + }; + + /* Commit mode set by switch? */ +- mode { ++ button-mode { + label = "Mode"; + linux,code = ; + gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>; + }; + + /* Switch: AP mode */ +- sw_ap { ++ button-sw-ap { + label = "AP"; + linux,code = ; + gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; + }; + +- eject { ++ button-eject { + label = "USB eject"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +@@ -100,33 +100,33 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + +- aoss { ++ button-aoss { + label = "AOSS"; + linux,code = ; + gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>; + }; + + /* Commit mode set by switch? */ +- mode { ++ button-mode { + label = "Mode"; + linux,code = ; + gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>; + }; + + /* Switch: AP mode */ +- sw_ap { ++ button-sw-ap { + label = "AP"; + linux,code = ; + gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; + }; + +- eject { ++ button-eject { + label = "USB eject"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts +@@ -29,13 +29,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +@@ -25,13 +25,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts ++++ b/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts +@@ -45,7 +45,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts ++++ b/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts +@@ -52,7 +52,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts +@@ -63,19 +63,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +@@ -59,19 +59,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts ++++ b/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts +@@ -94,19 +94,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts ++++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +@@ -60,13 +60,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts +@@ -91,26 +91,26 @@ + gpio-keys { + compatible = "gpio-keys"; + +- aoss { ++ button-aoss { + label = "AOSS"; + linux,code = ; + gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + + /* Switch device mode? */ +- mode { ++ button-mode { + label = "Mode"; + linux,code = ; + gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; + }; + +- eject { ++ button-eject { + label = "USB eject"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts +@@ -96,7 +96,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts ++++ b/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts +@@ -45,7 +45,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts ++++ b/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts +@@ -94,7 +94,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts ++++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +@@ -77,13 +77,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts ++++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +@@ -50,13 +50,13 @@ + #address-cells = <1>; + #size-cells = <0>; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts ++++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +@@ -80,39 +80,39 @@ + #address-cells = <1>; + #size-cells = <0>; + +- power { ++ button-power { + label = "Power"; + linux,code = ; + gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; + }; + +- aoss { ++ button-aoss { + label = "AOSS"; + linux,code = ; + gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>; + }; + + /* Commit mode set by switch? */ +- mode { ++ button-mode { + label = "Mode"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; + }; + + /* Switch: AP mode */ +- sw_ap { ++ button-sw-ap { + label = "AP"; + linux,code = ; + gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>; + }; + +- eject { ++ button-eject { + label = "USB eject"; + linux,code = ; + gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts ++++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +@@ -32,13 +32,13 @@ + #address-cells = <1>; + #size-cells = <0>; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +@@ -75,19 +75,19 @@ + #address-cells = <1>; + #size-cells = <0>; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -102,25 +102,25 @@ + #address-cells = <1>; + #size-cells = <0>; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>; + }; + +- brightness { ++ button-brightness { + label = "Backlight"; + linux,code = ; + gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts ++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +@@ -80,13 +80,13 @@ + #address-cells = <1>; + #size-cells = <0>; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -72,25 +72,25 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>; + }; + +- reset { ++ button-reset { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + +- wifi { ++ button-wifi { + label = "Wi-Fi"; + linux,code = ; + gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>; + }; + +- led { ++ button-led { + label = "Backlight"; + linux,code = ; + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +@@ -86,20 +86,20 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + + /* Switch: router / extender */ +- extender { ++ button-extender { + label = "Extender"; + linux,code = ; + gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts ++++ b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts +@@ -30,19 +30,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>; + }; + +- reset { ++ button-reset { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts +@@ -49,7 +49,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts +@@ -43,7 +43,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts +@@ -49,7 +49,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts +@@ -37,7 +37,7 @@ + #address-cells = <1>; + #size-cells = <0>; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts +@@ -89,7 +89,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts +@@ -67,7 +67,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts ++++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts +@@ -65,25 +65,25 @@ + gpio-keys { + compatible = "gpio-keys"; + +- brightness { ++ button-brightness { + label = "Backlight"; + linux,code = ; + gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-phicomm-k3.dts ++++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +@@ -22,7 +22,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts ++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts +@@ -39,7 +39,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts ++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts +@@ -49,7 +49,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47189-tenda-ac9.dts ++++ b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts +@@ -59,19 +59,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -50,7 +50,7 @@ + #address-cells = <1>; + #size-cells = <0>; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm911360_entphn.dts ++++ b/arch/arm/boot/dts/bcm911360_entphn.dts +@@ -47,10 +47,10 @@ + stdout-path = "serial0:115200n8"; + }; + +- gpio_keys { ++ gpio-keys { + compatible = "gpio-keys"; + +- hook { ++ button-hook { + label = "HOOK"; + linux,code = ; + gpios = <&gpio_asiu 48 0>; +--- a/arch/arm/boot/dts/bcm947189acdbmr.dts ++++ b/arch/arm/boot/dts/bcm947189acdbmr.dts +@@ -44,13 +44,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm953012er.dts ++++ b/arch/arm/boot/dts/bcm953012er.dts +@@ -47,13 +47,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -13,7 +13,7 @@ + autorepeat; + poll-interval = <20>; + +- reset { ++ button-reset { + label = "reset"; + linux,code = ; + gpios = <&gpioa 8 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi +@@ -14,7 +14,7 @@ + autorepeat; + poll-interval = <20>; + +- reset { ++ button-reset { + label = "reset"; + linux,code = ; + gpios = <&gpioa 6 GPIO_ACTIVE_LOW>; diff --git a/target/linux/bcm53xx/patches-5.4/041-v6.0-0002-ARM-dts-broadcom-correct-gpio-keys-properties.patch b/target/linux/bcm53xx/patches-5.4/041-v6.0-0002-ARM-dts-broadcom-correct-gpio-keys-properties.patch new file mode 100644 index 0000000000..7bded431b0 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/041-v6.0-0002-ARM-dts-broadcom-correct-gpio-keys-properties.patch @@ -0,0 +1,108 @@ +From d634a6969c03803a945fdc2bccbe7d813420e569 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Thu, 9 Jun 2022 13:39:31 +0200 +Subject: [PATCH] ARM: dts: broadcom: correct gpio-keys properties + +gpio-keys children do not use unit addresses. + +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts | 2 -- + arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts | 2 -- + arch/arm/boot/dts/bcm4709-linksys-ea9200.dts | 2 -- + arch/arm/boot/dts/bcm4709-netgear-r7000.dts | 2 -- + arch/arm/boot/dts/bcm4709-netgear-r8000.dts | 2 -- + arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts | 2 -- + arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts | 2 -- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 2 -- + 8 files changed, 16 deletions(-) + +--- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts ++++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +@@ -47,8 +47,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-wps { + label = "WPS"; +--- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts ++++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +@@ -77,8 +77,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-power { + label = "Power"; +--- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts ++++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +@@ -29,8 +29,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-wps { + label = "WPS"; +--- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +@@ -72,8 +72,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-wps { + label = "WPS"; +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -99,8 +99,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-rfkill { + label = "WiFi"; +--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts ++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +@@ -77,8 +77,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-wps { + label = "WPS"; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts +@@ -34,8 +34,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-restart { + label = "Reset"; +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -47,8 +47,6 @@ + + keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-restart { + label = "Reset"; diff --git a/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-BCM5301X-Correct-description-of-TP-Link-part.patch b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-BCM5301X-Correct-description-of-TP-Link-part.patch new file mode 100644 index 0000000000..4c4ed036b9 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-BCM5301X-Correct-description-of-TP-Link-part.patch @@ -0,0 +1,99 @@ +From c8ee9f119bfb4244f76c9971c341ec06b49332cd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 8 Nov 2022 12:07:08 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: Correct description of TP-Link partitions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +TP-Link routers have flash space partitioned according to the partitions +table. It may look like fixed partitioning but those partitions can be +actually reorganized. New can be added (or some removed), offsets and +sizes may change. + +Fix DT to use binding for the TP-Link SafeLoader partitioning method. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20221108110708.13693-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../boot/dts/bcm47081-tplink-archer-c5-v2.dts | 25 ++++--------------- + .../boot/dts/bcm4709-tplink-archer-c9-v1.dts | 25 ++++--------------- + 2 files changed, 10 insertions(+), 40 deletions(-) + +--- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts ++++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +@@ -95,30 +95,15 @@ + status = "okay"; + + partitions { +- compatible = "fixed-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; ++ compatible = "tplink,safeloader-partitions"; ++ partitions-table-offset = <0xe50000>; + +- boot@0 { +- label = "boot"; +- reg = <0x000000 0x040000>; +- read-only; +- }; +- +- os-image@100000 { +- label = "os-image"; +- reg = <0x040000 0x200000>; ++ partition-os-image { + compatible = "brcm,trx"; + }; + +- rootfs@240000 { +- label = "rootfs"; +- reg = <0x240000 0xc00000>; +- }; +- +- nvram@ff0000 { +- label = "nvram"; +- reg = <0xff0000 0x010000>; ++ partition-file-system { ++ linux,rootfs; + }; + }; + }; +--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts ++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +@@ -104,30 +104,15 @@ + status = "okay"; + + partitions { +- compatible = "fixed-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; ++ compatible = "tplink,safeloader-partitions"; ++ partitions-table-offset = <0xe50000>; + +- boot@0 { +- label = "boot"; +- reg = <0x000000 0x040000>; +- read-only; +- }; +- +- os-image@100000 { +- label = "os-image"; +- reg = <0x040000 0x200000>; ++ partition-os-image { + compatible = "brcm,trx"; + }; + +- rootfs@240000 { +- label = "rootfs"; +- reg = <0x240000 0xc00000>; +- }; +- +- nvram@ff0000 { +- label = "nvram"; +- reg = <0xff0000 0x010000>; ++ partition-file-system { ++ linux,rootfs; + }; + }; + }; diff --git a/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm47094-Add-devicetree-for-D-Link-DIR-890L.patch b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm47094-Add-devicetree-for-D-Link-DIR-890L.patch new file mode 100644 index 0000000000..3e3b4f84f6 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm47094-Add-devicetree-for-D-Link-DIR-890L.patch @@ -0,0 +1,242 @@ +From b1ba87897ceda8e49a47aa92832dd7bff8583e21 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Mon, 7 Nov 2022 14:41:04 +0100 +Subject: [PATCH] ARM: dts: bcm47094: Add devicetree for D-Link DIR-890L + +This adds a device tree for the D-Link DIR-890L. This device +is very similar to D-Link DIR-885L, the differences are detailed +as a comment in the DTS file. + +Signed-off-by: Linus Walleij +Link: https://lore.kernel.org/r/20221107134104.1422169-2-linus.walleij@linaro.org +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts | 211 ++++++++++++++++++ + 2 files changed, 212 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -112,6 +112,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4709-tplink-archer-c9-v1.dtb \ + bcm47094-asus-rt-ac88u.dtb \ + bcm47094-dlink-dir-885l.dtb \ ++ bcm47094-dlink-dir-890l.dtb \ + bcm47094-linksys-panamera.dtb \ + bcm47094-luxul-abr-4500.dtb \ + bcm47094-luxul-xap-1610.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts +@@ -0,0 +1,211 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device tree for D-Link DIR-890L ++ * D-Link calls this board "WRGAC36" ++ * this router has the same looks and form factor as D-Link DIR-885L. ++ * ++ * Some differences from DIR-885L include a separate USB2 port, separate LEDs ++ * for USB2 and USB3, a separate VCC supply for the USB2 slot and no ++ * router/extender switch is mounted (there is an empty mount point on the ++ * PCB) so this device is a pure router. Also the LAN ports are in the right ++ * order. ++ * ++ * Based on the device tree for DIR-885L ++ * Copyright (C) 2016 Rafał Miłecki ++ * Copyright (C) 2022 Linus Walleij ++ */ ++ ++/dts-v1/; ++ ++#include "bcm47094.dtsi" ++#include "bcm5301x-nand-cs0-bch1.dtsi" ++ ++/ { ++ compatible = "dlink,dir-890l", "brcm,bcm47094", "brcm,bcm4708"; ++ model = "D-Link DIR-890L"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200 earlycon"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x08000000>; ++ }; ++ ++ leds { ++ /* ++ * LED information is derived from the boot log which ++ * conveniently lists all the LEDs. ++ */ ++ compatible = "gpio-leds"; ++ ++ power-white { ++ label = "bcm53xx:white:power"; ++ gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ wan-white { ++ label = "bcm53xx:white:wan"; ++ gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ power-amber { ++ label = "bcm53xx:amber:power"; ++ gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wan-amber { ++ label = "bcm53xx:amber:wan"; ++ gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb3-white { ++ label = "bcm53xx:white:usb3"; ++ gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&xhci_port1>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ usb2-white { ++ label = "bcm53xx:white:usb2"; ++ gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ohci_port1>, <&ehci_port1>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ 2ghz { ++ label = "bcm53xx:white:2ghz"; ++ gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>; ++ }; ++ ++ 5ghz { ++ label = "bcm53xx:white:5ghz"; ++ gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ button-wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; ++ }; ++ ++ /* Called "factory reset" in the vendor dmesg */ ++ button-restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ /* ++ * The flash memory is memory mapped at 0x1e000000-0x1fffffff ++ * 64KB blocks; total size 2MB, same that can be ++ * found attached to the spi_nor SPI controller. ++ */ ++ nvram@1e1f0000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1e1f0000 0x00010000>; ++ ++ et0macaddr: et0macaddr { ++ }; ++ }; ++}; ++ ++&gmac2 { ++ /* ++ * The NVRAM curiously does not contain a MAC address ++ * for et2 so since that is the only ethernet interface ++ * actually in use on the platform, we use this et0 MAC ++ * address for et2. ++ */ ++ nvmem-cells = <&et0macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&spi_nor { ++ status = "okay"; ++}; ++ ++&nandcs { ++ /* Spansion S34ML01G2, 128MB with 128KB erase blocks */ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ /* ++ * This is called "nflash" in the vendor kernel with ++ * "upgrade" and "rootfs" (probably using OpenWrt ++ * splitpart). We call it "firmware" like standard tools ++ * assume. The CFE loader contains incorrect information ++ * about TRX partitions, ignore this, there are no TRX ++ * partitions: this device uses SEAMA. ++ */ ++ firmware@0 { ++ label = "firmware"; ++ reg = <0x00000000 0x08000000>; ++ }; ++ }; ++}; ++ ++&usb2 { ++ vcc-gpios = <&chipcommon 21 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3 { ++ vcc-gpios = <&chipcommon 18 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ phy-mode = "rgmii"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm53016-Add-devicetree-for-D-Link-DWL-8610A.patch b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm53016-Add-devicetree-for-D-Link-DWL-8610A.patch new file mode 100644 index 0000000000..6102963f82 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm53016-Add-devicetree-for-D-Link-DWL-8610A.patch @@ -0,0 +1,165 @@ +From 9f66e1dd82e3186aee95282657512ca2aef1afe0 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Wed, 19 Oct 2022 21:34:49 +0200 +Subject: [PATCH] ARM: dts: bcm53016: Add devicetree for D-Link DWL-8610AP + +This adds a device tree for the BCM53016-based D-Link DWL-8610AP +access point wireless router. + +The TRX-format partitions had to be named "firmware" due to +an OpenWrt patch that only accepts parting such nodes if they +are named "firmware". + +Signed-off-by: Linus Walleij +Link: https://lore.kernel.org/r/20221019193449.3036010-2-linus.walleij@linaro.org +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + .../boot/dts/bcm53016-dlink-dwl-8610ap.dts | 131 ++++++++++++++++++ + 2 files changed, 132 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm53016-dlink-dwl-8610ap.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -122,6 +122,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm47094-luxul-xwr-3150-v1.dtb \ + bcm47094-netgear-r8500.dtb \ + bcm47094-phicomm-k3.dtb \ ++ bcm53016-dlink-dwl-8610ap.dtb \ + bcm53016-meraki-mr32.dtb \ + bcm94708.dtb \ + bcm94709.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm53016-dlink-dwl-8610ap.dts +@@ -0,0 +1,131 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/dts-v1/; ++ ++#include "bcm4709.dtsi" ++#include "bcm5301x-nand-cs0-bch8.dtsi" ++#include ++#include ++ ++/ { ++ model = "D-Link DWL-8610AP"; ++ compatible = "dlink,dwl-8610ap", "brcm,bcm53016", "brcm,bcm4708"; ++ ++ memory@0 { ++ device_type = "memory"; ++ /* 512 MB RAM in 2 x Macronix D9PSH chips */ ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x08000000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ power { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>; ++ default-state = "on"; ++ }; ++ ++ diag { ++ /* Actually "diag" unclear what this means */ ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; ++ default-state = "on"; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ wlan-2g { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wlan-5g { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio_keys { ++ compatible = "gpio-keys"; ++ ++ button-reset { ++ debounce-interval = <100>; ++ wakeup-source; ++ linux,code = ; ++ label = "reset"; ++ /* This GPIO is actually stored in NVRAM, but it's not gonna change */ ++ gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ /* ++ * Flash memory at 0x1e000000-0x1fffffff ++ * Macronix 32 64KB blocks; total size 2MB, same that can be ++ * found attached to the spi_nor SPI controller. ++ */ ++ nvram@1e080000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1e080000 0x00020000>; ++ ++ et0macaddr: et0macaddr { ++ }; ++ ++ et1macaddr: et1macaddr { ++ }; ++ }; ++}; ++ ++&gmac0 { ++ nvmem-cells = <&et0macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&gmac1 { ++ nvmem-cells = <&et1macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&spi_nor { ++ /* Serial SPI NOR Flash MX 25L1606E */ ++ status = "okay"; ++}; ++ ++&nandcs { ++ /* ++ * Spansion S34ML01G100TFI00 128 MB NAND Flash memory ++ * ++ * This ECC is a bit unorthodox but it is what the stock firmware ++ * is using, so to be able to mount the original partitions ++ * this is necessary. ++ */ ++ nand-ecc-strength = <5>; ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ /* This is named nflash1.trx in CFE */ ++ trx@0 { ++ label = "firmware"; ++ reg = <0x00000000 0x02800000>; ++ compatible = "brcm,trx"; ++ }; ++ ++ /* This is named nflash1.trx2 in CFE */ ++ trx2@2800000 { ++ label = "firmware2"; ++ reg = <0x02800000 0x02800000>; ++ compatible = "brcm,trx"; ++ }; ++ ++ /* This is named nflash1.rwfs in CFE */ ++ free@5000000 { ++ label = "free"; ++ reg = <0x05000000 0x03000000>; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/070-v5.17-phy-bcm-ns-usb2-support-updated-DT-binding-with-PHY-.patch b/target/linux/bcm53xx/patches-5.4/070-v5.17-phy-bcm-ns-usb2-support-updated-DT-binding-with-PHY-.patch new file mode 100644 index 0000000000..464849bc69 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/070-v5.17-phy-bcm-ns-usb2-support-updated-DT-binding-with-PHY-.patch @@ -0,0 +1,131 @@ +From d3bc6269e21fc474763708e79c7a118740befb94 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 26 Oct 2021 11:37:16 +0200 +Subject: [PATCH] phy: bcm-ns-usb2: support updated DT binding with PHY reg + space +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Updated DT binding maps just a PHY's register space instead of the whole +DMU block. Accessing a common CRU reg is handled using syscon & +regmap. + +The old binding has been deprecated and remains supported as a fallback +method. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20211026093716.5567-1-zajec5@gmail.com +Signed-off-by: Vinod Koul +--- + drivers/phy/broadcom/phy-bcm-ns-usb2.c | 52 +++++++++++++++++++++----- + 1 file changed, 43 insertions(+), 9 deletions(-) + +--- a/drivers/phy/broadcom/phy-bcm-ns-usb2.c ++++ b/drivers/phy/broadcom/phy-bcm-ns-usb2.c +@@ -9,17 +9,23 @@ + #include + #include + #include ++#include + #include + #include + #include + #include + #include ++#include + #include + + struct bcm_ns_usb2 { + struct device *dev; + struct clk *ref_clk; + struct phy *phy; ++ struct regmap *clkset; ++ void __iomem *base; ++ ++ /* Deprecated binding */ + void __iomem *dmu; + }; + +@@ -27,7 +33,6 @@ static int bcm_ns_usb2_phy_init(struct p + { + struct bcm_ns_usb2 *usb2 = phy_get_drvdata(phy); + struct device *dev = usb2->dev; +- void __iomem *dmu = usb2->dmu; + u32 ref_clk_rate, usb2ctl, usb_pll_ndiv, usb_pll_pdiv; + int err = 0; + +@@ -44,7 +49,10 @@ static int bcm_ns_usb2_phy_init(struct p + goto err_clk_off; + } + +- usb2ctl = readl(dmu + BCMA_DMU_CRU_USB2_CONTROL); ++ if (usb2->base) ++ usb2ctl = readl(usb2->base); ++ else ++ usb2ctl = readl(usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL); + + if (usb2ctl & BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_PDIV_MASK) { + usb_pll_pdiv = usb2ctl; +@@ -58,15 +66,24 @@ static int bcm_ns_usb2_phy_init(struct p + usb_pll_ndiv = (1920000000 * usb_pll_pdiv) / ref_clk_rate; + + /* Unlock DMU PLL settings with some magic value */ +- writel(0x0000ea68, dmu + BCMA_DMU_CRU_CLKSET_KEY); ++ if (usb2->clkset) ++ regmap_write(usb2->clkset, 0, 0x0000ea68); ++ else ++ writel(0x0000ea68, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY); + + /* Write USB 2.0 PLL control setting */ + usb2ctl &= ~BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_MASK; + usb2ctl |= usb_pll_ndiv << BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_SHIFT; +- writel(usb2ctl, dmu + BCMA_DMU_CRU_USB2_CONTROL); ++ if (usb2->base) ++ writel(usb2ctl, usb2->base); ++ else ++ writel(usb2ctl, usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL); + + /* Lock DMU PLL settings */ +- writel(0x00000000, dmu + BCMA_DMU_CRU_CLKSET_KEY); ++ if (usb2->clkset) ++ regmap_write(usb2->clkset, 0, 0x00000000); ++ else ++ writel(0x00000000, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY); + + err_clk_off: + clk_disable_unprepare(usb2->ref_clk); +@@ -91,11 +108,28 @@ static int bcm_ns_usb2_probe(struct plat + return -ENOMEM; + usb2->dev = dev; + +- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmu"); +- usb2->dmu = devm_ioremap_resource(dev, res); +- if (IS_ERR(usb2->dmu)) { +- dev_err(dev, "Failed to map DMU regs\n"); +- return PTR_ERR(usb2->dmu); ++ if (of_find_property(dev->of_node, "brcm,syscon-clkset", NULL)) { ++ usb2->base = devm_platform_ioremap_resource(pdev, 0); ++ if (IS_ERR(usb2->base)) { ++ dev_err(dev, "Failed to map control reg\n"); ++ return PTR_ERR(usb2->base); ++ } ++ ++ usb2->clkset = syscon_regmap_lookup_by_phandle(dev->of_node, ++ "brcm,syscon-clkset"); ++ if (IS_ERR(usb2->clkset)) { ++ dev_err(dev, "Failed to lookup clkset regmap\n"); ++ return PTR_ERR(usb2->clkset); ++ } ++ } else { ++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmu"); ++ usb2->dmu = devm_ioremap_resource(dev, res); ++ if (IS_ERR(usb2->dmu)) { ++ dev_err(dev, "Failed to map DMU regs\n"); ++ return PTR_ERR(usb2->dmu); ++ } ++ ++ dev_warn(dev, "using deprecated DT binding\n"); + } + + usb2->ref_clk = devm_clk_get(dev, "phy-ref-clk"); diff --git a/target/linux/bcm53xx/patches-5.4/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch b/target/linux/bcm53xx/patches-5.4/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch new file mode 100644 index 0000000000..0fb29e99d3 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch @@ -0,0 +1,711 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] ARM: dts: BCM5301X: Specify switch ports for remaining + devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Rafał Miłecki +--- + +--- a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts ++++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts +@@ -93,3 +93,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts ++++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts +@@ -83,3 +83,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +@@ -149,3 +149,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts +@@ -46,3 +46,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +@@ -42,3 +42,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +@@ -86,3 +86,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts ++++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +@@ -77,3 +77,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts ++++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +@@ -66,6 +66,38 @@ + status = "okay"; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@7 { ++ reg = <7>; ++ label = "cpu"; ++ ethernet = <&gmac1>; ++ }; ++ }; ++}; ++ + &nandcs { + partitions { + compatible = "fixed-partitions"; +--- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts ++++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +@@ -130,3 +130,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts ++++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +@@ -47,3 +47,45 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +@@ -104,3 +104,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts ++++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts +@@ -94,3 +94,45 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-phicomm-k3.dts ++++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +@@ -38,6 +38,38 @@ + status = "okay"; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ + &nandcs { + partitions { + compatible = "fixed-partitions"; +--- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts ++++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +@@ -91,6 +91,43 @@ + }; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ + &spi_nor { + status = "okay"; + +--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts ++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +@@ -100,6 +100,43 @@ + vcc-gpio = <&chipcommon 12 GPIO_ACTIVE_HIGH>; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ + &spi_nor { + status = "okay"; + +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts +@@ -107,3 +107,41 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ diff --git a/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch b/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch index b0800e50ae..60fc630a49 100644 --- a/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch +++ b/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch @@ -9,14 +9,14 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -106,6 +106,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ +@@ -108,6 +108,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ bcm4709-buffalo-wxr-1900dhp.dtb \ bcm4709-linksys-ea9200.dtb \ bcm4709-netgear-r7000.dtb \ + bcm4709-netgear-r7900.dtb \ bcm4709-netgear-r8000.dtb \ bcm4709-tplink-archer-c9-v1.dtb \ - bcm47094-dlink-dir-885l.dtb \ + bcm47094-asus-rt-ac88u.dtb \ --- /dev/null +++ b/arch/arm/boot/dts/bcm4709-netgear-r7900.dts @@ -0,0 +1,42 @@ diff --git a/target/linux/bcm53xx/patches-5.4/311-ARM-BCM5301X-Add-power-button-for-Buffalo-WZR-1750DHP.patch b/target/linux/bcm53xx/patches-5.4/311-ARM-BCM5301X-Add-power-button-for-Buffalo-WZR-1750DHP.patch index b3cb5de048..9e7398c66d 100644 --- a/target/linux/bcm53xx/patches-5.4/311-ARM-BCM5301X-Add-power-button-for-Buffalo-WZR-1750DHP.patch +++ b/target/linux/bcm53xx/patches-5.4/311-ARM-BCM5301X-Add-power-button-for-Buffalo-WZR-1750DHP.patch @@ -9,12 +9,12 @@ Signed-off-by: Felix Fietkau gpio-keys { compatible = "gpio-keys"; -+ power { ++ button-power { + label = "Power"; + linux,code = ; + gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; + }; + - restart { + button-restart { label = "Reset"; linux,code = ; diff --git a/target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch b/target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch index fb78ee93c4..92a71e58fe 100644 --- a/target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch +++ b/target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch @@ -17,7 +17,7 @@ Signed-off-by: Christian Lamparter }; leds { -@@ -68,7 +69,7 @@ +@@ -66,7 +67,7 @@ max-brightness = <255>; }; diff --git a/target/linux/generic/backport-5.4/612-v5.15-netfilter-conntrack-sanitize-table-size-default-sett.patch b/target/linux/generic/backport-5.4/612-v5.15-netfilter-conntrack-sanitize-table-size-default-sett.patch new file mode 100644 index 0000000000..1e7773c193 --- /dev/null +++ b/target/linux/generic/backport-5.4/612-v5.15-netfilter-conntrack-sanitize-table-size-default-sett.patch @@ -0,0 +1,100 @@ +From d532bcd0b2699d84d71a0c71d37157ac6eb3be25 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Florian Westphal +Date: Thu, 26 Aug 2021 15:54:19 +0200 +Subject: [PATCH] netfilter: conntrack: sanitize table size default settings + +conntrack has two distinct table size settings: +nf_conntrack_max and nf_conntrack_buckets. + +The former limits how many conntrack objects are allowed to exist +in each namespace. + +The second sets the size of the hashtable. + +As all entries are inserted twice (once for original direction, once for +reply), there should be at least twice as many buckets in the table than +the maximum number of conntrack objects that can exist at the same time. + +Change the default multiplier to 1 and increase the chosen bucket sizes. +This results in the same nf_conntrack_max settings as before but reduces +the average bucket list length. + +Signed-off-by: Florian Westphal +Signed-off-by: Pablo Neira Ayuso +--- + .../networking/nf_conntrack-sysctl.rst | 13 ++++---- + net/netfilter/nf_conntrack_core.c | 30 +++++++++---------- + 2 files changed, 22 insertions(+), 21 deletions(-) + +--- a/Documentation/networking/nf_conntrack-sysctl.txt ++++ b/Documentation/networking/nf_conntrack-sysctl.txt +@@ -10,9 +10,8 @@ nf_conntrack_acct - BOOLEAN + nf_conntrack_buckets - INTEGER + Size of hash table. If not specified as parameter during module + loading, the default size is calculated by dividing total memory +- by 16384 to determine the number of buckets but the hash table will +- never have fewer than 32 and limited to 16384 buckets. For systems +- with more than 4GB of memory it will be 65536 buckets. ++ by 16384 to determine the number of buckets. The hash table will ++ never have fewer than 1024 and never more than 262144 buckets. + This sysctl is only writeable in the initial net namespace. + + nf_conntrack_checksum - BOOLEAN +@@ -93,8 +92,12 @@ nf_conntrack_log_invalid - INTEGER + Log invalid packets of a type specified by value. + + nf_conntrack_max - INTEGER +- Size of connection tracking table. Default value is +- nf_conntrack_buckets value * 4. ++ Maximum number of allowed connection tracking entries. This value is set ++ to nf_conntrack_buckets by default. ++ Note that connection tracking entries are added to the table twice -- once ++ for the original direction and once for the reply direction (i.e., with ++ the reversed address). This means that with default settings a maxed-out ++ table will have a average hash chain length of 2, not 1. + + nf_conntrack_tcp_be_liberal - BOOLEAN + 0 - disabled (default) +--- a/net/netfilter/nf_conntrack_core.c ++++ b/net/netfilter/nf_conntrack_core.c +@@ -2418,26 +2418,24 @@ int nf_conntrack_init_start(void) + spin_lock_init(&nf_conntrack_locks[i]); + + if (!nf_conntrack_htable_size) { +- /* Idea from tcp.c: use 1/16384 of memory. +- * On i386: 32MB machine has 512 buckets. +- * >= 1GB machines have 16384 buckets. +- * >= 4GB machines have 65536 buckets. +- */ + nf_conntrack_htable_size + = (((nr_pages << PAGE_SHIFT) / 16384) + / sizeof(struct hlist_head)); +- if (nr_pages > (4 * (1024 * 1024 * 1024 / PAGE_SIZE))) +- nf_conntrack_htable_size = 65536; ++ if (BITS_PER_LONG >= 64 && ++ nr_pages > (4 * (1024 * 1024 * 1024 / PAGE_SIZE))) ++ nf_conntrack_htable_size = 262144; + else if (nr_pages > (1024 * 1024 * 1024 / PAGE_SIZE)) +- nf_conntrack_htable_size = 16384; +- if (nf_conntrack_htable_size < 32) +- nf_conntrack_htable_size = 32; ++ nf_conntrack_htable_size = 65536; + +- /* Use a max. factor of four by default to get the same max as +- * with the old struct list_heads. When a table size is given +- * we use the old value of 8 to avoid reducing the max. +- * entries. */ +- max_factor = 4; ++ if (nf_conntrack_htable_size < 1024) ++ nf_conntrack_htable_size = 1024; ++ /* Use a max. factor of one by default to keep the average ++ * hash chain length at 2 entries. Each entry has to be added ++ * twice (once for original direction, once for reply). ++ * When a table size is given we use the old value of 8 to ++ * avoid implicit reduction of the max entries setting. ++ */ ++ max_factor = 1; + } + + nf_conntrack_hash = nf_ct_alloc_hashtable(&nf_conntrack_htable_size, 1); diff --git a/target/linux/generic/backport-5.4/701-v5.7-net-dsa-Implement-flow-dissection-for-tag_brcm.c.patch b/target/linux/generic/backport-5.4/701-v5.7-net-dsa-Implement-flow-dissection-for-tag_brcm.c.patch new file mode 100644 index 0000000000..5d7b90f699 --- /dev/null +++ b/target/linux/generic/backport-5.4/701-v5.7-net-dsa-Implement-flow-dissection-for-tag_brcm.c.patch @@ -0,0 +1,62 @@ +From 52015366e361a88c569550a285c71f72bb095661 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Sun, 22 Mar 2020 14:09:57 -0700 +Subject: [PATCH] net: dsa: Implement flow dissection for tag_brcm.c + +Provide a flow_dissect callback which returns the network offset and +where to find the skb protocol, given the tags structure a common +function works for both tagging formats that are supported. + +Signed-off-by: Florian Fainelli +Reviewed-by: Vivien Didelot +Signed-off-by: David S. Miller +--- + net/dsa/tag_brcm.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +--- a/net/dsa/tag_brcm.c ++++ b/net/dsa/tag_brcm.c +@@ -144,6 +144,27 @@ static struct sk_buff *brcm_tag_rcv_ll(s + + return skb; + } ++ ++static int brcm_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, ++ int *offset) ++{ ++ /* We have been called on the DSA master network device after ++ * eth_type_trans() which pulled the Ethernet header already. ++ * Frames have one of these two layouts: ++ * ----------------------------------- ++ * | MAC DA | MAC SA | 4b tag | Type | DSA_TAG_PROTO_BRCM ++ * ----------------------------------- ++ * ----------------------------------- ++ * | 4b tag | MAC DA | MAC SA | Type | DSA_TAG_PROTO_BRCM_PREPEND ++ * ----------------------------------- ++ * skb->data points 2 bytes before the actual Ethernet type field and ++ * we have an offset of 4bytes between where skb->data and where the ++ * payload starts. ++ */ ++ *offset = BRCM_TAG_LEN; ++ *proto = ((__be16 *)skb->data)[1]; ++ return 0; ++} + #endif + + #if IS_ENABLED(CONFIG_NET_DSA_TAG_BRCM) +@@ -179,6 +200,7 @@ static const struct dsa_device_ops brcm_ + .xmit = brcm_tag_xmit, + .rcv = brcm_tag_rcv, + .overhead = BRCM_TAG_LEN, ++ .flow_dissect = brcm_tag_flow_dissect, + }; + + DSA_TAG_DRIVER(brcm_netdev_ops); +@@ -207,6 +229,7 @@ static const struct dsa_device_ops brcm_ + .xmit = brcm_tag_xmit_prepend, + .rcv = brcm_tag_rcv_prepend, + .overhead = BRCM_TAG_LEN, ++ .flow_dissect = brcm_tag_flow_dissect, + }; + + DSA_TAG_DRIVER(brcm_prepend_netdev_ops); diff --git a/target/linux/generic/backport-5.4/702-Revert-net-dsa-b53-Fix-valid-setting-for-MDB-entries.patch b/target/linux/generic/backport-5.4/702-Revert-net-dsa-b53-Fix-valid-setting-for-MDB-entries.patch new file mode 100644 index 0000000000..d9602fab7a --- /dev/null +++ b/target/linux/generic/backport-5.4/702-Revert-net-dsa-b53-Fix-valid-setting-for-MDB-entries.patch @@ -0,0 +1,31 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Wed, 7 Dec 2022 07:57:58 +0100 +Subject: [PATCH] Revert "net: dsa: b53: Fix valid setting for MDB entries" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit 1fae6eb0fc91d3ecb539e03f9e4dcd1c53ada553. + +Upstream commit was a fix for an overlook of setting "ent.is_valid" +twice after 5d65b64a3d97 ("net: dsa: b53: Add support for MDB"). + +Since MDB support was not backported to stable kernels (it's not a bug +fix) there is nothing to fix there. Backporting this commit resulted in +"env.is_valid" not being set at all. + +Signed-off-by: Rafał Miłecki +--- + drivers/net/dsa/b53/b53_common.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1551,6 +1551,7 @@ static int b53_arl_op(struct b53_device + + memset(&ent, 0, sizeof(ent)); + ent.port = port; ++ ent.is_valid = is_valid; + ent.vid = vid; + ent.is_static = true; + memcpy(ent.mac, addr, ETH_ALEN); diff --git a/target/linux/generic/backport-5.4/703-v5.5-0001-net-dsa-b53-Add-support-for-MDB.patch b/target/linux/generic/backport-5.4/703-v5.5-0001-net-dsa-b53-Add-support-for-MDB.patch new file mode 100644 index 0000000000..8349d31900 --- /dev/null +++ b/target/linux/generic/backport-5.4/703-v5.5-0001-net-dsa-b53-Add-support-for-MDB.patch @@ -0,0 +1,130 @@ +From 5d65b64a3d97011796b225ce315b3ce0011551e7 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 24 Oct 2019 12:45:07 -0700 +Subject: [PATCH] net: dsa: b53: Add support for MDB + +In preparation for supporting IGMP snooping with or without the use of +a bridge, add support within b53_common.c to program the ARL entries for +multicast operations. The key difference is that a multicast ARL entry +is comprised of a bitmask of enabled ports, instead of a port number. + +Signed-off-by: Florian Fainelli +Reviewed-by: Vivien Didelot +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 62 ++++++++++++++++++++++++++++++-- + drivers/net/dsa/b53/b53_priv.h | 8 ++++- + 2 files changed, 67 insertions(+), 3 deletions(-) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1549,11 +1549,25 @@ static int b53_arl_op(struct b53_device + break; + } + +- memset(&ent, 0, sizeof(ent)); +- ent.port = port; ++ /* For multicast address, the port is a bitmask and the validity ++ * is determined by having at least one port being still active ++ */ ++ if (!is_multicast_ether_addr(addr)) { ++ ent.port = port; ++ ent.is_valid = is_valid; ++ } else { ++ if (is_valid) ++ ent.port |= BIT(port); ++ else ++ ent.port &= ~BIT(port); ++ ++ ent.is_valid = !!(ent.port); ++ } ++ + ent.is_valid = is_valid; + ent.vid = vid; + ent.is_static = true; ++ ent.is_age = false; + memcpy(ent.mac, addr, ETH_ALEN); + b53_arl_from_entry(&mac_vid, &fwd_entry, &ent); + +@@ -1672,6 +1686,47 @@ int b53_fdb_dump(struct dsa_switch *ds, + } + EXPORT_SYMBOL(b53_fdb_dump); + ++int b53_mdb_prepare(struct dsa_switch *ds, int port, ++ const struct switchdev_obj_port_mdb *mdb) ++{ ++ struct b53_device *priv = ds->priv; ++ ++ /* 5325 and 5365 require some more massaging, but could ++ * be supported eventually ++ */ ++ if (is5325(priv) || is5365(priv)) ++ return -EOPNOTSUPP; ++ ++ return 0; ++} ++EXPORT_SYMBOL(b53_mdb_prepare); ++ ++void b53_mdb_add(struct dsa_switch *ds, int port, ++ const struct switchdev_obj_port_mdb *mdb) ++{ ++ struct b53_device *priv = ds->priv; ++ int ret; ++ ++ ret = b53_arl_op(priv, 0, port, mdb->addr, mdb->vid, true); ++ if (ret) ++ dev_err(ds->dev, "failed to add MDB entry\n"); ++} ++EXPORT_SYMBOL(b53_mdb_add); ++ ++int b53_mdb_del(struct dsa_switch *ds, int port, ++ const struct switchdev_obj_port_mdb *mdb) ++{ ++ struct b53_device *priv = ds->priv; ++ int ret; ++ ++ ret = b53_arl_op(priv, 0, port, mdb->addr, mdb->vid, false); ++ if (ret) ++ dev_err(ds->dev, "failed to delete MDB entry\n"); ++ ++ return ret; ++} ++EXPORT_SYMBOL(b53_mdb_del); ++ + int b53_br_join(struct dsa_switch *ds, int port, struct net_device *br) + { + struct b53_device *dev = ds->priv; +@@ -2050,6 +2105,9 @@ static const struct dsa_switch_ops b53_s + .port_fdb_del = b53_fdb_del, + .port_mirror_add = b53_mirror_add, + .port_mirror_del = b53_mirror_del, ++ .port_mdb_prepare = b53_mdb_prepare, ++ .port_mdb_add = b53_mdb_add, ++ .port_mdb_del = b53_mdb_del, + }; + + struct b53_chip_data { +--- a/drivers/net/dsa/b53/b53_priv.h ++++ b/drivers/net/dsa/b53/b53_priv.h +@@ -250,7 +250,7 @@ b53_build_op(write48, u64); + b53_build_op(write64, u64); + + struct b53_arl_entry { +- u8 port; ++ u16 port; + u8 mac[ETH_ALEN]; + u16 vid; + u8 is_valid:1; +@@ -351,6 +351,12 @@ int b53_fdb_del(struct dsa_switch *ds, i + const unsigned char *addr, u16 vid); + int b53_fdb_dump(struct dsa_switch *ds, int port, + dsa_fdb_dump_cb_t *cb, void *data); ++int b53_mdb_prepare(struct dsa_switch *ds, int port, ++ const struct switchdev_obj_port_mdb *mdb); ++void b53_mdb_add(struct dsa_switch *ds, int port, ++ const struct switchdev_obj_port_mdb *mdb); ++int b53_mdb_del(struct dsa_switch *ds, int port, ++ const struct switchdev_obj_port_mdb *mdb); + int b53_mirror_add(struct dsa_switch *ds, int port, + struct dsa_mall_mirror_tc_entry *mirror, bool ingress); + enum dsa_tag_protocol b53_get_tag_protocol(struct dsa_switch *ds, int port); diff --git a/target/linux/generic/backport-5.4/703-v5.5-0002-net-dsa-bcm_sf2-Wire-up-MDB-operations.patch b/target/linux/generic/backport-5.4/703-v5.5-0002-net-dsa-bcm_sf2-Wire-up-MDB-operations.patch new file mode 100644 index 0000000000..98c69fc51e --- /dev/null +++ b/target/linux/generic/backport-5.4/703-v5.5-0002-net-dsa-bcm_sf2-Wire-up-MDB-operations.patch @@ -0,0 +1,27 @@ +From 29bb5e8337caf2e3d9802ee6a6804561f125bfcf Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 24 Oct 2019 12:45:08 -0700 +Subject: [PATCH] net: dsa: bcm_sf2: Wire up MDB operations + +Leverage the recently add b53_mdb_{add,del,prepare} functions since they +work as-is for bcm_sf2. + +Signed-off-by: Florian Fainelli +Reviewed-by: Vivien Didelot +Signed-off-by: David S. Miller +--- + drivers/net/dsa/bcm_sf2.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/dsa/bcm_sf2.c ++++ b/drivers/net/dsa/bcm_sf2.c +@@ -981,6 +981,9 @@ static const struct dsa_switch_ops bcm_s + .set_rxnfc = bcm_sf2_set_rxnfc, + .port_mirror_add = b53_mirror_add, + .port_mirror_del = b53_mirror_del, ++ .port_mdb_prepare = b53_mdb_prepare, ++ .port_mdb_add = b53_mdb_add, ++ .port_mdb_del = b53_mdb_del, + }; + + struct bcm_sf2_of_data { diff --git a/target/linux/generic/backport-5.4/703-v5.5-0003-net-dsa-bcm_sf2-Add-support-for-optional-reset-contr.patch b/target/linux/generic/backport-5.4/703-v5.5-0003-net-dsa-bcm_sf2-Add-support-for-optional-reset-contr.patch new file mode 100644 index 0000000000..be62e7f077 --- /dev/null +++ b/target/linux/generic/backport-5.4/703-v5.5-0003-net-dsa-bcm_sf2-Add-support-for-optional-reset-contr.patch @@ -0,0 +1,81 @@ +From eee87e4377a4b86dc2eea0ade162b0dc33f40576 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 4 Nov 2019 13:51:39 -0800 +Subject: [PATCH] net: dsa: bcm_sf2: Add support for optional reset controller + line + +Grab an optional and exclusive reset controller line for the switch and +manage it during probe/remove functions accordingly. For 7278 devices we +change bcm_sf2_sw_rst() to use the reset controller line since the +WATCHDOG_CTRL register does not reset the switch contrary to stated +documentation. + +Signed-off-by: Florian Fainelli +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/dsa/bcm_sf2.c | 19 +++++++++++++++++++ + drivers/net/dsa/bcm_sf2.h | 3 +++ + 2 files changed, 22 insertions(+) + +--- a/drivers/net/dsa/bcm_sf2.c ++++ b/drivers/net/dsa/bcm_sf2.c +@@ -346,6 +346,18 @@ static int bcm_sf2_sw_rst(struct bcm_sf2 + { + unsigned int timeout = 1000; + u32 reg; ++ int ret; ++ ++ /* The watchdog reset does not work on 7278, we need to hit the ++ * "external" reset line through the reset controller. ++ */ ++ if (priv->type == BCM7278_DEVICE_ID && !IS_ERR(priv->rcdev)) { ++ ret = reset_control_assert(priv->rcdev); ++ if (ret) ++ return ret; ++ ++ return reset_control_deassert(priv->rcdev); ++ } + + reg = core_readl(priv, CORE_WATCHDOG_CTRL); + reg |= SOFTWARE_RESET | EN_CHIP_RST | EN_SW_RESET; +@@ -1099,6 +1111,11 @@ static int bcm_sf2_sw_probe(struct platf + priv->core_reg_align = data->core_reg_align; + priv->num_cfp_rules = data->num_cfp_rules; + ++ priv->rcdev = devm_reset_control_get_optional_exclusive(&pdev->dev, ++ "switch"); ++ if (PTR_ERR(priv->rcdev) == -EPROBE_DEFER) ++ return PTR_ERR(priv->rcdev); ++ + /* Auto-detection using standard registers will not work, so + * provide an indication of what kind of device we are for + * b53_common to work with +@@ -1237,6 +1254,8 @@ static int bcm_sf2_sw_remove(struct plat + dsa_unregister_switch(priv->dev->ds); + bcm_sf2_cfp_exit(priv->dev->ds); + bcm_sf2_mdio_unregister(priv); ++ if (priv->type == BCM7278_DEVICE_ID && !IS_ERR(priv->rcdev)) ++ reset_control_assert(priv->rcdev); + + return 0; + } +--- a/drivers/net/dsa/bcm_sf2.h ++++ b/drivers/net/dsa/bcm_sf2.h +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include + +@@ -64,6 +65,8 @@ struct bcm_sf2_priv { + void __iomem *fcb; + void __iomem *acb; + ++ struct reset_control *rcdev; ++ + /* Register offsets indirection tables */ + u32 type; + const u16 *reg_offsets; diff --git a/target/linux/generic/backport-5.4/704-v5.6-net-dsa-Get-information-about-stacked-DSA-protocol.patch b/target/linux/generic/backport-5.4/704-v5.6-net-dsa-Get-information-about-stacked-DSA-protocol.patch new file mode 100644 index 0000000000..0a05721864 --- /dev/null +++ b/target/linux/generic/backport-5.4/704-v5.6-net-dsa-Get-information-about-stacked-DSA-protocol.patch @@ -0,0 +1,363 @@ +From 4d776482ecc689bdd68627985ac4cb5a6f325953 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Tue, 7 Jan 2020 21:06:05 -0800 +Subject: [PATCH] net: dsa: Get information about stacked DSA protocol + +It is possible to stack multiple DSA switches in a way that they are not +part of the tree (disjoint) but the DSA master of a switch is a DSA +slave of another. When that happens switch drivers may have to know this +is the case so as to determine whether their tagging protocol has a +remove chance of working. + +This is useful for specific switch drivers such as b53 where devices +have been known to be stacked in the wild without the Broadcom tag +protocol supporting that feature. This allows b53 to continue supporting +those devices by forcing the disabling of Broadcom tags on the outermost +switches if necessary. + +The get_tag_protocol() function is therefore updated to gain an +additional enum dsa_tag_protocol argument which denotes the current +tagging protocol used by the DSA master we are attached to, else +DSA_TAG_PROTO_NONE for the top of the dsa_switch_tree. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 22 +++++++++++------- + drivers/net/dsa/b53/b53_priv.h | 4 +++- + drivers/net/dsa/dsa_loop.c | 3 ++- + drivers/net/dsa/lan9303-core.c | 3 ++- + drivers/net/dsa/lantiq_gswip.c | 3 ++- + drivers/net/dsa/microchip/ksz8795.c | 3 ++- + drivers/net/dsa/microchip/ksz9477.c | 3 ++- + drivers/net/dsa/mt7530.c | 3 ++- + drivers/net/dsa/mv88e6060.c | 3 ++- + drivers/net/dsa/mv88e6xxx/chip.c | 3 ++- + drivers/net/dsa/ocelot/felix.c | 3 ++- + drivers/net/dsa/qca/ar9331.c | 3 ++- + drivers/net/dsa/qca8k.c | 3 ++- + drivers/net/dsa/rtl8366rb.c | 3 ++- + drivers/net/dsa/sja1105/sja1105_main.c | 3 ++- + drivers/net/dsa/vitesse-vsc73xx-core.c | 3 ++- + include/net/dsa.h | 3 ++- + net/dsa/dsa2.c | 31 ++++++++++++++++++++++++-- + net/dsa/dsa_priv.h | 1 + + net/dsa/slave.c | 4 +--- + 20 files changed, 78 insertions(+), 29 deletions(-) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -587,9 +587,8 @@ EXPORT_SYMBOL(b53_disable_port); + + void b53_brcm_hdr_setup(struct dsa_switch *ds, int port) + { +- bool tag_en = !(ds->ops->get_tag_protocol(ds, port) == +- DSA_TAG_PROTO_NONE); + struct b53_device *dev = ds->priv; ++ bool tag_en = !(dev->tag_protocol == DSA_TAG_PROTO_NONE); + u8 hdr_ctl, val; + u16 reg; + +@@ -1921,7 +1920,8 @@ static bool b53_can_enable_brcm_tags(str + return ret; + } + +-enum dsa_tag_protocol b53_get_tag_protocol(struct dsa_switch *ds, int port) ++enum dsa_tag_protocol b53_get_tag_protocol(struct dsa_switch *ds, int port, ++ enum dsa_tag_protocol mprot) + { + struct b53_device *dev = ds->priv; + +@@ -1931,16 +1931,22 @@ enum dsa_tag_protocol b53_get_tag_protoc + * misses on multicast addresses (TBD). + */ + if (is5325(dev) || is5365(dev) || is539x(dev) || is531x5(dev) || +- !b53_can_enable_brcm_tags(ds, port)) +- return DSA_TAG_PROTO_NONE; ++ !b53_can_enable_brcm_tags(ds, port)) { ++ dev->tag_protocol = DSA_TAG_PROTO_NONE; ++ goto out; ++ } + + /* Broadcom BCM58xx chips have a flow accelerator on Port 8 + * which requires us to use the prepended Broadcom tag type + */ +- if (dev->chip_id == BCM58XX_DEVICE_ID && port == B53_CPU_PORT) +- return DSA_TAG_PROTO_BRCM_PREPEND; ++ if (dev->chip_id == BCM58XX_DEVICE_ID && port == B53_CPU_PORT) { ++ dev->tag_protocol = DSA_TAG_PROTO_BRCM_PREPEND; ++ goto out; ++ } + +- return DSA_TAG_PROTO_BRCM; ++ dev->tag_protocol = DSA_TAG_PROTO_BRCM; ++out: ++ return dev->tag_protocol; + } + EXPORT_SYMBOL(b53_get_tag_protocol); + +--- a/drivers/net/dsa/b53/b53_priv.h ++++ b/drivers/net/dsa/b53/b53_priv.h +@@ -118,6 +118,7 @@ struct b53_device { + u8 jumbo_size_reg; + int reset_gpio; + u8 num_arl_entries; ++ enum dsa_tag_protocol tag_protocol; + + /* used ports mask */ + u16 enabled_ports; +@@ -359,7 +360,8 @@ int b53_mdb_del(struct dsa_switch *ds, i + const struct switchdev_obj_port_mdb *mdb); + int b53_mirror_add(struct dsa_switch *ds, int port, + struct dsa_mall_mirror_tc_entry *mirror, bool ingress); +-enum dsa_tag_protocol b53_get_tag_protocol(struct dsa_switch *ds, int port); ++enum dsa_tag_protocol b53_get_tag_protocol(struct dsa_switch *ds, int port, ++ enum dsa_tag_protocol mprot); + void b53_mirror_del(struct dsa_switch *ds, int port, + struct dsa_mall_mirror_tc_entry *mirror); + int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy); +--- a/drivers/net/dsa/dsa_loop.c ++++ b/drivers/net/dsa/dsa_loop.c +@@ -61,7 +61,8 @@ struct dsa_loop_priv { + static struct phy_device *phydevs[PHY_MAX_ADDR]; + + static enum dsa_tag_protocol dsa_loop_get_protocol(struct dsa_switch *ds, +- int port) ++ int port, ++ enum dsa_tag_protocol mp) + { + dev_dbg(ds->dev, "%s: port: %d\n", __func__, port); + +--- a/drivers/net/dsa/lan9303-core.c ++++ b/drivers/net/dsa/lan9303-core.c +@@ -889,7 +889,8 @@ static int lan9303_check_device(struct l + /* ---------------------------- DSA -----------------------------------*/ + + static enum dsa_tag_protocol lan9303_get_tag_protocol(struct dsa_switch *ds, +- int port) ++ int port, ++ enum dsa_tag_protocol mp) + { + return DSA_TAG_PROTO_LAN9303; + } +--- a/drivers/net/dsa/lantiq_gswip.c ++++ b/drivers/net/dsa/lantiq_gswip.c +@@ -860,7 +860,8 @@ static int gswip_setup(struct dsa_switch + } + + static enum dsa_tag_protocol gswip_get_tag_protocol(struct dsa_switch *ds, +- int port) ++ int port, ++ enum dsa_tag_protocol mp) + { + return DSA_TAG_PROTO_GSWIP; + } +--- a/drivers/net/dsa/microchip/ksz8795.c ++++ b/drivers/net/dsa/microchip/ksz8795.c +@@ -645,7 +645,8 @@ static void ksz8795_w_phy(struct ksz_dev + } + + static enum dsa_tag_protocol ksz8795_get_tag_protocol(struct dsa_switch *ds, +- int port) ++ int port, ++ enum dsa_tag_protocol mp) + { + return DSA_TAG_PROTO_KSZ8795; + } +--- a/drivers/net/dsa/microchip/ksz9477.c ++++ b/drivers/net/dsa/microchip/ksz9477.c +@@ -295,7 +295,8 @@ static void ksz9477_port_init_cnt(struct + } + + static enum dsa_tag_protocol ksz9477_get_tag_protocol(struct dsa_switch *ds, +- int port) ++ int port, ++ enum dsa_tag_protocol mp) + { + enum dsa_tag_protocol proto = DSA_TAG_PROTO_KSZ9477; + struct ksz_device *dev = ds->priv; +--- a/drivers/net/dsa/mt7530.c ++++ b/drivers/net/dsa/mt7530.c +@@ -1144,7 +1144,8 @@ mt7530_port_vlan_del(struct dsa_switch * + } + + static enum dsa_tag_protocol +-mtk_get_tag_protocol(struct dsa_switch *ds, int port) ++mtk_get_tag_protocol(struct dsa_switch *ds, int port, ++ enum dsa_tag_protocol mp) + { + struct mt7530_priv *priv = ds->priv; + +--- a/drivers/net/dsa/mv88e6060.c ++++ b/drivers/net/dsa/mv88e6060.c +@@ -43,7 +43,8 @@ static const char *mv88e6060_get_name(st + } + + static enum dsa_tag_protocol mv88e6060_get_tag_protocol(struct dsa_switch *ds, +- int port) ++ int port, ++ enum dsa_tag_protocol m) + { + return DSA_TAG_PROTO_TRAILER; + } +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -4878,7 +4878,8 @@ static struct mv88e6xxx_chip *mv88e6xxx_ + } + + static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds, +- int port) ++ int port, ++ enum dsa_tag_protocol m) + { + struct mv88e6xxx_chip *chip = ds->priv; + +--- a/drivers/net/dsa/qca8k.c ++++ b/drivers/net/dsa/qca8k.c +@@ -1016,7 +1016,8 @@ qca8k_port_fdb_dump(struct dsa_switch *d + } + + static enum dsa_tag_protocol +-qca8k_get_tag_protocol(struct dsa_switch *ds, int port) ++qca8k_get_tag_protocol(struct dsa_switch *ds, int port, ++ enum dsa_tag_protocol mp) + { + return DSA_TAG_PROTO_QCA; + } +--- a/drivers/net/dsa/rtl8366rb.c ++++ b/drivers/net/dsa/rtl8366rb.c +@@ -964,7 +964,8 @@ static int rtl8366rb_setup(struct dsa_sw + } + + static enum dsa_tag_protocol rtl8366_get_tag_protocol(struct dsa_switch *ds, +- int port) ++ int port, ++ enum dsa_tag_protocol mp) + { + /* For now, the RTL switches are handled without any custom tags. + * +--- a/drivers/net/dsa/sja1105/sja1105_main.c ++++ b/drivers/net/dsa/sja1105/sja1105_main.c +@@ -1591,7 +1591,8 @@ static int sja1105_setup_8021q_tagging(s + } + + static enum dsa_tag_protocol +-sja1105_get_tag_protocol(struct dsa_switch *ds, int port) ++sja1105_get_tag_protocol(struct dsa_switch *ds, int port, ++ enum dsa_tag_protocol mp) + { + return DSA_TAG_PROTO_SJA1105; + } +--- a/drivers/net/dsa/vitesse-vsc73xx-core.c ++++ b/drivers/net/dsa/vitesse-vsc73xx-core.c +@@ -542,7 +542,8 @@ static int vsc73xx_phy_write(struct dsa_ + } + + static enum dsa_tag_protocol vsc73xx_get_tag_protocol(struct dsa_switch *ds, +- int port) ++ int port, ++ enum dsa_tag_protocol mp) + { + /* The switch internally uses a 8 byte header with length, + * source port, tag, LPA and priority. This is supposedly +--- a/include/net/dsa.h ++++ b/include/net/dsa.h +@@ -353,7 +353,8 @@ typedef int dsa_fdb_dump_cb_t(const unsi + bool is_static, void *data); + struct dsa_switch_ops { + enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds, +- int port); ++ int port, ++ enum dsa_tag_protocol mprot); + + int (*setup)(struct dsa_switch *ds); + void (*teardown)(struct dsa_switch *ds); +--- a/net/dsa/dsa2.c ++++ b/net/dsa/dsa2.c +@@ -631,6 +631,32 @@ static int dsa_port_parse_dsa(struct dsa + return 0; + } + ++static enum dsa_tag_protocol dsa_get_tag_protocol(struct dsa_port *dp, ++ struct net_device *master) ++{ ++ enum dsa_tag_protocol tag_protocol = DSA_TAG_PROTO_NONE; ++ struct dsa_switch *mds, *ds = dp->ds; ++ unsigned int mdp_upstream; ++ struct dsa_port *mdp; ++ ++ /* It is possible to stack DSA switches onto one another when that ++ * happens the switch driver may want to know if its tagging protocol ++ * is going to work in such a configuration. ++ */ ++ if (dsa_slave_dev_check(master)) { ++ mdp = dsa_slave_to_port(master); ++ mds = mdp->ds; ++ mdp_upstream = dsa_upstream_port(mds, mdp->index); ++ tag_protocol = mds->ops->get_tag_protocol(mds, mdp_upstream, ++ DSA_TAG_PROTO_NONE); ++ } ++ ++ /* If the master device is not itself a DSA slave in a disjoint DSA ++ * tree, then return immediately. ++ */ ++ return ds->ops->get_tag_protocol(ds, dp->index, tag_protocol); ++} ++ + static int dsa_port_parse_cpu(struct dsa_port *dp, struct net_device *master) + { + struct dsa_switch *ds = dp->ds; +@@ -638,20 +664,21 @@ static int dsa_port_parse_cpu(struct dsa + const struct dsa_device_ops *tag_ops; + enum dsa_tag_protocol tag_protocol; + +- tag_protocol = ds->ops->get_tag_protocol(ds, dp->index); ++ tag_protocol = dsa_get_tag_protocol(dp, master); + tag_ops = dsa_tag_driver_get(tag_protocol); + if (IS_ERR(tag_ops)) { + if (PTR_ERR(tag_ops) == -ENOPROTOOPT) + return -EPROBE_DEFER; + dev_warn(ds->dev, "No tagger for this switch\n"); ++ dp->master = NULL; + return PTR_ERR(tag_ops); + } + ++ dp->master = master; + dp->type = DSA_PORT_TYPE_CPU; + dp->filter = tag_ops->filter; + dp->rcv = tag_ops->rcv; + dp->tag_ops = tag_ops; +- dp->master = master; + dp->dst = dst; + + return 0; +--- a/net/dsa/dsa_priv.h ++++ b/net/dsa/dsa_priv.h +@@ -189,6 +189,7 @@ extern const struct dsa_device_ops notag + void dsa_slave_mii_bus_init(struct dsa_switch *ds); + int dsa_slave_create(struct dsa_port *dp); + void dsa_slave_destroy(struct net_device *slave_dev); ++bool dsa_slave_dev_check(const struct net_device *dev); + int dsa_slave_suspend(struct net_device *slave_dev); + int dsa_slave_resume(struct net_device *slave_dev); + int dsa_slave_register_notifier(void); +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -22,8 +22,6 @@ + + #include "dsa_priv.h" + +-static bool dsa_slave_dev_check(const struct net_device *dev); +- + /* slave mii_bus handling ***************************************************/ + static int dsa_slave_phy_read(struct mii_bus *bus, int addr, int reg) + { +@@ -1494,7 +1492,7 @@ void dsa_slave_destroy(struct net_device + free_netdev(slave_dev); + } + +-static bool dsa_slave_dev_check(const struct net_device *dev) ++bool dsa_slave_dev_check(const struct net_device *dev) + { + return dev->netdev_ops == &dsa_slave_netdev_ops; + } diff --git a/target/linux/generic/backport-5.4/705-v5.6-0001-net-dsa-b53-Enable-Broadcom-tags-for-531x5-539x-fami.patch b/target/linux/generic/backport-5.4/705-v5.6-0001-net-dsa-b53-Enable-Broadcom-tags-for-531x5-539x-fami.patch new file mode 100644 index 0000000000..abc2dc836a --- /dev/null +++ b/target/linux/generic/backport-5.4/705-v5.6-0001-net-dsa-b53-Enable-Broadcom-tags-for-531x5-539x-fami.patch @@ -0,0 +1,104 @@ +From 8fab459e69abfd04a66d76423d18ba853fced4ab Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Tue, 7 Jan 2020 21:06:06 -0800 +Subject: [PATCH] net: dsa: b53: Enable Broadcom tags for 531x5/539x families + +The BCM531x5 and BCM539x families require that the IMP port be enabled +within the management page and that management mode (SM_SW_FWD_MODE) be +turned on. Once this is done, everything works as expected, including +multicast with standalone DSA devices or bridge devices. + +Because such switches are frequencly cascaded with other internal +Broadcom switches on which we want to enable Broadcom tags, update +b53_can_enable_brcm_tags() to check the kind of DSA master tagging +protocol being used, if it is one of the two supported Broadcom tagging +protocols, force DSA_TAG_PROTO_NONE. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 46 +++++++++++++++++++++++++------- + 1 file changed, 37 insertions(+), 9 deletions(-) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -371,8 +371,6 @@ static void b53_enable_vlan(struct b53_d + b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5, &vc5); + } + +- mgmt &= ~SM_SW_FWD_MODE; +- + if (enable) { + vc0 |= VC0_VLAN_EN | VC0_VID_CHK_EN | VC0_VID_HASH_VID; + vc1 |= VC1_RX_MCST_UNTAG_EN | VC1_RX_MCST_FWD_EN; +@@ -608,6 +606,22 @@ void b53_brcm_hdr_setup(struct dsa_switc + break; + } + ++ /* Enable management mode if tagging is requested */ ++ b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &hdr_ctl); ++ if (tag_en) ++ hdr_ctl |= SM_SW_FWD_MODE; ++ else ++ hdr_ctl &= ~SM_SW_FWD_MODE; ++ b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, hdr_ctl); ++ ++ /* Configure the appropriate IMP port */ ++ b53_read8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, &hdr_ctl); ++ if (port == 8) ++ hdr_ctl |= GC_FRM_MGMT_PORT_MII; ++ else if (port == 5) ++ hdr_ctl |= GC_FRM_MGMT_PORT_M; ++ b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, hdr_ctl); ++ + /* Enable Broadcom tags for IMP port */ + b53_read8(dev, B53_MGMT_PAGE, B53_BRCM_HDR, &hdr_ctl); + if (tag_en) +@@ -1910,13 +1924,29 @@ static bool b53_possible_cpu_port(struct + return false; + } + +-static bool b53_can_enable_brcm_tags(struct dsa_switch *ds, int port) ++static bool b53_can_enable_brcm_tags(struct dsa_switch *ds, int port, ++ enum dsa_tag_protocol tag_protocol) + { + bool ret = b53_possible_cpu_port(ds, port); + +- if (!ret) ++ if (!ret) { + dev_warn(ds->dev, "Port %d is not Broadcom tag capable\n", + port); ++ return ret; ++ } ++ ++ switch (tag_protocol) { ++ case DSA_TAG_PROTO_BRCM: ++ case DSA_TAG_PROTO_BRCM_PREPEND: ++ dev_warn(ds->dev, ++ "Port %d is stacked to Broadcom tag switch\n", port); ++ ret = false; ++ break; ++ default: ++ ret = true; ++ break; ++ } ++ + return ret; + } + +@@ -1926,12 +1956,10 @@ enum dsa_tag_protocol b53_get_tag_protoc + struct b53_device *dev = ds->priv; + + /* Older models (5325, 5365) support a different tag format that we do +- * not support in net/dsa/tag_brcm.c yet. 539x and 531x5 require managed +- * mode to be turned on which means we need to specifically manage ARL +- * misses on multicast addresses (TBD). ++ * not support in net/dsa/tag_brcm.c yet. + */ +- if (is5325(dev) || is5365(dev) || is539x(dev) || is531x5(dev) || +- !b53_can_enable_brcm_tags(ds, port)) { ++ if (is5325(dev) || is5365(dev) || ++ !b53_can_enable_brcm_tags(ds, port, mprot)) { + dev->tag_protocol = DSA_TAG_PROTO_NONE; + goto out; + } diff --git a/target/linux/generic/backport-5.4/707-v5.7-0001-net-dsa-bcm_sf2-Also-configure-Port-5-for-2Gb-sec-on.patch b/target/linux/generic/backport-5.4/707-v5.7-0001-net-dsa-bcm_sf2-Also-configure-Port-5-for-2Gb-sec-on.patch new file mode 100644 index 0000000000..61a037b361 --- /dev/null +++ b/target/linux/generic/backport-5.4/707-v5.7-0001-net-dsa-bcm_sf2-Also-configure-Port-5-for-2Gb-sec-on.patch @@ -0,0 +1,37 @@ +From 7458bd540fa0a90220b9e8c349d910d9dde9caf8 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Fri, 14 Feb 2020 16:32:29 -0800 +Subject: [PATCH] net: dsa: bcm_sf2: Also configure Port 5 for 2Gb/sec on 7278 + +Either port 5 or port 8 can be used on a 7278 device, make sure that +port 5 also gets configured properly for 2Gb/sec in that case. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/bcm_sf2.c | 3 +++ + drivers/net/dsa/bcm_sf2_regs.h | 1 + + 2 files changed, 4 insertions(+) + +--- a/drivers/net/dsa/bcm_sf2.c ++++ b/drivers/net/dsa/bcm_sf2.c +@@ -620,6 +620,9 @@ force_link: + reg |= RXFLOW_CNTL; + } + ++ if (priv->type == BCM7278_DEVICE_ID && dsa_is_cpu_port(ds, port)) ++ reg |= GMIIP_SPEED_UP_2G; ++ + core_writel(priv, reg, offset); + } + +--- a/drivers/net/dsa/bcm_sf2_regs.h ++++ b/drivers/net/dsa/bcm_sf2_regs.h +@@ -178,6 +178,7 @@ enum bcm_sf2_reg_offs { + #define RXFLOW_CNTL (1 << 4) + #define TXFLOW_CNTL (1 << 5) + #define SW_OVERRIDE (1 << 6) ++#define GMIIP_SPEED_UP_2G (1 << 7) + + #define CORE_WATCHDOG_CTRL 0x001e4 + #define SOFTWARE_RESET (1 << 7) diff --git a/target/linux/generic/backport-5.4/707-v5.7-0002-Revert-net-dsa-bcm_sf2-Also-configure-Port-5-for-2Gb.patch b/target/linux/generic/backport-5.4/707-v5.7-0002-Revert-net-dsa-bcm_sf2-Also-configure-Port-5-for-2Gb.patch new file mode 100644 index 0000000000..2b99f47436 --- /dev/null +++ b/target/linux/generic/backport-5.4/707-v5.7-0002-Revert-net-dsa-bcm_sf2-Also-configure-Port-5-for-2Gb.patch @@ -0,0 +1,43 @@ +From 3f02735e5da5367e4cd563ce6e5c21ce27922248 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 24 Feb 2020 15:44:26 -0800 +Subject: [PATCH] Revert "net: dsa: bcm_sf2: Also configure Port 5 for 2Gb/sec + on 7278" + +This reverts commit 7458bd540fa0a90220b9e8c349d910d9dde9caf8 ("net: dsa: +bcm_sf2: Also configure Port 5 for 2Gb/sec on 7278") as it causes +advanced congestion buffering issues with 7278 switch devices when using +their internal Giabit PHY. While this is being debugged, continue with +conservative defaults that work and do not cause packet loss. + +Fixes: 7458bd540fa0 ("net: dsa: bcm_sf2: Also configure Port 5 for 2Gb/sec on 7278") +Signed-off-by: Florian Fainelli +Reviewed-by: Vivien Didelot +Signed-off-by: David S. Miller +--- + drivers/net/dsa/bcm_sf2.c | 3 --- + drivers/net/dsa/bcm_sf2_regs.h | 1 - + 2 files changed, 4 deletions(-) + +--- a/drivers/net/dsa/bcm_sf2.c ++++ b/drivers/net/dsa/bcm_sf2.c +@@ -620,9 +620,6 @@ force_link: + reg |= RXFLOW_CNTL; + } + +- if (priv->type == BCM7278_DEVICE_ID && dsa_is_cpu_port(ds, port)) +- reg |= GMIIP_SPEED_UP_2G; +- + core_writel(priv, reg, offset); + } + +--- a/drivers/net/dsa/bcm_sf2_regs.h ++++ b/drivers/net/dsa/bcm_sf2_regs.h +@@ -178,7 +178,6 @@ enum bcm_sf2_reg_offs { + #define RXFLOW_CNTL (1 << 4) + #define TXFLOW_CNTL (1 << 5) + #define SW_OVERRIDE (1 << 6) +-#define GMIIP_SPEED_UP_2G (1 << 7) + + #define CORE_WATCHDOG_CTRL 0x001e4 + #define SOFTWARE_RESET (1 << 7) diff --git a/target/linux/generic/backport-5.4/707-v5.7-0005-net-dsa-b53-Restore-VLAN-entries-upon-re-configurati.patch b/target/linux/generic/backport-5.4/707-v5.7-0005-net-dsa-b53-Restore-VLAN-entries-upon-re-configurati.patch new file mode 100644 index 0000000000..cf8be49075 --- /dev/null +++ b/target/linux/generic/backport-5.4/707-v5.7-0005-net-dsa-b53-Restore-VLAN-entries-upon-re-configurati.patch @@ -0,0 +1,48 @@ +From d7a0b1f7652f9f6b7ba0c9d8ad8edd6b8c0c1511 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 30 Mar 2020 14:38:47 -0700 +Subject: [PATCH] net: dsa: b53: Restore VLAN entries upon (re)configuration + +The first time b53_configure_vlan() is called we have not configured any +VLAN entries yet, since that happens later when interfaces get brought +up. When b53_configure_vlan() is called again from suspend/resume we +need to restore all VLAN entries though. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -696,7 +696,9 @@ int b53_configure_vlan(struct dsa_switch + { + struct b53_device *dev = ds->priv; + struct b53_vlan vl = { 0 }; ++ struct b53_vlan *v; + int i, def_vid; ++ u16 vid; + + def_vid = b53_default_pvid(dev); + +@@ -717,6 +719,19 @@ int b53_configure_vlan(struct dsa_switch + if (!is5325(dev) && !is5365(dev)) + b53_set_jumbo(dev, dev->enable_jumbo, false); + ++ /* Upon initial call we have not set-up any VLANs, but upon ++ * system resume, we need to restore all VLAN entries. ++ */ ++ for (vid = def_vid; vid < dev->num_vlans; vid++) { ++ v = &dev->vlans[vid]; ++ ++ if (!v->members) ++ continue; ++ ++ b53_set_vlan_entry(dev, vid, v); ++ b53_fast_age_vlan(dev, vid); ++ } ++ + return 0; + } + EXPORT_SYMBOL(b53_configure_vlan); diff --git a/target/linux/generic/backport-5.4/707-v5.7-0006-net-dsa-b53-Prevent-tagged-VLAN-on-port-7-for-7278.patch b/target/linux/generic/backport-5.4/707-v5.7-0006-net-dsa-b53-Prevent-tagged-VLAN-on-port-7-for-7278.patch new file mode 100644 index 0000000000..12c9546f7b --- /dev/null +++ b/target/linux/generic/backport-5.4/707-v5.7-0006-net-dsa-b53-Prevent-tagged-VLAN-on-port-7-for-7278.patch @@ -0,0 +1,33 @@ +From 88631864da093377ce6d5e60b5639328622a8e5c Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 30 Mar 2020 14:38:48 -0700 +Subject: [PATCH] net: dsa: b53: Prevent tagged VLAN on port 7 for 7278 + +On 7278, port 7 of the switch connects to the ASP UniMAC which is not +capable of processing VLAN tagged frames. We can still allow the port to +be part of a VLAN entry, and we may want it to be untagged on egress on +that VLAN because of that limitation. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1366,6 +1366,14 @@ int b53_vlan_prepare(struct dsa_switch * + if ((is5325(dev) || is5365(dev)) && vlan->vid_begin == 0) + return -EOPNOTSUPP; + ++ /* Port 7 on 7278 connects to the ASP's UniMAC which is not capable of ++ * receiving VLAN tagged frames at all, we can still allow the port to ++ * be configured for egress untagged. ++ */ ++ if (dev->chip_id == BCM7278_DEVICE_ID && port == 7 && ++ !(vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED)) ++ return -EINVAL; ++ + if (vlan->vid_end >= dev->num_vlans) + return -ERANGE; + diff --git a/target/linux/generic/backport-5.4/707-v5.7-0007-net-dsa-b53-Deny-enslaving-port-7-for-7278-into-a-br.patch b/target/linux/generic/backport-5.4/707-v5.7-0007-net-dsa-b53-Deny-enslaving-port-7-for-7278-into-a-br.patch new file mode 100644 index 0000000000..0cddffa363 --- /dev/null +++ b/target/linux/generic/backport-5.4/707-v5.7-0007-net-dsa-b53-Deny-enslaving-port-7-for-7278-into-a-br.patch @@ -0,0 +1,31 @@ +From 31bfc2d42cae6e8b1440fc5db3f0aba6c5d7e602 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 30 Mar 2020 14:38:49 -0700 +Subject: [PATCH] net: dsa: b53: Deny enslaving port 7 for 7278 into a bridge + +On 7278, port 7 connects to the ASP which should only receive frames +through the use of CFP rules, it is not desirable to have it be part of +a bridge at all since that would make it pick up unwanted traffic that +it may not even be able to filter or sustain. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1770,6 +1770,12 @@ int b53_br_join(struct dsa_switch *ds, i + u16 pvlan, reg; + unsigned int i; + ++ /* On 7278, port 7 which connects to the ASP should only receive ++ * traffic from matching CFP rules. ++ */ ++ if (dev->chip_id == BCM7278_DEVICE_ID && port == 7) ++ return -EINVAL; ++ + /* Make this port leave the all VLANs join since we will have proper + * VLAN entries from now on + */ diff --git a/target/linux/generic/backport-5.4/707-v5.7-0008-net-dsa-bcm_sf2-Disable-learning-for-ASP-port.patch b/target/linux/generic/backport-5.4/707-v5.7-0008-net-dsa-bcm_sf2-Disable-learning-for-ASP-port.patch new file mode 100644 index 0000000000..c3ba9ae37a --- /dev/null +++ b/target/linux/generic/backport-5.4/707-v5.7-0008-net-dsa-bcm_sf2-Disable-learning-for-ASP-port.patch @@ -0,0 +1,36 @@ +From 8b6b208b69917d88bb3e087f8c9e61c6b05ed571 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 30 Mar 2020 14:38:50 -0700 +Subject: [PATCH] net: dsa: bcm_sf2: Disable learning for ASP port + +We don't want to enable learning for the ASP port since it only receives +directed traffic, this allows us to bypass ARL-driven forwarding rules +which could conflict with Broadcom tags and/or CFP forwarding. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/bcm_sf2.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/net/dsa/bcm_sf2.c ++++ b/drivers/net/dsa/bcm_sf2.c +@@ -173,9 +173,17 @@ static int bcm_sf2_port_setup(struct dsa + core_writel(priv, reg, CORE_MEM_PSM_VDD_CTRL); + + /* Enable Broadcom tags for that port if requested */ +- if (priv->brcm_tag_mask & BIT(port)) ++ if (priv->brcm_tag_mask & BIT(port)) { + b53_brcm_hdr_setup(ds, port); + ++ /* Disable learning on ASP port */ ++ if (port == 7) { ++ reg = core_readl(priv, CORE_DIS_LEARN); ++ reg |= BIT(port); ++ core_writel(priv, reg, CORE_DIS_LEARN); ++ } ++ } ++ + /* Configure Traffic Class to QoS mapping, allow each priority to map + * to a different queue number + */ diff --git a/target/linux/generic/backport-5.4/707-v5.7-0009-net-dsa-bcm_sf2-Check-earlier-for-FLOW_EXT-and-FLOW_.patch b/target/linux/generic/backport-5.4/707-v5.7-0009-net-dsa-bcm_sf2-Check-earlier-for-FLOW_EXT-and-FLOW_.patch new file mode 100644 index 0000000000..5c445ee9b9 --- /dev/null +++ b/target/linux/generic/backport-5.4/707-v5.7-0009-net-dsa-bcm_sf2-Check-earlier-for-FLOW_EXT-and-FLOW_.patch @@ -0,0 +1,33 @@ +From 5ae8c0d51ace3bdbfb89c27e7661f081cc9287de Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 30 Mar 2020 14:38:51 -0700 +Subject: [PATCH] net: dsa: bcm_sf2: Check earlier for FLOW_EXT and + FLOW_MAC_EXT + +We do not currently support matching on FLOW_EXT or FLOW_MAC_EXT, but we +were not checking for those bits being set in the flow specification. + +The check for FLOW_EXT and FLOW_MAC_EXT are separated out because a +subsequent commit will add support for matching VLAN TCI which are +covered by FLOW_EXT. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/bcm_sf2_cfp.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/net/dsa/bcm_sf2_cfp.c ++++ b/drivers/net/dsa/bcm_sf2_cfp.c +@@ -878,8 +878,9 @@ static int bcm_sf2_cfp_rule_set(struct d + int ret = -EINVAL; + + /* Check for unsupported extensions */ +- if ((fs->flow_type & FLOW_EXT) && (fs->m_ext.vlan_etype || +- fs->m_ext.data[1])) ++ if ((fs->flow_type & FLOW_EXT) || ++ (fs->flow_type & FLOW_MAC_EXT) || ++ fs->m_ext.data[1]) + return -EINVAL; + + if (fs->location != RX_CLS_LOC_ANY && diff --git a/target/linux/generic/backport-5.4/707-v5.7-0010-net-dsa-bcm_sf2-Move-writing-of-CFP_DATA-5-into-slic.patch b/target/linux/generic/backport-5.4/707-v5.7-0010-net-dsa-bcm_sf2-Move-writing-of-CFP_DATA-5-into-slic.patch new file mode 100644 index 0000000000..93b47aff71 --- /dev/null +++ b/target/linux/generic/backport-5.4/707-v5.7-0010-net-dsa-bcm_sf2-Move-writing-of-CFP_DATA-5-into-slic.patch @@ -0,0 +1,131 @@ +From c2d639d118d27d6419f5848675ed5c112a86910f Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 30 Mar 2020 14:38:52 -0700 +Subject: [PATCH] net: dsa: bcm_sf2: Move writing of CFP_DATA(5) into slicing + functions + +In preparation for matching VLANs, move the writing of CFP_DATA(5) into +the IPv4 and IPv6 slicing logic since they are part of the per-flow +configuration. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/bcm_sf2_cfp.c | 64 +++++++++++++++++------------------ + 1 file changed, 32 insertions(+), 32 deletions(-) + +--- a/drivers/net/dsa/bcm_sf2_cfp.c ++++ b/drivers/net/dsa/bcm_sf2_cfp.c +@@ -261,11 +261,20 @@ static int bcm_sf2_cfp_act_pol_set(struc + static void bcm_sf2_cfp_slice_ipv4(struct bcm_sf2_priv *priv, + struct flow_dissector_key_ipv4_addrs *addrs, + struct flow_dissector_key_ports *ports, +- unsigned int slice_num, ++ unsigned int slice_num, u8 num_udf, + bool mask) + { + u32 reg, offset; + ++ /* UDF_Valid[7:0] [31:24] ++ * S-Tag [23:8] ++ * C-Tag [7:0] ++ */ ++ if (mask) ++ core_writel(priv, udf_lower_bits(num_udf) << 24, CORE_CFP_MASK_PORT(5)); ++ else ++ core_writel(priv, udf_lower_bits(num_udf) << 24, CORE_CFP_DATA_PORT(5)); ++ + /* C-Tag [31:24] + * UDF_n_A8 [23:8] + * UDF_n_A7 [7:0] +@@ -421,18 +430,11 @@ static int bcm_sf2_cfp_ipv4_rule_set(str + core_writel(priv, layout->udfs[slice_num].mask_value | + udf_upper_bits(num_udf), CORE_CFP_MASK_PORT(6)); + +- /* UDF_Valid[7:0] [31:24] +- * S-Tag [23:8] +- * C-Tag [7:0] +- */ +- core_writel(priv, udf_lower_bits(num_udf) << 24, CORE_CFP_DATA_PORT(5)); +- +- /* Mask all but valid UDFs */ +- core_writel(priv, udf_lower_bits(num_udf) << 24, CORE_CFP_MASK_PORT(5)); +- + /* Program the match and the mask */ +- bcm_sf2_cfp_slice_ipv4(priv, ipv4.key, ports.key, slice_num, false); +- bcm_sf2_cfp_slice_ipv4(priv, ipv4.mask, ports.mask, SLICE_NUM_MASK, true); ++ bcm_sf2_cfp_slice_ipv4(priv, ipv4.key, ports.key, slice_num, ++ num_udf, false); ++ bcm_sf2_cfp_slice_ipv4(priv, ipv4.mask, ports.mask, SLICE_NUM_MASK, ++ num_udf, true); + + /* Insert into TCAM now */ + bcm_sf2_cfp_rule_addr_set(priv, rule_index); +@@ -468,11 +470,20 @@ out_err_flow_rule: + + static void bcm_sf2_cfp_slice_ipv6(struct bcm_sf2_priv *priv, + const __be32 *ip6_addr, const __be16 port, +- unsigned int slice_num, ++ unsigned int slice_num, u32 udf_bits, + bool mask) + { + u32 reg, tmp, val, offset; + ++ /* UDF_Valid[7:0] [31:24] ++ * S-Tag [23:8] ++ * C-Tag [7:0] ++ */ ++ if (mask) ++ core_writel(priv, udf_bits << 24, CORE_CFP_MASK_PORT(5)); ++ else ++ core_writel(priv, udf_bits << 24, CORE_CFP_DATA_PORT(5)); ++ + /* C-Tag [31:24] + * UDF_n_B8 [23:8] (port) + * UDF_n_B7 (upper) [7:0] (addr[15:8]) +@@ -704,20 +715,13 @@ static int bcm_sf2_cfp_ipv6_rule_set(str + reg = layout->udfs[slice_num].mask_value | udf_upper_bits(num_udf); + core_writel(priv, reg, CORE_CFP_MASK_PORT(6)); + +- /* UDF_Valid[7:0] [31:24] +- * S-Tag [23:8] +- * C-Tag [7:0] +- */ +- core_writel(priv, udf_lower_bits(num_udf) << 24, CORE_CFP_DATA_PORT(5)); +- +- /* Mask all but valid UDFs */ +- core_writel(priv, udf_lower_bits(num_udf) << 24, CORE_CFP_MASK_PORT(5)); +- + /* Slice the IPv6 source address and port */ + bcm_sf2_cfp_slice_ipv6(priv, ipv6.key->src.in6_u.u6_addr32, +- ports.key->src, slice_num, false); ++ ports.key->src, slice_num, ++ udf_lower_bits(num_udf), false); + bcm_sf2_cfp_slice_ipv6(priv, ipv6.mask->src.in6_u.u6_addr32, +- ports.mask->src, SLICE_NUM_MASK, true); ++ ports.mask->src, SLICE_NUM_MASK, ++ udf_lower_bits(num_udf), true); + + /* Insert into TCAM now because we need to insert a second rule */ + bcm_sf2_cfp_rule_addr_set(priv, rule_index[0]); +@@ -768,16 +772,12 @@ static int bcm_sf2_cfp_ipv6_rule_set(str + udf_lower_bits(num_udf) << 8; + core_writel(priv, reg, CORE_CFP_MASK_PORT(6)); + +- /* Don't care */ +- core_writel(priv, 0, CORE_CFP_DATA_PORT(5)); +- +- /* Mask all */ +- core_writel(priv, 0, CORE_CFP_MASK_PORT(5)); +- + bcm_sf2_cfp_slice_ipv6(priv, ipv6.key->dst.in6_u.u6_addr32, +- ports.key->dst, slice_num, false); ++ ports.key->dst, slice_num, ++ 0, false); + bcm_sf2_cfp_slice_ipv6(priv, ipv6.mask->dst.in6_u.u6_addr32, +- ports.key->dst, SLICE_NUM_MASK, true); ++ ports.key->dst, SLICE_NUM_MASK, ++ 0, true); + + /* Insert into TCAM now */ + bcm_sf2_cfp_rule_addr_set(priv, rule_index[1]); diff --git a/target/linux/generic/backport-5.4/707-v5.7-0011-net-dsa-bcm_sf2-Add-support-for-matching-VLAN-TCI.patch b/target/linux/generic/backport-5.4/707-v5.7-0011-net-dsa-bcm_sf2-Add-support-for-matching-VLAN-TCI.patch new file mode 100644 index 0000000000..71de609870 --- /dev/null +++ b/target/linux/generic/backport-5.4/707-v5.7-0011-net-dsa-bcm_sf2-Add-support-for-matching-VLAN-TCI.patch @@ -0,0 +1,181 @@ +From 7555020c44db75a0d934dffc0aa6c678b52b2a13 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 30 Mar 2020 14:38:53 -0700 +Subject: [PATCH] net: dsa: bcm_sf2: Add support for matching VLAN TCI + +Update relevant code paths to support the programming and matching of +VLAN TCI, this is the only member of the ethtool_flow_ext that we can +match, the switch does not permit matching the VLAN Ethernet Type field. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/bcm_sf2_cfp.c | 53 +++++++++++++++++++++++++---------- + 1 file changed, 38 insertions(+), 15 deletions(-) + +--- a/drivers/net/dsa/bcm_sf2_cfp.c ++++ b/drivers/net/dsa/bcm_sf2_cfp.c +@@ -261,6 +261,7 @@ static int bcm_sf2_cfp_act_pol_set(struc + static void bcm_sf2_cfp_slice_ipv4(struct bcm_sf2_priv *priv, + struct flow_dissector_key_ipv4_addrs *addrs, + struct flow_dissector_key_ports *ports, ++ const __be16 vlan_tci, + unsigned int slice_num, u8 num_udf, + bool mask) + { +@@ -270,16 +271,17 @@ static void bcm_sf2_cfp_slice_ipv4(struc + * S-Tag [23:8] + * C-Tag [7:0] + */ ++ reg = udf_lower_bits(num_udf) << 24 | be16_to_cpu(vlan_tci) >> 8; + if (mask) +- core_writel(priv, udf_lower_bits(num_udf) << 24, CORE_CFP_MASK_PORT(5)); ++ core_writel(priv, reg, CORE_CFP_MASK_PORT(5)); + else +- core_writel(priv, udf_lower_bits(num_udf) << 24, CORE_CFP_DATA_PORT(5)); ++ core_writel(priv, reg, CORE_CFP_DATA_PORT(5)); + + /* C-Tag [31:24] + * UDF_n_A8 [23:8] + * UDF_n_A7 [7:0] + */ +- reg = 0; ++ reg = (u32)(be16_to_cpu(vlan_tci) & 0xff) << 24; + if (mask) + offset = CORE_CFP_MASK_PORT(4); + else +@@ -345,6 +347,7 @@ static int bcm_sf2_cfp_ipv4_rule_set(str + struct ethtool_rx_flow_spec *fs) + { + struct ethtool_rx_flow_spec_input input = {}; ++ __be16 vlan_tci = 0 , vlan_m_tci = 0xffff; + const struct cfp_udf_layout *layout; + unsigned int slice_num, rule_index; + struct ethtool_rx_flow_rule *flow; +@@ -369,6 +372,12 @@ static int bcm_sf2_cfp_ipv4_rule_set(str + + ip_frag = !!(be32_to_cpu(fs->h_ext.data[0]) & 1); + ++ /* Extract VLAN TCI */ ++ if (fs->flow_type & FLOW_EXT) { ++ vlan_tci = fs->h_ext.vlan_tci; ++ vlan_m_tci = fs->m_ext.vlan_tci; ++ } ++ + /* Locate the first rule available */ + if (fs->location == RX_CLS_LOC_ANY) + rule_index = find_first_zero_bit(priv->cfp.used, +@@ -431,10 +440,10 @@ static int bcm_sf2_cfp_ipv4_rule_set(str + udf_upper_bits(num_udf), CORE_CFP_MASK_PORT(6)); + + /* Program the match and the mask */ +- bcm_sf2_cfp_slice_ipv4(priv, ipv4.key, ports.key, slice_num, +- num_udf, false); +- bcm_sf2_cfp_slice_ipv4(priv, ipv4.mask, ports.mask, SLICE_NUM_MASK, +- num_udf, true); ++ bcm_sf2_cfp_slice_ipv4(priv, ipv4.key, ports.key, vlan_tci, ++ slice_num, num_udf, false); ++ bcm_sf2_cfp_slice_ipv4(priv, ipv4.mask, ports.mask, vlan_m_tci, ++ SLICE_NUM_MASK, num_udf, true); + + /* Insert into TCAM now */ + bcm_sf2_cfp_rule_addr_set(priv, rule_index); +@@ -470,6 +479,7 @@ out_err_flow_rule: + + static void bcm_sf2_cfp_slice_ipv6(struct bcm_sf2_priv *priv, + const __be32 *ip6_addr, const __be16 port, ++ const __be16 vlan_tci, + unsigned int slice_num, u32 udf_bits, + bool mask) + { +@@ -479,10 +489,11 @@ static void bcm_sf2_cfp_slice_ipv6(struc + * S-Tag [23:8] + * C-Tag [7:0] + */ ++ reg = udf_bits << 24 | be16_to_cpu(vlan_tci) >> 8; + if (mask) +- core_writel(priv, udf_bits << 24, CORE_CFP_MASK_PORT(5)); ++ core_writel(priv, reg, CORE_CFP_MASK_PORT(5)); + else +- core_writel(priv, udf_bits << 24, CORE_CFP_DATA_PORT(5)); ++ core_writel(priv, reg, CORE_CFP_DATA_PORT(5)); + + /* C-Tag [31:24] + * UDF_n_B8 [23:8] (port) +@@ -490,6 +501,7 @@ static void bcm_sf2_cfp_slice_ipv6(struc + */ + reg = be32_to_cpu(ip6_addr[3]); + val = (u32)be16_to_cpu(port) << 8 | ((reg >> 8) & 0xff); ++ val |= (u32)(be16_to_cpu(vlan_tci) & 0xff) << 24; + if (mask) + offset = CORE_CFP_MASK_PORT(4); + else +@@ -598,6 +610,11 @@ static int bcm_sf2_cfp_rule_cmp(struct b + + ret = memcmp(&rule->fs.h_u, &fs->h_u, fs_size); + ret |= memcmp(&rule->fs.m_u, &fs->m_u, fs_size); ++ /* Compare VLAN TCI values as well */ ++ if (rule->fs.flow_type & FLOW_EXT) { ++ ret |= rule->fs.h_ext.vlan_tci != fs->h_ext.vlan_tci; ++ ret |= rule->fs.m_ext.vlan_tci != fs->m_ext.vlan_tci; ++ } + if (ret == 0) + break; + } +@@ -611,6 +628,7 @@ static int bcm_sf2_cfp_ipv6_rule_set(str + struct ethtool_rx_flow_spec *fs) + { + struct ethtool_rx_flow_spec_input input = {}; ++ __be16 vlan_tci = 0, vlan_m_tci = 0xffff; + unsigned int slice_num, rule_index[2]; + const struct cfp_udf_layout *layout; + struct ethtool_rx_flow_rule *flow; +@@ -634,6 +652,12 @@ static int bcm_sf2_cfp_ipv6_rule_set(str + + ip_frag = !!(be32_to_cpu(fs->h_ext.data[0]) & 1); + ++ /* Extract VLAN TCI */ ++ if (fs->flow_type & FLOW_EXT) { ++ vlan_tci = fs->h_ext.vlan_tci; ++ vlan_m_tci = fs->m_ext.vlan_tci; ++ } ++ + layout = &udf_tcpip6_layout; + slice_num = bcm_sf2_get_slice_number(layout, 0); + if (slice_num == UDF_NUM_SLICES) +@@ -717,10 +741,10 @@ static int bcm_sf2_cfp_ipv6_rule_set(str + + /* Slice the IPv6 source address and port */ + bcm_sf2_cfp_slice_ipv6(priv, ipv6.key->src.in6_u.u6_addr32, +- ports.key->src, slice_num, ++ ports.key->src, vlan_tci, slice_num, + udf_lower_bits(num_udf), false); + bcm_sf2_cfp_slice_ipv6(priv, ipv6.mask->src.in6_u.u6_addr32, +- ports.mask->src, SLICE_NUM_MASK, ++ ports.mask->src, vlan_m_tci, SLICE_NUM_MASK, + udf_lower_bits(num_udf), true); + + /* Insert into TCAM now because we need to insert a second rule */ +@@ -773,10 +797,10 @@ static int bcm_sf2_cfp_ipv6_rule_set(str + core_writel(priv, reg, CORE_CFP_MASK_PORT(6)); + + bcm_sf2_cfp_slice_ipv6(priv, ipv6.key->dst.in6_u.u6_addr32, +- ports.key->dst, slice_num, ++ ports.key->dst, 0, slice_num, + 0, false); + bcm_sf2_cfp_slice_ipv6(priv, ipv6.mask->dst.in6_u.u6_addr32, +- ports.key->dst, SLICE_NUM_MASK, ++ ports.key->dst, 0, SLICE_NUM_MASK, + 0, true); + + /* Insert into TCAM now */ +@@ -878,8 +902,7 @@ static int bcm_sf2_cfp_rule_set(struct d + int ret = -EINVAL; + + /* Check for unsupported extensions */ +- if ((fs->flow_type & FLOW_EXT) || +- (fs->flow_type & FLOW_MAC_EXT) || ++ if ((fs->flow_type & FLOW_MAC_EXT) || + fs->m_ext.data[1]) + return -EINVAL; + diff --git a/target/linux/generic/backport-5.4/707-v5.7-0012-net-dsa-bcm_sf2-Support-specifying-VLAN-tag-egress-r.patch b/target/linux/generic/backport-5.4/707-v5.7-0012-net-dsa-bcm_sf2-Support-specifying-VLAN-tag-egress-r.patch new file mode 100644 index 0000000000..174d76c7e6 --- /dev/null +++ b/target/linux/generic/backport-5.4/707-v5.7-0012-net-dsa-bcm_sf2-Support-specifying-VLAN-tag-egress-r.patch @@ -0,0 +1,94 @@ +From 8b3abe304c5f1057b7bac70fd5576dfa67e3e2b3 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 30 Mar 2020 14:38:54 -0700 +Subject: [PATCH] net: dsa: bcm_sf2: Support specifying VLAN tag egress rule + +The port to which the ASP is connected on 7278 is not capable of +processing VLAN tags as part of the Ethernet frame, so allow an user to +configure the egress VLAN policy they want to see applied by purposing +the h_ext.data[1] field. Bit 0 is used to indicate that 0=tagged, +1=untagged. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/bcm_sf2_cfp.c | 40 +++++++++++++++++++++++++++++++++-- + 1 file changed, 38 insertions(+), 2 deletions(-) + +--- a/drivers/net/dsa/bcm_sf2_cfp.c ++++ b/drivers/net/dsa/bcm_sf2_cfp.c +@@ -13,6 +13,8 @@ + #include + #include + #include ++#include ++#include + + #include "bcm_sf2.h" + #include "bcm_sf2_regs.h" +@@ -847,7 +849,9 @@ static int bcm_sf2_cfp_rule_insert(struc + struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); + s8 cpu_port = ds->ports[port].cpu_dp->index; + __u64 ring_cookie = fs->ring_cookie; ++ struct switchdev_obj_port_vlan vlan; + unsigned int queue_num, port_num; ++ u16 vid; + int ret; + + /* This rule is a Wake-on-LAN filter and we must specifically +@@ -867,6 +871,34 @@ static int bcm_sf2_cfp_rule_insert(struc + dsa_is_cpu_port(ds, port_num)) || + port_num >= priv->hw_params.num_ports) + return -EINVAL; ++ ++ /* If the rule is matching a particular VLAN, make sure that we honor ++ * the matching and have it tagged or untagged on the destination port, ++ * we do this on egress with a VLAN entry. The egress tagging attribute ++ * is expected to be provided in h_ext.data[1] bit 0. A 1 means untagged, ++ * a 0 means tagged. ++ */ ++ if (fs->flow_type & FLOW_EXT) { ++ /* We cannot support matching multiple VLAN IDs yet */ ++ if ((be16_to_cpu(fs->m_ext.vlan_tci) & VLAN_VID_MASK) != ++ VLAN_VID_MASK) ++ return -EINVAL; ++ ++ vid = be16_to_cpu(fs->h_ext.vlan_tci) & VLAN_VID_MASK; ++ vlan.vid_begin = vid; ++ vlan.vid_end = vid; ++ if (cpu_to_be32(fs->h_ext.data[1]) & 1) ++ vlan.flags = BRIDGE_VLAN_INFO_UNTAGGED; ++ else ++ vlan.flags = 0; ++ ++ ret = ds->ops->port_vlan_prepare(ds, port_num, &vlan); ++ if (ret) ++ return ret; ++ ++ ds->ops->port_vlan_add(ds, port_num, &vlan); ++ } ++ + /* + * We have a small oddity where Port 6 just does not have a + * valid bit here (so we substract by one). +@@ -902,14 +934,18 @@ static int bcm_sf2_cfp_rule_set(struct d + int ret = -EINVAL; + + /* Check for unsupported extensions */ +- if ((fs->flow_type & FLOW_MAC_EXT) || +- fs->m_ext.data[1]) ++ if (fs->flow_type & FLOW_MAC_EXT) + return -EINVAL; + + if (fs->location != RX_CLS_LOC_ANY && + fs->location > bcm_sf2_cfp_rule_size(priv)) + return -EINVAL; + ++ if ((fs->flow_type & FLOW_EXT) && ++ !(ds->ops->port_vlan_prepare || ds->ops->port_vlan_add || ++ ds->ops->port_vlan_del)) ++ return -EOPNOTSUPP; ++ + if (fs->location != RX_CLS_LOC_ANY && + test_bit(fs->location, priv->cfp.used)) + return -EBUSY; diff --git a/target/linux/generic/backport-5.4/707-v5.7-0016-net-dsa-b53-Fix-valid-setting-for-MDB-entries.patch b/target/linux/generic/backport-5.4/707-v5.7-0016-net-dsa-b53-Fix-valid-setting-for-MDB-entries.patch new file mode 100644 index 0000000000..f77aee1a87 --- /dev/null +++ b/target/linux/generic/backport-5.4/707-v5.7-0016-net-dsa-b53-Fix-valid-setting-for-MDB-entries.patch @@ -0,0 +1,30 @@ +From eab167f4851a19c514469dfa81147f77e17b5b20 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 20 Apr 2020 20:26:52 -0700 +Subject: [PATCH] net: dsa: b53: Fix valid setting for MDB entries + +When support for the MDB entries was added, the valid bit was correctly +changed to be assigned depending on the remaining port bitmask, that is, +if there were no more ports added to the entry's port bitmask, the entry +now becomes invalid. There was another assignment a few lines below that +would override this which would invalidate entries even when there were +still multiple ports left in the MDB entry. + +Fixes: 5d65b64a3d97 ("net: dsa: b53: Add support for MDB") +Reviewed-by: Andrew Lunn +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1600,7 +1600,6 @@ static int b53_arl_op(struct b53_device + ent.is_valid = !!(ent.port); + } + +- ent.is_valid = is_valid; + ent.vid = vid; + ent.is_static = true; + ent.is_age = false; diff --git a/target/linux/generic/backport-5.4/709-v5.8-0001-net-dsa-b53-per-port-interrupts-are-optional.patch b/target/linux/generic/backport-5.4/709-v5.8-0001-net-dsa-b53-per-port-interrupts-are-optional.patch new file mode 100644 index 0000000000..ee1c883585 --- /dev/null +++ b/target/linux/generic/backport-5.4/709-v5.8-0001-net-dsa-b53-per-port-interrupts-are-optional.patch @@ -0,0 +1,25 @@ +From 007fc3c0ca478f3a8ad687cf9ecbe672d3a64700 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Fri, 17 Apr 2020 11:33:41 -0700 +Subject: [PATCH] net: dsa: b53: per-port interrupts are optional + +Make use of platform_get_irq_byname_optional() to avoid printing +messages on the kernel console that interrupts cannot be found. + +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_srab.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/dsa/b53/b53_srab.c ++++ b/drivers/net/dsa/b53/b53_srab.c +@@ -524,7 +524,7 @@ static void b53_srab_prepare_irq(struct + + port->num = i; + port->dev = dev; +- port->irq = platform_get_irq_byname(pdev, name); ++ port->irq = platform_get_irq_byname_optional(pdev, name); + kfree(name); + } + diff --git a/target/linux/generic/backport-5.4/709-v5.8-0002-net-dsa-b53-Rename-num_arl_entries-to-num_arl_bins.patch b/target/linux/generic/backport-5.4/709-v5.8-0002-net-dsa-b53-Rename-num_arl_entries-to-num_arl_bins.patch new file mode 100644 index 0000000000..7b566ddb6c --- /dev/null +++ b/target/linux/generic/backport-5.4/709-v5.8-0002-net-dsa-b53-Rename-num_arl_entries-to-num_arl_bins.patch @@ -0,0 +1,255 @@ +From 673e69a67dd63fc3b40f109d1677a5dc72185fbb Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 30 Apr 2020 11:49:08 -0700 +Subject: [PATCH] net: dsa: b53: Rename num_arl_entries to num_arl_bins + +The variable currently holds the number of ARL bins per ARL buckets, +which is different from the number of ARL entries which would be bins +times buckets. We will be adding a num_arl_buckets in a subsequent patch +so get variables straight now. + +Signed-off-by: Florian Fainelli +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 52 ++++++++++++++++---------------- + drivers/net/dsa/b53/b53_priv.h | 2 +- + 2 files changed, 27 insertions(+), 27 deletions(-) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1506,10 +1506,10 @@ static int b53_arl_read(struct b53_devic + if (ret) + return ret; + +- bitmap_zero(free_bins, dev->num_arl_entries); ++ bitmap_zero(free_bins, dev->num_arl_bins); + + /* Read the bins */ +- for (i = 0; i < dev->num_arl_entries; i++) { ++ for (i = 0; i < dev->num_arl_bins; i++) { + u64 mac_vid; + u32 fwd_entry; + +@@ -1532,10 +1532,10 @@ static int b53_arl_read(struct b53_devic + return 0; + } + +- if (bitmap_weight(free_bins, dev->num_arl_entries) == 0) ++ if (bitmap_weight(free_bins, dev->num_arl_bins) == 0) + return -ENOSPC; + +- *idx = find_first_bit(free_bins, dev->num_arl_entries); ++ *idx = find_first_bit(free_bins, dev->num_arl_bins); + + return -ENOENT; + } +@@ -1705,7 +1705,7 @@ int b53_fdb_dump(struct dsa_switch *ds, + if (ret) + return ret; + +- if (priv->num_arl_entries > 2) { ++ if (priv->num_arl_bins > 2) { + b53_arl_search_rd(priv, 1, &results[1]); + ret = b53_fdb_copy(port, &results[1], cb, data); + if (ret) +@@ -2179,7 +2179,7 @@ struct b53_chip_data { + u16 enabled_ports; + u8 cpu_port; + u8 vta_regs[3]; +- u8 arl_entries; ++ u8 arl_bins; + u8 duplex_reg; + u8 jumbo_pm_reg; + u8 jumbo_size_reg; +@@ -2198,7 +2198,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM5325", + .vlans = 16, + .enabled_ports = 0x1f, +- .arl_entries = 2, ++ .arl_bins = 2, + .cpu_port = B53_CPU_PORT_25, + .duplex_reg = B53_DUPLEX_STAT_FE, + }, +@@ -2207,7 +2207,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM5365", + .vlans = 256, + .enabled_ports = 0x1f, +- .arl_entries = 2, ++ .arl_bins = 2, + .cpu_port = B53_CPU_PORT_25, + .duplex_reg = B53_DUPLEX_STAT_FE, + }, +@@ -2216,7 +2216,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM5389", + .vlans = 4096, + .enabled_ports = 0x1f, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2228,7 +2228,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM5395", + .vlans = 4096, + .enabled_ports = 0x1f, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2240,7 +2240,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM5397", + .vlans = 4096, + .enabled_ports = 0x1f, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS_9798, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2252,7 +2252,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM5398", + .vlans = 4096, + .enabled_ports = 0x7f, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS_9798, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2264,7 +2264,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM53115", + .vlans = 4096, + .enabled_ports = 0x1f, +- .arl_entries = 4, ++ .arl_bins = 4, + .vta_regs = B53_VTA_REGS, + .cpu_port = B53_CPU_PORT, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2276,7 +2276,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM53125", + .vlans = 4096, + .enabled_ports = 0xff, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2288,7 +2288,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM53128", + .vlans = 4096, + .enabled_ports = 0x1ff, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2300,7 +2300,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM63xx", + .vlans = 4096, + .enabled_ports = 0, /* pdata must provide them */ +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS_63XX, + .duplex_reg = B53_DUPLEX_STAT_63XX, +@@ -2312,7 +2312,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM53010", + .vlans = 4096, + .enabled_ports = 0x1f, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */ + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2324,7 +2324,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM53011", + .vlans = 4096, + .enabled_ports = 0x1bf, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */ + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2336,7 +2336,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM53012", + .vlans = 4096, + .enabled_ports = 0x1bf, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */ + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2348,7 +2348,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM53018", + .vlans = 4096, + .enabled_ports = 0x1f, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */ + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2360,7 +2360,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM53019", + .vlans = 4096, + .enabled_ports = 0x1f, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */ + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2372,7 +2372,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM585xx/586xx/88312", + .vlans = 4096, + .enabled_ports = 0x1ff, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2384,7 +2384,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM583xx/11360", + .vlans = 4096, + .enabled_ports = 0x103, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2396,7 +2396,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM7445", + .vlans = 4096, + .enabled_ports = 0x1ff, +- .arl_entries = 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2408,7 +2408,7 @@ static const struct b53_chip_data b53_sw + .dev_name = "BCM7278", + .vlans = 4096, + .enabled_ports = 0x1ff, +- .arl_entries= 4, ++ .arl_bins = 4, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2436,7 +2436,7 @@ static int b53_switch_init(struct b53_de + dev->jumbo_pm_reg = chip->jumbo_pm_reg; + dev->cpu_port = chip->cpu_port; + dev->num_vlans = chip->vlans; +- dev->num_arl_entries = chip->arl_entries; ++ dev->num_arl_bins = chip->arl_bins; + break; + } + } +--- a/drivers/net/dsa/b53/b53_priv.h ++++ b/drivers/net/dsa/b53/b53_priv.h +@@ -117,7 +117,7 @@ struct b53_device { + u8 jumbo_pm_reg; + u8 jumbo_size_reg; + int reset_gpio; +- u8 num_arl_entries; ++ u8 num_arl_bins; + enum dsa_tag_protocol tag_protocol; + + /* used ports mask */ diff --git a/target/linux/generic/backport-5.4/709-v5.8-0003-net-dsa-b53-Provide-number-of-ARL-buckets.patch b/target/linux/generic/backport-5.4/709-v5.8-0003-net-dsa-b53-Provide-number-of-ARL-buckets.patch new file mode 100644 index 0000000000..3c278d4a54 --- /dev/null +++ b/target/linux/generic/backport-5.4/709-v5.8-0003-net-dsa-b53-Provide-number-of-ARL-buckets.patch @@ -0,0 +1,198 @@ +From e3da4038f4ca1094596a7604c6edac4a6a4f6ee9 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 30 Apr 2020 11:49:09 -0700 +Subject: [PATCH] net: dsa: b53: Provide number of ARL buckets + +In preparation for doing proper upper bound checking of FDB/MDB entries +being added to the ARL, provide the number of ARL buckets for each +switch chip we support. All chips have 1024 buckets, except 7278 which +has only 256. + +Signed-off-by: Florian Fainelli +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 21 +++++++++++++++++++++ + drivers/net/dsa/b53/b53_priv.h | 1 + + 2 files changed, 22 insertions(+) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -2180,6 +2180,7 @@ struct b53_chip_data { + u8 cpu_port; + u8 vta_regs[3]; + u8 arl_bins; ++ u16 arl_buckets; + u8 duplex_reg; + u8 jumbo_pm_reg; + u8 jumbo_size_reg; +@@ -2199,6 +2200,7 @@ static const struct b53_chip_data b53_sw + .vlans = 16, + .enabled_ports = 0x1f, + .arl_bins = 2, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT_25, + .duplex_reg = B53_DUPLEX_STAT_FE, + }, +@@ -2208,6 +2210,7 @@ static const struct b53_chip_data b53_sw + .vlans = 256, + .enabled_ports = 0x1f, + .arl_bins = 2, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT_25, + .duplex_reg = B53_DUPLEX_STAT_FE, + }, +@@ -2217,6 +2220,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1f, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2229,6 +2233,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1f, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2241,6 +2246,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1f, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS_9798, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2253,6 +2259,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x7f, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS_9798, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2265,6 +2272,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1f, + .arl_bins = 4, ++ .arl_buckets = 1024, + .vta_regs = B53_VTA_REGS, + .cpu_port = B53_CPU_PORT, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2277,6 +2285,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0xff, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2289,6 +2298,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1ff, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2301,6 +2311,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0, /* pdata must provide them */ + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS_63XX, + .duplex_reg = B53_DUPLEX_STAT_63XX, +@@ -2313,6 +2324,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1f, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */ + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2325,6 +2337,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1bf, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */ + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2337,6 +2350,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1bf, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */ + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2349,6 +2363,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1f, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */ + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2361,6 +2376,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1f, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */ + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2373,6 +2389,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1ff, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2385,6 +2402,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x103, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2397,6 +2415,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1ff, + .arl_bins = 4, ++ .arl_buckets = 1024, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2409,6 +2428,7 @@ static const struct b53_chip_data b53_sw + .vlans = 4096, + .enabled_ports = 0x1ff, + .arl_bins = 4, ++ .arl_buckets = 256, + .cpu_port = B53_CPU_PORT, + .vta_regs = B53_VTA_REGS, + .duplex_reg = B53_DUPLEX_STAT_GE, +@@ -2437,6 +2457,7 @@ static int b53_switch_init(struct b53_de + dev->cpu_port = chip->cpu_port; + dev->num_vlans = chip->vlans; + dev->num_arl_bins = chip->arl_bins; ++ dev->num_arl_buckets = chip->arl_buckets; + break; + } + } +--- a/drivers/net/dsa/b53/b53_priv.h ++++ b/drivers/net/dsa/b53/b53_priv.h +@@ -118,6 +118,7 @@ struct b53_device { + u8 jumbo_size_reg; + int reset_gpio; + u8 num_arl_bins; ++ u16 num_arl_buckets; + enum dsa_tag_protocol tag_protocol; + + /* used ports mask */ diff --git a/target/linux/generic/backport-5.4/709-v5.8-0004-net-dsa-b53-Bound-check-ARL-searches.patch b/target/linux/generic/backport-5.4/709-v5.8-0004-net-dsa-b53-Bound-check-ARL-searches.patch new file mode 100644 index 0000000000..8faf2ace82 --- /dev/null +++ b/target/linux/generic/backport-5.4/709-v5.8-0004-net-dsa-b53-Bound-check-ARL-searches.patch @@ -0,0 +1,43 @@ +From cd169d799beeb738fa2d3e891960924cdcaf8414 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 30 Apr 2020 11:49:10 -0700 +Subject: [PATCH] net: dsa: b53: Bound check ARL searches + +ARL searches are done by reading two ARL entries at a time, do not cap +the search at 1024 which would only limit us to half of the possible ARL +capacity, but use b53_max_arl_entries() instead which does the right +multiplication between bins and indexes. + +Signed-off-by: Florian Fainelli +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 2 +- + drivers/net/dsa/b53/b53_priv.h | 5 +++++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1715,7 +1715,7 @@ int b53_fdb_dump(struct dsa_switch *ds, + break; + } + +- } while (count++ < 1024); ++ } while (count++ < b53_max_arl_entries(priv) / 2); + + return 0; + } +--- a/drivers/net/dsa/b53/b53_priv.h ++++ b/drivers/net/dsa/b53/b53_priv.h +@@ -213,6 +213,11 @@ static inline int is58xx(struct b53_devi + #define B53_CPU_PORT_25 5 + #define B53_CPU_PORT 8 + ++static inline unsigned int b53_max_arl_entries(struct b53_device *dev) ++{ ++ return dev->num_arl_buckets * dev->num_arl_bins; ++} ++ + struct b53_device *b53_switch_alloc(struct device *base, + const struct b53_io_ops *ops, + void *priv); diff --git a/target/linux/generic/backport-5.4/709-v5.8-0005-net-dsa-b53-Remove-is_static-argument-to-b53_read_op.patch b/target/linux/generic/backport-5.4/709-v5.8-0005-net-dsa-b53-Remove-is_static-argument-to-b53_read_op.patch new file mode 100644 index 0000000000..e4dad7d924 --- /dev/null +++ b/target/linux/generic/backport-5.4/709-v5.8-0005-net-dsa-b53-Remove-is_static-argument-to-b53_read_op.patch @@ -0,0 +1,36 @@ +From ef2a0bd99b1549a3a4253355be247d5dff25d720 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 30 Apr 2020 11:49:11 -0700 +Subject: [PATCH] net: dsa: b53: Remove is_static argument to b53_read_op() + +This argument is not used. + +Signed-off-by: Florian Fainelli +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1495,8 +1495,7 @@ static int b53_arl_rw_op(struct b53_devi + } + + static int b53_arl_read(struct b53_device *dev, u64 mac, +- u16 vid, struct b53_arl_entry *ent, u8 *idx, +- bool is_valid) ++ u16 vid, struct b53_arl_entry *ent, u8 *idx) + { + DECLARE_BITMAP(free_bins, B53_ARLTBL_MAX_BIN_ENTRIES); + unsigned int i; +@@ -1561,7 +1560,8 @@ static int b53_arl_op(struct b53_device + if (ret) + return ret; + +- ret = b53_arl_read(dev, mac, vid, &ent, &idx, is_valid); ++ ret = b53_arl_read(dev, mac, vid, &ent, &idx); ++ + /* If this is a read, just finish now */ + if (op) + return ret; diff --git a/target/linux/generic/backport-5.4/709-v5.8-0006-net-dsa-b53-remove-redundant-premature-assignment-to.patch b/target/linux/generic/backport-5.4/709-v5.8-0006-net-dsa-b53-remove-redundant-premature-assignment-to.patch new file mode 100644 index 0000000000..1360aa4631 --- /dev/null +++ b/target/linux/generic/backport-5.4/709-v5.8-0006-net-dsa-b53-remove-redundant-premature-assignment-to.patch @@ -0,0 +1,28 @@ +From 9f01a71c5cbec10b851588457089d17c20dc5a40 Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Wed, 27 May 2020 13:01:29 +0100 +Subject: [PATCH] net: dsa: b53: remove redundant premature assignment to + new_pvid + +Variable new_pvid is being assigned with a value that is never read, +the following if statement updates new_pvid with a new value in both +of the if paths. The assignment is redundant and can be removed. + +Addresses-Coverity: ("Unused value") +Signed-off-by: Colin Ian King +Acked-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_common.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1336,7 +1336,6 @@ int b53_vlan_filtering(struct dsa_switch + u16 pvid, new_pvid; + + b53_read16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port), &pvid); +- new_pvid = pvid; + if (!vlan_filtering) { + /* Filtering is currently enabled, use the default PVID since + * the bridge does not expect tagging anymore diff --git a/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch b/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch index 71a06997c3..566dfce5ca 100644 --- a/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch +++ b/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch @@ -80,9 +80,9 @@ Signed-off-by: David S. Miller +} + static enum dsa_tag_protocol - mtk_get_tag_protocol(struct dsa_switch *ds, int port) - { -@@ -1520,6 +1578,8 @@ static const struct dsa_switch_ops mt753 + mtk_get_tag_protocol(struct dsa_switch *ds, int port, + enum dsa_tag_protocol mp) +@@ -1521,6 +1579,8 @@ static const struct dsa_switch_ops mt753 .port_vlan_prepare = mt7530_port_vlan_prepare, .port_vlan_add = mt7530_port_vlan_add, .port_vlan_del = mt7530_port_vlan_del, diff --git a/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch b/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch index a45a22e485..81acdaecd2 100644 --- a/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch +++ b/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -4928,6 +4928,80 @@ static int mv88e6xxx_port_mdb_del(struct +@@ -4929,6 +4929,80 @@ static int mv88e6xxx_port_mdb_del(struct return err; } @@ -106,7 +106,7 @@ Signed-off-by: David S. Miller static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port, bool unicast, bool multicast) { -@@ -4982,6 +5056,8 @@ static const struct dsa_switch_ops mv88e +@@ -4983,6 +5057,8 @@ static const struct dsa_switch_ops mv88e .port_mdb_prepare = mv88e6xxx_port_mdb_prepare, .port_mdb_add = mv88e6xxx_port_mdb_add, .port_mdb_del = mv88e6xxx_port_mdb_del, diff --git a/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch b/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch index 837126a336..9985e1cf56 100644 --- a/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch +++ b/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -4995,7 +4995,7 @@ static void mv88e6xxx_port_mirror_del(st +@@ -4996,7 +4996,7 @@ static void mv88e6xxx_port_mirror_del(st if (chip->info->ops->set_egress_port(chip, direction, dsa_upstream_port(ds, diff --git a/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch b/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch index 52d9351b70..86f1f8300e 100644 --- a/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch +++ b/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch @@ -83,7 +83,7 @@ Signed-off-by: David S. Miller { --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -319,7 +319,7 @@ static int dsa_slave_vlan_add(struct net +@@ -317,7 +317,7 @@ static int dsa_slave_vlan_add(struct net if (obj->orig_dev != dev) return -EOPNOTSUPP; @@ -92,7 +92,7 @@ Signed-off-by: David S. Miller return 0; vlan = *SWITCHDEV_OBJ_PORT_VLAN(obj); -@@ -386,7 +386,7 @@ static int dsa_slave_vlan_del(struct net +@@ -384,7 +384,7 @@ static int dsa_slave_vlan_del(struct net if (obj->orig_dev != dev) return -EOPNOTSUPP; @@ -101,7 +101,7 @@ Signed-off-by: David S. Miller return 0; /* Do not deprogram the CPU port as it may be shared with other user -@@ -1120,7 +1120,7 @@ static int dsa_slave_vlan_rx_add_vid(str +@@ -1118,7 +1118,7 @@ static int dsa_slave_vlan_rx_add_vid(str * need to emulate the switchdev prepare + commit phase. */ if (dp->bridge_dev) { @@ -110,7 +110,7 @@ Signed-off-by: David S. Miller return 0; /* br_vlan_get_info() returns -EINVAL or -ENOENT if the -@@ -1154,7 +1154,7 @@ static int dsa_slave_vlan_rx_kill_vid(st +@@ -1152,7 +1152,7 @@ static int dsa_slave_vlan_rx_kill_vid(st * need to emulate the switchdev prepare + commit phase. */ if (dp->bridge_dev) { diff --git a/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch b/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch index 0804cea9f7..e26829ee60 100644 --- a/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch +++ b/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch @@ -41,7 +41,7 @@ Signed-off-by: David S. Miller mutex_lock(&priv->reg_mutex); pvid = priv->ports[port].pvid; -@@ -1232,6 +1220,7 @@ mt7530_setup(struct dsa_switch *ds) +@@ -1233,6 +1221,7 @@ mt7530_setup(struct dsa_switch *ds) * as two netdev instances. */ dn = ds->ports[MT7530_CPU_PORT].master->dev.of_node->parent; diff --git a/target/linux/generic/backport-5.4/758-v5.8-net-dsa-rtl8366rb-Support-the-CPU-DSA-tag.patch b/target/linux/generic/backport-5.4/758-v5.8-net-dsa-rtl8366rb-Support-the-CPU-DSA-tag.patch index b68c033bbe..cabb9d9a92 100644 --- a/target/linux/generic/backport-5.4/758-v5.8-net-dsa-rtl8366rb-Support-the-CPU-DSA-tag.patch +++ b/target/linux/generic/backport-5.4/758-v5.8-net-dsa-rtl8366rb-Support-the-CPU-DSA-tag.patch @@ -74,9 +74,9 @@ Signed-off-by: David S. Miller if (ret) return ret; -@@ -966,21 +964,8 @@ static int rtl8366rb_setup(struct dsa_sw - static enum dsa_tag_protocol rtl8366_get_tag_protocol(struct dsa_switch *ds, - int port) +@@ -967,21 +965,8 @@ static enum dsa_tag_protocol rtl8366_get + int port, + enum dsa_tag_protocol mp) { - /* For now, the RTL switches are handled without any custom tags. - * diff --git a/target/linux/generic/backport-5.4/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch b/target/linux/generic/backport-5.4/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch index 7ec26899f9..3b630377f9 100644 --- a/target/linux/generic/backport-5.4/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch +++ b/target/linux/generic/backport-5.4/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch @@ -69,7 +69,7 @@ Signed-off-by: Jakub Kicinski --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -70,8 +70,11 @@ static int dsa_slave_open(struct net_dev +@@ -68,8 +68,11 @@ static int dsa_slave_open(struct net_dev struct dsa_port *dp = dsa_slave_to_port(dev); int err; diff --git a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch index 893eb719ca..f889489915 100644 --- a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch +++ b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch @@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1593,7 +1593,9 @@ static void dsa_slave_switchdev_event_wo +@@ -1591,7 +1591,9 @@ static void dsa_slave_switchdev_event_wo err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid); if (err) { @@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski break; } fdb_info->offloaded = true; -@@ -1608,9 +1610,11 @@ static void dsa_slave_switchdev_event_wo +@@ -1606,9 +1608,11 @@ static void dsa_slave_switchdev_event_wo err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid); if (err) { diff --git a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch index 275870d19f..bd1685a16a 100644 --- a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch +++ b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch @@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski struct sk_buff * (*xmit)(struct sk_buff *skb, --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1568,76 +1568,66 @@ static int dsa_slave_netdevice_event(str +@@ -1566,76 +1566,66 @@ static int dsa_slave_netdevice_event(str return NOTIFY_DONE; } @@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski } /* Called under rcu_read_lock() */ -@@ -1645,7 +1635,9 @@ static int dsa_slave_switchdev_event(str +@@ -1643,7 +1633,9 @@ static int dsa_slave_switchdev_event(str unsigned long event, void *ptr) { struct net_device *dev = switchdev_notifier_info_to_dev(ptr); @@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski int err; if (event == SWITCHDEV_PORT_ATTR_SET) { -@@ -1658,20 +1650,32 @@ static int dsa_slave_switchdev_event(str +@@ -1656,20 +1648,32 @@ static int dsa_slave_switchdev_event(str if (!dsa_slave_dev_check(dev)) return NOTIFY_DONE; @@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski dev_hold(dev); break; default: -@@ -1681,10 +1685,6 @@ static int dsa_slave_switchdev_event(str +@@ -1679,10 +1683,6 @@ static int dsa_slave_switchdev_event(str dsa_schedule_work(&switchdev_work->work); return NOTIFY_OK; diff --git a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch index b70986fcc1..acc6e16117 100644 --- a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch +++ b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1640,31 +1640,29 @@ static int dsa_slave_switchdev_event(str +@@ -1638,31 +1638,29 @@ static int dsa_slave_switchdev_event(str struct dsa_port *dp; int err; @@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski fdb_info = ptr; if (!fdb_info->added_by_user) { -@@ -1677,13 +1675,12 @@ static int dsa_slave_switchdev_event(str +@@ -1675,13 +1673,12 @@ static int dsa_slave_switchdev_event(str switchdev_work->vid = fdb_info->vid; dev_hold(dev); diff --git a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch index c7ed4064e8..35266b71bc 100644 --- a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch +++ b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch @@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1653,6 +1653,9 @@ static int dsa_slave_switchdev_event(str +@@ -1651,6 +1651,9 @@ static int dsa_slave_switchdev_event(str dp = dsa_slave_to_port(dev); diff --git a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch index e4ed6e808f..e49a97c81d 100644 --- a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch +++ b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch @@ -172,7 +172,7 @@ Signed-off-by: DENG Qingfang */ --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1630,6 +1630,25 @@ static void dsa_slave_switchdev_event_wo +@@ -1628,6 +1628,25 @@ static void dsa_slave_switchdev_event_wo dev_put(dp->slave); } @@ -198,7 +198,7 @@ Signed-off-by: DENG Qingfang /* Called under rcu_read_lock() */ static int dsa_slave_switchdev_event(struct notifier_block *unused, unsigned long event, void *ptr) -@@ -1648,10 +1667,37 @@ static int dsa_slave_switchdev_event(str +@@ -1646,10 +1665,37 @@ static int dsa_slave_switchdev_event(str return notifier_from_errno(err); case SWITCHDEV_FDB_ADD_TO_DEVICE: case SWITCHDEV_FDB_DEL_TO_DEVICE: @@ -239,7 +239,7 @@ Signed-off-by: DENG Qingfang if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del) return NOTIFY_DONE; -@@ -1666,18 +1712,13 @@ static int dsa_slave_switchdev_event(str +@@ -1664,18 +1710,13 @@ static int dsa_slave_switchdev_event(str switchdev_work->port = dp->index; switchdev_work->event = event; diff --git a/target/linux/generic/backport-5.4/822-v6.2-0001-nvmem-u-boot-env-fix-crc32_data_offset-on-redundant-.patch b/target/linux/generic/backport-5.4/822-v6.2-0001-nvmem-u-boot-env-fix-crc32_data_offset-on-redundant-.patch new file mode 100644 index 0000000000..69d5a1b845 --- /dev/null +++ b/target/linux/generic/backport-5.4/822-v6.2-0001-nvmem-u-boot-env-fix-crc32_data_offset-on-redundant-.patch @@ -0,0 +1,56 @@ +From 7a69ff9c9bde03a690ea783970f664782fc303d8 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 4 Nov 2022 17:52:03 +0100 +Subject: [PATCH] nvmem: u-boot-env: fix crc32_data_offset on redundant + u-boot-env + +The Western Digital MyBook Live (PowerPC 464/APM82181) +has a set of redundant u-boot-env. Loading up the driver +the following error: + +| u_boot_env: Invalid calculated CRC32: 0x4f8f2c86 (expected: 0x98b14514) +| u_boot_env: probe of partition@1e000 failed with error -22 + +Looking up the userspace libubootenv utilities source [0], +it looks like the "mark" or "flag" is not part of the +crc32 sum... which is unfortunate :( + +|static int libuboot_load(struct uboot_ctx *ctx) +|{ +|[...] +| if (ctx->redundant) { +| [...] +| offsetdata = offsetof(struct uboot_env_redund, data); +| [...] //-----^^ +| } +| usable_envsize = ctx->size - offsetdata; +| buf[0] = malloc(bufsize); +|[...] +| for (i = 0; i < copies; i++) { +| data = (uint8_t *)(buf[i] + offsetdata); +| uint32_t crc; +| +| ret = devread(ctx, i, buf[i]); +| [...] +| crc = *(uint32_t *)(buf[i] + offsetcrc); +| dev->crc = crc32(0, (uint8_t *)data, usable_envsize); +| + +[0] https://github.com/sbabic/libubootenv/blob/master/src/uboot_env.c#L951 +Fixes: d5542923f200 ("nvmem: add driver handling U-Boot environment variables") +Signed-off-by: Christian Lamparter +--- + drivers/nvmem/u-boot-env.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvmem/u-boot-env.c ++++ b/drivers/nvmem/u-boot-env.c +@@ -135,7 +135,7 @@ static int u_boot_env_parse(struct u_boo + break; + case U_BOOT_FORMAT_REDUNDANT: + crc32_offset = offsetof(struct u_boot_env_image_redundant, crc32); +- crc32_data_offset = offsetof(struct u_boot_env_image_redundant, mark); ++ crc32_data_offset = offsetof(struct u_boot_env_image_redundant, data); + data_offset = offsetof(struct u_boot_env_image_redundant, data); + break; + } diff --git a/target/linux/generic/backport-5.4/822-v6.2-0002-nvmem-u-boot-env-align-endianness-of-crc32-values.patch b/target/linux/generic/backport-5.4/822-v6.2-0002-nvmem-u-boot-env-align-endianness-of-crc32-values.patch new file mode 100644 index 0000000000..7d6723bb8e --- /dev/null +++ b/target/linux/generic/backport-5.4/822-v6.2-0002-nvmem-u-boot-env-align-endianness-of-crc32-values.patch @@ -0,0 +1,47 @@ +From 0e71cac033bb7689c4dfa2e6814191337ef770f5 Mon Sep 17 00:00:00 2001 +From: INAGAKI Hiroshi +Date: Thu, 13 Oct 2022 00:51:33 +0900 +Subject: [PATCH] nvmem: u-boot-env: align endianness of crc32 values +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch fixes crc32 error on Big-Endianness system by conversion of +calculated crc32 value. + +Little-Endianness system: + + obtained crc32: Little +calculated crc32: Little + +Big-Endianness system: + + obtained crc32: Little +calculated crc32: Big + +log (APRESIA ApresiaLightGS120GT-SS, RTL8382M, Big-Endianness): + +[ 8.570000] u_boot_env 18001200.spi:flash@0:partitions:partition@c0000: Invalid calculated CRC32: 0x88cd6f09 (expected: 0x096fcd88) +[ 8.580000] u_boot_env: probe of 18001200.spi:flash@0:partitions:partition@c0000 failed with error -22 + +Fixes: f955dc1445069 ("nvmem: add driver handling U-Boot environment variables") + +Signed-off-by: INAGAKI Hiroshi +Acked-by: Rafał Miłecki +Tested-by: Christian Lamparter +Signed-off-by: Srinivas Kandagatla +--- + drivers/nvmem/u-boot-env.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvmem/u-boot-env.c ++++ b/drivers/nvmem/u-boot-env.c +@@ -143,7 +143,7 @@ static int u_boot_env_parse(struct u_boo + crc32_data_len = priv->mtd->size - crc32_data_offset; + data_len = priv->mtd->size - data_offset; + +- calc = crc32(~0, buf + crc32_data_offset, crc32_data_len) ^ ~0L; ++ calc = le32_to_cpu((__le32)crc32(~0, buf + crc32_data_offset, crc32_data_len) ^ ~0L); + if (calc != crc32) { + dev_err(dev, "Invalid calculated CRC32: 0x%08x (expected: 0x%08x)\n", calc, crc32); + err = -EINVAL; diff --git a/target/linux/generic/backport-5.4/822-v6.2-0003-nvmem-u-boot-env-add-Broadcom-format-support.patch b/target/linux/generic/backport-5.4/822-v6.2-0003-nvmem-u-boot-env-add-Broadcom-format-support.patch new file mode 100644 index 0000000000..429b24f0f3 --- /dev/null +++ b/target/linux/generic/backport-5.4/822-v6.2-0003-nvmem-u-boot-env-add-Broadcom-format-support.patch @@ -0,0 +1,65 @@ +From 5b4eaafbeac472fc19049152f18e88aecb2b2829 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 17 Oct 2022 09:17:22 +0200 +Subject: [PATCH] nvmem: u-boot-env: add Broadcom format support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Broadcom uses U-Boot for a lot of their bcmbca familiy chipsets. They +decided to store U-Boot environment data inside U-Boot partition and to +use a custom header (with "uEnv" magic and env data length). + +Add support for Broadcom's specific binding and their custom format. + +Ref: 6b0584c19d87 ("dt-bindings: nvmem: u-boot,env: add Broadcom's variant binding") +Signed-off-by: Rafał Miłecki +Signed-off-by: Srinivas Kandagatla +--- + drivers/nvmem/u-boot-env.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/nvmem/u-boot-env.c ++++ b/drivers/nvmem/u-boot-env.c +@@ -16,6 +16,7 @@ + enum u_boot_env_format { + U_BOOT_FORMAT_SINGLE, + U_BOOT_FORMAT_REDUNDANT, ++ U_BOOT_FORMAT_BROADCOM, + }; + + struct u_boot_env { +@@ -40,6 +41,13 @@ struct u_boot_env_image_redundant { + uint8_t data[]; + } __packed; + ++struct u_boot_env_image_broadcom { ++ __le32 magic; ++ __le32 len; ++ __le32 crc32; ++ uint8_t data[0]; ++} __packed; ++ + static int u_boot_env_read(void *context, unsigned int offset, void *val, + size_t bytes) + { +@@ -138,6 +146,11 @@ static int u_boot_env_parse(struct u_boo + crc32_data_offset = offsetof(struct u_boot_env_image_redundant, data); + data_offset = offsetof(struct u_boot_env_image_redundant, data); + break; ++ case U_BOOT_FORMAT_BROADCOM: ++ crc32_offset = offsetof(struct u_boot_env_image_broadcom, crc32); ++ crc32_data_offset = offsetof(struct u_boot_env_image_broadcom, data); ++ data_offset = offsetof(struct u_boot_env_image_broadcom, data); ++ break; + } + crc32 = le32_to_cpu(*(__le32 *)(buf + crc32_offset)); + crc32_data_len = priv->mtd->size - crc32_data_offset; +@@ -202,6 +215,7 @@ static const struct of_device_id u_boot_ + { .compatible = "u-boot,env", .data = (void *)U_BOOT_FORMAT_SINGLE, }, + { .compatible = "u-boot,env-redundant-bool", .data = (void *)U_BOOT_FORMAT_REDUNDANT, }, + { .compatible = "u-boot,env-redundant-count", .data = (void *)U_BOOT_FORMAT_REDUNDANT, }, ++ { .compatible = "brcm,env", .data = (void *)U_BOOT_FORMAT_BROADCOM, }, + {}, + }; + diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index de7795f4dd..f804ea5f41 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -1028,6 +1028,7 @@ CONFIG_CRYPTO_BLKCIPHER2=y # CONFIG_CRYPTO_DEV_HISI_ZIP is not set # CONFIG_CRYPTO_DEV_IMGTEC_HASH is not set # CONFIG_CRYPTO_DEV_MARVELL_CESA is not set +# CONFIG_CRYPTO_DEV_MEDIATEK is not set # CONFIG_CRYPTO_DEV_MV_CESA is not set # CONFIG_CRYPTO_DEV_MXC_SCC is not set # CONFIG_CRYPTO_DEV_MXS_DCP is not set diff --git a/target/linux/generic/files/include/linux/soc/mediatek/mtk_wed.h b/target/linux/generic/files-5.4/include/linux/soc/mediatek/mtk_wed.h similarity index 89% rename from target/linux/generic/files/include/linux/soc/mediatek/mtk_wed.h rename to target/linux/generic/files-5.4/include/linux/soc/mediatek/mtk_wed.h index 0a7197f55a..04bc75138d 100644 --- a/target/linux/generic/files/include/linux/soc/mediatek/mtk_wed.h +++ b/target/linux/generic/files-5.4/include/linux/soc/mediatek/mtk_wed.h @@ -64,5 +64,8 @@ static inline bool mtk_wed_device_active(struct mtk_wed_device *dev) #define mtk_wed_device_reg_write(_dev, _reg, _val) do {} while (0) #define mtk_wed_device_irq_get(_dev, _mask) 0 #define mtk_wed_device_irq_set_mask(_dev, _mask) do {} while (0) +#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs) -ENODEV +#define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash) do {} while (0) +#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) -ENODEV #endif diff --git a/target/linux/generic/hack-5.4/221-module_exports.patch b/target/linux/generic/hack-5.4/221-module_exports.patch index 47f40ac5e1..446bf53008 100644 --- a/target/linux/generic/hack-5.4/221-module_exports.patch +++ b/target/linux/generic/hack-5.4/221-module_exports.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau /* Align . to a 8 byte boundary equals to maximum function alignment. */ #define ALIGN_FUNCTION() . = ALIGN(8) -@@ -407,14 +417,14 @@ +@@ -408,14 +418,14 @@ /* Kernel symbol table: Normal symbols */ \ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ __start___ksymtab = .; \ @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau __stop___ksymtab_gpl = .; \ } \ \ -@@ -476,7 +486,7 @@ +@@ -477,7 +487,7 @@ \ /* Kernel symbol table: strings */ \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ diff --git a/target/linux/generic/hack-5.4/661-kernel-ct-size-the-hashtable-more-adequately.patch b/target/linux/generic/hack-5.4/661-kernel-ct-size-the-hashtable-more-adequately.patch new file mode 100644 index 0000000000..b1bb1bc2e5 --- /dev/null +++ b/target/linux/generic/hack-5.4/661-kernel-ct-size-the-hashtable-more-adequately.patch @@ -0,0 +1,25 @@ +From 804fbb3f2ec9283f7b778e057a68bfff440a0be6 Mon Sep 17 00:00:00 2001 +From: Rui Salvaterra +Date: Wed, 30 Mar 2022 22:51:55 +0100 +Subject: [PATCH] kernel: ct: size the hashtable more adequately + +To set the default size of the connection tracking hash table, a divider of +16384 becomes inadequate for a router handling lots of connections. Divide by +2048 instead, making the default size scale better with the available RAM. + +Signed-off-by: Rui Salvaterra +--- + net/netfilter/nf_conntrack_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/netfilter/nf_conntrack_core.c ++++ b/net/netfilter/nf_conntrack_core.c +@@ -2419,7 +2419,7 @@ int nf_conntrack_init_start(void) + + if (!nf_conntrack_htable_size) { + nf_conntrack_htable_size +- = (((nr_pages << PAGE_SHIFT) / 16384) ++ = (((nr_pages << PAGE_SHIFT) / 2048) + / sizeof(struct hlist_head)); + if (BITS_PER_LONG >= 64 && + nr_pages > (4 * (1024 * 1024 * 1024 / PAGE_SIZE))) diff --git a/target/linux/generic/hack-5.4/952-net-conntrack-events-support-multiple-registrant.patch b/target/linux/generic/hack-5.4/952-net-conntrack-events-support-multiple-registrant.patch index e01728fc68..d09b367194 100644 --- a/target/linux/generic/hack-5.4/952-net-conntrack-events-support-multiple-registrant.patch +++ b/target/linux/generic/hack-5.4/952-net-conntrack-events-support-multiple-registrant.patch @@ -115,7 +115,7 @@ Signed-off-by: Zhi Chen depends on NETFILTER_ADVANCED --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -2572,6 +2572,9 @@ int nf_conntrack_init_net(struct net *ne +@@ -2570,6 +2570,9 @@ int nf_conntrack_init_net(struct net *ne nf_conntrack_helper_pernet_init(net); nf_conntrack_proto_pernet_init(net); diff --git a/target/linux/generic/hack-5.4/954-add-bcm-fullconenat-support.patch b/target/linux/generic/hack-5.4/954-add-bcm-fullconenat-support.patch new file mode 100644 index 0000000000..41b16c36d6 --- /dev/null +++ b/target/linux/generic/hack-5.4/954-add-bcm-fullconenat-support.patch @@ -0,0 +1,235 @@ +--- a/net/netfilter/nf_nat_masquerade.c ++++ b/net/netfilter/nf_nat_masquerade.c +@@ -8,6 +8,9 @@ + #include + + #include ++#include ++#include ++#include + + struct masq_dev_work { + struct work_struct work; +@@ -23,6 +26,129 @@ static DEFINE_MUTEX(masq_mutex); + static unsigned int masq_refcnt __read_mostly; + static atomic_t masq_worker_count __read_mostly; + ++static void bcm_nat_expect(struct nf_conn *ct, ++ struct nf_conntrack_expect *exp) ++{ ++ struct nf_nat_range2 range; ++ ++ /* This must be a fresh one. */ ++ BUG_ON(ct->status & IPS_NAT_DONE_MASK); ++ ++ /* Change src to where new ct comes from */ ++ range.flags = NF_NAT_RANGE_MAP_IPS; ++ range.min_addr = range.max_addr = ++ ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3; ++ nf_nat_setup_info(ct, &range, NF_NAT_MANIP_SRC); ++ ++ /* For DST manip, map port here to where it's expected. */ ++ range.flags = (NF_NAT_RANGE_MAP_IPS | NF_NAT_RANGE_PROTO_SPECIFIED); ++ range.min_proto = range.max_proto = exp->saved_proto; ++ range.min_addr = range.max_addr = exp->saved_addr; ++ nf_nat_setup_info(ct, &range, NF_NAT_MANIP_DST); ++} ++ ++/****************************************************************************/ ++static int bcm_nat_help(struct sk_buff *skb, unsigned int protoff, ++ struct nf_conn *ct, enum ip_conntrack_info ctinfo) ++{ ++ int dir = CTINFO2DIR(ctinfo); ++ struct nf_conn_help *help = nfct_help(ct); ++ struct nf_conntrack_expect *exp; ++ ++ if (dir != IP_CT_DIR_ORIGINAL || ++ help->expecting[NF_CT_EXPECT_CLASS_DEFAULT]) ++ return NF_ACCEPT; ++ ++ pr_debug("bcm_nat: packet[%d bytes] ", skb->len); ++ nf_ct_dump_tuple(&ct->tuplehash[dir].tuple); ++ pr_debug("reply: "); ++ nf_ct_dump_tuple(&ct->tuplehash[!dir].tuple); ++ ++ /* Create expect */ ++ if ((exp = nf_ct_expect_alloc(ct)) == NULL) ++ return NF_ACCEPT; ++ ++ nf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT, AF_INET, NULL, ++ &ct->tuplehash[!dir].tuple.dst.u3, IPPROTO_UDP, ++ NULL, &ct->tuplehash[!dir].tuple.dst.u.udp.port); ++ exp->flags = NF_CT_EXPECT_PERMANENT; ++ exp->saved_addr = ct->tuplehash[dir].tuple.src.u3; ++ exp->saved_proto.udp.port = ct->tuplehash[dir].tuple.src.u.udp.port; ++ exp->dir = !dir; ++ exp->expectfn = bcm_nat_expect; ++ ++ /* Setup expect */ ++ nf_ct_expect_related(exp, 0); ++ nf_ct_expect_put(exp); ++ pr_debug("bcm_nat: expect setup\n"); ++ ++ return NF_ACCEPT; ++} ++ ++/****************************************************************************/ ++static struct nf_conntrack_expect_policy bcm_nat_exp_policy __read_mostly = { ++ .max_expected = 1000, ++ .timeout = 240, ++}; ++ ++/****************************************************************************/ ++static struct nf_conntrack_helper nf_conntrack_helper_bcm_nat __read_mostly = { ++ .name = "BCM-NAT", ++ .me = THIS_MODULE, ++ .tuple.src.l3num = AF_INET, ++ .tuple.dst.protonum = IPPROTO_UDP, ++ .expect_policy = &bcm_nat_exp_policy, ++ .expect_class_max = 1, ++ .help = bcm_nat_help, ++}; ++ ++/****************************************************************************/ ++static inline int find_exp(__be32 ip, __be16 port, struct nf_conn *ct) ++{ ++ struct nf_conntrack_tuple tuple; ++ struct nf_conntrack_expect *i = NULL; ++ ++ ++ memset(&tuple, 0, sizeof(tuple)); ++ tuple.src.l3num = AF_INET; ++ tuple.dst.protonum = IPPROTO_UDP; ++ tuple.dst.u3.ip = ip; ++ tuple.dst.u.udp.port = port; ++ ++ rcu_read_lock(); ++ i = __nf_ct_expect_find(nf_ct_net(ct), nf_ct_zone(ct), &tuple); ++ rcu_read_unlock(); ++ ++ return i != NULL; ++} ++ ++/****************************************************************************/ ++static inline struct nf_conntrack_expect *find_fullcone_exp(struct nf_conn *ct) ++{ ++ struct nf_conntrack_tuple * tp = ++ &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_expect * exp = NULL; ++ struct nf_conntrack_expect * i; ++ unsigned int h; ++ ++ rcu_read_lock(); ++ for (h = 0; h < nf_ct_expect_hsize; h++) { ++ hlist_for_each_entry_rcu(i, &nf_ct_expect_hash[h], hnode) { ++ if (nf_inet_addr_cmp(&i->saved_addr, &tp->src.u3) && ++ i->saved_proto.all == tp->src.u.all && ++ i->tuple.dst.protonum == tp->dst.protonum && ++ i->tuple.src.u3.ip == 0 && ++ i->tuple.src.u.udp.port == 0) { ++ exp = i; ++ break; ++ } ++ } ++ } ++ rcu_read_unlock(); ++ ++ return exp; ++} ++ + unsigned int + nf_nat_masquerade_ipv4(struct sk_buff *skb, unsigned int hooknum, + const struct nf_nat_range2 *range, +@@ -60,6 +186,72 @@ nf_nat_masquerade_ipv4(struct sk_buff *s + if (nat) + nat->masq_index = out->ifindex; + ++/* RFC 4787 - 4.2.2. Port Parity ++ i.e., an even port will be mapped to an even port, and an odd port will be mapped to an odd port. ++*/ ++#define CHECK_PORT_PARITY(a, b) ((a%2)==(b%2)) ++ if (range->min_addr.ip != 0 /* nat_mode == full cone */ ++ && (nfct_help(ct) == NULL || nfct_help(ct)->helper == NULL) ++ && nf_ct_protonum(ct) == IPPROTO_UDP) { ++ unsigned int ret; ++ u_int16_t minport; ++ u_int16_t maxport; ++ struct nf_conntrack_expect *exp; ++ ++ pr_debug("bcm_nat: need full cone NAT\n"); ++ ++ /* Choose port */ ++ spin_lock_bh(&nf_conntrack_expect_lock); ++ /* Look for existing expectation */ ++ exp = find_fullcone_exp(ct); ++ if (exp) { ++ minport = maxport = exp->tuple.dst.u.udp.port; ++ pr_debug("bcm_nat: existing mapped port = %hu\n", ++ ntohs(minport)); ++ } else { /* no previous expect */ ++ u_int16_t newport, tmpport, orgport; ++ ++ minport = range->min_proto.all == 0? ++ ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src. ++ u.udp.port : range->min_proto.all; ++ maxport = range->max_proto.all == 0? ++ htons(65535) : range->max_proto.all; ++ orgport = ntohs(minport); ++ for (newport = ntohs(minport),tmpport = ntohs(maxport); ++ newport <= tmpport; newport++) { ++ if (CHECK_PORT_PARITY(orgport, newport) && !find_exp(newsrc, htons(newport), ct)) { ++ pr_debug("bcm_nat: new mapped port = " ++ "%hu\n", newport); ++ minport = maxport = htons(newport); ++ break; ++ } ++ } ++ } ++ spin_unlock_bh(&nf_conntrack_expect_lock); ++ ++ ++ memset(&newrange.min_addr, 0, sizeof(newrange.min_addr)); ++ memset(&newrange.max_addr, 0, sizeof(newrange.max_addr)); ++ ++ newrange.flags = range->flags | NF_NAT_RANGE_MAP_IPS | ++ NF_NAT_RANGE_PROTO_SPECIFIED; ++ newrange.max_addr.ip = newrange.min_addr.ip = newsrc; ++ newrange.min_proto.udp.port = newrange.max_proto.udp.port = minport; ++ ++ /* Set ct helper */ ++ ret = nf_nat_setup_info(ct, &newrange, NF_NAT_MANIP_SRC); ++ if (ret == NF_ACCEPT) { ++ struct nf_conn_help *help = nfct_help(ct); ++ if (help == NULL) ++ help = nf_ct_helper_ext_add(ct, GFP_ATOMIC); ++ if (help != NULL) { ++ help->helper = &nf_conntrack_helper_bcm_nat; ++ pr_debug("bcm_nat: helper set\n"); ++ } ++ } ++ return ret; ++ } ++ + /* Transfer from original range. */ + memset(&newrange.min_addr, 0, sizeof(newrange.min_addr)); + memset(&newrange.max_addr, 0, sizeof(newrange.max_addr)); +@@ -347,6 +539,7 @@ EXPORT_SYMBOL_GPL(nf_nat_masquerade_inet + + void nf_nat_masquerade_inet_unregister_notifiers(void) + { ++ nf_conntrack_helper_unregister(&nf_conntrack_helper_bcm_nat); + mutex_lock(&masq_mutex); + /* check if the notifiers still have clients */ + if (--masq_refcnt > 0) +--- a/net/netfilter/xt_MASQUERADE.c ++++ b/net/netfilter/xt_MASQUERADE.c +@@ -42,6 +42,9 @@ masquerade_tg(struct sk_buff *skb, const + range.min_proto = mr->range[0].min; + range.max_proto = mr->range[0].max; + ++ range.min_addr.ip = mr->range[0].min_ip; ++ range.max_addr.ip = mr->range[0].max_ip; ++ + return nf_nat_masquerade_ipv4(skb, xt_hooknum(par), &range, + xt_out(par)); + } diff --git a/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch b/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch index ce59eb16f8..047949eb3d 100644 --- a/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch +++ b/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch @@ -10,7 +10,7 @@ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0195, 4)}, /* Quectel EG95 */ --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -392,6 +392,7 @@ static void option_instat_callback(struc +@@ -393,6 +393,7 @@ static void option_instat_callback(struc * Mobidata, etc sell under their own brand names. */ #define LONGCHEER_VENDOR_ID 0x1c9e @@ -18,7 +18,7 @@ /* 4G Systems products */ /* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick * -@@ -599,6 +600,16 @@ static void option_instat_callback(struc +@@ -603,6 +604,16 @@ static void option_instat_callback(struc /* Device needs ZLP */ #define ZLP BIT(17) @@ -35,7 +35,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, -@@ -633,6 +644,8 @@ static const struct usb_device_id option +@@ -637,6 +648,8 @@ static const struct usb_device_id option { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) }, { USB_DEVICE(QUANTA_VENDOR_ID, 0xea42), .driver_info = RSVD(4) }, diff --git a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch index 369a09caac..ff41a17c62 100644 --- a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch +++ b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau #include "dsa_priv.h" -@@ -1226,6 +1230,27 @@ static struct devlink_port *dsa_slave_ge +@@ -1224,6 +1228,27 @@ static struct devlink_port *dsa_slave_ge return dp->ds->devlink ? &dp->devlink_port : NULL; } @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops dsa_slave_netdev_ops = { .ndo_open = dsa_slave_open, .ndo_stop = dsa_slave_close, -@@ -1250,6 +1275,9 @@ static const struct net_device_ops dsa_s +@@ -1248,6 +1273,9 @@ static const struct net_device_ops dsa_s .ndo_vlan_rx_add_vid = dsa_slave_vlan_rx_add_vid, .ndo_vlan_rx_kill_vid = dsa_slave_vlan_rx_kill_vid, .ndo_get_devlink_port = dsa_slave_get_devlink_port, diff --git a/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch b/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch index c2dc35d134..93ed193747 100644 --- a/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch +++ b/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch @@ -9,7 +9,7 @@ Content-Transfer-Encoding: 8bit Signed-off-by: René van Dorst --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -1407,9 +1407,13 @@ static void mt7530_phylink_mac_config(st +@@ -1408,9 +1408,13 @@ static void mt7530_phylink_mac_config(st switch (state->speed) { case SPEED_1000: mcr_new |= PMCR_FORCE_SPEED_1000; @@ -23,7 +23,7 @@ Signed-off-by: René van Dorst break; } if (state->duplex == DUPLEX_FULL) { -@@ -1545,6 +1549,54 @@ mt7530_phylink_mac_link_state(struct dsa +@@ -1546,6 +1550,54 @@ mt7530_phylink_mac_link_state(struct dsa return 1; } @@ -78,7 +78,7 @@ Signed-off-by: René van Dorst static const struct dsa_switch_ops mt7530_switch_ops = { .get_tag_protocol = mtk_get_tag_protocol, .setup = mt7530_setup, -@@ -1572,6 +1624,8 @@ static const struct dsa_switch_ops mt753 +@@ -1573,6 +1625,8 @@ static const struct dsa_switch_ops mt753 .phylink_mac_config = mt7530_phylink_mac_config, .phylink_mac_link_down = mt7530_phylink_mac_link_down, .phylink_mac_link_up = mt7530_phylink_mac_link_up, diff --git a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch index d951246260..4c0c4391a3 100644 --- a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch +++ b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch @@ -18,7 +18,7 @@ Signed-off-by: Tobias Waldekranz --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1698,10 +1698,12 @@ static int dsa_slave_switchdev_event(str +@@ -1696,10 +1696,12 @@ static int dsa_slave_switchdev_event(str fdb_info = ptr; if (dsa_slave_dev_check(dev)) { diff --git a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch index 46504aeeff..14f62ec19a 100644 --- a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch +++ b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch @@ -15,7 +15,7 @@ Signed-off-by: Tobias Waldekranz --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1712,7 +1712,11 @@ static int dsa_slave_switchdev_event(str +@@ -1710,7 +1710,11 @@ static int dsa_slave_switchdev_event(str struct net_device *br_dev; struct dsa_slave_priv *p; diff --git a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch index e626086bc1..33f49685bf 100644 --- a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch +++ b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch @@ -28,7 +28,7 @@ Signed-off-by: Tobias Waldekranz --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1705,9 +1705,12 @@ static int dsa_slave_switchdev_event(str +@@ -1703,9 +1703,12 @@ static int dsa_slave_switchdev_event(str else if (!fdb_info->added_by_user) return NOTIFY_OK; } else { @@ -44,7 +44,7 @@ Signed-off-by: Tobias Waldekranz */ struct net_device *br_dev; struct dsa_slave_priv *p; -@@ -1729,7 +1732,8 @@ static int dsa_slave_switchdev_event(str +@@ -1727,7 +1730,8 @@ static int dsa_slave_switchdev_event(str dp = p->dp->cpu_dp; diff --git a/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch index 65b0e1084e..dc9e61eb9d 100644 --- a/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -5082,6 +5082,7 @@ static int mv88e6xxx_register_switch(str +@@ -5083,6 +5083,7 @@ static int mv88e6xxx_register_switch(str ds->ops = &mv88e6xxx_switch_ops; ds->ageing_time_min = chip->info->age_time_coeff; ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts index 2465348a82..1496f145bd 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts @@ -9,6 +9,11 @@ model = "Luma Home WRTQ-329ACN"; compatible = "luma,wrtq-329acn"; + aliases { + ethernet0 = &gmac1; + ethernet1 = &gmac0; + }; + i2c-gpio { compatible = "i2c-gpio"; sda-gpios = <&tlmm 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; diff --git a/target/linux/lantiq/patches-5.4/0320-v6.1-MIPS-lantiq-enable-all-hardware-interrupts-on-second.patch b/target/linux/lantiq/patches-5.4/0320-v6.1-MIPS-lantiq-enable-all-hardware-interrupts-on-second.patch new file mode 100644 index 0000000000..b7b95d6bfc --- /dev/null +++ b/target/linux/lantiq/patches-5.4/0320-v6.1-MIPS-lantiq-enable-all-hardware-interrupts-on-second.patch @@ -0,0 +1,87 @@ +From 730320fd770d4114a2ecb6fb223dcc8c3cecdc5b Mon Sep 17 00:00:00 2001 +From: Aleksander Jan Bajkowski +Date: Wed, 21 Sep 2022 22:59:44 +0200 +Subject: [PATCH] MIPS: lantiq: enable all hardware interrupts on second VPE + +This patch is needed to handle interrupts by the second VPE on the Lantiq +ARX100, xRX200, xRX300 and xRX330 SoCs. Switching some ICU interrupts to +the second VPE results in a hang. Currently, the vsmp_init_secondary() +function is responsible for enabling these interrupts. It only enables +Malta-specific interrupts (SW0, SW1, HW4 and HW5). + +The MIPS core has 8 interrupts defined. On Lantiq SoCs, hardware +interrupts are wired to an ICU instance. Each VPE has an independent +instance of the ICU. The mapping of the ICU interrupts is shown below: +SW0(IP0) - IPI call, +SW1(IP1) - IPI resched, +HW0(IP2) - ICU 0-31, +HW1(IP3) - ICU 32-63, +HW2(IP4) - ICU 64-95, +HW3(IP5) - ICU 96-127, +HW4(IP6) - ICU 128-159, +HW5(IP7) - timer. + +This patch enables all interrupt lines on the second VPE. + +This problem affects multithreaded SoCs with a custom interrupt controller. +SOCs with 1004Kc core and newer use the MIPS GIC. At this point, I am aware +that the Realtek RTL839x and RTL930x SoCs may need a similar fix. In the +future, this may be replaced with some generic solution. + +Tested on Lantiq xRX200. + +Suggested-by: Thomas Bogendoerfer +Signed-off-by: Aleksander Jan Bajkowski +Signed-off-by: Thomas Bogendoerfer +--- + arch/mips/lantiq/prom.c | 26 ++++++++++++++++++++++++-- + 1 file changed, 24 insertions(+), 2 deletions(-) + +--- a/arch/mips/lantiq/prom.c ++++ b/arch/mips/lantiq/prom.c +@@ -37,6 +37,14 @@ static struct ltq_soc_info soc_info; + /* for Multithreading (APRP), vpe.c will use it */ + unsigned long cp0_memsize; + ++/* ++ * These structs are used to override vsmp_init_secondary() ++ */ ++#if defined(CONFIG_MIPS_MT_SMP) ++extern const struct plat_smp_ops vsmp_smp_ops; ++static struct plat_smp_ops lantiq_smp_ops; ++#endif ++ + const char *get_system_type(void) + { + return soc_info.sys_type; +@@ -100,6 +108,17 @@ void __init device_tree_init(void) + unflatten_and_copy_device_tree(); + } + ++#if defined(CONFIG_MIPS_MT_SMP) ++static void lantiq_init_secondary(void) ++{ ++ /* ++ * MIPS CPU startup function vsmp_init_secondary() will only ++ * enable some of the interrupts for the second CPU/VPE. ++ */ ++ set_c0_status(ST0_IM); ++} ++#endif ++ + void __init prom_init(void) + { + /* call the soc specific detetcion code and get it to fill soc_info */ +@@ -111,7 +130,10 @@ void __init prom_init(void) + prom_init_cmdline(); + + #if defined(CONFIG_MIPS_MT_SMP) +- if (register_vsmp_smp_ops()) +- panic("failed to register_vsmp_smp_ops()"); ++ if (cpu_has_mipsmt) { ++ lantiq_smp_ops = vsmp_smp_ops; ++ lantiq_smp_ops.init_secondary = lantiq_init_secondary; ++ register_smp_ops(&lantiq_smp_ops); ++ } + #endif + } diff --git a/target/linux/layerscape/armv8_64b/config-5.4 b/target/linux/layerscape/armv8_64b/config-5.4 index 5dec1b986d..9ca2b7f512 100644 --- a/target/linux/layerscape/armv8_64b/config-5.4 +++ b/target/linux/layerscape/armv8_64b/config-5.4 @@ -203,8 +203,9 @@ CONFIG_CRYPTO_AES_ARM64=y CONFIG_CRYPTO_AES_ARM64_CE=y CONFIG_CRYPTO_AES_ARM64_CE_BLK=y CONFIG_CRYPTO_AES_ARM64_CE_CCM=y +CONFIG_CRYPTO_AKCIPHER=y +CONFIG_CRYPTO_AKCIPHER2=y CONFIG_CRYPTO_AUTHENC=y -CONFIG_CRYPTO_BLAKE2B=y CONFIG_CRYPTO_CRC32=y CONFIG_CRYPTO_CRC32C=y CONFIG_CRYPTO_CRCT10DIF=y @@ -220,16 +221,23 @@ CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC=y CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI=y # CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set +CONFIG_CRYPTO_DEV_FSL_CAAM_DMA=y # CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y +CONFIG_CRYPTO_DEV_FSL_CAAM_JR_UIO=y CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y +# CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_TEST is not set +CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=y +CONFIG_CRYPTO_DEV_FSL_CAAM_SM=y +CONFIG_CRYPTO_DEV_FSL_CAAM_SM_SLOTSIZE=7 +# CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST is not set +CONFIG_CRYPTO_DEV_FSL_CAAM_TK_API=y CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM=y CONFIG_CRYPTO_ECB=y -CONFIG_CRYPTO_ENGINE=y -CONFIG_CRYPTO_GHASH_ARM64_CE=y CONFIG_CRYPTO_GF128MUL=y +CONFIG_CRYPTO_GHASH_ARM64_CE=y CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_HASH2=y CONFIG_CRYPTO_HASH_INFO=y @@ -239,6 +247,7 @@ CONFIG_CRYPTO_LIB_SHA256=y CONFIG_CRYPTO_LZO=y CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL=y CONFIG_CRYPTO_NULL2=y CONFIG_CRYPTO_RNG=y CONFIG_CRYPTO_RNG2=y @@ -247,6 +256,7 @@ CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA256_ARM64=y CONFIG_CRYPTO_SHA2_ARM64_CE=y CONFIG_CRYPTO_SIMD=y +# CONFIG_CRYPTO_TLS is not set CONFIG_CRYPTO_XTS=y CONFIG_CRYPTO_XXHASH=y CONFIG_CRYPTO_ZSTD=y @@ -854,6 +864,7 @@ CONFIG_SCSI_SAS_HOST_SMP=y CONFIG_SCSI_SAS_LIBSAS=y CONFIG_SECCOMP=y CONFIG_SECCOMP_FILTER=y +CONFIG_SECURE_KEYS=y CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y CONFIG_SERIAL_8250_DW=y CONFIG_SERIAL_8250_DWLIB=y diff --git a/target/linux/layerscape/patches-5.4/701-net-0273-net-dsa-ocelot-add-tsn-support-for-felix-switch.patch b/target/linux/layerscape/patches-5.4/701-net-0273-net-dsa-ocelot-add-tsn-support-for-felix-switch.patch index 72b101bfb0..8214e1a310 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0273-net-dsa-ocelot-add-tsn-support-for-felix-switch.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0273-net-dsa-ocelot-add-tsn-support-for-felix-switch.patch @@ -648,7 +648,7 @@ Signed-off-by: Xiaoliang Yang static const u32 vsc9959_gcb_regmap[] = { --- a/include/net/dsa.h +++ b/include/net/dsa.h -@@ -559,6 +559,7 @@ struct dsa_switch_ops { +@@ -560,6 +560,7 @@ struct dsa_switch_ops { */ netdev_tx_t (*port_deferred_xmit)(struct dsa_switch *ds, int port, struct sk_buff *skb); diff --git a/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch b/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch index a5b84f3db9..be6b077e0b 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch @@ -64,9 +64,13 @@ Reviewed-by: Peter Chen --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c -@@ -16,6 +16,44 @@ static const struct xhci_plat_priv dwc3_ - .quirks = XHCI_SKIP_PHY_INIT, - }; +@@ -9,8 +9,48 @@ + + #include + ++#include "../host/xhci.h" ++ + #include "core.h" +#define XHCI_HCSPARAMS1 0x4 +#define XHCI_PORTSC_BASE 0x400 @@ -109,7 +113,7 @@ Reviewed-by: Peter Chen static int dwc3_host_get_irq(struct dwc3 *dwc) { struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); -@@ -55,6 +93,13 @@ int dwc3_host_init(struct dwc3 *dwc) +@@ -50,6 +90,13 @@ int dwc3_host_init(struct dwc3 *dwc) struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); int prop_idx = 0; diff --git a/target/linux/mediatek/mt7629/config-5.4 b/target/linux/mediatek/mt7629/config-5.4 index 46eac73240..8ff33d04cc 100644 --- a/target/linux/mediatek/mt7629/config-5.4 +++ b/target/linux/mediatek/mt7629/config-5.4 @@ -318,6 +318,7 @@ CONFIG_REGMAP_MMIO=y CONFIG_RESET_CONTROLLER=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y +# CONFIG_RTL8367S_GSW is not set CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_SCSI=y CONFIG_SERIAL_8250_FSL=y diff --git a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch index 888d5cb621..dbba2f65a2 100644 --- a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch +++ b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch @@ -12,7 +12,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c -@@ -1284,7 +1284,9 @@ EXPORT_SYMBOL(b53_phylink_mac_link_down) +@@ -1312,7 +1312,9 @@ EXPORT_SYMBOL(b53_phylink_mac_link_down) void b53_phylink_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface, @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/b53/b53_priv.h +++ b/drivers/net/dsa/b53/b53_priv.h -@@ -337,7 +337,9 @@ void b53_phylink_mac_link_down(struct ds +@@ -344,7 +344,9 @@ void b53_phylink_mac_link_down(struct ds void b53_phylink_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface, @@ -38,7 +38,7 @@ Signed-off-by: David S. Miller const struct switchdev_obj_port_vlan *vlan); --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c -@@ -641,7 +641,9 @@ static void bcm_sf2_sw_mac_link_down(str +@@ -661,7 +661,9 @@ static void bcm_sf2_sw_mac_link_down(str static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface, @@ -51,7 +51,7 @@ Signed-off-by: David S. Miller struct ethtool_eee *p = &priv->dev->ports[port].eee; --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c -@@ -1661,7 +1661,9 @@ static void gswip_phylink_mac_link_down( +@@ -1662,7 +1662,9 @@ static void gswip_phylink_mac_link_down( static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface, @@ -64,7 +64,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -1440,7 +1440,9 @@ static void mt7530_phylink_mac_link_down +@@ -1441,7 +1441,9 @@ static void mt7530_phylink_mac_link_down static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface, @@ -103,7 +103,7 @@ Signed-off-by: David S. Miller } --- a/include/net/dsa.h +++ b/include/net/dsa.h -@@ -406,7 +406,9 @@ struct dsa_switch_ops { +@@ -407,7 +407,9 @@ struct dsa_switch_ops { void (*phylink_mac_link_up)(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface, diff --git a/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch b/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch index 23fba85252..57066a3607 100644 --- a/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch +++ b/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch @@ -51,7 +51,7 @@ Signed-off-by: David S. Miller mutex_unlock(&priv->reg_mutex); } -@@ -1395,8 +1384,7 @@ static void mt7530_phylink_mac_config(st +@@ -1396,8 +1385,7 @@ static void mt7530_phylink_mac_config(st mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port)); mcr_new = mcr_cur; @@ -61,7 +61,7 @@ Signed-off-by: David S. Miller mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN | PMCR_BACKPR_EN | PMCR_FORCE_MODE; -@@ -1404,26 +1392,6 @@ static void mt7530_phylink_mac_config(st +@@ -1405,26 +1393,6 @@ static void mt7530_phylink_mac_config(st if (port == 5 && dsa_is_user_port(ds, 5)) mcr_new |= PMCR_EXT_PHY; @@ -88,7 +88,7 @@ Signed-off-by: David S. Miller if (mcr_new != mcr_cur) mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); } -@@ -1434,7 +1402,7 @@ static void mt7530_phylink_mac_link_down +@@ -1435,7 +1403,7 @@ static void mt7530_phylink_mac_link_down { struct mt7530_priv *priv = ds->priv; @@ -97,7 +97,7 @@ Signed-off-by: David S. Miller } static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port, -@@ -1445,8 +1413,31 @@ static void mt7530_phylink_mac_link_up(s +@@ -1446,8 +1414,31 @@ static void mt7530_phylink_mac_link_up(s bool tx_pause, bool rx_pause) { struct mt7530_priv *priv = ds->priv; diff --git a/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch b/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch index 718ed8ea2d..84579ac2c5 100644 --- a/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch +++ b/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch @@ -47,7 +47,7 @@ Signed-off-by: Sean Wang return -EINVAL; } -@@ -1332,12 +1334,11 @@ mt7530_setup(struct dsa_switch *ds) +@@ -1333,12 +1335,11 @@ mt7530_setup(struct dsa_switch *ds) return 0; } @@ -63,7 +63,7 @@ Signed-off-by: Sean Wang switch (port) { case 0: /* Internal phy */ -@@ -1346,33 +1347,114 @@ static void mt7530_phylink_mac_config(st +@@ -1347,33 +1348,114 @@ static void mt7530_phylink_mac_config(st case 3: case 4: if (state->interface != PHY_INTERFACE_MODE_GMII) @@ -189,7 +189,7 @@ Signed-off-by: Sean Wang return; } -@@ -1440,61 +1522,44 @@ static void mt7530_phylink_mac_link_up(s +@@ -1441,61 +1523,44 @@ static void mt7530_phylink_mac_link_up(s mt7530_set(priv, MT7530_PMCR_P(port), mcr); } @@ -274,7 +274,7 @@ Signed-off-by: Sean Wang phylink_set(mask, Pause); phylink_set(mask, Asym_Pause); -@@ -1590,12 +1655,45 @@ static int mt7530_set_mac_eee(struct dsa +@@ -1591,12 +1656,45 @@ static int mt7530_set_mac_eee(struct dsa return 0; } @@ -323,7 +323,7 @@ Signed-off-by: Sean Wang .get_ethtool_stats = mt7530_get_ethtool_stats, .get_sset_count = mt7530_get_sset_count, .port_enable = mt7530_port_enable, -@@ -1612,18 +1710,43 @@ static const struct dsa_switch_ops mt753 +@@ -1613,18 +1711,43 @@ static const struct dsa_switch_ops mt753 .port_vlan_del = mt7530_port_vlan_del, .port_mirror_add = mt7530_port_mirror_add, .port_mirror_del = mt7530_port_mirror_del, @@ -372,7 +372,7 @@ Signed-off-by: Sean Wang { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, mt7530_of_match); -@@ -1661,8 +1784,21 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -1662,8 +1785,21 @@ mt7530_probe(struct mdio_device *mdiodev /* Get the hardware identifier from the devicetree node. * We will need it for some of the clock and regulator setup. */ diff --git a/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch b/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch index 8ede862204..95dddf68b0 100644 --- a/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch +++ b/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch @@ -466,7 +466,7 @@ Signed-off-by: Sean Wang } } -@@ -1280,7 +1619,7 @@ mt7530_setup(struct dsa_switch *ds) +@@ -1281,7 +1620,7 @@ mt7530_setup(struct dsa_switch *ds) PCR_MATRIX_CLR); if (dsa_is_cpu_port(ds, i)) @@ -475,7 +475,7 @@ Signed-off-by: Sean Wang else mt7530_port_disable(ds, i); -@@ -1334,6 +1673,118 @@ mt7530_setup(struct dsa_switch *ds) +@@ -1335,6 +1674,118 @@ mt7530_setup(struct dsa_switch *ds) return 0; } @@ -594,7 +594,7 @@ Signed-off-by: Sean Wang static bool mt7530_phy_mode_supported(struct dsa_switch *ds, int port, const struct phylink_link_state *state) -@@ -1372,6 +1823,47 @@ unsupported: +@@ -1373,6 +1824,47 @@ unsupported: return false; } @@ -642,7 +642,7 @@ Signed-off-by: Sean Wang static bool mt753x_phy_mode_supported(struct dsa_switch *ds, int port, const struct phylink_link_state *state) -@@ -1404,6 +1896,227 @@ mt7530_mac_config(struct dsa_switch *ds, +@@ -1405,6 +1897,227 @@ mt7530_mac_config(struct dsa_switch *ds, return 0; } @@ -870,7 +870,7 @@ Signed-off-by: Sean Wang static int mt753x_mac_config(struct dsa_switch *ds, int port, unsigned int mode, const struct phylink_link_state *state) -@@ -1439,6 +2152,8 @@ mt753x_phylink_mac_config(struct dsa_swi +@@ -1440,6 +2153,8 @@ mt753x_phylink_mac_config(struct dsa_swi if (mt753x_mac_config(ds, port, mode, state) < 0) goto unsupported; @@ -879,7 +879,7 @@ Signed-off-by: Sean Wang break; case 6: /* 1st cpu port */ if (priv->p6_interface == state->interface) -@@ -1458,7 +2173,8 @@ unsupported: +@@ -1459,7 +2174,8 @@ unsupported: return; } @@ -889,7 +889,7 @@ Signed-off-by: Sean Wang dev_err(ds->dev, "%s: in-band negotiation unsupported\n", __func__); return; -@@ -1468,7 +2184,7 @@ unsupported: +@@ -1469,7 +2185,7 @@ unsupported: mcr_new = mcr_cur; mcr_new &= ~PMCR_LINK_SETTINGS_MASK; mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN | @@ -898,7 +898,7 @@ Signed-off-by: Sean Wang /* Are we connected to external phy */ if (port == 5 && dsa_is_user_port(ds, 5)) -@@ -1478,7 +2194,18 @@ unsupported: +@@ -1479,7 +2195,18 @@ unsupported: mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); } @@ -918,7 +918,7 @@ Signed-off-by: Sean Wang unsigned int mode, phy_interface_t interface) { -@@ -1487,7 +2214,19 @@ static void mt7530_phylink_mac_link_down +@@ -1488,7 +2215,19 @@ static void mt7530_phylink_mac_link_down mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK); } @@ -939,7 +939,7 @@ Signed-off-by: Sean Wang unsigned int mode, phy_interface_t interface, struct phy_device *phydev, -@@ -1497,18 +2236,29 @@ static void mt7530_phylink_mac_link_up(s +@@ -1498,18 +2237,29 @@ static void mt7530_phylink_mac_link_up(s struct mt7530_priv *priv = ds->priv; u32 mcr; @@ -971,7 +971,7 @@ Signed-off-by: Sean Wang break; } if (duplex == DUPLEX_FULL) { -@@ -1522,6 +2272,45 @@ static void mt7530_phylink_mac_link_up(s +@@ -1523,6 +2273,45 @@ static void mt7530_phylink_mac_link_up(s mt7530_set(priv, MT7530_PMCR_P(port), mcr); } @@ -1017,7 +1017,7 @@ Signed-off-by: Sean Wang static void mt7530_mac_port_validate(struct dsa_switch *ds, int port, unsigned long *supported) -@@ -1530,6 +2319,14 @@ mt7530_mac_port_validate(struct dsa_swit +@@ -1531,6 +2320,14 @@ mt7530_mac_port_validate(struct dsa_swit phylink_set(supported, 1000baseX_Full); } @@ -1032,7 +1032,7 @@ Signed-off-by: Sean Wang static void mt753x_phylink_validate(struct dsa_switch *ds, int port, unsigned long *supported, -@@ -1546,7 +2343,8 @@ mt753x_phylink_validate(struct dsa_switc +@@ -1547,7 +2344,8 @@ mt753x_phylink_validate(struct dsa_switc phylink_set_port_modes(mask); @@ -1042,7 +1042,7 @@ Signed-off-by: Sean Wang phylink_set(mask, 10baseT_Half); phylink_set(mask, 10baseT_Full); phylink_set(mask, 100baseT_Half); -@@ -1565,6 +2363,11 @@ mt753x_phylink_validate(struct dsa_switc +@@ -1566,6 +2364,11 @@ mt753x_phylink_validate(struct dsa_switc linkmode_and(supported, supported, mask); linkmode_and(state->advertising, state->advertising, mask); @@ -1054,7 +1054,7 @@ Signed-off-by: Sean Wang } static int -@@ -1655,6 +2458,63 @@ static int mt7530_set_mac_eee(struct dsa +@@ -1656,6 +2459,63 @@ static int mt7530_set_mac_eee(struct dsa return 0; } @@ -1118,7 +1118,7 @@ Signed-off-by: Sean Wang static int mt753x_phylink_mac_link_state(struct dsa_switch *ds, int port, struct phylink_link_state *state) -@@ -1708,13 +2568,14 @@ static const struct dsa_switch_ops mt753 +@@ -1709,13 +2569,14 @@ static const struct dsa_switch_ops mt753 .port_vlan_prepare = mt7530_port_vlan_prepare, .port_vlan_add = mt7530_port_vlan_add, .port_vlan_del = mt7530_port_vlan_del, @@ -1137,7 +1137,7 @@ Signed-off-by: Sean Wang .get_mac_eee = mt7530_get_mac_eee, .set_mac_eee = mt7530_set_mac_eee, }; -@@ -1742,11 +2603,26 @@ static const struct mt753x_info mt753x_t +@@ -1743,11 +2604,26 @@ static const struct mt753x_info mt753x_t .mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_config = mt7530_mac_config, }, diff --git a/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch b/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch index 64b556088d..a25c845ffc 100644 --- a/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch +++ b/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch @@ -19,7 +19,7 @@ }, [PORT_NPCM] = { .name = "Nuvoton 16550", -@@ -2612,6 +2612,11 @@ serial8250_do_set_termios(struct uart_po +@@ -2615,6 +2615,11 @@ serial8250_do_set_termios(struct uart_po unsigned long flags; unsigned int baud, quot, frac = 0; diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts index c218521c03..5910f112f6 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts @@ -8,10 +8,10 @@ model = "GB-PC1"; aliases { - led-boot = &led_status; - led-failsafe = &led_status; - led-running = &led_status; - led-upgrade = &led_status; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; }; keys { @@ -27,24 +27,16 @@ leds { compatible = "gpio-leds"; - system { - label = "green:system"; + power { + label = "green:power"; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "default-on"; }; - led_status: status { - label = "green:status"; + led_system: system { + label = "green:system"; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - }; - - lan1 { - label = "green:lan1"; - gpios = <&gpio 24 GPIO_ACTIVE_LOW>; - }; - - lan2 { - label = "green:lan2"; - gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; }; }; }; @@ -59,9 +51,8 @@ flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <80000000>; + spi-max-frequency = <50000000>; broken-flash-reset; - m25p,fast-read; partitions { compatible = "fixed-partitions"; @@ -107,19 +98,19 @@ ports { port@0 { status = "okay"; - label = "lan1"; + label = "ethblack"; }; port@4 { status = "okay"; - label = "lan2"; + label = "ethblue"; }; }; }; &state_default { gpio { - groups = "jtag", "rgmii2", "uart3", "wdt"; + groups = "jtag", "uart3", "wdt"; function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts index 613524d1da..e27c4e4d47 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts @@ -8,10 +8,10 @@ model = "GB-PC2"; aliases { - led-boot = &led_status; - led-failsafe = &led_status; - led-running = &led_status; - led-upgrade = &led_status; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; }; keys { @@ -27,34 +27,36 @@ leds { compatible = "gpio-leds"; - system { - label = "green:system"; - gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + ethblack-green { + label = "green:ethblack"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; }; - led_status: status { - label = "green:status"; - gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + ethblue-green { + label = "green:ethblue"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; }; - lan1 { - label = "green:lan1"; - gpios = <&gpio 24 GPIO_ACTIVE_LOW>; + ethyellow-green { + label = "green:ethyellow"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; - lan2 { - label = "green:lan2"; - gpios = <&gpio 25 GPIO_ACTIVE_LOW>; - }; - - lan3-yellow { - label = "yellow:lan3"; + ethyellow-orange { + label = "orange:ethyellow"; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; }; - lan3-green { - label = "green:lan3"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + power { + label = "green:power"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "default-on"; + }; + + led_system: system { + label = "green:system"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; }; }; }; @@ -69,9 +71,8 @@ flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <80000000>; + spi-max-frequency = <50000000>; broken-flash-reset; - m25p,fast-read; partitions { compatible = "fixed-partitions"; @@ -113,23 +114,38 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "ethyellow"; + phy-handle = <ðphy5>; + + mtd-mac-address = <&factory 0xe000>; +}; + +&mdio { + ethphy5: ethernet-phy@5 { + reg = <5>; + phy-mode = "rgmii-rxid"; + }; +}; + &switch0 { ports { port@0 { status = "okay"; - label = "lan1"; + label = "ethblack"; }; port@4 { status = "okay"; - label = "lan2"; + label = "ethblue"; }; }; }; &state_default { gpio { - groups = "jtag", "rgmii2", "uart3", "wdt"; + groups = "jtag", "uart3", "wdt"; function = "gpio"; }; }; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 80dfd50894..f3fe5dd2cc 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -595,6 +595,7 @@ TARGET_DEVICES += glinet_gl-mt1300 define Device/gnubee_gb-pc1 $(Device/dsa-migration) + $(Device/uimage-lzma-loader) DEVICE_VENDOR := GnuBee DEVICE_MODEL := Personal Cloud One DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-basic-openssl @@ -604,6 +605,7 @@ TARGET_DEVICES += gnubee_gb-pc1 define Device/gnubee_gb-pc2 $(Device/dsa-migration) + $(Device/uimage-lzma-loader) DEVICE_VENDOR := GnuBee DEVICE_MODEL := Personal Cloud Two DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-basic-openssl 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 fcdaeaa039..5347c30f2f 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 @@ -42,10 +42,8 @@ dlink,dir-882-a1|\ dlink,dir-882-r1) ucidef_set_led_netdev "wan" "wan" "green:net" "wan" ;; -gnubee,gb-pc1|\ gnubee,gb-pc2) - ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1" - ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2" + ucidef_set_led_netdev "ethyellow" "ethyellow" "orange:ethyellow" "ethyellow" "link tx rx" ;; linksys,e5600) ucidef_set_led_netdev "wan" "wan link" "blue:wan" "wan" "link" diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 4f27aa67f0..64f144fb7c 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -49,9 +49,11 @@ ramips_setup_interfaces() xiaomi,mi-router-4a-gigabit) ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" ;; - gnubee,gb-pc1|\ + gnubee,gb-pc1) + ucidef_set_interface_lan "ethblack ethblue" + ;; gnubee,gb-pc2) - ucidef_set_interface_lan "lan1 lan2" + ucidef_set_interface_lan "ethblack ethblue ethyellow" ;; linksys,re6500|\ netgear,wac104) diff --git a/target/linux/ramips/mt7621/config-5.4 b/target/linux/ramips/mt7621/config-5.4 index c6ae28f304..78b557c335 100644 --- a/target/linux/ramips/mt7621/config-5.4 +++ b/target/linux/ramips/mt7621/config-5.4 @@ -107,6 +107,7 @@ CONFIG_HZ_PERIODIC=y CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y CONFIG_I2C_MT7621=y +CONFIG_ICPLUS_PHY=y CONFIG_INITRAMFS_SOURCE="" CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y diff --git a/target/linux/x86/patches-5.4/993-bnx2x_warpcore_8727_2_5g_sgmii_txfault.patch b/target/linux/x86/patches-5.4/993-bnx2x_warpcore_8727_2_5g_sgmii_txfault.patch new file mode 100644 index 0000000000..edb9838f7b --- /dev/null +++ b/target/linux/x86/patches-5.4/993-bnx2x_warpcore_8727_2_5g_sgmii_txfault.patch @@ -0,0 +1,216 @@ +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +@@ -1592,6 +1592,7 @@ struct bnx2x { + uint num_ethernet_queues; + uint num_cnic_queues; + int disable_tpa; ++ int mask_tx_fault; + + u32 rx_mode; + #define BNX2X_RX_MODE_NONE 0 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +@@ -151,6 +151,7 @@ typedef int (*read_sfp_module_eeprom_fun + + #define SFP_EEPROM_CON_TYPE_ADDR 0x2 + #define SFP_EEPROM_CON_TYPE_VAL_UNKNOWN 0x0 ++ #define SFP_EEPROM_CON_TYPE_VAL_SC 0x1 + #define SFP_EEPROM_CON_TYPE_VAL_LC 0x7 + #define SFP_EEPROM_CON_TYPE_VAL_COPPER 0x21 + #define SFP_EEPROM_CON_TYPE_VAL_RJ45 0x22 +@@ -4206,6 +4207,16 @@ static void bnx2x_warpcore_set_sgmii_spe + 0x1000); + DP(NETIF_MSG_LINK, "set SGMII AUTONEG\n"); + } else { ++ /* Note that 2.5G works only when used with 1G advertisment */ ++ if (fiber_mode && (phy->req_line_speed == SPEED_2500) && ++ (phy->speed_cap_mask & ++ (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G | ++ PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))) { ++ bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, ++ MDIO_WC_REG_SERDESDIGITAL_MISC1, ++ 0x6010); ++ } ++ + bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD, + MDIO_WC_REG_COMBO_IEEE0_MIICTRL, &val16); + val16 &= 0xcebf; +@@ -4216,6 +4227,7 @@ static void bnx2x_warpcore_set_sgmii_spe + val16 |= 0x2000; + break; + case SPEED_1000: ++ case SPEED_2500: + val16 |= 0x0040; + break; + default: +@@ -8169,6 +8181,7 @@ static int bnx2x_get_edc_mode(struct bnx + break; + } + case SFP_EEPROM_CON_TYPE_VAL_UNKNOWN: ++ case SFP_EEPROM_CON_TYPE_VAL_SC: + case SFP_EEPROM_CON_TYPE_VAL_LC: + case SFP_EEPROM_CON_TYPE_VAL_RJ45: + check_limiting_mode = 1; +@@ -8179,7 +8192,8 @@ static int bnx2x_get_edc_mode(struct bnx + (val[SFP_EEPROM_1G_COMP_CODE_ADDR] != 0)) { + DP(NETIF_MSG_LINK, "1G SFP module detected\n"); + phy->media_type = ETH_PHY_SFP_1G_FIBER; +- if (phy->req_line_speed != SPEED_1000) { ++ if ((phy->req_line_speed != SPEED_1000) && ++ (phy->req_line_speed != SPEED_2500)) { + u8 gport = params->port; + phy->req_line_speed = SPEED_1000; + if (!CHIP_IS_E1x(bp)) { +@@ -8339,7 +8353,7 @@ static int bnx2x_wait_for_sfp_module_ini + * some phys type ( e.g. JDSU ) + */ + +- for (timeout = 0; timeout < 60; timeout++) { ++ for (timeout = 0; timeout < 1800; timeout++) { + if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT) + rc = bnx2x_warpcore_read_sfp_module_eeprom( + phy, params, I2C_DEV_ADDR_A0, 1, 1, &val, +@@ -9238,6 +9252,7 @@ static void bnx2x_8727_config_speed(stru + u16 tmp1, val; + /* Set option 1G speed */ + if ((phy->req_line_speed == SPEED_1000) || ++ (phy->req_line_speed == SPEED_2500) || + (phy->media_type == ETH_PHY_SFP_1G_FIBER)) { + DP(NETIF_MSG_LINK, "Setting 1G force\n"); + bnx2x_cl45_write(bp, phy, +@@ -9247,6 +9262,22 @@ static void bnx2x_8727_config_speed(stru + bnx2x_cl45_read(bp, phy, + MDIO_PMA_DEVAD, MDIO_PMA_REG_10G_CTRL2, &tmp1); + DP(NETIF_MSG_LINK, "1.7 = 0x%x\n", tmp1); ++ if ((phy->req_line_speed == SPEED_2500) && ++ (phy->speed_cap_mask & ++ (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G | ++ PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))) { ++ bnx2x_cl45_read_and_write(bp, phy, ++ MDIO_AN_DEVAD, ++ MDIO_AN_REG_8727_MISC_CTRL2, ++ ~(1<<5)); ++ bnx2x_cl45_write(bp, phy, ++ MDIO_AN_DEVAD, ++ MDIO_AN_REG_8727_MISC_CTRL1, 0x0010); ++ } else { ++ bnx2x_cl45_write(bp, phy, ++ MDIO_AN_DEVAD, ++ MDIO_AN_REG_8727_MISC_CTRL1, 0x001C); ++ } + /* Power down the XAUI until link is up in case of dual-media + * and 1G + */ +@@ -9268,7 +9299,7 @@ static void bnx2x_8727_config_speed(stru + + DP(NETIF_MSG_LINK, "Setting 1G clause37\n"); + bnx2x_cl45_write(bp, phy, +- MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL, 0); ++ MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL2, 0); + bnx2x_cl45_write(bp, phy, + MDIO_AN_DEVAD, MDIO_AN_REG_CL37_AN, 0x1300); + } else { +@@ -9276,9 +9307,12 @@ static void bnx2x_8727_config_speed(stru + * registers although it is default + */ + bnx2x_cl45_write(bp, phy, +- MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL, ++ MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL2, + 0x0020); + bnx2x_cl45_write(bp, phy, ++ MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL1, ++ 0x001C); ++ bnx2x_cl45_write(bp, phy, + MDIO_AN_DEVAD, MDIO_AN_REG_CL37_AN, 0x0100); + bnx2x_cl45_write(bp, phy, + MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 0x2040); +@@ -9569,6 +9603,11 @@ static u8 bnx2x_8727_read_status(struct + vars->line_speed = SPEED_10000; + DP(NETIF_MSG_LINK, "port %x: External link up in 10G\n", + params->port); ++ } else if ((link_status & (1<<1)) && (!(link_status & (1<<14)))) { ++ link_up = 1; ++ vars->line_speed = SPEED_2500; ++ DP(NETIF_MSG_LINK, "port %x: External link up in 2.5G\n", ++ params->port); + } else if ((link_status & (1<<0)) && (!(link_status & (1<<13)))) { + link_up = 1; + vars->line_speed = SPEED_1000; +@@ -9600,7 +9639,8 @@ static u8 bnx2x_8727_read_status(struct + } + + if ((DUAL_MEDIA(params)) && +- (phy->req_line_speed == SPEED_1000)) { ++ ((phy->req_line_speed == SPEED_1000) || ++ (phy->req_line_speed == SPEED_2500))) { + bnx2x_cl45_read(bp, phy, + MDIO_PMA_DEVAD, + MDIO_PMA_REG_8727_PCS_GP, &val1); +@@ -11730,6 +11770,7 @@ static const struct bnx2x_phy phy_warpco + SUPPORTED_100baseT_Full | + SUPPORTED_1000baseT_Full | + SUPPORTED_1000baseKX_Full | ++ SUPPORTED_2500baseX_Full | + SUPPORTED_10000baseT_Full | + SUPPORTED_10000baseKR_Full | + SUPPORTED_20000baseKR2_Full | +@@ -11916,6 +11957,7 @@ static const struct bnx2x_phy phy_8727 = + .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff}, + .mdio_ctrl = 0, + .supported = (SUPPORTED_10000baseT_Full | ++ SUPPORTED_2500baseX_Full | + SUPPORTED_1000baseT_Full | + SUPPORTED_FIBRE | + SUPPORTED_Pause | +@@ -12263,6 +12305,7 @@ static int bnx2x_populate_int_phy(struct + break; + case PORT_HW_CFG_NET_SERDES_IF_SFI: + phy->supported &= (SUPPORTED_1000baseT_Full | ++ SUPPORTED_2500baseX_Full | + SUPPORTED_10000baseT_Full | + SUPPORTED_FIBRE | + SUPPORTED_Pause | +@@ -13947,7 +13990,8 @@ void bnx2x_period_func(struct link_param + & PORT_HW_CFG_NET_SERDES_IF_MASK) == + PORT_HW_CFG_NET_SERDES_IF_SFI) { + if (bnx2x_is_sfp_module_plugged(phy, params)) { +- bnx2x_sfp_tx_fault_detection(phy, params, vars); ++ if(!((params->port + 1) & bp->mask_tx_fault)) ++ bnx2x_sfp_tx_fault_detection(phy, params, vars); + } else if (vars->link_status & + LINK_STATUS_SFP_TX_FAULT) { + /* Clean trail, interrupt corrects the leds */ +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +@@ -105,6 +105,10 @@ static int disable_tpa; + module_param(disable_tpa, int, 0444); + MODULE_PARM_DESC(disable_tpa, " Disable the TPA (LRO) feature"); + ++static int mask_tx_fault; ++module_param(mask_tx_fault, int, 0444); ++MODULE_PARM_DESC(mask_tx_fault, " Mask SFP TX fault detection"); ++ + static int int_mode; + module_param(int_mode, int, 0444); + MODULE_PARM_DESC(int_mode, " Force interrupt mode other than MSI-X " +@@ -12455,6 +12459,8 @@ static int bnx2x_init_bp(struct bnx2x *b + if (BP_NOMCP(bp) && (func == 0)) + dev_err(&bp->pdev->dev, "MCP disabled, must load devices in order!\n"); + ++ bp->mask_tx_fault = mask_tx_fault; ++ + bp->disable_tpa = disable_tpa; + bp->disable_tpa |= !!IS_MF_STORAGE_ONLY(bp); + /* Reduce memory usage in kdump environment by disabling TPA */ +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +@@ -7169,7 +7169,8 @@ Theotherbitsarereservedandshouldbezero*/ + #define MDIO_PMA_REG_8727_PCS_GP 0xc842 + #define MDIO_PMA_REG_8727_OPT_CFG_REG 0xc8e4 + +-#define MDIO_AN_REG_8727_MISC_CTRL 0x8309 ++#define MDIO_AN_REG_8727_MISC_CTRL1 0x8308 ++#define MDIO_AN_REG_8727_MISC_CTRL2 0x8309 + + #define MDIO_PMA_REG_8073_CHIP_REV 0xc801 + #define MDIO_PMA_REG_8073_SPEED_LINK_STATUS 0xc820 diff --git a/target/sdk/files/Config.in b/target/sdk/files/Config.in index 4393daab5b..b1e18949f6 100644 --- a/target/sdk/files/Config.in +++ b/target/sdk/files/Config.in @@ -18,6 +18,51 @@ menu "Global build settings" bool "Cryptographically sign package lists" default y + comment "Package build options" + + config DEBUG + bool + prompt "Compile packages with debugging info" + default n + help + Adds -g3 to the CFLAGS. + + comment "Stripping options" + + choice + prompt "Binary stripping method" + default USE_STRIP if USE_GLIBC + default USE_SSTRIP + help + Select the binary stripping method you wish to use. + + config NO_STRIP + bool "none" + help + This will install unstripped binaries (useful for native + compiling/debugging). + + config USE_STRIP + bool "strip" + help + This will install binaries stripped using strip from binutils. + + config USE_SSTRIP + bool "sstrip" + depends on !USE_GLIBC + help + This will install binaries stripped using sstrip. + endchoice + + config STRIP_ARGS + string + prompt "Strip arguments" + depends on USE_STRIP + default "--strip-unneeded --remove-section=.comment --remove-section=.note" if DEBUG + default "--strip-all" + help + Specifies arguments passed to the strip command when stripping binaries. + endmenu menu "Advanced configuration options (for developers)" diff --git a/toolchain/Config.in b/toolchain/Config.in index 6dda9af92d..c30928854b 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -135,6 +135,7 @@ menuconfig EXTERNAL_TOOLCHAIN string prompt "Toolchain include path" if DEVEL depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN + default "./usr/include ./include/fortify ./include" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL default "./usr/include ./include" help Specify additional directories searched for header files (override