From 4e74777fa8111a2bdf63164a4920a42917faec28 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Thu, 22 Jun 2023 00:32:32 +0800 Subject: [PATCH 1/8] ramips: backport upstream mt762x PCIe driver error log fixes These patches silence some mt762x PCIe driver error messeges by removing the useless debugging codes and replacing incorrectly used 'dev_err()' with 'dev_info()': PCI: mt7621: Use dev_info() to log PCIe card detection [1] mips: pci-mt7620: do not print NFTS register value as error log [2] mips: pci-mt7620: use dev_info() to log PCIe device detection result [3] Patch [1] has already been merged into the Linux 6.3 branch. Patches [2] and [3] have been merged into the "mips-next" tree, and they will be part of the upcoming Linux 6.5. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.4-rc7&id=50233e105a0332ec0f3bc83180c416e6b200471e [2] https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/commit/?id=9f9a035e6156a57d9da062b26d2a48d031744a1e [3] https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/commit/?id=89ec9bbe60b61cc6ae3eddd6d4f43e128f8a88de Signed-off-by: Shiji Yang --- ...do-not-print-NFTS-register-value-as-.patch | 32 +++++++++++++++ ...use-dev_info-to-log-PCIe-device-dete.patch | 39 +++++++++++++++++++ ...-dev_info-to-log-PCIe-card-detection.patch | 31 +++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 target/linux/ramips/patches-5.15/010-v6.5-01-mips-pci-mt7620-do-not-print-NFTS-register-value-as-.patch create mode 100644 target/linux/ramips/patches-5.15/010-v6.5-02-mips-pci-mt7620-use-dev_info-to-log-PCIe-device-dete.patch create mode 100644 target/linux/ramips/patches-5.15/110-v6.4-PCI-mt7621-Use-dev_info-to-log-PCIe-card-detection.patch diff --git a/target/linux/ramips/patches-5.15/010-v6.5-01-mips-pci-mt7620-do-not-print-NFTS-register-value-as-.patch b/target/linux/ramips/patches-5.15/010-v6.5-01-mips-pci-mt7620-do-not-print-NFTS-register-value-as-.patch new file mode 100644 index 0000000000..704e861b82 --- /dev/null +++ b/target/linux/ramips/patches-5.15/010-v6.5-01-mips-pci-mt7620-do-not-print-NFTS-register-value-as-.patch @@ -0,0 +1,32 @@ +From 9f9a035e6156a57d9da062b26d2a48d031744a1e Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Tue, 20 Jun 2023 18:43:22 +0800 +Subject: [PATCH 1/2] mips: pci-mt7620: do not print NFTS register value as + error log + +These codes are used to read NFTS_TIMEOUT_DELAY register value and +write it into kernel log after writing the register. they are only +used for debugging during driver development, so there is no need +to keep them now. + +Tested on MT7628AN router Motorola MWR03. + +Signed-off-by: Shiji Yang +Reviewed-by: Sergio Paracuellos +Signed-off-by: Thomas Bogendoerfer +--- + arch/mips/pci/pci-mt7620.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/arch/mips/pci/pci-mt7620.c ++++ b/arch/mips/pci/pci-mt7620.c +@@ -274,9 +274,6 @@ static int mt7628_pci_hw_init(struct pla + val |= 0x50 << 8; + pci_config_write(NULL, 0, 0x70c, 4, val); + +- pci_config_read(NULL, 0, 0x70c, 4, &val); +- dev_err(&pdev->dev, "Port 0 N_FTS = %x\n", (unsigned int) val); +- + return 0; + } + diff --git a/target/linux/ramips/patches-5.15/010-v6.5-02-mips-pci-mt7620-use-dev_info-to-log-PCIe-device-dete.patch b/target/linux/ramips/patches-5.15/010-v6.5-02-mips-pci-mt7620-use-dev_info-to-log-PCIe-device-dete.patch new file mode 100644 index 0000000000..5898a110ea --- /dev/null +++ b/target/linux/ramips/patches-5.15/010-v6.5-02-mips-pci-mt7620-use-dev_info-to-log-PCIe-device-dete.patch @@ -0,0 +1,39 @@ +From 89ec9bbe60b61cc6ae3eddd6d4f43e128f8a88de Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Tue, 20 Jun 2023 18:43:23 +0800 +Subject: [PATCH 2/2] mips: pci-mt7620: use dev_info() to log PCIe device + detection result + +Usually, We only need to print the error log when there is a PCIe card but +initialization fails. Whether the driver finds the PCIe card or not is the +expected behavior. So it's better to log these information with dev_info(). + +Tested on MT7628AN router Motorola MWR03. + +Signed-off-by: Shiji Yang +Reviewed-by: Sergio Paracuellos +Signed-off-by: Thomas Bogendoerfer +--- + arch/mips/pci/pci-mt7620.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/mips/pci/pci-mt7620.c ++++ b/arch/mips/pci/pci-mt7620.c +@@ -331,7 +331,7 @@ static int mt7620_pci_probe(struct platf + rt_sysc_m32(RALINK_PCIE0_CLK_EN, 0, RALINK_CLKCFG1); + if (ralink_soc == MT762X_SOC_MT7620A) + rt_sysc_m32(LC_CKDRVPD, PDRV_SW_SET, PPLL_DRV); +- dev_err(&pdev->dev, "PCIE0 no card, disable it(RST&CLK)\n"); ++ dev_info(&pdev->dev, "PCIE0 no card, disable it(RST&CLK)\n"); + return -1; + } + +@@ -374,7 +374,7 @@ int pcibios_map_irq(const struct pci_dev + dev->bus->number, slot); + return 0; + } +- dev_err(&dev->dev, "card - bus=0x%x, slot = 0x%x irq=%d\n", ++ dev_info(&dev->dev, "card - bus=0x%x, slot = 0x%x irq=%d\n", + dev->bus->number, slot, irq); + + /* configure the cache line size to 0x14 */ diff --git a/target/linux/ramips/patches-5.15/110-v6.4-PCI-mt7621-Use-dev_info-to-log-PCIe-card-detection.patch b/target/linux/ramips/patches-5.15/110-v6.4-PCI-mt7621-Use-dev_info-to-log-PCIe-card-detection.patch new file mode 100644 index 0000000000..94519b9c01 --- /dev/null +++ b/target/linux/ramips/patches-5.15/110-v6.4-PCI-mt7621-Use-dev_info-to-log-PCIe-card-detection.patch @@ -0,0 +1,31 @@ +From 50233e105a0332ec0f3bc83180c416e6b200471e Mon Sep 17 00:00:00 2001 +From: Sergio Paracuellos +Date: Fri, 24 Mar 2023 08:37:33 +0100 +Subject: PCI: mt7621: Use dev_info() to log PCIe card detection + +When there is no card plugged on a PCIe port a log reporting that +the port will be disabled is flagged as an error (dev_err()). + +Since this is not an error at all, change the log level by using +dev_info() instead. + +Link: https://lore.kernel.org/r/20230324073733.1596231-1-sergio.paracuellos@gmail.com +Signed-off-by: Sergio Paracuellos +Signed-off-by: Lorenzo Pieralisi +--- + drivers/pci/controller/pcie-mt7621.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/pci/controller/pcie-mt7621.c ++++ b/drivers/pci/controller/pcie-mt7621.c +@@ -383,8 +383,8 @@ static int mt7621_pcie_init_ports(struct + u32 slot = port->slot; + + if (!mt7621_pcie_port_is_linkup(port)) { +- dev_err(dev, "pcie%d no card, disable it (RST & CLK)\n", +- slot); ++ dev_info(dev, "pcie%d no card, disable it (RST & CLK)\n", ++ slot); + mt7621_control_assert(port); + port->enabled = false; + num_disabled++; From 285f0668f4058a935389985eb80353c8a5adbc7d Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Fri, 23 Jun 2023 02:05:21 +0800 Subject: [PATCH 2/8] ramips: do not print error log when mdio bus is disabled The mdio bus is used to control externel switch. In most cases, they are disabled, which is the normal behavior. Treating this as an error makes no sense, so we need to change the notification level from error to info. Fixes: a2acdf960704 ("ramips: mt7620: remove useless GMAC nodes") Signed-off-by: Shiji Yang --- target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c index a6448443c0..7e896644f8 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c @@ -257,7 +257,7 @@ err_free_bus: err_put_node: of_node_put(mii_np); err_no_bus: - dev_err(priv->dev, "%s disabled", "mdio-bus"); + dev_info(priv->dev, "%s disabled", "mdio-bus"); priv->mii_bus = NULL; return err; } From fc08989a3215b542f82d886a71437f059b147d3d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 25 Jun 2023 22:22:22 +0200 Subject: [PATCH 3/8] Revert "mt76: update to the latest version" This reverts commit 901af2718957fc878279073e9b917458144c75a4. Will be re-applied once crash issues have been figured out and resolved Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 11a4c5ba87..04db7fe32c 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:=2023-06-22 -PKG_SOURCE_VERSION:=29cfabbb4b9076aca2a5b5124729a2a9c391905c -PKG_MIRROR_HASH:=4b696f473fa784c5cc14ea964a0942e7263022e078e2929db650b458b576f1ce +PKG_SOURCE_DATE:=2023-05-13 +PKG_SOURCE_VERSION:=969b7b5ebd129068ca56e4b0d831593a2f92382f +PKG_MIRROR_HASH:=d28869591d1cb9a967b72f5cd8215c7b2c3388b7b31147b7b18c797018ab8ffb PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 @@ -266,7 +266,7 @@ define KernelPackage/mt7921-common $(KernelPackage/mt76-default) TITLE:=MediaTek MT7615 wireless driver common code HIDDEN:=1 - DEPENDS+=+kmod-mt76-connac +kmod-mt7921-firmware +@DRIVER_11AX_SUPPORT +kmod-hwmon-core + DEPENDS+=+kmod-mt76-connac +kmod-mt7921-firmware +@DRIVER_11AX_SUPPORT FILES:= $(PKG_BUILD_DIR)/mt7921/mt7921-common.ko endef From 03ce5598a03b59fcebafa06b9f5292aaf5517eb2 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 21 May 2023 22:30:23 +0200 Subject: [PATCH 4/8] kernel: phy: motorcomm: Fix compile Fix compilation on starfive target. Signed-off-by: Hauke Mehrtens --- ...et-phy-motorcomm-Add-missing-include.patch | 22 +++++++++++++++++++ ...et-phy-motorcomm-Add-missing-include.patch | 22 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 target/linux/generic/pending-5.15/740-net-phy-motorcomm-Add-missing-include.patch create mode 100644 target/linux/generic/pending-6.1/740-net-phy-motorcomm-Add-missing-include.patch diff --git a/target/linux/generic/pending-5.15/740-net-phy-motorcomm-Add-missing-include.patch b/target/linux/generic/pending-5.15/740-net-phy-motorcomm-Add-missing-include.patch new file mode 100644 index 0000000000..2a1f908cfb --- /dev/null +++ b/target/linux/generic/pending-5.15/740-net-phy-motorcomm-Add-missing-include.patch @@ -0,0 +1,22 @@ +From 6f291aa7da199c6486cc229b055dcbcd5cee7a21 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 21 May 2023 22:24:56 +0200 +Subject: [PATCH] net: phy: motorcomm: Add missing include + +Directly include linux/bitfield.h which provides FIELD_PREP. + +Signed-off-by: Hauke Mehrtens +--- + drivers/net/phy/motorcomm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/phy/motorcomm.c ++++ b/drivers/net/phy/motorcomm.c +@@ -6,6 +6,7 @@ + * Author: Frank + */ + ++#include + #include + #include + #include diff --git a/target/linux/generic/pending-6.1/740-net-phy-motorcomm-Add-missing-include.patch b/target/linux/generic/pending-6.1/740-net-phy-motorcomm-Add-missing-include.patch new file mode 100644 index 0000000000..2a1f908cfb --- /dev/null +++ b/target/linux/generic/pending-6.1/740-net-phy-motorcomm-Add-missing-include.patch @@ -0,0 +1,22 @@ +From 6f291aa7da199c6486cc229b055dcbcd5cee7a21 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 21 May 2023 22:24:56 +0200 +Subject: [PATCH] net: phy: motorcomm: Add missing include + +Directly include linux/bitfield.h which provides FIELD_PREP. + +Signed-off-by: Hauke Mehrtens +--- + drivers/net/phy/motorcomm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/phy/motorcomm.c ++++ b/drivers/net/phy/motorcomm.c +@@ -6,6 +6,7 @@ + * Author: Frank + */ + ++#include + #include + #include + #include From 7a6f6b812632a5983cd34ab5c41271d5d4de5fbf Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 25 Jun 2023 20:03:42 +0200 Subject: [PATCH 5/8] uhttpd: update to latest git HEAD 34a8a74 uhttpd/file: fix string out of buffer range on uh_defer_script Signed-off-by: Hauke Mehrtens --- package/network/services/uhttpd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index 3923e55b07..02a02405fd 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git -PKG_SOURCE_DATE:=2023-01-28 -PKG_SOURCE_VERSION:=47561aa13574068403d48f13ea310f8511057b2b -PKG_MIRROR_HASH:=84500cf0c8224fe80b5717c9b6bad8ac13f44f286e3a88e8b12adfcf02e22c7c +PKG_SOURCE_DATE:=2023-06-25 +PKG_SOURCE_VERSION:=34a8a74dbdec3c0de38abc1b08f6a73c51263792 +PKG_MIRROR_HASH:=8206885eebed5d1827763bcc5bcf9ca3510ae22b0ad1f6432114f1136c32dde2 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=ISC From 9d8d65322ce7d82ee20cc6dcca07506e7405c5f5 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 25 Jun 2023 20:09:38 +0200 Subject: [PATCH 6/8] rpcd: update to latest git HEAD 31c3907 file: strengthen exec access control Signed-off-by: Hauke Mehrtens --- package/system/rpcd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index 6221da8c8e..b0e351b25d 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git -PKG_MIRROR_HASH:=d636b6e08a69578d615b2a294d6ca2c7ef73791de2a8314f1afb741655d8a143 -PKG_SOURCE_DATE:=2023-03-14 -PKG_SOURCE_VERSION:=d97883005ffb5be251872c3e4abe04f71732f9bd +PKG_MIRROR_HASH:=9c29ee1b4379f835420986fdef3d9510cdd5fc1fd5f4662ecc185913a1f0ec17 +PKG_SOURCE_DATE:=2023-06-25 +PKG_SOURCE_VERSION:=31c390727b83c9efd768c7aa258813e6084b46a3 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC From 359638098742d7573ff422f6dc7125c89086072b Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 25 Jun 2023 21:46:45 +0200 Subject: [PATCH 7/8] procd: update to latest git HEAD 122a5e3 Revert "sysupgrade: print errno on failure" 2db8365 system: add RISC-V CPU info Signed-off-by: Hauke Mehrtens --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 2d51b51ad7..9e829a2159 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_MIRROR_HASH:=75a92c01ef85f41dc7e0b77ac35f464fbe45942af02ca6847516c4ebf574c4a4 -PKG_SOURCE_DATE:=2023-01-16 -PKG_SOURCE_VERSION:=190f13a75e67e0bdb662188da79b8be31e0aae01 +PKG_MIRROR_HASH:=a7e42525ae65eb1342e593a714e88bc59e46467cbb5a7fd7d7aca4a9815b7c0d +PKG_SOURCE_DATE:=2023-06-25 +PKG_SOURCE_VERSION:=2db836553e8fc318143b38dbc6e12b8625cf5c33 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 186976c963f0b2484be81854b97c0d8ec6c6e7a7 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sun, 25 Jun 2023 23:41:35 +0800 Subject: [PATCH 8/8] arm-trusted-firmware-rockchip: add m0 gcc toolchain rk3399 ATF requires arm toolchain to build the m0 pmu driver. As OpenWrt doesn't ship this toolchain so download the prebuilt one just like what we did in arm-trusted-firmware-mvebu. Fixes: 5d1cb52da062 ("arm-trusted-firmware-rockchip: Update to 2.9") Reported-by: Wurzer Juergen Signed-off-by: Tianling Shen --- .../arm-trusted-firmware-rockchip/Makefile | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/package/boot/arm-trusted-firmware-rockchip/Makefile b/package/boot/arm-trusted-firmware-rockchip/Makefile index f5b9d6b16d..aaae4ce392 100644 --- a/package/boot/arm-trusted-firmware-rockchip/Makefile +++ b/package/boot/arm-trusted-firmware-rockchip/Makefile @@ -37,6 +37,33 @@ TFA_TARGETS:= \ rk3328 \ rk3399 +ifeq ($(BUILD_VARIANT),rk3399) + M0_GCC_NAME:=gcc-arm + M0_GCC_RELEASE:=11.2-2022.02 + M0_GCC_VERSION:=$(HOST_ARCH)-arm-none-eabi + M0_GCC_SOURCE:=$(M0_GCC_NAME)-$(M0_GCC_RELEASE)-$(M0_GCC_VERSION).tar.xz + + define Download/m0-gcc + FILE:=$(M0_GCC_SOURCE) + URL:=https://developer.arm.com/-/media/Files/downloads/gnu/$(M0_GCC_RELEASE)/binrel + ifeq ($(HOST_ARCH),aarch64) + HASH:=ef1d82e5894e3908cb7ed49c5485b5b95deefa32872f79c2b5f6f5447cabf55f + else + HASH:=8c5acd5ae567c0100245b0556941c237369f210bceb196edfe5a2e7532c60326 + endif + endef + + define Build/Prepare + $(eval $(call Download,m0-gcc)) + $(call Build/Prepare/Default) + + xzcat $(DL_DIR)/$(M0_GCC_SOURCE) | $(HOST_TAR) -C $(PKG_BUILD_DIR)/ $(TAR_OPTIONS) + endef + + TFA_MAKE_FLAGS+= \ + M0_CROSS_COMPILE=$(PKG_BUILD_DIR)/$(M0_GCC_NAME)-$(M0_GCC_RELEASE)-$(M0_GCC_VERSION)/bin/arm-none-eabi- +endif + define Package/trusted-firmware-a/install $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/$(PLAT)/release/bl31/bl31.elf $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)_bl31.elf