diff --git a/include/kernel-6.1 b/include/kernel-6.1 index 93a76f81fe..e8acd5ca1f 100644 --- a/include/kernel-6.1 +++ b/include/kernel-6.1 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.1 = .95 -LINUX_KERNEL_HASH-6.1.95 = 2960f0aa1d75665f39114ad3c272a999c54796e553a2355d0379f5188d14dfbd +LINUX_VERSION-6.1 = .96 +LINUX_KERNEL_HASH-6.1.96 = 3e77c9069de5e7ab02ff9c2dcfe77dab193613fc1de21071901b4153374862a9 diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 1d73f76874..bb8c01bfbf 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .35 -LINUX_KERNEL_HASH-6.6.35 = fce3ee728712ed063aa8c14a8756c8ff8c7a46ba3827f61d2b04a73c7cf5dd9e +LINUX_VERSION-6.6 = .36 +LINUX_KERNEL_HASH-6.6.36 = b9676828b737e8fb8eaa5198303d35d35e8df019550be153c8a42c99afe0cdd5 diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index d4446167b7..19c3073c74 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -9,15 +9,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot -PKG_VERSION:=2024.01 -PKG_RELEASE:=3 +PKG_VERSION:=2024.07 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ https://ftp.denx.de/pub/u-boot \ https://mirror.cyberbits.eu/u-boot \ ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=b99611f1ed237bf3541bdc8434b68c96a6e05967061f992443cb30aabebef5b3 +PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION) diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index 801af34b84..06ffaebac1 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -112,7 +112,8 @@ livinet,zr-3020-ubootmod) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "1" ;; mercusys,mr90x-v1|\ -routerich,ax3000) +routerich,ax3000|\ +tplink,re6000xd) local envdev=/dev/mtd$(find_mtd_index "u-boot-env") ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1" ;; diff --git a/package/boot/uboot-envtools/patches/010-fw_env-fix-reading-NVMEM-device-s-compatible-value.patch b/package/boot/uboot-envtools/patches/010-fw_env-fix-reading-NVMEM-device-s-compatible-value.patch deleted file mode 100644 index 5af8a1aa0e..0000000000 --- a/package/boot/uboot-envtools/patches/010-fw_env-fix-reading-NVMEM-device-s-compatible-value.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Tue, 12 Dec 2023 18:23:45 +0100 -Subject: [PATCH] fw_env: fix reading NVMEM device's "compatible" value -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Call to fread() was changed to check for return value. The problem is it -can't be checked for returning 1 (as it is) to determine success. - -We call fread() with buffer size as "size" argument. Reading any -"compatible" value shorter than buffer size will result in returning 0 -even on success. - -Modify code to use fstat() to determine expected read length. - -This fixes regression that broke using fw_env with NVMEM devices. - -Fixes: c059a22b7776 ("tools: env: fw_env: Fix unused-result warning") -Cc: Jaehoon Chung -Signed-off-by: Rafał Miłecki ---- - tools/env/fw_env.c | 18 ++++++++++++++---- - 1 file changed, 14 insertions(+), 4 deletions(-) - ---- a/tools/env/fw_env.c -+++ b/tools/env/fw_env.c -@@ -1732,6 +1732,7 @@ static int find_nvmem_device(void) - } - - while (!nvmem && (dent = readdir(dir))) { -+ struct stat s; - FILE *fp; - size_t size; - -@@ -1749,14 +1750,22 @@ static int find_nvmem_device(void) - continue; - } - -- size = fread(buf, sizeof(buf), 1, fp); -+ if (fstat(fileno(fp), &s)) { -+ fprintf(stderr, "Failed to fstat %s\n", comp); -+ goto next; -+ } -+ -+ if (s.st_size >= sizeof(buf)) { -+ goto next; -+ } -+ -+ size = fread(buf, s.st_size, 1, fp); - if (size != 1) { - fprintf(stderr, - "read failed about %s\n", comp); -- fclose(fp); -- return -EIO; -+ goto next; - } -- -+ buf[s.st_size] = '\0'; - - if (!strcmp(buf, "u-boot,env")) { - bytes = asprintf(&nvmem, "%s/%s/nvmem", path, dent->d_name); -@@ -1765,6 +1774,7 @@ static int find_nvmem_device(void) - } - } - -+next: - fclose(fp); - } - diff --git a/package/boot/uboot-envtools/patches/011-fw_env-keep-calling-read-until-whole-flash-block-is-.patch b/package/boot/uboot-envtools/patches/011-fw_env-keep-calling-read-until-whole-flash-block-is-.patch deleted file mode 100644 index af1c32fe91..0000000000 --- a/package/boot/uboot-envtools/patches/011-fw_env-keep-calling-read-until-whole-flash-block-is-.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 9e3003f79d168eac7ee65cd457e3904e2fb4eea8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Wed, 13 Dec 2023 13:13:54 +0100 -Subject: [PATCH] fw_env: keep calling read() until whole flash block is read -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It's totally valid for read() to provide less bytes than requested -maximum. It may happen if there is no more data available yet or source -pushes data in small chunks. - -This actually happens when trying to read env data from NVMEM device. -Kernel may provide NVMEM content in page size parts (like 4096 B). - -This fixes warnings like: -Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 16384 bytes but got 4096 -Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 12288 bytes but got 4096 -Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 8192 bytes but got 4096 - -Since the main loop in flash_read_buf() is used to read blocks this -patch adds a new nested one. - -Signed-off-by: Rafał Miłecki ---- - tools/env/fw_env.c | 34 +++++++++++++++------------------- - 1 file changed, 15 insertions(+), 19 deletions(-) - ---- a/tools/env/fw_env.c -+++ b/tools/env/fw_env.c -@@ -948,29 +948,25 @@ static int flash_read_buf(int dev, int f - */ - lseek(fd, blockstart + block_seek, SEEK_SET); - -- rc = read(fd, buf + processed, readlen); -- if (rc == -1) { -- fprintf(stderr, "Read error on %s: %s\n", -- DEVNAME(dev), strerror(errno)); -- return -1; -- } -+ while (readlen) { -+ rc = read(fd, buf + processed, readlen); -+ if (rc == -1) { -+ fprintf(stderr, "Read error on %s: %s\n", -+ DEVNAME(dev), strerror(errno)); -+ return -1; -+ } - #ifdef DEBUG -- fprintf(stderr, "Read 0x%x bytes at 0x%llx on %s\n", -- rc, (unsigned long long)blockstart + block_seek, -- DEVNAME(dev)); -+ fprintf(stderr, "Read 0x%x bytes at 0x%llx on %s\n", -+ rc, (unsigned long long)blockstart + block_seek, -+ DEVNAME(dev)); - #endif -- processed += rc; -- if (rc != readlen) { -- fprintf(stderr, -- "Warning on %s: Attempted to read %zd bytes but got %d\n", -- DEVNAME(dev), readlen, rc); -+ processed += rc; - readlen -= rc; -- block_seek += rc; -- } else { -- blockstart += blocklen; -- readlen = min(blocklen, count - processed); -- block_seek = 0; - } -+ -+ blockstart += blocklen; -+ readlen = min(blocklen, count - processed); -+ block_seek = 0; - } - - return processed; diff --git a/package/boot/uboot-envtools/patches/012-fw_env-autodetect-NAND-erase-size-and-env-sectors.patch b/package/boot/uboot-envtools/patches/012-fw_env-autodetect-NAND-erase-size-and-env-sectors.patch deleted file mode 100644 index 78f555fb1f..0000000000 --- a/package/boot/uboot-envtools/patches/012-fw_env-autodetect-NAND-erase-size-and-env-sectors.patch +++ /dev/null @@ -1,49 +0,0 @@ -From d73a6641868029b5cae53ed00c5766921c9d8b1f Mon Sep 17 00:00:00 2001 -From: Anthony Loiseau -Date: Thu, 21 Dec 2023 23:44:38 +0100 -Subject: [PATCH] fw_env: autodetect NAND erase size and env sectors - -As already done for NOR chips, if device ESIZE and ENVSECTORS static -configurations are both zero, then autodetect them at runtime. - -Cc: Joe Hershberger -cc: Stefan Agner -cc: Rasmus Villemoes -Signed-off-by: Anthony Loiseau ---- - tools/env/README | 3 +++ - tools/env/fw_env.c | 11 +++++++++-- - 2 files changed, 12 insertions(+), 2 deletions(-) - ---- a/tools/env/README -+++ b/tools/env/README -@@ -58,6 +58,9 @@ DEVICEx_ENVSECTORS defines the number of - this environment instance. On NAND this is used to limit the range - within which bad blocks are skipped, on NOR it is not used. - -+If DEVICEx_ESIZE and DEVICEx_ENVSECTORS are both zero, then a runtime -+detection is attempted for NOR and NAND mtd types. -+ - To prevent losing changes to the environment and to prevent confusing the MTD - drivers, a lock file at /run/fw_printenv.lock is used to serialize access - to the environment. ---- a/tools/env/fw_env.c -+++ b/tools/env/fw_env.c -@@ -1655,8 +1655,15 @@ static int check_device_config(int dev) - } - DEVTYPE(dev) = mtdinfo.type; - if (DEVESIZE(dev) == 0 && ENVSECTORS(dev) == 0 && -- mtdinfo.type == MTD_NORFLASH) -- DEVESIZE(dev) = mtdinfo.erasesize; -+ mtdinfo.erasesize > 0) { -+ if (mtdinfo.type == MTD_NORFLASH) -+ DEVESIZE(dev) = mtdinfo.erasesize; -+ else if (mtdinfo.type == MTD_NANDFLASH) { -+ DEVESIZE(dev) = mtdinfo.erasesize; -+ ENVSECTORS(dev) = -+ mtdinfo.size / mtdinfo.erasesize; -+ } -+ } - if (DEVESIZE(dev) == 0) - /* Assume the erase size is the same as the env-size */ - DEVESIZE(dev) = ENVSIZE(dev); diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index 65e0040f40..7772a19c1e 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -337,7 +337,6 @@ UBOOT_TARGETS := \ UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes UBOOT_CUSTOMIZE_CONFIG := \ - --disable SPL_FIT_SIGNATURE \ --disable TOOLS_MKEFICAPSULE \ --set-str MKIMAGE_DTC_PATH $(PKG_BUILD_DIR)/scripts/dtc/dtc \ $(if $(TPL),, \ @@ -347,6 +346,7 @@ UBOOT_CUSTOMIZE_CONFIG := \ --disable DFU_MMC \ --disable EFI_CAPSULE_ON_DISK \ --disable EFI_CAPSULE_FIRMWARE_RAW \ + --disable SPL_FIT_SIGNATURE \ ) UBOOT_MAKE_FLAGS += \ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index fc578115f3..917818db4a 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2024-04-26 -PKG_SOURCE_VERSION:=644ba9ea2e6685e420561ef098cb6fbaaf136cbf -PKG_MIRROR_HASH:=3b913fd6fb0fac404b16e67c66d36c10315dba5459a8d495d870afcb1e2c33cd +PKG_SOURCE_DATE:=2024-06-30 +PKG_SOURCE_VERSION:=e82cba7e7ce79a04d2b658c20ac9be387ccc1dd9 +PKG_MIRROR_HASH:=c71ad9785bf382a80b4c9042f1f19da8737dc85cd11e49f18881dee94df61efd PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk @@ -38,6 +38,7 @@ ALLWIFIBOARDS:= \ linksys_mx4200 \ linksys_mx5300 \ linksys_mx8500 \ + linksys_whw03 \ netgear_lbr20 \ netgear_rax120v2 \ netgear_sxk80 \ @@ -160,6 +161,7 @@ $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800)) $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200)) $(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300)) $(eval $(call generate-ipq-wifi-package,linksys_mx8500,Linksys MX8500)) +$(eval $(call generate-ipq-wifi-package,linksys_whw03,Linksys WHW03)) $(eval $(call generate-ipq-wifi-package,netgear_lbr20,Netgear LBR20)) $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2)) $(eval $(call generate-ipq-wifi-package,netgear_sxk80,Netgear SXK80)) diff --git a/target/linux/ath79/dts/ar7100.dtsi b/target/linux/ath79/dts/ar7100.dtsi index 6648311619..5237157458 100644 --- a/target/linux/ath79/dts/ar7100.dtsi +++ b/target/linux/ath79/dts/ar7100.dtsi @@ -67,7 +67,7 @@ reg = <0x18040000 0x28>; interrupts = <2>; - ngpios = <16>; + ngpios = <12>; gpio-controller; #gpio-cells = <2>; diff --git a/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi b/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi index 6ec700f179..41629da750 100644 --- a/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi +++ b/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi @@ -49,12 +49,9 @@ }; &gpio { - ngpios = <31>; gpio-line-names = "", "", "", "", "LED", "RDY", "", "MDC", - "MDIO", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", ""; + "MDIO", "", "", ""; }; &pcie0 { diff --git a/target/linux/ath79/dts/ar7240.dtsi b/target/linux/ath79/dts/ar7240.dtsi index afbae33a80..eb4b2e4aa3 100644 --- a/target/linux/ath79/dts/ar7240.dtsi +++ b/target/linux/ath79/dts/ar7240.dtsi @@ -15,6 +15,10 @@ }; }; +&gpio { + ngpios = <18>; +}; + &ahb { usb: usb@1b000000 { compatible = "generic-ohci"; diff --git a/target/linux/ath79/dts/ar7242.dtsi b/target/linux/ath79/dts/ar7242.dtsi index 96b0442614..aab6c28f7b 100644 --- a/target/linux/ath79/dts/ar7242.dtsi +++ b/target/linux/ath79/dts/ar7242.dtsi @@ -16,7 +16,7 @@ }; &gpio { - ngpios = <20>; + ngpios = <18>; }; &ahb { diff --git a/target/linux/ath79/dts/ar724x.dtsi b/target/linux/ath79/dts/ar724x.dtsi index c758fc244e..7b4bf3e3f2 100644 --- a/target/linux/ath79/dts/ar724x.dtsi +++ b/target/linux/ath79/dts/ar724x.dtsi @@ -60,8 +60,6 @@ reg = <0x18040000 0x28>; interrupts = <2>; - ngpios = <18>; - gpio-controller; #gpio-cells = <2>; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-s200.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-s200.dtsi index f6ff4f3a10..648c3a9c8e 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-s200.dtsi +++ b/target/linux/ath79/dts/qca9531_glinet_gl-s200.dtsi @@ -91,7 +91,6 @@ }; &gpio { - ngpios = <17>; gpio-line-names = "","reset-zigbee","reset-zwave","reset", "LED-orange","","","","","","", diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi index cc26db5ba2..0e52a80f6e 100644 --- a/target/linux/ath79/dts/qca953x.dtsi +++ b/target/linux/ath79/dts/qca953x.dtsi @@ -72,7 +72,7 @@ reg = <0x18040000 0x28>; interrupts = <2>; - ngpios = <20>; + ngpios = <18>; gpio-controller; #gpio-cells = <2>; diff --git a/target/linux/ath79/dts/qca956x.dtsi b/target/linux/ath79/dts/qca956x.dtsi index 8b261568f0..de685d053c 100644 --- a/target/linux/ath79/dts/qca956x.dtsi +++ b/target/linux/ath79/dts/qca956x.dtsi @@ -61,7 +61,7 @@ reg = <0x18040000 0x28>; interrupts = <2>; - ngpios = <24>; + ngpios = <23>; gpio-controller; #gpio-cells = <2>; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches index 279f518409..d5b41dc0b8 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches @@ -11,62 +11,62 @@ board=$(board_name) case "$board" in adtran,bsap1800-v2|\ adtran,bsap1840) - ucidef_add_gpio_switch "wifi1_ext_a" "5GHz External Antenna A" "489" "1" - ucidef_add_gpio_switch "wifi1_int_a" "5GHz Internal Antenna A" "493" - ucidef_add_gpio_switch "wifi1_ext_b" "5GHz External Antenna B" "494" "1" - ucidef_add_gpio_switch "wifi1_int_b" "5GHz Internal Antenna B" "495" - ucidef_add_gpio_switch "wifi1_ext_c" "5GHz External Antenna C" "496" "1" - ucidef_add_gpio_switch "wifi1_int_c" "5GHz Internal Antenna C" "497" - ucidef_add_gpio_switch "wifi0_ext_a" "2.4GHz External Antenna A" "505" "1" - ucidef_add_gpio_switch "wifi0_int_a" "2.4GHz Internal Antenna A" "506" - ucidef_add_gpio_switch "wifi0_ext_b" "2.4GHz External Antenna B" "507" "1" - ucidef_add_gpio_switch "wifi0_int_b" "2.4GHz Internal Antenna B" "508" - ucidef_add_gpio_switch "wifi0_ext_c" "2.4GHz External Antenna C" "509" "1" - ucidef_add_gpio_switch "wifi0_int_c" "2.4GHz Internal Antenna C" "510" + ucidef_add_gpio_switch "wifi1_ext_a" "5GHz External Antenna A" "534" "1" + ucidef_add_gpio_switch "wifi1_int_a" "5GHz Internal Antenna A" "535" + ucidef_add_gpio_switch "wifi1_ext_b" "5GHz External Antenna B" "536" "1" + ucidef_add_gpio_switch "wifi1_int_b" "5GHz Internal Antenna B" "537" + ucidef_add_gpio_switch "wifi1_ext_c" "5GHz External Antenna C" "538" "1" + ucidef_add_gpio_switch "wifi1_int_c" "5GHz Internal Antenna C" "539" + ucidef_add_gpio_switch "wifi0_ext_a" "2.4GHz External Antenna A" "527" "1" + ucidef_add_gpio_switch "wifi0_int_a" "2.4GHz Internal Antenna A" "528" + ucidef_add_gpio_switch "wifi0_ext_b" "2.4GHz External Antenna B" "529" "1" + ucidef_add_gpio_switch "wifi0_int_b" "2.4GHz Internal Antenna B" "530" + ucidef_add_gpio_switch "wifi0_ext_c" "2.4GHz External Antenna C" "531" "1" + ucidef_add_gpio_switch "wifi0_int_c" "2.4GHz Internal Antenna C" "532" ;; asus,pl-ac56) - ucidef_add_gpio_switch "plc_enable" "PLC enable" "14" "1" + ucidef_add_gpio_switch "plc_enable" "PLC enable" "526" "1" ;; comfast,cf-e5|\ telco,t1) - ucidef_add_gpio_switch "lte_power" "LTE Power" "14" "1" - ucidef_add_gpio_switch "lte_wakeup" "LTE Wakeup" "11" "1" - ucidef_add_gpio_switch "lte_poweroff" "LTE Poweroff" "1" "1" - ucidef_add_gpio_switch "lte_reset" "LTE Reset" "12" "1" + ucidef_add_gpio_switch "lte_power" "LTE Power" "526" "1" + ucidef_add_gpio_switch "lte_wakeup" "LTE Wakeup" "523" "1" + ucidef_add_gpio_switch "lte_poweroff" "LTE Poweroff" "513" "1" + ucidef_add_gpio_switch "lte_reset" "LTE Reset" "524" "1" ;; devolo,dlan-pro-1200plus-ac) - ucidef_add_gpio_switch "plc_enable" "PLC enable" "13" "0" + ucidef_add_gpio_switch "plc_enable" "PLC enable" "525" "0" ;; devolo,magic-2-wifi) - ucidef_add_gpio_switch "plc_pairing" "PLC pairing" "11" "1" - ucidef_add_gpio_switch "plc_enable" "PLC enable" "13" "1" + ucidef_add_gpio_switch "plc_pairing" "PLC pairing" "523" "1" + ucidef_add_gpio_switch "plc_enable" "PLC enable" "525" "1" ;; dlink,dir-825-c1|\ dlink,dir-835-a1) - ucidef_add_gpio_switch "wan_led_auto" "WAN LED Auto" "20" "0" + ucidef_add_gpio_switch "wan_led_auto" "WAN LED Auto" "532" "0" ;; librerouter,librerouter-v1) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "1" "0" + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "513" "0" ;; teltonika,rut955) - ucidef_add_gpio_switch "sim_sel" "SIM select" "503" "1" - ucidef_add_gpio_switch "DOUT1" "DOUT1 (OC)" "504" "0" - ucidef_add_gpio_switch "DOUT2" "DOUT2 (Relay)" "505" "0" - ucidef_add_gpio_switch "modem_vbus" "Modem enable" "506" "1" - ucidef_add_gpio_switch "modem_rst" "Modem reset" "507" "0" - ucidef_add_gpio_switch "DOUT3" "DOUT3" "508" "0" + ucidef_add_gpio_switch "sim_sel" "SIM select" "542" "1" + ucidef_add_gpio_switch "DOUT1" "DOUT1 (OC)" "543" "0" + ucidef_add_gpio_switch "DOUT2" "DOUT2 (Relay)" "544" "0" + ucidef_add_gpio_switch "modem_vbus" "Modem enable" "545" "1" + ucidef_add_gpio_switch "modem_rst" "Modem reset" "546" "0" + ucidef_add_gpio_switch "DOUT3" "DOUT3" "547" "0" ;; teltonika,rut955-h7v3c0) - ucidef_add_gpio_switch "sim_sel" "SIM select" "503" "1" - ucidef_add_gpio_switch "DOUT1" "DOUT1 (OC)" "504" "0" - ucidef_add_gpio_switch "DOUT2" "DOUT2 (Relay)" "505" "0" - ucidef_add_gpio_switch "modem_vbus" "Modem enable" "508" "1" - ucidef_add_gpio_switch "modem_rst" "Modem reset" "509" "0" + ucidef_add_gpio_switch "sim_sel" "SIM select" "542" "1" + ucidef_add_gpio_switch "DOUT1" "DOUT1 (OC)" "543" "0" + ucidef_add_gpio_switch "DOUT2" "DOUT2 (Relay)" "544" "0" + ucidef_add_gpio_switch "modem_vbus" "Modem enable" "547" "1" + ucidef_add_gpio_switch "modem_rst" "Modem reset" "548" "0" ;; tplink,archer-c25-v1) - ucidef_add_gpio_switch "led_control" "LED control" "21" "0" - ucidef_add_gpio_switch "led_reset" "LED reset" "19" "1" + ucidef_add_gpio_switch "led_control" "LED control" "533" "0" + ucidef_add_gpio_switch "led_reset" "LED reset" "531" "1" ;; tplink,cpe210-v1|\ tplink,cpe220-v2|\ @@ -76,31 +76,31 @@ tplink,wbs210-v1|\ tplink,wbs210-v2|\ tplink,wbs510-v1|\ tplink,wbs510-v2) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20" + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "532" ;; ubnt,aircube-ac|\ ubnt,nanobeam-ac-gen2|\ ubnt,nanostation-ac) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "3" + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "515" ;; ubnt,aircube-isp) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "523" ;; ubnt,nanostation-m) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "8" + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "520" ;; ubnt,nanostation-m-xw) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "2" + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "514" ;; ubnt,uk-ultra) - ucidef_add_gpio_switch "ant0_internal" "ANT0 Internal" "5" "1" - ucidef_add_gpio_switch "ant1_internal" "ANT1 Internal" "6" "1" + ucidef_add_gpio_switch "ant0_internal" "ANT0 Internal" "517" "1" + ucidef_add_gpio_switch "ant1_internal" "ANT1 Internal" "518" "1" ;; zbtlink,zbt-wd323) - ucidef_add_gpio_switch "io0" "IO#0" "0" - ucidef_add_gpio_switch "io1" "IO#1" "1" - ucidef_add_gpio_switch "io2" "IO#2" "2" - ucidef_add_gpio_switch "io14" "IO#14" "14" + ucidef_add_gpio_switch "io0" "IO#0" "512" + ucidef_add_gpio_switch "io1" "IO#1" "513" + ucidef_add_gpio_switch "io2" "IO#2" "514" + ucidef_add_gpio_switch "io14" "IO#14" "526" ;; esac diff --git a/target/linux/ath79/nand/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/nand/base-files/etc/board.d/03_gpio_switches index 775778a2be..1fe83bc65c 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ath79/nand/base-files/etc/board.d/03_gpio_switches @@ -11,7 +11,7 @@ board=$(board_name) case "$board" in zte,mf286a|\ zte,mf286r) - ucidef_add_gpio_switch "power_btn_block" "Power button blocker" "20" "0" + ucidef_add_gpio_switch "power_btn_block" "Power button blocker" "532" "0" ;; esac diff --git a/target/linux/ath79/patches-6.6/001-v6.11-gpio-ath79-convert-to-dynamic-GPIO-base-allocation.patch b/target/linux/ath79/patches-6.6/001-v6.11-gpio-ath79-convert-to-dynamic-GPIO-base-allocation.patch new file mode 100644 index 0000000000..4222639d4d --- /dev/null +++ b/target/linux/ath79/patches-6.6/001-v6.11-gpio-ath79-convert-to-dynamic-GPIO-base-allocation.patch @@ -0,0 +1,32 @@ +From 9a473c2a093e0d1c466bf86073230e2c8b658977 Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Wed, 26 Jun 2024 08:33:18 +0800 +Subject: gpio: ath79: convert to dynamic GPIO base allocation + +ath79 target has already been converted to device tree based platform. +Use dynamic GPIO numberspace base to suppress the warning: + +gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation. + +Tested on Atheros AR7241 and AR9344. + +Signed-off-by: Shiji Yang +Suggested-by: Jonas Gorski +Link: https://lore.kernel.org/r/TYCP286MB089598EA71E964BD8AB9EFD3BCD62@TYCP286MB0895.JPNP286.PROD.OUTLOOK.COM +[Bartosz: tweaked the commit message] +Signed-off-by: Bartosz Golaszewski +--- + drivers/gpio/gpio-ath79.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/gpio/gpio-ath79.c ++++ b/drivers/gpio/gpio-ath79.c +@@ -273,8 +273,6 @@ static int ath79_gpio_probe(struct platf + dev_err(dev, "bgpio_init failed\n"); + return err; + } +- /* Use base 0 to stay compatible with legacy platforms */ +- ctrl->gc.base = 0; + + /* Optional interrupt setup */ + if (!np || of_property_read_bool(np, "interrupt-controller")) { diff --git a/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index 8ff54e98f8..a64754310d 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1404,6 +1407,9 @@ +@@ -1405,6 +1408,9 @@ #define USB_VENDOR_ID_XIAOMI 0x2717 #define USB_DEVICE_ID_MI_SILENT_MOUSE 0x5014 diff --git a/target/linux/bcm27xx/patches-6.6/950-0967-dmaengine-dw-axi-dmac-Fix-a-non-atomic-update.patch b/target/linux/bcm27xx/patches-6.6/950-0967-dmaengine-dw-axi-dmac-Fix-a-non-atomic-update.patch index 8be04170e3..ac6a07f16e 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0967-dmaengine-dw-axi-dmac-Fix-a-non-atomic-update.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0967-dmaengine-dw-axi-dmac-Fix-a-non-atomic-update.patch @@ -30,7 +30,7 @@ Signed-off-by: Phil Elwell --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c -@@ -465,8 +465,6 @@ static void axi_chan_block_xfer_start(st +@@ -389,8 +389,6 @@ static void axi_chan_block_xfer_start(st return; } diff --git a/target/linux/bcm27xx/patches-6.6/950-0986-Revert-net-usb-ax88179_178a-avoid-two-consecutive-de.patch b/target/linux/bcm27xx/patches-6.6/950-0986-Revert-net-usb-ax88179_178a-avoid-two-consecutive-de.patch index 29ba36f7a0..518aab3fa4 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0986-Revert-net-usb-ax88179_178a-avoid-two-consecutive-de.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0986-Revert-net-usb-ax88179_178a-avoid-two-consecutive-de.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c -@@ -1320,6 +1320,8 @@ static int ax88179_bind(struct usbnet *d +@@ -1319,6 +1319,8 @@ static int ax88179_bind(struct usbnet *d ax88179_reset(dev); diff --git a/target/linux/bcm27xx/patches-6.6/950-1047-dw-axi-dmac-platform-Avoid-trampling-with-zero-lengt.patch b/target/linux/bcm27xx/patches-6.6/950-1047-dw-axi-dmac-platform-Avoid-trampling-with-zero-lengt.patch index 36d5b7cf1d..d7d4ca6172 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1047-dw-axi-dmac-platform-Avoid-trampling-with-zero-lengt.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1047-dw-axi-dmac-platform-Avoid-trampling-with-zero-lengt.patch @@ -22,7 +22,7 @@ Signed-off-by: Dom Cobley --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c -@@ -916,6 +916,9 @@ dw_axi_dma_chan_prep_slave_sg(struct dma +@@ -834,6 +834,9 @@ dw_axi_dma_chan_prep_slave_sg(struct dma mem = sg_dma_address(sg); len = sg_dma_len(sg); num_segments = DIV_ROUND_UP(sg_dma_len(sg), axi_block_len); diff --git a/target/linux/bcm27xx/patches-6.6/950-1133-drivers-mmc-sdhci-brcmstb-improve-bcm2712-card-remov.patch b/target/linux/bcm27xx/patches-6.6/950-1133-drivers-mmc-sdhci-brcmstb-improve-bcm2712-card-remov.patch new file mode 100644 index 0000000000..f521711977 --- /dev/null +++ b/target/linux/bcm27xx/patches-6.6/950-1133-drivers-mmc-sdhci-brcmstb-improve-bcm2712-card-remov.patch @@ -0,0 +1,52 @@ +From 5c0f94088e0694220a2f0d8ad6e8216b50a80f2e Mon Sep 17 00:00:00 2001 +From: Jonathan Bell +Date: Thu, 13 Jun 2024 15:01:02 +0100 +Subject: [PATCH 1133/1145] drivers: mmc: sdhci-brcmstb: improve bcm2712 card + removal handling + +If the controller is being reset, then the CQE needs to be reset as well. + +For removable cards, CQHCI_SSC1 must specify a polling mode (CBC=0) +otherwise it's possible that the controller stops emitting periodic +CMD13s on card removal, without raising an error status interrupt. + +Signed-off-by: Jonathan Bell +--- + drivers/mmc/host/sdhci-brcmstb.c | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +--- a/drivers/mmc/host/sdhci-brcmstb.c ++++ b/drivers/mmc/host/sdhci-brcmstb.c +@@ -365,8 +365,21 @@ static void sdhci_brcmstb_cqe_enable(str + + sdhci_cqe_enable(mmc); + +- /* Reset CMD13 polling timer back to eMMC specification default */ +- cqhci_writel(cq_host, 0x00011000, CQHCI_SSC1); ++ /* ++ * The controller resets this register to a very short default interval ++ * whenever CQHCI is disabled. ++ * ++ * For removable cards CBC needs to be clear or card removal can hang ++ * the CQE. In polling mode, a CIT of 0x4000 "cycles" seems to produce the best ++ * throughput. ++ * ++ * For nonremovable cards, the specification default of CBC=1 CIT=0x1000 ++ * suffices. ++ */ ++ if (mmc->caps & MMC_CAP_NONREMOVABLE) ++ cqhci_writel(cq_host, 0x00011000, CQHCI_SSC1); ++ else ++ cqhci_writel(cq_host, 0x00004000, CQHCI_SSC1); + } + + static const struct cqhci_host_ops sdhci_brcmstb_cqhci_ops = { +@@ -386,7 +399,7 @@ static struct sdhci_ops sdhci_brcmstb_op + .set_clock = sdhci_bcm2712_set_clock, + .set_power = sdhci_brcmstb_set_power, + .set_bus_width = sdhci_set_bus_width, +- .reset = sdhci_reset, ++ .reset = brcmstb_reset, + .set_uhs_signaling = sdhci_set_uhs_signaling, + .init_sd_express = bcm2712_init_sd_express, + }; diff --git a/target/linux/bcm27xx/patches-6.6/950-1136-feat-Add-support-for-SunFounder-PiPower-3-overlay.patch b/target/linux/bcm27xx/patches-6.6/950-1136-feat-Add-support-for-SunFounder-PiPower-3-overlay.patch new file mode 100644 index 0000000000..45b94b7f17 --- /dev/null +++ b/target/linux/bcm27xx/patches-6.6/950-1136-feat-Add-support-for-SunFounder-PiPower-3-overlay.patch @@ -0,0 +1,193 @@ +From a1d3defcca200077e1e382fe049ca613d16efd2b Mon Sep 17 00:00:00 2001 +From: Cavon Lee +Date: Tue, 18 Jun 2024 14:01:23 +0800 +Subject: [PATCH 1136/1145] feat: Add support for SunFounder PiPower 3 overlay + fix: Fix wrong Pironman 5 ir default pin number fix: Change space indentation + to tab + +Signed-off-by: Cavon Lee +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 8 +- + .../overlays/sunfounder-pipower3-overlay.dts | 44 ++++++++++ + .../overlays/sunfounder-pironman5-overlay.dts | 88 ++++++++++--------- + 4 files changed, 98 insertions(+), 43 deletions(-) + create mode 100644 arch/arm/boot/dts/overlays/sunfounder-pipower3-overlay.dts + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -275,6 +275,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + ssd1306-spi.dtbo \ + ssd1331-spi.dtbo \ + ssd1351-spi.dtbo \ ++ sunfounder-pipower3.dtbo \ + sunfounder-pironman5.dtbo \ + superaudioboard.dtbo \ + sx150x.dtbo \ +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -4695,11 +4695,17 @@ Params: speed SPI bus + reset_pin GPIO pin for RESET (default 25) + + ++Name: sunfounder-pipower3 ++Info: Overlay for SunFounder PiPower 3 ++Load: dtoverlay=sunfounder-pipower3,= ++Params: poweroff_pin Change poweroff pin (default 26) ++ ++ + Name: sunfounder-pironman5 + Info: Overlay for SunFounder Pironman 5 + Load: dtoverlay=sunfounder-pironman5,= + Params: ir Enable IR or not (on or off, default on) +- ir_pins Change IR receiver pin (default 12) ++ ir_pins Change IR receiver pin (default 13) + + + Name: superaudioboard +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/sunfounder-pipower3-overlay.dts +@@ -0,0 +1,44 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target-path = "/chosen"; ++ __overlay__ { ++ power: power { ++ hat_current_supply = <5000>; ++ }; ++ }; ++ }; ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ fragment@2 { ++ target-path = "/"; ++ __overlay__ { ++ power_ctrl: power_ctrl { ++ compatible = "gpio-poweroff"; ++ gpios = <&gpio 26 0>; ++ force; ++ }; ++ }; ++ }; ++ fragment@3 { ++ target = <&gpio>; ++ __overlay__ { ++ power_ctrl_pins: power_ctrl_pins { ++ brcm,pins = <26>; ++ brcm,function = <1>; // out ++ }; ++ }; ++ }; ++ __overrides__ { ++ poweroff_pin = <&power_ctrl>,"gpios:4", ++ <&power_ctrl_pins>,"brcm,pins:0"; ++ }; ++}; +--- a/arch/arm/boot/dts/overlays/sunfounder-pironman5-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sunfounder-pironman5-overlay.dts +@@ -2,50 +2,54 @@ + /plugin/; + + / { +- compatible = "brcm,bcm2835"; ++ compatible = "brcm,bcm2835"; + +- fragment@0 { +- target = <&i2c1>; +- __overlay__ { +- status = "okay"; +- }; +- }; +- fragment@1 { +- target = <&spi0>; +- __overlay__ { +- status = "okay"; +- }; +- }; +- fragment@2 { +- target-path = "/"; +- __overlay__ { +- gpio_ir: ir-receiver@c { +- compatible = "gpio-ir-receiver"; +- pinctrl-names = "default"; +- pinctrl-0 = <&gpio_ir_pins>; ++ fragment@0 { ++ target = <&i2c1>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ fragment@1 { ++ target = <&spi0>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ fragment@2 { ++ target-path = "/"; ++ __overlay__ { ++ gpio_ir: ir-receiver@d { ++ compatible = "gpio-ir-receiver"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gpio_ir_pins>; + +- // pin number, high or low +- gpios = <&gpio 12 1>; ++ // pin number, high or low ++ gpios = <&gpio 13 1>; + +- // parameter for keymap name +- linux,rc-map-name = "rc-rc6-mce"; ++ // parameter for keymap name ++ linux,rc-map-name = "rc-rc6-mce"; + +- status = "okay"; +- }; +- }; +- }; +- fragment@3 { +- target = <&gpio>; +- __overlay__ { +- gpio_ir_pins: gpio_ir_pins@c { +- brcm,pins = <12>; +- brcm,function = <0>; +- brcm,pull = <2>; +- }; +- }; +- }; +- __overrides__ { +- ir = <&gpio_ir>,"status"; +- ir_pins = <&gpio_ir>,"gpios:4", <&gpio_ir>,"reg:0", <&gpio_ir_pins>,"brcm,pins:0", <&gpio_ir_pins>,"reg:0"; +- }; ++ status = "okay"; ++ }; ++ }; ++ }; ++ fragment@3 { ++ target = <&gpio>; ++ __overlay__ { ++ gpio_ir_pins: gpio_ir_pins@d { ++ brcm,pins = <13>; ++ brcm,function = <0>; ++ brcm,pull = <2>; ++ }; ++ }; ++ }; ++ __overrides__ { ++ ir = <&gpio_ir>,"status"; ++ ir_pins = ++ <&gpio_ir>,"gpios:4", ++ <&gpio_ir>,"reg:0", ++ <&gpio_ir_pins>,"brcm,pins:0", ++ <&gpio_ir_pins>,"reg:0"; ++ }; + }; diff --git a/target/linux/bcm27xx/patches-6.6/950-1137-pwm-gpio-pwm-follow-pwm_apply_might_sleep-rename.patch b/target/linux/bcm27xx/patches-6.6/950-1137-pwm-gpio-pwm-follow-pwm_apply_might_sleep-rename.patch new file mode 100644 index 0000000000..b763006154 --- /dev/null +++ b/target/linux/bcm27xx/patches-6.6/950-1137-pwm-gpio-pwm-follow-pwm_apply_might_sleep-rename.patch @@ -0,0 +1,32 @@ +From cd92a9591833ea06d1f12391f6b027fcecf436a9 Mon Sep 17 00:00:00 2001 +From: Ratchanan Srirattanamet +Date: Tue, 18 Jun 2024 15:44:13 +0700 +Subject: [PATCH 1137/1145] pwm: gpio-pwm: follow pwm_apply_might_sleep() + rename + +Fixes: 03286093be68("drivers/gpio: Add a driver that wraps the PWM API as a GPIO controller") +Signed-off-by: Ratchanan Srirattanamet +--- + drivers/gpio/gpio-pwm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpio/gpio-pwm.c ++++ b/drivers/gpio/gpio-pwm.c +@@ -34,7 +34,7 @@ static void pwm_gpio_set(struct gpio_chi + + pwm_get_state(pwm_gpio->pwm[off], &state); + state.duty_cycle = val ? state.period : 0; +- pwm_apply_state(pwm_gpio->pwm[off], &state); ++ pwm_apply_might_sleep(pwm_gpio->pwm[off], &state); + } + + static int pwm_gpio_parse_dt(struct pwm_gpio *pwm_gpio, +@@ -79,7 +79,7 @@ static int pwm_gpio_parse_dt(struct pwm_ + pwm_init_state(pwm_gpio->pwm[i], &state); + + state.duty_cycle = 0; +- pwm_apply_state(pwm_gpio->pwm[i], &state); ++ pwm_apply_might_sleep(pwm_gpio->pwm[i], &state); + } + + pwm_gpio->gc.ngpio = num_gpios; diff --git a/target/linux/bcm27xx/patches-6.6/950-1138-drm-bridge-panel-Ensure-backlight-is-reachable.patch b/target/linux/bcm27xx/patches-6.6/950-1138-drm-bridge-panel-Ensure-backlight-is-reachable.patch new file mode 100644 index 0000000000..b19941bc8a --- /dev/null +++ b/target/linux/bcm27xx/patches-6.6/950-1138-drm-bridge-panel-Ensure-backlight-is-reachable.patch @@ -0,0 +1,29 @@ +From da87f91ad8450ccc5274cd7b6ba8d823b396c96f Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 18 Jun 2024 15:33:30 +0100 +Subject: [PATCH 1138/1145] drm/bridge: panel: Ensure backlight is reachable + +Ensure that the various options of modules vs builtin results +in being able to call into the backlight code. + +https://github.com/raspberrypi/linux/issues/6198 + +Fixes: 573f8fd0abf1 ("drm/bridge: panel: Name an associated backlight device") +Signed-off-by: Dave Stevenson +--- + drivers/gpu/drm/bridge/panel.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/gpu/drm/bridge/panel.c ++++ b/drivers/gpu/drm/bridge/panel.c +@@ -87,8 +87,10 @@ static int panel_bridge_attach(struct dr + drm_connector_attach_encoder(&panel_bridge->connector, + bridge->encoder); + ++#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE) + backlight_set_display_name(panel_bridge->panel->backlight, + panel_bridge->connector.name); ++#endif + + if (bridge->dev->registered) { + if (connector->funcs->reset) diff --git a/target/linux/bcm27xx/patches-6.6/950-1141-fs-ntfs3-Fix-memory-corruption-when-page_size-change.patch b/target/linux/bcm27xx/patches-6.6/950-1141-fs-ntfs3-Fix-memory-corruption-when-page_size-change.patch new file mode 100644 index 0000000000..113b3fdf53 --- /dev/null +++ b/target/linux/bcm27xx/patches-6.6/950-1141-fs-ntfs3-Fix-memory-corruption-when-page_size-change.patch @@ -0,0 +1,36 @@ +From 7af85d54e39733bb9a236b95ea5ed1ab8277d560 Mon Sep 17 00:00:00 2001 +From: Dom Cobley +Date: Tue, 11 Jun 2024 16:12:47 +0100 +Subject: [PATCH 1141/1145] fs/ntfs3: Fix memory corruption when page_size + changes + +The rework in fs/ntfs3: Reduce stack usage +changes log->page_size but doesn't change the associated +log->page_mask and log->page_bits. + +That results in the bytes value in read_log_page +getting a negative value, which is bad when it is +passed to memcpy. + +The kernel panic can be observed when connecting an +ntfs formatted drive that has previously been connected +to a Windows machine to a Raspberry Pi 5, which by defauilt +uses a 16K kernel pagesize. + +Fixes: 865e7a7700d9 ("fs/ntfs3: Reduce stack usage") +Signed-off-by: Dom Cobley +--- + fs/ntfs3/fslog.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/ntfs3/fslog.c ++++ b/fs/ntfs3/fslog.c +@@ -3907,6 +3907,8 @@ check_restart_area: + log->l_size = log->orig_file_size; + log->page_size = norm_file_page(t32, &log->l_size, + t32 == DefaultLogPageSize); ++ log->page_mask = log->page_size - 1; ++ log->page_bits = blksize_bits(log->page_size); + } + + if (log->page_size != t32 || diff --git a/target/linux/bcm27xx/patches-6.6/950-1142-fixup-drivers-mmc-sdhci-brcmstb-bcm2712-supports-HS4.patch b/target/linux/bcm27xx/patches-6.6/950-1142-fixup-drivers-mmc-sdhci-brcmstb-bcm2712-supports-HS4.patch new file mode 100644 index 0000000000..fb08ba1ad5 --- /dev/null +++ b/target/linux/bcm27xx/patches-6.6/950-1142-fixup-drivers-mmc-sdhci-brcmstb-bcm2712-supports-HS4.patch @@ -0,0 +1,26 @@ +From d2813c02131b9ddf938277f4123da7ccbd113ea7 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 24 Jun 2024 22:35:42 +0100 +Subject: [PATCH 1142/1145] fixup! drivers: mmc: sdhci-brcmstb: bcm2712 + supports HS400es and clock gating + +Declaring auto-clockgate support for a host that can interface with +SDIO cards is a bug. + +See: https://github.com/raspberrypi/linux/issues/6237 + +Signed-off-by: Phil Elwell +--- + drivers/mmc/host/sdhci-brcmstb.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/mmc/host/sdhci-brcmstb.c ++++ b/drivers/mmc/host/sdhci-brcmstb.c +@@ -429,7 +429,6 @@ static const struct brcmstb_match_priv m + }; + + static const struct brcmstb_match_priv match_priv_2712 = { +- .flags = BRCMSTB_MATCH_FLAGS_HAS_CLOCK_GATE, + .hs400es = sdhci_brcmstb_hs400es, + .cfginit = sdhci_brcmstb_cfginit_2712, + .ops = &sdhci_brcmstb_ops_2712, diff --git a/target/linux/bcm27xx/patches-6.6/950-0536-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch b/target/linux/bcm27xx/patches-6.6/950-1144-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch similarity index 85% rename from target/linux/bcm27xx/patches-6.6/950-0536-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch rename to target/linux/bcm27xx/patches-6.6/950-1144-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch index 47da512954..ad364196e9 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0536-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1144-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch @@ -1,7 +1,7 @@ -From c6cd3e6878e32548ea90c4160c534e952221c194 Mon Sep 17 00:00:00 2001 +From 3b42260d2130b5ca110c5340ab2bd055eede5968 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 28 Apr 2021 17:46:01 +0100 -Subject: [PATCH 0536/1085] dmaengine: dw-axi-dmac: Fixes for RP1 +Subject: [PATCH 1144/1145] dmaengine: dw-axi-dmac: Fixes for RP1 Don't assume that DMA addresses of devices are the same as their physical addresses - convert correctly. @@ -42,9 +42,9 @@ to the source register width. Signed-off-by: Phil Elwell --- - .../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 132 +++++++++++++++--- + .../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 136 +++++++++++++++--- drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 1 + - 2 files changed, 113 insertions(+), 20 deletions(-) + 2 files changed, 116 insertions(+), 21 deletions(-) --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c @@ -93,16 +93,24 @@ Signed-off-by: Phil Elwell for (i = 0; i < chip->dw->hdata->nr_channels; i++) { axi_chan_irq_disable(&chip->dw->chan[i], DWAXIDMAC_IRQ_ALL); axi_chan_disable(&chip->dw->chan[i]); -@@ -282,7 +305,7 @@ static struct axi_dma_lli *axi_desc_get( +@@ -256,7 +279,6 @@ static struct axi_dma_desc *axi_desc_all + kfree(desc); + return NULL; + } +- desc->nr_hw_descs = num; + + return desc; + } +@@ -283,7 +305,7 @@ static struct axi_dma_lli *axi_desc_get( static void axi_desc_put(struct axi_dma_desc *desc) { struct axi_dma_chan *chan = desc->chan; -- int count = atomic_read(&chan->descs_allocated); +- int count = desc->nr_hw_descs; + u32 count = desc->hw_desc_count; struct axi_dma_hw_desc *hw_desc; int descs_put; -@@ -304,6 +327,48 @@ static void vchan_desc_put(struct virt_d +@@ -305,6 +327,48 @@ static void vchan_desc_put(struct virt_d axi_desc_put(vd_to_axi_desc(vdesc)); } @@ -151,7 +159,7 @@ Signed-off-by: Phil Elwell static enum dma_status dma_chan_tx_status(struct dma_chan *dchan, dma_cookie_t cookie, struct dma_tx_state *txstate) -@@ -313,10 +378,7 @@ dma_chan_tx_status(struct dma_chan *dcha +@@ -314,10 +378,7 @@ dma_chan_tx_status(struct dma_chan *dcha enum dma_status status; u32 completed_length; unsigned long flags; @@ -162,7 +170,7 @@ Signed-off-by: Phil Elwell status = dma_cookie_status(dchan, cookie, txstate); if (status == DMA_COMPLETE || !txstate) -@@ -325,16 +387,31 @@ dma_chan_tx_status(struct dma_chan *dcha +@@ -326,16 +387,31 @@ dma_chan_tx_status(struct dma_chan *dcha spin_lock_irqsave(&chan->vc.lock, flags); vdesc = vchan_find_desc(&chan->vc, cookie); @@ -201,7 +209,7 @@ Signed-off-by: Phil Elwell return status; } -@@ -522,7 +599,7 @@ static void dw_axi_dma_set_hw_channel(st +@@ -521,7 +597,7 @@ static void dw_axi_dma_set_hw_channel(st unsigned long reg_value, val; if (!chip->apb_regs) { @@ -210,7 +218,7 @@ Signed-off-by: Phil Elwell return; } -@@ -626,18 +703,25 @@ static int dw_axi_dma_set_hw_desc(struct +@@ -625,18 +701,25 @@ static int dw_axi_dma_set_hw_desc(struct switch (chan->direction) { case DMA_MEM_TO_DEV: reg_width = __ffs(chan->config.dst_addr_width); @@ -238,7 +246,7 @@ Signed-off-by: Phil Elwell DWAXIDMAC_CH_CTL_L_INC << CH_CTL_L_DST_INC_POS | DWAXIDMAC_CH_CTL_L_NOINC << CH_CTL_L_SRC_INC_POS; block_ts = len >> reg_width; -@@ -673,9 +757,6 @@ static int dw_axi_dma_set_hw_desc(struct +@@ -672,9 +755,6 @@ static int dw_axi_dma_set_hw_desc(struct } hw_desc->lli->block_ts_lo = cpu_to_le32(block_ts - 1); @@ -248,7 +256,7 @@ Signed-off-by: Phil Elwell hw_desc->lli->ctl_lo = cpu_to_le32(ctllo); set_desc_src_master(hw_desc); -@@ -770,6 +851,8 @@ dw_axi_dma_chan_prep_cyclic(struct dma_c +@@ -769,6 +849,8 @@ dw_axi_dma_chan_prep_cyclic(struct dma_c src_addr += segment_len; } @@ -257,7 +265,7 @@ Signed-off-by: Phil Elwell llp = desc->hw_desc[0].llp; /* Managed transfer list */ -@@ -849,6 +932,8 @@ dw_axi_dma_chan_prep_slave_sg(struct dma +@@ -851,6 +933,8 @@ dw_axi_dma_chan_prep_slave_sg(struct dma } while (len >= segment_len); } @@ -266,7 +274,7 @@ Signed-off-by: Phil Elwell /* Set end-of-link to the last link descriptor of list */ set_desc_last(&desc->hw_desc[num_sgs - 1]); -@@ -956,6 +1041,8 @@ dma_chan_prep_dma_memcpy(struct dma_chan +@@ -958,6 +1042,8 @@ dma_chan_prep_dma_memcpy(struct dma_chan num++; } @@ -275,7 +283,7 @@ Signed-off-by: Phil Elwell /* Set end-of-link to the last link descriptor of list */ set_desc_last(&desc->hw_desc[num - 1]); /* Managed transfer list */ -@@ -1004,7 +1091,7 @@ static void axi_chan_dump_lli(struct axi +@@ -1006,7 +1092,7 @@ static void axi_chan_dump_lli(struct axi static void axi_chan_list_dump_lli(struct axi_dma_chan *chan, struct axi_dma_desc *desc_head) { @@ -284,7 +292,7 @@ Signed-off-by: Phil Elwell int i; for (i = 0; i < count; i++) -@@ -1047,11 +1134,11 @@ out: +@@ -1049,11 +1135,11 @@ out: static void axi_chan_block_xfer_complete(struct axi_dma_chan *chan) { @@ -297,7 +305,7 @@ Signed-off-by: Phil Elwell u64 llp; int i; -@@ -1073,6 +1160,7 @@ static void axi_chan_block_xfer_complete +@@ -1075,6 +1161,7 @@ static void axi_chan_block_xfer_complete if (chan->cyclic) { desc = vd_to_axi_desc(vd); if (desc) { @@ -305,7 +313,17 @@ Signed-off-by: Phil Elwell llp = lo_hi_readq(chan->chan_regs + CH_LLP); for (i = 0; i < count; i++) { hw_desc = &desc->hw_desc[i]; -@@ -1325,6 +1413,10 @@ static int parse_device_properties(struc +@@ -1095,6 +1182,9 @@ static void axi_chan_block_xfer_complete + /* Remove the completed descriptor from issued list before completing */ + list_del(&vd->node); + vchan_cookie_complete(vd); ++ ++ /* Submit queued descriptors after processing the completed ones */ ++ axi_chan_start_first_queued(chan); + } + + out: +@@ -1324,6 +1414,10 @@ static int parse_device_properties(struc chip->dw->hdata->nr_masters = tmp; diff --git a/target/linux/bcm27xx/patches-6.6/950-1145-fixup-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch b/target/linux/bcm27xx/patches-6.6/950-1145-fixup-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch new file mode 100644 index 0000000000..adefd4ab54 --- /dev/null +++ b/target/linux/bcm27xx/patches-6.6/950-1145-fixup-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch @@ -0,0 +1,89 @@ +From 769634f344626ed73bcda14c91b567067974d7b2 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Sat, 29 Jun 2024 09:30:23 +0100 +Subject: [PATCH 1145/1145] fixup! dmaengine: dw-axi-dmac: Fixes for RP1 + +nr_hw_descs is the upstream version of what count_hw_descs, so make +(more) use of it instead. + +Signed-off-by: Phil Elwell +--- + drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 14 +++++++------- + drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 1 - + 2 files changed, 7 insertions(+), 8 deletions(-) + +--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c ++++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +@@ -305,7 +305,7 @@ static struct axi_dma_lli *axi_desc_get( + static void axi_desc_put(struct axi_dma_desc *desc) + { + struct axi_dma_chan *chan = desc->chan; +- u32 count = desc->hw_desc_count; ++ int count = desc->nr_hw_descs; + struct axi_dma_hw_desc *hw_desc; + int descs_put; + +@@ -849,7 +849,7 @@ dw_axi_dma_chan_prep_cyclic(struct dma_c + src_addr += segment_len; + } + +- desc->hw_desc_count = total_segments; ++ desc->nr_hw_descs = total_segments; + + llp = desc->hw_desc[0].llp; + +@@ -933,7 +933,7 @@ dw_axi_dma_chan_prep_slave_sg(struct dma + } while (len >= segment_len); + } + +- desc->hw_desc_count = loop; ++ desc->nr_hw_descs = loop; + + /* Set end-of-link to the last link descriptor of list */ + set_desc_last(&desc->hw_desc[num_sgs - 1]); +@@ -1042,7 +1042,7 @@ dma_chan_prep_dma_memcpy(struct dma_chan + num++; + } + +- desc->hw_desc_count = num; ++ desc->nr_hw_descs = num; + + /* Set end-of-link to the last link descriptor of list */ + set_desc_last(&desc->hw_desc[num - 1]); +@@ -1092,7 +1092,7 @@ static void axi_chan_dump_lli(struct axi + static void axi_chan_list_dump_lli(struct axi_dma_chan *chan, + struct axi_dma_desc *desc_head) + { +- u32 count = desc_head->hw_desc_count; ++ int count = desc_head->nr_hw_descs; + int i; + + for (i = 0; i < count; i++) +@@ -1139,7 +1139,7 @@ static void axi_chan_block_xfer_complete + struct axi_dma_desc *desc; + struct virt_dma_desc *vd; + unsigned long flags; +- u32 count; ++ int count; + u64 llp; + int i; + +@@ -1161,7 +1161,7 @@ static void axi_chan_block_xfer_complete + if (chan->cyclic) { + desc = vd_to_axi_desc(vd); + if (desc) { +- count = desc->hw_desc_count; ++ count = desc->nr_hw_descs; + llp = lo_hi_readq(chan->chan_regs + CH_LLP); + for (i = 0; i < count; i++) { + hw_desc = &desc->hw_desc[i]; +--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac.h ++++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h +@@ -101,7 +101,6 @@ struct axi_dma_desc { + + struct virt_dma_desc vd; + struct axi_dma_chan *chan; +- u32 hw_desc_count; + u32 completed_blocks; + u32 length; + u32 period_len; diff --git a/target/linux/bcm47xx/Makefile b/target/linux/bcm47xx/Makefile index 325a207d08..428fa75e70 100644 --- a/target/linux/bcm47xx/Makefile +++ b/target/linux/bcm47xx/Makefile @@ -10,8 +10,7 @@ BOARDNAME:=Broadcom BCM47xx/53xx (MIPS) FEATURES:=squashfs usb SUBTARGETS:=generic mips74k legacy -KERNEL_PATCHVER:=6.1 -KERNEL_TESTING_PATCHVER:=6.6 +KERNEL_PATCHVER:=6.6 define Target/Description Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS CPU, *not* ARM. diff --git a/target/linux/bcm47xx/config-6.1 b/target/linux/bcm47xx/config-6.1 deleted file mode 100644 index d86e79d98b..0000000000 --- a/target/linux/bcm47xx/config-6.1 +++ /dev/null @@ -1,190 +0,0 @@ -CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_KEEP_MEMBLOCK=y -CONFIG_ARCH_MMAP_RND_BITS_MAX=15 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_BCM47XX=y -CONFIG_BCM47XX_BCMA=y -CONFIG_BCM47XX_NVRAM=y -CONFIG_BCM47XX_SPROM=y -CONFIG_BCM47XX_SSB=y -CONFIG_BCM47XX_WDT=y -CONFIG_BCMA=y -CONFIG_BCMA_BLOCKIO=y -CONFIG_BCMA_DEBUG=y -CONFIG_BCMA_DRIVER_GMAC_CMN=y -CONFIG_BCMA_DRIVER_GPIO=y -CONFIG_BCMA_DRIVER_MIPS=y -CONFIG_BCMA_DRIVER_PCI=y -CONFIG_BCMA_DRIVER_PCI_HOSTMODE=y -CONFIG_BCMA_FALLBACK_SPROM=y -CONFIG_BCMA_HOST_PCI=y -CONFIG_BCMA_HOST_PCI_POSSIBLE=y -CONFIG_BCMA_HOST_SOC=y -CONFIG_BCMA_NFLASH=y -CONFIG_BCMA_PFLASH=y -CONFIG_BCMA_SFLASH=y -# CONFIG_BGMAC_BCMA is not set -CONFIG_BLK_MQ_PCI=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y -CONFIG_CEVT_R4K=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_CMDLINE="noinitrd console=ttyS0,115200" -CONFIG_CMDLINE_BOOL=y -# CONFIG_CMDLINE_OVERRIDE is not set -# CONFIG_COMMON_CLK is not set -CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 -CONFIG_COMPAT_32BIT_TIME=y -# CONFIG_CPU_BMIPS is not set -CONFIG_CPU_GENERIC_DUMP_TLB=y -CONFIG_CPU_HAS_PREFETCH=y -CONFIG_CPU_HAS_SYNC=y -CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_CPU_MIPS32=y -CONFIG_CPU_MIPS32_R1=y -# CONFIG_CPU_MIPS32_R2 is not set -CONFIG_CPU_MIPSR1=y -CONFIG_CPU_MIPSR2_IRQ_VI=y -CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y -CONFIG_CPU_R4K_CACHE_TLB=y -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y -CONFIG_CPU_SUPPORTS_HIGHMEM=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2 -CONFIG_CRYPTO_LIB_SHA1=y -CONFIG_CRYPTO_LIB_UTILS=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CSRC_R4K=y -CONFIG_DEBUG_INFO=y -CONFIG_DMA_NONCOHERENT=y -# CONFIG_EARLY_PRINTK is not set -CONFIG_EXCLUSIVE_SYSTEM_RAM=y -CONFIG_FIXED_PHY=y -CONFIG_FW_LOADER_PAGED_BUF=y -CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y -CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y -CONFIG_GENERIC_ATOMIC64=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_GETTIMEOFDAY=y -CONFIG_GENERIC_IOMAP=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_LIB_ASHLDI3=y -CONFIG_GENERIC_LIB_ASHRDI3=y -CONFIG_GENERIC_LIB_CMPDI2=y -CONFIG_GENERIC_LIB_LSHRDI3=y -CONFIG_GENERIC_LIB_UCMPDI2=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_CDEV=y -CONFIG_GPIO_WDT=y -CONFIG_HARDWARE_WATCHPOINTS=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HW_RANDOM=y -CONFIG_HZ_PERIODIC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_MIPS_CPU=y -CONFIG_IRQ_WORK=y -CONFIG_LEDS_GPIO_REGISTER=y -CONFIG_LOCK_DEBUGGING_SUPPORT=y -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MDIO_DEVRES=y -CONFIG_MEMFD_CREATE=y -CONFIG_MIGRATION=y -CONFIG_MIPS=y -CONFIG_MIPS_ASID_BITS=8 -CONFIG_MIPS_ASID_SHIFT=0 -CONFIG_MIPS_CLOCK_VSYSCALL=y -# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set -CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y -CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_MIPS_LD_CAN_LINK_VDSO=y -CONFIG_MODULES_USE_ELF_REL=y -CONFIG_MTD_BCM47XXSFLASH=y -CONFIG_MTD_BCM47XX_PARTS=y -CONFIG_MTD_NAND_BCM47XXNFLASH=y -CONFIG_MTD_NAND_BRCMNAND=y -CONFIG_MTD_NAND_BRCMNAND_BCMA=y -CONFIG_MTD_NAND_CORE=y -CONFIG_MTD_NAND_ECC=y -CONFIG_MTD_PARSER_TRX=y -CONFIG_MTD_PHYSMAP=y -CONFIG_MTD_RAW_NAND=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEED_PER_CPU_KM=y -CONFIG_NET_SELFTESTS=y -CONFIG_NO_EXCEPT_FILL=y -CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y -# CONFIG_OF is not set -CONFIG_PAGE_POOL=y -CONFIG_PAGE_SIZE_LESS_THAN_256KB=y -CONFIG_PAGE_SIZE_LESS_THAN_64KB=y -CONFIG_PCI=y -CONFIG_PCI_DISABLE_COMMON_QUIRKS=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_DRIVERS_LEGACY=y -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_PHYLIB=y -CONFIG_PREEMPT_NONE_BUILD=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -CONFIG_RANDSTRUCT_NONE=y -CONFIG_SERIAL_8250_EXTENDED=y -CONFIG_SERIAL_8250_SHARE_IRQ=y -CONFIG_SERIAL_MCTRL_GPIO=y -CONFIG_SRCU=y -CONFIG_SSB=y -CONFIG_SSB_B43_PCI_BRIDGE=y -CONFIG_SSB_BLOCKIO=y -CONFIG_SSB_DRIVER_EXTIF=y -CONFIG_SSB_DRIVER_GIGE=y -CONFIG_SSB_DRIVER_GPIO=y -CONFIG_SSB_DRIVER_MIPS=y -CONFIG_SSB_DRIVER_PCICORE=y -CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y -CONFIG_SSB_EMBEDDED=y -CONFIG_SSB_FALLBACK_SPROM=y -CONFIG_SSB_HOST_SOC=y -CONFIG_SSB_PCICORE_HOSTMODE=y -CONFIG_SSB_PCIHOST=y -CONFIG_SSB_PCIHOST_POSSIBLE=y -CONFIG_SSB_SERIAL=y -CONFIG_SSB_SFLASH=y -CONFIG_SSB_SPROM=y -CONFIG_SWCONFIG=y -CONFIG_SWCONFIG_B53=y -CONFIG_SWCONFIG_B53_PHY_DRIVER=y -CONFIG_SWCONFIG_B53_PHY_FIXUP=y -CONFIG_SWPHY=y -CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_SYS_HAS_CPU_BMIPS=y -CONFIG_SYS_HAS_CPU_BMIPS32_3300=y -CONFIG_SYS_HAS_CPU_MIPS32_R1=y -CONFIG_SYS_HAS_CPU_MIPS32_R2=y -CONFIG_SYS_HAS_EARLY_PRINTK=y -CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y -CONFIG_SYS_SUPPORTS_ARBIT_HZ=y -CONFIG_SYS_SUPPORTS_HIGHMEM=y -CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y -CONFIG_SYS_SUPPORTS_MIPS16=y -CONFIG_SYS_SUPPORTS_ZBOOT=y -CONFIG_TARGET_ISA_REV=1 -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TINY_SRCU=y -CONFIG_USB_SUPPORT=y -CONFIG_USE_GENERIC_EARLY_PRINTK_8250=y -CONFIG_WATCHDOG_CORE=y -CONFIG_ZBOOT_LOAD_ADDRESS=0xffffffff80400000 diff --git a/target/linux/bcm47xx/patches-6.1/030-v6.3-MIPS-BCM47XX-Add-support-for-Linksys-E2500-V3.patch b/target/linux/bcm47xx/patches-6.1/030-v6.3-MIPS-BCM47XX-Add-support-for-Linksys-E2500-V3.patch deleted file mode 100644 index 4faecdc7d5..0000000000 --- a/target/linux/bcm47xx/patches-6.1/030-v6.3-MIPS-BCM47XX-Add-support-for-Linksys-E2500-V3.patch +++ /dev/null @@ -1,65 +0,0 @@ -From fc605b914167de75432c3b5aae239fb191e84a31 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Wed, 8 Feb 2023 08:03:01 +0100 -Subject: [PATCH] MIPS: BCM47XX: Add support for Linksys E2500 V3 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It's a BCM5358 based home WiFi router. 16 MiB flash, 64 MiB RAM, BCM5325 -switch, on-SoC 802.11n radio. - -Signed-off-by: Rafał Miłecki -Reviewed-by: Florian Fainelli -Signed-off-by: Thomas Bogendoerfer ---- - arch/mips/bcm47xx/board.c | 1 + - arch/mips/bcm47xx/buttons.c | 9 +++++++++ - arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 + - 3 files changed, 11 insertions(+) - ---- a/arch/mips/bcm47xx/board.c -+++ b/arch/mips/bcm47xx/board.c -@@ -130,6 +130,7 @@ struct bcm47xx_board_type_list2 bcm47xx_ - {{BCM47XX_BOARD_LINKSYS_E1000V21, "Linksys E1000 V2.1"}, "E1000", "2.1"}, - {{BCM47XX_BOARD_LINKSYS_E1200V2, "Linksys E1200 V2"}, "E1200", "2.0"}, - {{BCM47XX_BOARD_LINKSYS_E2000V1, "Linksys E2000 V1"}, "Linksys E2000", "1.0"}, -+ {{BCM47XX_BOARD_LINKSYS_E2500V3, "Linksys E2500 V3"}, "E2500", "1.0"}, - /* like WRT610N v2.0 */ - {{BCM47XX_BOARD_LINKSYS_E3000V1, "Linksys E3000 V1"}, "E300", "1.0"}, - {{BCM47XX_BOARD_LINKSYS_E3200V1, "Linksys E3200 V1"}, "E3200", "1.0"}, ---- a/arch/mips/bcm47xx/buttons.c -+++ b/arch/mips/bcm47xx/buttons.c -@@ -223,6 +223,12 @@ bcm47xx_buttons_linksys_e2000v1[] __init - }; - - static const struct gpio_keys_button -+bcm47xx_buttons_linksys_e2500v3[] __initconst = { -+ BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON), -+ BCM47XX_GPIO_KEY(10, KEY_RESTART), -+}; -+ -+static const struct gpio_keys_button - bcm47xx_buttons_linksys_e3000v1[] __initconst = { - BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), - BCM47XX_GPIO_KEY(6, KEY_RESTART), -@@ -617,6 +623,9 @@ int __init bcm47xx_buttons_register(void - case BCM47XX_BOARD_LINKSYS_E2000V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2000v1); - break; -+ case BCM47XX_BOARD_LINKSYS_E2500V3: -+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2500v3); -+ break; - case BCM47XX_BOARD_LINKSYS_E3000V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3000v1); - break; ---- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h -+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h -@@ -61,6 +61,7 @@ enum bcm47xx_board { - BCM47XX_BOARD_LINKSYS_E1000V21, - BCM47XX_BOARD_LINKSYS_E1200V2, - BCM47XX_BOARD_LINKSYS_E2000V1, -+ BCM47XX_BOARD_LINKSYS_E2500V3, - BCM47XX_BOARD_LINKSYS_E3000V1, - BCM47XX_BOARD_LINKSYS_E3200V1, - BCM47XX_BOARD_LINKSYS_E4200V1, diff --git a/target/linux/bcm47xx/patches-6.1/130-MIPS-BCM47XX-Add-support-for-Huawei-B593u-12.patch b/target/linux/bcm47xx/patches-6.1/130-MIPS-BCM47XX-Add-support-for-Huawei-B593u-12.patch deleted file mode 100644 index 333c3d7b87..0000000000 --- a/target/linux/bcm47xx/patches-6.1/130-MIPS-BCM47XX-Add-support-for-Huawei-B593u-12.patch +++ /dev/null @@ -1,61 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Mon, 27 Feb 2023 07:44:38 +0100 -Subject: [PATCH] MIPS: BCM47XX: Add support for Huawei B593u-12 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It's a BCM5358 based home router. One of very few bcm47xx devices with -cellular modems (here: LTE). - -Signed-off-by: Rafał Miłecki ---- - arch/mips/bcm47xx/board.c | 1 + - arch/mips/bcm47xx/leds.c | 8 ++++++++ - arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 + - 3 files changed, 10 insertions(+) - ---- a/arch/mips/bcm47xx/board.c -+++ b/arch/mips/bcm47xx/board.c -@@ -193,6 +193,7 @@ struct bcm47xx_board_type_list1 bcm47xx_ - /* boardtype, boardnum, boardrev */ - static const - struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = { -+ {{BCM47XX_BOARD_HUAWEI_B593U_12, "Huawei B593u-12"}, "0x053d", "1234", "0x1301"}, - {{BCM47XX_BOARD_HUAWEI_E970, "Huawei E970"}, "0x048e", "0x5347", "0x11"}, - {{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"}, - {{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"}, ---- a/arch/mips/bcm47xx/leds.c -+++ b/arch/mips/bcm47xx/leds.c -@@ -223,6 +223,11 @@ bcm47xx_leds_dlink_dir330[] __initconst - /* Huawei */ - - static const struct gpio_led -+bcm47xx_leds_huawei_b593u_12[] __initconst = { -+ BCM47XX_GPIO_LED(5, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), -+}; -+ -+static const struct gpio_led - bcm47xx_leds_huawei_e970[] __initconst = { - BCM47XX_GPIO_LED(0, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), - }; -@@ -672,6 +677,9 @@ void __init bcm47xx_leds_register(void) - bcm47xx_set_pdata(bcm47xx_leds_dlink_dir330); - break; - -+ case BCM47XX_BOARD_HUAWEI_B593U_12: -+ bcm47xx_set_pdata(bcm47xx_leds_huawei_b593u_12); -+ break; - case BCM47XX_BOARD_HUAWEI_E970: - bcm47xx_set_pdata(bcm47xx_leds_huawei_e970); - break; ---- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h -+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h -@@ -53,6 +53,7 @@ enum bcm47xx_board { - BCM47XX_BOARD_DLINK_DIR130, - BCM47XX_BOARD_DLINK_DIR330, - -+ BCM47XX_BOARD_HUAWEI_B593U_12, - BCM47XX_BOARD_HUAWEI_E970, - - BCM47XX_BOARD_LINKSYS_E900V1, diff --git a/target/linux/bcm47xx/patches-6.1/159-cpu_fixes.patch b/target/linux/bcm47xx/patches-6.1/159-cpu_fixes.patch deleted file mode 100644 index f51ed83d93..0000000000 --- a/target/linux/bcm47xx/patches-6.1/159-cpu_fixes.patch +++ /dev/null @@ -1,484 +0,0 @@ ---- a/arch/mips/include/asm/r4kcache.h -+++ b/arch/mips/include/asm/r4kcache.h -@@ -27,6 +27,38 @@ - extern void (*r4k_blast_dcache)(void); - extern void (*r4k_blast_icache)(void); - -+#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2) -+#include -+#include -+#define BCM4710_DUMMY_RREG() bcm4710_dummy_rreg() -+ -+static inline unsigned long bcm4710_dummy_rreg(void) -+{ -+ return *(volatile unsigned long *)(KSEG1ADDR(SSB_ENUM_BASE)); -+} -+ -+#define BCM4710_FILL_TLB(addr) bcm4710_fill_tlb((void *)(addr)) -+ -+static inline unsigned long bcm4710_fill_tlb(void *addr) -+{ -+ return *(unsigned long *)addr; -+} -+ -+#define BCM4710_PROTECTED_FILL_TLB(addr) bcm4710_protected_fill_tlb((void *)(addr)) -+ -+static inline void bcm4710_protected_fill_tlb(void *addr) -+{ -+ unsigned long x; -+ get_dbe(x, (unsigned long *)addr);; -+} -+ -+#else -+#define BCM4710_DUMMY_RREG() -+ -+#define BCM4710_FILL_TLB(addr) -+#define BCM4710_PROTECTED_FILL_TLB(addr) -+#endif -+ - /* - * This macro return a properly sign-extended address suitable as base address - * for indexed cache operations. Two issues here: -@@ -60,6 +92,7 @@ static inline void flush_icache_line_ind - - static inline void flush_dcache_line_indexed(unsigned long addr) - { -+ BCM4710_DUMMY_RREG(); - cache_op(Index_Writeback_Inv_D, addr); - } - -@@ -83,11 +116,13 @@ static inline void flush_icache_line(uns - - static inline void flush_dcache_line(unsigned long addr) - { -+ BCM4710_DUMMY_RREG(); - cache_op(Hit_Writeback_Inv_D, addr); - } - - static inline void invalidate_dcache_line(unsigned long addr) - { -+ BCM4710_DUMMY_RREG(); - cache_op(Hit_Invalidate_D, addr); - } - -@@ -160,6 +195,7 @@ static inline int protected_flush_icache - return protected_cache_op(Hit_Invalidate_I_Loongson2, addr); - - default: -+ BCM4710_DUMMY_RREG(); - return protected_cache_op(Hit_Invalidate_I, addr); - } - } -@@ -172,6 +208,7 @@ static inline int protected_flush_icache - */ - static inline int protected_writeback_dcache_line(unsigned long addr) - { -+ BCM4710_DUMMY_RREG(); - return protected_cache_op(Hit_Writeback_Inv_D, addr); - } - -@@ -193,8 +230,51 @@ static inline void invalidate_tcache_pag - unroll(times, _cache_op, insn, op, (addr) + (i++ * (lsize))); \ - } while (0) - -+static inline void blast_dcache(void) -+{ -+ unsigned long start = KSEG0; -+ unsigned long dcache_size = current_cpu_data.dcache.waysize * current_cpu_data.dcache.ways; -+ unsigned long end = (start + dcache_size); -+ -+ do { -+ BCM4710_DUMMY_RREG(); -+ cache_op(Index_Writeback_Inv_D, start); -+ start += current_cpu_data.dcache.linesz; -+ } while(start < end); -+} -+ -+static inline void blast_dcache_page(unsigned long page) -+{ -+ unsigned long start = page; -+ unsigned long end = start + PAGE_SIZE; -+ -+ BCM4710_FILL_TLB(start); -+ do { -+ BCM4710_DUMMY_RREG(); -+ cache_op(Hit_Writeback_Inv_D, start); -+ start += current_cpu_data.dcache.linesz; -+ } while(start < end); -+} -+ -+static inline void blast_dcache_page_indexed(unsigned long page) -+{ -+ unsigned long start = page; -+ unsigned long end = start + PAGE_SIZE; -+ unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit; -+ unsigned long ws_end = current_cpu_data.dcache.ways << -+ current_cpu_data.dcache.waybit; -+ unsigned long ws, addr; -+ for (ws = 0; ws < ws_end; ws += ws_inc) { -+ start = page + ws; -+ for (addr = start; addr < end; addr += current_cpu_data.dcache.linesz) { -+ BCM4710_DUMMY_RREG(); -+ cache_op(Index_Writeback_Inv_D, addr); -+ } -+ } -+} -+ - /* build blast_xxx, blast_xxx_page, blast_xxx_page_indexed */ --#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra) \ -+#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra, war) \ - static inline void extra##blast_##pfx##cache##lsize(void) \ - { \ - unsigned long start = INDEX_BASE; \ -@@ -204,6 +284,7 @@ static inline void extra##blast_##pfx##c - current_cpu_data.desc.waybit; \ - unsigned long ws, addr; \ - \ -+ war \ - for (ws = 0; ws < ws_end; ws += ws_inc) \ - for (addr = start; addr < end; addr += lsize * 32) \ - cache_unroll(32, kernel_cache, indexop, \ -@@ -215,6 +296,7 @@ static inline void extra##blast_##pfx##c - unsigned long start = page; \ - unsigned long end = page + PAGE_SIZE; \ - \ -+ war \ - do { \ - cache_unroll(32, kernel_cache, hitop, start, lsize); \ - start += lsize * 32; \ -@@ -231,32 +313,33 @@ static inline void extra##blast_##pfx##c - current_cpu_data.desc.waybit; \ - unsigned long ws, addr; \ - \ -+ war \ - for (ws = 0; ws < ws_end; ws += ws_inc) \ - for (addr = start; addr < end; addr += lsize * 32) \ - cache_unroll(32, kernel_cache, indexop, \ - addr | ws, lsize); \ - } - --__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, ) --__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, ) --__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, ) --__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, ) --__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, ) --__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_) --__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, ) --__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, ) --__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, ) --__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, ) --__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, ) --__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, ) --__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, ) -- --__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, ) --__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, ) --__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, ) --__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, ) --__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, ) --__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, ) -+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, , ) -+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, , BCM4710_FILL_TLB(start);) -+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, , ) -+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, , ) -+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, , BCM4710_FILL_TLB(start);) -+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_, BCM4710_FILL_TLB(start);) -+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, , ) -+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, , ) -+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, , BCM4710_FILL_TLB(start);) -+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, , ) -+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, , ) -+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, , ) -+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, , ) -+ -+__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, , ) -+__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, , ) -+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, , ) -+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, , ) -+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, , ) -+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, , ) - - #define __BUILD_BLAST_USER_CACHE(pfx, desc, indexop, hitop, lsize) \ - static inline void blast_##pfx##cache##lsize##_user_page(unsigned long page) \ -@@ -281,65 +364,36 @@ __BUILD_BLAST_USER_CACHE(d, dcache, Inde - __BUILD_BLAST_USER_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64) - - /* build blast_xxx_range, protected_blast_xxx_range */ --#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra) \ -+#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra, war, war2) \ - static inline void prot##extra##blast_##pfx##cache##_range(unsigned long start, \ - unsigned long end) \ - { \ - unsigned long lsize = cpu_##desc##_line_size(); \ -- unsigned long lsize_2 = lsize * 2; \ -- unsigned long lsize_3 = lsize * 3; \ -- unsigned long lsize_4 = lsize * 4; \ -- unsigned long lsize_5 = lsize * 5; \ -- unsigned long lsize_6 = lsize * 6; \ -- unsigned long lsize_7 = lsize * 7; \ -- unsigned long lsize_8 = lsize * 8; \ - unsigned long addr = start & ~(lsize - 1); \ -- unsigned long aend = (end + lsize - 1) & ~(lsize - 1); \ -- int lines = (aend - addr) / lsize; \ -- \ -- while (lines >= 8) { \ -- prot##cache_op(hitop, addr); \ -- prot##cache_op(hitop, addr + lsize); \ -- prot##cache_op(hitop, addr + lsize_2); \ -- prot##cache_op(hitop, addr + lsize_3); \ -- prot##cache_op(hitop, addr + lsize_4); \ -- prot##cache_op(hitop, addr + lsize_5); \ -- prot##cache_op(hitop, addr + lsize_6); \ -- prot##cache_op(hitop, addr + lsize_7); \ -- addr += lsize_8; \ -- lines -= 8; \ -- } \ -+ unsigned long aend = (end - 1) & ~(lsize - 1); \ - \ -- if (lines & 0x4) { \ -- prot##cache_op(hitop, addr); \ -- prot##cache_op(hitop, addr + lsize); \ -- prot##cache_op(hitop, addr + lsize_2); \ -- prot##cache_op(hitop, addr + lsize_3); \ -- addr += lsize_4; \ -- } \ -- \ -- if (lines & 0x2) { \ -- prot##cache_op(hitop, addr); \ -- prot##cache_op(hitop, addr + lsize); \ -- addr += lsize_2; \ -- } \ -+ war \ - \ -- if (lines & 0x1) { \ -+ while (1) { \ -+ war2 \ - prot##cache_op(hitop, addr); \ -+ if (addr == aend) \ -+ break; \ -+ addr += lsize; \ - } \ - } - --__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, ) --__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, ) --__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, ) -+__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, , BCM4710_PROTECTED_FILL_TLB(addr); BCM4710_PROTECTED_FILL_TLB(aend);, BCM4710_DUMMY_RREG();) -+__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, , , ) -+__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, , , ) - __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson2, \ -- protected_, loongson2_) --__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , ) --__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , ) --__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , ) -+ protected_, loongson2_, , ) -+__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , , BCM4710_FILL_TLB(addr); BCM4710_FILL_TLB(aend);, BCM4710_DUMMY_RREG();) -+__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , , , ) -+__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , , , ) - /* blast_inv_dcache_range */ --__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , ) --__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , ) -+__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , , , BCM4710_DUMMY_RREG();) -+__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , , , ) - - /* Currently, this is very specific to Loongson-3 */ - #define __BUILD_BLAST_CACHE_NODE(pfx, desc, indexop, hitop, lsize) \ ---- a/arch/mips/include/asm/stackframe.h -+++ b/arch/mips/include/asm/stackframe.h -@@ -429,6 +429,10 @@ - #else - .set push - .set arch=r4000 -+#ifdef CONFIG_BCM47XX -+ nop -+ nop -+#endif - eret - .set pop - #endif ---- a/arch/mips/kernel/genex.S -+++ b/arch/mips/kernel/genex.S -@@ -21,6 +21,19 @@ - #include - #include - -+#ifdef CONFIG_BCM47XX -+# ifdef eret -+# undef eret -+# endif -+# define eret \ -+ .set push; \ -+ .set noreorder; \ -+ nop; \ -+ nop; \ -+ eret; \ -+ .set pop; -+#endif -+ - __INIT - - /* -@@ -32,6 +45,9 @@ - NESTED(except_vec3_generic, 0, sp) - .set push - .set noat -+#ifdef CONFIG_BCM47XX -+ nop -+#endif - mfc0 k1, CP0_CAUSE - andi k1, k1, 0x7c - #ifdef CONFIG_64BIT -@@ -52,6 +68,9 @@ NESTED(except_vec3_r4000, 0, sp) - .set push - .set arch=r4000 - .set noat -+#ifdef CONFIG_BCM47XX -+ nop -+#endif - mfc0 k1, CP0_CAUSE - li k0, 31<<2 - andi k1, k1, 0x7c ---- a/arch/mips/mm/c-r4k.c -+++ b/arch/mips/mm/c-r4k.c -@@ -37,6 +37,9 @@ - #include - #include - -+/* For enabling BCM4710 cache workarounds */ -+static int bcm4710 = 0; -+ - /* - * Bits describing what cache ops an SMP callback function may perform. - * -@@ -189,6 +192,9 @@ static void r4k_blast_dcache_user_page_s - { - unsigned long dc_lsize = cpu_dcache_line_size(); - -+ if (bcm4710) -+ r4k_blast_dcache_page = blast_dcache_page; -+ else - if (dc_lsize == 0) - r4k_blast_dcache_user_page = (void *)cache_noop; - else if (dc_lsize == 16) -@@ -207,6 +213,9 @@ static void r4k_blast_dcache_page_indexe - { - unsigned long dc_lsize = cpu_dcache_line_size(); - -+ if (bcm4710) -+ r4k_blast_dcache_page_indexed = blast_dcache_page_indexed; -+ else - if (dc_lsize == 0) - r4k_blast_dcache_page_indexed = (void *)cache_noop; - else if (dc_lsize == 16) -@@ -226,6 +235,9 @@ static void r4k_blast_dcache_setup(void) - { - unsigned long dc_lsize = cpu_dcache_line_size(); - -+ if (bcm4710) -+ r4k_blast_dcache = blast_dcache; -+ else - if (dc_lsize == 0) - r4k_blast_dcache = (void *)cache_noop; - else if (dc_lsize == 16) -@@ -1779,6 +1791,17 @@ static void coherency_setup(void) - * silly idea of putting something else there ... - */ - switch (current_cpu_type()) { -+ case CPU_BMIPS3300: -+ { -+ u32 cm; -+ cm = read_c0_diag(); -+ /* Enable icache */ -+ cm |= (1 << 31); -+ /* Enable dcache */ -+ cm |= (1 << 30); -+ write_c0_diag(cm); -+ } -+ break; - case CPU_R4000PC: - case CPU_R4000SC: - case CPU_R4000MC: -@@ -1825,6 +1848,15 @@ void r4k_cache_init(void) - extern void build_copy_page(void); - struct cpuinfo_mips *c = ¤t_cpu_data; - -+ /* Check if special workarounds are required */ -+#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2) -+ if (current_cpu_data.cputype == CPU_BMIPS32 && (current_cpu_data.processor_id & 0xff) == 0) { -+ printk("Enabling BCM4710A0 cache workarounds.\n"); -+ bcm4710 = 1; -+ } else -+#endif -+ bcm4710 = 0; -+ - probe_pcache(); - probe_vcache(); - setup_scache(); -@@ -1897,7 +1929,15 @@ void r4k_cache_init(void) - */ - local_r4k___flush_cache_all(NULL); - -+#ifdef CONFIG_BCM47XX -+ { -+ static void (*_coherency_setup)(void); -+ _coherency_setup = (void (*)(void)) KSEG1ADDR(coherency_setup); -+ _coherency_setup(); -+ } -+#else - coherency_setup(); -+#endif - board_cache_error_setup = r4k_cache_error_setup; - - /* ---- a/arch/mips/mm/tlbex.c -+++ b/arch/mips/mm/tlbex.c -@@ -958,6 +958,9 @@ void build_get_pgde32(u32 **p, unsigned - uasm_i_srl(p, ptr, ptr, SMP_CPUID_PTRSHIFT); - uasm_i_addu(p, ptr, tmp, ptr); - #else -+#ifdef CONFIG_BCM47XX -+ uasm_i_nop(p); -+#endif - UASM_i_LA_mostly(p, ptr, pgdc); - #endif - uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */ -@@ -1304,6 +1307,9 @@ static void build_r4000_tlb_refill_handl - #ifdef CONFIG_64BIT - build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */ - #else -+# ifdef CONFIG_BCM47XX -+ uasm_i_nop(&p); -+# endif - build_get_pgde32(&p, K0, K1); /* get pgd in K1 */ - #endif - -@@ -1315,6 +1321,9 @@ static void build_r4000_tlb_refill_handl - build_update_entries(&p, K0, K1); - build_tlb_write_entry(&p, &l, &r, tlb_random); - uasm_l_leave(&l, p); -+#ifdef CONFIG_BCM47XX -+ uasm_i_nop(&p); -+#endif - uasm_i_eret(&p); /* return from trap */ - } - #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT -@@ -2016,6 +2025,9 @@ build_r4000_tlbchange_handler_head(u32 * - #ifdef CONFIG_64BIT - build_get_pmde64(p, l, r, wr.r1, wr.r2); /* get pmd in ptr */ - #else -+# ifdef CONFIG_BCM47XX -+ uasm_i_nop(p); -+# endif - build_get_pgde32(p, wr.r1, wr.r2); /* get pgd in ptr */ - #endif - -@@ -2062,6 +2074,9 @@ build_r4000_tlbchange_handler_tail(u32 * - build_tlb_write_entry(p, l, r, tlb_indexed); - uasm_l_leave(l, *p); - build_restore_work_registers(p); -+#ifdef CONFIG_BCM47XX -+ uasm_i_nop(p); -+#endif - uasm_i_eret(p); /* return from trap */ - - #ifdef CONFIG_64BIT diff --git a/target/linux/bcm47xx/patches-6.1/160-kmap_coherent.patch b/target/linux/bcm47xx/patches-6.1/160-kmap_coherent.patch deleted file mode 100644 index 2af9d42fe5..0000000000 --- a/target/linux/bcm47xx/patches-6.1/160-kmap_coherent.patch +++ /dev/null @@ -1,78 +0,0 @@ -From: Jeff Hansen -Subject: [PATCH] kmap_coherent - -On ASUS WL-500gP there are some "Data bus error"s when executing simple -commands liks "ps" or "cat /proc/1/cmdline". - -This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485 ---- ---- a/arch/mips/include/asm/cpu-features.h -+++ b/arch/mips/include/asm/cpu-features.h -@@ -257,6 +257,9 @@ - #ifndef cpu_has_pindexed_dcache - #define cpu_has_pindexed_dcache (cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX) - #endif -+#ifndef cpu_use_kmap_coherent -+#define cpu_use_kmap_coherent 1 -+#endif - - /* - * I-Cache snoops remote store. This only matters on SMP. Some multiprocessors ---- a/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h -+++ b/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h -@@ -79,4 +79,6 @@ - #define cpu_scache_line_size() 0 - #define cpu_has_vz 0 - -+#define cpu_use_kmap_coherent 0 -+ - #endif /* __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H */ ---- a/arch/mips/mm/c-r4k.c -+++ b/arch/mips/mm/c-r4k.c -@@ -701,7 +701,7 @@ static inline void local_r4k_flush_cache - map_coherent = (cpu_has_dc_aliases && - page_mapcount(page) && - !Page_dcache_dirty(page)); -- if (map_coherent) -+ if (map_coherent && cpu_use_kmap_coherent) - vaddr = kmap_coherent(page, addr); - else - vaddr = kmap_atomic(page); -@@ -728,7 +728,7 @@ static inline void local_r4k_flush_cache - } - - if (vaddr) { -- if (map_coherent) -+ if (map_coherent && cpu_use_kmap_coherent) - kunmap_coherent(); - else - kunmap_atomic(vaddr); ---- a/arch/mips/mm/init.c -+++ b/arch/mips/mm/init.c -@@ -172,7 +172,7 @@ void copy_user_highpage(struct page *to, - void *vfrom, *vto; - - vto = kmap_atomic(to); -- if (cpu_has_dc_aliases && -+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent && - page_mapcount(from) && !Page_dcache_dirty(from)) { - vfrom = kmap_coherent(from, vaddr); - copy_page(vto, vfrom); -@@ -194,7 +194,7 @@ void copy_to_user_page(struct vm_area_st - struct page *page, unsigned long vaddr, void *dst, const void *src, - unsigned long len) - { -- if (cpu_has_dc_aliases && -+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent && - page_mapcount(page) && !Page_dcache_dirty(page)) { - void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); - memcpy(vto, src, len); -@@ -212,7 +212,7 @@ void copy_from_user_page(struct vm_area_ - struct page *page, unsigned long vaddr, void *dst, const void *src, - unsigned long len) - { -- if (cpu_has_dc_aliases && -+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent && - page_mapcount(page) && !Page_dcache_dirty(page)) { - void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); - memcpy(dst, vfrom, len); diff --git a/target/linux/bcm47xx/patches-6.1/209-b44-register-adm-switch.patch b/target/linux/bcm47xx/patches-6.1/209-b44-register-adm-switch.patch deleted file mode 100644 index 1b9dcb3adc..0000000000 --- a/target/linux/bcm47xx/patches-6.1/209-b44-register-adm-switch.patch +++ /dev/null @@ -1,121 +0,0 @@ -From b36f694256f41bc71571f467646d015dda128d14 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Sat, 9 Nov 2013 17:03:59 +0100 -Subject: [PATCH 210/210] b44: register adm switch - ---- - drivers/net/ethernet/broadcom/b44.c | 57 +++++++++++++++++++++++++++++++++++ - drivers/net/ethernet/broadcom/b44.h | 3 ++ - 2 files changed, 60 insertions(+) - ---- a/drivers/net/ethernet/broadcom/b44.c -+++ b/drivers/net/ethernet/broadcom/b44.c -@@ -31,6 +31,8 @@ - #include - #include - #include -+#include -+#include - - #include - #include -@@ -2251,6 +2253,69 @@ static void b44_adjust_link(struct net_d - } - } - -+#ifdef CONFIG_BCM47XX -+static int b44_register_adm_switch(struct b44 *bp) -+{ -+ int gpio; -+ struct platform_device *pdev; -+ struct adm6996_gpio_platform_data adm_data = {0}; -+ struct platform_device_info info = {0}; -+ -+ adm_data.model = ADM6996L; -+ gpio = bcm47xx_nvram_gpio_pin("adm_eecs"); -+ if (gpio >= 0) -+ adm_data.eecs = gpio; -+ else -+ adm_data.eecs = 2; -+ -+ gpio = bcm47xx_nvram_gpio_pin("adm_eesk"); -+ if (gpio >= 0) -+ adm_data.eesk = gpio; -+ else -+ adm_data.eesk = 3; -+ -+ gpio = bcm47xx_nvram_gpio_pin("adm_eedi"); -+ if (gpio >= 0) -+ adm_data.eedi = gpio; -+ else -+ adm_data.eedi = 4; -+ -+ /* -+ * We ignore the "adm_rc" GPIO here. The driver does not use it, -+ * and it conflicts with the Reset button GPIO on the Linksys WRT54GSv1. -+ */ -+ -+ info.parent = bp->sdev->dev; -+ info.name = "adm6996_gpio"; -+ info.id = -1; -+ info.data = &adm_data; -+ info.size_data = sizeof(adm_data); -+ -+ if (!bp->adm_switch) { -+ pdev = platform_device_register_full(&info); -+ if (IS_ERR(pdev)) -+ return PTR_ERR(pdev); -+ -+ bp->adm_switch = pdev; -+ } -+ return 0; -+} -+static void b44_unregister_adm_switch(struct b44 *bp) -+{ -+ if (bp->adm_switch) -+ platform_device_unregister(bp->adm_switch); -+} -+#else -+static int b44_register_adm_switch(struct b44 *bp) -+{ -+ return 0; -+} -+static void b44_unregister_adm_switch(struct b44 *bp) -+{ -+ -+} -+#endif /* CONFIG_BCM47XX */ -+ - static int b44_register_phy_one(struct b44 *bp) - { - __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; -@@ -2287,6 +2352,9 @@ static int b44_register_phy_one(struct b - if (!mdiobus_is_registered_device(bp->mii_bus, bp->phy_addr) && - (sprom->boardflags_lo & (B44_BOARDFLAG_ROBO | B44_BOARDFLAG_ADM))) { - -+ if (sprom->boardflags_lo & B44_BOARDFLAG_ADM) -+ b44_register_adm_switch(bp); -+ - dev_info(sdev->dev, - "could not find PHY at %i, use fixed one\n", - bp->phy_addr); -@@ -2481,6 +2549,7 @@ static void b44_remove_one(struct ssb_de - unregister_netdev(dev); - if (bp->flags & B44_FLAG_EXTERNAL_PHY) - b44_unregister_phy_one(bp); -+ b44_unregister_adm_switch(bp); - ssb_device_disable(sdev, 0); - ssb_bus_may_powerdown(sdev->bus); - netif_napi_del(&bp->napi); ---- a/drivers/net/ethernet/broadcom/b44.h -+++ b/drivers/net/ethernet/broadcom/b44.h -@@ -408,6 +408,9 @@ struct b44 { - struct mii_bus *mii_bus; - int old_link; - struct mii_if_info mii_if; -+ -+ /* platform device for associated switch */ -+ struct platform_device *adm_switch; - }; - - #endif /* _B44_H */ diff --git a/target/linux/bcm47xx/patches-6.1/210-b44_phy_fix.patch b/target/linux/bcm47xx/patches-6.1/210-b44_phy_fix.patch deleted file mode 100644 index af9736518b..0000000000 --- a/target/linux/bcm47xx/patches-6.1/210-b44_phy_fix.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- a/drivers/net/ethernet/broadcom/b44.c -+++ b/drivers/net/ethernet/broadcom/b44.c -@@ -430,10 +430,34 @@ static void b44_wap54g10_workaround(stru - error: - pr_warn("PHY: cannot reset MII transceiver isolate bit\n"); - } -+ -+static void b44_bcm47xx_workarounds(struct b44 *bp) -+{ -+ char buf[20]; -+ struct ssb_device *sdev = bp->sdev; -+ -+ /* Toshiba WRC-1000, Siemens SE505 v1, Askey RT-210W, RT-220W */ -+ if (sdev->bus->sprom.board_num == 100) { -+ bp->phy_addr = B44_PHY_ADDR_NO_LOCAL_PHY; -+ } else { -+ /* WL-HDD */ -+ if (bcm47xx_nvram_getenv("hardware_version", buf, sizeof(buf)) >= 0 && -+ !strncmp(buf, "WL300-", strlen("WL300-"))) { -+ if (sdev->bus->sprom.et0phyaddr == 0 && -+ sdev->bus->sprom.et1phyaddr == 1) -+ bp->phy_addr = B44_PHY_ADDR_NO_LOCAL_PHY; -+ } -+ } -+ return; -+} - #else - static inline void b44_wap54g10_workaround(struct b44 *bp) - { - } -+ -+static inline void b44_bcm47xx_workarounds(struct b44 *bp) -+{ -+} - #endif - - static int b44_setup_phy(struct b44 *bp) -@@ -442,6 +466,7 @@ static int b44_setup_phy(struct b44 *bp) - int err; - - b44_wap54g10_workaround(bp); -+ b44_bcm47xx_workarounds(bp); - - if (bp->flags & B44_FLAG_EXTERNAL_PHY) - return 0; -@@ -2181,6 +2206,8 @@ static int b44_get_invariants(struct b44 - * valid PHY address. */ - bp->phy_addr &= 0x1F; - -+ b44_bcm47xx_workarounds(bp); -+ - eth_hw_addr_set(bp->dev, addr); - - if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){ diff --git a/target/linux/bcm47xx/patches-6.1/280-activate_ssb_support_in_usb.patch b/target/linux/bcm47xx/patches-6.1/280-activate_ssb_support_in_usb.patch deleted file mode 100644 index f6e9e6d30a..0000000000 --- a/target/linux/bcm47xx/patches-6.1/280-activate_ssb_support_in_usb.patch +++ /dev/null @@ -1,25 +0,0 @@ -This prevents the options from being delete with make kernel_oldconfig. ---- - drivers/ssb/Kconfig | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/drivers/bcma/Kconfig -+++ b/drivers/bcma/Kconfig -@@ -36,6 +36,7 @@ config BCMA_HOST_PCI - config BCMA_HOST_SOC - bool "Support for BCMA in a SoC" - depends on HAS_IOMEM -+ select USB_HCD_BCMA if USB_EHCI_HCD || USB_OHCI_HCD - help - Host interface for a Broadcom AIX bus directly mapped into - the memory. This only works with the Broadcom SoCs from the ---- a/drivers/ssb/Kconfig -+++ b/drivers/ssb/Kconfig -@@ -141,6 +141,7 @@ config SSB_SFLASH - config SSB_EMBEDDED - bool - depends on SSB_DRIVER_MIPS && SSB_PCICORE_HOSTMODE -+ select USB_HCD_SSB if USB_EHCI_HCD || USB_OHCI_HCD - default y - - config SSB_DRIVER_EXTIF diff --git a/target/linux/bcm47xx/patches-6.1/300-fork_cacheflush.patch b/target/linux/bcm47xx/patches-6.1/300-fork_cacheflush.patch deleted file mode 100644 index daa2c1adf0..0000000000 --- a/target/linux/bcm47xx/patches-6.1/300-fork_cacheflush.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Wolfram Joost -Subject: [PATCH] fork_cacheflush - -On ASUS WL-500gP there are many unexpected "Segmentation fault"s that -seem to be caused by a kernel. They can be avoided by: -1) Disabling highpage -2) Using flush_cache_mm in flush_cache_dup_mm - -For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035 ---- ---- a/arch/mips/include/asm/cacheflush.h -+++ b/arch/mips/include/asm/cacheflush.h -@@ -46,7 +46,7 @@ - extern void (*flush_cache_all)(void); - extern void (*__flush_cache_all)(void); - extern void (*flush_cache_mm)(struct mm_struct *mm); --#define flush_cache_dup_mm(mm) do { (void) (mm); } while (0) -+#define flush_cache_dup_mm(mm) flush_cache_mm(mm) - extern void (*flush_cache_range)(struct vm_area_struct *vma, - unsigned long start, unsigned long end); - extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn); diff --git a/target/linux/bcm47xx/patches-6.1/310-no_highpage.patch b/target/linux/bcm47xx/patches-6.1/310-no_highpage.patch deleted file mode 100644 index 8f368e3e9e..0000000000 --- a/target/linux/bcm47xx/patches-6.1/310-no_highpage.patch +++ /dev/null @@ -1,74 +0,0 @@ -From: Jeff Hansen -Subject: [PATCH] no highpage - -On ASUS WL-500gP there are many unexpected "Segmentation fault"s that -seem to be caused by a kernel. They can be avoided by: -1) Disabling highpage -2) Using flush_cache_mm in flush_cache_dup_mm - -For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035 ---- ---- a/arch/mips/include/asm/page.h -+++ b/arch/mips/include/asm/page.h -@@ -71,6 +71,7 @@ static inline unsigned int page_size_ftl - #endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */ - - #include -+#include - - extern void build_clear_page(void); - extern void build_copy_page(void); -@@ -110,11 +111,16 @@ static inline void clear_user_page(void - flush_data_cache_page((unsigned long)addr); - } - --struct vm_area_struct; --extern void copy_user_highpage(struct page *to, struct page *from, -- unsigned long vaddr, struct vm_area_struct *vma); -+static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, -+ struct page *to) -+{ -+ extern void (*flush_data_cache_page)(unsigned long addr); - --#define __HAVE_ARCH_COPY_USER_HIGHPAGE -+ copy_page(vto, vfrom); -+ if (!cpu_has_ic_fills_f_dc || -+ pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK)) -+ flush_data_cache_page((unsigned long)vto); -+} - - /* - * These are used to make use of C type-checking.. ---- a/arch/mips/mm/init.c -+++ b/arch/mips/mm/init.c -@@ -166,30 +166,6 @@ void kunmap_coherent(void) - preempt_enable(); - } - --void copy_user_highpage(struct page *to, struct page *from, -- unsigned long vaddr, struct vm_area_struct *vma) --{ -- void *vfrom, *vto; -- -- vto = kmap_atomic(to); -- if (cpu_has_dc_aliases && cpu_use_kmap_coherent && -- page_mapcount(from) && !Page_dcache_dirty(from)) { -- vfrom = kmap_coherent(from, vaddr); -- copy_page(vto, vfrom); -- kunmap_coherent(); -- } else { -- vfrom = kmap_atomic(from); -- copy_page(vto, vfrom); -- kunmap_atomic(vfrom); -- } -- if ((!cpu_has_ic_fills_f_dc) || -- pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK)) -- flush_data_cache_page((unsigned long)vto); -- kunmap_atomic(vto); -- /* Make sure this page is cleared on other CPU's too before using it */ -- smp_wmb(); --} -- - void copy_to_user_page(struct vm_area_struct *vma, - struct page *page, unsigned long vaddr, void *dst, const void *src, - unsigned long len) diff --git a/target/linux/bcm47xx/patches-6.1/400-mtd-bcm47xxpart-get-nvram.patch b/target/linux/bcm47xx/patches-6.1/400-mtd-bcm47xxpart-get-nvram.patch deleted file mode 100644 index 17abe89d1d..0000000000 --- a/target/linux/bcm47xx/patches-6.1/400-mtd-bcm47xxpart-get-nvram.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/drivers/mtd/parsers/bcm47xxpart.c -+++ b/drivers/mtd/parsers/bcm47xxpart.c -@@ -98,6 +98,7 @@ static int bcm47xxpart_parse(struct mtd_ - int trx_num = 0; /* Number of found TRX partitions */ - int possible_nvram_sizes[] = { 0x8000, 0xF000, 0x10000, }; - int err; -+ bool found_nvram = false; - - /* - * Some really old flashes (like AT45DB*) had smaller erasesize-s, but -@@ -279,12 +280,23 @@ static int bcm47xxpart_parse(struct mtd_ - if (buf[0] == NVRAM_HEADER) { - bcm47xxpart_add_part(&parts[curr_part++], "nvram", - master->size - blocksize, 0); -+ found_nvram = true; - break; - } - } - - kfree(buf); - -+ if (!found_nvram) { -+ pr_err("can not find a nvram partition reserve last block\n"); -+ bcm47xxpart_add_part(&parts[curr_part++], "nvram_guess", -+ master->size - blocksize * 2, MTD_WRITEABLE); -+ for (i = 0; i < curr_part; i++) { -+ if (parts[i].size + parts[i].offset == master->size) -+ parts[i].offset -= blocksize * 2; -+ } -+ } -+ - /* - * Assume that partitions end at the beginning of the one they are - * followed by. diff --git a/target/linux/bcm47xx/patches-6.1/700-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch b/target/linux/bcm47xx/patches-6.1/700-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch deleted file mode 100644 index 2fcfbb7438..0000000000 --- a/target/linux/bcm47xx/patches-6.1/700-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch +++ /dev/null @@ -1,42 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Sun, 7 Nov 2021 14:20:40 +0100 -Subject: [PATCH] net: bgmac: connect to PHY even if it is BGMAC_PHY_NOREGS -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Recent bgmac change was meant to just fix a race between "Generic PHY" -and "bcm53xx" drivers after -EPROBE_DEFER. It modified bgmac to use -phy_connect() only if there is a real PHY device connected. - -That change broke bgmac on bcm47xx. bcma_phy_connect() now registers a -fixed PHY with the bgmac_phy_connect_direct(). That fails as another -fixed PHY (also using address 0) is already registered - by bcm47xx arch -code bcm47xx_register_bus_complete(). - -This change brings origial behaviour. It connects Ethernet interface -with pseudo-PHY (switch device) and adjusts Ethernet interface link to -match connected switch. - -This fixes: -[ 2.548098] bgmac_bcma bcma0:1: Failed to register fixed PHY device -[ 2.554584] bgmac_bcma bcma0:1: Cannot connect to phy - -Fixes: b5375509184d ("net: bgmac: improve handling PHY") -Link: https://lore.kernel.org/netdev/3639116e-9292-03ca-b9d9-d741118a4541@gmail.com/T/#u -Signed-off-by: Rafał Miłecki ---- - drivers/net/ethernet/broadcom/bgmac-bcma.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/ethernet/broadcom/bgmac-bcma.c -+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c -@@ -94,7 +94,7 @@ static int bcma_phy_connect(struct bgmac - return 0; - - /* Connect to the PHY */ -- if (bgmac->mii_bus && bgmac->phyaddr != BGMAC_PHY_NOREGS) { -+ if (bgmac->mii_bus) { - snprintf(bus_id, sizeof(bus_id), PHY_ID_FMT, bgmac->mii_bus->id, - bgmac->phyaddr); - phy_dev = phy_connect(bgmac->net_dev, bus_id, bgmac_adjust_link, diff --git a/target/linux/bcm47xx/patches-6.1/701-bgmac-reduce-max-frame-size-to-support-just-MTU-1500.patch b/target/linux/bcm47xx/patches-6.1/701-bgmac-reduce-max-frame-size-to-support-just-MTU-1500.patch deleted file mode 100644 index 3a2f4b06ed..0000000000 --- a/target/linux/bcm47xx/patches-6.1/701-bgmac-reduce-max-frame-size-to-support-just-MTU-1500.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 10 Jun 2022 13:10:47 +0200 -Subject: [PATCH] bgmac: reduce max frame size to support just MTU 1500 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -bgmac allocates new replacement buffer before handling each received -frame. Allocating & DMA-preparing 9724 B each time consumes a lot of CPU -time. Ideally bgmac should just respect currently set MTU but it isn't -the case right now. For now just revert back to the old limited frame -size. - -This change bumps NAT masquarade speed by ~95%. - -Ref: 8c7da63978f1 ("bgmac: configure MTU and add support for frames beyond 8192 byte size") -Signed-off-by: Rafał Miłecki ---- - drivers/net/ethernet/broadcom/bgmac.h | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/drivers/net/ethernet/broadcom/bgmac.h -+++ b/drivers/net/ethernet/broadcom/bgmac.h -@@ -328,8 +328,7 @@ - #define BGMAC_RX_FRAME_OFFSET 30 /* There are 2 unused bytes between header and real data */ - #define BGMAC_RX_BUF_OFFSET (NET_SKB_PAD + NET_IP_ALIGN - \ - BGMAC_RX_FRAME_OFFSET) --/* Jumbo frame size with FCS */ --#define BGMAC_RX_MAX_FRAME_SIZE 9724 -+#define BGMAC_RX_MAX_FRAME_SIZE 1536 - #define BGMAC_RX_BUF_SIZE (BGMAC_RX_FRAME_OFFSET + BGMAC_RX_MAX_FRAME_SIZE) - #define BGMAC_RX_ALLOC_SIZE (SKB_DATA_ALIGN(BGMAC_RX_BUF_SIZE + BGMAC_RX_BUF_OFFSET) + \ - SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) diff --git a/target/linux/bcm47xx/patches-6.1/791-tg3-no-pci-sleep.patch b/target/linux/bcm47xx/patches-6.1/791-tg3-no-pci-sleep.patch deleted file mode 100644 index 76e979ad58..0000000000 --- a/target/linux/bcm47xx/patches-6.1/791-tg3-no-pci-sleep.patch +++ /dev/null @@ -1,17 +0,0 @@ -When the Ethernet controller is powered down and someone wants to -access the mdio bus like the witch driver (b53) the system crashed if -PCI_D3hot was set before. This patch deactivates this power sawing mode -when a switch driver is in use. - ---- a/drivers/net/ethernet/broadcom/tg3.c -+++ b/drivers/net/ethernet/broadcom/tg3.c -@@ -4269,7 +4269,8 @@ static int tg3_power_down_prepare(struct - static void tg3_power_down(struct tg3 *tp) - { - pci_wake_from_d3(tp->pdev, tg3_flag(tp, WOL_ENABLE)); -- pci_set_power_state(tp->pdev, PCI_D3hot); -+ if (!tg3_flag(tp, ROBOSWITCH)) -+ pci_set_power_state(tp->pdev, PCI_D3hot); - } - - static void tg3_aux_stat_to_speed_duplex(struct tg3 *tp, u32 val, u32 *speed, u8 *duplex) diff --git a/target/linux/bcm47xx/patches-6.1/800-bcma-add-table-of-serial-flashes-with-smaller-blocks.patch b/target/linux/bcm47xx/patches-6.1/800-bcma-add-table-of-serial-flashes-with-smaller-blocks.patch deleted file mode 100644 index 318dc55810..0000000000 --- a/target/linux/bcm47xx/patches-6.1/800-bcma-add-table-of-serial-flashes-with-smaller-blocks.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 597715c61ae75a05ab3310a34ff3857a006f0f63 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Thu, 20 Nov 2014 21:32:42 +0100 -Subject: [PATCH] bcma: add table of serial flashes with smaller blocks -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Rafał Miłecki ---- - drivers/bcma/driver_chipcommon_sflash.c | 29 +++++++++++++++++++++++++++++ - 1 file changed, 29 insertions(+) - ---- a/drivers/bcma/driver_chipcommon_sflash.c -+++ b/drivers/bcma/driver_chipcommon_sflash.c -@@ -9,6 +9,7 @@ - - #include - #include -+#include - - static struct resource bcma_sflash_resource = { - .name = "bcma_sflash", -@@ -42,6 +43,13 @@ static const struct bcma_sflash_tbl_e bc - { NULL }, - }; - -+/* Some devices use smaller blocks (and have more of them) */ -+static const struct bcma_sflash_tbl_e bcma_sflash_st_shrink_tbl[] = { -+ { "M25P16", 0x14, 0x1000, 512, }, -+ { "M25P32", 0x15, 0x1000, 1024, }, -+ { NULL }, -+}; -+ - static const struct bcma_sflash_tbl_e bcma_sflash_sst_tbl[] = { - { "SST25WF512", 1, 0x1000, 16, }, - { "SST25VF512", 0x48, 0x1000, 16, }, -@@ -85,6 +93,24 @@ static void bcma_sflash_cmd(struct bcma_ - bcma_err(cc->core->bus, "SFLASH control command failed (timeout)!\n"); - } - -+const struct bcma_sflash_tbl_e *bcma_sflash_shrink_flash(u32 id) -+{ -+ enum bcm47xx_board board = bcm47xx_board_get(); -+ const struct bcma_sflash_tbl_e *e; -+ -+ switch (board) { -+ case BCM47XX_BOARD_NETGEAR_WGR614_V10: -+ case BCM47XX_BOARD_NETGEAR_WNR1000_V3: -+ for (e = bcma_sflash_st_shrink_tbl; e->name; e++) { -+ if (e->id == id) -+ return e; -+ } -+ return NULL; -+ default: -+ return NULL; -+ } -+} -+ - /* Initialize serial flash access */ - int bcma_sflash_init(struct bcma_drv_cc *cc) - { -@@ -115,6 +141,10 @@ int bcma_sflash_init(struct bcma_drv_cc - case 0x13: - return -ENOTSUPP; - default: -+ e = bcma_sflash_shrink_flash(id); -+ if (e) -+ break; -+ - for (e = bcma_sflash_st_tbl; e->name; e++) { - if (e->id == id) - break; diff --git a/target/linux/bcm47xx/patches-6.1/820-wgt634u-nvram-fix.patch b/target/linux/bcm47xx/patches-6.1/820-wgt634u-nvram-fix.patch deleted file mode 100644 index 82997ca65a..0000000000 --- a/target/linux/bcm47xx/patches-6.1/820-wgt634u-nvram-fix.patch +++ /dev/null @@ -1,296 +0,0 @@ -The Netgear wgt634u uses a different format for storing the -configuration. This patch is needed to read out the correct -configuration. The cfe_env.c file uses a different method way to read -out the configuration than the in kernel cfe config reader. - ---- a/drivers/firmware/broadcom/Makefile -+++ b/drivers/firmware/broadcom/Makefile -@@ -1,4 +1,4 @@ - # SPDX-License-Identifier: GPL-2.0-only --obj-$(CONFIG_BCM47XX_NVRAM) += bcm47xx_nvram.o -+obj-$(CONFIG_BCM47XX_NVRAM) += bcm47xx_nvram.o cfe_env.o - obj-$(CONFIG_BCM47XX_SPROM) += bcm47xx_sprom.o - obj-$(CONFIG_TEE_BNXT_FW) += tee_bnxt_fw.o ---- /dev/null -+++ b/drivers/firmware/broadcom/cfe_env.c -@@ -0,0 +1,228 @@ -+/* -+ * CFE environment variable access -+ * -+ * Copyright 2001-2003, Broadcom Corporation -+ * Copyright 2006, Felix Fietkau -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License as published by the -+ * Free Software Foundation; either version 2 of the License, or (at your -+ * option) any later version. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define NVRAM_SIZE (0x1ff0) -+static char _nvdata[NVRAM_SIZE]; -+static char _valuestr[256]; -+ -+/* -+ * TLV types. These codes are used in the "type-length-value" -+ * encoding of the items stored in the NVRAM device (flash or EEPROM) -+ * -+ * The layout of the flash/nvram is as follows: -+ * -+ * -+ * -+ * The type code of "ENV_TLV_TYPE_END" marks the end of the list. -+ * The "length" field marks the length of the data section, not -+ * including the type and length fields. -+ * -+ * Environment variables are stored as follows: -+ * -+ * = -+ * -+ * If bit 0 (low bit) is set, the length is an 8-bit value. -+ * If bit 0 (low bit) is clear, the length is a 16-bit value -+ * -+ * Bit 7 set indicates "user" TLVs. In this case, bit 0 still -+ * indicates the size of the length field. -+ * -+ * Flags are from the constants below: -+ * -+ */ -+#define ENV_LENGTH_16BITS 0x00 /* for low bit */ -+#define ENV_LENGTH_8BITS 0x01 -+ -+#define ENV_TYPE_USER 0x80 -+ -+#define ENV_CODE_SYS(n,l) (((n)<<1)|(l)) -+#define ENV_CODE_USER(n,l) ((((n)<<1)|(l)) | ENV_TYPE_USER) -+ -+/* -+ * The actual TLV types we support -+ */ -+ -+#define ENV_TLV_TYPE_END 0x00 -+#define ENV_TLV_TYPE_ENV ENV_CODE_SYS(0,ENV_LENGTH_8BITS) -+ -+/* -+ * Environment variable flags -+ */ -+ -+#define ENV_FLG_NORMAL 0x00 /* normal read/write */ -+#define ENV_FLG_BUILTIN 0x01 /* builtin - not stored in flash */ -+#define ENV_FLG_READONLY 0x02 /* read-only - cannot be changed */ -+ -+#define ENV_FLG_MASK 0xFF /* mask of attributes we keep */ -+#define ENV_FLG_ADMIN 0x100 /* lets us internally override permissions */ -+ -+ -+/* ********************************************************************* -+ * _nvram_read(buffer,offset,length) -+ * -+ * Read data from the NVRAM device -+ * -+ * Input parameters: -+ * buffer - destination buffer -+ * offset - offset of data to read -+ * length - number of bytes to read -+ * -+ * Return value: -+ * number of bytes read, or <0 if error occured -+ ********************************************************************* */ -+static int -+_nvram_read(unsigned char *nv_buf, unsigned char *buffer, int offset, int length) -+{ -+ int i; -+ if (offset > NVRAM_SIZE) -+ return -1; -+ -+ for ( i = 0; i < length; i++) { -+ buffer[i] = ((volatile unsigned char*)nv_buf)[offset + i]; -+ } -+ return length; -+} -+ -+ -+static char* -+_strnchr(const char *dest,int c,size_t cnt) -+{ -+ while (*dest && (cnt > 0)) { -+ if (*dest == c) return (char *) dest; -+ dest++; -+ cnt--; -+ } -+ return NULL; -+} -+ -+ -+ -+/* -+ * Core support API: Externally visible. -+ */ -+ -+/* -+ * Get the value of an NVRAM variable -+ * @param name name of variable to get -+ * @return value of variable or NULL if undefined -+ */ -+ -+char *cfe_env_get(unsigned char *nv_buf, const char *name) -+{ -+ int size; -+ unsigned char *buffer; -+ unsigned char *ptr; -+ unsigned char *envval; -+ unsigned int reclen; -+ unsigned int rectype; -+ int offset; -+ int flg; -+ -+ if (!strcmp(name, "nvram_type")) -+ return "cfe"; -+ -+ size = NVRAM_SIZE; -+ buffer = &_nvdata[0]; -+ -+ ptr = buffer; -+ offset = 0; -+ -+ /* Read the record type and length */ -+ if (_nvram_read(nv_buf, ptr,offset,1) != 1) { -+ goto error; -+ } -+ -+ while ((*ptr != ENV_TLV_TYPE_END) && (size > 1)) { -+ -+ /* Adjust pointer for TLV type */ -+ rectype = *(ptr); -+ offset++; -+ size--; -+ -+ /* -+ * Read the length. It can be either 1 or 2 bytes -+ * depending on the code -+ */ -+ if (rectype & ENV_LENGTH_8BITS) { -+ /* Read the record type and length - 8 bits */ -+ if (_nvram_read(nv_buf, ptr,offset,1) != 1) { -+ goto error; -+ } -+ reclen = *(ptr); -+ size--; -+ offset++; -+ } -+ else { -+ /* Read the record type and length - 16 bits, MSB first */ -+ if (_nvram_read(nv_buf, ptr,offset,2) != 2) { -+ goto error; -+ } -+ reclen = (((unsigned int) *(ptr)) << 8) + (unsigned int) *(ptr+1); -+ size -= 2; -+ offset += 2; -+ } -+ -+ if (reclen > size) -+ break; /* should not happen, bad NVRAM */ -+ -+ switch (rectype) { -+ case ENV_TLV_TYPE_ENV: -+ /* Read the TLV data */ -+ if (_nvram_read(nv_buf, ptr,offset,reclen) != reclen) -+ goto error; -+ flg = *ptr++; -+ envval = (unsigned char *) _strnchr(ptr,'=',(reclen-1)); -+ if (envval) { -+ *envval++ = '\0'; -+ memcpy(_valuestr,envval,(reclen-1)-(envval-ptr)); -+ _valuestr[(reclen-1)-(envval-ptr)] = '\0'; -+#if 0 -+ printk(KERN_INFO "NVRAM:%s=%s\n", ptr, _valuestr); -+#endif -+ if(!strcmp(ptr, name)){ -+ return _valuestr; -+ } -+ if((strlen(ptr) > 1) && !strcmp(&ptr[1], name)) -+ return _valuestr; -+ } -+ break; -+ -+ default: -+ /* Unknown TLV type, skip it. */ -+ break; -+ } -+ -+ /* -+ * Advance to next TLV -+ */ -+ -+ size -= (int)reclen; -+ offset += reclen; -+ -+ /* Read the next record type */ -+ ptr = buffer; -+ if (_nvram_read(nv_buf, ptr,offset,1) != 1) -+ goto error; -+ } -+ -+error: -+ return NULL; -+ -+} -+ ---- a/drivers/firmware/broadcom/bcm47xx_nvram.c -+++ b/drivers/firmware/broadcom/bcm47xx_nvram.c -@@ -33,6 +33,8 @@ struct nvram_header { - static char nvram_buf[NVRAM_SPACE]; - static size_t nvram_len; - static const u32 nvram_sizes[] = {0x6000, 0x8000, 0xF000, 0x10000}; -+static int cfe_env; -+extern char *cfe_env_get(char *nv_buf, const char *name); - - /** - * bcm47xx_nvram_is_valid - check for a valid NVRAM at specified memory -@@ -80,6 +82,26 @@ static int bcm47xx_nvram_find_and_copy(v - return -EEXIST; - } - -+ cfe_env = 0; -+ -+ /* XXX: hack for supporting the CFE environment stuff on WGT634U */ -+ if (res_size >= 8 * 1024 * 1024) { -+ u32 *src = (u32 *)(flash_start + 8 * 1024 * 1024 - 0x2000); -+ u32 *dst = (u32 *)nvram_buf; -+ -+ if ((*src & 0xff00ff) == 0x000001) { -+ printk("early_nvram_init: WGT634U NVRAM found.\n"); -+ -+ for (i = 0; i < 0x1ff0; i++) { -+ if (*src == 0xFFFFFFFF) -+ break; -+ *dst++ = *src++; -+ } -+ cfe_env = 1; -+ return 0; -+ } -+ } -+ - /* TODO: when nvram is on nand flash check for bad blocks first. */ - - /* Try every possible flash size and check for NVRAM at its end */ -@@ -190,6 +212,13 @@ int bcm47xx_nvram_getenv(const char *nam - if (!name) - return -EINVAL; - -+ if (cfe_env) { -+ value = cfe_env_get(nvram_buf, name); -+ if (!value) -+ return -ENOENT; -+ return snprintf(val, val_len, "%s", value); -+ } -+ - if (!nvram_len) { - err = nvram_init(); - if (err) diff --git a/target/linux/bcm47xx/patches-6.1/830-huawei_e970_support.patch b/target/linux/bcm47xx/patches-6.1/830-huawei_e970_support.patch deleted file mode 100644 index 1746fee592..0000000000 --- a/target/linux/bcm47xx/patches-6.1/830-huawei_e970_support.patch +++ /dev/null @@ -1,101 +0,0 @@ ---- a/arch/mips/bcm47xx/setup.c -+++ b/arch/mips/bcm47xx/setup.c -@@ -37,6 +37,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -254,6 +255,33 @@ static struct fixed_phy_status bcm47xx_f - .duplex = DUPLEX_FULL, - }; - -+static struct gpio_wdt_platform_data gpio_wdt_data; -+ -+static struct platform_device gpio_wdt_device = { -+ .name = "gpio-wdt", -+ .id = 0, -+ .dev = { -+ .platform_data = &gpio_wdt_data, -+ }, -+}; -+ -+static int __init bcm47xx_register_gpio_watchdog(void) -+{ -+ enum bcm47xx_board board = bcm47xx_board_get(); -+ -+ switch (board) { -+ case BCM47XX_BOARD_HUAWEI_E970: -+ pr_info("bcm47xx: detected Huawei E970 or similar, starting early gpio_wdt timer\n"); -+ gpio_wdt_data.gpio = 7; -+ gpio_wdt_data.interval = HZ; -+ gpio_wdt_data.first_interval = HZ / 5; -+ return platform_device_register(&gpio_wdt_device); -+ default: -+ /* Nothing to do */ -+ return 0; -+ } -+} -+ - static int __init bcm47xx_register_bus_complete(void) - { - switch (bcm47xx_bus_type) { -@@ -275,6 +303,7 @@ static int __init bcm47xx_register_bus_c - bcm47xx_workarounds(); - - fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status); -+ bcm47xx_register_gpio_watchdog(); - return 0; - } - device_initcall(bcm47xx_register_bus_complete); ---- a/arch/mips/configs/bcm47xx_defconfig -+++ b/arch/mips/configs/bcm47xx_defconfig -@@ -63,6 +63,7 @@ CONFIG_HW_RANDOM=y - CONFIG_GPIO_SYSFS=y - CONFIG_WATCHDOG=y - CONFIG_BCM47XX_WDT=y -+CONFIG_GPIO_WDT=y - CONFIG_SSB_DRIVER_GIGE=y - CONFIG_BCMA_DRIVER_GMAC_CMN=y - CONFIG_USB=y ---- a/drivers/ssb/embedded.c -+++ b/drivers/ssb/embedded.c -@@ -34,11 +34,36 @@ int ssb_watchdog_timer_set(struct ssb_bu - } - EXPORT_SYMBOL(ssb_watchdog_timer_set); - -+#ifdef CONFIG_BCM47XX -+#include -+ -+static bool ssb_watchdog_supported(void) -+{ -+ enum bcm47xx_board board = bcm47xx_board_get(); -+ -+ /* The Huawei E970 has a hardware watchdog using a GPIO */ -+ switch (board) { -+ case BCM47XX_BOARD_HUAWEI_E970: -+ return false; -+ default: -+ return true; -+ } -+} -+#else -+static bool ssb_watchdog_supported(void) -+{ -+ return true; -+} -+#endif -+ - int ssb_watchdog_register(struct ssb_bus *bus) - { - struct bcm47xx_wdt wdt = {}; - struct platform_device *pdev; - -+ if (!ssb_watchdog_supported()) -+ return 0; -+ - if (ssb_chipco_available(&bus->chipco)) { - wdt.driver_data = &bus->chipco; - wdt.timer_set = ssb_chipco_watchdog_timer_set_wdt; diff --git a/target/linux/bcm47xx/patches-6.1/831-old_gpio_wdt.patch b/target/linux/bcm47xx/patches-6.1/831-old_gpio_wdt.patch deleted file mode 100644 index 55639c6d2e..0000000000 --- a/target/linux/bcm47xx/patches-6.1/831-old_gpio_wdt.patch +++ /dev/null @@ -1,360 +0,0 @@ -This generic GPIO watchdog is used on Huawei E970 (bcm47xx) - -Signed-off-by: Mathias Adam - ---- a/drivers/watchdog/Kconfig -+++ b/drivers/watchdog/Kconfig -@@ -1728,6 +1728,15 @@ config WDT_MTX1 - Hardware driver for the MTX-1 boards. This is a watchdog timer that - will reboot the machine after a 100 seconds timer expired. - -+config GPIO_WDT -+ tristate "GPIO Hardware Watchdog" -+ help -+ Hardware driver for GPIO-controlled watchdogs. GPIO pin and -+ toggle interval settings are platform-specific. The driver -+ will stop toggling the GPIO (i.e. machine reboots) after a -+ 100 second timer expired and no process has written to -+ /dev/watchdog during that time. -+ - config SIBYTE_WDOG - tristate "Sibyte SoC hardware watchdog" - depends on CPU_SB1 ---- a/drivers/watchdog/Makefile -+++ b/drivers/watchdog/Makefile -@@ -164,6 +164,7 @@ obj-$(CONFIG_RC32434_WDT) += rc32434_wdt - obj-$(CONFIG_INDYDOG) += indydog.o - obj-$(CONFIG_JZ4740_WDT) += jz4740_wdt.o - obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o -+obj-$(CONFIG_GPIO_WDT) += old_gpio_wdt.o - obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o - obj-$(CONFIG_AR7_WDT) += ar7_wdt.o - obj-$(CONFIG_TXX9_WDT) += txx9wdt.o ---- /dev/null -+++ b/drivers/watchdog/old_gpio_wdt.c -@@ -0,0 +1,301 @@ -+/* -+ * Driver for GPIO-controlled Hardware Watchdogs. -+ * -+ * Copyright (C) 2013 Mathias Adam -+ * -+ * Replaces mtx1_wdt (driver for the MTX-1 Watchdog): -+ * -+ * (C) Copyright 2005 4G Systems , -+ * All Rights Reserved. -+ * http://www.4g-systems.biz -+ * -+ * (C) Copyright 2007 OpenWrt.org, Florian Fainelli -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version -+ * 2 of the License, or (at your option) any later version. -+ * -+ * Neither Michael Stickel nor 4G Systems admit liability nor provide -+ * warranty for any of this software. This material is provided -+ * "AS-IS" and at no charge. -+ * -+ * (c) Copyright 2005 4G Systems -+ * -+ * Release 0.01. -+ * Author: Michael Stickel michael.stickel@4g-systems.biz -+ * -+ * Release 0.02. -+ * Author: Florian Fainelli florian@openwrt.org -+ * use the Linux watchdog/timer APIs -+ * -+ * Release 0.03. -+ * Author: Mathias Adam -+ * make it a generic gpio watchdog driver -+ * -+ * The Watchdog is configured to reset the MTX-1 -+ * if it is not triggered for 100 seconds. -+ * It should not be triggered more often than 1.6 seconds. -+ * -+ * A timer triggers the watchdog every 5 seconds, until -+ * it is opened for the first time. After the first open -+ * it MUST be triggered every 2..95 seconds. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static int ticks = 100 * HZ; -+ -+static struct { -+ struct completion stop; -+ spinlock_t lock; -+ int running; -+ struct timer_list timer; -+ int queue; -+ int default_ticks; -+ unsigned long inuse; -+ unsigned gpio; -+ unsigned int gstate; -+ int interval; -+ int first_interval; -+} gpio_wdt_device; -+ -+static void gpio_wdt_trigger(struct timer_list *unused) -+{ -+ spin_lock(&gpio_wdt_device.lock); -+ if (gpio_wdt_device.running && ticks > 0) -+ ticks -= gpio_wdt_device.interval; -+ -+ /* toggle wdt gpio */ -+ gpio_wdt_device.gstate = !gpio_wdt_device.gstate; -+ gpio_set_value(gpio_wdt_device.gpio, gpio_wdt_device.gstate); -+ -+ if (gpio_wdt_device.queue && ticks > 0) -+ mod_timer(&gpio_wdt_device.timer, jiffies + gpio_wdt_device.interval); -+ else -+ complete(&gpio_wdt_device.stop); -+ spin_unlock(&gpio_wdt_device.lock); -+} -+ -+static void gpio_wdt_reset(void) -+{ -+ ticks = gpio_wdt_device.default_ticks; -+} -+ -+ -+static void gpio_wdt_start(void) -+{ -+ unsigned long flags; -+ -+ spin_lock_irqsave(&gpio_wdt_device.lock, flags); -+ if (!gpio_wdt_device.queue) { -+ gpio_wdt_device.queue = 1; -+ gpio_wdt_device.gstate = 1; -+ gpio_set_value(gpio_wdt_device.gpio, 1); -+ mod_timer(&gpio_wdt_device.timer, jiffies + gpio_wdt_device.first_interval); -+ } -+ gpio_wdt_device.running++; -+ spin_unlock_irqrestore(&gpio_wdt_device.lock, flags); -+} -+ -+static int gpio_wdt_stop(void) -+{ -+ unsigned long flags; -+ -+ spin_lock_irqsave(&gpio_wdt_device.lock, flags); -+ if (gpio_wdt_device.queue) { -+ gpio_wdt_device.queue = 0; -+ gpio_wdt_device.gstate = 0; -+ gpio_set_value(gpio_wdt_device.gpio, 0); -+ } -+ ticks = gpio_wdt_device.default_ticks; -+ spin_unlock_irqrestore(&gpio_wdt_device.lock, flags); -+ return 0; -+} -+ -+/* Filesystem functions */ -+ -+static int gpio_wdt_open(struct inode *inode, struct file *file) -+{ -+ if (test_and_set_bit(0, &gpio_wdt_device.inuse)) -+ return -EBUSY; -+ return nonseekable_open(inode, file); -+} -+ -+ -+static int gpio_wdt_release(struct inode *inode, struct file *file) -+{ -+ clear_bit(0, &gpio_wdt_device.inuse); -+ return 0; -+} -+ -+static long gpio_wdt_ioctl(struct file *file, unsigned int cmd, -+ unsigned long arg) -+{ -+ void __user *argp = (void __user *)arg; -+ int __user *p = (int __user *)argp; -+ unsigned int value; -+ static const struct watchdog_info ident = { -+ .options = WDIOF_CARDRESET, -+ .identity = "GPIO WDT", -+ }; -+ -+ switch (cmd) { -+ case WDIOC_GETSUPPORT: -+ if (copy_to_user(argp, &ident, sizeof(ident))) -+ return -EFAULT; -+ break; -+ case WDIOC_GETSTATUS: -+ case WDIOC_GETBOOTSTATUS: -+ put_user(0, p); -+ break; -+ case WDIOC_SETOPTIONS: -+ if (get_user(value, p)) -+ return -EFAULT; -+ if (value & WDIOS_ENABLECARD) -+ gpio_wdt_start(); -+ else if (value & WDIOS_DISABLECARD) -+ gpio_wdt_stop(); -+ else -+ return -EINVAL; -+ return 0; -+ case WDIOC_KEEPALIVE: -+ gpio_wdt_reset(); -+ break; -+ default: -+ return -ENOTTY; -+ } -+ return 0; -+} -+ -+ -+static ssize_t gpio_wdt_write(struct file *file, const char *buf, -+ size_t count, loff_t *ppos) -+{ -+ if (!count) -+ return -EIO; -+ gpio_wdt_reset(); -+ return count; -+} -+ -+static const struct file_operations gpio_wdt_fops = { -+ .owner = THIS_MODULE, -+ .llseek = no_llseek, -+ .unlocked_ioctl = gpio_wdt_ioctl, -+ .open = gpio_wdt_open, -+ .write = gpio_wdt_write, -+ .release = gpio_wdt_release, -+}; -+ -+ -+static struct miscdevice gpio_wdt_misc = { -+ .minor = WATCHDOG_MINOR, -+ .name = "watchdog", -+ .fops = &gpio_wdt_fops, -+}; -+ -+ -+static int gpio_wdt_probe(struct platform_device *pdev) -+{ -+ int ret; -+ struct gpio_wdt_platform_data *gpio_wdt_data = pdev->dev.platform_data; -+ -+ gpio_wdt_device.gpio = gpio_wdt_data->gpio; -+ gpio_wdt_device.interval = gpio_wdt_data->interval; -+ gpio_wdt_device.first_interval = gpio_wdt_data->first_interval; -+ if (gpio_wdt_device.first_interval <= 0) { -+ gpio_wdt_device.first_interval = gpio_wdt_device.interval; -+ } -+ -+ ret = gpio_request(gpio_wdt_device.gpio, "gpio-wdt"); -+ if (ret < 0) { -+ dev_err(&pdev->dev, "failed to request gpio"); -+ return ret; -+ } -+ -+ spin_lock_init(&gpio_wdt_device.lock); -+ init_completion(&gpio_wdt_device.stop); -+ gpio_wdt_device.queue = 0; -+ clear_bit(0, &gpio_wdt_device.inuse); -+ timer_setup(&gpio_wdt_device.timer, gpio_wdt_trigger, 0L); -+ gpio_wdt_device.default_ticks = ticks; -+ -+ gpio_wdt_start(); -+ dev_info(&pdev->dev, "GPIO Hardware Watchdog driver (gpio=%i interval=%i/%i)\n", -+ gpio_wdt_data->gpio, gpio_wdt_data->first_interval, gpio_wdt_data->interval); -+ return 0; -+} -+ -+static int gpio_wdt_remove(struct platform_device *pdev) -+{ -+ /* FIXME: do we need to lock this test ? */ -+ if (gpio_wdt_device.queue) { -+ gpio_wdt_device.queue = 0; -+ wait_for_completion(&gpio_wdt_device.stop); -+ } -+ -+ gpio_free(gpio_wdt_device.gpio); -+ misc_deregister(&gpio_wdt_misc); -+ return 0; -+} -+ -+static struct platform_driver gpio_wdt_driver = { -+ .probe = gpio_wdt_probe, -+ .remove = gpio_wdt_remove, -+ .driver.name = "gpio-wdt", -+ .driver.owner = THIS_MODULE, -+}; -+ -+static int __init gpio_wdt_init(void) -+{ -+ return platform_driver_register(&gpio_wdt_driver); -+} -+arch_initcall(gpio_wdt_init); -+ -+/* -+ * We do wdt initialization in two steps: arch_initcall probes the wdt -+ * very early to start pinging the watchdog (misc devices are not yet -+ * available), and later module_init() just registers the misc device. -+ */ -+static int gpio_wdt_init_late(void) -+{ -+ int ret; -+ -+ ret = misc_register(&gpio_wdt_misc); -+ if (ret < 0) { -+ pr_err("GPIO_WDT: failed to register misc device\n"); -+ return ret; -+ } -+ return 0; -+} -+#ifndef MODULE -+module_init(gpio_wdt_init_late); -+#endif -+ -+static void __exit gpio_wdt_exit(void) -+{ -+ platform_driver_unregister(&gpio_wdt_driver); -+} -+module_exit(gpio_wdt_exit); -+ -+MODULE_AUTHOR("Michael Stickel, Florian Fainelli, Mathias Adam"); -+MODULE_DESCRIPTION("Driver for GPIO hardware watchdogs"); -+MODULE_LICENSE("GPL"); -+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); -+MODULE_ALIAS("platform:gpio-wdt"); ---- /dev/null -+++ b/include/linux/old_gpio_wdt.h -@@ -0,0 +1,21 @@ -+/* -+ * Definitions for the GPIO watchdog driver -+ * -+ * Copyright (C) 2013 Mathias Adam -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#ifndef _GPIO_WDT_H_ -+#define _GPIO_WDT_H_ -+ -+struct gpio_wdt_platform_data { -+ int gpio; /* GPIO line number */ -+ int interval; /* watchdog reset interval in system ticks */ -+ int first_interval; /* first wd reset interval in system ticks */ -+}; -+ -+#endif /* _GPIO_WDT_H_ */ diff --git a/target/linux/bcm47xx/patches-6.1/900-ssb-reject-PCI-writes-setting-CardBus-bridge-resourc.patch b/target/linux/bcm47xx/patches-6.1/900-ssb-reject-PCI-writes-setting-CardBus-bridge-resourc.patch deleted file mode 100644 index 970e36eb68..0000000000 --- a/target/linux/bcm47xx/patches-6.1/900-ssb-reject-PCI-writes-setting-CardBus-bridge-resourc.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 5c81397a0147ea59c778d1de14ef54e2268221f6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Wed, 8 Apr 2015 06:58:11 +0200 -Subject: [PATCH] ssb: reject PCI writes setting CardBus bridge resources -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If SoC has a CardBus we can set resources of device at slot 1 only. It's -impossigle to set bridge resources as it simply overwrites device 1 -configuration and usually results in Data bus error-s. - -Signed-off-by: Rafał Miłecki ---- - drivers/ssb/driver_pcicore.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/ssb/driver_pcicore.c -+++ b/drivers/ssb/driver_pcicore.c -@@ -165,6 +165,10 @@ static int ssb_extpci_write_config(struc - WARN_ON(!pc->hostmode); - if (unlikely(len != 1 && len != 2 && len != 4)) - goto out; -+ /* CardBus SoCs allow configuring dev 1 resources only */ -+ if (extpci_core->cardbusmode && dev != 1 && -+ off >= PCI_BASE_ADDRESS_0 && off <= PCI_BASE_ADDRESS_5) -+ goto out; - addr = get_cfgspace_addr(pc, bus, dev, func, off); - if (unlikely(!addr)) - goto out; diff --git a/target/linux/bcm47xx/patches-6.1/940-bcm47xx-yenta.patch b/target/linux/bcm47xx/patches-6.1/940-bcm47xx-yenta.patch deleted file mode 100644 index f1b46c2ce4..0000000000 --- a/target/linux/bcm47xx/patches-6.1/940-bcm47xx-yenta.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- a/drivers/pcmcia/yenta_socket.c -+++ b/drivers/pcmcia/yenta_socket.c -@@ -925,6 +925,8 @@ static struct cardbus_type cardbus_type[ - - static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mask) - { -+/* WRT54G3G does not like this */ -+#ifndef CONFIG_BCM47XX - int i; - unsigned long val; - u32 mask; -@@ -953,6 +955,9 @@ static unsigned int yenta_probe_irq(stru - mask = probe_irq_mask(val) & 0xffff; - - return mask; -+#else -+ return 0; -+#endif - } - - -@@ -1033,6 +1038,10 @@ static void yenta_get_socket_capabilitie - else - socket->socket.irq_mask = 0; - -+ /* irq mask probing is broken for the WRT54G3G */ -+ if (socket->socket.irq_mask == 0) -+ socket->socket.irq_mask = 0x6f8; -+ - dev_info(&socket->dev->dev, "ISA IRQ mask 0x%04x, PCI irq %d\n", - socket->socket.irq_mask, socket->cb_irq); - } -@@ -1264,6 +1273,15 @@ static int yenta_probe(struct pci_dev *d - dev_info(&dev->dev, "Socket status: %08x\n", - cb_readl(socket, CB_SOCKET_STATE)); - -+ /* Generate an interrupt on card insert/remove */ -+ config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK); -+ -+ /* Set up Multifunction Routing Status Register */ -+ config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */); -+ -+ /* Switch interrupts to parallelized */ -+ config_writeb(socket, 0x92, 0x64); -+ - yenta_fixup_parent_bridge(dev->subordinate); - - /* Register it with the pcmcia layer.. */ diff --git a/target/linux/bcm47xx/patches-6.1/976-ssb_increase_pci_delay.patch b/target/linux/bcm47xx/patches-6.1/976-ssb_increase_pci_delay.patch deleted file mode 100644 index 201be1b187..0000000000 --- a/target/linux/bcm47xx/patches-6.1/976-ssb_increase_pci_delay.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/ssb/driver_pcicore.c -+++ b/drivers/ssb/driver_pcicore.c -@@ -394,7 +394,7 @@ static void ssb_pcicore_init_hostmode(st - /* Give some time to the PCI controller to configure itself with the new - * values. Not waiting at this point causes crashes of the machine. - */ -- mdelay(10); -+ mdelay(300); - register_pci_controller(&ssb_pcicore_controller); - } - diff --git a/target/linux/bcm47xx/patches-6.6/160-kmap_coherent.patch b/target/linux/bcm47xx/patches-6.6/160-kmap_coherent.patch deleted file mode 100644 index 19ab8df7c4..0000000000 --- a/target/linux/bcm47xx/patches-6.6/160-kmap_coherent.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Jeff Hansen -Subject: [PATCH] kmap_coherent - -On ASUS WL-500gP there are some "Data bus error"s when executing simple -commands liks "ps" or "cat /proc/1/cmdline". - -This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485 ---- ---- a/arch/mips/include/asm/cpu-features.h -+++ b/arch/mips/include/asm/cpu-features.h -@@ -257,6 +257,9 @@ - #ifndef cpu_has_pindexed_dcache - #define cpu_has_pindexed_dcache (cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX) - #endif -+#ifndef cpu_use_kmap_coherent -+#define cpu_use_kmap_coherent 1 -+#endif - - /* - * I-Cache snoops remote store. This only matters on SMP. Some multiprocessors ---- a/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h -+++ b/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h -@@ -79,4 +79,6 @@ - #define cpu_scache_line_size() 0 - #define cpu_has_vz 0 - -+#define cpu_use_kmap_coherent 0 -+ - #endif /* __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H */ ---- a/arch/mips/mm/c-r4k.c -+++ b/arch/mips/mm/c-r4k.c -@@ -618,7 +618,7 @@ static inline void local_r4k_flush_cache - } - - if (vaddr) { -- if (map_coherent) -+ if (map_coherent && cpu_use_kmap_coherent) - kunmap_coherent(); - else - kunmap_atomic(vaddr); ---- a/arch/mips/mm/init.c -+++ b/arch/mips/mm/init.c -@@ -173,7 +173,7 @@ void copy_user_highpage(struct page *to, - void *vfrom, *vto; - - vto = kmap_atomic(to); -- if (cpu_has_dc_aliases && -+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent && - folio_mapped(src) && !folio_test_dcache_dirty(src)) { - vfrom = kmap_coherent(from, vaddr); - copy_page(vto, vfrom); -@@ -197,7 +197,7 @@ void copy_to_user_page(struct vm_area_st - { - struct folio *folio = page_folio(page); - -- if (cpu_has_dc_aliases && -+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent && - folio_mapped(folio) && !folio_test_dcache_dirty(folio)) { - void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); - memcpy(vto, src, len); -@@ -217,7 +217,7 @@ void copy_from_user_page(struct vm_area_ - { - struct folio *folio = page_folio(page); - -- if (cpu_has_dc_aliases && -+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent && - folio_mapped(folio) && !folio_test_dcache_dirty(folio)) { - void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); - memcpy(dst, vfrom, len); diff --git a/target/linux/bcm47xx/patches-6.6/300-fork_cacheflush.patch b/target/linux/bcm47xx/patches-6.6/300-fork_cacheflush.patch deleted file mode 100644 index daa2c1adf0..0000000000 --- a/target/linux/bcm47xx/patches-6.6/300-fork_cacheflush.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Wolfram Joost -Subject: [PATCH] fork_cacheflush - -On ASUS WL-500gP there are many unexpected "Segmentation fault"s that -seem to be caused by a kernel. They can be avoided by: -1) Disabling highpage -2) Using flush_cache_mm in flush_cache_dup_mm - -For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035 ---- ---- a/arch/mips/include/asm/cacheflush.h -+++ b/arch/mips/include/asm/cacheflush.h -@@ -46,7 +46,7 @@ - extern void (*flush_cache_all)(void); - extern void (*__flush_cache_all)(void); - extern void (*flush_cache_mm)(struct mm_struct *mm); --#define flush_cache_dup_mm(mm) do { (void) (mm); } while (0) -+#define flush_cache_dup_mm(mm) flush_cache_mm(mm) - extern void (*flush_cache_range)(struct vm_area_struct *vma, - unsigned long start, unsigned long end); - extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn); diff --git a/target/linux/bcm47xx/patches-6.6/310-no_highpage.patch b/target/linux/bcm47xx/patches-6.6/310-no_highpage.patch deleted file mode 100644 index 7a4cd6ed90..0000000000 --- a/target/linux/bcm47xx/patches-6.6/310-no_highpage.patch +++ /dev/null @@ -1,75 +0,0 @@ -From: Jeff Hansen -Subject: [PATCH] no highpage - -On ASUS WL-500gP there are many unexpected "Segmentation fault"s that -seem to be caused by a kernel. They can be avoided by: -1) Disabling highpage -2) Using flush_cache_mm in flush_cache_dup_mm - -For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035 ---- ---- a/arch/mips/include/asm/page.h -+++ b/arch/mips/include/asm/page.h -@@ -71,6 +71,7 @@ static inline unsigned int page_size_ftl - #endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */ - - #include -+#include - - extern void build_clear_page(void); - extern void build_copy_page(void); -@@ -110,11 +111,16 @@ static inline void clear_user_page(void - flush_data_cache_page((unsigned long)addr); - } - --struct vm_area_struct; --extern void copy_user_highpage(struct page *to, struct page *from, -- unsigned long vaddr, struct vm_area_struct *vma); -+static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, -+ struct page *to) -+{ -+ extern void (*flush_data_cache_page)(unsigned long addr); - --#define __HAVE_ARCH_COPY_USER_HIGHPAGE -+ copy_page(vto, vfrom); -+ if (!cpu_has_ic_fills_f_dc || -+ pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK)) -+ flush_data_cache_page((unsigned long)vto); -+} - - /* - * These are used to make use of C type-checking.. ---- a/arch/mips/mm/init.c -+++ b/arch/mips/mm/init.c -@@ -166,31 +166,6 @@ void kunmap_coherent(void) - preempt_enable(); - } - --void copy_user_highpage(struct page *to, struct page *from, -- unsigned long vaddr, struct vm_area_struct *vma) --{ -- struct folio *src = page_folio(from); -- void *vfrom, *vto; -- -- vto = kmap_atomic(to); -- if (cpu_has_dc_aliases && cpu_use_kmap_coherent && -- folio_mapped(src) && !folio_test_dcache_dirty(src)) { -- vfrom = kmap_coherent(from, vaddr); -- copy_page(vto, vfrom); -- kunmap_coherent(); -- } else { -- vfrom = kmap_atomic(from); -- copy_page(vto, vfrom); -- kunmap_atomic(vfrom); -- } -- if ((!cpu_has_ic_fills_f_dc) || -- pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK)) -- flush_data_cache_page((unsigned long)vto); -- kunmap_atomic(vto); -- /* Make sure this page is cleared on other CPU's too before using it */ -- smp_wmb(); --} -- - void copy_to_user_page(struct vm_area_struct *vma, - struct page *page, unsigned long vaddr, void *dst, const void *src, - unsigned long len) diff --git a/target/linux/bmips/patches-6.6/010-v6.10-mips-bmips-BCM6358-make-sure-CBR-is-correctly-set.patch b/target/linux/bmips/patches-6.6/010-v6.10-mips-bmips-BCM6358-make-sure-CBR-is-correctly-set.patch deleted file mode 100644 index 0a5a7c2402..0000000000 --- a/target/linux/bmips/patches-6.6/010-v6.10-mips-bmips-BCM6358-make-sure-CBR-is-correctly-set.patch +++ /dev/null @@ -1,35 +0,0 @@ -From ce5cdd3b05216b704a704f466fb4c2dff3778caf Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Tue, 11 Jun 2024 13:35:33 +0200 -Subject: [PATCH] mips: bmips: BCM6358: make sure CBR is correctly set - -It was discovered that some device have CBR address set to 0 causing -kernel panic when arch_sync_dma_for_cpu_all is called. - -This was notice in situation where the system is booted from TP1 and -BMIPS_GET_CBR() returns 0 instead of a valid address and -!!(read_c0_brcm_cmt_local() & (1 << 31)); not failing. - -The current check whether RAC flush should be disabled or not are not -enough hence lets check if CBR is a valid address or not. - -Fixes: ab327f8acdf8 ("mips: bmips: BCM6358: disable RAC flush for TP1") -Signed-off-by: Christian Marangi -Acked-by: Florian Fainelli -Signed-off-by: Thomas Bogendoerfer ---- - arch/mips/bmips/setup.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/arch/mips/bmips/setup.c -+++ b/arch/mips/bmips/setup.c -@@ -110,7 +110,8 @@ static void bcm6358_quirks(void) - * RAC flush causes kernel panics on BCM6358 when booting from TP1 - * because the bootloader is not initializing it properly. - */ -- bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31)); -+ bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31)) || -+ !!BMIPS_GET_CBR(); - } - - static void bcm6368_quirks(void) diff --git a/target/linux/generic/pending-6.6/734-net-ethernet-mediatek-Allow-gaps-in-MAC-allocation.patch b/target/linux/generic/backport-6.6/752-28-v6.10-net-ethernet-mediatek-Allow-gaps-in-MAC-allocation.patch similarity index 72% rename from target/linux/generic/pending-6.6/734-net-ethernet-mediatek-Allow-gaps-in-MAC-allocation.patch rename to target/linux/generic/backport-6.6/752-28-v6.10-net-ethernet-mediatek-Allow-gaps-in-MAC-allocation.patch index 8e1ad54a53..b62586b992 100644 --- a/target/linux/generic/pending-6.6/734-net-ethernet-mediatek-Allow-gaps-in-MAC-allocation.patch +++ b/target/linux/generic/backport-6.6/752-28-v6.10-net-ethernet-mediatek-Allow-gaps-in-MAC-allocation.patch @@ -1,10 +1,6 @@ -From 379ae584cea112db60f4ada79c7e5ba4f3364a64 Mon Sep 17 00:00:00 2001 -X-Patchwork-Submitter: Daniel Golle -X-Patchwork-Id: 13718593 -X-Patchwork-Delegate: kuba@kernel.org -List-Id: +From 3b2aef99221d395ce37efa426d7b50e7dcd621d6 Mon Sep 17 00:00:00 2001 From: Daniel Golle -Date: Mon, 1 Jul 2024 19:26:28 +0100 +Date: Mon, 1 Jul 2024 20:28:14 +0100 Subject: [PATCH] net: ethernet: mediatek: Allow gaps in MAC allocation Some devices with MediaTek SoCs don't use the first but only the second @@ -16,13 +12,16 @@ using 'continue' instead of aborting the loop using 'break'. Fixes: dee4dd10c79a ("net: ethernet: mtk_eth_soc: ppe: add support for multiple PPEs") Suggested-by: Elad Yifee Signed-off-by: Daniel Golle +Reviewed-by: Przemek Kitszel +Link: https://patch.msgid.link/379ae584cea112db60f4ada79c7e5ba4f3364a64.1719862038.git.daniel@makrotopia.org +Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3431,7 +3431,7 @@ static int mtk_open(struct net_device *d +@@ -3396,7 +3396,7 @@ static int mtk_open(struct net_device *d for (i = 0; i < MTK_MAX_DEVS; i++) { if (!eth->netdev[i]) diff --git a/target/linux/generic/backport-6.6/752-29-v6.10-net-ethernet-mtk_ppe-Change-PPE-entries-number-to-16.patch b/target/linux/generic/backport-6.6/752-29-v6.10-net-ethernet-mtk_ppe-Change-PPE-entries-number-to-16.patch new file mode 100644 index 0000000000..c6b332f370 --- /dev/null +++ b/target/linux/generic/backport-6.6/752-29-v6.10-net-ethernet-mtk_ppe-Change-PPE-entries-number-to-16.patch @@ -0,0 +1,29 @@ +From ca18300e00d584d5693127eb60c108b84883b8ac Mon Sep 17 00:00:00 2001 +From: Shengyu Qu +Date: Fri, 5 Jul 2024 01:26:26 +0800 +Subject: [PATCH] net: ethernet: mtk_ppe: Change PPE entries number to 16K + +MT7981,7986 and 7988 all supports 32768 PPE entries, and MT7621/MT7620 +supports 16384 PPE entries, but only set to 8192 entries in driver. So +incrase max entries to 16384 instead. + +Signed-off-by: Elad Yifee +Signed-off-by: Shengyu Qu +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/TY3P286MB261103F937DE4EEB0F88437D98DE2@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/mediatek/mtk_ppe.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mediatek/mtk_ppe.h ++++ b/drivers/net/ethernet/mediatek/mtk_ppe.h +@@ -8,7 +8,7 @@ + #include + #include + +-#define MTK_PPE_ENTRIES_SHIFT 3 ++#define MTK_PPE_ENTRIES_SHIFT 4 + #define MTK_PPE_ENTRIES (1024 << MTK_PPE_ENTRIES_SHIFT) + #define MTK_PPE_HASH_MASK (MTK_PPE_ENTRIES - 1) + #define MTK_PPE_WAIT_TIMEOUT_US 1000000 diff --git a/target/linux/generic/backport-6.6/752-30-v6.10-net-ethernet-mtk_eth_soc-implement-.-get-set-_pausep.patch b/target/linux/generic/backport-6.6/752-30-v6.10-net-ethernet-mtk_eth_soc-implement-.-get-set-_pausep.patch new file mode 100644 index 0000000000..09d7054965 --- /dev/null +++ b/target/linux/generic/backport-6.6/752-30-v6.10-net-ethernet-mtk_eth_soc-implement-.-get-set-_pausep.patch @@ -0,0 +1,55 @@ +From 064fbc4e9b5a6dbda7fe7b67dc7e9e95d31f8d75 Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Thu, 4 Jul 2024 11:14:55 +0100 +Subject: [PATCH] net: ethernet: mtk_eth_soc: implement .{get,set}_pauseparam + ethtool ops + +Implement operations to get and set flow-control link parameters. +Both is done by simply calling phylink_ethtool_{get,set}_pauseparam(). +Fix whitespace in mtk_ethtool_ops while at it. + +Signed-off-by: Daniel Golle +Reviewed-by: Michal Kubiak +Reviewed-by: Russell King (Oracle) +Tested-by: Rui Salvaterra +Link: https://patch.msgid.link/e3ece47323444631d6cb479f32af0dfd6d145be0.1720088047.git.daniel@makrotopia.org +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -4462,6 +4462,20 @@ static int mtk_set_rxnfc(struct net_devi + return ret; + } + ++static void mtk_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause) ++{ ++ struct mtk_mac *mac = netdev_priv(dev); ++ ++ phylink_ethtool_get_pauseparam(mac->phylink, pause); ++} ++ ++static int mtk_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause) ++{ ++ struct mtk_mac *mac = netdev_priv(dev); ++ ++ return phylink_ethtool_set_pauseparam(mac->phylink, pause); ++} ++ + static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb, + struct net_device *sb_dev) + { +@@ -4490,8 +4504,10 @@ static const struct ethtool_ops mtk_etht + .get_strings = mtk_get_strings, + .get_sset_count = mtk_get_sset_count, + .get_ethtool_stats = mtk_get_ethtool_stats, ++ .get_pauseparam = mtk_get_pauseparam, ++ .set_pauseparam = mtk_set_pauseparam, + .get_rxnfc = mtk_get_rxnfc, +- .set_rxnfc = mtk_set_rxnfc, ++ .set_rxnfc = mtk_set_rxnfc, + }; + + static const struct net_device_ops mtk_netdev_ops = { diff --git a/target/linux/generic/backport-6.6/801-v6.11-gpio-mmio-do-not-calculate-bgpio_bits-via-ngpios.patch b/target/linux/generic/backport-6.6/801-v6.11-gpio-mmio-do-not-calculate-bgpio_bits-via-ngpios.patch new file mode 100644 index 0000000000..117c879e48 --- /dev/null +++ b/target/linux/generic/backport-6.6/801-v6.11-gpio-mmio-do-not-calculate-bgpio_bits-via-ngpios.patch @@ -0,0 +1,42 @@ +From f07798d7bb9c46d17d80103fb772fd2c75d47919 Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Tue, 25 Jun 2024 09:19:49 +0800 +Subject: [PATCH] gpio: mmio: do not calculate bgpio_bits via "ngpios" + +bgpio_bits must be aligned with the data bus width. For example, on a +32 bit big endian system and we only have 16 GPIOs. If we only assume +bgpio_bits=16 we can never control the GPIO because the base address +is the lowest address. + +low address high address +------------------------------------------------- +| byte3 | byte2 | byte1 | byte0 | +------------------------------------------------- +| NaN | NaN | gpio8-15 | gpio0-7 | +------------------------------------------------- + +Fixes: 55b2395e4e92 ("gpio: mmio: handle "ngpios" properly in bgpio_init()") +Fixes: https://github.com/openwrt/openwrt/issues/15739 +Reported-by: Mark Mentovai +Signed-off-by: Shiji Yang +Suggested-By: Mark Mentovai +Reviewed-by: Jonas Gorski +Tested-by: Lóránd Horváth +Reviewed-by: Linus Walleij +Link: https://lore.kernel.org/r/TYCP286MB089577B47D70F0AB25ABA6F5BCD52@TYCP286MB0895.JPNP286.PROD.OUTLOOK.COM +Signed-off-by: Bartosz Golaszewski +--- + drivers/gpio/gpio-mmio.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/gpio/gpio-mmio.c ++++ b/drivers/gpio/gpio-mmio.c +@@ -622,8 +622,6 @@ int bgpio_init(struct gpio_chip *gc, str + ret = gpiochip_get_ngpios(gc, dev); + if (ret) + gc->ngpio = gc->bgpio_bits; +- else +- gc->bgpio_bits = roundup_pow_of_two(round_up(gc->ngpio, 8)); + + ret = bgpio_setup_io(gc, dat, set, clr, flags); + if (ret) diff --git a/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch b/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch index 2724efa15e..70851ec9ac 100644 --- a/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch +++ b/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch @@ -55,7 +55,7 @@ Signed-off-by: David Bauer /* SGMII */ #define VSPEC1_SGMII_CTRL 0x08 #define VSPEC1_SGMII_CTRL_ANEN BIT(12) /* Aneg enable */ -@@ -241,6 +248,35 @@ out: +@@ -258,10 +265,39 @@ out: return ret; } @@ -90,15 +90,8 @@ Signed-off-by: David Bauer + static int gpy_config_init(struct phy_device *phydev) { - int ret; -@@ -252,7 +288,10 @@ static int gpy_config_init(struct phy_de - - /* Clear all pending interrupts */ - ret = phy_read(phydev, PHY_ISTAT); -- return ret < 0 ? ret : 0; -+ if (ret < 0) -+ return ret; -+ + /* Nothing to configure. Configuration Requirement Placeholder */ +- return 0; + return gpy_led_write(phydev); } diff --git a/target/linux/generic/hack-6.1/902-debloat_proc.patch b/target/linux/generic/hack-6.1/902-debloat_proc.patch index 06b3a04f7a..ee3caa9f47 100644 --- a/target/linux/generic/hack-6.1/902-debloat_proc.patch +++ b/target/linux/generic/hack-6.1/902-debloat_proc.patch @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -4115,6 +4115,8 @@ static __net_initdata struct pernet_oper +@@ -4118,6 +4118,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/hack-6.6/765-mxl-gpy-control-LED-reg-from-DT.patch b/target/linux/generic/hack-6.6/765-mxl-gpy-control-LED-reg-from-DT.patch index 51a03be2ad..fd2a327811 100644 --- a/target/linux/generic/hack-6.6/765-mxl-gpy-control-LED-reg-from-DT.patch +++ b/target/linux/generic/hack-6.6/765-mxl-gpy-control-LED-reg-from-DT.patch @@ -55,7 +55,7 @@ Signed-off-by: David Bauer #define PHY_PMA_MGBT_POLARITY 0x82 #define PHY_MDI_MDI_X_MASK GENMASK(1, 0) #define PHY_MDI_MDI_X_NORMAL 0x3 -@@ -260,6 +267,35 @@ out: +@@ -270,10 +277,39 @@ out: return ret; } @@ -90,15 +90,8 @@ Signed-off-by: David Bauer + static int gpy_config_init(struct phy_device *phydev) { - int ret; -@@ -271,7 +307,10 @@ static int gpy_config_init(struct phy_de - - /* Clear all pending interrupts */ - ret = phy_read(phydev, PHY_ISTAT); -- return ret < 0 ? ret : 0; -+ if (ret < 0) -+ return ret; -+ + /* Nothing to configure. Configuration Requirement Placeholder */ +- return 0; + return gpy_led_write(phydev); } diff --git a/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch b/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch index a4d84f8b7d..7733b45520 100644 --- a/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch +++ b/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch @@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle // Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report // 2500MBd NRZ in their EEPROM SFP_QUIRK_M("Lantech", "8330-262D-E", sfp_quirk_2500basex), -@@ -2586,7 +2589,8 @@ static void sfp_sm_main(struct sfp *sfp, +@@ -2589,7 +2592,8 @@ static void sfp_sm_main(struct sfp *sfp, * or t_start_up, so assume there is a fault. */ sfp_sm_fault(sfp, SFP_S_INIT_TX_FAULT, @@ -46,7 +46,7 @@ Signed-off-by: Daniel Golle } else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) { init_done: /* Create mdiobus and start trying for PHY */ -@@ -2840,10 +2844,12 @@ static void sfp_check_state(struct sfp * +@@ -2843,10 +2847,12 @@ static void sfp_check_state(struct sfp * mutex_lock(&sfp->st_mutex); state = sfp_get_state(sfp); changed = state ^ sfp->state; diff --git a/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch b/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch index 9375a721b5..a011cf8ffa 100644 --- a/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch +++ b/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch @@ -133,7 +133,7 @@ Subject: [PATCH] ssb_sprom: add generic kernel support for Broadcom Fallback SP # host support --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c -@@ -1287,6 +1287,14 @@ static int __init ssb_modinit(void) +@@ -1289,6 +1289,14 @@ static int __init ssb_modinit(void) { int err; diff --git a/target/linux/generic/hack-6.6/902-debloat_proc.patch b/target/linux/generic/hack-6.6/902-debloat_proc.patch index 3b037a732c..26832476c3 100644 --- a/target/linux/generic/hack-6.6/902-debloat_proc.patch +++ b/target/linux/generic/hack-6.6/902-debloat_proc.patch @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -4145,6 +4145,8 @@ static __net_initdata struct pernet_oper +@@ -4148,6 +4148,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/pending-6.1/510-block-add-uImage.FIT-subimage-block-driver.patch b/target/linux/generic/pending-6.1/510-block-add-uImage.FIT-subimage-block-driver.patch index f88136541f..700eda1c8e 100644 --- a/target/linux/generic/pending-6.1/510-block-add-uImage.FIT-subimage-block-driver.patch +++ b/target/linux/generic/pending-6.1/510-block-add-uImage.FIT-subimage-block-driver.patch @@ -645,7 +645,7 @@ Signed-off-by: Daniel Golle + (imgmaxsect + MIN_FREE_SECT) < dsectors) { + add_fit_subimage_device(bdev, slot++, imgmaxsect, + dsectors - imgmaxsect, false); -+ dev_info(dev, "mapped remaing space as /dev/fitrw\n"); ++ dev_info(dev, "mapped remaining space as /dev/fitrw\n"); + } + +out_bootconf: diff --git a/target/linux/generic/pending-6.1/630-packet_socket_type.patch b/target/linux/generic/pending-6.1/630-packet_socket_type.patch index 9c8be72745..359d002b0e 100644 --- a/target/linux/generic/pending-6.1/630-packet_socket_type.patch +++ b/target/linux/generic/pending-6.1/630-packet_socket_type.patch @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -4012,6 +4015,16 @@ packet_setsockopt(struct socket *sock, i +@@ -4014,6 +4017,16 @@ packet_setsockopt(struct socket *sock, i WRITE_ONCE(po->xmit, val ? packet_direct_xmit : dev_queue_xmit); return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -4068,6 +4081,13 @@ static int packet_getsockopt(struct sock +@@ -4070,6 +4083,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 7ffb6dd1d1..43d49f07d1 100644 --- a/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski static const struct rt6_info ip6_blk_hole_entry_template = { .dst = { .__refcnt = ATOMIC_INIT(1), -@@ -1040,6 +1054,7 @@ static const int fib6_prop[RTN_MAX + 1] +@@ -1042,6 +1056,7 @@ static const int fib6_prop[RTN_MAX + 1] [RTN_BLACKHOLE] = -EINVAL, [RTN_UNREACHABLE] = -EHOSTUNREACH, [RTN_PROHIBIT] = -EACCES, @@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski [RTN_THROW] = -EAGAIN, [RTN_NAT] = -EINVAL, [RTN_XRESOLVE] = -EINVAL, -@@ -1075,6 +1090,10 @@ static void ip6_rt_init_dst_reject(struc +@@ -1077,6 +1092,10 @@ static void ip6_rt_init_dst_reject(struc rt->dst.output = ip6_pkt_prohibit_out; rt->dst.input = ip6_pkt_prohibit; break; @@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: case RTN_UNREACHABLE: default: -@@ -4545,6 +4564,17 @@ static int ip6_pkt_prohibit_out(struct n +@@ -4547,6 +4566,17 @@ static int ip6_pkt_prohibit_out(struct n return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -5038,7 +5068,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -5040,7 +5070,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -6285,6 +6316,8 @@ static int ip6_route_dev_notify(struct n +@@ -6287,6 +6318,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -6296,6 +6329,7 @@ static int ip6_route_dev_notify(struct n +@@ -6298,6 +6331,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -6487,6 +6521,8 @@ static int __net_init ip6_route_net_init +@@ -6489,6 +6523,8 @@ static int __net_init ip6_route_net_init #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.fib6_has_custom_rules = false; @@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template, sizeof(*net->ipv6.ip6_prohibit_entry), GFP_KERNEL); -@@ -6497,11 +6533,21 @@ static int __net_init ip6_route_net_init +@@ -6499,11 +6535,21 @@ static int __net_init ip6_route_net_init ip6_template_metrics, true); INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached); @@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); -@@ -6528,6 +6574,8 @@ out: +@@ -6530,6 +6576,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -6547,6 +6595,7 @@ static void __net_exit ip6_route_net_exi +@@ -6549,6 +6597,7 @@ static void __net_exit ip6_route_net_exi kfree(net->ipv6.ip6_null_entry); #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); @@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski kfree(net->ipv6.ip6_blk_hole_entry); #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); -@@ -6630,6 +6679,9 @@ void __init ip6_route_init_special_entri +@@ -6632,6 +6681,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-6.6/600-netfilter_conntrack_flush.patch b/target/linux/generic/pending-6.6/600-netfilter_conntrack_flush.patch index f6c3783219..52e97e46ef 100644 --- a/target/linux/generic/pending-6.6/600-netfilter_conntrack_flush.patch +++ b/target/linux/generic/pending-6.6/600-netfilter_conntrack_flush.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau #include #ifdef CONFIG_SYSCTL #include -@@ -461,6 +462,58 @@ static int ct_cpu_seq_show(struct seq_fi +@@ -458,6 +459,58 @@ static int ct_cpu_seq_show(struct seq_fi return 0; } @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau static const struct seq_operations ct_cpu_seq_ops = { .start = ct_cpu_seq_start, .next = ct_cpu_seq_next, -@@ -474,8 +527,9 @@ static int nf_conntrack_standalone_init_ +@@ -471,8 +524,9 @@ static int nf_conntrack_standalone_init_ kuid_t root_uid; kgid_t root_gid; diff --git a/target/linux/generic/pending-6.6/630-packet_socket_type.patch b/target/linux/generic/pending-6.6/630-packet_socket_type.patch index 10a312776f..fd00e1e052 100644 --- a/target/linux/generic/pending-6.6/630-packet_socket_type.patch +++ b/target/linux/generic/pending-6.6/630-packet_socket_type.patch @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -4034,6 +4037,16 @@ packet_setsockopt(struct socket *sock, i +@@ -4036,6 +4039,16 @@ packet_setsockopt(struct socket *sock, i packet_sock_flag_set(po, PACKET_SOCK_QDISC_BYPASS, val); return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -4093,6 +4106,13 @@ static int packet_getsockopt(struct sock +@@ -4095,6 +4108,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR_SZ: val = READ_ONCE(po->vnet_hdr_sz); break; diff --git a/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 77a16bad9a..cc92e20f63 100644 --- a/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski static const struct rt6_info ip6_blk_hole_entry_template = { .dst = { .__rcuref = RCUREF_INIT(1), -@@ -1038,6 +1052,7 @@ static const int fib6_prop[RTN_MAX + 1] +@@ -1040,6 +1054,7 @@ static const int fib6_prop[RTN_MAX + 1] [RTN_BLACKHOLE] = -EINVAL, [RTN_UNREACHABLE] = -EHOSTUNREACH, [RTN_PROHIBIT] = -EACCES, @@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski [RTN_THROW] = -EAGAIN, [RTN_NAT] = -EINVAL, [RTN_XRESOLVE] = -EINVAL, -@@ -1073,6 +1088,10 @@ static void ip6_rt_init_dst_reject(struc +@@ -1075,6 +1090,10 @@ static void ip6_rt_init_dst_reject(struc rt->dst.output = ip6_pkt_prohibit_out; rt->dst.input = ip6_pkt_prohibit; break; @@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: case RTN_UNREACHABLE: default: -@@ -4544,6 +4563,17 @@ static int ip6_pkt_prohibit_out(struct n +@@ -4546,6 +4565,17 @@ static int ip6_pkt_prohibit_out(struct n return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -5035,7 +5065,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -5037,7 +5067,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -6282,6 +6313,8 @@ static int ip6_route_dev_notify(struct n +@@ -6284,6 +6315,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -6293,6 +6326,7 @@ static int ip6_route_dev_notify(struct n +@@ -6295,6 +6328,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -6493,6 +6527,8 @@ static int __net_init ip6_route_net_init +@@ -6495,6 +6529,8 @@ static int __net_init ip6_route_net_init #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.fib6_has_custom_rules = false; @@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template, sizeof(*net->ipv6.ip6_prohibit_entry), GFP_KERNEL); -@@ -6503,11 +6539,21 @@ static int __net_init ip6_route_net_init +@@ -6505,11 +6541,21 @@ static int __net_init ip6_route_net_init ip6_template_metrics, true); INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->dst.rt_uncached); @@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); -@@ -6534,6 +6580,8 @@ out: +@@ -6536,6 +6582,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -6553,6 +6601,7 @@ static void __net_exit ip6_route_net_exi +@@ -6555,6 +6603,7 @@ static void __net_exit ip6_route_net_exi kfree(net->ipv6.ip6_null_entry); #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); @@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski kfree(net->ipv6.ip6_blk_hole_entry); #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); -@@ -6636,6 +6685,9 @@ void __init ip6_route_init_special_entri +@@ -6638,6 +6687,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch b/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch index 4fbf6288c8..5563bf1f93 100644 --- a/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch +++ b/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -5020,6 +5020,8 @@ static int mtk_probe(struct platform_dev +@@ -5036,6 +5036,8 @@ static int mtk_probe(struct platform_dev * for NAPI to work */ init_dummy_netdev(ð->dummy_dev); diff --git a/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch b/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch index 89dc87e1a2..f9e10e5733 100644 --- a/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch +++ b/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch @@ -510,7 +510,7 @@ Signed-off-by: Daniel Golle return 0; } -@@ -4554,6 +4701,7 @@ static const struct net_device_ops mtk_n +@@ -4570,6 +4717,7 @@ static const struct net_device_ops mtk_n static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { const __be32 *_id = of_get_property(np, "reg", NULL); @@ -518,7 +518,7 @@ Signed-off-by: Daniel Golle phy_interface_t phy_mode; struct phylink *phylink; struct mtk_mac *mac; -@@ -4590,16 +4738,41 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4606,16 +4754,41 @@ static int mtk_add_mac(struct mtk_eth *e mac->id = id; mac->hw = eth; mac->of_node = np; @@ -568,7 +568,7 @@ Signed-off-by: Daniel Golle } memset(mac->hwlro_ip, 0, sizeof(mac->hwlro_ip)); -@@ -4682,8 +4855,21 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4698,8 +4871,21 @@ static int mtk_add_mac(struct mtk_eth *e phy_interface_zero(mac->phylink_config.supported_interfaces); __set_bit(PHY_INTERFACE_MODE_INTERNAL, mac->phylink_config.supported_interfaces); @@ -590,7 +590,7 @@ Signed-off-by: Daniel Golle phylink = phylink_create(&mac->phylink_config, of_fwnode_handle(mac->of_node), phy_mode, &mtk_phylink_ops); -@@ -4734,6 +4920,26 @@ free_netdev: +@@ -4750,6 +4936,26 @@ free_netdev: return err; } @@ -617,7 +617,7 @@ Signed-off-by: Daniel Golle void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev) { struct net_device *dev, *tmp; -@@ -4880,7 +5086,8 @@ static int mtk_probe(struct platform_dev +@@ -4896,7 +5102,8 @@ static int mtk_probe(struct platform_dev regmap_write(cci, 0, 3); } @@ -627,7 +627,7 @@ Signed-off-by: Daniel Golle err = mtk_sgmii_init(eth); if (err) -@@ -4991,6 +5198,24 @@ static int mtk_probe(struct platform_dev +@@ -5007,6 +5214,24 @@ static int mtk_probe(struct platform_dev } } @@ -652,7 +652,7 @@ Signed-off-by: Daniel Golle if (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_INT)) { err = devm_request_irq(eth->dev, eth->irq[0], mtk_handle_irq, 0, -@@ -5094,6 +5319,11 @@ static int mtk_remove(struct platform_de +@@ -5110,6 +5335,11 @@ static int mtk_remove(struct platform_de mtk_stop(eth->netdev[i]); mac = netdev_priv(eth->netdev[i]); phylink_disconnect_phy(mac->phylink); diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 5f8082c99f..929cff72ea 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -739,7 +739,7 @@ define Device/linksys_whw03 IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | linksys-image type=WHW03 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-leds-pca963x kmod-spi-dev kmod-bluetooth \ - kmod-fs-ext4 e2fsprogs kmod-fs-f2fs mkf2fs losetup + kmod-fs-ext4 e2fsprogs kmod-fs-f2fs mkf2fs losetup ipq-wifi-linksys_whw03 endef TARGET_DEVICES += linksys_whw03 diff --git a/target/linux/mediatek/dts/mt7986b-tplink-re6000xd.dts b/target/linux/mediatek/dts/mt7986b-tplink-re6000xd.dts new file mode 100644 index 0000000000..44a5e21e7c --- /dev/null +++ b/target/linux/mediatek/dts/mt7986b-tplink-re6000xd.dts @@ -0,0 +1,298 @@ +// SPDX-License-Identifier: (GL-2.0 OR MIT) + +/dts-v1/; +#include +#include +#include + +#include "mt7986b.dtsi" + +/ { + compatible = "tplink,re6000xd", "mediatek,mt7986b"; + model = "TP-Link RE6000XD"; + + aliases { + serial0 = &uart0; + + led-boot = &led_status_blue; + led-failsafe = &led_status_blue; + led-running = &led_status_blue; + led-upgrade = &led_status_blue; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0 0x40000000 0 0x20000000>; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&pio 14 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue: power { + gpios = <&pio 15 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + panic-indicator; + function-enumerator = <0>; + }; + wlan_2g { + gpios = <&pio 11 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_WLAN_2GHZ; + linux,default-trigger = "phy0tpt"; + }; + wlan_5g { + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + linux,default-trigger = "phy1tpt"; + }; + signal_blue { + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; + }; + signal_red { + gpios = <&pio 19 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <2>; + }; + lan1 { + gpios = <&pio 16 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <0>; + }; + lan2 { + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + }; + lan3 { + gpios = <&pio 18 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + }; + }; +}; + +&crypto { + status = "okay"; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-handle = <&phy6>; + phy-mode = "2500base-x"; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + }; +}; + +&mdio { + #address-cells = <1>; + #size-cells = <0>; + + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + reset-delay-us = <1500000>; + reset-post-delay-us = <1000000>; + + /* LAN3 2.5Gbps phy + MaxLinear GPY211C0VC (SLNW8) */ + phy6: phy@6 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <6>; + }; + + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + /* reorder LAN1 and LAN2 port to match the port order of the case + LAN1 - LAN2 - LAN3 (top to bottom of the case, no silkscreen) + */ + /* LAN2 port */ + port@1 { + reg = <1>; + label = "lan2"; + }; + + /* LAN1 port */ + port@2 { + reg = <2>; + label = "lan1"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&pio { + spi_flash_pins: spi-flash-pins-33-to-38 { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + conf-pd { + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + drive-strength = <8>; + mediatek,pull-down-adv = <0>; /* bias-disable */ + }; + }; + + wf_2g_5g_pins: wf_2g_5g-pins { + mux { + function = "wifi"; + groups = "wf_2g", "wf_5g"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi_flash_pins>; + status = "okay"; + + spi_nand_flash: flash@0 { + compatible = "spi-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + + spi-max-frequency = <20000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "boot"; + reg = <0x0 0x200000>; + read-only; + }; + + partition@200000 { + label = "u-boot-env"; + reg = <0x200000 0x100000>; + }; + + partition@300000 { + label = "ubi0"; + reg = <0x300000 0x3200000>; + }; + + partition@3500000 { + label = "ubi1"; + reg = <0x3500000 0x3200000>; + read-only; + }; + + partition@6700000 { + label = "userconfig"; + reg = <0x6700000 0x800000>; + read-only; + }; + + partition@6f00000 { + label = "tp_data"; + reg = <0x6f00000 0x400000>; + read-only; + }; + }; + }; +}; + +&trng { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&wf_2g_5g_pins>; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index abc736d13b..dc192268a5 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -103,11 +103,17 @@ smartrg,sdg-8734) ucidef_set_led_netdev "wan-green" "WAN" "mdio-bus:00:green:wan" "wan" "link_2500 link_5000" ucidef_set_led_netdev "wan-orange" "WAN" "mdio-bus:00:orange:wan" "wan" "link_100 link_1000" ucidef_set_led_netdev "wan-white" "WAN" "mdio-bus:00:white:wan" "wan" "link_10000" + ;; wavlink,wl-wn586x3) ucidef_set_led_netdev "lan-1" "lan-1" "blue:lan-1" "lan1" "link tx rx" ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-2" "lan2" "link tx rx" ucidef_set_led_netdev "wan" "wan" "blue:wan" "eth1" "link tx rx" ;; +tplink,re6000xd) + ucidef_set_led_netdev "lan-1" "lan-1" "blue:lan-0" "lan1" "link tx rx" + ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-1" "lan2" "link tx rx" + ucidef_set_led_netdev "eth1" "lan-3" "blue:lan-2" "eth1" "link tx rx" + ;; xiaomi,mi-router-wr30u-stock|\ xiaomi,mi-router-wr30u-ubootmod) ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" "link tx rx" diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index cfac18ee60..8b2c8f81e3 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -110,6 +110,9 @@ mediatek_setup_interfaces() wavlink,wl-wn586x3) ucidef_set_interfaces_lan_wan "lan1 lan2" eth1 ;; + tplink,re6000xd) + ucidef_set_interface_lan "lan1 lan2 eth1" + ;; xiaomi,mi-router-ax3000t|\ xiaomi,mi-router-ax3000t-ubootmod|\ xiaomi,mi-router-wr30u-stock|\ @@ -161,7 +164,8 @@ mediatek_setup_macs() [ -n "$lan_mac" ] || lan_mac=$(macaddr_add $(mtd_get_mac_binary Factory 0x4) -1) wan_mac=$(macaddr_add $lan_mac 2) ;; - mercusys,mr90x-v1) + mercusys,mr90x-v1|\ + tplink,re6000xd) label_mac=$(get_mac_binary "/tmp/tp_data/default-mac" 0) lan_mac=$label_mac ;; diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata index e0d1d93207..920a16d05d 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata @@ -31,9 +31,6 @@ case "$FIRMWARE" in ;; esac ;; - openwrt,one) - caldata_extract "factory" 0x0 0x1000 - ;; ubnt,unifi-6-plus) caldata_extract_mmc "factory" 0x0 0x1000 ;; @@ -41,7 +38,8 @@ case "$FIRMWARE" in ;; "mediatek/mt7986_eeprom_mt7975_dual.bin") case "$board" in - mercusys,mr90x-v1) + mercusys,mr90x-v1|\ + tplink,re6000xd) ln -sf /tmp/tp_data/MT7986_EEPROM.bin \ /lib/firmware/$FIRMWARE ;; diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 4c26d8f35a..2bfbaf2a4c 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -126,7 +126,8 @@ case "$board" in [ "$PHYNBR" = "0" ] && mtd_get_mac_ascii config2 wifi2gmac > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && mtd_get_mac_ascii config2 wifi5gmac > /sys${DEVPATH}/macaddress ;; - mercusys,mr90x-v1) + mercusys,mr90x-v1|\ + tplink,re6000xd) addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0) [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $addr -1 > /sys${DEVPATH}/macaddress diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part b/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part index 819df40d08..11e3b598af 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part @@ -12,7 +12,8 @@ mount_ubi_part() { preinit_mount_cfg_part() { case $(board_name) in - mercusys,mr90x-v1) + mercusys,mr90x-v1|\ + tplink,re6000xd) mount_ubi_part "tp_data" ;; *) diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh index 2fe48b0ccf..fefca2327b 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -17,7 +17,8 @@ preinit_set_mac_address() { ip link set dev eth0 address "$addr" ip link set dev eth1 address "$addr" ;; - mercusys,mr90x-v1) + mercusys,mr90x-v1|\ + tplink,re6000xd) addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0) ip link set dev eth1 address "$(macaddr_add $addr 1)" ;; diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/90_extract_caldata b/target/linux/mediatek/filogic/base-files/lib/preinit/90_extract_caldata deleted file mode 100644 index e2e79a0465..0000000000 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/90_extract_caldata +++ /dev/null @@ -1,12 +0,0 @@ -. /lib/functions/system.sh - -do_extract_caldata() { - case $(board_name) in - glinet,gl-mt6000|\ - jdcloud,re-cp-03) - FIRMWARE=mediatek/mt7986_eeprom_mt7976_dual.bin \ - sh /etc/hotplug.d/firmware/11-mt76-caldata - ;; - esac -} -boot_hook_add preinit_main do_extract_caldata diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index f97fbeb879..b30b465e89 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -142,7 +142,8 @@ platform_do_upgrade() { CI_KERNPART="fit" nand_do_upgrade "$1" ;; - mercusys,mr90x-v1) + mercusys,mr90x-v1|\ + tplink,re6000xd) CI_UBIPART="ubi0" nand_do_upgrade "$1" ;; diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index ccba665bb1..a22a91fdb5 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -1244,6 +1244,20 @@ define Device/ruijie_rg-x60-pro endef TARGET_DEVICES += ruijie_rg-x60-pro +define Device/tplink_re6000xd + DEVICE_VENDOR := TP-Link + DEVICE_MODEL := RE6000XD + DEVICE_DTS := mt7986b-tplink-re6000xd + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 51200k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += tplink_re6000xd + define Device/tplink_tl-xdr-common DEVICE_VENDOR := TP-Link DEVICE_DTS_DIR := ../dts diff --git a/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch b/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch index 80179cc7dc..99d0a0dbc2 100644 --- a/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch +++ b/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch @@ -14,7 +14,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/mxl-gpy.c +++ b/drivers/net/phy/mxl-gpy.c -@@ -386,8 +386,11 @@ static bool gpy_2500basex_chk(struct phy +@@ -385,8 +385,11 @@ static bool gpy_2500basex_chk(struct phy phydev->speed = SPEED_2500; phydev->interface = PHY_INTERFACE_MODE_2500BASEX; @@ -28,7 +28,7 @@ Signed-off-by: Daniel Golle return true; } -@@ -438,6 +441,14 @@ static int gpy_config_aneg(struct phy_de +@@ -437,6 +440,14 @@ static int gpy_config_aneg(struct phy_de u32 adv; int ret; @@ -43,7 +43,7 @@ Signed-off-by: Daniel Golle if (phydev->autoneg == AUTONEG_DISABLE) { /* Configure half duplex with genphy_setup_forced, * because genphy_c45_pma_setup_forced does not support. -@@ -560,6 +571,8 @@ static int gpy_update_interface(struct p +@@ -559,6 +570,8 @@ static int gpy_update_interface(struct p switch (phydev->speed) { case SPEED_2500: phydev->interface = PHY_INTERFACE_MODE_2500BASEX; @@ -52,7 +52,7 @@ Signed-off-by: Daniel Golle ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_SGMII_CTRL, VSPEC1_SGMII_CTRL_ANEN, 0); if (ret < 0) { -@@ -573,7 +586,7 @@ static int gpy_update_interface(struct p +@@ -572,7 +585,7 @@ static int gpy_update_interface(struct p case SPEED_100: case SPEED_10: phydev->interface = PHY_INTERFACE_MODE_SGMII; diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch b/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch index 29393a6891..76fe8326d6 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch @@ -29,7 +29,7 @@ Signed-off-by: Rafael J. Wysocki --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c -@@ -1243,7 +1243,7 @@ static int lvts_probe(struct platform_de +@@ -1247,7 +1247,7 @@ static int lvts_probe(struct platform_de return 0; } @@ -38,7 +38,7 @@ Signed-off-by: Rafael J. Wysocki { struct lvts_domain *lvts_td; int i; -@@ -1254,8 +1254,6 @@ static int lvts_remove(struct platform_d +@@ -1258,8 +1258,6 @@ static int lvts_remove(struct platform_d lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], false); lvts_debugfs_exit(lvts_td); @@ -47,7 +47,7 @@ Signed-off-by: Rafael J. Wysocki } static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { -@@ -1356,7 +1354,7 @@ MODULE_DEVICE_TABLE(of, lvts_of_match); +@@ -1360,7 +1358,7 @@ MODULE_DEVICE_TABLE(of, lvts_of_match); static struct platform_driver lvts_driver = { .probe = lvts_probe, diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch b/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch index 5871c87549..0b965c9521 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch @@ -135,8 +135,8 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de { u32 gt; -@@ -703,7 +712,7 @@ static int lvts_golden_temp_init(struct - if (gt && gt < LVTS_GOLDEN_TEMP_MAX) +@@ -707,7 +716,7 @@ static int lvts_golden_temp_init(struct + if (gt < LVTS_GOLDEN_TEMP_MAX) golden_temp = gt; - coeff_b = golden_temp * 500 + LVTS_COEFF_B; @@ -144,7 +144,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de return 0; } -@@ -726,7 +735,7 @@ static int lvts_ctrl_init(struct device +@@ -730,7 +739,7 @@ static int lvts_ctrl_init(struct device * The golden temp information is contained in the first chunk * of efuse data. */ @@ -153,7 +153,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de if (ret) return ret; -@@ -737,6 +746,7 @@ static int lvts_ctrl_init(struct device +@@ -741,6 +750,7 @@ static int lvts_ctrl_init(struct device for (i = 0; i < lvts_data->num_lvts_ctrl; i++) { lvts_ctrl[i].base = lvts_td->base + lvts_data->lvts_ctrl[i].offset; @@ -161,7 +161,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de ret = lvts_sensor_init(dev, &lvts_ctrl[i], &lvts_data->lvts_ctrl[i]); -@@ -760,7 +770,8 @@ static int lvts_ctrl_init(struct device +@@ -764,7 +774,8 @@ static int lvts_ctrl_init(struct device * after initializing the calibration. */ lvts_ctrl[i].hw_tshut_raw_temp = @@ -171,7 +171,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de lvts_ctrl[i].low_thresh = INT_MIN; lvts_ctrl[i].high_thresh = INT_MIN; -@@ -1225,6 +1236,8 @@ static int lvts_probe(struct platform_de +@@ -1229,6 +1240,8 @@ static int lvts_probe(struct platform_de if (irq < 0) return irq; @@ -180,7 +180,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de ret = lvts_domain_init(dev, lvts_td, lvts_data); if (ret) return dev_err_probe(dev, ret, "Failed to initialize the lvts domain\n"); -@@ -1338,11 +1351,15 @@ static const struct lvts_ctrl_data mt819 +@@ -1342,11 +1355,15 @@ static const struct lvts_ctrl_data mt819 static const struct lvts_data mt8195_lvts_mcu_data = { .lvts_ctrl = mt8195_lvts_mcu_data_ctrl, .num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl), diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch b/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch index b758720d24..65d90899f8 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch @@ -33,7 +33,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de #define LVTS_HW_SHUTDOWN_MT8195 105000 #define LVTS_MINIMUM_THRESHOLD 20000 -@@ -1269,6 +1272,33 @@ static void lvts_remove(struct platform_ +@@ -1273,6 +1276,33 @@ static void lvts_remove(struct platform_ lvts_debugfs_exit(lvts_td); } @@ -67,7 +67,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { { .cal_offset = { 0x04, 0x07 }, -@@ -1348,6 +1378,13 @@ static const struct lvts_ctrl_data mt819 +@@ -1352,6 +1382,13 @@ static const struct lvts_ctrl_data mt819 } }; @@ -81,7 +81,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de static const struct lvts_data mt8195_lvts_mcu_data = { .lvts_ctrl = mt8195_lvts_mcu_data_ctrl, .num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl), -@@ -1363,6 +1400,7 @@ static const struct lvts_data mt8195_lvt +@@ -1367,6 +1404,7 @@ static const struct lvts_data mt8195_lvt }; static const struct of_device_id lvts_of_match[] = { diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch b/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch index 0893db74a5..98946fc814 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch @@ -24,7 +24,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-3-bero@baylibre.com --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c -@@ -1299,6 +1299,38 @@ static const struct lvts_ctrl_data mt798 +@@ -1303,6 +1303,38 @@ static const struct lvts_ctrl_data mt798 } }; @@ -63,7 +63,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-3-bero@baylibre.com static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { { .cal_offset = { 0x04, 0x07 }, -@@ -1407,12 +1439,17 @@ static const struct of_device_id lvts_of +@@ -1411,12 +1443,17 @@ static const struct of_device_id lvts_of }; MODULE_DEVICE_TABLE(of, lvts_of_match); diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch b/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch index 1fe7e255b7..d478856359 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch @@ -34,7 +34,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com #define LVTS_HW_SHUTDOWN_MT8195 105000 #define LVTS_MINIMUM_THRESHOLD 20000 -@@ -1331,6 +1332,88 @@ static int lvts_resume(struct device *de +@@ -1335,6 +1336,88 @@ static int lvts_resume(struct device *de return 0; } @@ -123,7 +123,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { { .cal_offset = { 0x04, 0x07 }, -@@ -1417,6 +1500,16 @@ static const struct lvts_data mt7988_lvt +@@ -1421,6 +1504,16 @@ static const struct lvts_data mt7988_lvt .temp_offset = LVTS_COEFF_B_MT7988, }; @@ -140,7 +140,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com static const struct lvts_data mt8195_lvts_mcu_data = { .lvts_ctrl = mt8195_lvts_mcu_data_ctrl, .num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl), -@@ -1433,6 +1526,8 @@ static const struct lvts_data mt8195_lvt +@@ -1437,6 +1530,8 @@ static const struct lvts_data mt8195_lvt static const struct of_device_id lvts_of_match[] = { { .compatible = "mediatek,mt7988-lvts-ap", .data = &mt7988_lvts_ap_data }, diff --git a/target/linux/mvebu/patches-6.6/701-mvpp2-read-mac-address-from-nvmem.patch b/target/linux/mvebu/patches-6.6/701-mvpp2-read-mac-address-from-nvmem.patch index c5bad1772f..69ee10c3f2 100644 --- a/target/linux/mvebu/patches-6.6/701-mvpp2-read-mac-address-from-nvmem.patch +++ b/target/linux/mvebu/patches-6.6/701-mvpp2-read-mac-address-from-nvmem.patch @@ -12,7 +12,7 @@ Signed-off-by: Tobias Schramm --- --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c -@@ -6153,6 +6153,12 @@ static int mvpp2_port_copy_mac_addr(stru +@@ -6156,6 +6156,12 @@ static int mvpp2_port_copy_mac_addr(stru return 0; } diff --git a/target/linux/ramips/dts/mt7620a.dtsi b/target/linux/ramips/dts/mt7620a.dtsi index 4ba4b48bef..a0429ade45 100644 --- a/target/linux/ramips/dts/mt7620a.dtsi +++ b/target/linux/ramips/dts/mt7620a.dtsi @@ -116,7 +116,6 @@ #gpio-cells = <2>; ngpios = <24>; - ralink,gpio-base = <0>; ralink,register-map = [ 00 04 08 0c 20 24 28 2c 30 34 ]; @@ -133,7 +132,6 @@ #gpio-cells = <2>; ngpios = <16>; - ralink,gpio-base = <24>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; @@ -152,7 +150,6 @@ #gpio-cells = <2>; ngpios = <32>; - ralink,gpio-base = <40>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; @@ -171,7 +168,6 @@ #gpio-cells = <2>; ngpios = <1>; - ralink,gpio-base = <72>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; diff --git a/target/linux/ramips/dts/mt7620n.dtsi b/target/linux/ramips/dts/mt7620n.dtsi index a844198f66..eafa7c16bb 100644 --- a/target/linux/ramips/dts/mt7620n.dtsi +++ b/target/linux/ramips/dts/mt7620n.dtsi @@ -100,7 +100,6 @@ #gpio-cells = <2>; ngpios = <24>; - ralink,gpio-base = <0>; ralink,register-map = [ 00 04 08 0c 20 24 28 2c 30 34 ]; @@ -117,7 +116,6 @@ #gpio-cells = <2>; ngpios = <16>; - ralink,gpio-base = <24>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; @@ -136,7 +134,6 @@ #gpio-cells = <2>; ngpios = <32>; - ralink,gpio-base = <40>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; @@ -155,7 +152,6 @@ #gpio-cells = <2>; ngpios = <1>; - ralink,gpio-base = <72>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; diff --git a/target/linux/ramips/dts/rt2880.dtsi b/target/linux/ramips/dts/rt2880.dtsi index 5ac2d2e3b8..15f5eac625 100644 --- a/target/linux/ramips/dts/rt2880.dtsi +++ b/target/linux/ramips/dts/rt2880.dtsi @@ -88,7 +88,6 @@ #gpio-cells = <2>; ngpios = <24>; - ralink,gpio-base = <0>; ralink,register-map = [ 00 04 08 0c 20 24 28 2c 30 34 ]; @@ -102,7 +101,6 @@ #gpio-cells = <2>; ngpios = <16>; - ralink,gpio-base = <24>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; @@ -118,7 +116,6 @@ #gpio-cells = <2>; ngpios = <32>; - ralink,gpio-base = <40>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; diff --git a/target/linux/ramips/dts/rt3050.dtsi b/target/linux/ramips/dts/rt3050.dtsi index 80d0f1585b..886f6b7de1 100644 --- a/target/linux/ramips/dts/rt3050.dtsi +++ b/target/linux/ramips/dts/rt3050.dtsi @@ -112,7 +112,6 @@ #gpio-cells = <2>; ngpios = <24>; - ralink,gpio-base = <0>; ralink,register-map = [ 00 04 08 0c 20 24 28 2c 30 34 ]; @@ -129,7 +128,6 @@ #gpio-cells = <2>; ngpios = <16>; - ralink,gpio-base = <24>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; @@ -145,7 +143,6 @@ #gpio-cells = <2>; ngpios = <12>; - ralink,gpio-base = <40>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; diff --git a/target/linux/ramips/dts/rt3352.dtsi b/target/linux/ramips/dts/rt3352.dtsi index 0690589e5d..ceef29259c 100644 --- a/target/linux/ramips/dts/rt3352.dtsi +++ b/target/linux/ramips/dts/rt3352.dtsi @@ -113,7 +113,6 @@ #gpio-cells = <2>; ngpios = <24>; - ralink,gpio-base = <0>; ralink,register-map = [ 00 04 08 0c 20 24 28 2c 30 34 ]; @@ -130,7 +129,6 @@ #gpio-cells = <2>; ngpios = <16>; - ralink,gpio-base = <24>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; @@ -146,7 +144,6 @@ #gpio-cells = <2>; ngpios = <6>; - ralink,gpio-base = <40>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; diff --git a/target/linux/ramips/dts/rt3883.dtsi b/target/linux/ramips/dts/rt3883.dtsi index d2557d4559..de89645406 100644 --- a/target/linux/ramips/dts/rt3883.dtsi +++ b/target/linux/ramips/dts/rt3883.dtsi @@ -116,7 +116,6 @@ #gpio-cells = <2>; ngpios = <24>; - ralink,gpio-base = <0>; ralink,register-map = [ 00 04 08 0c 20 24 28 2c 30 34 ]; @@ -130,7 +129,6 @@ #gpio-cells = <2>; ngpios = <16>; - ralink,gpio-base = <24>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; @@ -146,7 +144,6 @@ #gpio-cells = <2>; ngpios = <32>; - ralink,gpio-base = <40>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; @@ -162,7 +159,6 @@ #gpio-cells = <2>; ngpios = <24>; - ralink,gpio-base = <72>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; diff --git a/target/linux/ramips/dts/rt5350.dtsi b/target/linux/ramips/dts/rt5350.dtsi index 6b54291800..cb6f3ff232 100644 --- a/target/linux/ramips/dts/rt5350.dtsi +++ b/target/linux/ramips/dts/rt5350.dtsi @@ -116,7 +116,6 @@ #gpio-cells = <2>; ngpios = <22>; - ralink,gpio-base = <0>; ralink,register-map = [ 00 04 08 0c 20 24 28 2c 30 34 ]; @@ -133,7 +132,6 @@ #gpio-cells = <2>; ngpios = <6>; - ralink,gpio-base = <22>; ralink,register-map = [ 00 04 08 0c 10 14 18 1c 20 24 ]; diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt7620/base-files/etc/board.d/03_gpio_switches index 5588113548..6d3cc61aca 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/03_gpio_switches @@ -7,30 +7,30 @@ board=$(board_name) case "$board" in bolt,bl100) - ucidef_add_gpio_switch "modem_enable" "Enable LTE Modem" "28" "1" + ucidef_add_gpio_switch "modem_enable" "Enable LTE Modem" "540" "1" ;; dlink,dir-510l) - ucidef_add_gpio_switch "usb_enable1" "USB 1A enable" "12" "0" - ucidef_add_gpio_switch "usb_enable05" "USB 0.5A enable" "13" "1" + ucidef_add_gpio_switch "usb_enable1" "USB 1A enable" "524" "0" + ucidef_add_gpio_switch "usb_enable05" "USB 0.5A enable" "525" "1" ;; dlink,dwr-960|\ dlink,dwr-961-a1) - ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "0" "1" + ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "512" "1" ;; head-weblink,hdrm200) - ucidef_add_gpio_switch "sim_switch" "SIM slot switch" "0" - ucidef_add_gpio_switch "io1" "I/O 1" "1" - ucidef_add_gpio_switch "io2" "I/O 2" "2" - ucidef_add_gpio_switch "io3" "I/O 3" "11" - ucidef_add_gpio_switch "io4" "I/O 4" "14" - ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "21" "1" + ucidef_add_gpio_switch "sim_switch" "SIM slot switch" "512" + ucidef_add_gpio_switch "io1" "I/O 1" "513" + ucidef_add_gpio_switch "io2" "I/O 2" "514" + ucidef_add_gpio_switch "io3" "I/O 3" "523" + ucidef_add_gpio_switch "io4" "I/O 4" "526" + ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "533" "1" ;; lb-link,bl-w1200) - ucidef_add_gpio_switch "eth_leds_enable" "ETH LEDs enable" "10" "1" + ucidef_add_gpio_switch "eth_leds_enable" "ETH LEDs enable" "522" "1" ;; zbtlink,zbt-we826-e) - ucidef_add_gpio_switch "sim_switch" "SIM slot switch" "13" - ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "14" "1" + ucidef_add_gpio_switch "sim_switch" "SIM slot switch" "525" + ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "526" "1" ;; esac diff --git a/target/linux/ramips/mt7620/config-6.6 b/target/linux/ramips/mt7620/config-6.6 index bf96543344..a142efd43b 100644 --- a/target/linux/ramips/mt7620/config-6.6 +++ b/target/linux/ramips/mt7620/config-6.6 @@ -30,6 +30,7 @@ CONFIG_CPU_MIPS32=y CONFIG_CPU_MIPS32_R2=y CONFIG_CPU_MIPSR2=y CONFIG_CPU_MIPSR2_IRQ_VI=y +CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y @@ -58,8 +59,7 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y -CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y +CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y @@ -82,6 +82,7 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y # CONFIG_GPIO_MT7621 is not set CONFIG_GPIO_RALINK=y CONFIG_GPIO_WATCHDOG=y diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches index 22cf272429..b8f2922f48 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches @@ -7,10 +7,10 @@ board=$(board_name) case "$board" in mikrotik,routerboard-760igs) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "497" + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "529" ;; telco-electronics,x1) - ucidef_add_gpio_switch "modem_reset" "Modem Reset" "496" + ucidef_add_gpio_switch "modem_reset" "Modem Reset" "528" ;; tozed,zlt-s12-pro) ucidef_add_gpio_switch "lt72_power" "Power LTE modem" "lt72_power" "1" @@ -20,14 +20,14 @@ tplink,eap615-wall-v1) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "poe-passthrough" ;; ubnt,edgerouter-x) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "480" + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "512" ;; ubnt,edgerouter-x-sfp) - ucidef_add_gpio_switch "poe_power_port0" "PoE Power Port0" "400" - ucidef_add_gpio_switch "poe_power_port1" "PoE Power Port1" "401" - ucidef_add_gpio_switch "poe_power_port2" "PoE Power Port2" "402" - ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "403" - ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "404" + ucidef_add_gpio_switch "poe_power_port0" "PoE Power Port0" "608" + ucidef_add_gpio_switch "poe_power_port1" "PoE Power Port1" "609" + ucidef_add_gpio_switch "poe_power_port2" "PoE Power Port2" "610" + ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "611" + ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "612" ;; zyxel,lte3301-plus|\ zyxel,lte5398-m904) @@ -35,10 +35,10 @@ zyxel,lte5398-m904) ucidef_add_gpio_switch "lte_power" "Power LTE modem" "lte_power" "1" ;; zyxel,nr7101) - ucidef_add_gpio_switch "lte_reset" "Reset LTE/5G modem" "483" + ucidef_add_gpio_switch "lte_reset" "Reset LTE/5G modem" "515" ;; zyxel,wap6805) - ucidef_add_gpio_switch "qtn_power" "Quantenna Module Power" "496" "1" + ucidef_add_gpio_switch "qtn_power" "Quantenna Module Power" "528" "1" ;; esac diff --git a/target/linux/ramips/mt7621/config-6.6 b/target/linux/ramips/mt7621/config-6.6 index 219e61a467..75d3f300fd 100644 --- a/target/linux/ramips/mt7621/config-6.6 +++ b/target/linux/ramips/mt7621/config-6.6 @@ -34,6 +34,7 @@ CONFIG_CPU_MIPS32_R2=y CONFIG_CPU_MIPSR2=y CONFIG_CPU_MIPSR2_IRQ_EI=y CONFIG_CPU_MIPSR2_IRQ_VI=y +CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_RMAP=y @@ -64,8 +65,7 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y -CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y +CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y @@ -128,7 +128,6 @@ CONFIG_MFD_SYSCON=y CONFIG_MIGRATION=y CONFIG_MIKROTIK=y CONFIG_MIKROTIK_RB_SYSFS=y -# CONFIG_NVMEM_LAYOUT_MIKROTIK is not set CONFIG_MIPS=y CONFIG_MIPS_ASID_BITS=8 CONFIG_MIPS_ASID_SHIFT=0 @@ -201,6 +200,7 @@ CONFIG_NO_HZ_IDLE=y CONFIG_NR_CPUS=4 CONFIG_NVMEM=y CONFIG_NVMEM_LAYOUTS=y +# CONFIG_NVMEM_LAYOUT_MIKROTIK is not set CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/mt76x8/config-6.6 b/target/linux/ramips/mt76x8/config-6.6 index db1281ad54..a2d7bc9866 100644 --- a/target/linux/ramips/mt76x8/config-6.6 +++ b/target/linux/ramips/mt76x8/config-6.6 @@ -29,6 +29,7 @@ CONFIG_CPU_MIPS32=y CONFIG_CPU_MIPS32_R2=y CONFIG_CPU_MIPSR2=y CONFIG_CPU_MIPSR2_IRQ_VI=y +CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y @@ -56,8 +57,7 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y -CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y +CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/ramips/patches-6.6/801-DT-Add-documentation-for-gpio-ralink.patch b/target/linux/ramips/patches-6.6/801-DT-Add-documentation-for-gpio-ralink.patch index 976029c18c..fdb07f84f7 100644 --- a/target/linux/ramips/patches-6.6/801-DT-Add-documentation-for-gpio-ralink.patch +++ b/target/linux/ramips/patches-6.6/801-DT-Add-documentation-for-gpio-ralink.patch @@ -1,22 +1,18 @@ -From d410e5478c622c01fcf31427533df5f433df9146 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sun, 28 Jul 2013 19:45:30 +0200 -Subject: [PATCH 26/53] DT: Add documentation for gpio-ralink +Subject: [PATCH 1/3] DT: Add documentation for gpio-ralink Describe gpio-ralink binding. Signed-off-by: John Crispin -Cc: linux-mips@linux-mips.org -Cc: devicetree@vger.kernel.org -Cc: linux-gpio@vger.kernel.org --- - .../devicetree/bindings/gpio/gpio-ralink.txt | 40 ++++++++++++++++++++ - 1 file changed, 40 insertions(+) + .../devicetree/bindings/gpio/gpio-ralink.txt | 36 +++++++++++++++++++ + 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-ralink.txt --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-ralink.txt -@@ -0,0 +1,40 @@ +@@ -0,0 +1,36 @@ +Ralink SoC GPIO controller bindings + +Required properties: @@ -34,9 +30,6 @@ Cc: linux-gpio@vger.kernel.org + SoC type. Register offsets need to be in this order. + [ INT, EDGE, RENA, FENA, DATA, DIR, POL, SET, RESET, TOGGLE ] + -+Optional properties: -+- ralink,gpio-base : Specify the GPIO chips base number -+ +Example: + + gpio0: gpio@600 { @@ -51,7 +44,6 @@ Cc: linux-gpio@vger.kernel.org + interrupts = <6>; + + ngpios = <24>; -+ ralink,gpio-base = <0>; + ralink,register-map = [ 00 04 08 0c + 20 24 28 2c + 30 34 ]; diff --git a/target/linux/ramips/patches-6.6/802-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch b/target/linux/ramips/patches-6.6/802-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch index 75a7374054..2930c57f40 100644 --- a/target/linux/ramips/patches-6.6/802-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch +++ b/target/linux/ramips/patches-6.6/802-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch @@ -1,59 +1,28 @@ -From 69fdd2c4f937796b934e89c33acde9d082e27bfd Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 4 Aug 2014 20:36:29 +0200 -Subject: [PATCH 27/53] GPIO: MIPS: ralink: add gpio driver for ralink SoC +Subject: [PATCH 2/3] GPIO: MIPS: ralink: add gpio driver for ralink SoC Add gpio driver for Ralink SoC. This driver makes the gpio core on RT2880, RT305x, rt3352, rt3662, rt3883, rt5350 and mt7620 work. Signed-off-by: John Crispin -Cc: linux-mips@linux-mips.org -Cc: linux-gpio@vger.kernel.org --- - arch/mips/include/asm/mach-ralink/gpio.h | 24 ++ - drivers/gpio/Kconfig | 6 + - drivers/gpio/Makefile | 1 + - drivers/gpio/gpio-ralink.c | 355 ++++++++++++++++++++++++++++++ - 4 files changed, 386 insertions(+) - create mode 100644 arch/mips/include/asm/mach-ralink/gpio.h + drivers/gpio/Kconfig | 7 + + drivers/gpio/Makefile | 1 + + drivers/gpio/gpio-ralink.c | 273 +++++++++++++++++++++++++++++++++++++ + 3 files changed, 281 insertions(+) create mode 100644 drivers/gpio/gpio-ralink.c ---- /dev/null -+++ b/arch/mips/include/asm/mach-ralink/gpio.h -@@ -0,0 +1,24 @@ -+/* -+ * Ralink SoC GPIO API support -+ * -+ * Copyright (C) 2008-2009 Gabor Juhos -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 as published -+ * by the Free Software Foundation. -+ * -+ */ -+ -+#ifndef __ASM_MACH_RALINK_GPIO_H -+#define __ASM_MACH_RALINK_GPIO_H -+ -+#define ARCH_NR_GPIOS 128 -+#include -+ -+#define gpio_get_value __gpio_get_value -+#define gpio_set_value __gpio_set_value -+#define gpio_cansleep __gpio_cansleep -+#define gpio_to_irq __gpio_to_irq -+ -+#endif /* __ASM_MACH_RALINK_GPIO_H */ --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig -@@ -594,6 +594,12 @@ config GPIO_SNPS_CREG +@@ -594,6 +594,13 @@ config GPIO_SNPS_CREG where only several fields in register belong to GPIO lines and each GPIO line owns a field with different length and on/off value. +config GPIO_RALINK + bool "Ralink GPIO Support" + depends on RALINK ++ select GPIO_GENERIC + help + Say yes here to support the Ralink SoC GPIO device + @@ -72,7 +41,7 @@ Cc: linux-gpio@vger.kernel.org obj-$(CONFIG_GPIO_RCAR) += gpio-rcar.o --- /dev/null +++ b/drivers/gpio/gpio-ralink.c -@@ -0,0 +1,341 @@ +@@ -0,0 +1,273 @@ +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published @@ -142,52 +111,6 @@ Cc: linux-gpio@vger.kernel.org + return ioread32(rg->membase + rg->regs[reg]); +} + -+static void ralink_gpio_set(struct gpio_chip *chip, unsigned offset, int value) -+{ -+ struct ralink_gpio_chip *rg = to_ralink_gpio(chip); -+ -+ rt_gpio_w32(rg, (value) ? GPIO_REG_SET : GPIO_REG_RESET, BIT(offset)); -+} -+ -+static int ralink_gpio_get(struct gpio_chip *chip, unsigned offset) -+{ -+ struct ralink_gpio_chip *rg = to_ralink_gpio(chip); -+ -+ return !!(rt_gpio_r32(rg, GPIO_REG_DATA) & BIT(offset)); -+} -+ -+static int ralink_gpio_direction_input(struct gpio_chip *chip, unsigned offset) -+{ -+ struct ralink_gpio_chip *rg = to_ralink_gpio(chip); -+ unsigned long flags; -+ u32 t; -+ -+ spin_lock_irqsave(&rg->lock, flags); -+ t = rt_gpio_r32(rg, GPIO_REG_DIR); -+ t &= ~BIT(offset); -+ rt_gpio_w32(rg, GPIO_REG_DIR, t); -+ spin_unlock_irqrestore(&rg->lock, flags); -+ -+ return 0; -+} -+ -+static int ralink_gpio_direction_output(struct gpio_chip *chip, -+ unsigned offset, int value) -+{ -+ struct ralink_gpio_chip *rg = to_ralink_gpio(chip); -+ unsigned long flags; -+ u32 t; -+ -+ spin_lock_irqsave(&rg->lock, flags); -+ ralink_gpio_set(chip, offset, value); -+ t = rt_gpio_r32(rg, GPIO_REG_DIR); -+ t |= BIT(offset); -+ rt_gpio_w32(rg, GPIO_REG_DIR, t); -+ spin_unlock_irqrestore(&rg->lock, flags); -+ -+ return 0; -+} -+ +static int ralink_gpio_to_irq(struct gpio_chip *chip, unsigned pin) +{ + struct ralink_gpio_chip *rg = to_ralink_gpio(chip); @@ -330,55 +253,35 @@ Cc: linux-gpio@vger.kernel.org + +static int ralink_gpio_probe(struct platform_device *pdev) +{ -+ struct device_node *np = pdev->dev.of_node; -+ struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ struct device *dev = &pdev->dev; ++ struct device_node *np = dev->of_node; + struct ralink_gpio_chip *rg; -+ const __be32 *ngpio, *gpiobase; ++ int ret; + -+ if (!res) { -+ dev_err(&pdev->dev, "failed to find resource\n"); -+ return -ENOMEM; -+ } -+ -+ rg = devm_kzalloc(&pdev->dev, -+ sizeof(struct ralink_gpio_chip), GFP_KERNEL); ++ rg = devm_kzalloc(dev, sizeof(struct ralink_gpio_chip), GFP_KERNEL); + if (!rg) + return -ENOMEM; + -+ rg->membase = devm_ioremap_resource(&pdev->dev, res); -+ if (!rg->membase) { -+ dev_err(&pdev->dev, "cannot remap I/O memory region\n"); -+ return -ENOMEM; -+ } ++ rg->membase = devm_platform_ioremap_resource(pdev, 0); ++ if (IS_ERR(rg->membase)) ++ return PTR_ERR(rg->membase); + + if (of_property_read_u8_array(np, "ralink,register-map", + rg->regs, GPIO_REG_MAX)) { -+ dev_err(&pdev->dev, "failed to read register definition\n"); ++ dev_err(dev, "failed to read register definition\n"); + return -EINVAL; + } + -+ ngpio = of_get_property(np, "ngpios", NULL); -+ if (!ngpio) { -+ dev_err(&pdev->dev, "failed to read number of pins\n"); -+ return -EINVAL; -+ } -+ -+ gpiobase = of_get_property(np, "ralink,gpio-base", NULL); -+ if (gpiobase) -+ rg->chip.base = be32_to_cpu(*gpiobase); -+ else -+ rg->chip.base = -1; -+ + spin_lock_init(&rg->lock); + -+ rg->chip.parent = &pdev->dev; -+ rg->chip.label = dev_name(&pdev->dev); -+ rg->chip.fwnode = of_node_to_fwnode(np); -+ rg->chip.ngpio = be32_to_cpu(*ngpio); -+ rg->chip.direction_input = ralink_gpio_direction_input; -+ rg->chip.direction_output = ralink_gpio_direction_output; -+ rg->chip.get = ralink_gpio_get; -+ rg->chip.set = ralink_gpio_set; ++ ret = bgpio_init(&rg->chip, dev, 4, ++ rg->membase + rg->regs[GPIO_REG_DATA], ++ rg->membase + rg->regs[GPIO_REG_SET], ++ rg->membase + rg->regs[GPIO_REG_RESET], ++ rg->membase + rg->regs[GPIO_REG_DIR], ++ NULL, 0); ++ if (ret) ++ return dev_err_probe(dev, ret, "bgpio_init() failed\n"); + rg->chip.request = gpiochip_generic_request; + rg->chip.to_irq = ralink_gpio_to_irq; + rg->chip.free = gpiochip_generic_free; @@ -386,11 +289,9 @@ Cc: linux-gpio@vger.kernel.org + /* set polarity to low for all lines */ + rt_gpio_w32(rg, GPIO_REG_POL, 0); + -+ dev_info(&pdev->dev, "registering %d gpios\n", rg->chip.ngpio); -+ + ralink_gpio_irq_init(np, rg); + -+ return gpiochip_add(&rg->chip); ++ return devm_gpiochip_add_data(dev, &rg->chip, rg); +} + +static const struct of_device_id ralink_gpio_match[] = { diff --git a/target/linux/ramips/patches-6.6/803-gpio-ralink-Add-support-for-GPIO-as-interrupt-contro.patch b/target/linux/ramips/patches-6.6/803-gpio-ralink-Add-support-for-GPIO-as-interrupt-contro.patch index 8520ce32ff..54dadc735d 100644 --- a/target/linux/ramips/patches-6.6/803-gpio-ralink-Add-support-for-GPIO-as-interrupt-contro.patch +++ b/target/linux/ramips/patches-6.6/803-gpio-ralink-Add-support-for-GPIO-as-interrupt-contro.patch @@ -1,7 +1,6 @@ -From 57fa7f2f4ef6f78ce1d30509c0d111aa3791b524 Mon Sep 17 00:00:00 2001 From: Daniel Santos Date: Sun, 4 Nov 2018 20:24:32 -0600 -Subject: gpio-ralink: Add support for GPIO as interrupt-controller +Subject: [PATCH 3/3] gpio-ralink: Add support for GPIO as interrupt-controller Signed-off-by: Daniel Santos --- @@ -11,17 +10,17 @@ Signed-off-by: Daniel Santos --- a/Documentation/devicetree/bindings/gpio/gpio-ralink.txt +++ b/Documentation/devicetree/bindings/gpio/gpio-ralink.txt -@@ -17,6 +17,9 @@ Required properties: - - Optional properties: - - ralink,gpio-base : Specify the GPIO chips base number +@@ -14,6 +14,9 @@ Required properties: + - ralink,register-map : The register layout depends on the GPIO bank and actual + SoC type. Register offsets need to be in this order. + [ INT, EDGE, RENA, FENA, DATA, DIR, POL, SET, RESET, TOGGLE ] +- interrupt-controller : marks this as an interrupt controller +- #interrupt-cells : a standard two-cell interrupt flag, see + interrupt-controller/interrupts.txt Example: -@@ -28,6 +31,9 @@ Example: +@@ -25,6 +28,9 @@ Example: reg = <0x600 0x34>; @@ -33,7 +32,7 @@ Signed-off-by: Daniel Santos --- a/drivers/gpio/gpio-ralink.c +++ b/drivers/gpio/gpio-ralink.c -@@ -220,7 +220,7 @@ static int gpio_map(struct irq_domain *d +@@ -174,7 +174,7 @@ static int gpio_map(struct irq_domain *d } static const struct irq_domain_ops irq_domain_ops = { diff --git a/target/linux/ramips/rt288x/config-6.6 b/target/linux/ramips/rt288x/config-6.6 index f3261258ae..3a6657fdfe 100644 --- a/target/linux/ramips/rt288x/config-6.6 +++ b/target/linux/ramips/rt288x/config-6.6 @@ -25,6 +25,7 @@ CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_MIPS32=y CONFIG_CPU_MIPS32_R2=y CONFIG_CPU_MIPSR2=y +CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y @@ -49,8 +50,7 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y -CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y +CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y @@ -73,6 +73,7 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y CONFIG_GPIO_RALINK=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y diff --git a/target/linux/ramips/rt305x/config-6.6 b/target/linux/ramips/rt305x/config-6.6 index 27bf316c68..69070730ad 100644 --- a/target/linux/ramips/rt305x/config-6.6 +++ b/target/linux/ramips/rt305x/config-6.6 @@ -27,6 +27,7 @@ CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_MIPS32=y CONFIG_CPU_MIPS32_R2=y CONFIG_CPU_MIPSR2=y +CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y @@ -52,8 +53,7 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y -CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y +CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y @@ -76,6 +76,7 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y CONFIG_GPIO_RALINK=y CONFIG_GPIO_WATCHDOG=y # CONFIG_GPIO_WATCHDOG_ARCH_INITCALL is not set diff --git a/target/linux/ramips/rt3883/config-6.6 b/target/linux/ramips/rt3883/config-6.6 index b272c751ed..55dd19406e 100644 --- a/target/linux/ramips/rt3883/config-6.6 +++ b/target/linux/ramips/rt3883/config-6.6 @@ -26,6 +26,7 @@ CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_MIPS32=y CONFIG_CPU_MIPS32_R2=y CONFIG_CPU_MIPSR2=y +CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y @@ -52,8 +53,7 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y -CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y +CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y @@ -76,6 +76,7 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y CONFIG_GPIO_RALINK=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y diff --git a/target/linux/rockchip/image/Makefile b/target/linux/rockchip/image/Makefile index dbd7ea7b90..04f3649588 100644 --- a/target/linux/rockchip/image/Makefile +++ b/target/linux/rockchip/image/Makefile @@ -29,7 +29,7 @@ define Build/pine64-img # combining boot partition, root partition as well as the u-boot bootloader # Generate a new partition table in $@ with 32 MiB of - # alignment padding for the idbloader and u-boot to fit: + # alignment padding for the u-boot-rockchip.bin (idbloader + u-boot) to fit: # http://opensource.rock-chips.com/wiki_Boot_option#Boot_flow # # U-Boot SPL expects the U-Boot ITB to be located at sector 0x4000 (8 MiB) on the MMC storage @@ -39,9 +39,8 @@ define Build/pine64-img $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \ 32768 - # Copy the idbloader and the u-boot image to the image at sector 0x40 and 0x4000 - dd if="$(STAGING_DIR_IMAGE)"/$(UBOOT_DEVICE_NAME)-idbloader.img of="$@" seek=64 conv=notrunc - dd if="$(STAGING_DIR_IMAGE)"/$(UBOOT_DEVICE_NAME)-u-boot.itb of="$@" seek=16384 conv=notrunc + # Copy the u-boot-rockchip.bin to the image at sector 0x40 + dd if="$(STAGING_DIR_IMAGE)"/$(UBOOT_DEVICE_NAME)-u-boot-rockchip.bin of="$@" seek=64 conv=notrunc endef define Build/pine64-bin diff --git a/target/linux/starfive/patches-6.1/0112-dmaengine-dw-axi-dmac-Add-support-for-StarFive-JH711.patch b/target/linux/starfive/patches-6.1/0112-dmaengine-dw-axi-dmac-Add-support-for-StarFive-JH711.patch index 8b15fc213a..a8cc23bf10 100644 --- a/target/linux/starfive/patches-6.1/0112-dmaengine-dw-axi-dmac-Add-support-for-StarFive-JH711.patch +++ b/target/linux/starfive/patches-6.1/0112-dmaengine-dw-axi-dmac-Add-support-for-StarFive-JH711.patch @@ -51,7 +51,7 @@ Reviewed-by: Emil Renner Berthing cfg_hi = config->tt_fc << CH_CFG_H_TT_FC_POS | config->hs_sel_src << CH_CFG_H_HS_SEL_SRC_POS | config->hs_sel_dst << CH_CFG_H_HS_SEL_DST_POS | -@@ -1367,11 +1374,12 @@ static int parse_device_properties(struc +@@ -1365,11 +1372,12 @@ static int parse_device_properties(struc static int dw_probe(struct platform_device *pdev) { @@ -65,7 +65,7 @@ Reviewed-by: Emil Renner Berthing u32 i; int ret; -@@ -1400,12 +1408,25 @@ static int dw_probe(struct platform_devi +@@ -1398,12 +1406,25 @@ static int dw_probe(struct platform_devi if (IS_ERR(chip->regs)) return PTR_ERR(chip->regs); @@ -92,7 +92,7 @@ Reviewed-by: Emil Renner Berthing chip->core_clk = devm_clk_get(chip->dev, "core-clk"); if (IS_ERR(chip->core_clk)) return PTR_ERR(chip->core_clk); -@@ -1556,8 +1577,15 @@ static const struct dev_pm_ops dw_axi_dm +@@ -1554,8 +1575,15 @@ static const struct dev_pm_ops dw_axi_dm }; static const struct of_device_id dw_dma_of_id_table[] = { diff --git a/target/linux/starfive/patches-6.1/0113-dmaengine-dw-axi-dmac-Increase-polling-time-to-DMA-t.patch b/target/linux/starfive/patches-6.1/0113-dmaengine-dw-axi-dmac-Increase-polling-time-to-DMA-t.patch index 903efb43c1..30f4abd798 100644 --- a/target/linux/starfive/patches-6.1/0113-dmaengine-dw-axi-dmac-Increase-polling-time-to-DMA-t.patch +++ b/target/linux/starfive/patches-6.1/0113-dmaengine-dw-axi-dmac-Increase-polling-time-to-DMA-t.patch @@ -18,7 +18,7 @@ Signed-off-by: Walker Chen --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c -@@ -1147,7 +1147,7 @@ static int dma_chan_terminate_all(struct +@@ -1145,7 +1145,7 @@ static int dma_chan_terminate_all(struct axi_chan_disable(chan); ret = readl_poll_timeout_atomic(chan->chip->regs + DMAC_CHEN, val, diff --git a/target/linux/starfive/patches-6.1/1007-dmaengine-dw-axi-dmac-Handle-xfer-start-while-non-id.patch b/target/linux/starfive/patches-6.1/1007-dmaengine-dw-axi-dmac-Handle-xfer-start-while-non-id.patch index 1599e8a2ca..2c0b1938ce 100644 --- a/target/linux/starfive/patches-6.1/1007-dmaengine-dw-axi-dmac-Handle-xfer-start-while-non-id.patch +++ b/target/linux/starfive/patches-6.1/1007-dmaengine-dw-axi-dmac-Handle-xfer-start-while-non-id.patch @@ -13,7 +13,7 @@ Signed-off-by: Curry Zhang --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c -@@ -382,11 +382,13 @@ static void axi_chan_block_xfer_start(st +@@ -383,11 +383,13 @@ static void axi_chan_block_xfer_start(st u32 irq_mask; u8 lms = 0; /* Select AXI0 master for LLI fetching */ @@ -28,7 +28,7 @@ Signed-off-by: Curry Zhang } axi_dma_enable(chan->chip); -@@ -1028,6 +1030,14 @@ static noinline void axi_chan_handle_err +@@ -1029,6 +1031,14 @@ static noinline void axi_chan_handle_err axi_chan_name(chan)); goto out; } diff --git a/target/linux/starfive/patches-6.1/1008-dmaengine-dw-axi-dmac-Add-StarFive-JH7100-support.patch b/target/linux/starfive/patches-6.1/1008-dmaengine-dw-axi-dmac-Add-StarFive-JH7100-support.patch index e01c37fd76..854e739bab 100644 --- a/target/linux/starfive/patches-6.1/1008-dmaengine-dw-axi-dmac-Add-StarFive-JH7100-support.patch +++ b/target/linux/starfive/patches-6.1/1008-dmaengine-dw-axi-dmac-Add-StarFive-JH7100-support.patch @@ -12,7 +12,7 @@ Signed-off-by: Emil Renner Berthing --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c -@@ -677,8 +677,13 @@ static int dw_axi_dma_set_hw_desc(struct +@@ -678,8 +678,13 @@ static int dw_axi_dma_set_hw_desc(struct hw_desc->lli->block_ts_lo = cpu_to_le32(block_ts - 1); @@ -26,7 +26,7 @@ Signed-off-by: Emil Renner Berthing hw_desc->lli->ctl_lo = cpu_to_le32(ctllo); set_desc_src_master(hw_desc); -@@ -1508,7 +1513,11 @@ static int dw_probe(struct platform_devi +@@ -1506,7 +1511,11 @@ static int dw_probe(struct platform_devi * Therefore, set constraint to 1024 * 4. */ dw->dma.dev->dma_parms = &dw->dma_parms; @@ -38,7 +38,7 @@ Signed-off-by: Emil Renner Berthing platform_set_drvdata(pdev, chip); pm_runtime_enable(chip->dev); -@@ -1593,6 +1602,9 @@ static const struct of_device_id dw_dma_ +@@ -1591,6 +1600,9 @@ static const struct of_device_id dw_dma_ .compatible = "intel,kmb-axi-dma", .data = (void *)AXI_DMA_FLAG_HAS_APB_REGS, }, { @@ -50,7 +50,7 @@ Signed-off-by: Emil Renner Berthing }, --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac.h +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h -@@ -283,7 +283,11 @@ enum { +@@ -284,7 +284,11 @@ enum { #define CH_CTL_L_SRC_MAST BIT(0) /* CH_CFG_H */ diff --git a/tools/mkimage/Makefile b/tools/mkimage/Makefile index 6d2cc5f764..0a1712bc67 100644 --- a/tools/mkimage/Makefile +++ b/tools/mkimage/Makefile @@ -7,14 +7,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mkimage -PKG_VERSION:=2024.04 +PKG_VERSION:=2024.07 PKG_SOURCE:=u-boot-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ https://mirror.cyberbits.eu/u-boot \ https://ftp.denx.de/pub/u-boot \ ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=18a853fe39fad7ad03a90cc2d4275aeaed6da69735defac3492b80508843dd4a +PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/u-boot-$(PKG_VERSION)