From 8c5194ae391347d9db867be830e251184f056747 Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Mon, 16 Sep 2024 09:59:53 +0200 Subject: [PATCH 1/6] mediatek: add kmod-thermal for BPI-R4 device Without adding that kmod, build fails with an error: Collected errors: * pkg_hash_check_unresolved: cannot find dependency kmod-thermal for kmod-hwmon-pwmfan * pkg_hash_fetch_best_installation_candidate: Packages for kmod-hwmon-pwmfan found, but incompatible with the architectures configured * opkg_install_cmd: Cannot install package kmod-hwmon-pwmfan. It is because, the kmod-thermal is marked as module: CONFIG_PACKAGE_kmod-thermal=m After adding it as dependency to the BPI-R4 device, the problem disappear. Signed-off-by: Daniel Pawlik (cherry picked from commit 664c5e413a8736c835a239514141be694c01e3db) --- target/linux/mediatek/image/filogic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 3e10003e4c2b73..455fd63f185411 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -373,7 +373,7 @@ define Device/bananapi_bpi-r4-common DEVICE_DTS_LOADADDR := 0x45f00000 DEVICE_DTS_OVERLAY:= mt7988a-bananapi-bpi-r4-emmc mt7988a-bananapi-bpi-r4-rtc mt7988a-bananapi-bpi-r4-sd mt7988a-bananapi-bpi-r4-wifi-mt7996a DEVICE_DTC_FLAGS := --pad 4096 - DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware kmod-mt7996-233-firmware \ + DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-thermal kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware kmod-mt7996-233-firmware \ kmod-rtc-pcf8563 kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs IMAGES := sysupgrade.itb KERNEL_LOADADDR := 0x46000000 From b7715a66755982eb9837f37297bc1f2af246ab56 Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Mon, 30 Sep 2024 08:25:27 +0200 Subject: [PATCH 2/6] Switch luci to use feed repo with BE patch The feed repo contains a patch [1]. [1] https://github.com/openwrt/luci/pull/7279 (cherry picked from commit 016c0d0fbdb41e1183a9be3b9d5d9e55c7acdaa8) --- feeds.conf.default | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index fc679335e0e47f..21d6582dbcf59f 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,5 +1,6 @@ src-git packages https://git.openwrt.org/feed/packages.git -src-git luci https://git.openwrt.org/project/luci.git +# src-git luci https://git.openwrt.org/project/luci.git +src-git luci https://github.com/danpawlik/luci.git;14be src-git routing https://git.openwrt.org/feed/routing.git src-git telephony https://git.openwrt.org/feed/telephony.git #src-git video https://github.com/openwrt/video.git From d592267a0622af84ddf5eec70fa5c6c96dc0517f Mon Sep 17 00:00:00 2001 From: Rudy Andram Date: Mon, 7 Oct 2024 14:09:05 +0100 Subject: [PATCH 3/6] mediatek/filogic crypto/inside-secure/safexcel The filogic banana-rpi4 has a crypto module that makes use of safexcel/eip197 to date the module doesn't load this patch fixes the module load by fixing the firmware location (eip197_minifw) and enabling the clocks to be forced on for EIP197 Signed-off-by: Rudy Andram Tested on the banana rpi4 (cherry picked from commit 32afae80fe6d4be423b2154e058785d97ea4207c) --- ...pto-add-eip197-inside-secure-support.patch | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 target/linux/mediatek/patches-6.6/999-2706-crypto-add-eip197-inside-secure-support.patch diff --git a/target/linux/mediatek/patches-6.6/999-2706-crypto-add-eip197-inside-secure-support.patch b/target/linux/mediatek/patches-6.6/999-2706-crypto-add-eip197-inside-secure-support.patch new file mode 100644 index 00000000000000..704811706fd2b6 --- /dev/null +++ b/target/linux/mediatek/patches-6.6/999-2706-crypto-add-eip197-inside-secure-support.patch @@ -0,0 +1,85 @@ +--- a/drivers/crypto/inside-secure/safexcel.c ++++ b/drivers/crypto/inside-secure/safexcel.c +@@ -414,13 +414,13 @@ + const struct firmware *fw[FW_NB]; + char fw_path[37], *dir = NULL; + int i, j, ret = 0, pe; +- int ipuesz, ifppsz, minifw = 0; ++ int ipuesz, ifppsz, minifw = 1; + + if (priv->data->version == EIP197D_MRVL) + dir = "eip197d"; + else if (priv->data->version == EIP197B_MRVL || + priv->data->version == EIP197_DEVBRD) +- dir = "eip197b"; ++ dir = "eip197_minifw"; + else if (priv->data->version == EIP197C_MXL) + dir = "eip197c"; + else +@@ -455,6 +455,9 @@ + + ipuesz = eip197_write_firmware(priv, fw[FW_IPUE]); + ++ for (j = 0; j < i; j++) ++ release_firmware(fw[j]); ++ + if (eip197_start_firmware(priv, ipuesz, ifppsz, minifw)) { + dev_dbg(priv->dev, "Firmware loaded successfully\n"); + return 0; +@@ -605,6 +608,11 @@ + */ + if (priv->flags & SAFEXCEL_HW_EIP197) { + val = readl(EIP197_HIA_AIC(priv) + EIP197_HIA_MST_CTRL); ++ /* Clear axi_burst_size and rx_burst_size */ ++ val &= 0xffffff00; ++ /* Set axi_burst_size = 3, rx_burst_size = 3 */ ++ val |= EIP197_MST_CTRL_RD_CACHE(3); ++ val |= EIP197_MST_CTRL_WD_CACHE(3); + val |= EIP197_MST_CTRL_TX_MAX_CMD(5); + writel(val, EIP197_HIA_AIC(priv) + EIP197_HIA_MST_CTRL); + } +@@ -805,6 +813,12 @@ + return ret; + } + ++ /* Allow clocks to be forced on for EIP197 */ ++ if (priv->flags & SAFEXCEL_HW_EIP197) { ++ writel(0xffffffff, EIP197_HIA_GEN_CFG(priv) + EIP197_FORCE_CLOCK_ON); ++ writel(0xffffffff, EIP197_HIA_GEN_CFG(priv) + EIP197_FORCE_CLOCK_ON2); ++ } ++ + return safexcel_hw_setup_cdesc_rings(priv) ?: + safexcel_hw_setup_rdesc_rings(priv) ?: + 0; +@@ -1746,6 +1760,7 @@ + { + struct device *dev = &pdev->dev; + struct safexcel_crypto_priv *priv; ++ struct resource *res; + int ret; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); +@@ -1757,7 +1772,11 @@ + + platform_set_drvdata(pdev, priv); + +- priv->base = devm_platform_ioremap_resource(pdev, 0); ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (!res) ++ return -EINVAL; ++ ++ priv->base = devm_ioremap(dev, res->start, resource_size(res)); + if (IS_ERR(priv->base)) { + dev_err(dev, "failed to get resource\n"); + return PTR_ERR(priv->base); +--- a/drivers/crypto/inside-secure/safexcel.h ++++ b/drivers/crypto/inside-secure/safexcel.h +@@ -189,6 +189,8 @@ + #define EIP197_PE_DEBUG(n) (0x1ff4 + (0x2000 * (n))) + #define EIP197_PE_OPTIONS(n) (0x1ff8 + (0x2000 * (n))) + #define EIP197_PE_VERSION(n) (0x1ffc + (0x2000 * (n))) ++#define EIP197_FORCE_CLOCK_ON2 0xffd8 ++#define EIP197_FORCE_CLOCK_ON 0xffe8 + #define EIP197_MST_CTRL 0xfff4 + #define EIP197_OPTIONS 0xfff8 + #define EIP197_VERSION 0xfffc From 22a6c8067b454485816d6dbe23b8539b30e7482d Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Tue, 8 Oct 2024 08:17:01 +0200 Subject: [PATCH 4/6] Update mt76 to HEAD --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 070d0f3c2b588b..cf6f576dc73d27 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:=2024-09-29 -PKG_SOURCE_VERSION:=680bc70f161fde0f167e2ae50c771be4775eb50a -PKG_MIRROR_HASH:=bcdb95e40cfceba56a565ad6b6d9f92a122e7230d0f7f950b3d39e4280723cca +PKG_SOURCE_DATE:=2024-10-08 +PKG_SOURCE_VERSION:=02c07fe539b44ff66f762a7a7895663ff9743745 +PKG_MIRROR_HASH:=5805d45157b117f3f67dd4b764ac3a9ae3cdb2d98db2e66903d853e76d3abed4 PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 From 5a9c84126d76bf8b1a8d454be18009dff983b9df Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Tue, 8 Oct 2024 08:21:52 +0200 Subject: [PATCH 5/6] Revert "Switch luci to use feed repo with BE patch" This reverts commit b7715a66755982eb9837f37297bc1f2af246ab56. --- feeds.conf.default | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/feeds.conf.default b/feeds.conf.default index 21d6582dbcf59f..fc679335e0e47f 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,6 +1,5 @@ src-git packages https://git.openwrt.org/feed/packages.git -# src-git luci https://git.openwrt.org/project/luci.git -src-git luci https://github.com/danpawlik/luci.git;14be +src-git luci https://git.openwrt.org/project/luci.git src-git routing https://git.openwrt.org/feed/routing.git src-git telephony https://git.openwrt.org/feed/telephony.git #src-git video https://github.com/openwrt/video.git From 9ffe542193d2ec2ea852e39a67b2f350b25f7bc1 Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Tue, 8 Oct 2024 08:52:36 +0200 Subject: [PATCH 6/6] Revert "Update mt76 to HEAD" This reverts commit 22a6c8067b454485816d6dbe23b8539b30e7482d. --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index cf6f576dc73d27..070d0f3c2b588b 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:=2024-10-08 -PKG_SOURCE_VERSION:=02c07fe539b44ff66f762a7a7895663ff9743745 -PKG_MIRROR_HASH:=5805d45157b117f3f67dd4b764ac3a9ae3cdb2d98db2e66903d853e76d3abed4 +PKG_SOURCE_DATE:=2024-09-29 +PKG_SOURCE_VERSION:=680bc70f161fde0f167e2ae50c771be4775eb50a +PKG_MIRROR_HASH:=bcdb95e40cfceba56a565ad6b6d9f92a122e7230d0f7f950b3d39e4280723cca PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0