From 0e391c2c72b5c258080302bf247c8edaab567dd6 Mon Sep 17 00:00:00 2001 From: Vince JV <1276544+vincejv@users.noreply.github.com> Date: Thu, 25 Jul 2024 03:11:40 +0800 Subject: [PATCH] Upstream sync --- README.md | 2 +- include/host-build.mk | 4 + include/kernel-build.mk | 2 +- include/netfilter.mk | 2 - include/target.mk | 10 +- package/boot/uboot-envtools/Makefile | 6 +- ...ding-NVMEM-device-s-compatible-value.patch | 70 - ...ing-read-until-whole-flash-block-is-.patch | 75 - ...tect-NAND-erase-size-and-env-sectors.patch | 49 - package/boot/uboot-mvebu/Makefile | 11 +- ...da-8k-respect-CONFIG_DISTRO_DEFAULTS.patch | 38 + .../101-net-mvpp2-fix-10GBase-R-support.patch | 108 + ...d-support-for-MikroTik-RB5009UG-S-IN.patch | 459 ++ package/boot/uboot-rockchip/Makefile | 8 +- package/firmware/ipq-wifi/Makefile | 2 + package/firmware/linux-firmware/realtek.mk | 2 +- package/kernel/bcm63xx-cfe/Makefile | 6 +- package/kernel/linux/modules/crypto.mk | 25 +- package/kernel/linux/modules/fs.mk | 2 +- package/kernel/linux/modules/hwmon.mk | 4 +- package/kernel/linux/modules/lib.mk | 62 +- package/kernel/linux/modules/netdevices.mk | 3 +- package/kernel/linux/modules/netfilter.mk | 26 +- package/kernel/linux/modules/netsupport.mk | 27 +- package/kernel/linux/modules/other.mk | 13 + package/kernel/qca-ssdk/Makefile | 13 +- ...upport-for-detection-PSGMII-PHY-mode.patch | 25 - .../patches/200-allow-parallel-build.patch | 2 +- .../patches/201-fix-compile-warnings.patch | 31 - package/network/services/hostapd/Makefile | 2 +- ...probe-requests-with-invalid-DSSS-par.patch | 44 + package/utils/e2fsprogs/Makefile | 20 +- package/utils/f2fs-tools/Makefile | 3 +- package/utils/mtd-utils/Makefile | 10 +- .../mtd-utils/patches/100-fix_includes.patch | 10 - .../mtd-utils/patches/130-lzma_jffs2.patch | 5038 ----------------- rules.mk | 14 + ...he-incorrect-ifdeffery-and-dependenc.patch | 206 + ...-arm-qcom-ids-Add-SoC-ID-for-IPQ5321.patch | 28 + ..._eth_soc-ppe-add-support-for-multipl.patch | 371 ++ ..._eth_soc-ppe-prevent-ppe-update-for-.patch | 30 + ...support-for-LED-s-on-RTL8168-RTL8101.patch | 319 ++ ...ix-building-with-CONFIG_LEDS_CLASS-m.patch | 75 + ...-v6.9-r8169-add-support-for-RTL8126A.patch | 355 ++ ...improve-checking-for-valid-LED-modes.patch | 81 + ...-add-LED-support-for-RTL8125-RTL8126.patch | 244 + ...d-MODULE_FIRMWARE-entry-for-RTL8126A.patch | 25 + ...v6.10-r8169-add-support-for-RTL8168M.patch | 30 + ...D-related-deadlock-on-module-removal.patch | 147 + ...g-conditional-compiling-for-call-to-.patch | 31 + ...ntia-move-priv-and-hw-stat-to-header.patch | 122 + ...y-aquantia-add-support-for-PHY-LEDs.patch} | 247 +- ...6.11-hwmon-g672-add-support-for-g761.patch | 106 + ...v6.8-net-phy-add-possible-interfaces.patch | 60 + ...6.8-net-phylink-use-for_each_set_bit.patch | 46 + ...k-split-out-per-interface-validation.patch | 76 + ...k-pass-PHY-into-phylink_validate_one.patch | 47 + ...-pass-PHY-into-phylink_validate_mask.patch | 58 + ...t-out-PHY-validation-from-phylink_br.patch | 95 + ...the-PHY-s-possible_interfaces-if-pop.patch | 130 + ...x-rename-mv88e6xxx_g2_scratch_gpio_s.patch | 61 + ...x-add-Amethyst-specific-SMI-GPIO-fun.patch | 92 + ...808x-add-helper-for-checking-for-1G-.patch | 50 + ...-qca808x-fill-in-possible_interfaces.patch | 44 + target/linux/generic/config-6.6 | 647 +-- ...hy-aquantia-enable-AQR112-and-AQR412.patch | 8 +- ...aquantia-fix-system-side-protocol-mi.patch | 2 +- ...ntia-add-PHY_IDs-for-AQR112-variants.patch | 1 - .../765-mxl-gpy-control-LED-reg-from-DT.patch | 15 +- ...mtd-device-named-ubi-or-data-on-boot.patch | 10 +- ...add-uImage.FIT-subimage-block-driver.patch | 2 +- ...detach-callback-to-struct-phy_driver.patch | 4 +- ..._eth_soc-compile-out-netsys-v2-code-.patch | 4 +- ..._eth_soc-work-around-issue-with-send.patch | 6 +- ...ernet-mtk_eth_soc-use-napi_build_skb.patch | 4 +- ..._eth_soc-add-paths-and-SerDes-modes-.patch | 38 +- ...equest-assisted-learning-on-CPU-port.patch | 2 +- ...phy-move-LED-polarity-to-phy_init_hw.patch | 100 - tools/Makefile | 6 +- tools/coreutils/Makefile | 1 - tools/e2fsprogs/Makefile | 17 +- tools/llvm-bpf/Makefile | 28 +- tools/mkimage/Makefile | 4 +- tools/mtd-utils/Makefile | 14 +- tools/mtd-utils/patches/110-portability.patch | 22 +- tools/mtd-utils/patches/130-lzma_jffs2.patch | 95 +- tools/util-linux/Makefile | 8 +- ...w-enabling-with-disable-all-programs.patch | 28 + .../patches/101-macos-weak-aliases.patch | 26 + 89 files changed, 4138 insertions(+), 6358 deletions(-) delete mode 100644 package/boot/uboot-envtools/patches/010-fw_env-fix-reading-NVMEM-device-s-compatible-value.patch delete mode 100644 package/boot/uboot-envtools/patches/011-fw_env-keep-calling-read-until-whole-flash-block-is-.patch delete mode 100644 package/boot/uboot-envtools/patches/012-fw_env-autodetect-NAND-erase-size-and-env-sectors.patch create mode 100644 package/boot/uboot-mvebu/patches/100-mvebu-armada-8k-respect-CONFIG_DISTRO_DEFAULTS.patch create mode 100644 package/boot/uboot-mvebu/patches/101-net-mvpp2-fix-10GBase-R-support.patch create mode 100644 package/boot/uboot-mvebu/patches/102-arm-mvebu-add-support-for-MikroTik-RB5009UG-S-IN.patch delete mode 100644 package/kernel/qca-ssdk/patches/101-hsl_phy-add-support-for-detection-PSGMII-PHY-mode.patch delete mode 100644 package/kernel/qca-ssdk/patches/201-fix-compile-warnings.patch create mode 100644 package/network/services/hostapd/patches/762-AP-don-t-ignore-probe-requests-with-invalid-DSSS-par.patch delete mode 100644 package/utils/mtd-utils/patches/100-fix_includes.patch delete mode 100644 package/utils/mtd-utils/patches/130-lzma_jffs2.patch create mode 100644 target/linux/generic/backport-6.6/310-v6.7-mips-kexec-fix-the-incorrect-ifdeffery-and-dependenc.patch create mode 100644 target/linux/generic/backport-6.6/722-v6.10-dt-bindings-arm-qcom-ids-Add-SoC-ID-for-IPQ5321.patch create mode 100644 target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch create mode 100644 target/linux/generic/backport-6.6/752-27-v6.10-net-ethernet-mtk_eth_soc-ppe-prevent-ppe-update-for-.patch create mode 100644 target/linux/generic/backport-6.6/780-01-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch create mode 100644 target/linux/generic/backport-6.6/780-02-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch create mode 100644 target/linux/generic/backport-6.6/780-03-v6.9-r8169-add-support-for-RTL8126A.patch create mode 100644 target/linux/generic/backport-6.6/780-04-v6.9-r8169-improve-checking-for-valid-LED-modes.patch create mode 100644 target/linux/generic/backport-6.6/780-05-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch create mode 100644 target/linux/generic/backport-6.6/780-06-v6.9-r8169-add-MODULE_FIRMWARE-entry-for-RTL8126A.patch create mode 100644 target/linux/generic/backport-6.6/780-07-v6.10-r8169-add-support-for-RTL8168M.patch create mode 100644 target/linux/generic/backport-6.6/780-08-v6.10-r8169-fix-LED-related-deadlock-on-module-removal.patch create mode 100644 target/linux/generic/backport-6.6/780-09-v6.10-r8169-add-missing-conditional-compiling-for-call-to-.patch create mode 100644 target/linux/generic/backport-6.6/791-v6.11-01-net-phy-aquantia-move-priv-and-hw-stat-to-header.patch rename target/linux/generic/{pending-6.6/743-net-phy-aquantia-add-support-for-PHY-LEDs.patch => backport-6.6/791-v6.11-02-net-phy-aquantia-add-support-for-PHY-LEDs.patch} (65%) create mode 100644 target/linux/generic/backport-6.6/810-v6.11-hwmon-g672-add-support-for-g761.patch create mode 100644 target/linux/generic/backport-6.6/895-01-v6.8-net-phy-add-possible-interfaces.patch create mode 100644 target/linux/generic/backport-6.6/895-02-v6.8-net-phylink-use-for_each_set_bit.patch create mode 100644 target/linux/generic/backport-6.6/895-03-v6.8-net-phylink-split-out-per-interface-validation.patch create mode 100644 target/linux/generic/backport-6.6/895-04-v6.8-net-phylink-pass-PHY-into-phylink_validate_one.patch create mode 100644 target/linux/generic/backport-6.6/895-05-v6.8-net-phylink-pass-PHY-into-phylink_validate_mask.patch create mode 100644 target/linux/generic/backport-6.6/895-06-v6.8-net-phylink-split-out-PHY-validation-from-phylink_br.patch create mode 100644 target/linux/generic/backport-6.6/895-07-v6.8-net-phylink-use-the-PHY-s-possible_interfaces-if-pop.patch create mode 100644 target/linux/generic/backport-6.6/896-01-v6.9-net-dsa-mv88e6xxx-rename-mv88e6xxx_g2_scratch_gpio_s.patch create mode 100644 target/linux/generic/backport-6.6/896-02-v6.9-net-dsa-mv88e6xxx-add-Amethyst-specific-SMI-GPIO-fun.patch create mode 100644 target/linux/generic/backport-6.6/897-01-v6.9-net-phy-qcom-qca808x-add-helper-for-checking-for-1G-.patch create mode 100644 target/linux/generic/backport-6.6/897-02-v6.9-net-phy-qcom-qca808x-fill-in-possible_interfaces.patch delete mode 100644 target/linux/generic/pending-6.6/999-net-phy-move-LED-polarity-to-phy_init_hw.patch create mode 100644 tools/util-linux/patches/0001-hexdump-allow-enabling-with-disable-all-programs.patch create mode 100644 tools/util-linux/patches/101-macos-weak-aliases.patch diff --git a/README.md b/README.md index 8bca0ee7b08247..9141b2392df73e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ An advanced user may require additional or specific package. (Toolchain, SDK, .. ## Development -To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case +To build your own firmware you need a GNU/Linux, BSD or macOS system (case sensitive filesystem required). Cygwin is unsupported because of the lack of a case sensitive file system. diff --git a/include/host-build.mk b/include/host-build.mk index 4406b92cc9eb87..8313dbfbb39e73 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -76,6 +76,10 @@ HOST_CONFIGURE_ARGS = \ --localstatedir=$(HOST_BUILD_PREFIX)/var \ --sbindir=$(HOST_BUILD_PREFIX)/bin +ifneq ($(YEAR_2038),y) + HOST_CONFIGURE_ARGS += --disable-year2038 +endif + HOST_MAKE_VARS = \ CFLAGS="$(HOST_CFLAGS)" \ CPPFLAGS="$(HOST_CPPFLAGS)" \ diff --git a/include/kernel-build.mk b/include/kernel-build.mk index c42dae0049ba4f..48e00fa4c61b2e 100644 --- a/include/kernel-build.mk +++ b/include/kernel-build.mk @@ -51,7 +51,7 @@ endif define Download/git-kernel URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)) PROTO:=git - VERSION:=$(CONFIG_KERNEL_GIT_REF) + SOURCE_VERSION:=$(CONFIG_KERNEL_GIT_REF) FILE:=$(LINUX_SOURCE) SUBDIR:=linux-$(LINUX_VERSION) OPTS:=$(KERNEL_GIT_OPTS) diff --git a/include/netfilter.mk b/include/netfilter.mk index 81488fe5c8eb8a..7d1f03891ba7ff 100644 --- a/include/netfilter.mk +++ b/include/netfilter.mk @@ -253,8 +253,6 @@ $(eval $(call nf_add,IPT_LED,CONFIG_NETFILTER_XT_TARGET_LED, $(P_XT)xt_LED)) # tee $(eval $(call nf_add,IPT_TEE,CONFIG_NETFILTER_XT_TARGET_TEE, $(P_XT)xt_TEE)) -$(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV4, $(P_V4)nf_dup_ipv4),)) -$(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV6, $(P_V6)nf_dup_ipv6),)) # u32 diff --git a/include/target.mk b/include/target.mk index 3edfb565852a0b..d778ac4250d106 100644 --- a/include/target.mk +++ b/include/target.mk @@ -346,7 +346,15 @@ ifeq ($(DUMP),1) ifneq ($(CONFIG_CPU_MIPS32_R2),) FEATURES += mips16 endif - FEATURES += $(foreach v,6 7,$(if $(CONFIG_CPU_V$(v)),arm_v$(v))) + ifneq ($(CONFIG_CPU_V6),) + FEATURES += arm_v6 + endif + ifneq ($(CONFIG_CPU_V6K),) + FEATURES += arm_v6 + endif + ifneq ($(CONFIG_CPU_V7),) + FEATURES += arm_v7 + endif # remove duplicates FEATURES:=$(sort $(FEATURES)) diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index d4446167b73aa3..19c3073c74a936 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/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 5af8a1aa0e6014..00000000000000 --- 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 af1c32fe91cb9f..00000000000000 --- 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 78f555fb1f3aed..00000000000000 --- 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-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index c92e7f4f19da29..535180f4c8e177 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -60,13 +60,22 @@ define U-Boot/eDPU BUILD_SUBTARGET:=cortexa53 endef +define U-Boot/rb5009 + NAME:=MikroTik RB5009 + BUILD_SUBTARGET:=cortexa72 + BUILD_DEVICES:=mikrotik_rb5009 + UBOOT_CONFIG:=mvebu_rb5009 + UBOOT_IMAGE:=u-boot.elf +endef + UBOOT_TARGETS:= \ clearfog \ helios4 \ omnia \ espressobin \ uDPU \ - eDPU + eDPU \ + rb5009 define Package/u-boot/install $(if $(findstring cortexa53,$(BUILD_SUBTARGET)),,$(Package/u-boot/install/default)) diff --git a/package/boot/uboot-mvebu/patches/100-mvebu-armada-8k-respect-CONFIG_DISTRO_DEFAULTS.patch b/package/boot/uboot-mvebu/patches/100-mvebu-armada-8k-respect-CONFIG_DISTRO_DEFAULTS.patch new file mode 100644 index 00000000000000..f32f24602229b6 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/100-mvebu-armada-8k-respect-CONFIG_DISTRO_DEFAULTS.patch @@ -0,0 +1,38 @@ +From a322b1cbb3f3e606d33a11fd18df20811e5c16f2 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Fri, 21 Jun 2024 11:41:30 +0200 +Subject: [PATCH 1/3] mvebu: armada-8k: respect CONFIG_DISTRO_DEFAULTS + +Currently, Armada 8k config header is setting boot devices and including + regardless of the CONFIG_DISTRO_DEFAULTS being +enabled or not, thus populating the environment for distro boot even on +devices that have no need for it. + +So, lets simply respect the value of CONFIG_DISTRO_DEFAULTS. + +Signed-off-by: Robert Marko +--- + include/configs/mvebu_armada-8k.h | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/include/configs/mvebu_armada-8k.h ++++ b/include/configs/mvebu_armada-8k.h +@@ -30,7 +30,7 @@ + /* + * PCI configuration + */ +- ++#ifdef CONFIG_DISTRO_DEFAULTS + #define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 1) \ + func(MMC, mmc, 0) \ +@@ -40,6 +40,9 @@ + func(DHCP, dhcp, na) + + #include ++#else ++#define BOOTENV ++#endif + + #define CFG_EXTRA_ENV_SETTINGS \ + "scriptaddr=0x6d00000\0" \ diff --git a/package/boot/uboot-mvebu/patches/101-net-mvpp2-fix-10GBase-R-support.patch b/package/boot/uboot-mvebu/patches/101-net-mvpp2-fix-10GBase-R-support.patch new file mode 100644 index 00000000000000..eb7bbdbf484497 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/101-net-mvpp2-fix-10GBase-R-support.patch @@ -0,0 +1,108 @@ +From 0de5d031f36bca4f7c2686287eff1ef0f5412367 Mon Sep 17 00:00:00 2001 +From: Sergey Sergeev +Date: Sun, 16 Jan 2022 17:19:35 +0100 +Subject: [PATCH 2/3] net: mvpp2: fix 10GBase-R support + +Due to the lack of XPCS register initialization code and partially incorrect +initialization of the MPCS network controler registers (tested on Mikrotik RB5009 +in conjunction with MV88E6393X) the network does not work correctly. +The problem manifests itself as an arbitrary delay (0.4-4 sec) for the actual +data transmission to the network! Accordingly, an almost completely non-working +network for U-Boot is obtained. The code is backported from a similar Linux driver. + +Signed-off-by: Sergey Sergeev +Signed-off-by: Robert Marko +--- + drivers/net/mvpp2.c | 73 +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 73 insertions(+) + +--- a/drivers/net/mvpp2.c ++++ b/drivers/net/mvpp2.c +@@ -3255,6 +3255,76 @@ static int gop_gpcs_reset(struct mvpp2_p + return 0; + } + ++static void gop_pcs_reset_assert(struct mvpp2_port *port) ++{ ++ u32 val; ++ ++ if (port->priv->hw_version == MVPP21 || port->gop_id != 0) ++ return; ++ ++ val = readl(port->priv->mpcs_base + port->gop_id * MVPP22_PORT_OFFSET + ++ PCS_CLOCK_RESET); ++ val &= ~(MAC_CLK_RESET_MASK | RX_SD_CLK_RESET_MASK | TX_SD_CLK_RESET_MASK); ++ val |= CLK_DIV_PHASE_SET_MASK; ++ writel(val, port->priv->mpcs_base + port->gop_id * MVPP22_PORT_OFFSET + ++ PCS_CLOCK_RESET); ++ ++ val = readl(port->priv->xpcs_base + port->gop_id * MVPP22_PORT_OFFSET + ++ MVPP22_XPCS_GLOBAL_CFG_0_REG); ++ val &= ~MVPP22_XPCS_PCSRESET; ++ writel(val, port->priv->xpcs_base + port->gop_id * MVPP22_PORT_OFFSET + ++ MVPP22_XPCS_GLOBAL_CFG_0_REG); ++} ++ ++static void gps_pcs_reset_deassert(struct mvpp2_port *port) ++{ ++ u32 val; ++ ++ if (port->priv->hw_version == MVPP21 || port->gop_id != 0) ++ return; ++ ++ /* this code is only for case of PHY_INTERFACE_MODE_10GBASER! */ ++ val = readl(port->priv->mpcs_base + port->gop_id * MVPP22_PORT_OFFSET + ++ PCS_CLOCK_RESET); ++ val |= MAC_CLK_RESET_MASK | RX_SD_CLK_RESET_MASK | ++ TX_SD_CLK_RESET_MASK; ++ val &= ~CLK_DIV_PHASE_SET_MASK; ++ writel(val, port->priv->mpcs_base + port->gop_id * MVPP22_PORT_OFFSET + ++ PCS_CLOCK_RESET); ++} ++ ++/* Set the internal mux's to the required PCS in the PI */ ++static int gop_xpcs_mode(struct mvpp2_port *port, int num_of_lanes) ++{ ++ u32 val; ++ int lane; ++ ++ switch (num_of_lanes) { ++ case 1: ++ lane = 0; ++ break; ++ case 2: ++ lane = 1; ++ break; ++ case 4: ++ lane = 2; ++ break; ++ default: ++ return -1; ++ } ++ ++ /* configure XG MAC mode */ ++ val = readl(port->priv->xpcs_base + port->gop_id * MVPP22_PORT_OFFSET + ++ MVPP22_XPCS_GLOBAL_CFG_0_REG); ++ val &= ~MVPP22_XPCS_PCSMODE_MASK; ++ val &= ~MVPP22_XPCS_LANEACTIVE_MASK; ++ val |= (2 * lane) << MVPP22_XPCS_LANEACTIVE_OFFS; ++ writel(val, port->priv->xpcs_base + port->gop_id * MVPP22_PORT_OFFSET + ++ MVPP22_XPCS_GLOBAL_CFG_0_REG); ++ ++ return 0; ++} ++ + static int gop_mpcs_mode(struct mvpp2_port *port) + { + u32 val; +@@ -3397,7 +3467,10 @@ static int gop_port_init(struct mvpp2_po + num_of_act_lanes = 2; + mac_num = 0; + /* configure PCS */ ++ gop_pcs_reset_assert(port); ++ gop_xpcs_mode(port, num_of_act_lanes); + gop_mpcs_mode(port); ++ gps_pcs_reset_deassert(port); + /* configure MAC */ + gop_xlg_mac_mode_cfg(port, num_of_act_lanes); + diff --git a/package/boot/uboot-mvebu/patches/102-arm-mvebu-add-support-for-MikroTik-RB5009UG-S-IN.patch b/package/boot/uboot-mvebu/patches/102-arm-mvebu-add-support-for-MikroTik-RB5009UG-S-IN.patch new file mode 100644 index 00000000000000..b1b94cc566a3c2 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/102-arm-mvebu-add-support-for-MikroTik-RB5009UG-S-IN.patch @@ -0,0 +1,459 @@ +From 163b07bda901b728f4f208a296c15b513f9d5b49 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Sun, 2 Jan 2022 15:10:34 +0100 +Subject: [PATCH 3/3] arm: mvebu: add support for MikroTik RB5009UG+S+IN + +Specifications: + - SoC: Marvell Armada 7040 (88F7040) - 4 cores, ARMv8, 1.4GHz, 64bit + - RAM: 1024MB DDR4 + - Flash: 16MB SPI NOR flash, 1024MB NAND + - Ethernet: One Marvell 88E6393X - Amethyst: one 2.5G + seven 1G ports and one SFP+ + - LED: User, SFP, Hdr1, Hdr2 + - Buttons: Reset + - UART: 115200 8n1 + - USB: One USB3 port + +This provides only the basic support required to boot OpenWrt, however +networking via the switch also works since its preconfigured by MikroTik +RouterBoot since we are using U-Boot as the secondary bootloader. + +Signed-off-by: Robert Marko +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/armada-7040-rb5009.dts | 241 ++++++++++++++++++ + arch/arm/mach-mvebu/arm64-common.c | 10 +- + .../mvebu_armada-8k/mikrotik-rb5009.env | 52 ++++ + configs/mvebu_rb5009_defconfig | 97 +++++++ + 5 files changed, 398 insertions(+), 3 deletions(-) + create mode 100644 arch/arm/dts/armada-7040-rb5009.dts + create mode 100644 board/Marvell/mvebu_armada-8k/mikrotik-rb5009.env + create mode 100644 configs/mvebu_rb5009_defconfig + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -333,6 +333,7 @@ dtb-$(CONFIG_ARCH_MVEBU) += \ + armada-3720-uDPU.dtb \ + armada-7040-db-nand.dtb \ + armada-7040-db.dtb \ ++ armada-7040-rb5009.dtb \ + armada-8040-clearfog-gt-8k.dtb \ + armada-8040-db.dtb \ + armada-8040-mcbin.dtb \ +--- /dev/null ++++ b/arch/arm/dts/armada-7040-rb5009.dts +@@ -0,0 +1,241 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright (C) 2016- 2021 Marvell International Ltd. ++ */ ++ ++/* ++ * Device Tree file for MikroTik RB5009 ++ * Boot device: SPI NOR, 0x0 ++ */ ++ ++#include "armada-7040.dtsi" ++#include ++#include ++ ++/ { ++ model = "MikroTik RB5009"; ++ compatible = "mikrotik,rb5009", "marvell,armada7040", ++ "marvell,armada-ap806-quad", "marvell,armada-ap806"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@00000000 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0x40000000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led_user: user { ++ label = "green:user"; ++ gpios = <&cp0_gpio1 26 GPIO_ACTIVE_LOW>; ++ default-state = "on"; ++ }; ++ ++ sfp { ++ label = "green:sfp"; ++ gpios = <&cp0_gpio1 25 GPIO_ACTIVE_LOW>; ++ }; ++ ++ hdr1 { ++ label = "blue:hdr1"; ++ gpios = <&cp0_gpio0 4 GPIO_ACTIVE_LOW>; ++ }; ++ ++ hdr2 { ++ label = "blue:hdr2"; ++ gpios = <&cp0_gpio1 19 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ gpios = <&cp0_gpio0 28 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++}; ++ ++&ap_pinctl { ++ /* MPP Bus: ++ * SPI [0-3] ++ * UART0 [11,19] ++ */ ++ /* 0 1 2 3 4 5 6 7 8 9 */ ++ pin-func = < 3 3 3 3 0 0 0 0 0 0 ++ 0 3 0 0 0 0 0 0 0 3 >; ++ ++ ap_spi_pins: ap-spi-pins { ++ marvell,pins = < 0 1 2 3 >; ++ marvell,function = <3>; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; ++ ++&ap_spi0 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ap_spi_pins>; ++ ++ spi-flash@0 { ++ #address-cells = <0x1>; ++ #size-cells = <0x1>; ++ compatible = "jedec,spi-nor"; ++ reg = <0x0>; ++ spi-max-frequency = <20000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ /* Empty space on NOR repurposed for U-Boot environment */ ++ partition@fe0000 { ++ compatible = "u-boot,env"; ++ label = "u-boot-env"; ++ reg = <0xfe0000 0x20000>; ++ }; ++ }; ++ }; ++}; ++ ++&cp0_pinctl { ++ /* MPP Bus: ++ * NF_RBn [13] ++ * DEV_BUS [15-27] ++ * UART0 [29,30] ++ * SMI [35,36] ++ * I2C0 [37,38] ++ * SPI1 [47-50] ++ */ ++ /* 0 1 2 3 4 5 6 7 8 9 */ ++ pin-func = < 0 0 0 0 0 0 0 0 0 0 ++ 0 0 0 2 0 1 1 1 1 1 ++ 1 1 1 1 1 1 1 1 0 0xA ++ 0xA 0 0 0 0 8 8 2 2 0 ++ 0 0 0 0 0 0 0 5 5 5 ++ 5 0 0 0 0 0 0 0 0 0 ++ 0 0 0 >; ++ ++ cp0_nand_pins: cp0-nand-pins { ++ marvell,pins = < 15 16 17 18 19 20 21 22 23 24 25 26 27 >; ++ marvell,function = <1>; ++ }; ++ ++ cp0_smi_pins: cp0-smi-pins { ++ marvell,pins = < 35 36 >; ++ marvell,function = <8>; ++ }; ++ ++ cp0_spi1_pins: cp0-spi-pins-1 { ++ marvell,pins = < 47 48 49 50 >; ++ marvell,function = <5>; ++ }; ++}; ++ ++&cp0_gpio1 { ++ enable-usb-power { ++ gpio-hog; ++ gpios = <23 GPIO_ACTIVE_HIGH>; ++ output-high; ++ line-name = "enable USB power"; ++ }; ++ ++ enable-leds-power { ++ gpio-hog; ++ gpios = <27 GPIO_ACTIVE_HIGH>; ++ output-high; ++ line-name = "enable LED-s power"; ++ }; ++}; ++ ++&cp0_nand { ++ status = "okay"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&cp0_nand_pins>; ++ ++ nand-ecc-strength = <4>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "YAFFS"; ++ reg = <0x0 0x800000>; ++ }; ++ ++ partition@800000 { ++ label = "ubi"; ++ reg = <0x800000 0x3f800000>; ++ }; ++ }; ++}; ++ ++&cp0_usb3_1 { ++ status = "okay"; ++}; ++ ++&cp0_utmi1 { ++ status = "okay"; ++}; ++ ++&cp0_i2c0 { ++ status = "okay"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&cp0_i2c0_pins>; ++ clock-frequency = <100000>; ++}; ++ ++&cp0_comphy { ++ phy0 { ++ phy-type = ; ++ }; ++ ++ phy1 { ++ phy-type = ; ++ }; ++ ++ phy2 { ++ phy-type = ; ++ phy-speed = ; ++ }; ++ ++ phy3 { ++ phy-type = ; ++ phy-speed = ; ++ }; ++ ++ phy4 { ++ phy-type = ; ++ }; ++ ++ phy5 { ++ phy-type = ; ++ }; ++}; ++ ++&cp0_mdio { ++ status = "okay"; ++}; ++ ++&cp0_ethernet { ++ status = "okay"; ++}; ++ ++&cp0_eth0 { ++ status = "okay"; ++ phy-mode = "10gbase-r"; ++}; +--- a/arch/arm/mach-mvebu/arm64-common.c ++++ b/arch/arm/mach-mvebu/arm64-common.c +@@ -62,9 +62,13 @@ __weak int dram_init_banksize(void) + __weak int dram_init(void) + { + if (IS_ENABLED(CONFIG_ARMADA_8K)) { +- gd->ram_size = a8k_dram_scan_ap_sz(); +- if (gd->ram_size != 0) +- return 0; ++ if (of_machine_is_compatible("mikrotik,rb5009")) ++ return fdtdec_setup_mem_size_base(); ++ else { ++ gd->ram_size = a8k_dram_scan_ap_sz(); ++ if (gd->ram_size != 0) ++ return 0; ++ } + } + + if (IS_ENABLED(CONFIG_ARMADA_3700)) +--- /dev/null ++++ b/board/Marvell/mvebu_armada-8k/mikrotik-rb5009.env +@@ -0,0 +1,52 @@ ++openwrt_initramfs=openwrt-mvebu-cortexa72-mikrotik_rb5009-initramfs-uImage.itb ++boot_devices=ubi usb net ++recovery_boot_devices=usb net ++ ++button_cmd_0_name=reset ++button_cmd_0=run recovery_bootcmd ++ ++recovery_bootcmd= ++ led green:sfp on; ++ led blue:hdr1 on; ++ led blue:hdr2 on; ++ ++ for b in ${recovery_boot_devices}; do ++ if test ${b} = usb; then ++ run usbboot; ++ fi; ++ if test ${b} = net; then ++ run netboot; ++ fi; ++ done; ++ ++bootcmd= ++ for b in ${boot_devices}; do ++ if test ${b} = ubi; then ++ run ubiboot; ++ fi; ++ if test ${b} = usb; then ++ run usbboot; ++ fi; ++ if test ${b} = net; then ++ run netboot; ++ fi; ++ done; ++ ++ubiboot= ++ echo Booting from NAND (UBI); ++ ubi part ubi; ++ setenv loadimagecmd ${ubiloadimage}; ++ ubi read ${loadaddr} kernel; ++ bootm ${loadaddr}; ++ ++usbboot= ++ echo Booting from USB Storage; ++ usb start; ++ load usb 0:1 ${loadaddr} ${openwrt_initramfs}; ++ bootm ${loadaddr}; ++ ++netboot= ++ echo Booting from Network; ++ dhcp; ++ tftpboot ${loadaddr} ${openwrt_initramfs}; ++ bootm ${loadaddr}; +--- /dev/null ++++ b/configs/mvebu_rb5009_defconfig +@@ -0,0 +1,97 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_CPU_INIT=y ++CONFIG_ARCH_MVEBU=y ++CONFIG_TEXT_BASE=0x0 ++CONFIG_NR_DRAM_BANKS=2 ++CONFIG_ENV_SOURCE_FILE="mikrotik-rb5009" ++CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y ++CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xff0000 ++CONFIG_TARGET_MVEBU_ARMADA_8K=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0xfe0000 ++CONFIG_ENV_SECT_SIZE=0x10000 ++CONFIG_DM_GPIO=y ++CONFIG_DEFAULT_DEVICE_TREE="armada-7040-rb5009" ++CONFIG_DEBUG_UART_BASE=0xf0512000 ++CONFIG_DEBUG_UART_CLOCK=200000000 ++CONFIG_SYS_LOAD_ADDR=0x800000 ++CONFIG_DEBUG_UART=y ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_REMAKE_ELF=y ++CONFIG_BUTTON_CMD=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++# CONFIG_BOOTSTD is not set ++CONFIG_SUPPORT_RAW_INITRD=y ++CONFIG_BOOTDELAY=5 ++CONFIG_SYS_CONSOLE_INFO_QUIET=y ++CONFIG_LOG=y ++CONFIG_LOG_ERROR_RETURN=y ++# CONFIG_DISPLAY_CPUINFO is not set ++# CONFIG_DISPLAY_BOARDINFO is not set ++CONFIG_DISPLAY_BOARDINFO_LATE=y ++CONFIG_BOARD_EARLY_INIT_F=y ++CONFIG_HUSH_PARSER=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_I2C=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_PART=y ++CONFIG_CMD_PCI=y ++CONFIG_CMD_SPI=y ++CONFIG_CMD_USB=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_TFTPPUT=y ++CONFIG_CMD_MII=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_CACHE=y ++CONFIG_CMD_TIME=y ++CONFIG_CMD_SYSBOOT=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_EXT4_WRITE=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_FS_GENERIC=y ++CONFIG_CMD_UBI=y ++CONFIG_EFI_PARTITION=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_SPI_FLASH=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_BUTTON=y ++CONFIG_BUTTON_GPIO=y ++CONFIG_GPIO_HOG=y ++CONFIG_DM_I2C=y ++CONFIG_SYS_I2C_MVTWSI=y ++CONFIG_LED=y ++CONFIG_LED_GPIO=y ++CONFIG_MISC=y ++CONFIG_MTD_RAW_NAND=y ++CONFIG_SYS_NAND_USE_FLASH_BBT=y ++CONFIG_NAND_PXA3XX=y ++CONFIG_SYS_NAND_ONFI_DETECTION=y ++CONFIG_SPI_FLASH_SFDP_SUPPORT=y ++CONFIG_SPI_FLASH_WINBOND=y ++# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set ++CONFIG_SPI_FLASH_MTD=y ++CONFIG_PHY_MARVELL=y ++CONFIG_PHY_GIGE=y ++CONFIG_MVPP2=y ++CONFIG_PHY=y ++CONFIG_MVEBU_COMPHY_SUPPORT=y ++CONFIG_PINCTRL=y ++CONFIG_PINCTRL_ARMADA_8K=y ++CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_DEBUG_UART_ANNOUNCE=y ++CONFIG_SYS_NS16550=y ++CONFIG_KIRKWOOD_SPI=y ++CONFIG_USB=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_STORAGE=y ++CONFIG_USB_HOST_ETHER=y ++CONFIG_USB_ETHER_RTL8152=y ++CONFIG_YAFFS2=y ++# CONFIG_SHA256 is not set ++# CONFIG_EFI_LOADER is not set diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index e6e9372b909861..0d31b0be6f69de 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -5,9 +5,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2024.04 +PKG_VERSION:=2024.07 PKG_RELEASE:=1 -PKG_HASH:=18a853fe39fad7ad03a90cc2d4275aeaed6da69735defac3492b80508843dd4a +PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f PKG_MAINTAINER:=Tobias Maedel @@ -222,7 +222,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 @@ -232,8 +231,7 @@ UBOOT_MAKE_FLAGS += \ define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/idbloader.img $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-idbloader.img - $(CP) $(PKG_BUILD_DIR)/u-boot.itb $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.itb + $(CP) $(PKG_BUILD_DIR)/u-boot-rockchip.bin $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot-rockchip.bin endef define Package/u-boot/install/default diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 6e13b3ee625dd9..f6ff0d9b2bfcd5 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -39,6 +39,7 @@ ALLWIFIBOARDS:= \ linksys_mx4200 \ linksys_mx5300 \ linksys_mx8500 \ + linksys_whw03 \ netgear_lbr20 \ netgear_rax120v2 \ netgear_sxk80 \ @@ -162,6 +163,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/package/firmware/linux-firmware/realtek.mk b/package/firmware/linux-firmware/realtek.mk index e0707251603c70..5ba679d404922d 100644 --- a/package/firmware/linux-firmware/realtek.mk +++ b/package/firmware/linux-firmware/realtek.mk @@ -13,7 +13,7 @@ define Package/r8169-firmware/install $(INSTALL_DIR) $(1)/lib/firmware/rtl_nic $(CP) \ $(PKG_BUILD_DIR)/rtl_nic/rtl810* \ - $(PKG_BUILD_DIR)/rtl_nic/rtl8125* \ + $(PKG_BUILD_DIR)/rtl_nic/rtl812* \ $(PKG_BUILD_DIR)/rtl_nic/rtl8168* \ $(PKG_BUILD_DIR)/rtl_nic/rtl84* \ $(1)/lib/firmware/rtl_nic diff --git a/package/kernel/bcm63xx-cfe/Makefile b/package/kernel/bcm63xx-cfe/Makefile index 62548a57616300..9bd61afdead5c3 100644 --- a/package/kernel/bcm63xx-cfe/Makefile +++ b/package/kernel/bcm63xx-cfe/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/openwrt/bcm63xx-cfe.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-06-22 -PKG_SOURCE_VERSION:=e5050f37150b34deb547b50feccd0e7439cb5bd7 -PKG_MIRROR_HASH:=3b53abf21790e42707e20c73aff23fc32db9fdaf010da6f459a20a9e8f8feae6 +PKG_SOURCE_DATE:=2024-06-25 +PKG_SOURCE_VERSION:=6519bd2dde3535cafeea43157755f4dbef2f90c5 +PKG_MIRROR_HASH:=db4da580b7a611a2b4ddd4ff812e5f8ddfd9694b6f5fd8246a341e61967c00ef PKG_FLAGS:=nonshared diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 638182d712f65e..43330bf0642e2c 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -81,6 +81,18 @@ endef $(eval $(call KernelPackage,crypto-authenc)) +define KernelPackage/crypto-blake2b + TITLE:=Support for BLAKE2b cryptographic hash function (RFC 7693) + DEPENDS:=+kmod-crypto-hash + KCONFIG:=CONFIG_CRYPTO_BLAKE2B + FILES:=$(LINUX_DIR)/crypto/blake2b_generic.ko + AUTOLOAD:=$(call AutoLoad,09,blake2b_generic) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-blake2b)) + + define KernelPackage/crypto-cbc TITLE:=Cipher Block Chaining CryptoAPI module DEPENDS:=+kmod-crypto-manager @@ -752,7 +764,6 @@ define KernelPackage/crypto-misc CONFIG_CRYPTO_CAMELLIA \ CONFIG_CRYPTO_CAST5 \ CONFIG_CRYPTO_CAST6 \ - CONFIG_CRYPTO_FCRYPT \ CONFIG_CRYPTO_KHAZAD \ CONFIG_CRYPTO_SERPENT \ CONFIG_CRYPTO_TEA \ @@ -1159,3 +1170,15 @@ endef $(eval $(call KernelPackage,crypto-xts)) + +define KernelPackage/crypto-xxhash + TITLE:=xxHash non-cryptographic hash algorithm + DEPENDS:=+kmod-crypto-hash +kmod-lib-xxhash + KCONFIG:=CONFIG_CRYPTO_XXHASH + FILES:=$(LINUX_DIR)/crypto/xxhash_generic.ko + AUTOLOAD:=$(call AutoLoad,09,xxhash_generic) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-xxhash)) + diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index 0d98c5a6815166..bc55dbd96779c1 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -67,7 +67,7 @@ $(eval $(call KernelPackage,fs-autofs4)) define KernelPackage/fs-btrfs SUBMENU:=$(FS_MENU) TITLE:=BTRFS filesystem support - DEPENDS:=+kmod-lib-crc32c +kmod-lib-lzo +kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +kmod-lib-raid6 +kmod-lib-xor +kmod-lib-zstd + DEPENDS:=+kmod-lib-crc32c +kmod-lib-lzo +kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +kmod-lib-raid6 +kmod-lib-xor +kmod-lib-zstd +kmod-crypto-blake2b +kmod-crypto-xxhash KCONFIG:=\ CONFIG_BTRFS_FS \ CONFIG_BTRFS_FS_CHECK_INTEGRITY=n diff --git a/package/kernel/linux/modules/hwmon.mk b/package/kernel/linux/modules/hwmon.mk index ba393ab8fa09fe..9a329bc6bca97a 100644 --- a/package/kernel/linux/modules/hwmon.mk +++ b/package/kernel/linux/modules/hwmon.mk @@ -148,7 +148,7 @@ define KernelPackage/hwmon-gsc $(LINUX_DIR)/drivers/mfd/gateworks-gsc.ko \ $(LINUX_DIR)/drivers/hwmon/gsc-hwmon.ko AUTOLOAD:=$(call AutoLoad,20,gsc-hwmon,1) - $(call AddDepends/hwmon,+kmod-i2c-core) + $(call AddDepends/hwmon,+kmod-i2c-core +kmod-mfd) endef define KernelPackage/hwmon-gsc/description @@ -198,7 +198,7 @@ define KernelPackage/hwmon-g762 endef define KernelPackage/hwmon-g762/description - Kernel module for Global Mixed-mode Technology Inc G762 and G763 fan speed PWM controller chips. + Kernel module for Global Mixed-mode Technology Inc G761/G762/G763 fan speed PWM controller chips. endef $(eval $(call KernelPackage,hwmon-g762)) diff --git a/package/kernel/linux/modules/lib.mk b/package/kernel/linux/modules/lib.mk index 8d67a3187a6272..ea4f034b998a2a 100644 --- a/package/kernel/linux/modules/lib.mk +++ b/package/kernel/linux/modules/lib.mk @@ -122,22 +122,31 @@ endef $(eval $(call KernelPackage,lib-lzo)) +define KernelPackage/lib-xxhash + SUBMENU:=$(LIB_MENU) + TITLE:=xxhash support + HIDDEN:=1 + KCONFIG:=CONFIG_XXHASH + FILES:=$(LINUX_DIR)/lib/xxhash.ko +endef + +$(eval $(call KernelPackage,lib-xxhash)) + + define KernelPackage/lib-zstd SUBMENU:=$(LIB_MENU) TITLE:=ZSTD support - DEPENDS:=+kmod-crypto-acompress + DEPENDS:=+kmod-crypto-acompress +kmod-lib-xxhash KCONFIG:= \ CONFIG_CRYPTO_ZSTD \ CONFIG_ZSTD_COMPRESS \ - CONFIG_ZSTD_DECOMPRESS \ - CONFIG_XXHASH + CONFIG_ZSTD_DECOMPRESS FILES:= \ $(LINUX_DIR)/crypto/zstd.ko \ - $(LINUX_DIR)/lib/xxhash.ko \ $(LINUX_DIR)/lib/zstd/zstd_common.ko@ge6.1 \ $(LINUX_DIR)/lib/zstd/zstd_compress.ko \ $(LINUX_DIR)/lib/zstd/zstd_decompress.ko - AUTOLOAD:=$(call AutoProbe,xxhash zstd zstd_compress zstd_decompress) + AUTOLOAD:=$(call AutoProbe,zstd zstd_compress zstd_decompress) endef define KernelPackage/lib-zstd/description @@ -147,21 +156,28 @@ endef $(eval $(call KernelPackage,lib-zstd)) +define KernelPackage/lib-lz4-decompress + SUBMENU:=$(LIB_MENU) + TITLE:=LZ4 decompress + HIDDEN:=1 + KCONFIG:=CONFIG_LZ4_DECOMPRESS + FILES:=$(LINUX_DIR)/lib/lz4/lz4_decompress.ko +endef + +$(eval $(call KernelPackage,lib-lz4-decompress)) + + define KernelPackage/lib-lz4 SUBMENU:=$(LIB_MENU) TITLE:=LZ4 support - DEPENDS:=+kmod-crypto-acompress + DEPENDS:=+kmod-crypto-acompress +kmod-lib-lz4-decompress KCONFIG:= \ CONFIG_CRYPTO_LZ4 \ - CONFIG_CRYPTO_LZ4HC \ - CONFIG_LZ4_COMPRESS \ - CONFIG_LZ4_DECOMPRESS + CONFIG_LZ4_COMPRESS FILES:= \ $(LINUX_DIR)/crypto/lz4.ko \ - $(LINUX_DIR)/lib/lz4/lz4_compress.ko \ - $(LINUX_DIR)/lib/lz4/lz4hc_compress.ko \ - $(LINUX_DIR)/lib/lz4/lz4_decompress.ko - AUTOLOAD:=$(call AutoProbe,lz4 lz4_compress lz4hc_compress lz4_decompress) + $(LINUX_DIR)/lib/lz4/lz4_compress.ko + AUTOLOAD:=$(call AutoProbe,lz4 lz4_compress) endef define KernelPackage/lib-lz4/description @@ -171,6 +187,26 @@ endef $(eval $(call KernelPackage,lib-lz4)) +define KernelPackage/lib-lz4hc + SUBMENU:=$(LIB_MENU) + TITLE:=LZ4HC support + DEPENDS:=+kmod-crypto-acompress +kmod-lib-lz4-decompress + KCONFIG:= \ + CONFIG_CRYPTO_LZ4HC \ + CONFIG_LZ4HC_COMPRESS + FILES:= \ + $(LINUX_DIR)/crypto/lz4hc.ko \ + $(LINUX_DIR)/lib/lz4/lz4hc_compress.ko + AUTOLOAD:=$(call AutoProbe,lz4hc lz4hc_compress) +endef + +define KernelPackage/lib-lz4hc/description + Kernel module for LZ4HC compression/decompression support +endef + +$(eval $(call KernelPackage,lib-lz4hc)) + + define KernelPackage/lib-842 SUBMENU:=$(LIB_MENU) TITLE:=842 support diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 06bae6a7ed758a..c1188351dccf15 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -779,8 +779,7 @@ define KernelPackage/r8169 DEPENDS:=@PCI_SUPPORT +kmod-mii +r8169-firmware +kmod-phy-realtek +kmod-mdio-devres KCONFIG:= \ CONFIG_R8169 \ - CONFIG_R8169_NAPI=y \ - CONFIG_R8169_VLAN=n + CONFIG_R8169_LEDS=y@ge6.6 FILES:=$(LINUX_DIR)/drivers/net/ethernet/realtek/r8169.ko AUTOLOAD:=$(call AutoProbe,r8169) endef diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index 31c9de9e3f2cf3..3cf63982ba4416 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -132,6 +132,22 @@ endef $(eval $(call KernelPackage,nf-conntrack6)) +define KernelPackage/nf-dup-inet + SUBMENU:=$(NF_MENU) + TITLE:=Netfilter nf_tables dup in ip/ip6/inet family support + HIDDEN:=1 + DEPENDS:=+kmod-nf-conntrack +IPV6:kmod-nf-conntrack6 + KCONFIG:= \ + CONFIG_NF_DUP_IPV4 \ + CONFIG_NF_DUP_IPV6 + FILES:= \ + $(LINUX_DIR)/net/ipv4/netfilter/nf_dup_ipv4.ko \ + $(LINUX_DIR)/net/ipv6/netfilter/nf_dup_ipv6.ko +endef + +$(eval $(call KernelPackage,nf-dup-inet)) + + define KernelPackage/nf-log SUBMENU:=$(NF_MENU) TITLE:=Netfilter Logging @@ -716,7 +732,7 @@ $(eval $(call KernelPackage,ipt-tproxy)) define KernelPackage/ipt-tee TITLE:=TEE support - DEPENDS:=+kmod-ipt-conntrack + DEPENDS:=+kmod-ipt-conntrack +kmod-nf-dup-inet KCONFIG:=$(KCONFIG_IPT_TEE) FILES:=$(foreach mod,$(IPT_TEE-m),$(LINUX_DIR)/net/$(mod).ko) AUTOLOAD:=$(call AutoProbe,$(notdir nf_tee $(IPT_TEE-m))) @@ -1150,18 +1166,14 @@ $(eval $(call KernelPackage,nft-bridge)) define KernelPackage/nft-dup-inet SUBMENU:=$(NF_MENU) TITLE:=Netfilter nf_tables dup in ip/ip6/inet family support - DEPENDS:=+kmod-nft-core +kmod-nf-conntrack +IPV6:kmod-nf-conntrack6 + DEPENDS:=+kmod-nft-core +kmod-nf-dup-inet KCONFIG:= \ - CONFIG_NF_DUP_IPV4 \ - CONFIG_NF_DUP_IPV6 \ CONFIG_NFT_DUP_IPV4 \ CONFIG_NFT_DUP_IPV6 FILES:= \ - $(LINUX_DIR)/net/ipv4/netfilter/nf_dup_ipv4.ko \ - $(LINUX_DIR)/net/ipv6/netfilter/nf_dup_ipv6.ko \ $(LINUX_DIR)/net/ipv4/netfilter/nft_dup_ipv4.ko \ $(LINUX_DIR)/net/ipv6/netfilter/nft_dup_ipv6.ko - AUTOLOAD:=$(call AutoProbe,nf_dup_ipv4 nf_dup_ipv6 nft_dup_ipv4 nft_dup_ipv6) + AUTOLOAD:=$(call AutoProbe,nft_dup_ipv4 nft_dup_ipv6) endef $(eval $(call KernelPackage,nft-dup-inet)) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 0ee58fada47bb8..00dfb98d79f4a0 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -1245,6 +1245,18 @@ endef $(eval $(call KernelPackage,sctp)) +define KernelPackage/sctp-diag + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=SCTP diag support + DEPENDS:=+kmod-sctp +kmod-inet-diag + KCONFIG:=CONFIG_INET_SCTP_DIAG + FILES:= $(LINUX_DIR)/net/sctp/sctp_diag.ko + AUTOLOAD:= $(call AutoLoad,33,sctp_diag) +endef + +$(eval $(call KernelPackage,sctp-diag)) + + define KernelPackage/netem SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Network emulation functionality @@ -1297,13 +1309,20 @@ define KernelPackage/rxrpc HIDDEN:=1 KCONFIG:= \ CONFIG_AF_RXRPC \ - CONFIG_RXKAD=m \ + CONFIG_AF_RXRPC_IPV6=y \ + CONFIG_RXKAD \ CONFIG_AF_RXRPC_DEBUG=n FILES:= \ $(LINUX_DIR)/net/rxrpc/rxrpc.ko - AUTOLOAD:=$(call AutoLoad,30,rxrpc.ko) - DEPENDS:= +kmod-crypto-manager +kmod-crypto-pcbc +kmod-crypto-fcrypt \ - +kmod-udptunnel4 +kmod-udptunnel6 + AUTOLOAD:=$(call AutoLoad,30,rxrpc) + DEPENDS:= \ + +kmod-crypto-fcrypt \ + +kmod-crypto-hmac \ + +kmod-crypto-manager \ + +kmod-crypto-md5 \ + +kmod-crypto-pcbc \ + +kmod-udptunnel4 \ + +IPV6:kmod-udptunnel6 endef define KernelPackage/rxrpc/description diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 36a8ef46d0a3b4..f6f5ecc075ab14 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -572,11 +572,24 @@ endef $(eval $(call KernelPackage,bcma)) +define KernelPackage/mfd + SUBMENU:=$(OTHER_MENU) + TITLE:=Multifunction device drivers + HIDDEN:=1 + KCONFIG:=CONFIG_MFD_CORE + FILES:=$(LINUX_DIR)/drivers/mfd/mfd-core.ko + AUTOLOAD:=$(call AutoLoad,10,mfd-core) +endef + +$(eval $(call KernelPackage,mfd)) + + define KernelPackage/mtdtests SUBMENU:=$(OTHER_MENU) TITLE:=MTD subsystem tests KCONFIG:=CONFIG_MTD_TESTS FILES:=\ + $(LINUX_DIR)/drivers/mtd/tests/mtd_nandbiterrs.ko \ $(LINUX_DIR)/drivers/mtd/tests/mtd_nandecctest.ko \ $(LINUX_DIR)/drivers/mtd/tests/mtd_oobtest.ko \ $(LINUX_DIR)/drivers/mtd/tests/mtd_pagetest.ko \ diff --git a/package/kernel/qca-ssdk/Makefile b/package/kernel/qca-ssdk/Makefile index de262e6578a5ff..16b2b4477d9a04 100644 --- a/package/kernel/qca-ssdk/Makefile +++ b/package/kernel/qca-ssdk/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qca-ssdk -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-04-17 -PKG_SOURCE_VERSION:=3d060f7ad70d087f6b0452abe79ab6d042e8cd53 -PKG_MIRROR_HASH:=6f5e390b294e699491584094f5d7eb941de6237ad8c5320191e9e306fbcd8eb5 +PKG_SOURCE_DATE:=2024-06-13 +PKG_SOURCE_VERSION:=c451136ba69d51d60f770365b6d6d60ff2801998 +PKG_MIRROR_HASH:=4c54f2d77b5abeb96bddceb4a9eb58aa2c8fb12b58d5d666196224a35ac107dc PKG_FLAGS:=nonshared PKG_BUILD_PARALLEL:=1 @@ -47,8 +47,9 @@ MAKE_FLAGS+= \ SoC=$(CONFIG_TARGET_SUBTARGET) \ SHELL="$(BASH)" \ PTP_FEATURE=disable SWCONFIG_FEATURE=disable \ - ISISC_ENABLE=disable IN_QCA803X_PHY=FALSE \ - IN_QCA808X_PHY=FALSE IN_MALIBU_PHY=FALSE \ + ISISC_ENABLE=disable MHT_ENABLE=disable \ + IN_QCA803X_PHY=FALSE IN_QCA808X_PHY=FALSE \ + IN_MALIBU_PHY=FALSE \ $(LNX_CONFIG_OPTS) ifeq ($(CONFIG_TARGET_SUBTARGET), "ipq807x") diff --git a/package/kernel/qca-ssdk/patches/101-hsl_phy-add-support-for-detection-PSGMII-PHY-mode.patch b/package/kernel/qca-ssdk/patches/101-hsl_phy-add-support-for-detection-PSGMII-PHY-mode.patch deleted file mode 100644 index 9d028992a7298b..00000000000000 --- a/package/kernel/qca-ssdk/patches/101-hsl_phy-add-support-for-detection-PSGMII-PHY-mode.patch +++ /dev/null @@ -1,25 +0,0 @@ -From e3763fd77e41b2f2495672c6a5898d69892fbf9f Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Wed, 15 Nov 2023 00:57:41 +0100 -Subject: [PATCH] hsl_phy: add support for detection PSGMII PHY mode - -Add support for detection of PSGMII PHY mode to correctly detect qca807x -PHY upstream driver. - -Signed-off-by: Christian Marangi ---- - src/hsl/phy/hsl_phy.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/src/hsl/phy/hsl_phy.c -+++ b/src/hsl/phy/hsl_phy.c -@@ -1322,6 +1322,9 @@ hsl_port_phydev_interface_mode_status_ge - case PHY_INTERFACE_MODE_10GKR: - *interface_mode_status = PORT_10GBASE_R; - break; -+ case PHY_INTERFACE_MODE_PSGMII: -+ *interface_mode_status = PHY_PSGMII_BASET; -+ break; - case PHY_INTERFACE_MODE_QSGMII: - *interface_mode_status = PORT_QSGMII; - break; diff --git a/package/kernel/qca-ssdk/patches/200-allow-parallel-build.patch b/package/kernel/qca-ssdk/patches/200-allow-parallel-build.patch index 6c28e0ff2ebd68..2a3735a7361f4f 100644 --- a/package/kernel/qca-ssdk/patches/200-allow-parallel-build.patch +++ b/package/kernel/qca-ssdk/patches/200-allow-parallel-build.patch @@ -40,7 +40,7 @@ kslib_c: --- a/make/linux_opt.mk +++ b/make/linux_opt.mk -@@ -778,6 +778,6 @@ LOCAL_CFLAGS += $(CPU_CFLAG) -D"KBUILD_M +@@ -782,6 +782,6 @@ LOCAL_CFLAGS += $(CPU_CFLAG) -D"KBUILD_M #################################################################### # cflags for LNX Modules-Style Makefile #################################################################### diff --git a/package/kernel/qca-ssdk/patches/201-fix-compile-warnings.patch b/package/kernel/qca-ssdk/patches/201-fix-compile-warnings.patch deleted file mode 100644 index 5b57f41975bbca..00000000000000 --- a/package/kernel/qca-ssdk/patches/201-fix-compile-warnings.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/src/fal/fal_port_ctrl.c -+++ b/src/fal/fal_port_ctrl.c -@@ -2089,7 +2089,7 @@ fal_port_hibernate_get (a_uint32_t dev_i - */ - sw_error_t - fal_port_cdt (a_uint32_t dev_id, fal_port_t port_id, a_uint32_t mdi_pair, -- a_uint32_t * cable_status, a_uint32_t * cable_len) -+ fal_cable_status_t * cable_status, a_uint32_t * cable_len) - { - sw_error_t rv; - ---- a/src/fal/fal_portvlan.c -+++ b/src/fal/fal_portvlan.c -@@ -2173,7 +2173,7 @@ fal_netisolate_get(a_uint32_t dev_id, a_ - * @return SW_OK or error code - */ - sw_error_t --fal_eg_trans_filter_bypass_en_set(a_uint32_t dev_id, a_bool_t enable) -+fal_eg_trans_filter_bypass_en_set(a_uint32_t dev_id, a_uint32_t enable) - { - sw_error_t rv; - -@@ -2190,7 +2190,7 @@ fal_eg_trans_filter_bypass_en_set(a_uint - * @return SW_OK or error code - */ - sw_error_t --fal_eg_trans_filter_bypass_en_get(a_uint32_t dev_id, a_bool_t* enable) -+fal_eg_trans_filter_bypass_en_get(a_uint32_t dev_id, a_uint32_t* enable) - { - sw_error_t rv; - diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 0171bc0edca940..8cedef976bbacd 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=https://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/patches/762-AP-don-t-ignore-probe-requests-with-invalid-DSSS-par.patch b/package/network/services/hostapd/patches/762-AP-don-t-ignore-probe-requests-with-invalid-DSSS-par.patch new file mode 100644 index 00000000000000..3cb1abeb583f9e --- /dev/null +++ b/package/network/services/hostapd/patches/762-AP-don-t-ignore-probe-requests-with-invalid-DSSS-par.patch @@ -0,0 +1,44 @@ +From a329773522953892d9bb4548482d42fc93fea329 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Thu, 27 Jun 2024 18:45:19 +0200 +Subject: [PATCH] AP: don't ignore probe-requests with invalid DSSS params + +Don't ignore probe requests which contain an invalid DS parameter for the +current operating channel. + +As the comment outlines, the drop shall only apply if +dot11RadioMeasurementActivated is set to 1. + +However, it was observed Linux clients (Debian 12 / NixOS 23.11) +with an Intel 8265 NIC may generate a probe request frame with +dot11RadioMeasurementActivated set to false and an invalid DSSS +parameter. + +These were also dropped even though they should not have been. They +however should not have contained this parameter in the first place. + +Don't drop Probe Requests which contain such an invalid field. This may +lead to more probe responses being sent, however it does fix very +frequent connection issues for these clients on 2.4 GHz. + +Signed-off-by: David Bauer +--- + src/ap/beacon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index 8cd1c4170..bb9329085 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -905,7 +905,7 @@ void handle_probe_req(struct hostapd_data *hapd, + * is less likely to see them (Probe Request frame sent on a + * neighboring, but partially overlapping, channel). + */ +- if (elems.ds_params && ++ if (elems.ds_params && 0 && + hapd->iface->current_mode && + (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G || + hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211B) && +-- +2.43.0 + diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile index 9e2f2fafe55345..16b47748e3569a 100644 --- a/package/utils/e2fsprogs/Makefile +++ b/package/utils/e2fsprogs/Makefile @@ -19,7 +19,7 @@ PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=NOTICE PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs -PKG_BUILD_DEPENDS:=util-linux e2fsprogs/host +PKG_BUILD_DEPENDS:=util-linux PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 @@ -225,23 +225,6 @@ define Build/InstallDev $(CP) $(PKG_BUILD_DIR)/lib/e2p/e2p.h $(1)/usr/include/e2p endef -define Host/Compile - $(MAKE) $(PKG_JOBS) -C $(HOST_BUILD_DIR)/lib/ss mk_cmds - $(MAKE) $(PKG_JOBS) -C $(HOST_BUILD_DIR)/lib/et compile_et -endef - -define Host/Install - $(INSTALL_DIR) $(1)/share/et - $(CP) $(HOST_BUILD_DIR)/lib/et/et_[ch].awk $(1)/share/et/ - $(INSTALL_DIR) $(1)/share/ss - $(CP) $(HOST_BUILD_DIR)/lib/ss/ct_c.{sed,awk} $(1)/share/ss/ - $(INSTALL_DIR) $(1)/bin - $(CP) \ - $(HOST_BUILD_DIR)/lib/et/compile_et \ - $(HOST_BUILD_DIR)/lib/ss/mk_cmds \ - $(1)/bin/ -endef - define Package/e2fsprogs/conffiles /etc/e2fsck.conf endef @@ -354,4 +337,3 @@ $(eval $(call BuildPackage,filefrag)) $(eval $(call BuildPackage,debugfs)) $(eval $(call BuildPackage,chattr)) $(eval $(call BuildPackage,lsattr)) -$(eval $(call HostBuild)) diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile index d5dc1a6d7824a1..d11e89d8e3cee2 100644 --- a/package/utils/f2fs-tools/Makefile +++ b/package/utils/f2fs-tools/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=f2fs-tools PKG_VERSION:=1.16.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ @@ -137,6 +137,7 @@ define Package/f2fsck/install $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/sload.f2fs $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs + $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/f2fslabel endef Package/f2fsck-selinux/install = $(Package/f2fsck/install) diff --git a/package/utils/mtd-utils/Makefile b/package/utils/mtd-utils/Makefile index c0ea0abbcb43de..a73f5e1eb1f1b1 100644 --- a/package/utils/mtd-utils/Makefile +++ b/package/utils/mtd-utils/Makefile @@ -8,15 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd-utils -PKG_VERSION:=2.1.6 -PKG_RELEASE:=2 +PKG_VERSION:=2.2.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://infraroot.at/pub/mtd/ -PKG_HASH:=c1d853bc4adf83bcabd2792fc95af33bdd8643c97e8f7b3f0180af36af76f0e5 +PKG_HASH:=250d082f67375ca8451b5fcfc9a23a53ced3ebebd8312c288daf2507bbab1324 PKG_INSTALL:=1 -PKG_FIXUP:=autoreconf PKG_FLAGS:=nonshared PKG_BUILD_FLAGS:=gc-sections @@ -63,7 +62,8 @@ CONFIGURE_ARGS += \ --without-crypto \ --without-xattr \ --without-zstd \ - --without-lzo + --without-lzo \ + --without-zlib define Package/ubi-utils/install $(INSTALL_DIR) $(1)/usr/sbin diff --git a/package/utils/mtd-utils/patches/100-fix_includes.patch b/package/utils/mtd-utils/patches/100-fix_includes.patch deleted file mode 100644 index cc75052c5e83c4..00000000000000 --- a/package/utils/mtd-utils/patches/100-fix_includes.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/lib/libfec.c -+++ b/lib/libfec.c -@@ -45,6 +45,7 @@ - #include - #include - #include -+#include - #include "libfec.h" - - /* diff --git a/package/utils/mtd-utils/patches/130-lzma_jffs2.patch b/package/utils/mtd-utils/patches/130-lzma_jffs2.patch deleted file mode 100644 index db683063d58950..00000000000000 --- a/package/utils/mtd-utils/patches/130-lzma_jffs2.patch +++ /dev/null @@ -1,5038 +0,0 @@ ---- a/jffsX-utils/Makemodule.am -+++ b/jffsX-utils/Makemodule.am -@@ -4,7 +4,10 @@ mkfs_jffs2_SOURCES = \ - jffsX-utils/compr_zlib.c \ - jffsX-utils/compr.h \ - jffsX-utils/rbtree.c \ -- jffsX-utils/compr_lzo.c \ -+ jffsX-utils/compr_lzma.c \ -+ jffsX-utils/lzma/LzFind.c \ -+ jffsX-utils/lzma/LzmaEnc.c \ -+ jffsX-utils/lzma/LzmaDec.c \ - jffsX-utils/compr.c \ - jffsX-utils/compr_rtime.c \ - jffsX-utils/compr.h \ -@@ -12,8 +15,13 @@ mkfs_jffs2_SOURCES = \ - jffsX-utils/summary.h \ - include/linux/jffs2.h \ - include/mtd/jffs2-user.h -+ -+if !WITHOUT_LZO -+mkfs_jffs2_SOURCES += jffsX-utils/compr_lzo.c -+endif -+ - mkfs_jffs2_LDADD = libmtd.a $(ZLIB_LIBS) $(LZO_LIBS) --mkfs_jffs2_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) -+mkfs_jffs2_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) -I./include/linux/lzma - - jffs2reader_SOURCES = jffsX-utils/jffs2reader.c include/mtd/jffs2-user.h - jffs2reader_LDADD = libmtd.a $(ZLIB_LIBS) $(LZO_LIBS) ---- a/jffsX-utils/compr.c -+++ b/jffsX-utils/compr.c -@@ -520,6 +520,9 @@ int jffs2_compressors_init(void) - #ifdef CONFIG_JFFS2_LZO - jffs2_lzo_init(); - #endif -+#ifdef CONFIG_JFFS2_LZMA -+ jffs2_lzma_init(); -+#endif - return 0; - } - -@@ -534,5 +537,8 @@ int jffs2_compressors_exit(void) - #ifdef CONFIG_JFFS2_LZO - jffs2_lzo_exit(); - #endif -+#ifdef CONFIG_JFFS2_LZMA -+ jffs2_lzma_exit(); -+#endif - return 0; - } ---- a/jffsX-utils/compr.h -+++ b/jffsX-utils/compr.h -@@ -18,13 +18,14 @@ - - #define CONFIG_JFFS2_ZLIB - #define CONFIG_JFFS2_RTIME --#define CONFIG_JFFS2_LZO -+#define CONFIG_JFFS2_LZMA - - #define JFFS2_RUBINMIPS_PRIORITY 10 - #define JFFS2_DYNRUBIN_PRIORITY 20 - #define JFFS2_RTIME_PRIORITY 50 --#define JFFS2_ZLIB_PRIORITY 60 --#define JFFS2_LZO_PRIORITY 80 -+#define JFFS2_LZMA_PRIORITY 70 -+#define JFFS2_ZLIB_PRIORITY 80 -+#define JFFS2_LZO_PRIORITY 90 - - #define JFFS2_COMPR_MODE_NONE 0 - #define JFFS2_COMPR_MODE_PRIORITY 1 -@@ -115,5 +116,10 @@ void jffs2_rtime_exit(void); - int jffs2_lzo_init(void); - void jffs2_lzo_exit(void); - #endif -+#ifdef CONFIG_JFFS2_LZMA -+int jffs2_lzma_init(void); -+void jffs2_lzma_exit(void); -+#endif -+ - - #endif /* __JFFS2_COMPR_H__ */ ---- /dev/null -+++ b/jffsX-utils/compr_lzma.c -@@ -0,0 +1,128 @@ -+/* -+ * JFFS2 -- Journalling Flash File System, Version 2. -+ * -+ * For licensing information, see the file 'LICENCE' in this directory. -+ * -+ * JFFS2 wrapper to the LZMA C SDK -+ * -+ */ -+ -+#include -+#include "compr.h" -+ -+#ifdef __KERNEL__ -+ static DEFINE_MUTEX(deflate_mutex); -+#endif -+ -+CLzmaEncHandle *p; -+Byte propsEncoded[LZMA_PROPS_SIZE]; -+SizeT propsSize = sizeof(propsEncoded); -+ -+STATIC void lzma_free_workspace(void) -+{ -+ LzmaEnc_Destroy(p, &lzma_alloc, &lzma_alloc); -+} -+ -+STATIC int INIT lzma_alloc_workspace(CLzmaEncProps *props) -+{ -+ if ((p = (CLzmaEncHandle *)LzmaEnc_Create(&lzma_alloc)) == NULL) -+ { -+ PRINT_ERROR("Failed to allocate lzma deflate workspace\n"); -+ return -ENOMEM; -+ } -+ -+ if (LzmaEnc_SetProps(p, props) != SZ_OK) -+ { -+ lzma_free_workspace(); -+ return -1; -+ } -+ -+ if (LzmaEnc_WriteProperties(p, propsEncoded, &propsSize) != SZ_OK) -+ { -+ lzma_free_workspace(); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+STATIC int jffs2_lzma_compress(unsigned char *data_in, unsigned char *cpage_out, -+ uint32_t *sourcelen, uint32_t *dstlen) -+{ -+ SizeT compress_size = (SizeT)(*dstlen); -+ int ret; -+ -+ #ifdef __KERNEL__ -+ mutex_lock(&deflate_mutex); -+ #endif -+ -+ ret = LzmaEnc_MemEncode(p, cpage_out, &compress_size, data_in, *sourcelen, -+ 0, NULL, &lzma_alloc, &lzma_alloc); -+ -+ #ifdef __KERNEL__ -+ mutex_unlock(&deflate_mutex); -+ #endif -+ -+ if (ret != SZ_OK) -+ return -1; -+ -+ *dstlen = (uint32_t)compress_size; -+ -+ return 0; -+} -+ -+STATIC int jffs2_lzma_decompress(unsigned char *data_in, unsigned char *cpage_out, -+ uint32_t srclen, uint32_t destlen) -+{ -+ int ret; -+ SizeT dl = (SizeT)destlen; -+ SizeT sl = (SizeT)srclen; -+ ELzmaStatus status; -+ -+ ret = LzmaDecode(cpage_out, &dl, data_in, &sl, propsEncoded, -+ propsSize, LZMA_FINISH_ANY, &status, &lzma_alloc); -+ -+ if (ret != SZ_OK || status == LZMA_STATUS_NOT_FINISHED || dl != (SizeT)destlen) -+ return -1; -+ -+ return 0; -+} -+ -+static struct jffs2_compressor jffs2_lzma_comp = { -+ .priority = JFFS2_LZMA_PRIORITY, -+ .name = "lzma", -+ .compr = JFFS2_COMPR_LZMA, -+ .compress = &jffs2_lzma_compress, -+ .decompress = &jffs2_lzma_decompress, -+ .disabled = 0, -+}; -+ -+int INIT jffs2_lzma_init(void) -+{ -+ int ret; -+ CLzmaEncProps props; -+ LzmaEncProps_Init(&props); -+ -+ props.dictSize = LZMA_BEST_DICT(0x2000); -+ props.level = LZMA_BEST_LEVEL; -+ props.lc = LZMA_BEST_LC; -+ props.lp = LZMA_BEST_LP; -+ props.pb = LZMA_BEST_PB; -+ props.fb = LZMA_BEST_FB; -+ -+ ret = lzma_alloc_workspace(&props); -+ if (ret < 0) -+ return ret; -+ -+ ret = jffs2_register_compressor(&jffs2_lzma_comp); -+ if (ret) -+ lzma_free_workspace(); -+ -+ return ret; -+} -+ -+void jffs2_lzma_exit(void) -+{ -+ jffs2_unregister_compressor(&jffs2_lzma_comp); -+ lzma_free_workspace(); -+} ---- a/include/linux/jffs2.h -+++ b/include/linux/jffs2.h -@@ -47,6 +47,7 @@ - #define JFFS2_COMPR_DYNRUBIN 0x05 - #define JFFS2_COMPR_ZLIB 0x06 - #define JFFS2_COMPR_LZO 0x07 -+#define JFFS2_COMPR_LZMA 0x08 - /* Compatibility flags. */ - #define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ - #define JFFS2_NODE_ACCURATE 0x2000 ---- /dev/null -+++ b/include/linux/lzma.h -@@ -0,0 +1,61 @@ -+#ifndef __LZMA_H__ -+#define __LZMA_H__ -+ -+#ifdef __KERNEL__ -+ #include -+ #include -+ #include -+ #include -+ #include -+ #define LZMA_MALLOC vmalloc -+ #define LZMA_FREE vfree -+ #define PRINT_ERROR(msg) printk(KERN_WARNING #msg) -+ #define INIT __init -+ #define STATIC static -+#else -+ #include -+ #include -+ #include -+ #include -+ #include -+ #include -+ #include -+ #ifndef PAGE_SIZE -+ extern int page_size; -+ #define PAGE_SIZE page_size -+ #endif -+ #define LZMA_MALLOC malloc -+ #define LZMA_FREE free -+ #define PRINT_ERROR(msg) fprintf(stderr, msg) -+ #define INIT -+ #define STATIC static -+#endif -+ -+#include "lzma/LzmaDec.h" -+#include "lzma/LzmaEnc.h" -+ -+#define LZMA_BEST_LEVEL (9) -+#define LZMA_BEST_LC (0) -+#define LZMA_BEST_LP (0) -+#define LZMA_BEST_PB (0) -+#define LZMA_BEST_FB (273) -+ -+#define LZMA_BEST_DICT(n) (((int)((n) / 2)) * 2) -+ -+static void *p_lzma_malloc(void *p, size_t size) -+{ -+ if (size == 0) -+ return NULL; -+ -+ return LZMA_MALLOC(size); -+} -+ -+static void p_lzma_free(void *p, void *address) -+{ -+ if (address != NULL) -+ LZMA_FREE(address); -+} -+ -+static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free}; -+ -+#endif ---- /dev/null -+++ b/include/linux/lzma/LzFind.h -@@ -0,0 +1,116 @@ -+/* LzFind.h -- Match finder for LZ algorithms -+2008-04-04 -+Copyright (c) 1999-2008 Igor Pavlov -+You can use any of the following license options: -+ 1) GNU Lesser General Public License (GNU LGPL) -+ 2) Common Public License (CPL) -+ 3) Common Development and Distribution License (CDDL) Version 1.0 -+ 4) Igor Pavlov, as the author of this code, expressly permits you to -+ statically or dynamically link your code (or bind by name) to this file, -+ while you keep this file unmodified. -+*/ -+ -+#ifndef __LZFIND_H -+#define __LZFIND_H -+ -+#include "Types.h" -+ -+typedef UInt32 CLzRef; -+ -+typedef struct _CMatchFinder -+{ -+ Byte *buffer; -+ UInt32 pos; -+ UInt32 posLimit; -+ UInt32 streamPos; -+ UInt32 lenLimit; -+ -+ UInt32 cyclicBufferPos; -+ UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */ -+ -+ UInt32 matchMaxLen; -+ CLzRef *hash; -+ CLzRef *son; -+ UInt32 hashMask; -+ UInt32 cutValue; -+ -+ Byte *bufferBase; -+ ISeqInStream *stream; -+ int streamEndWasReached; -+ -+ UInt32 blockSize; -+ UInt32 keepSizeBefore; -+ UInt32 keepSizeAfter; -+ -+ UInt32 numHashBytes; -+ int directInput; -+ int btMode; -+ /* int skipModeBits; */ -+ int bigHash; -+ UInt32 historySize; -+ UInt32 fixedHashSize; -+ UInt32 hashSizeSum; -+ UInt32 numSons; -+ SRes result; -+ UInt32 crc[256]; -+} CMatchFinder; -+ -+#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer) -+#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)]) -+ -+#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos) -+ -+int MatchFinder_NeedMove(CMatchFinder *p); -+Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); -+void MatchFinder_MoveBlock(CMatchFinder *p); -+void MatchFinder_ReadIfRequired(CMatchFinder *p); -+ -+void MatchFinder_Construct(CMatchFinder *p); -+ -+/* Conditions: -+ historySize <= 3 GB -+ keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB -+*/ -+int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, -+ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, -+ ISzAlloc *alloc); -+void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc); -+void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems); -+void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue); -+ -+UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son, -+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, -+ UInt32 *distances, UInt32 maxLen); -+ -+/* -+Conditions: -+ Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func. -+ Mf_GetPointerToCurrentPos_Func's result must be used only before any other function -+*/ -+ -+typedef void (*Mf_Init_Func)(void *object); -+typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index); -+typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object); -+typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object); -+typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances); -+typedef void (*Mf_Skip_Func)(void *object, UInt32); -+ -+typedef struct _IMatchFinder -+{ -+ Mf_Init_Func Init; -+ Mf_GetIndexByte_Func GetIndexByte; -+ Mf_GetNumAvailableBytes_Func GetNumAvailableBytes; -+ Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos; -+ Mf_GetMatches_Func GetMatches; -+ Mf_Skip_Func Skip; -+} IMatchFinder; -+ -+void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable); -+ -+void MatchFinder_Init(CMatchFinder *p); -+UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); -+UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); -+void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); -+void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); -+ -+#endif ---- /dev/null -+++ b/include/linux/lzma/LzHash.h -@@ -0,0 +1,56 @@ -+/* LzHash.h -- HASH functions for LZ algorithms -+2008-03-26 -+Copyright (c) 1999-2008 Igor Pavlov -+Read LzFind.h for license options */ -+ -+#ifndef __LZHASH_H -+#define __LZHASH_H -+ -+#define kHash2Size (1 << 10) -+#define kHash3Size (1 << 16) -+#define kHash4Size (1 << 20) -+ -+#define kFix3HashSize (kHash2Size) -+#define kFix4HashSize (kHash2Size + kHash3Size) -+#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size) -+ -+#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8); -+ -+#define HASH3_CALC { \ -+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ -+ hash2Value = temp & (kHash2Size - 1); \ -+ hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; } -+ -+#define HASH4_CALC { \ -+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ -+ hash2Value = temp & (kHash2Size - 1); \ -+ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ -+ hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; } -+ -+#define HASH5_CALC { \ -+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ -+ hash2Value = temp & (kHash2Size - 1); \ -+ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ -+ hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \ -+ hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \ -+ hash4Value &= (kHash4Size - 1); } -+ -+/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */ -+#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF; -+ -+ -+#define MT_HASH2_CALC \ -+ hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1); -+ -+#define MT_HASH3_CALC { \ -+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ -+ hash2Value = temp & (kHash2Size - 1); \ -+ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); } -+ -+#define MT_HASH4_CALC { \ -+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ -+ hash2Value = temp & (kHash2Size - 1); \ -+ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ -+ hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); } -+ -+#endif ---- /dev/null -+++ b/include/linux/lzma/LzmaDec.h -@@ -0,0 +1,232 @@ -+/* LzmaDec.h -- LZMA Decoder -+2008-04-29 -+Copyright (c) 1999-2008 Igor Pavlov -+You can use any of the following license options: -+ 1) GNU Lesser General Public License (GNU LGPL) -+ 2) Common Public License (CPL) -+ 3) Common Development and Distribution License (CDDL) Version 1.0 -+ 4) Igor Pavlov, as the author of this code, expressly permits you to -+ statically or dynamically link your code (or bind by name) to this file, -+ while you keep this file unmodified. -+*/ -+ -+#ifndef __LZMADEC_H -+#define __LZMADEC_H -+ -+#include "Types.h" -+ -+/* #define _LZMA_PROB32 */ -+/* _LZMA_PROB32 can increase the speed on some CPUs, -+ but memory usage for CLzmaDec::probs will be doubled in that case */ -+ -+#ifdef _LZMA_PROB32 -+#define CLzmaProb UInt32 -+#else -+#define CLzmaProb UInt16 -+#endif -+ -+ -+/* ---------- LZMA Properties ---------- */ -+ -+#define LZMA_PROPS_SIZE 5 -+ -+typedef struct _CLzmaProps -+{ -+ unsigned lc, lp, pb; -+ UInt32 dicSize; -+} CLzmaProps; -+ -+/* LzmaProps_Decode - decodes properties -+Returns: -+ SZ_OK -+ SZ_ERROR_UNSUPPORTED - Unsupported properties -+*/ -+ -+SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); -+ -+ -+/* ---------- LZMA Decoder state ---------- */ -+ -+/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case. -+ Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */ -+ -+#define LZMA_REQUIRED_INPUT_MAX 20 -+ -+typedef struct -+{ -+ CLzmaProps prop; -+ CLzmaProb *probs; -+ Byte *dic; -+ const Byte *buf; -+ UInt32 range, code; -+ SizeT dicPos; -+ SizeT dicBufSize; -+ UInt32 processedPos; -+ UInt32 checkDicSize; -+ unsigned state; -+ UInt32 reps[4]; -+ unsigned remainLen; -+ int needFlush; -+ int needInitState; -+ UInt32 numProbs; -+ unsigned tempBufSize; -+ Byte tempBuf[LZMA_REQUIRED_INPUT_MAX]; -+} CLzmaDec; -+ -+#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } -+ -+void LzmaDec_Init(CLzmaDec *p); -+ -+/* There are two types of LZMA streams: -+ 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. -+ 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ -+ -+typedef enum -+{ -+ LZMA_FINISH_ANY, /* finish at any point */ -+ LZMA_FINISH_END /* block must be finished at the end */ -+} ELzmaFinishMode; -+ -+/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!! -+ -+ You must use LZMA_FINISH_END, when you know that current output buffer -+ covers last bytes of block. In other cases you must use LZMA_FINISH_ANY. -+ -+ If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK, -+ and output value of destLen will be less than output buffer size limit. -+ You can check status result also. -+ -+ You can use multiple checks to test data integrity after full decompression: -+ 1) Check Result and "status" variable. -+ 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. -+ 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. -+ You must use correct finish mode in that case. */ -+ -+typedef enum -+{ -+ LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */ -+ LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ -+ LZMA_STATUS_NOT_FINISHED, /* stream was not finished */ -+ LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */ -+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */ -+} ELzmaStatus; -+ -+/* ELzmaStatus is used only as output value for function call */ -+ -+ -+/* ---------- Interfaces ---------- */ -+ -+/* There are 3 levels of interfaces: -+ 1) Dictionary Interface -+ 2) Buffer Interface -+ 3) One Call Interface -+ You can select any of these interfaces, but don't mix functions from different -+ groups for same object. */ -+ -+ -+/* There are two variants to allocate state for Dictionary Interface: -+ 1) LzmaDec_Allocate / LzmaDec_Free -+ 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs -+ You can use variant 2, if you set dictionary buffer manually. -+ For Buffer Interface you must always use variant 1. -+ -+LzmaDec_Allocate* can return: -+ SZ_OK -+ SZ_ERROR_MEM - Memory allocation error -+ SZ_ERROR_UNSUPPORTED - Unsupported properties -+*/ -+ -+SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); -+void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); -+ -+SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); -+void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); -+ -+/* ---------- Dictionary Interface ---------- */ -+ -+/* You can use it, if you want to eliminate the overhead for data copying from -+ dictionary to some other external buffer. -+ You must work with CLzmaDec variables directly in this interface. -+ -+ STEPS: -+ LzmaDec_Constr() -+ LzmaDec_Allocate() -+ for (each new stream) -+ { -+ LzmaDec_Init() -+ while (it needs more decompression) -+ { -+ LzmaDec_DecodeToDic() -+ use data from CLzmaDec::dic and update CLzmaDec::dicPos -+ } -+ } -+ LzmaDec_Free() -+*/ -+ -+/* LzmaDec_DecodeToDic -+ -+ The decoding to internal dictionary buffer (CLzmaDec::dic). -+ You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! -+ -+finishMode: -+ It has meaning only if the decoding reaches output limit (dicLimit). -+ LZMA_FINISH_ANY - Decode just dicLimit bytes. -+ LZMA_FINISH_END - Stream must be finished after dicLimit. -+ -+Returns: -+ SZ_OK -+ status: -+ LZMA_STATUS_FINISHED_WITH_MARK -+ LZMA_STATUS_NOT_FINISHED -+ LZMA_STATUS_NEEDS_MORE_INPUT -+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK -+ SZ_ERROR_DATA - Data error -+*/ -+ -+SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, -+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); -+ -+ -+/* ---------- Buffer Interface ---------- */ -+ -+/* It's zlib-like interface. -+ See LzmaDec_DecodeToDic description for information about STEPS and return results, -+ but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need -+ to work with CLzmaDec variables manually. -+ -+finishMode: -+ It has meaning only if the decoding reaches output limit (*destLen). -+ LZMA_FINISH_ANY - Decode just destLen bytes. -+ LZMA_FINISH_END - Stream must be finished after (*destLen). -+*/ -+ -+SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, -+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); -+ -+ -+/* ---------- One Call Interface ---------- */ -+ -+/* LzmaDecode -+ -+finishMode: -+ It has meaning only if the decoding reaches output limit (*destLen). -+ LZMA_FINISH_ANY - Decode just destLen bytes. -+ LZMA_FINISH_END - Stream must be finished after (*destLen). -+ -+Returns: -+ SZ_OK -+ status: -+ LZMA_STATUS_FINISHED_WITH_MARK -+ LZMA_STATUS_NOT_FINISHED -+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK -+ SZ_ERROR_DATA - Data error -+ SZ_ERROR_MEM - Memory allocation error -+ SZ_ERROR_UNSUPPORTED - Unsupported properties -+ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). -+*/ -+ -+SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, -+ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, -+ ELzmaStatus *status, ISzAlloc *alloc); -+ -+#endif ---- /dev/null -+++ b/include/linux/lzma/LzmaEnc.h -@@ -0,0 +1,74 @@ -+/* LzmaEnc.h -- LZMA Encoder -+2008-04-27 -+Copyright (c) 1999-2008 Igor Pavlov -+Read LzFind.h for license options */ -+ -+#ifndef __LZMAENC_H -+#define __LZMAENC_H -+ -+#include "Types.h" -+ -+#define LZMA_PROPS_SIZE 5 -+ -+typedef struct _CLzmaEncProps -+{ -+ int level; /* 0 <= level <= 9 */ -+ UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version -+ (1 << 12) <= dictSize <= (1 << 30) for 64-bit version -+ default = (1 << 24) */ -+ int lc; /* 0 <= lc <= 8, default = 3 */ -+ int lp; /* 0 <= lp <= 4, default = 0 */ -+ int pb; /* 0 <= pb <= 4, default = 2 */ -+ int algo; /* 0 - fast, 1 - normal, default = 1 */ -+ int fb; /* 5 <= fb <= 273, default = 32 */ -+ int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */ -+ int numHashBytes; /* 2, 3 or 4, default = 4 */ -+ UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */ -+ unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */ -+ int numThreads; /* 1 or 2, default = 2 */ -+} CLzmaEncProps; -+ -+void LzmaEncProps_Init(CLzmaEncProps *p); -+void LzmaEncProps_Normalize(CLzmaEncProps *p); -+UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); -+ -+ -+/* ---------- CLzmaEncHandle Interface ---------- */ -+ -+/* LzmaEnc_* functions can return the following exit codes: -+Returns: -+ SZ_OK - OK -+ SZ_ERROR_MEM - Memory allocation error -+ SZ_ERROR_PARAM - Incorrect paramater in props -+ SZ_ERROR_WRITE - Write callback error. -+ SZ_ERROR_PROGRESS - some break from progress callback -+ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) -+*/ -+ -+typedef void * CLzmaEncHandle; -+ -+CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc); -+void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); -+SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); -+SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); -+SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, -+ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); -+SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, -+ int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); -+ -+/* ---------- One Call Interface ---------- */ -+ -+/* LzmaEncode -+Return code: -+ SZ_OK - OK -+ SZ_ERROR_MEM - Memory allocation error -+ SZ_ERROR_PARAM - Incorrect paramater -+ SZ_ERROR_OUTPUT_EOF - output buffer overflow -+ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) -+*/ -+ -+SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, -+ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, -+ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); -+ -+#endif ---- /dev/null -+++ b/include/linux/lzma/Types.h -@@ -0,0 +1,130 @@ -+/* Types.h -- Basic types -+2008-04-11 -+Igor Pavlov -+Public domain */ -+ -+#ifndef __7Z_TYPES_H -+#define __7Z_TYPES_H -+ -+#define SZ_OK 0 -+ -+#define SZ_ERROR_DATA 1 -+#define SZ_ERROR_MEM 2 -+#define SZ_ERROR_CRC 3 -+#define SZ_ERROR_UNSUPPORTED 4 -+#define SZ_ERROR_PARAM 5 -+#define SZ_ERROR_INPUT_EOF 6 -+#define SZ_ERROR_OUTPUT_EOF 7 -+#define SZ_ERROR_READ 8 -+#define SZ_ERROR_WRITE 9 -+#define SZ_ERROR_PROGRESS 10 -+#define SZ_ERROR_FAIL 11 -+#define SZ_ERROR_THREAD 12 -+ -+#define SZ_ERROR_ARCHIVE 16 -+#define SZ_ERROR_NO_ARCHIVE 17 -+ -+typedef int SRes; -+ -+#ifndef RINOK -+#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } -+#endif -+ -+typedef unsigned char Byte; -+typedef short Int16; -+typedef unsigned short UInt16; -+ -+#ifdef _LZMA_UINT32_IS_ULONG -+typedef long Int32; -+typedef unsigned long UInt32; -+#else -+typedef int Int32; -+typedef unsigned int UInt32; -+#endif -+ -+/* #define _SZ_NO_INT_64 */ -+/* define it if your compiler doesn't support 64-bit integers */ -+ -+#ifdef _SZ_NO_INT_64 -+ -+typedef long Int64; -+typedef unsigned long UInt64; -+ -+#else -+ -+#if defined(_MSC_VER) || defined(__BORLANDC__) -+typedef __int64 Int64; -+typedef unsigned __int64 UInt64; -+#else -+typedef long long int Int64; -+typedef unsigned long long int UInt64; -+#endif -+ -+#endif -+ -+#ifdef _LZMA_NO_SYSTEM_SIZE_T -+typedef UInt32 SizeT; -+#else -+#include -+typedef size_t SizeT; -+#endif -+ -+typedef int Bool; -+#define True 1 -+#define False 0 -+ -+ -+#ifdef _MSC_VER -+ -+#if _MSC_VER >= 1300 -+#define MY_NO_INLINE __declspec(noinline) -+#else -+#define MY_NO_INLINE -+#endif -+ -+#define MY_CDECL __cdecl -+#define MY_STD_CALL __stdcall -+#define MY_FAST_CALL MY_NO_INLINE __fastcall -+ -+#else -+ -+#define MY_CDECL -+#define MY_STD_CALL -+#define MY_FAST_CALL -+ -+#endif -+ -+ -+/* The following interfaces use first parameter as pointer to structure */ -+ -+typedef struct -+{ -+ SRes (*Read)(void *p, void *buf, size_t *size); -+ /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. -+ (output(*size) < input(*size)) is allowed */ -+} ISeqInStream; -+ -+typedef struct -+{ -+ size_t (*Write)(void *p, const void *buf, size_t size); -+ /* Returns: result - the number of actually written bytes. -+ (result < size) means error */ -+} ISeqOutStream; -+ -+typedef struct -+{ -+ SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize); -+ /* Returns: result. (result != SZ_OK) means break. -+ Value (UInt64)(Int64)-1 for size means unknown value. */ -+} ICompressProgress; -+ -+typedef struct -+{ -+ void *(*Alloc)(void *p, size_t size); -+ void (*Free)(void *p, void *address); /* address can be 0 */ -+} ISzAlloc; -+ -+#define IAlloc_Alloc(p, size) (p)->Alloc((p), size) -+#define IAlloc_Free(p, a) (p)->Free((p), a) -+ -+#endif ---- /dev/null -+++ b/jffsX-utils/lzma/LzFind.c -@@ -0,0 +1,753 @@ -+/* LzFind.c -- Match finder for LZ algorithms -+2008-04-04 -+Copyright (c) 1999-2008 Igor Pavlov -+Read LzFind.h for license options */ -+ -+#include -+ -+#include "LzFind.h" -+#include "LzHash.h" -+ -+#define kEmptyHashValue 0 -+#define kMaxValForNormalize ((UInt32)0xFFFFFFFF) -+#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */ -+#define kNormalizeMask (~(kNormalizeStepMin - 1)) -+#define kMaxHistorySize ((UInt32)3 << 30) -+ -+#define kStartMaxLen 3 -+ -+static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc) -+{ -+ if (!p->directInput) -+ { -+ alloc->Free(alloc, p->bufferBase); -+ p->bufferBase = 0; -+ } -+} -+ -+/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */ -+ -+static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc) -+{ -+ UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv; -+ if (p->directInput) -+ { -+ p->blockSize = blockSize; -+ return 1; -+ } -+ if (p->bufferBase == 0 || p->blockSize != blockSize) -+ { -+ LzInWindow_Free(p, alloc); -+ p->blockSize = blockSize; -+ p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize); -+ } -+ return (p->bufferBase != 0); -+} -+ -+Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } -+static Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } -+ -+static UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } -+ -+void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) -+{ -+ p->posLimit -= subValue; -+ p->pos -= subValue; -+ p->streamPos -= subValue; -+} -+ -+static void MatchFinder_ReadBlock(CMatchFinder *p) -+{ -+ if (p->streamEndWasReached || p->result != SZ_OK) -+ return; -+ for (;;) -+ { -+ Byte *dest = p->buffer + (p->streamPos - p->pos); -+ size_t size = (p->bufferBase + p->blockSize - dest); -+ if (size == 0) -+ return; -+ p->result = p->stream->Read(p->stream, dest, &size); -+ if (p->result != SZ_OK) -+ return; -+ if (size == 0) -+ { -+ p->streamEndWasReached = 1; -+ return; -+ } -+ p->streamPos += (UInt32)size; -+ if (p->streamPos - p->pos > p->keepSizeAfter) -+ return; -+ } -+} -+ -+void MatchFinder_MoveBlock(CMatchFinder *p) -+{ -+ memmove(p->bufferBase, -+ p->buffer - p->keepSizeBefore, -+ (size_t)(p->streamPos - p->pos + p->keepSizeBefore)); -+ p->buffer = p->bufferBase + p->keepSizeBefore; -+} -+ -+int MatchFinder_NeedMove(CMatchFinder *p) -+{ -+ /* if (p->streamEndWasReached) return 0; */ -+ return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter); -+} -+ -+void MatchFinder_ReadIfRequired(CMatchFinder *p) -+{ -+ if (p->streamEndWasReached) -+ return; -+ if (p->keepSizeAfter >= p->streamPos - p->pos) -+ MatchFinder_ReadBlock(p); -+} -+ -+static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p) -+{ -+ if (MatchFinder_NeedMove(p)) -+ MatchFinder_MoveBlock(p); -+ MatchFinder_ReadBlock(p); -+} -+ -+static void MatchFinder_SetDefaultSettings(CMatchFinder *p) -+{ -+ p->cutValue = 32; -+ p->btMode = 1; -+ p->numHashBytes = 4; -+ /* p->skipModeBits = 0; */ -+ p->directInput = 0; -+ p->bigHash = 0; -+} -+ -+#define kCrcPoly 0xEDB88320 -+ -+void MatchFinder_Construct(CMatchFinder *p) -+{ -+ UInt32 i; -+ p->bufferBase = 0; -+ p->directInput = 0; -+ p->hash = 0; -+ MatchFinder_SetDefaultSettings(p); -+ -+ for (i = 0; i < 256; i++) -+ { -+ UInt32 r = i; -+ int j; -+ for (j = 0; j < 8; j++) -+ r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); -+ p->crc[i] = r; -+ } -+} -+ -+static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc) -+{ -+ alloc->Free(alloc, p->hash); -+ p->hash = 0; -+} -+ -+void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc) -+{ -+ MatchFinder_FreeThisClassMemory(p, alloc); -+ LzInWindow_Free(p, alloc); -+} -+ -+static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc) -+{ -+ size_t sizeInBytes = (size_t)num * sizeof(CLzRef); -+ if (sizeInBytes / sizeof(CLzRef) != num) -+ return 0; -+ return (CLzRef *)alloc->Alloc(alloc, sizeInBytes); -+} -+ -+int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, -+ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, -+ ISzAlloc *alloc) -+{ -+ UInt32 sizeReserv; -+ if (historySize > kMaxHistorySize) -+ { -+ MatchFinder_Free(p, alloc); -+ return 0; -+ } -+ sizeReserv = historySize >> 1; -+ if (historySize > ((UInt32)2 << 30)) -+ sizeReserv = historySize >> 2; -+ sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19); -+ -+ p->keepSizeBefore = historySize + keepAddBufferBefore + 1; -+ p->keepSizeAfter = matchMaxLen + keepAddBufferAfter; -+ /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */ -+ if (LzInWindow_Create(p, sizeReserv, alloc)) -+ { -+ UInt32 newCyclicBufferSize = (historySize /* >> p->skipModeBits */) + 1; -+ UInt32 hs; -+ p->matchMaxLen = matchMaxLen; -+ { -+ p->fixedHashSize = 0; -+ if (p->numHashBytes == 2) -+ hs = (1 << 16) - 1; -+ else -+ { -+ hs = historySize - 1; -+ hs |= (hs >> 1); -+ hs |= (hs >> 2); -+ hs |= (hs >> 4); -+ hs |= (hs >> 8); -+ hs >>= 1; -+ /* hs >>= p->skipModeBits; */ -+ hs |= 0xFFFF; /* don't change it! It's required for Deflate */ -+ if (hs > (1 << 24)) -+ { -+ if (p->numHashBytes == 3) -+ hs = (1 << 24) - 1; -+ else -+ hs >>= 1; -+ } -+ } -+ p->hashMask = hs; -+ hs++; -+ if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size; -+ if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size; -+ if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size; -+ hs += p->fixedHashSize; -+ } -+ -+ { -+ UInt32 prevSize = p->hashSizeSum + p->numSons; -+ UInt32 newSize; -+ p->historySize = historySize; -+ p->hashSizeSum = hs; -+ p->cyclicBufferSize = newCyclicBufferSize; -+ p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize); -+ newSize = p->hashSizeSum + p->numSons; -+ if (p->hash != 0 && prevSize == newSize) -+ return 1; -+ MatchFinder_FreeThisClassMemory(p, alloc); -+ p->hash = AllocRefs(newSize, alloc); -+ if (p->hash != 0) -+ { -+ p->son = p->hash + p->hashSizeSum; -+ return 1; -+ } -+ } -+ } -+ MatchFinder_Free(p, alloc); -+ return 0; -+} -+ -+static void MatchFinder_SetLimits(CMatchFinder *p) -+{ -+ UInt32 limit = kMaxValForNormalize - p->pos; -+ UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos; -+ if (limit2 < limit) -+ limit = limit2; -+ limit2 = p->streamPos - p->pos; -+ if (limit2 <= p->keepSizeAfter) -+ { -+ if (limit2 > 0) -+ limit2 = 1; -+ } -+ else -+ limit2 -= p->keepSizeAfter; -+ if (limit2 < limit) -+ limit = limit2; -+ { -+ UInt32 lenLimit = p->streamPos - p->pos; -+ if (lenLimit > p->matchMaxLen) -+ lenLimit = p->matchMaxLen; -+ p->lenLimit = lenLimit; -+ } -+ p->posLimit = p->pos + limit; -+} -+ -+void MatchFinder_Init(CMatchFinder *p) -+{ -+ UInt32 i; -+ for(i = 0; i < p->hashSizeSum; i++) -+ p->hash[i] = kEmptyHashValue; -+ p->cyclicBufferPos = 0; -+ p->buffer = p->bufferBase; -+ p->pos = p->streamPos = p->cyclicBufferSize; -+ p->result = SZ_OK; -+ p->streamEndWasReached = 0; -+ MatchFinder_ReadBlock(p); -+ MatchFinder_SetLimits(p); -+} -+ -+static UInt32 MatchFinder_GetSubValue(CMatchFinder *p) -+{ -+ return (p->pos - p->historySize - 1) & kNormalizeMask; -+} -+ -+void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems) -+{ -+ UInt32 i; -+ for (i = 0; i < numItems; i++) -+ { -+ UInt32 value = items[i]; -+ if (value <= subValue) -+ value = kEmptyHashValue; -+ else -+ value -= subValue; -+ items[i] = value; -+ } -+} -+ -+static void MatchFinder_Normalize(CMatchFinder *p) -+{ -+ UInt32 subValue = MatchFinder_GetSubValue(p); -+ MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons); -+ MatchFinder_ReduceOffsets(p, subValue); -+} -+ -+static void MatchFinder_CheckLimits(CMatchFinder *p) -+{ -+ if (p->pos == kMaxValForNormalize) -+ MatchFinder_Normalize(p); -+ if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos) -+ MatchFinder_CheckAndMoveAndRead(p); -+ if (p->cyclicBufferPos == p->cyclicBufferSize) -+ p->cyclicBufferPos = 0; -+ MatchFinder_SetLimits(p); -+} -+ -+static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, -+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, -+ UInt32 *distances, UInt32 maxLen) -+{ -+ son[_cyclicBufferPos] = curMatch; -+ for (;;) -+ { -+ UInt32 delta = pos - curMatch; -+ if (cutValue-- == 0 || delta >= _cyclicBufferSize) -+ return distances; -+ { -+ const Byte *pb = cur - delta; -+ curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; -+ if (pb[maxLen] == cur[maxLen] && *pb == *cur) -+ { -+ UInt32 len = 0; -+ while(++len != lenLimit) -+ if (pb[len] != cur[len]) -+ break; -+ if (maxLen < len) -+ { -+ *distances++ = maxLen = len; -+ *distances++ = delta - 1; -+ if (len == lenLimit) -+ return distances; -+ } -+ } -+ } -+ } -+} -+ -+UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, -+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, -+ UInt32 *distances, UInt32 maxLen) -+{ -+ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; -+ CLzRef *ptr1 = son + (_cyclicBufferPos << 1); -+ UInt32 len0 = 0, len1 = 0; -+ for (;;) -+ { -+ UInt32 delta = pos - curMatch; -+ if (cutValue-- == 0 || delta >= _cyclicBufferSize) -+ { -+ *ptr0 = *ptr1 = kEmptyHashValue; -+ return distances; -+ } -+ { -+ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); -+ const Byte *pb = cur - delta; -+ UInt32 len = (len0 < len1 ? len0 : len1); -+ if (pb[len] == cur[len]) -+ { -+ if (++len != lenLimit && pb[len] == cur[len]) -+ while(++len != lenLimit) -+ if (pb[len] != cur[len]) -+ break; -+ if (maxLen < len) -+ { -+ *distances++ = maxLen = len; -+ *distances++ = delta - 1; -+ if (len == lenLimit) -+ { -+ *ptr1 = pair[0]; -+ *ptr0 = pair[1]; -+ return distances; -+ } -+ } -+ } -+ if (pb[len] < cur[len]) -+ { -+ *ptr1 = curMatch; -+ ptr1 = pair + 1; -+ curMatch = *ptr1; -+ len1 = len; -+ } -+ else -+ { -+ *ptr0 = curMatch; -+ ptr0 = pair; -+ curMatch = *ptr0; -+ len0 = len; -+ } -+ } -+ } -+} -+ -+static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, -+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue) -+{ -+ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; -+ CLzRef *ptr1 = son + (_cyclicBufferPos << 1); -+ UInt32 len0 = 0, len1 = 0; -+ for (;;) -+ { -+ UInt32 delta = pos - curMatch; -+ if (cutValue-- == 0 || delta >= _cyclicBufferSize) -+ { -+ *ptr0 = *ptr1 = kEmptyHashValue; -+ return; -+ } -+ { -+ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); -+ const Byte *pb = cur - delta; -+ UInt32 len = (len0 < len1 ? len0 : len1); -+ if (pb[len] == cur[len]) -+ { -+ while(++len != lenLimit) -+ if (pb[len] != cur[len]) -+ break; -+ { -+ if (len == lenLimit) -+ { -+ *ptr1 = pair[0]; -+ *ptr0 = pair[1]; -+ return; -+ } -+ } -+ } -+ if (pb[len] < cur[len]) -+ { -+ *ptr1 = curMatch; -+ ptr1 = pair + 1; -+ curMatch = *ptr1; -+ len1 = len; -+ } -+ else -+ { -+ *ptr0 = curMatch; -+ ptr0 = pair; -+ curMatch = *ptr0; -+ len0 = len; -+ } -+ } -+ } -+} -+ -+#define MOVE_POS \ -+ ++p->cyclicBufferPos; \ -+ p->buffer++; \ -+ if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); -+ -+#define MOVE_POS_RET MOVE_POS return offset; -+ -+static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; } -+ -+#define GET_MATCHES_HEADER2(minLen, ret_op) \ -+ UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \ -+ lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ -+ cur = p->buffer; -+ -+#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0) -+#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue) -+ -+#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue -+ -+#define GET_MATCHES_FOOTER(offset, maxLen) \ -+ offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \ -+ distances + offset, maxLen) - distances); MOVE_POS_RET; -+ -+#define SKIP_FOOTER \ -+ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS; -+ -+static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -+{ -+ UInt32 offset; -+ GET_MATCHES_HEADER(2) -+ HASH2_CALC; -+ curMatch = p->hash[hashValue]; -+ p->hash[hashValue] = p->pos; -+ offset = 0; -+ GET_MATCHES_FOOTER(offset, 1) -+} -+ -+UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -+{ -+ UInt32 offset; -+ GET_MATCHES_HEADER(3) -+ HASH_ZIP_CALC; -+ curMatch = p->hash[hashValue]; -+ p->hash[hashValue] = p->pos; -+ offset = 0; -+ GET_MATCHES_FOOTER(offset, 2) -+} -+ -+static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -+{ -+ UInt32 hash2Value, delta2, maxLen, offset; -+ GET_MATCHES_HEADER(3) -+ -+ HASH3_CALC; -+ -+ delta2 = p->pos - p->hash[hash2Value]; -+ curMatch = p->hash[kFix3HashSize + hashValue]; -+ -+ p->hash[hash2Value] = -+ p->hash[kFix3HashSize + hashValue] = p->pos; -+ -+ -+ maxLen = 2; -+ offset = 0; -+ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) -+ { -+ for (; maxLen != lenLimit; maxLen++) -+ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) -+ break; -+ distances[0] = maxLen; -+ distances[1] = delta2 - 1; -+ offset = 2; -+ if (maxLen == lenLimit) -+ { -+ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); -+ MOVE_POS_RET; -+ } -+ } -+ GET_MATCHES_FOOTER(offset, maxLen) -+} -+ -+static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -+{ -+ UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; -+ GET_MATCHES_HEADER(4) -+ -+ HASH4_CALC; -+ -+ delta2 = p->pos - p->hash[ hash2Value]; -+ delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; -+ curMatch = p->hash[kFix4HashSize + hashValue]; -+ -+ p->hash[ hash2Value] = -+ p->hash[kFix3HashSize + hash3Value] = -+ p->hash[kFix4HashSize + hashValue] = p->pos; -+ -+ maxLen = 1; -+ offset = 0; -+ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) -+ { -+ distances[0] = maxLen = 2; -+ distances[1] = delta2 - 1; -+ offset = 2; -+ } -+ if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) -+ { -+ maxLen = 3; -+ distances[offset + 1] = delta3 - 1; -+ offset += 2; -+ delta2 = delta3; -+ } -+ if (offset != 0) -+ { -+ for (; maxLen != lenLimit; maxLen++) -+ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) -+ break; -+ distances[offset - 2] = maxLen; -+ if (maxLen == lenLimit) -+ { -+ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); -+ MOVE_POS_RET; -+ } -+ } -+ if (maxLen < 3) -+ maxLen = 3; -+ GET_MATCHES_FOOTER(offset, maxLen) -+} -+ -+static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -+{ -+ UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; -+ GET_MATCHES_HEADER(4) -+ -+ HASH4_CALC; -+ -+ delta2 = p->pos - p->hash[ hash2Value]; -+ delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; -+ curMatch = p->hash[kFix4HashSize + hashValue]; -+ -+ p->hash[ hash2Value] = -+ p->hash[kFix3HashSize + hash3Value] = -+ p->hash[kFix4HashSize + hashValue] = p->pos; -+ -+ maxLen = 1; -+ offset = 0; -+ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) -+ { -+ distances[0] = maxLen = 2; -+ distances[1] = delta2 - 1; -+ offset = 2; -+ } -+ if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) -+ { -+ maxLen = 3; -+ distances[offset + 1] = delta3 - 1; -+ offset += 2; -+ delta2 = delta3; -+ } -+ if (offset != 0) -+ { -+ for (; maxLen != lenLimit; maxLen++) -+ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) -+ break; -+ distances[offset - 2] = maxLen; -+ if (maxLen == lenLimit) -+ { -+ p->son[p->cyclicBufferPos] = curMatch; -+ MOVE_POS_RET; -+ } -+ } -+ if (maxLen < 3) -+ maxLen = 3; -+ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), -+ distances + offset, maxLen) - (distances)); -+ MOVE_POS_RET -+} -+ -+UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -+{ -+ UInt32 offset; -+ GET_MATCHES_HEADER(3) -+ HASH_ZIP_CALC; -+ curMatch = p->hash[hashValue]; -+ p->hash[hashValue] = p->pos; -+ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), -+ distances, 2) - (distances)); -+ MOVE_POS_RET -+} -+ -+static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -+{ -+ do -+ { -+ SKIP_HEADER(2) -+ HASH2_CALC; -+ curMatch = p->hash[hashValue]; -+ p->hash[hashValue] = p->pos; -+ SKIP_FOOTER -+ } -+ while (--num != 0); -+} -+ -+void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -+{ -+ do -+ { -+ SKIP_HEADER(3) -+ HASH_ZIP_CALC; -+ curMatch = p->hash[hashValue]; -+ p->hash[hashValue] = p->pos; -+ SKIP_FOOTER -+ } -+ while (--num != 0); -+} -+ -+static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -+{ -+ do -+ { -+ UInt32 hash2Value; -+ SKIP_HEADER(3) -+ HASH3_CALC; -+ curMatch = p->hash[kFix3HashSize + hashValue]; -+ p->hash[hash2Value] = -+ p->hash[kFix3HashSize + hashValue] = p->pos; -+ SKIP_FOOTER -+ } -+ while (--num != 0); -+} -+ -+static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -+{ -+ do -+ { -+ UInt32 hash2Value, hash3Value; -+ SKIP_HEADER(4) -+ HASH4_CALC; -+ curMatch = p->hash[kFix4HashSize + hashValue]; -+ p->hash[ hash2Value] = -+ p->hash[kFix3HashSize + hash3Value] = p->pos; -+ p->hash[kFix4HashSize + hashValue] = p->pos; -+ SKIP_FOOTER -+ } -+ while (--num != 0); -+} -+ -+static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -+{ -+ do -+ { -+ UInt32 hash2Value, hash3Value; -+ SKIP_HEADER(4) -+ HASH4_CALC; -+ curMatch = p->hash[kFix4HashSize + hashValue]; -+ p->hash[ hash2Value] = -+ p->hash[kFix3HashSize + hash3Value] = -+ p->hash[kFix4HashSize + hashValue] = p->pos; -+ p->son[p->cyclicBufferPos] = curMatch; -+ MOVE_POS -+ } -+ while (--num != 0); -+} -+ -+void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -+{ -+ do -+ { -+ SKIP_HEADER(3) -+ HASH_ZIP_CALC; -+ curMatch = p->hash[hashValue]; -+ p->hash[hashValue] = p->pos; -+ p->son[p->cyclicBufferPos] = curMatch; -+ MOVE_POS -+ } -+ while (--num != 0); -+} -+ -+void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable) -+{ -+ vTable->Init = (Mf_Init_Func)MatchFinder_Init; -+ vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte; -+ vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; -+ vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; -+ if (!p->btMode) -+ { -+ vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; -+ vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; -+ } -+ else if (p->numHashBytes == 2) -+ { -+ vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; -+ vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; -+ } -+ else if (p->numHashBytes == 3) -+ { -+ vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; -+ vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; -+ } -+ else -+ { -+ vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; -+ vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; -+ } -+} ---- /dev/null -+++ b/jffsX-utils/lzma/LzmaDec.c -@@ -0,0 +1,1014 @@ -+/* LzmaDec.c -- LZMA Decoder -+2008-04-29 -+Copyright (c) 1999-2008 Igor Pavlov -+Read LzmaDec.h for license options */ -+ -+#include "LzmaDec.h" -+ -+#include -+ -+#define kNumTopBits 24 -+#define kTopValue ((UInt32)1 << kNumTopBits) -+ -+#define kNumBitModelTotalBits 11 -+#define kBitModelTotal (1 << kNumBitModelTotalBits) -+#define kNumMoveBits 5 -+ -+#define RC_INIT_SIZE 5 -+ -+#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } -+ -+#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) -+#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); -+#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); -+#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \ -+ { UPDATE_0(p); i = (i + i); A0; } else \ -+ { UPDATE_1(p); i = (i + i) + 1; A1; } -+#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;) -+ -+#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); } -+#define TREE_DECODE(probs, limit, i) \ -+ { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } -+ -+/* #define _LZMA_SIZE_OPT */ -+ -+#ifdef _LZMA_SIZE_OPT -+#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i) -+#else -+#define TREE_6_DECODE(probs, i) \ -+ { i = 1; \ -+ TREE_GET_BIT(probs, i); \ -+ TREE_GET_BIT(probs, i); \ -+ TREE_GET_BIT(probs, i); \ -+ TREE_GET_BIT(probs, i); \ -+ TREE_GET_BIT(probs, i); \ -+ TREE_GET_BIT(probs, i); \ -+ i -= 0x40; } -+#endif -+ -+#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } -+ -+#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) -+#define UPDATE_0_CHECK range = bound; -+#define UPDATE_1_CHECK range -= bound; code -= bound; -+#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ -+ { UPDATE_0_CHECK; i = (i + i); A0; } else \ -+ { UPDATE_1_CHECK; i = (i + i) + 1; A1; } -+#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;) -+#define TREE_DECODE_CHECK(probs, limit, i) \ -+ { i = 1; do { GET_BIT_CHECK(probs + i, i) } while(i < limit); i -= limit; } -+ -+ -+#define kNumPosBitsMax 4 -+#define kNumPosStatesMax (1 << kNumPosBitsMax) -+ -+#define kLenNumLowBits 3 -+#define kLenNumLowSymbols (1 << kLenNumLowBits) -+#define kLenNumMidBits 3 -+#define kLenNumMidSymbols (1 << kLenNumMidBits) -+#define kLenNumHighBits 8 -+#define kLenNumHighSymbols (1 << kLenNumHighBits) -+ -+#define LenChoice 0 -+#define LenChoice2 (LenChoice + 1) -+#define LenLow (LenChoice2 + 1) -+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) -+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) -+#define kNumLenProbs (LenHigh + kLenNumHighSymbols) -+ -+ -+#define kNumStates 12 -+#define kNumLitStates 7 -+ -+#define kStartPosModelIndex 4 -+#define kEndPosModelIndex 14 -+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) -+ -+#define kNumPosSlotBits 6 -+#define kNumLenToPosStates 4 -+ -+#define kNumAlignBits 4 -+#define kAlignTableSize (1 << kNumAlignBits) -+ -+#define kMatchMinLen 2 -+#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) -+ -+#define IsMatch 0 -+#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) -+#define IsRepG0 (IsRep + kNumStates) -+#define IsRepG1 (IsRepG0 + kNumStates) -+#define IsRepG2 (IsRepG1 + kNumStates) -+#define IsRep0Long (IsRepG2 + kNumStates) -+#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) -+#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) -+#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) -+#define LenCoder (Align + kAlignTableSize) -+#define RepLenCoder (LenCoder + kNumLenProbs) -+#define Literal (RepLenCoder + kNumLenProbs) -+ -+#define LZMA_BASE_SIZE 1846 -+#define LZMA_LIT_SIZE 768 -+ -+#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp))) -+ -+#if Literal != LZMA_BASE_SIZE -+StopCompilingDueBUG -+#endif -+ -+/* -+#define LZMA_STREAM_WAS_FINISHED_ID (-1) -+#define LZMA_SPEC_LEN_OFFSET (-3) -+*/ -+ -+Byte kLiteralNextStates[kNumStates * 2] = -+{ -+ 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5, -+ 7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10 -+}; -+ -+#define LZMA_DIC_MIN (1 << 12) -+ -+/* First LZMA-symbol is always decoded. -+And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization -+Out: -+ Result: -+ 0 - OK -+ 1 - Error -+ p->remainLen: -+ < kMatchSpecLenStart : normal remain -+ = kMatchSpecLenStart : finished -+ = kMatchSpecLenStart + 1 : Flush marker -+ = kMatchSpecLenStart + 2 : State Init Marker -+*/ -+ -+static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit) -+{ -+ CLzmaProb *probs = p->probs; -+ -+ unsigned state = p->state; -+ UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3]; -+ unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1; -+ unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1; -+ unsigned lc = p->prop.lc; -+ -+ Byte *dic = p->dic; -+ SizeT dicBufSize = p->dicBufSize; -+ SizeT dicPos = p->dicPos; -+ -+ UInt32 processedPos = p->processedPos; -+ UInt32 checkDicSize = p->checkDicSize; -+ unsigned len = 0; -+ -+ const Byte *buf = p->buf; -+ UInt32 range = p->range; -+ UInt32 code = p->code; -+ -+ do -+ { -+ CLzmaProb *prob; -+ UInt32 bound; -+ unsigned ttt; -+ unsigned posState = processedPos & pbMask; -+ -+ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; -+ IF_BIT_0(prob) -+ { -+ unsigned symbol; -+ UPDATE_0(prob); -+ prob = probs + Literal; -+ if (checkDicSize != 0 || processedPos != 0) -+ prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) + -+ (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc)))); -+ -+ if (state < kNumLitStates) -+ { -+ symbol = 1; -+ do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); -+ } -+ else -+ { -+ unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; -+ unsigned offs = 0x100; -+ symbol = 1; -+ do -+ { -+ unsigned bit; -+ CLzmaProb *probLit; -+ matchByte <<= 1; -+ bit = (matchByte & offs); -+ probLit = prob + offs + bit + symbol; -+ GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) -+ } -+ while (symbol < 0x100); -+ } -+ dic[dicPos++] = (Byte)symbol; -+ processedPos++; -+ -+ state = kLiteralNextStates[state]; -+ /* if (state < 4) state = 0; else if (state < 10) state -= 3; else state -= 6; */ -+ continue; -+ } -+ else -+ { -+ UPDATE_1(prob); -+ prob = probs + IsRep + state; -+ IF_BIT_0(prob) -+ { -+ UPDATE_0(prob); -+ state += kNumStates; -+ prob = probs + LenCoder; -+ } -+ else -+ { -+ UPDATE_1(prob); -+ if (checkDicSize == 0 && processedPos == 0) -+ return SZ_ERROR_DATA; -+ prob = probs + IsRepG0 + state; -+ IF_BIT_0(prob) -+ { -+ UPDATE_0(prob); -+ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; -+ IF_BIT_0(prob) -+ { -+ UPDATE_0(prob); -+ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; -+ dicPos++; -+ processedPos++; -+ state = state < kNumLitStates ? 9 : 11; -+ continue; -+ } -+ UPDATE_1(prob); -+ } -+ else -+ { -+ UInt32 distance; -+ UPDATE_1(prob); -+ prob = probs + IsRepG1 + state; -+ IF_BIT_0(prob) -+ { -+ UPDATE_0(prob); -+ distance = rep1; -+ } -+ else -+ { -+ UPDATE_1(prob); -+ prob = probs + IsRepG2 + state; -+ IF_BIT_0(prob) -+ { -+ UPDATE_0(prob); -+ distance = rep2; -+ } -+ else -+ { -+ UPDATE_1(prob); -+ distance = rep3; -+ rep3 = rep2; -+ } -+ rep2 = rep1; -+ } -+ rep1 = rep0; -+ rep0 = distance; -+ } -+ state = state < kNumLitStates ? 8 : 11; -+ prob = probs + RepLenCoder; -+ } -+ { -+ unsigned limit, offset; -+ CLzmaProb *probLen = prob + LenChoice; -+ IF_BIT_0(probLen) -+ { -+ UPDATE_0(probLen); -+ probLen = prob + LenLow + (posState << kLenNumLowBits); -+ offset = 0; -+ limit = (1 << kLenNumLowBits); -+ } -+ else -+ { -+ UPDATE_1(probLen); -+ probLen = prob + LenChoice2; -+ IF_BIT_0(probLen) -+ { -+ UPDATE_0(probLen); -+ probLen = prob + LenMid + (posState << kLenNumMidBits); -+ offset = kLenNumLowSymbols; -+ limit = (1 << kLenNumMidBits); -+ } -+ else -+ { -+ UPDATE_1(probLen); -+ probLen = prob + LenHigh; -+ offset = kLenNumLowSymbols + kLenNumMidSymbols; -+ limit = (1 << kLenNumHighBits); -+ } -+ } -+ TREE_DECODE(probLen, limit, len); -+ len += offset; -+ } -+ -+ if (state >= kNumStates) -+ { -+ UInt32 distance; -+ prob = probs + PosSlot + -+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits); -+ TREE_6_DECODE(prob, distance); -+ if (distance >= kStartPosModelIndex) -+ { -+ unsigned posSlot = (unsigned)distance; -+ int numDirectBits = (int)(((distance >> 1) - 1)); -+ distance = (2 | (distance & 1)); -+ if (posSlot < kEndPosModelIndex) -+ { -+ distance <<= numDirectBits; -+ prob = probs + SpecPos + distance - posSlot - 1; -+ { -+ UInt32 mask = 1; -+ unsigned i = 1; -+ do -+ { -+ GET_BIT2(prob + i, i, ; , distance |= mask); -+ mask <<= 1; -+ } -+ while(--numDirectBits != 0); -+ } -+ } -+ else -+ { -+ numDirectBits -= kNumAlignBits; -+ do -+ { -+ NORMALIZE -+ range >>= 1; -+ -+ { -+ UInt32 t; -+ code -= range; -+ t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ -+ distance = (distance << 1) + (t + 1); -+ code += range & t; -+ } -+ /* -+ distance <<= 1; -+ if (code >= range) -+ { -+ code -= range; -+ distance |= 1; -+ } -+ */ -+ } -+ while (--numDirectBits != 0); -+ prob = probs + Align; -+ distance <<= kNumAlignBits; -+ { -+ unsigned i = 1; -+ GET_BIT2(prob + i, i, ; , distance |= 1); -+ GET_BIT2(prob + i, i, ; , distance |= 2); -+ GET_BIT2(prob + i, i, ; , distance |= 4); -+ GET_BIT2(prob + i, i, ; , distance |= 8); -+ } -+ if (distance == (UInt32)0xFFFFFFFF) -+ { -+ len += kMatchSpecLenStart; -+ state -= kNumStates; -+ break; -+ } -+ } -+ } -+ rep3 = rep2; -+ rep2 = rep1; -+ rep1 = rep0; -+ rep0 = distance + 1; -+ if (checkDicSize == 0) -+ { -+ if (distance >= processedPos) -+ return SZ_ERROR_DATA; -+ } -+ else if (distance >= checkDicSize) -+ return SZ_ERROR_DATA; -+ state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; -+ /* state = kLiteralNextStates[state]; */ -+ } -+ -+ len += kMatchMinLen; -+ -+ { -+ SizeT rem = limit - dicPos; -+ unsigned curLen = ((rem < len) ? (unsigned)rem : len); -+ SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0); -+ -+ processedPos += curLen; -+ -+ len -= curLen; -+ if (pos + curLen <= dicBufSize) -+ { -+ Byte *dest = dic + dicPos; -+ ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos; -+ const Byte *lim = dest + curLen; -+ dicPos += curLen; -+ do -+ *(dest) = (Byte)*(dest + src); -+ while (++dest != lim); -+ } -+ else -+ { -+ do -+ { -+ dic[dicPos++] = dic[pos]; -+ if (++pos == dicBufSize) -+ pos = 0; -+ } -+ while (--curLen != 0); -+ } -+ } -+ } -+ } -+ while (dicPos < limit && buf < bufLimit); -+ NORMALIZE; -+ p->buf = buf; -+ p->range = range; -+ p->code = code; -+ p->remainLen = len; -+ p->dicPos = dicPos; -+ p->processedPos = processedPos; -+ p->reps[0] = rep0; -+ p->reps[1] = rep1; -+ p->reps[2] = rep2; -+ p->reps[3] = rep3; -+ p->state = state; -+ -+ return SZ_OK; -+} -+ -+static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit) -+{ -+ if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) -+ { -+ Byte *dic = p->dic; -+ SizeT dicPos = p->dicPos; -+ SizeT dicBufSize = p->dicBufSize; -+ unsigned len = p->remainLen; -+ UInt32 rep0 = p->reps[0]; -+ if (limit - dicPos < len) -+ len = (unsigned)(limit - dicPos); -+ -+ if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) -+ p->checkDicSize = p->prop.dicSize; -+ -+ p->processedPos += len; -+ p->remainLen -= len; -+ while (len-- != 0) -+ { -+ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; -+ dicPos++; -+ } -+ p->dicPos = dicPos; -+ } -+} -+ -+/* LzmaDec_DecodeReal2 decodes LZMA-symbols and sets p->needFlush and p->needInit, if required. */ -+ -+static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit) -+{ -+ do -+ { -+ SizeT limit2 = limit; -+ if (p->checkDicSize == 0) -+ { -+ UInt32 rem = p->prop.dicSize - p->processedPos; -+ if (limit - p->dicPos > rem) -+ limit2 = p->dicPos + rem; -+ } -+ RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit)); -+ if (p->processedPos >= p->prop.dicSize) -+ p->checkDicSize = p->prop.dicSize; -+ LzmaDec_WriteRem(p, limit); -+ } -+ while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); -+ -+ if (p->remainLen > kMatchSpecLenStart) -+ { -+ p->remainLen = kMatchSpecLenStart; -+ } -+ return 0; -+} -+ -+typedef enum -+{ -+ DUMMY_ERROR, /* unexpected end of input stream */ -+ DUMMY_LIT, -+ DUMMY_MATCH, -+ DUMMY_REP -+} ELzmaDummy; -+ -+static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize) -+{ -+ UInt32 range = p->range; -+ UInt32 code = p->code; -+ const Byte *bufLimit = buf + inSize; -+ CLzmaProb *probs = p->probs; -+ unsigned state = p->state; -+ ELzmaDummy res; -+ -+ { -+ CLzmaProb *prob; -+ UInt32 bound; -+ unsigned ttt; -+ unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1); -+ -+ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK -+ -+ /* if (bufLimit - buf >= 7) return DUMMY_LIT; */ -+ -+ prob = probs + Literal; -+ if (p->checkDicSize != 0 || p->processedPos != 0) -+ prob += (LZMA_LIT_SIZE * -+ ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + -+ (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); -+ -+ if (state < kNumLitStates) -+ { -+ unsigned symbol = 1; -+ do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); -+ } -+ else -+ { -+ unsigned matchByte = p->dic[p->dicPos - p->reps[0] + -+ ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)]; -+ unsigned offs = 0x100; -+ unsigned symbol = 1; -+ do -+ { -+ unsigned bit; -+ CLzmaProb *probLit; -+ matchByte <<= 1; -+ bit = (matchByte & offs); -+ probLit = prob + offs + bit + symbol; -+ GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) -+ } -+ while (symbol < 0x100); -+ } -+ res = DUMMY_LIT; -+ } -+ else -+ { -+ unsigned len; -+ UPDATE_1_CHECK; -+ -+ prob = probs + IsRep + state; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK; -+ state = 0; -+ prob = probs + LenCoder; -+ res = DUMMY_MATCH; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ res = DUMMY_REP; -+ prob = probs + IsRepG0 + state; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK; -+ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK; -+ NORMALIZE_CHECK; -+ return DUMMY_REP; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ } -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ prob = probs + IsRepG1 + state; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ prob = probs + IsRepG2 + state; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ } -+ } -+ } -+ state = kNumStates; -+ prob = probs + RepLenCoder; -+ } -+ { -+ unsigned limit, offset; -+ CLzmaProb *probLen = prob + LenChoice; -+ IF_BIT_0_CHECK(probLen) -+ { -+ UPDATE_0_CHECK; -+ probLen = prob + LenLow + (posState << kLenNumLowBits); -+ offset = 0; -+ limit = 1 << kLenNumLowBits; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ probLen = prob + LenChoice2; -+ IF_BIT_0_CHECK(probLen) -+ { -+ UPDATE_0_CHECK; -+ probLen = prob + LenMid + (posState << kLenNumMidBits); -+ offset = kLenNumLowSymbols; -+ limit = 1 << kLenNumMidBits; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ probLen = prob + LenHigh; -+ offset = kLenNumLowSymbols + kLenNumMidSymbols; -+ limit = 1 << kLenNumHighBits; -+ } -+ } -+ TREE_DECODE_CHECK(probLen, limit, len); -+ len += offset; -+ } -+ -+ if (state < 4) -+ { -+ unsigned posSlot; -+ prob = probs + PosSlot + -+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << -+ kNumPosSlotBits); -+ TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); -+ if (posSlot >= kStartPosModelIndex) -+ { -+ int numDirectBits = ((posSlot >> 1) - 1); -+ -+ /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */ -+ -+ if (posSlot < kEndPosModelIndex) -+ { -+ prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1; -+ } -+ else -+ { -+ numDirectBits -= kNumAlignBits; -+ do -+ { -+ NORMALIZE_CHECK -+ range >>= 1; -+ code -= range & (((code - range) >> 31) - 1); -+ /* if (code >= range) code -= range; */ -+ } -+ while (--numDirectBits != 0); -+ prob = probs + Align; -+ numDirectBits = kNumAlignBits; -+ } -+ { -+ unsigned i = 1; -+ do -+ { -+ GET_BIT_CHECK(prob + i, i); -+ } -+ while(--numDirectBits != 0); -+ } -+ } -+ } -+ } -+ } -+ NORMALIZE_CHECK; -+ return res; -+} -+ -+ -+static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data) -+{ -+ p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]); -+ p->range = 0xFFFFFFFF; -+ p->needFlush = 0; -+} -+ -+static void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) -+{ -+ p->needFlush = 1; -+ p->remainLen = 0; -+ p->tempBufSize = 0; -+ -+ if (initDic) -+ { -+ p->processedPos = 0; -+ p->checkDicSize = 0; -+ p->needInitState = 1; -+ } -+ if (initState) -+ p->needInitState = 1; -+} -+ -+void LzmaDec_Init(CLzmaDec *p) -+{ -+ p->dicPos = 0; -+ LzmaDec_InitDicAndState(p, True, True); -+} -+ -+static void LzmaDec_InitStateReal(CLzmaDec *p) -+{ -+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp)); -+ UInt32 i; -+ CLzmaProb *probs = p->probs; -+ for (i = 0; i < numProbs; i++) -+ probs[i] = kBitModelTotal >> 1; -+ p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1; -+ p->state = 0; -+ p->needInitState = 0; -+} -+ -+SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, -+ ELzmaFinishMode finishMode, ELzmaStatus *status) -+{ -+ SizeT inSize = *srcLen; -+ (*srcLen) = 0; -+ LzmaDec_WriteRem(p, dicLimit); -+ -+ *status = LZMA_STATUS_NOT_SPECIFIED; -+ -+ while (p->remainLen != kMatchSpecLenStart) -+ { -+ int checkEndMarkNow; -+ -+ if (p->needFlush != 0) -+ { -+ for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) -+ p->tempBuf[p->tempBufSize++] = *src++; -+ if (p->tempBufSize < RC_INIT_SIZE) -+ { -+ *status = LZMA_STATUS_NEEDS_MORE_INPUT; -+ return SZ_OK; -+ } -+ if (p->tempBuf[0] != 0) -+ return SZ_ERROR_DATA; -+ -+ LzmaDec_InitRc(p, p->tempBuf); -+ p->tempBufSize = 0; -+ } -+ -+ checkEndMarkNow = 0; -+ if (p->dicPos >= dicLimit) -+ { -+ if (p->remainLen == 0 && p->code == 0) -+ { -+ *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK; -+ return SZ_OK; -+ } -+ if (finishMode == LZMA_FINISH_ANY) -+ { -+ *status = LZMA_STATUS_NOT_FINISHED; -+ return SZ_OK; -+ } -+ if (p->remainLen != 0) -+ { -+ *status = LZMA_STATUS_NOT_FINISHED; -+ return SZ_ERROR_DATA; -+ } -+ checkEndMarkNow = 1; -+ } -+ -+ if (p->needInitState) -+ LzmaDec_InitStateReal(p); -+ -+ if (p->tempBufSize == 0) -+ { -+ SizeT processed; -+ const Byte *bufLimit; -+ if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) -+ { -+ int dummyRes = LzmaDec_TryDummy(p, src, inSize); -+ if (dummyRes == DUMMY_ERROR) -+ { -+ memcpy(p->tempBuf, src, inSize); -+ p->tempBufSize = (unsigned)inSize; -+ (*srcLen) += inSize; -+ *status = LZMA_STATUS_NEEDS_MORE_INPUT; -+ return SZ_OK; -+ } -+ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) -+ { -+ *status = LZMA_STATUS_NOT_FINISHED; -+ return SZ_ERROR_DATA; -+ } -+ bufLimit = src; -+ } -+ else -+ bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX; -+ p->buf = src; -+ if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) -+ return SZ_ERROR_DATA; -+ processed = p->buf - src; -+ (*srcLen) += processed; -+ src += processed; -+ inSize -= processed; -+ } -+ else -+ { -+ unsigned rem = p->tempBufSize, lookAhead = 0; -+ while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) -+ p->tempBuf[rem++] = src[lookAhead++]; -+ p->tempBufSize = rem; -+ if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) -+ { -+ int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem); -+ if (dummyRes == DUMMY_ERROR) -+ { -+ (*srcLen) += lookAhead; -+ *status = LZMA_STATUS_NEEDS_MORE_INPUT; -+ return SZ_OK; -+ } -+ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) -+ { -+ *status = LZMA_STATUS_NOT_FINISHED; -+ return SZ_ERROR_DATA; -+ } -+ } -+ p->buf = p->tempBuf; -+ if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) -+ return SZ_ERROR_DATA; -+ lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf)); -+ (*srcLen) += lookAhead; -+ src += lookAhead; -+ inSize -= lookAhead; -+ p->tempBufSize = 0; -+ } -+ } -+ if (p->code == 0) -+ *status = LZMA_STATUS_FINISHED_WITH_MARK; -+ return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; -+} -+ -+SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) -+{ -+ SizeT outSize = *destLen; -+ SizeT inSize = *srcLen; -+ *srcLen = *destLen = 0; -+ for (;;) -+ { -+ SizeT inSizeCur = inSize, outSizeCur, dicPos; -+ ELzmaFinishMode curFinishMode; -+ SRes res; -+ if (p->dicPos == p->dicBufSize) -+ p->dicPos = 0; -+ dicPos = p->dicPos; -+ if (outSize > p->dicBufSize - dicPos) -+ { -+ outSizeCur = p->dicBufSize; -+ curFinishMode = LZMA_FINISH_ANY; -+ } -+ else -+ { -+ outSizeCur = dicPos + outSize; -+ curFinishMode = finishMode; -+ } -+ -+ res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status); -+ src += inSizeCur; -+ inSize -= inSizeCur; -+ *srcLen += inSizeCur; -+ outSizeCur = p->dicPos - dicPos; -+ memcpy(dest, p->dic + dicPos, outSizeCur); -+ dest += outSizeCur; -+ outSize -= outSizeCur; -+ *destLen += outSizeCur; -+ if (res != 0) -+ return res; -+ if (outSizeCur == 0 || outSize == 0) -+ return SZ_OK; -+ } -+} -+ -+void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) -+{ -+ alloc->Free(alloc, p->probs); -+ p->probs = 0; -+} -+ -+static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc) -+{ -+ alloc->Free(alloc, p->dic); -+ p->dic = 0; -+} -+ -+void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc) -+{ -+ LzmaDec_FreeProbs(p, alloc); -+ LzmaDec_FreeDict(p, alloc); -+} -+ -+SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) -+{ -+ UInt32 dicSize; -+ Byte d; -+ -+ if (size < LZMA_PROPS_SIZE) -+ return SZ_ERROR_UNSUPPORTED; -+ else -+ dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24); -+ -+ if (dicSize < LZMA_DIC_MIN) -+ dicSize = LZMA_DIC_MIN; -+ p->dicSize = dicSize; -+ -+ d = data[0]; -+ if (d >= (9 * 5 * 5)) -+ return SZ_ERROR_UNSUPPORTED; -+ -+ p->lc = d % 9; -+ d /= 9; -+ p->pb = d / 5; -+ p->lp = d % 5; -+ -+ return SZ_OK; -+} -+ -+static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc) -+{ -+ UInt32 numProbs = LzmaProps_GetNumProbs(propNew); -+ if (p->probs == 0 || numProbs != p->numProbs) -+ { -+ LzmaDec_FreeProbs(p, alloc); -+ p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb)); -+ p->numProbs = numProbs; -+ if (p->probs == 0) -+ return SZ_ERROR_MEM; -+ } -+ return SZ_OK; -+} -+ -+SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) -+{ -+ CLzmaProps propNew; -+ RINOK(LzmaProps_Decode(&propNew, props, propsSize)); -+ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); -+ p->prop = propNew; -+ return SZ_OK; -+} -+ -+SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) -+{ -+ CLzmaProps propNew; -+ SizeT dicBufSize; -+ RINOK(LzmaProps_Decode(&propNew, props, propsSize)); -+ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); -+ dicBufSize = propNew.dicSize; -+ if (p->dic == 0 || dicBufSize != p->dicBufSize) -+ { -+ LzmaDec_FreeDict(p, alloc); -+ p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); -+ if (p->dic == 0) -+ { -+ LzmaDec_FreeProbs(p, alloc); -+ return SZ_ERROR_MEM; -+ } -+ } -+ p->dicBufSize = dicBufSize; -+ p->prop = propNew; -+ return SZ_OK; -+} -+ -+SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, -+ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, -+ ELzmaStatus *status, ISzAlloc *alloc) -+{ -+ CLzmaDec p; -+ SRes res; -+ SizeT inSize = *srcLen; -+ SizeT outSize = *destLen; -+ *srcLen = *destLen = 0; -+ if (inSize < RC_INIT_SIZE) -+ return SZ_ERROR_INPUT_EOF; -+ -+ LzmaDec_Construct(&p); -+ res = LzmaDec_AllocateProbs(&p, propData, propSize, alloc); -+ if (res != 0) -+ return res; -+ p.dic = dest; -+ p.dicBufSize = outSize; -+ -+ LzmaDec_Init(&p); -+ -+ *srcLen = inSize; -+ res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status); -+ -+ if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) -+ res = SZ_ERROR_INPUT_EOF; -+ -+ (*destLen) = p.dicPos; -+ LzmaDec_FreeProbs(&p, alloc); -+ return res; -+} ---- /dev/null -+++ b/jffsX-utils/lzma/LzmaEnc.c -@@ -0,0 +1,2335 @@ -+/* LzmaEnc.c -- LZMA Encoder -+2008-04-28 -+Copyright (c) 1999-2008 Igor Pavlov -+Read LzmaEnc.h for license options */ -+ -+#if defined(SHOW_STAT) || defined(SHOW_STAT2) -+#include -+#endif -+ -+#include -+ -+#include "LzmaEnc.h" -+ -+#include "LzFind.h" -+#ifdef COMPRESS_MF_MT -+#include "LzFindMt.h" -+#endif -+ -+/* #define SHOW_STAT */ -+/* #define SHOW_STAT2 */ -+ -+#ifdef SHOW_STAT -+static int ttt = 0; -+#endif -+ -+#define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1) -+ -+#define kBlockSize (9 << 10) -+#define kUnpackBlockSize (1 << 18) -+#define kMatchArraySize (1 << 21) -+#define kMatchRecordMaxSize ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX) -+ -+#define kNumMaxDirectBits (31) -+ -+#define kNumTopBits 24 -+#define kTopValue ((UInt32)1 << kNumTopBits) -+ -+#define kNumBitModelTotalBits 11 -+#define kBitModelTotal (1 << kNumBitModelTotalBits) -+#define kNumMoveBits 5 -+#define kProbInitValue (kBitModelTotal >> 1) -+ -+#define kNumMoveReducingBits 4 -+#define kNumBitPriceShiftBits 4 -+#define kBitPrice (1 << kNumBitPriceShiftBits) -+ -+void LzmaEncProps_Init(CLzmaEncProps *p) -+{ -+ p->level = 5; -+ p->dictSize = p->mc = 0; -+ p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1; -+ p->writeEndMark = 0; -+} -+ -+void LzmaEncProps_Normalize(CLzmaEncProps *p) -+{ -+ int level = p->level; -+ if (level < 0) level = 5; -+ p->level = level; -+ if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26))); -+ if (p->lc < 0) p->lc = 3; -+ if (p->lp < 0) p->lp = 0; -+ if (p->pb < 0) p->pb = 2; -+ if (p->algo < 0) p->algo = (level < 5 ? 0 : 1); -+ if (p->fb < 0) p->fb = (level < 7 ? 32 : 64); -+ if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1); -+ if (p->numHashBytes < 0) p->numHashBytes = 4; -+ if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1); -+ if (p->numThreads < 0) p->numThreads = ((p->btMode && p->algo) ? 2 : 1); -+} -+ -+UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) -+{ -+ CLzmaEncProps props = *props2; -+ LzmaEncProps_Normalize(&props); -+ return props.dictSize; -+} -+ -+/* #define LZMA_LOG_BSR */ -+/* Define it for Intel's CPU */ -+ -+ -+#ifdef LZMA_LOG_BSR -+ -+#define kDicLogSizeMaxCompress 30 -+ -+#define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); } -+ -+UInt32 GetPosSlot1(UInt32 pos) -+{ -+ UInt32 res; -+ BSR2_RET(pos, res); -+ return res; -+} -+#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } -+#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); } -+ -+#else -+ -+#define kNumLogBits (9 + (int)sizeof(size_t) / 2) -+#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) -+ -+static void LzmaEnc_FastPosInit(Byte *g_FastPos) -+{ -+ int c = 2, slotFast; -+ g_FastPos[0] = 0; -+ g_FastPos[1] = 1; -+ -+ for (slotFast = 2; slotFast < kNumLogBits * 2; slotFast++) -+ { -+ UInt32 k = (1 << ((slotFast >> 1) - 1)); -+ UInt32 j; -+ for (j = 0; j < k; j++, c++) -+ g_FastPos[c] = (Byte)slotFast; -+ } -+} -+ -+#define BSR2_RET(pos, res) { UInt32 i = 6 + ((kNumLogBits - 1) & \ -+ (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \ -+ res = p->g_FastPos[pos >> i] + (i * 2); } -+/* -+#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \ -+ p->g_FastPos[pos >> 6] + 12 : \ -+ p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; } -+*/ -+ -+#define GetPosSlot1(pos) p->g_FastPos[pos] -+#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } -+#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); } -+ -+#endif -+ -+ -+#define LZMA_NUM_REPS 4 -+ -+typedef unsigned CState; -+ -+typedef struct _COptimal -+{ -+ UInt32 price; -+ -+ CState state; -+ int prev1IsChar; -+ int prev2; -+ -+ UInt32 posPrev2; -+ UInt32 backPrev2; -+ -+ UInt32 posPrev; -+ UInt32 backPrev; -+ UInt32 backs[LZMA_NUM_REPS]; -+} COptimal; -+ -+#define kNumOpts (1 << 12) -+ -+#define kNumLenToPosStates 4 -+#define kNumPosSlotBits 6 -+#define kDicLogSizeMin 0 -+#define kDicLogSizeMax 32 -+#define kDistTableSizeMax (kDicLogSizeMax * 2) -+ -+ -+#define kNumAlignBits 4 -+#define kAlignTableSize (1 << kNumAlignBits) -+#define kAlignMask (kAlignTableSize - 1) -+ -+#define kStartPosModelIndex 4 -+#define kEndPosModelIndex 14 -+#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex) -+ -+#define kNumFullDistances (1 << (kEndPosModelIndex / 2)) -+ -+#ifdef _LZMA_PROB32 -+#define CLzmaProb UInt32 -+#else -+#define CLzmaProb UInt16 -+#endif -+ -+#define LZMA_PB_MAX 4 -+#define LZMA_LC_MAX 8 -+#define LZMA_LP_MAX 4 -+ -+#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX) -+ -+ -+#define kLenNumLowBits 3 -+#define kLenNumLowSymbols (1 << kLenNumLowBits) -+#define kLenNumMidBits 3 -+#define kLenNumMidSymbols (1 << kLenNumMidBits) -+#define kLenNumHighBits 8 -+#define kLenNumHighSymbols (1 << kLenNumHighBits) -+ -+#define kLenNumSymbolsTotal (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) -+ -+#define LZMA_MATCH_LEN_MIN 2 -+#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1) -+ -+#define kNumStates 12 -+ -+typedef struct -+{ -+ CLzmaProb choice; -+ CLzmaProb choice2; -+ CLzmaProb low[LZMA_NUM_PB_STATES_MAX << kLenNumLowBits]; -+ CLzmaProb mid[LZMA_NUM_PB_STATES_MAX << kLenNumMidBits]; -+ CLzmaProb high[kLenNumHighSymbols]; -+} CLenEnc; -+ -+typedef struct -+{ -+ CLenEnc p; -+ UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal]; -+ UInt32 tableSize; -+ UInt32 counters[LZMA_NUM_PB_STATES_MAX]; -+} CLenPriceEnc; -+ -+typedef struct _CRangeEnc -+{ -+ UInt32 range; -+ Byte cache; -+ UInt64 low; -+ UInt64 cacheSize; -+ Byte *buf; -+ Byte *bufLim; -+ Byte *bufBase; -+ ISeqOutStream *outStream; -+ UInt64 processed; -+ SRes res; -+} CRangeEnc; -+ -+typedef struct _CSeqInStreamBuf -+{ -+ ISeqInStream funcTable; -+ const Byte *data; -+ SizeT rem; -+} CSeqInStreamBuf; -+ -+static SRes MyRead(void *pp, void *data, size_t *size) -+{ -+ size_t curSize = *size; -+ CSeqInStreamBuf *p = (CSeqInStreamBuf *)pp; -+ if (p->rem < curSize) -+ curSize = p->rem; -+ memcpy(data, p->data, curSize); -+ p->rem -= curSize; -+ p->data += curSize; -+ *size = curSize; -+ return SZ_OK; -+} -+ -+typedef struct -+{ -+ CLzmaProb *litProbs; -+ -+ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; -+ CLzmaProb isRep[kNumStates]; -+ CLzmaProb isRepG0[kNumStates]; -+ CLzmaProb isRepG1[kNumStates]; -+ CLzmaProb isRepG2[kNumStates]; -+ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; -+ -+ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; -+ CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; -+ CLzmaProb posAlignEncoder[1 << kNumAlignBits]; -+ -+ CLenPriceEnc lenEnc; -+ CLenPriceEnc repLenEnc; -+ -+ UInt32 reps[LZMA_NUM_REPS]; -+ UInt32 state; -+} CSaveState; -+ -+typedef struct _CLzmaEnc -+{ -+ IMatchFinder matchFinder; -+ void *matchFinderObj; -+ -+ #ifdef COMPRESS_MF_MT -+ Bool mtMode; -+ CMatchFinderMt matchFinderMt; -+ #endif -+ -+ CMatchFinder matchFinderBase; -+ -+ #ifdef COMPRESS_MF_MT -+ Byte pad[128]; -+ #endif -+ -+ UInt32 optimumEndIndex; -+ UInt32 optimumCurrentIndex; -+ -+ Bool longestMatchWasFound; -+ UInt32 longestMatchLength; -+ UInt32 numDistancePairs; -+ -+ COptimal opt[kNumOpts]; -+ -+ #ifndef LZMA_LOG_BSR -+ Byte g_FastPos[1 << kNumLogBits]; -+ #endif -+ -+ UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits]; -+ UInt32 matchDistances[LZMA_MATCH_LEN_MAX * 2 + 2 + 1]; -+ UInt32 numFastBytes; -+ UInt32 additionalOffset; -+ UInt32 reps[LZMA_NUM_REPS]; -+ UInt32 state; -+ -+ UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax]; -+ UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances]; -+ UInt32 alignPrices[kAlignTableSize]; -+ UInt32 alignPriceCount; -+ -+ UInt32 distTableSize; -+ -+ unsigned lc, lp, pb; -+ unsigned lpMask, pbMask; -+ -+ CLzmaProb *litProbs; -+ -+ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; -+ CLzmaProb isRep[kNumStates]; -+ CLzmaProb isRepG0[kNumStates]; -+ CLzmaProb isRepG1[kNumStates]; -+ CLzmaProb isRepG2[kNumStates]; -+ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; -+ -+ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; -+ CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; -+ CLzmaProb posAlignEncoder[1 << kNumAlignBits]; -+ -+ CLenPriceEnc lenEnc; -+ CLenPriceEnc repLenEnc; -+ -+ unsigned lclp; -+ -+ Bool fastMode; -+ -+ CRangeEnc rc; -+ -+ Bool writeEndMark; -+ UInt64 nowPos64; -+ UInt32 matchPriceCount; -+ Bool finished; -+ Bool multiThread; -+ -+ SRes result; -+ UInt32 dictSize; -+ UInt32 matchFinderCycles; -+ -+ ISeqInStream *inStream; -+ CSeqInStreamBuf seqBufInStream; -+ -+ CSaveState saveState; -+} CLzmaEnc; -+ -+static void LzmaEnc_SaveState(CLzmaEncHandle pp) -+{ -+ CLzmaEnc *p = (CLzmaEnc *)pp; -+ CSaveState *dest = &p->saveState; -+ int i; -+ dest->lenEnc = p->lenEnc; -+ dest->repLenEnc = p->repLenEnc; -+ dest->state = p->state; -+ -+ for (i = 0; i < kNumStates; i++) -+ { -+ memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); -+ memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); -+ } -+ for (i = 0; i < kNumLenToPosStates; i++) -+ memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); -+ memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); -+ memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); -+ memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); -+ memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); -+ memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); -+ memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); -+ memcpy(dest->reps, p->reps, sizeof(p->reps)); -+ memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb)); -+} -+ -+static void LzmaEnc_RestoreState(CLzmaEncHandle pp) -+{ -+ CLzmaEnc *dest = (CLzmaEnc *)pp; -+ const CSaveState *p = &dest->saveState; -+ int i; -+ dest->lenEnc = p->lenEnc; -+ dest->repLenEnc = p->repLenEnc; -+ dest->state = p->state; -+ -+ for (i = 0; i < kNumStates; i++) -+ { -+ memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); -+ memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); -+ } -+ for (i = 0; i < kNumLenToPosStates; i++) -+ memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); -+ memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); -+ memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); -+ memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); -+ memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); -+ memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); -+ memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); -+ memcpy(dest->reps, p->reps, sizeof(p->reps)); -+ memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb)); -+} -+ -+SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) -+{ -+ CLzmaEnc *p = (CLzmaEnc *)pp; -+ CLzmaEncProps props = *props2; -+ LzmaEncProps_Normalize(&props); -+ -+ if (props.lc > LZMA_LC_MAX || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX || -+ props.dictSize > (1 << kDicLogSizeMaxCompress) || props.dictSize > (1 << 30)) -+ return SZ_ERROR_PARAM; -+ p->dictSize = props.dictSize; -+ p->matchFinderCycles = props.mc; -+ { -+ unsigned fb = props.fb; -+ if (fb < 5) -+ fb = 5; -+ if (fb > LZMA_MATCH_LEN_MAX) -+ fb = LZMA_MATCH_LEN_MAX; -+ p->numFastBytes = fb; -+ } -+ p->lc = props.lc; -+ p->lp = props.lp; -+ p->pb = props.pb; -+ p->fastMode = (props.algo == 0); -+ p->matchFinderBase.btMode = props.btMode; -+ { -+ UInt32 numHashBytes = 4; -+ if (props.btMode) -+ { -+ if (props.numHashBytes < 2) -+ numHashBytes = 2; -+ else if (props.numHashBytes < 4) -+ numHashBytes = props.numHashBytes; -+ } -+ p->matchFinderBase.numHashBytes = numHashBytes; -+ } -+ -+ p->matchFinderBase.cutValue = props.mc; -+ -+ p->writeEndMark = props.writeEndMark; -+ -+ #ifdef COMPRESS_MF_MT -+ /* -+ if (newMultiThread != _multiThread) -+ { -+ ReleaseMatchFinder(); -+ _multiThread = newMultiThread; -+ } -+ */ -+ p->multiThread = (props.numThreads > 1); -+ #endif -+ -+ return SZ_OK; -+} -+ -+static const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}; -+static const int kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}; -+static const int kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}; -+static const int kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}; -+ -+/* -+ void UpdateChar() { Index = kLiteralNextStates[Index]; } -+ void UpdateMatch() { Index = kMatchNextStates[Index]; } -+ void UpdateRep() { Index = kRepNextStates[Index]; } -+ void UpdateShortRep() { Index = kShortRepNextStates[Index]; } -+*/ -+ -+#define IsCharState(s) ((s) < 7) -+ -+ -+#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1) -+ -+#define kInfinityPrice (1 << 30) -+ -+static void RangeEnc_Construct(CRangeEnc *p) -+{ -+ p->outStream = 0; -+ p->bufBase = 0; -+} -+ -+#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize) -+ -+#define RC_BUF_SIZE (1 << 16) -+static int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc) -+{ -+ if (p->bufBase == 0) -+ { -+ p->bufBase = (Byte *)alloc->Alloc(alloc, RC_BUF_SIZE); -+ if (p->bufBase == 0) -+ return 0; -+ p->bufLim = p->bufBase + RC_BUF_SIZE; -+ } -+ return 1; -+} -+ -+static void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc) -+{ -+ alloc->Free(alloc, p->bufBase); -+ p->bufBase = 0; -+} -+ -+static void RangeEnc_Init(CRangeEnc *p) -+{ -+ /* Stream.Init(); */ -+ p->low = 0; -+ p->range = 0xFFFFFFFF; -+ p->cacheSize = 1; -+ p->cache = 0; -+ -+ p->buf = p->bufBase; -+ -+ p->processed = 0; -+ p->res = SZ_OK; -+} -+ -+static void RangeEnc_FlushStream(CRangeEnc *p) -+{ -+ size_t num; -+ if (p->res != SZ_OK) -+ return; -+ num = p->buf - p->bufBase; -+ if (num != p->outStream->Write(p->outStream, p->bufBase, num)) -+ p->res = SZ_ERROR_WRITE; -+ p->processed += num; -+ p->buf = p->bufBase; -+} -+ -+static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p) -+{ -+ if ((UInt32)p->low < (UInt32)0xFF000000 || (int)(p->low >> 32) != 0) -+ { -+ Byte temp = p->cache; -+ do -+ { -+ Byte *buf = p->buf; -+ *buf++ = (Byte)(temp + (Byte)(p->low >> 32)); -+ p->buf = buf; -+ if (buf == p->bufLim) -+ RangeEnc_FlushStream(p); -+ temp = 0xFF; -+ } -+ while (--p->cacheSize != 0); -+ p->cache = (Byte)((UInt32)p->low >> 24); -+ } -+ p->cacheSize++; -+ p->low = (UInt32)p->low << 8; -+} -+ -+static void RangeEnc_FlushData(CRangeEnc *p) -+{ -+ int i; -+ for (i = 0; i < 5; i++) -+ RangeEnc_ShiftLow(p); -+} -+ -+static void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, int numBits) -+{ -+ do -+ { -+ p->range >>= 1; -+ p->low += p->range & (0 - ((value >> --numBits) & 1)); -+ if (p->range < kTopValue) -+ { -+ p->range <<= 8; -+ RangeEnc_ShiftLow(p); -+ } -+ } -+ while (numBits != 0); -+} -+ -+static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol) -+{ -+ UInt32 ttt = *prob; -+ UInt32 newBound = (p->range >> kNumBitModelTotalBits) * ttt; -+ if (symbol == 0) -+ { -+ p->range = newBound; -+ ttt += (kBitModelTotal - ttt) >> kNumMoveBits; -+ } -+ else -+ { -+ p->low += newBound; -+ p->range -= newBound; -+ ttt -= ttt >> kNumMoveBits; -+ } -+ *prob = (CLzmaProb)ttt; -+ if (p->range < kTopValue) -+ { -+ p->range <<= 8; -+ RangeEnc_ShiftLow(p); -+ } -+} -+ -+static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol) -+{ -+ symbol |= 0x100; -+ do -+ { -+ RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1); -+ symbol <<= 1; -+ } -+ while (symbol < 0x10000); -+} -+ -+static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte) -+{ -+ UInt32 offs = 0x100; -+ symbol |= 0x100; -+ do -+ { -+ matchByte <<= 1; -+ RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1); -+ symbol <<= 1; -+ offs &= ~(matchByte ^ symbol); -+ } -+ while (symbol < 0x10000); -+} -+ -+static void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) -+{ -+ UInt32 i; -+ for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits)) -+ { -+ const int kCyclesBits = kNumBitPriceShiftBits; -+ UInt32 w = i; -+ UInt32 bitCount = 0; -+ int j; -+ for (j = 0; j < kCyclesBits; j++) -+ { -+ w = w * w; -+ bitCount <<= 1; -+ while (w >= ((UInt32)1 << 16)) -+ { -+ w >>= 1; -+ bitCount++; -+ } -+ } -+ ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount); -+ } -+} -+ -+ -+#define GET_PRICE(prob, symbol) \ -+ p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; -+ -+#define GET_PRICEa(prob, symbol) \ -+ ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; -+ -+#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits] -+#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] -+ -+#define GET_PRICE_0a(prob) ProbPrices[(prob) >> kNumMoveReducingBits] -+#define GET_PRICE_1a(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] -+ -+static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices) -+{ -+ UInt32 price = 0; -+ symbol |= 0x100; -+ do -+ { -+ price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1); -+ symbol <<= 1; -+ } -+ while (symbol < 0x10000); -+ return price; -+}; -+ -+static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices) -+{ -+ UInt32 price = 0; -+ UInt32 offs = 0x100; -+ symbol |= 0x100; -+ do -+ { -+ matchByte <<= 1; -+ price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1); -+ symbol <<= 1; -+ offs &= ~(matchByte ^ symbol); -+ } -+ while (symbol < 0x10000); -+ return price; -+}; -+ -+ -+static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) -+{ -+ UInt32 m = 1; -+ int i; -+ for (i = numBitLevels; i != 0 ;) -+ { -+ UInt32 bit; -+ i--; -+ bit = (symbol >> i) & 1; -+ RangeEnc_EncodeBit(rc, probs + m, bit); -+ m = (m << 1) | bit; -+ } -+}; -+ -+static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) -+{ -+ UInt32 m = 1; -+ int i; -+ for (i = 0; i < numBitLevels; i++) -+ { -+ UInt32 bit = symbol & 1; -+ RangeEnc_EncodeBit(rc, probs + m, bit); -+ m = (m << 1) | bit; -+ symbol >>= 1; -+ } -+} -+ -+static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) -+{ -+ UInt32 price = 0; -+ symbol |= (1 << numBitLevels); -+ while (symbol != 1) -+ { -+ price += GET_PRICEa(probs[symbol >> 1], symbol & 1); -+ symbol >>= 1; -+ } -+ return price; -+} -+ -+static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) -+{ -+ UInt32 price = 0; -+ UInt32 m = 1; -+ int i; -+ for (i = numBitLevels; i != 0; i--) -+ { -+ UInt32 bit = symbol & 1; -+ symbol >>= 1; -+ price += GET_PRICEa(probs[m], bit); -+ m = (m << 1) | bit; -+ } -+ return price; -+} -+ -+ -+static void LenEnc_Init(CLenEnc *p) -+{ -+ unsigned i; -+ p->choice = p->choice2 = kProbInitValue; -+ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumLowBits); i++) -+ p->low[i] = kProbInitValue; -+ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumMidBits); i++) -+ p->mid[i] = kProbInitValue; -+ for (i = 0; i < kLenNumHighSymbols; i++) -+ p->high[i] = kProbInitValue; -+} -+ -+static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState) -+{ -+ if (symbol < kLenNumLowSymbols) -+ { -+ RangeEnc_EncodeBit(rc, &p->choice, 0); -+ RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol); -+ } -+ else -+ { -+ RangeEnc_EncodeBit(rc, &p->choice, 1); -+ if (symbol < kLenNumLowSymbols + kLenNumMidSymbols) -+ { -+ RangeEnc_EncodeBit(rc, &p->choice2, 0); -+ RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols); -+ } -+ else -+ { -+ RangeEnc_EncodeBit(rc, &p->choice2, 1); -+ RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols); -+ } -+ } -+} -+ -+static void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, UInt32 *ProbPrices) -+{ -+ UInt32 a0 = GET_PRICE_0a(p->choice); -+ UInt32 a1 = GET_PRICE_1a(p->choice); -+ UInt32 b0 = a1 + GET_PRICE_0a(p->choice2); -+ UInt32 b1 = a1 + GET_PRICE_1a(p->choice2); -+ UInt32 i = 0; -+ for (i = 0; i < kLenNumLowSymbols; i++) -+ { -+ if (i >= numSymbols) -+ return; -+ prices[i] = a0 + RcTree_GetPrice(p->low + (posState << kLenNumLowBits), kLenNumLowBits, i, ProbPrices); -+ } -+ for (; i < kLenNumLowSymbols + kLenNumMidSymbols; i++) -+ { -+ if (i >= numSymbols) -+ return; -+ prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << kLenNumMidBits), kLenNumMidBits, i - kLenNumLowSymbols, ProbPrices); -+ } -+ for (; i < numSymbols; i++) -+ prices[i] = b1 + RcTree_GetPrice(p->high, kLenNumHighBits, i - kLenNumLowSymbols - kLenNumMidSymbols, ProbPrices); -+} -+ -+static void MY_FAST_CALL LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, UInt32 *ProbPrices) -+{ -+ LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices); -+ p->counters[posState] = p->tableSize; -+} -+ -+static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, UInt32 *ProbPrices) -+{ -+ UInt32 posState; -+ for (posState = 0; posState < numPosStates; posState++) -+ LenPriceEnc_UpdateTable(p, posState, ProbPrices); -+} -+ -+static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices) -+{ -+ LenEnc_Encode(&p->p, rc, symbol, posState); -+ if (updatePrice) -+ if (--p->counters[posState] == 0) -+ LenPriceEnc_UpdateTable(p, posState, ProbPrices); -+} -+ -+ -+ -+ -+static void MovePos(CLzmaEnc *p, UInt32 num) -+{ -+ #ifdef SHOW_STAT -+ ttt += num; -+ printf("\n MovePos %d", num); -+ #endif -+ if (num != 0) -+ { -+ p->additionalOffset += num; -+ p->matchFinder.Skip(p->matchFinderObj, num); -+ } -+} -+ -+static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes) -+{ -+ UInt32 lenRes = 0, numDistancePairs; -+ numDistancePairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matchDistances); -+ #ifdef SHOW_STAT -+ printf("\n i = %d numPairs = %d ", ttt, numDistancePairs / 2); -+ if (ttt >= 61994) -+ ttt = ttt; -+ -+ ttt++; -+ { -+ UInt32 i; -+ for (i = 0; i < numDistancePairs; i += 2) -+ printf("%2d %6d | ", p->matchDistances[i], p->matchDistances[i + 1]); -+ } -+ #endif -+ if (numDistancePairs > 0) -+ { -+ lenRes = p->matchDistances[numDistancePairs - 2]; -+ if (lenRes == p->numFastBytes) -+ { -+ UInt32 numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) + 1; -+ const Byte *pby = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; -+ UInt32 distance = p->matchDistances[numDistancePairs - 1] + 1; -+ if (numAvail > LZMA_MATCH_LEN_MAX) -+ numAvail = LZMA_MATCH_LEN_MAX; -+ -+ { -+ const Byte *pby2 = pby - distance; -+ for (; lenRes < numAvail && pby[lenRes] == pby2[lenRes]; lenRes++); -+ } -+ } -+ } -+ p->additionalOffset++; -+ *numDistancePairsRes = numDistancePairs; -+ return lenRes; -+} -+ -+ -+#define MakeAsChar(p) (p)->backPrev = (UInt32)(-1); (p)->prev1IsChar = False; -+#define MakeAsShortRep(p) (p)->backPrev = 0; (p)->prev1IsChar = False; -+#define IsShortRep(p) ((p)->backPrev == 0) -+ -+static UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState) -+{ -+ return -+ GET_PRICE_0(p->isRepG0[state]) + -+ GET_PRICE_0(p->isRep0Long[state][posState]); -+} -+ -+static UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState) -+{ -+ UInt32 price; -+ if (repIndex == 0) -+ { -+ price = GET_PRICE_0(p->isRepG0[state]); -+ price += GET_PRICE_1(p->isRep0Long[state][posState]); -+ } -+ else -+ { -+ price = GET_PRICE_1(p->isRepG0[state]); -+ if (repIndex == 1) -+ price += GET_PRICE_0(p->isRepG1[state]); -+ else -+ { -+ price += GET_PRICE_1(p->isRepG1[state]); -+ price += GET_PRICE(p->isRepG2[state], repIndex - 2); -+ } -+ } -+ return price; -+} -+ -+static UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState) -+{ -+ return p->repLenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN] + -+ GetPureRepPrice(p, repIndex, state, posState); -+} -+ -+static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur) -+{ -+ UInt32 posMem = p->opt[cur].posPrev; -+ UInt32 backMem = p->opt[cur].backPrev; -+ p->optimumEndIndex = cur; -+ do -+ { -+ if (p->opt[cur].prev1IsChar) -+ { -+ MakeAsChar(&p->opt[posMem]) -+ p->opt[posMem].posPrev = posMem - 1; -+ if (p->opt[cur].prev2) -+ { -+ p->opt[posMem - 1].prev1IsChar = False; -+ p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2; -+ p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2; -+ } -+ } -+ { -+ UInt32 posPrev = posMem; -+ UInt32 backCur = backMem; -+ -+ backMem = p->opt[posPrev].backPrev; -+ posMem = p->opt[posPrev].posPrev; -+ -+ p->opt[posPrev].backPrev = backCur; -+ p->opt[posPrev].posPrev = cur; -+ cur = posPrev; -+ } -+ } -+ while (cur != 0); -+ *backRes = p->opt[0].backPrev; -+ p->optimumCurrentIndex = p->opt[0].posPrev; -+ return p->optimumCurrentIndex; -+} -+ -+#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * 0x300) -+ -+static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes) -+{ -+ UInt32 numAvailableBytes, lenMain, numDistancePairs; -+ const Byte *data; -+ UInt32 reps[LZMA_NUM_REPS]; -+ UInt32 repLens[LZMA_NUM_REPS]; -+ UInt32 repMaxIndex, i; -+ UInt32 *matchDistances; -+ Byte currentByte, matchByte; -+ UInt32 posState; -+ UInt32 matchPrice, repMatchPrice; -+ UInt32 lenEnd; -+ UInt32 len; -+ UInt32 normalMatchPrice; -+ UInt32 cur; -+ if (p->optimumEndIndex != p->optimumCurrentIndex) -+ { -+ const COptimal *opt = &p->opt[p->optimumCurrentIndex]; -+ UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex; -+ *backRes = opt->backPrev; -+ p->optimumCurrentIndex = opt->posPrev; -+ return lenRes; -+ } -+ p->optimumCurrentIndex = p->optimumEndIndex = 0; -+ -+ numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); -+ -+ if (!p->longestMatchWasFound) -+ { -+ lenMain = ReadMatchDistances(p, &numDistancePairs); -+ } -+ else -+ { -+ lenMain = p->longestMatchLength; -+ numDistancePairs = p->numDistancePairs; -+ p->longestMatchWasFound = False; -+ } -+ -+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; -+ if (numAvailableBytes < 2) -+ { -+ *backRes = (UInt32)(-1); -+ return 1; -+ } -+ if (numAvailableBytes > LZMA_MATCH_LEN_MAX) -+ numAvailableBytes = LZMA_MATCH_LEN_MAX; -+ -+ repMaxIndex = 0; -+ for (i = 0; i < LZMA_NUM_REPS; i++) -+ { -+ UInt32 lenTest; -+ const Byte *data2; -+ reps[i] = p->reps[i]; -+ data2 = data - (reps[i] + 1); -+ if (data[0] != data2[0] || data[1] != data2[1]) -+ { -+ repLens[i] = 0; -+ continue; -+ } -+ for (lenTest = 2; lenTest < numAvailableBytes && data[lenTest] == data2[lenTest]; lenTest++); -+ repLens[i] = lenTest; -+ if (lenTest > repLens[repMaxIndex]) -+ repMaxIndex = i; -+ } -+ if (repLens[repMaxIndex] >= p->numFastBytes) -+ { -+ UInt32 lenRes; -+ *backRes = repMaxIndex; -+ lenRes = repLens[repMaxIndex]; -+ MovePos(p, lenRes - 1); -+ return lenRes; -+ } -+ -+ matchDistances = p->matchDistances; -+ if (lenMain >= p->numFastBytes) -+ { -+ *backRes = matchDistances[numDistancePairs - 1] + LZMA_NUM_REPS; -+ MovePos(p, lenMain - 1); -+ return lenMain; -+ } -+ currentByte = *data; -+ matchByte = *(data - (reps[0] + 1)); -+ -+ if (lenMain < 2 && currentByte != matchByte && repLens[repMaxIndex] < 2) -+ { -+ *backRes = (UInt32)-1; -+ return 1; -+ } -+ -+ p->opt[0].state = (CState)p->state; -+ -+ posState = (position & p->pbMask); -+ -+ { -+ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); -+ p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) + -+ (!IsCharState(p->state) ? -+ LitEnc_GetPriceMatched(probs, currentByte, matchByte, p->ProbPrices) : -+ LitEnc_GetPrice(probs, currentByte, p->ProbPrices)); -+ } -+ -+ MakeAsChar(&p->opt[1]); -+ -+ matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]); -+ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]); -+ -+ if (matchByte == currentByte) -+ { -+ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState); -+ if (shortRepPrice < p->opt[1].price) -+ { -+ p->opt[1].price = shortRepPrice; -+ MakeAsShortRep(&p->opt[1]); -+ } -+ } -+ lenEnd = ((lenMain >= repLens[repMaxIndex]) ? lenMain : repLens[repMaxIndex]); -+ -+ if (lenEnd < 2) -+ { -+ *backRes = p->opt[1].backPrev; -+ return 1; -+ } -+ -+ p->opt[1].posPrev = 0; -+ for (i = 0; i < LZMA_NUM_REPS; i++) -+ p->opt[0].backs[i] = reps[i]; -+ -+ len = lenEnd; -+ do -+ p->opt[len--].price = kInfinityPrice; -+ while (len >= 2); -+ -+ for (i = 0; i < LZMA_NUM_REPS; i++) -+ { -+ UInt32 repLen = repLens[i]; -+ UInt32 price; -+ if (repLen < 2) -+ continue; -+ price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState); -+ do -+ { -+ UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2]; -+ COptimal *opt = &p->opt[repLen]; -+ if (curAndLenPrice < opt->price) -+ { -+ opt->price = curAndLenPrice; -+ opt->posPrev = 0; -+ opt->backPrev = i; -+ opt->prev1IsChar = False; -+ } -+ } -+ while (--repLen >= 2); -+ } -+ -+ normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]); -+ -+ len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2); -+ if (len <= lenMain) -+ { -+ UInt32 offs = 0; -+ while (len > matchDistances[offs]) -+ offs += 2; -+ for (; ; len++) -+ { -+ COptimal *opt; -+ UInt32 distance = matchDistances[offs + 1]; -+ -+ UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN]; -+ UInt32 lenToPosState = GetLenToPosState(len); -+ if (distance < kNumFullDistances) -+ curAndLenPrice += p->distancesPrices[lenToPosState][distance]; -+ else -+ { -+ UInt32 slot; -+ GetPosSlot2(distance, slot); -+ curAndLenPrice += p->alignPrices[distance & kAlignMask] + p->posSlotPrices[lenToPosState][slot]; -+ } -+ opt = &p->opt[len]; -+ if (curAndLenPrice < opt->price) -+ { -+ opt->price = curAndLenPrice; -+ opt->posPrev = 0; -+ opt->backPrev = distance + LZMA_NUM_REPS; -+ opt->prev1IsChar = False; -+ } -+ if (len == matchDistances[offs]) -+ { -+ offs += 2; -+ if (offs == numDistancePairs) -+ break; -+ } -+ } -+ } -+ -+ cur = 0; -+ -+ #ifdef SHOW_STAT2 -+ if (position >= 0) -+ { -+ unsigned i; -+ printf("\n pos = %4X", position); -+ for (i = cur; i <= lenEnd; i++) -+ printf("\nprice[%4X] = %d", position - cur + i, p->opt[i].price); -+ } -+ #endif -+ -+ for (;;) -+ { -+ UInt32 numAvailableBytesFull, newLen, numDistancePairs; -+ COptimal *curOpt; -+ UInt32 posPrev; -+ UInt32 state; -+ UInt32 curPrice; -+ Bool nextIsChar; -+ const Byte *data; -+ Byte currentByte, matchByte; -+ UInt32 posState; -+ UInt32 curAnd1Price; -+ COptimal *nextOpt; -+ UInt32 matchPrice, repMatchPrice; -+ UInt32 numAvailableBytes; -+ UInt32 startLen; -+ -+ cur++; -+ if (cur == lenEnd) -+ return Backward(p, backRes, cur); -+ -+ numAvailableBytesFull = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); -+ newLen = ReadMatchDistances(p, &numDistancePairs); -+ if (newLen >= p->numFastBytes) -+ { -+ p->numDistancePairs = numDistancePairs; -+ p->longestMatchLength = newLen; -+ p->longestMatchWasFound = True; -+ return Backward(p, backRes, cur); -+ } -+ position++; -+ curOpt = &p->opt[cur]; -+ posPrev = curOpt->posPrev; -+ if (curOpt->prev1IsChar) -+ { -+ posPrev--; -+ if (curOpt->prev2) -+ { -+ state = p->opt[curOpt->posPrev2].state; -+ if (curOpt->backPrev2 < LZMA_NUM_REPS) -+ state = kRepNextStates[state]; -+ else -+ state = kMatchNextStates[state]; -+ } -+ else -+ state = p->opt[posPrev].state; -+ state = kLiteralNextStates[state]; -+ } -+ else -+ state = p->opt[posPrev].state; -+ if (posPrev == cur - 1) -+ { -+ if (IsShortRep(curOpt)) -+ state = kShortRepNextStates[state]; -+ else -+ state = kLiteralNextStates[state]; -+ } -+ else -+ { -+ UInt32 pos; -+ const COptimal *prevOpt; -+ if (curOpt->prev1IsChar && curOpt->prev2) -+ { -+ posPrev = curOpt->posPrev2; -+ pos = curOpt->backPrev2; -+ state = kRepNextStates[state]; -+ } -+ else -+ { -+ pos = curOpt->backPrev; -+ if (pos < LZMA_NUM_REPS) -+ state = kRepNextStates[state]; -+ else -+ state = kMatchNextStates[state]; -+ } -+ prevOpt = &p->opt[posPrev]; -+ if (pos < LZMA_NUM_REPS) -+ { -+ UInt32 i; -+ reps[0] = prevOpt->backs[pos]; -+ for (i = 1; i <= pos; i++) -+ reps[i] = prevOpt->backs[i - 1]; -+ for (; i < LZMA_NUM_REPS; i++) -+ reps[i] = prevOpt->backs[i]; -+ } -+ else -+ { -+ UInt32 i; -+ reps[0] = (pos - LZMA_NUM_REPS); -+ for (i = 1; i < LZMA_NUM_REPS; i++) -+ reps[i] = prevOpt->backs[i - 1]; -+ } -+ } -+ curOpt->state = (CState)state; -+ -+ curOpt->backs[0] = reps[0]; -+ curOpt->backs[1] = reps[1]; -+ curOpt->backs[2] = reps[2]; -+ curOpt->backs[3] = reps[3]; -+ -+ curPrice = curOpt->price; -+ nextIsChar = False; -+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; -+ currentByte = *data; -+ matchByte = *(data - (reps[0] + 1)); -+ -+ posState = (position & p->pbMask); -+ -+ curAnd1Price = curPrice + GET_PRICE_0(p->isMatch[state][posState]); -+ { -+ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); -+ curAnd1Price += -+ (!IsCharState(state) ? -+ LitEnc_GetPriceMatched(probs, currentByte, matchByte, p->ProbPrices) : -+ LitEnc_GetPrice(probs, currentByte, p->ProbPrices)); -+ } -+ -+ nextOpt = &p->opt[cur + 1]; -+ -+ if (curAnd1Price < nextOpt->price) -+ { -+ nextOpt->price = curAnd1Price; -+ nextOpt->posPrev = cur; -+ MakeAsChar(nextOpt); -+ nextIsChar = True; -+ } -+ -+ matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]); -+ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]); -+ -+ if (matchByte == currentByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0)) -+ { -+ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState); -+ if (shortRepPrice <= nextOpt->price) -+ { -+ nextOpt->price = shortRepPrice; -+ nextOpt->posPrev = cur; -+ MakeAsShortRep(nextOpt); -+ nextIsChar = True; -+ } -+ } -+ -+ { -+ UInt32 temp = kNumOpts - 1 - cur; -+ if (temp < numAvailableBytesFull) -+ numAvailableBytesFull = temp; -+ } -+ numAvailableBytes = numAvailableBytesFull; -+ -+ if (numAvailableBytes < 2) -+ continue; -+ if (numAvailableBytes > p->numFastBytes) -+ numAvailableBytes = p->numFastBytes; -+ if (!nextIsChar && matchByte != currentByte) /* speed optimization */ -+ { -+ /* try Literal + rep0 */ -+ UInt32 temp; -+ UInt32 lenTest2; -+ const Byte *data2 = data - (reps[0] + 1); -+ UInt32 limit = p->numFastBytes + 1; -+ if (limit > numAvailableBytesFull) -+ limit = numAvailableBytesFull; -+ -+ for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++); -+ lenTest2 = temp - 1; -+ if (lenTest2 >= 2) -+ { -+ UInt32 state2 = kLiteralNextStates[state]; -+ UInt32 posStateNext = (position + 1) & p->pbMask; -+ UInt32 nextRepMatchPrice = curAnd1Price + -+ GET_PRICE_1(p->isMatch[state2][posStateNext]) + -+ GET_PRICE_1(p->isRep[state2]); -+ /* for (; lenTest2 >= 2; lenTest2--) */ -+ { -+ UInt32 curAndLenPrice; -+ COptimal *opt; -+ UInt32 offset = cur + 1 + lenTest2; -+ while (lenEnd < offset) -+ p->opt[++lenEnd].price = kInfinityPrice; -+ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); -+ opt = &p->opt[offset]; -+ if (curAndLenPrice < opt->price) -+ { -+ opt->price = curAndLenPrice; -+ opt->posPrev = cur + 1; -+ opt->backPrev = 0; -+ opt->prev1IsChar = True; -+ opt->prev2 = False; -+ } -+ } -+ } -+ } -+ -+ startLen = 2; /* speed optimization */ -+ { -+ UInt32 repIndex; -+ for (repIndex = 0; repIndex < LZMA_NUM_REPS; repIndex++) -+ { -+ UInt32 lenTest; -+ UInt32 lenTestTemp; -+ UInt32 price; -+ const Byte *data2 = data - (reps[repIndex] + 1); -+ if (data[0] != data2[0] || data[1] != data2[1]) -+ continue; -+ for (lenTest = 2; lenTest < numAvailableBytes && data[lenTest] == data2[lenTest]; lenTest++); -+ while (lenEnd < cur + lenTest) -+ p->opt[++lenEnd].price = kInfinityPrice; -+ lenTestTemp = lenTest; -+ price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState); -+ do -+ { -+ UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2]; -+ COptimal *opt = &p->opt[cur + lenTest]; -+ if (curAndLenPrice < opt->price) -+ { -+ opt->price = curAndLenPrice; -+ opt->posPrev = cur; -+ opt->backPrev = repIndex; -+ opt->prev1IsChar = False; -+ } -+ } -+ while (--lenTest >= 2); -+ lenTest = lenTestTemp; -+ -+ if (repIndex == 0) -+ startLen = lenTest + 1; -+ -+ /* if (_maxMode) */ -+ { -+ UInt32 lenTest2 = lenTest + 1; -+ UInt32 limit = lenTest2 + p->numFastBytes; -+ UInt32 nextRepMatchPrice; -+ if (limit > numAvailableBytesFull) -+ limit = numAvailableBytesFull; -+ for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); -+ lenTest2 -= lenTest + 1; -+ if (lenTest2 >= 2) -+ { -+ UInt32 state2 = kRepNextStates[state]; -+ UInt32 posStateNext = (position + lenTest) & p->pbMask; -+ UInt32 curAndLenCharPrice = -+ price + p->repLenEnc.prices[posState][lenTest - 2] + -+ GET_PRICE_0(p->isMatch[state2][posStateNext]) + -+ LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), -+ data[lenTest], data2[lenTest], p->ProbPrices); -+ state2 = kLiteralNextStates[state2]; -+ posStateNext = (position + lenTest + 1) & p->pbMask; -+ nextRepMatchPrice = curAndLenCharPrice + -+ GET_PRICE_1(p->isMatch[state2][posStateNext]) + -+ GET_PRICE_1(p->isRep[state2]); -+ -+ /* for (; lenTest2 >= 2; lenTest2--) */ -+ { -+ UInt32 curAndLenPrice; -+ COptimal *opt; -+ UInt32 offset = cur + lenTest + 1 + lenTest2; -+ while (lenEnd < offset) -+ p->opt[++lenEnd].price = kInfinityPrice; -+ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); -+ opt = &p->opt[offset]; -+ if (curAndLenPrice < opt->price) -+ { -+ opt->price = curAndLenPrice; -+ opt->posPrev = cur + lenTest + 1; -+ opt->backPrev = 0; -+ opt->prev1IsChar = True; -+ opt->prev2 = True; -+ opt->posPrev2 = cur; -+ opt->backPrev2 = repIndex; -+ } -+ } -+ } -+ } -+ } -+ } -+ /* for (UInt32 lenTest = 2; lenTest <= newLen; lenTest++) */ -+ if (newLen > numAvailableBytes) -+ { -+ newLen = numAvailableBytes; -+ for (numDistancePairs = 0; newLen > matchDistances[numDistancePairs]; numDistancePairs += 2); -+ matchDistances[numDistancePairs] = newLen; -+ numDistancePairs += 2; -+ } -+ if (newLen >= startLen) -+ { -+ UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]); -+ UInt32 offs, curBack, posSlot; -+ UInt32 lenTest; -+ while (lenEnd < cur + newLen) -+ p->opt[++lenEnd].price = kInfinityPrice; -+ -+ offs = 0; -+ while (startLen > matchDistances[offs]) -+ offs += 2; -+ curBack = matchDistances[offs + 1]; -+ GetPosSlot2(curBack, posSlot); -+ for (lenTest = /*2*/ startLen; ; lenTest++) -+ { -+ UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN]; -+ UInt32 lenToPosState = GetLenToPosState(lenTest); -+ COptimal *opt; -+ if (curBack < kNumFullDistances) -+ curAndLenPrice += p->distancesPrices[lenToPosState][curBack]; -+ else -+ curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & kAlignMask]; -+ -+ opt = &p->opt[cur + lenTest]; -+ if (curAndLenPrice < opt->price) -+ { -+ opt->price = curAndLenPrice; -+ opt->posPrev = cur; -+ opt->backPrev = curBack + LZMA_NUM_REPS; -+ opt->prev1IsChar = False; -+ } -+ -+ if (/*_maxMode && */lenTest == matchDistances[offs]) -+ { -+ /* Try Match + Literal + Rep0 */ -+ const Byte *data2 = data - (curBack + 1); -+ UInt32 lenTest2 = lenTest + 1; -+ UInt32 limit = lenTest2 + p->numFastBytes; -+ UInt32 nextRepMatchPrice; -+ if (limit > numAvailableBytesFull) -+ limit = numAvailableBytesFull; -+ for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); -+ lenTest2 -= lenTest + 1; -+ if (lenTest2 >= 2) -+ { -+ UInt32 state2 = kMatchNextStates[state]; -+ UInt32 posStateNext = (position + lenTest) & p->pbMask; -+ UInt32 curAndLenCharPrice = curAndLenPrice + -+ GET_PRICE_0(p->isMatch[state2][posStateNext]) + -+ LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), -+ data[lenTest], data2[lenTest], p->ProbPrices); -+ state2 = kLiteralNextStates[state2]; -+ posStateNext = (posStateNext + 1) & p->pbMask; -+ nextRepMatchPrice = curAndLenCharPrice + -+ GET_PRICE_1(p->isMatch[state2][posStateNext]) + -+ GET_PRICE_1(p->isRep[state2]); -+ -+ /* for (; lenTest2 >= 2; lenTest2--) */ -+ { -+ UInt32 offset = cur + lenTest + 1 + lenTest2; -+ UInt32 curAndLenPrice; -+ COptimal *opt; -+ while (lenEnd < offset) -+ p->opt[++lenEnd].price = kInfinityPrice; -+ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); -+ opt = &p->opt[offset]; -+ if (curAndLenPrice < opt->price) -+ { -+ opt->price = curAndLenPrice; -+ opt->posPrev = cur + lenTest + 1; -+ opt->backPrev = 0; -+ opt->prev1IsChar = True; -+ opt->prev2 = True; -+ opt->posPrev2 = cur; -+ opt->backPrev2 = curBack + LZMA_NUM_REPS; -+ } -+ } -+ } -+ offs += 2; -+ if (offs == numDistancePairs) -+ break; -+ curBack = matchDistances[offs + 1]; -+ if (curBack >= kNumFullDistances) -+ GetPosSlot2(curBack, posSlot); -+ } -+ } -+ } -+ } -+} -+ -+#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist)) -+ -+static UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes) -+{ -+ UInt32 numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); -+ UInt32 lenMain, numDistancePairs; -+ const Byte *data; -+ UInt32 repLens[LZMA_NUM_REPS]; -+ UInt32 repMaxIndex, i; -+ UInt32 *matchDistances; -+ UInt32 backMain; -+ -+ if (!p->longestMatchWasFound) -+ { -+ lenMain = ReadMatchDistances(p, &numDistancePairs); -+ } -+ else -+ { -+ lenMain = p->longestMatchLength; -+ numDistancePairs = p->numDistancePairs; -+ p->longestMatchWasFound = False; -+ } -+ -+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; -+ if (numAvailableBytes > LZMA_MATCH_LEN_MAX) -+ numAvailableBytes = LZMA_MATCH_LEN_MAX; -+ if (numAvailableBytes < 2) -+ { -+ *backRes = (UInt32)(-1); -+ return 1; -+ } -+ -+ repMaxIndex = 0; -+ -+ for (i = 0; i < LZMA_NUM_REPS; i++) -+ { -+ const Byte *data2 = data - (p->reps[i] + 1); -+ UInt32 len; -+ if (data[0] != data2[0] || data[1] != data2[1]) -+ { -+ repLens[i] = 0; -+ continue; -+ } -+ for (len = 2; len < numAvailableBytes && data[len] == data2[len]; len++); -+ if (len >= p->numFastBytes) -+ { -+ *backRes = i; -+ MovePos(p, len - 1); -+ return len; -+ } -+ repLens[i] = len; -+ if (len > repLens[repMaxIndex]) -+ repMaxIndex = i; -+ } -+ matchDistances = p->matchDistances; -+ if (lenMain >= p->numFastBytes) -+ { -+ *backRes = matchDistances[numDistancePairs - 1] + LZMA_NUM_REPS; -+ MovePos(p, lenMain - 1); -+ return lenMain; -+ } -+ -+ backMain = 0; /* for GCC */ -+ if (lenMain >= 2) -+ { -+ backMain = matchDistances[numDistancePairs - 1]; -+ while (numDistancePairs > 2 && lenMain == matchDistances[numDistancePairs - 4] + 1) -+ { -+ if (!ChangePair(matchDistances[numDistancePairs - 3], backMain)) -+ break; -+ numDistancePairs -= 2; -+ lenMain = matchDistances[numDistancePairs - 2]; -+ backMain = matchDistances[numDistancePairs - 1]; -+ } -+ if (lenMain == 2 && backMain >= 0x80) -+ lenMain = 1; -+ } -+ -+ if (repLens[repMaxIndex] >= 2) -+ { -+ if (repLens[repMaxIndex] + 1 >= lenMain || -+ (repLens[repMaxIndex] + 2 >= lenMain && (backMain > (1 << 9))) || -+ (repLens[repMaxIndex] + 3 >= lenMain && (backMain > (1 << 15)))) -+ { -+ UInt32 lenRes; -+ *backRes = repMaxIndex; -+ lenRes = repLens[repMaxIndex]; -+ MovePos(p, lenRes - 1); -+ return lenRes; -+ } -+ } -+ -+ if (lenMain >= 2 && numAvailableBytes > 2) -+ { -+ UInt32 i; -+ numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); -+ p->longestMatchLength = ReadMatchDistances(p, &p->numDistancePairs); -+ if (p->longestMatchLength >= 2) -+ { -+ UInt32 newDistance = matchDistances[p->numDistancePairs - 1]; -+ if ((p->longestMatchLength >= lenMain && newDistance < backMain) || -+ (p->longestMatchLength == lenMain + 1 && !ChangePair(backMain, newDistance)) || -+ (p->longestMatchLength > lenMain + 1) || -+ (p->longestMatchLength + 1 >= lenMain && lenMain >= 3 && ChangePair(newDistance, backMain))) -+ { -+ p->longestMatchWasFound = True; -+ *backRes = (UInt32)(-1); -+ return 1; -+ } -+ } -+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; -+ for (i = 0; i < LZMA_NUM_REPS; i++) -+ { -+ UInt32 len; -+ const Byte *data2 = data - (p->reps[i] + 1); -+ if (data[1] != data2[1] || data[2] != data2[2]) -+ { -+ repLens[i] = 0; -+ continue; -+ } -+ for (len = 2; len < numAvailableBytes && data[len] == data2[len]; len++); -+ if (len + 1 >= lenMain) -+ { -+ p->longestMatchWasFound = True; -+ *backRes = (UInt32)(-1); -+ return 1; -+ } -+ } -+ *backRes = backMain + LZMA_NUM_REPS; -+ MovePos(p, lenMain - 2); -+ return lenMain; -+ } -+ *backRes = (UInt32)(-1); -+ return 1; -+} -+ -+static void WriteEndMarker(CLzmaEnc *p, UInt32 posState) -+{ -+ UInt32 len; -+ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); -+ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); -+ p->state = kMatchNextStates[p->state]; -+ len = LZMA_MATCH_LEN_MIN; -+ LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); -+ RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, (1 << kNumPosSlotBits) - 1); -+ RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> kNumAlignBits, 30 - kNumAlignBits); -+ RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask); -+} -+ -+static SRes CheckErrors(CLzmaEnc *p) -+{ -+ if (p->result != SZ_OK) -+ return p->result; -+ if (p->rc.res != SZ_OK) -+ p->result = SZ_ERROR_WRITE; -+ if (p->matchFinderBase.result != SZ_OK) -+ p->result = SZ_ERROR_READ; -+ if (p->result != SZ_OK) -+ p->finished = True; -+ return p->result; -+} -+ -+static SRes Flush(CLzmaEnc *p, UInt32 nowPos) -+{ -+ /* ReleaseMFStream(); */ -+ p->finished = True; -+ if (p->writeEndMark) -+ WriteEndMarker(p, nowPos & p->pbMask); -+ RangeEnc_FlushData(&p->rc); -+ RangeEnc_FlushStream(&p->rc); -+ return CheckErrors(p); -+} -+ -+static void FillAlignPrices(CLzmaEnc *p) -+{ -+ UInt32 i; -+ for (i = 0; i < kAlignTableSize; i++) -+ p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices); -+ p->alignPriceCount = 0; -+} -+ -+static void FillDistancesPrices(CLzmaEnc *p) -+{ -+ UInt32 tempPrices[kNumFullDistances]; -+ UInt32 i, lenToPosState; -+ for (i = kStartPosModelIndex; i < kNumFullDistances; i++) -+ { -+ UInt32 posSlot = GetPosSlot1(i); -+ UInt32 footerBits = ((posSlot >> 1) - 1); -+ UInt32 base = ((2 | (posSlot & 1)) << footerBits); -+ tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices); -+ } -+ -+ for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++) -+ { -+ UInt32 posSlot; -+ const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState]; -+ UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState]; -+ for (posSlot = 0; posSlot < p->distTableSize; posSlot++) -+ posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices); -+ for (posSlot = kEndPosModelIndex; posSlot < p->distTableSize; posSlot++) -+ posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits); -+ -+ { -+ UInt32 *distancesPrices = p->distancesPrices[lenToPosState]; -+ UInt32 i; -+ for (i = 0; i < kStartPosModelIndex; i++) -+ distancesPrices[i] = posSlotPrices[i]; -+ for (; i < kNumFullDistances; i++) -+ distancesPrices[i] = posSlotPrices[GetPosSlot1(i)] + tempPrices[i]; -+ } -+ } -+ p->matchPriceCount = 0; -+} -+ -+static void LzmaEnc_Construct(CLzmaEnc *p) -+{ -+ RangeEnc_Construct(&p->rc); -+ MatchFinder_Construct(&p->matchFinderBase); -+ #ifdef COMPRESS_MF_MT -+ MatchFinderMt_Construct(&p->matchFinderMt); -+ p->matchFinderMt.MatchFinder = &p->matchFinderBase; -+ #endif -+ -+ { -+ CLzmaEncProps props; -+ LzmaEncProps_Init(&props); -+ LzmaEnc_SetProps(p, &props); -+ } -+ -+ #ifndef LZMA_LOG_BSR -+ LzmaEnc_FastPosInit(p->g_FastPos); -+ #endif -+ -+ LzmaEnc_InitPriceTables(p->ProbPrices); -+ p->litProbs = 0; -+ p->saveState.litProbs = 0; -+} -+ -+CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc) -+{ -+ void *p; -+ p = alloc->Alloc(alloc, sizeof(CLzmaEnc)); -+ if (p != 0) -+ LzmaEnc_Construct((CLzmaEnc *)p); -+ return p; -+} -+ -+static void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) -+{ -+ alloc->Free(alloc, p->litProbs); -+ alloc->Free(alloc, p->saveState.litProbs); -+ p->litProbs = 0; -+ p->saveState.litProbs = 0; -+} -+ -+static void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) -+{ -+ #ifdef COMPRESS_MF_MT -+ MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); -+ #endif -+ MatchFinder_Free(&p->matchFinderBase, allocBig); -+ LzmaEnc_FreeLits(p, alloc); -+ RangeEnc_Free(&p->rc, alloc); -+} -+ -+void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig) -+{ -+ LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig); -+ alloc->Free(alloc, p); -+} -+ -+static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize) -+{ -+ UInt32 nowPos32, startPos32; -+ if (p->inStream != 0) -+ { -+ p->matchFinderBase.stream = p->inStream; -+ p->matchFinder.Init(p->matchFinderObj); -+ p->inStream = 0; -+ } -+ -+ if (p->finished) -+ return p->result; -+ RINOK(CheckErrors(p)); -+ -+ nowPos32 = (UInt32)p->nowPos64; -+ startPos32 = nowPos32; -+ -+ if (p->nowPos64 == 0) -+ { -+ UInt32 numDistancePairs; -+ Byte curByte; -+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) -+ return Flush(p, nowPos32); -+ ReadMatchDistances(p, &numDistancePairs); -+ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0); -+ p->state = kLiteralNextStates[p->state]; -+ curByte = p->matchFinder.GetIndexByte(p->matchFinderObj, 0 - p->additionalOffset); -+ LitEnc_Encode(&p->rc, p->litProbs, curByte); -+ p->additionalOffset--; -+ nowPos32++; -+ } -+ -+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0) -+ for (;;) -+ { -+ UInt32 pos, len, posState; -+ -+ if (p->fastMode) -+ len = GetOptimumFast(p, &pos); -+ else -+ len = GetOptimum(p, nowPos32, &pos); -+ -+ #ifdef SHOW_STAT2 -+ printf("\n pos = %4X, len = %d pos = %d", nowPos32, len, pos); -+ #endif -+ -+ posState = nowPos32 & p->pbMask; -+ if (len == 1 && pos == 0xFFFFFFFF) -+ { -+ Byte curByte; -+ CLzmaProb *probs; -+ const Byte *data; -+ -+ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0); -+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; -+ curByte = *data; -+ probs = LIT_PROBS(nowPos32, *(data - 1)); -+ if (IsCharState(p->state)) -+ LitEnc_Encode(&p->rc, probs, curByte); -+ else -+ LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1)); -+ p->state = kLiteralNextStates[p->state]; -+ } -+ else -+ { -+ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); -+ if (pos < LZMA_NUM_REPS) -+ { -+ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1); -+ if (pos == 0) -+ { -+ RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0); -+ RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1)); -+ } -+ else -+ { -+ UInt32 distance = p->reps[pos]; -+ RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1); -+ if (pos == 1) -+ RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0); -+ else -+ { -+ RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1); -+ RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2); -+ if (pos == 3) -+ p->reps[3] = p->reps[2]; -+ p->reps[2] = p->reps[1]; -+ } -+ p->reps[1] = p->reps[0]; -+ p->reps[0] = distance; -+ } -+ if (len == 1) -+ p->state = kShortRepNextStates[p->state]; -+ else -+ { -+ LenEnc_Encode2(&p->repLenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); -+ p->state = kRepNextStates[p->state]; -+ } -+ } -+ else -+ { -+ UInt32 posSlot; -+ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); -+ p->state = kMatchNextStates[p->state]; -+ LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); -+ pos -= LZMA_NUM_REPS; -+ GetPosSlot(pos, posSlot); -+ RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, posSlot); -+ -+ if (posSlot >= kStartPosModelIndex) -+ { -+ UInt32 footerBits = ((posSlot >> 1) - 1); -+ UInt32 base = ((2 | (posSlot & 1)) << footerBits); -+ UInt32 posReduced = pos - base; -+ -+ if (posSlot < kEndPosModelIndex) -+ RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced); -+ else -+ { -+ RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits); -+ RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask); -+ p->alignPriceCount++; -+ } -+ } -+ p->reps[3] = p->reps[2]; -+ p->reps[2] = p->reps[1]; -+ p->reps[1] = p->reps[0]; -+ p->reps[0] = pos; -+ p->matchPriceCount++; -+ } -+ } -+ p->additionalOffset -= len; -+ nowPos32 += len; -+ if (p->additionalOffset == 0) -+ { -+ UInt32 processed; -+ if (!p->fastMode) -+ { -+ if (p->matchPriceCount >= (1 << 7)) -+ FillDistancesPrices(p); -+ if (p->alignPriceCount >= kAlignTableSize) -+ FillAlignPrices(p); -+ } -+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) -+ break; -+ processed = nowPos32 - startPos32; -+ if (useLimits) -+ { -+ if (processed + kNumOpts + 300 >= maxUnpackSize || -+ RangeEnc_GetProcessed(&p->rc) + kNumOpts * 2 >= maxPackSize) -+ break; -+ } -+ else if (processed >= (1 << 15)) -+ { -+ p->nowPos64 += nowPos32 - startPos32; -+ return CheckErrors(p); -+ } -+ } -+ } -+ p->nowPos64 += nowPos32 - startPos32; -+ return Flush(p, nowPos32); -+} -+ -+#define kBigHashDicLimit ((UInt32)1 << 24) -+ -+static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) -+{ -+ UInt32 beforeSize = kNumOpts; -+ Bool btMode; -+ if (!RangeEnc_Alloc(&p->rc, alloc)) -+ return SZ_ERROR_MEM; -+ btMode = (p->matchFinderBase.btMode != 0); -+ #ifdef COMPRESS_MF_MT -+ p->mtMode = (p->multiThread && !p->fastMode && btMode); -+ #endif -+ -+ { -+ unsigned lclp = p->lc + p->lp; -+ if (p->litProbs == 0 || p->saveState.litProbs == 0 || p->lclp != lclp) -+ { -+ LzmaEnc_FreeLits(p, alloc); -+ p->litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); -+ p->saveState.litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); -+ if (p->litProbs == 0 || p->saveState.litProbs == 0) -+ { -+ LzmaEnc_FreeLits(p, alloc); -+ return SZ_ERROR_MEM; -+ } -+ p->lclp = lclp; -+ } -+ } -+ -+ p->matchFinderBase.bigHash = (p->dictSize > kBigHashDicLimit); -+ -+ if (beforeSize + p->dictSize < keepWindowSize) -+ beforeSize = keepWindowSize - p->dictSize; -+ -+ #ifdef COMPRESS_MF_MT -+ if (p->mtMode) -+ { -+ RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)); -+ p->matchFinderObj = &p->matchFinderMt; -+ MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder); -+ } -+ else -+ #endif -+ { -+ if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)) -+ return SZ_ERROR_MEM; -+ p->matchFinderObj = &p->matchFinderBase; -+ MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder); -+ } -+ return SZ_OK; -+} -+ -+static void LzmaEnc_Init(CLzmaEnc *p) -+{ -+ UInt32 i; -+ p->state = 0; -+ for(i = 0 ; i < LZMA_NUM_REPS; i++) -+ p->reps[i] = 0; -+ -+ RangeEnc_Init(&p->rc); -+ -+ -+ for (i = 0; i < kNumStates; i++) -+ { -+ UInt32 j; -+ for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++) -+ { -+ p->isMatch[i][j] = kProbInitValue; -+ p->isRep0Long[i][j] = kProbInitValue; -+ } -+ p->isRep[i] = kProbInitValue; -+ p->isRepG0[i] = kProbInitValue; -+ p->isRepG1[i] = kProbInitValue; -+ p->isRepG2[i] = kProbInitValue; -+ } -+ -+ { -+ UInt32 num = 0x300 << (p->lp + p->lc); -+ for (i = 0; i < num; i++) -+ p->litProbs[i] = kProbInitValue; -+ } -+ -+ { -+ for (i = 0; i < kNumLenToPosStates; i++) -+ { -+ CLzmaProb *probs = p->posSlotEncoder[i]; -+ UInt32 j; -+ for (j = 0; j < (1 << kNumPosSlotBits); j++) -+ probs[j] = kProbInitValue; -+ } -+ } -+ { -+ for(i = 0; i < kNumFullDistances - kEndPosModelIndex; i++) -+ p->posEncoders[i] = kProbInitValue; -+ } -+ -+ LenEnc_Init(&p->lenEnc.p); -+ LenEnc_Init(&p->repLenEnc.p); -+ -+ for (i = 0; i < (1 << kNumAlignBits); i++) -+ p->posAlignEncoder[i] = kProbInitValue; -+ -+ p->longestMatchWasFound = False; -+ p->optimumEndIndex = 0; -+ p->optimumCurrentIndex = 0; -+ p->additionalOffset = 0; -+ -+ p->pbMask = (1 << p->pb) - 1; -+ p->lpMask = (1 << p->lp) - 1; -+} -+ -+static void LzmaEnc_InitPrices(CLzmaEnc *p) -+{ -+ if (!p->fastMode) -+ { -+ FillDistancesPrices(p); -+ FillAlignPrices(p); -+ } -+ -+ p->lenEnc.tableSize = -+ p->repLenEnc.tableSize = -+ p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN; -+ LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices); -+ LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices); -+} -+ -+static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) -+{ -+ UInt32 i; -+ for (i = 0; i < (UInt32)kDicLogSizeMaxCompress; i++) -+ if (p->dictSize <= ((UInt32)1 << i)) -+ break; -+ p->distTableSize = i * 2; -+ -+ p->finished = False; -+ p->result = SZ_OK; -+ RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig)); -+ LzmaEnc_Init(p); -+ LzmaEnc_InitPrices(p); -+ p->nowPos64 = 0; -+ return SZ_OK; -+} -+ -+static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqInStream *inStream, ISeqOutStream *outStream, -+ ISzAlloc *alloc, ISzAlloc *allocBig) -+{ -+ CLzmaEnc *p = (CLzmaEnc *)pp; -+ p->inStream = inStream; -+ p->rc.outStream = outStream; -+ return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); -+} -+ -+static SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, -+ ISeqInStream *inStream, UInt32 keepWindowSize, -+ ISzAlloc *alloc, ISzAlloc *allocBig) -+{ -+ CLzmaEnc *p = (CLzmaEnc *)pp; -+ p->inStream = inStream; -+ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); -+} -+ -+static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen) -+{ -+ p->seqBufInStream.funcTable.Read = MyRead; -+ p->seqBufInStream.data = src; -+ p->seqBufInStream.rem = srcLen; -+} -+ -+static SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, -+ UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) -+{ -+ CLzmaEnc *p = (CLzmaEnc *)pp; -+ LzmaEnc_SetInputBuf(p, src, srcLen); -+ p->inStream = &p->seqBufInStream.funcTable; -+ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); -+} -+ -+static void LzmaEnc_Finish(CLzmaEncHandle pp) -+{ -+ #ifdef COMPRESS_MF_MT -+ CLzmaEnc *p = (CLzmaEnc *)pp; -+ if (p->mtMode) -+ MatchFinderMt_ReleaseStream(&p->matchFinderMt); -+ #endif -+} -+ -+typedef struct _CSeqOutStreamBuf -+{ -+ ISeqOutStream funcTable; -+ Byte *data; -+ SizeT rem; -+ Bool overflow; -+} CSeqOutStreamBuf; -+ -+static size_t MyWrite(void *pp, const void *data, size_t size) -+{ -+ CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp; -+ if (p->rem < size) -+ { -+ size = p->rem; -+ p->overflow = True; -+ } -+ memcpy(p->data, data, size); -+ p->rem -= size; -+ p->data += size; -+ return size; -+} -+ -+ -+static UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) -+{ -+ const CLzmaEnc *p = (CLzmaEnc *)pp; -+ return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); -+} -+ -+static const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) -+{ -+ const CLzmaEnc *p = (CLzmaEnc *)pp; -+ return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; -+} -+ -+static SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, -+ Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) -+{ -+ CLzmaEnc *p = (CLzmaEnc *)pp; -+ UInt64 nowPos64; -+ SRes res; -+ CSeqOutStreamBuf outStream; -+ -+ outStream.funcTable.Write = MyWrite; -+ outStream.data = dest; -+ outStream.rem = *destLen; -+ outStream.overflow = False; -+ -+ p->writeEndMark = False; -+ p->finished = False; -+ p->result = SZ_OK; -+ -+ if (reInit) -+ LzmaEnc_Init(p); -+ LzmaEnc_InitPrices(p); -+ nowPos64 = p->nowPos64; -+ RangeEnc_Init(&p->rc); -+ p->rc.outStream = &outStream.funcTable; -+ -+ res = LzmaEnc_CodeOneBlock(pp, True, desiredPackSize, *unpackSize); -+ -+ *unpackSize = (UInt32)(p->nowPos64 - nowPos64); -+ *destLen -= outStream.rem; -+ if (outStream.overflow) -+ return SZ_ERROR_OUTPUT_EOF; -+ -+ return res; -+} -+ -+SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, -+ ISzAlloc *alloc, ISzAlloc *allocBig) -+{ -+ CLzmaEnc *p = (CLzmaEnc *)pp; -+ SRes res = SZ_OK; -+ -+ #ifdef COMPRESS_MF_MT -+ Byte allocaDummy[0x300]; -+ int i = 0; -+ for (i = 0; i < 16; i++) -+ allocaDummy[i] = (Byte)i; -+ #endif -+ -+ RINOK(LzmaEnc_Prepare(pp, inStream, outStream, alloc, allocBig)); -+ -+ for (;;) -+ { -+ res = LzmaEnc_CodeOneBlock(pp, False, 0, 0); -+ if (res != SZ_OK || p->finished != 0) -+ break; -+ if (progress != 0) -+ { -+ res = progress->Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc)); -+ if (res != SZ_OK) -+ { -+ res = SZ_ERROR_PROGRESS; -+ break; -+ } -+ } -+ } -+ LzmaEnc_Finish(pp); -+ return res; -+} -+ -+SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size) -+{ -+ CLzmaEnc *p = (CLzmaEnc *)pp; -+ int i; -+ UInt32 dictSize = p->dictSize; -+ if (*size < LZMA_PROPS_SIZE) -+ return SZ_ERROR_PARAM; -+ *size = LZMA_PROPS_SIZE; -+ props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc); -+ -+ for (i = 11; i <= 30; i++) -+ { -+ if (dictSize <= ((UInt32)2 << i)) -+ { -+ dictSize = (2 << i); -+ break; -+ } -+ if (dictSize <= ((UInt32)3 << i)) -+ { -+ dictSize = (3 << i); -+ break; -+ } -+ } -+ -+ for (i = 0; i < 4; i++) -+ props[1 + i] = (Byte)(dictSize >> (8 * i)); -+ return SZ_OK; -+} -+ -+SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, -+ int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) -+{ -+ SRes res; -+ CLzmaEnc *p = (CLzmaEnc *)pp; -+ -+ CSeqOutStreamBuf outStream; -+ -+ LzmaEnc_SetInputBuf(p, src, srcLen); -+ -+ outStream.funcTable.Write = MyWrite; -+ outStream.data = dest; -+ outStream.rem = *destLen; -+ outStream.overflow = False; -+ -+ p->writeEndMark = writeEndMark; -+ res = LzmaEnc_Encode(pp, &outStream.funcTable, &p->seqBufInStream.funcTable, -+ progress, alloc, allocBig); -+ -+ *destLen -= outStream.rem; -+ if (outStream.overflow) -+ return SZ_ERROR_OUTPUT_EOF; -+ return res; -+} -+ -+SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, -+ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, -+ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) -+{ -+ CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc); -+ SRes res; -+ if (p == 0) -+ return SZ_ERROR_MEM; -+ -+ res = LzmaEnc_SetProps(p, props); -+ if (res == SZ_OK) -+ { -+ res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize); -+ if (res == SZ_OK) -+ res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen, -+ writeEndMark, progress, alloc, allocBig); -+ } -+ -+ LzmaEnc_Destroy(p, alloc, allocBig); -+ return res; -+} ---- a/jffsX-utils/mkfs.jffs2.c -+++ b/jffsX-utils/mkfs.jffs2.c -@@ -1668,11 +1668,11 @@ int main(int argc, char **argv) - } - erase_block_size *= units; - -- /* If it's less than 8KiB, they're not allowed */ -- if (erase_block_size < 0x2000) { -- fprintf(stderr, "Erase size 0x%x too small. Increasing to 8KiB minimum\n", -+ /* If it's less than 4KiB, they're not allowed */ -+ if (erase_block_size < 0x1000) { -+ fprintf(stderr, "Erase size 0x%x too small. Increasing to 4KiB minimum\n", - erase_block_size); -- erase_block_size = 0x2000; -+ erase_block_size = 0x1000; - } - break; - } diff --git a/rules.mk b/rules.mk index 7bd5e33bcc6be5..ae20742bd71bf8 100644 --- a/rules.mk +++ b/rules.mk @@ -26,6 +26,7 @@ qstrip=$(strip $(subst ",,$(1))) empty:= space:= $(empty) $(empty) comma:=, +pound:=\# merge=$(subst $(space),,$(1)) confvar=$(shell echo '$(foreach v,$(1),$(v)=$(subst ','\'',$($(v))))' | $(MKHASH) md5) strip_last=$(patsubst %.$(lastword $(subst .,$(space),$(1))),%,$(1)) @@ -378,6 +379,19 @@ define shexport export $(call shvar,$(1))=$$(call $(1)) endef +# Test support for 64-bit time with C code from largefile.m4 provided by GNU Gnulib +# the value is 'y' when successful and '' otherwise +define YEAR_2038 +$(shell \ + mkdir -p $(TMP_DIR); \ + echo '$(pound) include ' > $(TMP_DIR)/year2038.c; \ + echo '$(pound) define LARGE_TIME_T ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30)))' >> $(TMP_DIR)/year2038.c; \ + echo 'int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 && LARGE_TIME_T % 65537 == 0) ? 1 : -1];' >> $(TMP_DIR)/year2038.c; \ + echo 'int main (void) {return 0;}' >> $(TMP_DIR)/year2038.c; \ + $(HOSTCC) $(TMP_DIR)/year2038.c -o /dev/null 2>/dev/null && echo y && rm -f $(TMP_DIR)/year2038.c || rm -f $(TMP_DIR)/year2038.c; \ +) +endef + # Execute commands under flock # $(1) => The shell expression. # $(2) => The lock name. If not given, the global lock will be used. diff --git a/target/linux/generic/backport-6.6/310-v6.7-mips-kexec-fix-the-incorrect-ifdeffery-and-dependenc.patch b/target/linux/generic/backport-6.6/310-v6.7-mips-kexec-fix-the-incorrect-ifdeffery-and-dependenc.patch new file mode 100644 index 00000000000000..99a6bfe6380474 --- /dev/null +++ b/target/linux/generic/backport-6.6/310-v6.7-mips-kexec-fix-the-incorrect-ifdeffery-and-dependenc.patch @@ -0,0 +1,206 @@ +From 8cd2accb71f5eb8e92d775fc1978d3779875c2e5 Mon Sep 17 00:00:00 2001 +From: Baoquan He +Date: Fri, 8 Dec 2023 15:30:34 +0800 +Subject: [PATCH] mips, kexec: fix the incorrect ifdeffery and dependency of + CONFIG_KEXEC + +The select of KEXEC for CRASH_DUMP in kernel/Kconfig.kexec will be +dropped, then compiling errors will be triggered if below config items are +set: + +=== +CONFIG_CRASH_CORE=y +CONFIG_KEXEC_CORE=y +CONFIG_CRASH_DUMP=y +=== + +-------------------------------------------------------------------- +mipsel-linux-ld: kernel/kexec_core.o: in function `kimage_free': +kernel/kexec_core.c:(.text+0x2200): undefined reference to `machine_kexec_cleanup' +mipsel-linux-ld: kernel/kexec_core.o: in function `__crash_kexec': +kernel/kexec_core.c:(.text+0x2480): undefined reference to `machine_crash_shutdown' +mipsel-linux-ld: kernel/kexec_core.c:(.text+0x2488): undefined reference to `machine_kexec' +mipsel-linux-ld: kernel/kexec_core.o: in function `kernel_kexec': +kernel/kexec_core.c:(.text+0x29b8): undefined reference to `machine_shutdown' +mipsel-linux-ld: kernel/kexec_core.c:(.text+0x29c0): undefined reference to `machine_kexec' +-------------------------------------------------------------------- + +Here, change the dependency of building kexec_core related object files, +and the ifdeffery in mips from CONFIG_KEXEC to CONFIG_KEXEC_CORE. + +Link: https://lkml.kernel.org/r/20231208073036.7884-4-bhe@redhat.com +Signed-off-by: Baoquan He +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202311302042.sn8cDPIX-lkp@intel.com/ +Cc: Eric DeVolder +Cc: Ignat Korchagin +Cc: Stephen Rothwell +Signed-off-by: Andrew Morton +--- + arch/mips/cavium-octeon/smp.c | 4 ++-- + arch/mips/include/asm/kexec.h | 2 +- + arch/mips/include/asm/smp-ops.h | 2 +- + arch/mips/include/asm/smp.h | 2 +- + arch/mips/kernel/Makefile | 2 +- + arch/mips/kernel/smp-bmips.c | 4 ++-- + arch/mips/kernel/smp-cps.c | 10 +++++----- + arch/mips/loongson64/reset.c | 4 ++-- + arch/mips/loongson64/smp.c | 2 +- + 9 files changed, 16 insertions(+), 16 deletions(-) + +--- a/arch/mips/cavium-octeon/smp.c ++++ b/arch/mips/cavium-octeon/smp.c +@@ -422,7 +422,7 @@ static const struct plat_smp_ops octeon_ + .cpu_disable = octeon_cpu_disable, + .cpu_die = octeon_cpu_die, + #endif +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + .kexec_nonboot_cpu = kexec_nonboot_cpu_jump, + #endif + }; +@@ -502,7 +502,7 @@ static const struct plat_smp_ops octeon_ + .cpu_disable = octeon_cpu_disable, + .cpu_die = octeon_cpu_die, + #endif +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + .kexec_nonboot_cpu = kexec_nonboot_cpu_jump, + #endif + }; +--- a/arch/mips/include/asm/kexec.h ++++ b/arch/mips/include/asm/kexec.h +@@ -31,7 +31,7 @@ static inline void crash_setup_regs(stru + prepare_frametrace(newregs); + } + +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + struct kimage; + extern unsigned long kexec_args[4]; + extern int (*_machine_kexec_prepare)(struct kimage *); +--- a/arch/mips/include/asm/smp-ops.h ++++ b/arch/mips/include/asm/smp-ops.h +@@ -35,7 +35,7 @@ struct plat_smp_ops { + void (*cpu_die)(unsigned int cpu); + void (*cleanup_dead_cpu)(unsigned cpu); + #endif +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + void (*kexec_nonboot_cpu)(void); + #endif + }; +--- a/arch/mips/include/asm/smp.h ++++ b/arch/mips/include/asm/smp.h +@@ -93,7 +93,7 @@ static inline void __cpu_die(unsigned in + extern void __noreturn play_dead(void); + #endif + +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + static inline void kexec_nonboot_cpu(void) + { + extern const struct plat_smp_ops *mp_ops; /* private */ +--- a/arch/mips/kernel/Makefile ++++ b/arch/mips/kernel/Makefile +@@ -90,7 +90,7 @@ obj-$(CONFIG_GPIO_TXX9) += gpio_txx9.o + + obj-$(CONFIG_RELOCATABLE) += relocate.o + +-obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o ++obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o relocate_kernel.o crash.o + obj-$(CONFIG_CRASH_DUMP) += crash_dump.o + obj-$(CONFIG_EARLY_PRINTK) += early_printk.o + obj-$(CONFIG_EARLY_PRINTK_8250) += early_printk_8250.o +--- a/arch/mips/kernel/smp-bmips.c ++++ b/arch/mips/kernel/smp-bmips.c +@@ -434,7 +434,7 @@ const struct plat_smp_ops bmips43xx_smp_ + .cpu_disable = bmips_cpu_disable, + .cpu_die = bmips_cpu_die, + #endif +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + .kexec_nonboot_cpu = kexec_nonboot_cpu_jump, + #endif + }; +@@ -451,7 +451,7 @@ const struct plat_smp_ops bmips5000_smp_ + .cpu_disable = bmips_cpu_disable, + .cpu_die = bmips_cpu_die, + #endif +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + .kexec_nonboot_cpu = kexec_nonboot_cpu_jump, + #endif + }; +--- a/arch/mips/kernel/smp-cps.c ++++ b/arch/mips/kernel/smp-cps.c +@@ -392,7 +392,7 @@ static void cps_smp_finish(void) + local_irq_enable(); + } + +-#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_KEXEC) ++#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_KEXEC_CORE) + + enum cpu_death { + CPU_DEATH_HALT, +@@ -429,7 +429,7 @@ static void cps_shutdown_this_cpu(enum c + } + } + +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + + static void cps_kexec_nonboot_cpu(void) + { +@@ -439,9 +439,9 @@ static void cps_kexec_nonboot_cpu(void) + cps_shutdown_this_cpu(CPU_DEATH_POWER); + } + +-#endif /* CONFIG_KEXEC */ ++#endif /* CONFIG_KEXEC_CORE */ + +-#endif /* CONFIG_HOTPLUG_CPU || CONFIG_KEXEC */ ++#endif /* CONFIG_HOTPLUG_CPU || CONFIG_KEXEC_CORE */ + + #ifdef CONFIG_HOTPLUG_CPU + +@@ -610,7 +610,7 @@ static const struct plat_smp_ops cps_smp + .cpu_die = cps_cpu_die, + .cleanup_dead_cpu = cps_cleanup_dead_cpu, + #endif +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + .kexec_nonboot_cpu = cps_kexec_nonboot_cpu, + #endif + }; +--- a/arch/mips/loongson64/reset.c ++++ b/arch/mips/loongson64/reset.c +@@ -53,7 +53,7 @@ static void loongson_halt(void) + } + } + +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + + /* 0X80000000~0X80200000 is safe */ + #define MAX_ARGS 64 +@@ -158,7 +158,7 @@ static int __init mips_reboot_setup(void + _machine_halt = loongson_halt; + pm_power_off = loongson_poweroff; + +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + kexec_argv = kmalloc(KEXEC_ARGV_SIZE, GFP_KERNEL); + if (WARN_ON(!kexec_argv)) + return -ENOMEM; +--- a/arch/mips/loongson64/smp.c ++++ b/arch/mips/loongson64/smp.c +@@ -864,7 +864,7 @@ const struct plat_smp_ops loongson3_smp_ + .cpu_disable = loongson3_cpu_disable, + .cpu_die = loongson3_cpu_die, + #endif +-#ifdef CONFIG_KEXEC ++#ifdef CONFIG_KEXEC_CORE + .kexec_nonboot_cpu = kexec_nonboot_cpu_jump, + #endif + }; diff --git a/target/linux/generic/backport-6.6/722-v6.10-dt-bindings-arm-qcom-ids-Add-SoC-ID-for-IPQ5321.patch b/target/linux/generic/backport-6.6/722-v6.10-dt-bindings-arm-qcom-ids-Add-SoC-ID-for-IPQ5321.patch new file mode 100644 index 00000000000000..b05648aeab546b --- /dev/null +++ b/target/linux/generic/backport-6.6/722-v6.10-dt-bindings-arm-qcom-ids-Add-SoC-ID-for-IPQ5321.patch @@ -0,0 +1,28 @@ +From 27c42e925323b975a64429e313b0cf5c0c02a411 Mon Sep 17 00:00:00 2001 +From: Kathiravan Thirumoorthy +Date: Mon, 25 Mar 2024 21:19:48 +0530 +Subject: dt-bindings: arm: qcom,ids: Add SoC ID for IPQ5321 + +Add the ID for the Qualcomm IPQ5321 SoC. + +Acked-by: Krzysztof Kozlowski +Reviewed-by: Mukesh Ojha +Signed-off-by: Kathiravan Thirumoorthy +Link: https://lore.kernel.org/r/20240325-ipq5321-sku-support-v2-1-f30ce244732f@quicinc.com +Signed-off-by: Bjorn Andersson +--- + include/dt-bindings/arm/qcom,ids.h | 1 + + 1 file changed, 1 insertion(+) + +(limited to 'include/dt-bindings/arm/qcom,ids.h') + +--- a/include/dt-bindings/arm/qcom,ids.h ++++ b/include/dt-bindings/arm/qcom,ids.h +@@ -260,6 +260,7 @@ + #define QCOM_ID_IPQ5312 594 + #define QCOM_ID_IPQ5302 595 + #define QCOM_ID_IPQ5300 624 ++#define QCOM_ID_IPQ5321 650 + + /* + * The board type and revision information, used by Qualcomm bootloaders and diff --git a/target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch b/target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch new file mode 100644 index 00000000000000..07e7e863406fea --- /dev/null +++ b/target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch @@ -0,0 +1,371 @@ +From dee4dd10c79aaca192b73520d8fb64628468ae0f Mon Sep 17 00:00:00 2001 +From: Elad Yifee +Date: Fri, 7 Jun 2024 11:21:50 +0300 +Subject: [PATCH] net: ethernet: mtk_eth_soc: ppe: add support for multiple + PPEs + +Add the missing pieces to allow multiple PPEs units, one for each GMAC. +mtk_gdm_config has been modified to work on targted mac ID, +the inner loop moved outside of the function to allow unrelated +operations like setting the MAC's PPE index. +Introduce a sanity check in flow_offload_replace to account for +non-MTK ingress devices. +Additional field 'ppe_idx' was added to struct mtk_mac in order +to keep track on the assigned PPE unit. + +Signed-off-by: Elad Yifee +Link: https://lore.kernel.org/r/20240607082155.20021-1-eladwf@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 112 +++++++++++------- + drivers/net/ethernet/mediatek/mtk_eth_soc.h | 8 +- + .../net/ethernet/mediatek/mtk_ppe_offload.c | 17 ++- + 3 files changed, 92 insertions(+), 45 deletions(-) + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -80,7 +80,9 @@ static const struct mtk_reg_map mtk_reg_ + .fq_blen = 0x1b2c, + }, + .gdm1_cnt = 0x2400, +- .gdma_to_ppe = 0x4444, ++ .gdma_to_ppe = { ++ [0] = 0x4444, ++ }, + .ppe_base = 0x0c00, + .wdma_base = { + [0] = 0x2800, +@@ -144,7 +146,10 @@ static const struct mtk_reg_map mt7986_r + .tx_sch_rate = 0x4798, + }, + .gdm1_cnt = 0x1c00, +- .gdma_to_ppe = 0x3333, ++ .gdma_to_ppe = { ++ [0] = 0x3333, ++ [1] = 0x4444, ++ }, + .ppe_base = 0x2000, + .wdma_base = { + [0] = 0x4800, +@@ -192,7 +197,11 @@ static const struct mtk_reg_map mt7988_r + .tx_sch_rate = 0x4798, + }, + .gdm1_cnt = 0x1c00, +- .gdma_to_ppe = 0x3333, ++ .gdma_to_ppe = { ++ [0] = 0x3333, ++ [1] = 0x4444, ++ [2] = 0xcccc, ++ }, + .ppe_base = 0x2000, + .wdma_base = { + [0] = 0x4800, +@@ -2015,6 +2024,7 @@ static int mtk_poll_rx(struct napi_struc + struct mtk_rx_dma_v2 *rxd, trxd; + int done = 0, bytes = 0; + dma_addr_t dma_addr = DMA_MAPPING_ERROR; ++ int ppe_idx = 0; + + while (done < budget) { + unsigned int pktlen, *rxdcsum; +@@ -2058,6 +2068,7 @@ static int mtk_poll_rx(struct napi_struc + goto release_desc; + + netdev = eth->netdev[mac]; ++ ppe_idx = eth->mac[mac]->ppe_idx; + + if (unlikely(test_bit(MTK_RESETTING, ð->state))) + goto release_desc; +@@ -2181,7 +2192,7 @@ static int mtk_poll_rx(struct napi_struc + } + + if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED) +- mtk_ppe_check_skb(eth->ppe[0], skb, hash); ++ mtk_ppe_check_skb(eth->ppe[ppe_idx], skb, hash); + + skb_record_rx_queue(skb, 0); + napi_gro_receive(napi, skb); +@@ -3276,37 +3287,27 @@ static int mtk_start_dma(struct mtk_eth + return 0; + } + +-static void mtk_gdm_config(struct mtk_eth *eth, u32 config) ++static void mtk_gdm_config(struct mtk_eth *eth, u32 id, u32 config) + { +- int i; ++ u32 val; + + if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) + return; + +- for (i = 0; i < MTK_MAX_DEVS; i++) { +- u32 val; +- +- if (!eth->netdev[i]) +- continue; ++ val = mtk_r32(eth, MTK_GDMA_FWD_CFG(id)); + +- val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i)); ++ /* default setup the forward port to send frame to PDMA */ ++ val &= ~0xffff; + +- /* default setup the forward port to send frame to PDMA */ +- val &= ~0xffff; ++ /* Enable RX checksum */ ++ val |= MTK_GDMA_ICS_EN | MTK_GDMA_TCS_EN | MTK_GDMA_UCS_EN; + +- /* Enable RX checksum */ +- val |= MTK_GDMA_ICS_EN | MTK_GDMA_TCS_EN | MTK_GDMA_UCS_EN; ++ val |= config; + +- val |= config; ++ if (eth->netdev[id] && netdev_uses_dsa(eth->netdev[id])) ++ val |= MTK_GDMA_SPECIAL_TAG; + +- if (netdev_uses_dsa(eth->netdev[i])) +- val |= MTK_GDMA_SPECIAL_TAG; +- +- mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i)); +- } +- /* Reset and enable PSE */ +- mtk_w32(eth, RST_GL_PSE, MTK_RST_GL); +- mtk_w32(eth, 0, MTK_RST_GL); ++ mtk_w32(eth, val, MTK_GDMA_FWD_CFG(id)); + } + + +@@ -3366,7 +3367,10 @@ static int mtk_open(struct net_device *d + { + struct mtk_mac *mac = netdev_priv(dev); + struct mtk_eth *eth = mac->hw; +- int i, err; ++ struct mtk_mac *target_mac; ++ int i, err, ppe_num; ++ ++ ppe_num = eth->soc->ppe_num; + + err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); + if (err) { +@@ -3390,18 +3394,38 @@ static int mtk_open(struct net_device *d + for (i = 0; i < ARRAY_SIZE(eth->ppe); i++) + mtk_ppe_start(eth->ppe[i]); + +- gdm_config = soc->offload_version ? soc->reg_map->gdma_to_ppe +- : MTK_GDMA_TO_PDMA; +- mtk_gdm_config(eth, gdm_config); ++ for (i = 0; i < MTK_MAX_DEVS; i++) { ++ if (!eth->netdev[i]) ++ break; ++ ++ target_mac = netdev_priv(eth->netdev[i]); ++ if (!soc->offload_version) { ++ target_mac->ppe_idx = 0; ++ gdm_config = MTK_GDMA_TO_PDMA; ++ } else if (ppe_num >= 3 && target_mac->id == 2) { ++ target_mac->ppe_idx = 2; ++ gdm_config = soc->reg_map->gdma_to_ppe[2]; ++ } else if (ppe_num >= 2 && target_mac->id == 1) { ++ target_mac->ppe_idx = 1; ++ gdm_config = soc->reg_map->gdma_to_ppe[1]; ++ } else { ++ target_mac->ppe_idx = 0; ++ gdm_config = soc->reg_map->gdma_to_ppe[0]; ++ } ++ mtk_gdm_config(eth, target_mac->id, gdm_config); ++ } ++ /* Reset and enable PSE */ ++ mtk_w32(eth, RST_GL_PSE, MTK_RST_GL); ++ mtk_w32(eth, 0, MTK_RST_GL); + + napi_enable(ð->tx_napi); + napi_enable(ð->rx_napi); + mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); + mtk_rx_irq_enable(eth, soc->rx.irq_done_mask); + refcount_set(ð->dma_refcnt, 1); +- } +- else ++ } else { + refcount_inc(ð->dma_refcnt); ++ } + + phylink_start(mac->phylink); + netif_tx_start_all_queues(dev); +@@ -3478,7 +3502,8 @@ static int mtk_stop(struct net_device *d + if (!refcount_dec_and_test(ð->dma_refcnt)) + return 0; + +- mtk_gdm_config(eth, MTK_GDMA_DROP_ALL); ++ for (i = 0; i < MTK_MAX_DEVS; i++) ++ mtk_gdm_config(eth, i, MTK_GDMA_DROP_ALL); + + mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); + mtk_rx_irq_disable(eth, eth->soc->rx.irq_done_mask); +@@ -4957,23 +4982,24 @@ static int mtk_probe(struct platform_dev + } + + if (eth->soc->offload_version) { +- u32 num_ppe = mtk_is_netsys_v2_or_greater(eth) ? 2 : 1; ++ u8 ppe_num = eth->soc->ppe_num; + +- num_ppe = min_t(u32, ARRAY_SIZE(eth->ppe), num_ppe); +- for (i = 0; i < num_ppe; i++) { +- u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400; ++ ppe_num = min_t(u8, ARRAY_SIZE(eth->ppe), ppe_num); ++ for (i = 0; i < ppe_num; i++) { ++ u32 ppe_addr = eth->soc->reg_map->ppe_base; + ++ ppe_addr += (i == 2 ? 0xc00 : i * 0x400); + eth->ppe[i] = mtk_ppe_init(eth, eth->base + ppe_addr, i); + + if (!eth->ppe[i]) { + err = -ENOMEM; + goto err_deinit_ppe; + } +- } ++ err = mtk_eth_offload_init(eth, i); + +- err = mtk_eth_offload_init(eth); +- if (err) +- goto err_deinit_ppe; ++ if (err) ++ goto err_deinit_ppe; ++ } + } + + for (i = 0; i < MTK_MAX_DEVS; i++) { +@@ -5076,6 +5102,7 @@ static const struct mtk_soc_data mt7621_ + .required_pctl = false, + .version = 1, + .offload_version = 1, ++ .ppe_num = 1, + .hash_offset = 2, + .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, + .tx = { +@@ -5104,6 +5131,7 @@ static const struct mtk_soc_data mt7622_ + .required_pctl = false, + .version = 1, + .offload_version = 2, ++ .ppe_num = 1, + .hash_offset = 2, + .has_accounting = true, + .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, +@@ -5132,6 +5160,7 @@ static const struct mtk_soc_data mt7623_ + .required_pctl = true, + .version = 1, + .offload_version = 1, ++ .ppe_num = 1, + .hash_offset = 2, + .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, + .disable_pll_modes = true, +@@ -5187,6 +5216,7 @@ static const struct mtk_soc_data mt7981_ + .required_pctl = false, + .version = 2, + .offload_version = 2, ++ .ppe_num = 2, + .hash_offset = 4, + .has_accounting = true, + .foe_entry_size = MTK_FOE_ENTRY_V2_SIZE, +@@ -5216,6 +5246,7 @@ static const struct mtk_soc_data mt7986_ + .required_pctl = false, + .version = 2, + .offload_version = 2, ++ .ppe_num = 2, + .hash_offset = 4, + .has_accounting = true, + .foe_entry_size = MTK_FOE_ENTRY_V2_SIZE, +@@ -5245,6 +5276,7 @@ static const struct mtk_soc_data mt7988_ + .required_pctl = false, + .version = 3, + .offload_version = 2, ++ .ppe_num = 3, + .hash_offset = 4, + .has_accounting = true, + .foe_entry_size = MTK_FOE_ENTRY_V3_SIZE, +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -1132,7 +1132,7 @@ struct mtk_reg_map { + u32 tx_sch_rate; /* tx scheduler rate control registers */ + } qdma; + u32 gdm1_cnt; +- u32 gdma_to_ppe; ++ u32 gdma_to_ppe[3]; + u32 ppe_base; + u32 wdma_base[3]; + u32 pse_iq_sta; +@@ -1170,6 +1170,7 @@ struct mtk_soc_data { + u8 offload_version; + u8 hash_offset; + u8 version; ++ u8 ppe_num; + u16 foe_entry_size; + netdev_features_t hw_features; + bool has_accounting; +@@ -1294,7 +1295,7 @@ struct mtk_eth { + + struct metadata_dst *dsa_meta[MTK_MAX_DSA_PORTS]; + +- struct mtk_ppe *ppe[2]; ++ struct mtk_ppe *ppe[3]; + struct rhashtable flow_table; + + struct bpf_prog __rcu *prog; +@@ -1319,6 +1320,7 @@ struct mtk_eth { + struct mtk_mac { + int id; + phy_interface_t interface; ++ u8 ppe_idx; + int speed; + struct device_node *of_node; + struct phylink *phylink; +@@ -1440,7 +1442,7 @@ int mtk_gmac_sgmii_path_setup(struct mtk + int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id); + int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id); + +-int mtk_eth_offload_init(struct mtk_eth *eth); ++int mtk_eth_offload_init(struct mtk_eth *eth, u8 id); + int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type, + void *type_data); + int mtk_flow_offload_cmd(struct mtk_eth *eth, struct flow_cls_offload *cls, +--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c ++++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +@@ -245,10 +245,10 @@ mtk_flow_offload_replace(struct mtk_eth + int ppe_index) + { + struct flow_rule *rule = flow_cls_offload_flow_rule(f); ++ struct net_device *idev = NULL, *odev = NULL; + struct flow_action_entry *act; + struct mtk_flow_data data = {}; + struct mtk_foe_entry foe; +- struct net_device *odev = NULL; + struct mtk_flow_entry *entry; + int offload_type = 0; + int wed_index = -1; +@@ -264,6 +264,17 @@ mtk_flow_offload_replace(struct mtk_eth + struct flow_match_meta match; + + flow_rule_match_meta(rule, &match); ++ if (mtk_is_netsys_v2_or_greater(eth)) { ++ idev = __dev_get_by_index(&init_net, match.key->ingress_ifindex); ++ if (idev) { ++ struct mtk_mac *mac = netdev_priv(idev); ++ ++ if (WARN_ON(mac->ppe_idx >= eth->soc->ppe_num)) ++ return -EINVAL; ++ ++ ppe_index = mac->ppe_idx; ++ } ++ } + } else { + return -EOPNOTSUPP; + } +@@ -630,7 +641,9 @@ int mtk_eth_setup_tc(struct net_device * + } + } + +-int mtk_eth_offload_init(struct mtk_eth *eth) ++int mtk_eth_offload_init(struct mtk_eth *eth, u8 id) + { ++ if (!eth->ppe[id] || !eth->ppe[id]->foe_table) ++ return 0; + return rhashtable_init(ð->flow_table, &mtk_flow_ht_params); + } diff --git a/target/linux/generic/backport-6.6/752-27-v6.10-net-ethernet-mtk_eth_soc-ppe-prevent-ppe-update-for-.patch b/target/linux/generic/backport-6.6/752-27-v6.10-net-ethernet-mtk_eth_soc-ppe-prevent-ppe-update-for-.patch new file mode 100644 index 00000000000000..dbf574d80ac274 --- /dev/null +++ b/target/linux/generic/backport-6.6/752-27-v6.10-net-ethernet-mtk_eth_soc-ppe-prevent-ppe-update-for-.patch @@ -0,0 +1,30 @@ +From 73cfd947dbdb25ef9863ac49c4596a7d53ad4025 Mon Sep 17 00:00:00 2001 +From: Elad Yifee +Date: Sun, 23 Jun 2024 20:51:09 +0300 +Subject: [PATCH] net: ethernet: mtk_eth_soc: ppe: prevent ppe update for + non-mtk devices + +Introduce an additional validation to ensure that the PPE index +is modified exclusively for mtk_eth ingress devices. +This primarily addresses the issue related +to WED operation with multiple PPEs. + +Fixes: dee4dd10c79a ("net: ethernet: mtk_eth_soc: ppe: add support for multiple PPEs") +Signed-off-by: Elad Yifee +Link: https://lore.kernel.org/r/20240623175113.24437-1-eladwf@gmail.com +Signed-off-by: Paolo Abeni +--- + drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c ++++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +@@ -266,7 +266,7 @@ mtk_flow_offload_replace(struct mtk_eth + flow_rule_match_meta(rule, &match); + if (mtk_is_netsys_v2_or_greater(eth)) { + idev = __dev_get_by_index(&init_net, match.key->ingress_ifindex); +- if (idev) { ++ if (idev && idev->netdev_ops == eth->netdev[0]->netdev_ops) { + struct mtk_mac *mac = netdev_priv(idev); + + if (WARN_ON(mac->ppe_idx >= eth->soc->ppe_num)) diff --git a/target/linux/generic/backport-6.6/780-01-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch b/target/linux/generic/backport-6.6/780-01-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch new file mode 100644 index 00000000000000..3345ebf6c6ffc7 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-01-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch @@ -0,0 +1,319 @@ +From 18764b883e157e28126b54e7d4ba9dd487d5bf54 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Sat, 16 Dec 2023 20:58:10 +0100 +Subject: [PATCH] r8169: add support for LED's on RTL8168/RTL8101 + +This adds support for the LED's on most chip versions. Excluded are +the old non-PCIe versions and RTL8125. RTL8125 has a different LED +register layout, support for it will follow later. + +LED's can be controlled from userspace using the netdev LED trigger. + +Tested on RTL8168h. + +Note: The driver can't know which LED's are actually physically +wired. Therefore not every LED device may represent a physically +available LED. + +Signed-off-by: Heiner Kallweit +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/realtek/Makefile | 3 + + drivers/net/ethernet/realtek/r8169.h | 7 + + drivers/net/ethernet/realtek/r8169_leds.c | 157 ++++++++++++++++++++++ + drivers/net/ethernet/realtek/r8169_main.c | 65 +++++++++ + 4 files changed, 232 insertions(+) + create mode 100644 drivers/net/ethernet/realtek/r8169_leds.c + +--- a/drivers/net/ethernet/realtek/Makefile ++++ b/drivers/net/ethernet/realtek/Makefile +@@ -7,4 +7,7 @@ obj-$(CONFIG_8139CP) += 8139cp.o + obj-$(CONFIG_8139TOO) += 8139too.o + obj-$(CONFIG_ATP) += atp.o + r8169-objs += r8169_main.o r8169_firmware.o r8169_phy_config.o ++ifdef CONFIG_LEDS_TRIGGER_NETDEV ++r8169-objs += r8169_leds.o ++endif + obj-$(CONFIG_R8169) += r8169.o +--- a/drivers/net/ethernet/realtek/r8169.h ++++ b/drivers/net/ethernet/realtek/r8169.h +@@ -8,6 +8,7 @@ + * See MAINTAINERS file for support contact information. + */ + ++#include + #include + #include + +@@ -77,3 +78,9 @@ u16 rtl8168h_2_get_adc_bias_ioffset(stru + u8 rtl8168d_efuse_read(struct rtl8169_private *tp, int reg_addr); + void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev, + enum mac_version ver); ++ ++void r8169_get_led_name(struct rtl8169_private *tp, int idx, ++ char *buf, int buf_len); ++int rtl8168_get_led_mode(struct rtl8169_private *tp); ++int rtl8168_led_mod_ctrl(struct rtl8169_private *tp, u16 mask, u16 val); ++void rtl8168_init_leds(struct net_device *ndev); +--- /dev/null ++++ b/drivers/net/ethernet/realtek/r8169_leds.c +@@ -0,0 +1,157 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++/* r8169_leds.c: Realtek 8169/8168/8101/8125 ethernet driver. ++ * ++ * Copyright (c) 2023 Heiner Kallweit ++ * ++ * See MAINTAINERS file for support contact information. ++ */ ++ ++#include ++#include ++#include ++ ++#include "r8169.h" ++ ++#define RTL8168_LED_CTRL_OPTION2 BIT(15) ++#define RTL8168_LED_CTRL_ACT BIT(3) ++#define RTL8168_LED_CTRL_LINK_1000 BIT(2) ++#define RTL8168_LED_CTRL_LINK_100 BIT(1) ++#define RTL8168_LED_CTRL_LINK_10 BIT(0) ++ ++#define RTL8168_NUM_LEDS 3 ++ ++#define RTL8168_SUPPORTED_MODES \ ++ (BIT(TRIGGER_NETDEV_LINK_1000) | BIT(TRIGGER_NETDEV_LINK_100) | \ ++ BIT(TRIGGER_NETDEV_LINK_10) | BIT(TRIGGER_NETDEV_RX) | \ ++ BIT(TRIGGER_NETDEV_TX)) ++ ++struct r8169_led_classdev { ++ struct led_classdev led; ++ struct net_device *ndev; ++ int index; ++}; ++ ++#define lcdev_to_r8169_ldev(lcdev) container_of(lcdev, struct r8169_led_classdev, led) ++ ++static int rtl8168_led_hw_control_is_supported(struct led_classdev *led_cdev, ++ unsigned long flags) ++{ ++ struct r8169_led_classdev *ldev = lcdev_to_r8169_ldev(led_cdev); ++ struct rtl8169_private *tp = netdev_priv(ldev->ndev); ++ int shift = ldev->index * 4; ++ bool rx, tx; ++ ++ if (flags & ~RTL8168_SUPPORTED_MODES) ++ goto nosupp; ++ ++ rx = flags & BIT(TRIGGER_NETDEV_RX); ++ tx = flags & BIT(TRIGGER_NETDEV_TX); ++ if (rx != tx) ++ goto nosupp; ++ ++ return 0; ++ ++nosupp: ++ /* Switch LED off to indicate that mode isn't supported */ ++ rtl8168_led_mod_ctrl(tp, 0x000f << shift, 0); ++ return -EOPNOTSUPP; ++} ++ ++static int rtl8168_led_hw_control_set(struct led_classdev *led_cdev, ++ unsigned long flags) ++{ ++ struct r8169_led_classdev *ldev = lcdev_to_r8169_ldev(led_cdev); ++ struct rtl8169_private *tp = netdev_priv(ldev->ndev); ++ int shift = ldev->index * 4; ++ u16 mode = 0; ++ ++ if (flags & BIT(TRIGGER_NETDEV_LINK_10)) ++ mode |= RTL8168_LED_CTRL_LINK_10; ++ if (flags & BIT(TRIGGER_NETDEV_LINK_100)) ++ mode |= RTL8168_LED_CTRL_LINK_100; ++ if (flags & BIT(TRIGGER_NETDEV_LINK_1000)) ++ mode |= RTL8168_LED_CTRL_LINK_1000; ++ if (flags & BIT(TRIGGER_NETDEV_TX)) ++ mode |= RTL8168_LED_CTRL_ACT; ++ ++ return rtl8168_led_mod_ctrl(tp, 0x000f << shift, mode << shift); ++} ++ ++static int rtl8168_led_hw_control_get(struct led_classdev *led_cdev, ++ unsigned long *flags) ++{ ++ struct r8169_led_classdev *ldev = lcdev_to_r8169_ldev(led_cdev); ++ struct rtl8169_private *tp = netdev_priv(ldev->ndev); ++ int shift = ldev->index * 4; ++ int mode; ++ ++ mode = rtl8168_get_led_mode(tp); ++ if (mode < 0) ++ return mode; ++ ++ if (mode & RTL8168_LED_CTRL_OPTION2) { ++ rtl8168_led_mod_ctrl(tp, RTL8168_LED_CTRL_OPTION2, 0); ++ netdev_notice(ldev->ndev, "Deactivating unsupported Option2 LED mode\n"); ++ } ++ ++ mode = (mode >> shift) & 0x000f; ++ ++ if (mode & RTL8168_LED_CTRL_ACT) ++ *flags |= BIT(TRIGGER_NETDEV_TX) | BIT(TRIGGER_NETDEV_RX); ++ ++ if (mode & RTL8168_LED_CTRL_LINK_10) ++ *flags |= BIT(TRIGGER_NETDEV_LINK_10); ++ if (mode & RTL8168_LED_CTRL_LINK_100) ++ *flags |= BIT(TRIGGER_NETDEV_LINK_100); ++ if (mode & RTL8168_LED_CTRL_LINK_1000) ++ *flags |= BIT(TRIGGER_NETDEV_LINK_1000); ++ ++ return 0; ++} ++ ++static struct device * ++ r8169_led_hw_control_get_device(struct led_classdev *led_cdev) ++{ ++ struct r8169_led_classdev *ldev = lcdev_to_r8169_ldev(led_cdev); ++ ++ return &ldev->ndev->dev; ++} ++ ++static void rtl8168_setup_ldev(struct r8169_led_classdev *ldev, ++ struct net_device *ndev, int index) ++{ ++ struct rtl8169_private *tp = netdev_priv(ndev); ++ struct led_classdev *led_cdev = &ldev->led; ++ char led_name[LED_MAX_NAME_SIZE]; ++ ++ ldev->ndev = ndev; ++ ldev->index = index; ++ ++ r8169_get_led_name(tp, index, led_name, LED_MAX_NAME_SIZE); ++ led_cdev->name = led_name; ++ led_cdev->default_trigger = "netdev"; ++ led_cdev->hw_control_trigger = "netdev"; ++ led_cdev->flags |= LED_RETAIN_AT_SHUTDOWN; ++ led_cdev->hw_control_is_supported = rtl8168_led_hw_control_is_supported; ++ led_cdev->hw_control_set = rtl8168_led_hw_control_set; ++ led_cdev->hw_control_get = rtl8168_led_hw_control_get; ++ led_cdev->hw_control_get_device = r8169_led_hw_control_get_device; ++ ++ /* ignore errors */ ++ devm_led_classdev_register(&ndev->dev, led_cdev); ++} ++ ++void rtl8168_init_leds(struct net_device *ndev) ++{ ++ /* bind resource mgmt to netdev */ ++ struct device *dev = &ndev->dev; ++ struct r8169_led_classdev *leds; ++ int i; ++ ++ leds = devm_kcalloc(dev, RTL8168_NUM_LEDS, sizeof(*leds), GFP_KERNEL); ++ if (!leds) ++ return; ++ ++ for (i = 0; i < RTL8168_NUM_LEDS; i++) ++ rtl8168_setup_ldev(leds + i, ndev, i); ++} +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -289,6 +289,7 @@ enum rtl8168_8101_registers { + }; + + enum rtl8168_registers { ++ LED_CTRL = 0x18, + LED_FREQ = 0x1a, + EEE_LED = 0x1b, + ERIDR = 0x70, +@@ -620,6 +621,7 @@ struct rtl8169_private { + + raw_spinlock_t config25_lock; + raw_spinlock_t mac_ocp_lock; ++ struct mutex led_lock; /* serialize LED ctrl RMW access */ + + raw_spinlock_t cfg9346_usage_lock; + int cfg9346_usage_count; +@@ -792,6 +794,62 @@ static const struct rtl_cond name = { + \ + static bool name ## _check(struct rtl8169_private *tp) + ++int rtl8168_led_mod_ctrl(struct rtl8169_private *tp, u16 mask, u16 val) ++{ ++ struct device *dev = tp_to_dev(tp); ++ int ret; ++ ++ ret = pm_runtime_resume_and_get(dev); ++ if (ret < 0) ++ return ret; ++ ++ mutex_lock(&tp->led_lock); ++ RTL_W16(tp, LED_CTRL, (RTL_R16(tp, LED_CTRL) & ~mask) | val); ++ mutex_unlock(&tp->led_lock); ++ ++ pm_runtime_put_sync(dev); ++ ++ return 0; ++} ++ ++int rtl8168_get_led_mode(struct rtl8169_private *tp) ++{ ++ struct device *dev = tp_to_dev(tp); ++ int ret; ++ ++ ret = pm_runtime_resume_and_get(dev); ++ if (ret < 0) ++ return ret; ++ ++ ret = RTL_R16(tp, LED_CTRL); ++ ++ pm_runtime_put_sync(dev); ++ ++ return ret; ++} ++ ++void r8169_get_led_name(struct rtl8169_private *tp, int idx, ++ char *buf, int buf_len) ++{ ++ struct pci_dev *pdev = tp->pci_dev; ++ char pdom[8], pfun[8]; ++ int domain; ++ ++ domain = pci_domain_nr(pdev->bus); ++ if (domain) ++ snprintf(pdom, sizeof(pdom), "P%d", domain); ++ else ++ pdom[0] = '\0'; ++ ++ if (pdev->multifunction) ++ snprintf(pfun, sizeof(pfun), "f%d", PCI_FUNC(pdev->devfn)); ++ else ++ pfun[0] = '\0'; ++ ++ snprintf(buf, buf_len, "en%sp%ds%d%s-%d::lan", pdom, pdev->bus->number, ++ PCI_SLOT(pdev->devfn), pfun, idx); ++} ++ + static void r8168fp_adjust_ocp_cmd(struct rtl8169_private *tp, u32 *cmd, int type) + { + /* based on RTL8168FP_OOBMAC_BASE in vendor driver */ +@@ -5258,6 +5316,7 @@ static int rtl_init_one(struct pci_dev * + raw_spin_lock_init(&tp->cfg9346_usage_lock); + raw_spin_lock_init(&tp->config25_lock); + raw_spin_lock_init(&tp->mac_ocp_lock); ++ mutex_init(&tp->led_lock); + + dev->tstats = devm_netdev_alloc_pcpu_stats(&pdev->dev, + struct pcpu_sw_netstats); +@@ -5414,6 +5473,12 @@ static int rtl_init_one(struct pci_dev * + if (rc) + return rc; + ++#if IS_REACHABLE(CONFIG_LEDS_CLASS) && IS_ENABLED(CONFIG_LEDS_TRIGGER_NETDEV) ++ if (tp->mac_version > RTL_GIGA_MAC_VER_06 && ++ tp->mac_version < RTL_GIGA_MAC_VER_61) ++ rtl8168_init_leds(dev); ++#endif ++ + netdev_info(dev, "%s, %pM, XID %03x, IRQ %d\n", + rtl_chip_infos[chipset].name, dev->dev_addr, xid, tp->irq); + diff --git a/target/linux/generic/backport-6.6/780-02-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch b/target/linux/generic/backport-6.6/780-02-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch new file mode 100644 index 00000000000000..cea88c042ad95c --- /dev/null +++ b/target/linux/generic/backport-6.6/780-02-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch @@ -0,0 +1,75 @@ +From a2634a5ffcafc31c343c6153ae487eb184c433a6 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Wed, 3 Jan 2024 16:52:04 +0100 +Subject: [PATCH] r8169: fix building with CONFIG_LEDS_CLASS=m + +When r8169 is built-in but LED support is a loadable module, the new +code to drive the LED causes a link failure: + +ld: drivers/net/ethernet/realtek/r8169_leds.o: in function `rtl8168_init_leds': +r8169_leds.c:(.text+0x36c): undefined reference to `devm_led_classdev_register_ext' + +LED support is an optional feature, so fix this issue by adding a Kconfig +symbol R8169_LEDS that is guaranteed to be false if r8169 is built-in +and LED core support is a module. As a positive side effect of this change +r8169_leds.o no longer is built under this configuration. + +Fixes: 18764b883e15 ("r8169: add support for LED's on RTL8168/RTL8101") +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202312281159.9TPeXbNd-lkp@intel.com/ +Suggested-by: Arnd Bergmann +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Tested-by: Simon Horman # build-tested +Tested-by: Arnd Bergmann +Link: https://lore.kernel.org/r/d055aeb5-fe5c-4ccf-987f-5af93a17537b@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/Kconfig | 7 +++++++ + drivers/net/ethernet/realtek/Makefile | 6 ++---- + drivers/net/ethernet/realtek/r8169_main.c | 5 ++--- + 3 files changed, 11 insertions(+), 7 deletions(-) + +--- a/drivers/net/ethernet/realtek/Kconfig ++++ b/drivers/net/ethernet/realtek/Kconfig +@@ -113,4 +113,11 @@ config R8169 + To compile this driver as a module, choose M here: the module + will be called r8169. This is recommended. + ++config R8169_LEDS ++ def_bool R8169 && LEDS_TRIGGER_NETDEV ++ depends on !(R8169=y && LEDS_CLASS=m) ++ help ++ Optional support for controlling the NIC LED's with the netdev ++ LED trigger. ++ + endif # NET_VENDOR_REALTEK +--- a/drivers/net/ethernet/realtek/Makefile ++++ b/drivers/net/ethernet/realtek/Makefile +@@ -6,8 +6,6 @@ + obj-$(CONFIG_8139CP) += 8139cp.o + obj-$(CONFIG_8139TOO) += 8139too.o + obj-$(CONFIG_ATP) += atp.o +-r8169-objs += r8169_main.o r8169_firmware.o r8169_phy_config.o +-ifdef CONFIG_LEDS_TRIGGER_NETDEV +-r8169-objs += r8169_leds.o +-endif ++r8169-y += r8169_main.o r8169_firmware.o r8169_phy_config.o ++r8169-$(CONFIG_R8169_LEDS) += r8169_leds.o + obj-$(CONFIG_R8169) += r8169.o +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -5473,11 +5473,10 @@ static int rtl_init_one(struct pci_dev * + if (rc) + return rc; + +-#if IS_REACHABLE(CONFIG_LEDS_CLASS) && IS_ENABLED(CONFIG_LEDS_TRIGGER_NETDEV) +- if (tp->mac_version > RTL_GIGA_MAC_VER_06 && ++ if (IS_ENABLED(CONFIG_R8169_LEDS) && ++ tp->mac_version > RTL_GIGA_MAC_VER_06 && + tp->mac_version < RTL_GIGA_MAC_VER_61) + rtl8168_init_leds(dev); +-#endif + + netdev_info(dev, "%s, %pM, XID %03x, IRQ %d\n", + rtl_chip_infos[chipset].name, dev->dev_addr, xid, tp->irq); diff --git a/target/linux/generic/backport-6.6/780-03-v6.9-r8169-add-support-for-RTL8126A.patch b/target/linux/generic/backport-6.6/780-03-v6.9-r8169-add-support-for-RTL8126A.patch new file mode 100644 index 00000000000000..5ab160855acfb3 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-03-v6.9-r8169-add-support-for-RTL8126A.patch @@ -0,0 +1,355 @@ +From 3907f1ffc0ecf466d5c04aadc44c4b9203f3ec9a Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Thu, 1 Feb 2024 22:38:01 +0100 +Subject: [PATCH] r8169: add support for RTL8126A + +This adds support for the RTL8126A found on Asus z790 Maximus Formula. +It was successfully tested w/o the firmware at 1000Mbps. Firmware file +has been provided by Realtek and submitted to linux-firmware. +2.5G and 5G modes are untested. + +Signed-off-by: Heiner Kallweit +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/realtek/r8169.h | 1 + + drivers/net/ethernet/realtek/r8169_main.c | 105 ++++++++++++++---- + .../net/ethernet/realtek/r8169_phy_config.c | 7 ++ + 3 files changed, 89 insertions(+), 24 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169.h ++++ b/drivers/net/ethernet/realtek/r8169.h +@@ -68,6 +68,7 @@ enum mac_version { + /* support for RTL_GIGA_MAC_VER_60 has been removed */ + RTL_GIGA_MAC_VER_61, + RTL_GIGA_MAC_VER_63, ++ RTL_GIGA_MAC_VER_65, + RTL_GIGA_MAC_NONE + }; + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -55,6 +55,7 @@ + #define FIRMWARE_8107E_2 "rtl_nic/rtl8107e-2.fw" + #define FIRMWARE_8125A_3 "rtl_nic/rtl8125a-3.fw" + #define FIRMWARE_8125B_2 "rtl_nic/rtl8125b-2.fw" ++#define FIRMWARE_8126A_2 "rtl_nic/rtl8126a-2.fw" + + /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). + The RTL chips use a 64 element hash table based on the Ethernet CRC. */ +@@ -140,6 +141,7 @@ static const struct { + [RTL_GIGA_MAC_VER_61] = {"RTL8125A", FIRMWARE_8125A_3}, + /* reserve 62 for CFG_METHOD_4 in the vendor driver */ + [RTL_GIGA_MAC_VER_63] = {"RTL8125B", FIRMWARE_8125B_2}, ++ [RTL_GIGA_MAC_VER_65] = {"RTL8126A", FIRMWARE_8126A_2}, + }; + + static const struct pci_device_id rtl8169_pci_tbl[] = { +@@ -162,6 +164,7 @@ static const struct pci_device_id rtl816 + { PCI_VENDOR_ID_LINKSYS, 0x1032, PCI_ANY_ID, 0x0024 }, + { 0x0001, 0x8168, PCI_ANY_ID, 0x2410 }, + { PCI_VDEVICE(REALTEK, 0x8125) }, ++ { PCI_VDEVICE(REALTEK, 0x8126) }, + { PCI_VDEVICE(REALTEK, 0x3000) }, + {} + }; +@@ -331,8 +334,12 @@ enum rtl8168_registers { + }; + + enum rtl8125_registers { ++ INT_CFG0_8125 = 0x34, ++#define INT_CFG0_ENABLE_8125 BIT(0) ++#define INT_CFG0_CLKREQEN BIT(3) + IntrMask_8125 = 0x38, + IntrStatus_8125 = 0x3c, ++ INT_CFG1_8125 = 0x7a, + TxPoll_8125 = 0x90, + MAC0_BKP = 0x19e0, + EEE_TXIDLE_TIMER_8125 = 0x6048, +@@ -1144,7 +1151,7 @@ static void rtl_writephy(struct rtl8169_ + case RTL_GIGA_MAC_VER_31: + r8168dp_2_mdio_write(tp, location, val); + break; +- case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_65: + r8168g_mdio_write(tp, location, val); + break; + default: +@@ -1159,7 +1166,7 @@ static int rtl_readphy(struct rtl8169_pr + case RTL_GIGA_MAC_VER_28: + case RTL_GIGA_MAC_VER_31: + return r8168dp_2_mdio_read(tp, location); +- case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_65: + return r8168g_mdio_read(tp, location); + default: + return r8169_mdio_read(tp, location); +@@ -1368,7 +1375,7 @@ static void rtl_set_d3_pll_down(struct r + case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: + case RTL_GIGA_MAC_VER_29 ... RTL_GIGA_MAC_VER_30: + case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_37: +- case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_65: + if (enable) + RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) & ~D3_NO_PLL_DOWN); + else +@@ -1535,7 +1542,7 @@ static void __rtl8169_set_wol(struct rtl + break; + case RTL_GIGA_MAC_VER_34: + case RTL_GIGA_MAC_VER_37: +- case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_65: + if (wolopts) + rtl_mod_config2(tp, 0, PME_SIGNAL); + else +@@ -2122,6 +2129,9 @@ static enum mac_version rtl8169_get_mac_ + u16 val; + enum mac_version ver; + } mac_info[] = { ++ /* 8126A family. */ ++ { 0x7cf, 0x649, RTL_GIGA_MAC_VER_65 }, ++ + /* 8125B family. */ + { 0x7cf, 0x641, RTL_GIGA_MAC_VER_63 }, + +@@ -2392,6 +2402,7 @@ static void rtl_init_rxcfg(struct rtl816 + RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST); + break; + case RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_65: + RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST | + RX_PAUSE_SLOT_ON); + break; +@@ -2578,7 +2589,7 @@ static void rtl_wait_txrx_fifo_empty(str + case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_61: + rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42); + break; +- case RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_63 ... RTL_GIGA_MAC_VER_65: + RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq); + rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42); + rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond_2, 100, 42); +@@ -2822,7 +2833,7 @@ static void rtl_enable_exit_l1(struct rt + case RTL_GIGA_MAC_VER_37 ... RTL_GIGA_MAC_VER_38: + rtl_eri_set_bits(tp, 0xd4, 0x0c00); + break; +- case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_65: + r8168_mac_ocp_modify(tp, 0xc0ac, 0, 0x1f80); + break; + default: +@@ -2836,7 +2847,7 @@ static void rtl_disable_exit_l1(struct r + case RTL_GIGA_MAC_VER_34 ... RTL_GIGA_MAC_VER_38: + rtl_eri_clear_bits(tp, 0xd4, 0x1f00); + break; +- case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_65: + r8168_mac_ocp_modify(tp, 0xc0ac, 0x1f80, 0); + break; + default: +@@ -2846,6 +2857,8 @@ static void rtl_disable_exit_l1(struct r + + static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable) + { ++ u8 val8; ++ + if (tp->mac_version < RTL_GIGA_MAC_VER_32) + return; + +@@ -2859,11 +2872,19 @@ static void rtl_hw_aspm_clkreq_enable(st + return; + + rtl_mod_config5(tp, 0, ASPM_en); +- rtl_mod_config2(tp, 0, ClkReqEn); ++ switch (tp->mac_version) { ++ case RTL_GIGA_MAC_VER_65: ++ val8 = RTL_R8(tp, INT_CFG0_8125) | INT_CFG0_CLKREQEN; ++ RTL_W8(tp, INT_CFG0_8125, val8); ++ break; ++ default: ++ rtl_mod_config2(tp, 0, ClkReqEn); ++ break; ++ } + + switch (tp->mac_version) { + case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48: +- case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_65: + /* reset ephy tx/rx disable timer */ + r8168_mac_ocp_modify(tp, 0xe094, 0xff00, 0); + /* chip can trigger L1.2 */ +@@ -2875,14 +2896,22 @@ static void rtl_hw_aspm_clkreq_enable(st + } else { + switch (tp->mac_version) { + case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48: +- case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_65: + r8168_mac_ocp_modify(tp, 0xe092, 0x00ff, 0); + break; + default: + break; + } + +- rtl_mod_config2(tp, ClkReqEn, 0); ++ switch (tp->mac_version) { ++ case RTL_GIGA_MAC_VER_65: ++ val8 = RTL_R8(tp, INT_CFG0_8125) & ~INT_CFG0_CLKREQEN; ++ RTL_W8(tp, INT_CFG0_8125, val8); ++ break; ++ default: ++ rtl_mod_config2(tp, ClkReqEn, 0); ++ break; ++ } + rtl_mod_config5(tp, ASPM_en, 0); + } + } +@@ -3678,10 +3707,15 @@ static void rtl_hw_start_8125_common(str + /* disable new tx descriptor format */ + r8168_mac_ocp_modify(tp, 0xeb58, 0x0001, 0x0000); + +- if (tp->mac_version == RTL_GIGA_MAC_VER_63) ++ if (tp->mac_version == RTL_GIGA_MAC_VER_65) ++ RTL_W8(tp, 0xD8, RTL_R8(tp, 0xD8) & ~0x02); ++ ++ if (tp->mac_version == RTL_GIGA_MAC_VER_65) ++ r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0400); ++ else if (tp->mac_version == RTL_GIGA_MAC_VER_63) + r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0200); + else +- r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0400); ++ r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0300); + + if (tp->mac_version == RTL_GIGA_MAC_VER_63) + r8168_mac_ocp_modify(tp, 0xe63e, 0x0c30, 0x0000); +@@ -3694,6 +3728,10 @@ static void rtl_hw_start_8125_common(str + r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0030); + r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000); + r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001); ++ if (tp->mac_version == RTL_GIGA_MAC_VER_65) ++ r8168_mac_ocp_modify(tp, 0xea1c, 0x0300, 0x0000); ++ else ++ r8168_mac_ocp_modify(tp, 0xea1c, 0x0004, 0x0000); + r8168_mac_ocp_modify(tp, 0xe0c0, 0x4f0f, 0x4403); + r8168_mac_ocp_modify(tp, 0xe052, 0x0080, 0x0068); + r8168_mac_ocp_modify(tp, 0xd430, 0x0fff, 0x047f); +@@ -3708,10 +3746,10 @@ static void rtl_hw_start_8125_common(str + + rtl_loop_wait_low(tp, &rtl_mac_ocp_e00e_cond, 1000, 10); + +- if (tp->mac_version == RTL_GIGA_MAC_VER_63) +- rtl8125b_config_eee_mac(tp); +- else ++ if (tp->mac_version == RTL_GIGA_MAC_VER_61) + rtl8125a_config_eee_mac(tp); ++ else ++ rtl8125b_config_eee_mac(tp); + + rtl_disable_rxdvgate(tp); + } +@@ -3755,6 +3793,12 @@ static void rtl_hw_start_8125b(struct rt + rtl_hw_start_8125_common(tp); + } + ++static void rtl_hw_start_8126a(struct rtl8169_private *tp) ++{ ++ rtl_set_def_aspm_entry_latency(tp); ++ rtl_hw_start_8125_common(tp); ++} ++ + static void rtl_hw_config(struct rtl8169_private *tp) + { + static const rtl_generic_fct hw_configs[] = { +@@ -3797,6 +3841,7 @@ static void rtl_hw_config(struct rtl8169 + [RTL_GIGA_MAC_VER_53] = rtl_hw_start_8117, + [RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2, + [RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b, ++ [RTL_GIGA_MAC_VER_65] = rtl_hw_start_8126a, + }; + + if (hw_configs[tp->mac_version]) +@@ -3807,9 +3852,23 @@ static void rtl_hw_start_8125(struct rtl + { + int i; + ++ RTL_W8(tp, INT_CFG0_8125, 0x00); ++ + /* disable interrupt coalescing */ +- for (i = 0xa00; i < 0xb00; i += 4) +- RTL_W32(tp, i, 0); ++ switch (tp->mac_version) { ++ case RTL_GIGA_MAC_VER_61: ++ for (i = 0xa00; i < 0xb00; i += 4) ++ RTL_W32(tp, i, 0); ++ break; ++ case RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_65: ++ for (i = 0xa00; i < 0xa80; i += 4) ++ RTL_W32(tp, i, 0); ++ RTL_W16(tp, INT_CFG1_8125, 0x0000); ++ break; ++ default: ++ break; ++ } + + rtl_hw_config(tp); + } +@@ -3887,8 +3946,7 @@ static int rtl8169_change_mtu(struct net + rtl_jumbo_config(tp); + + switch (tp->mac_version) { +- case RTL_GIGA_MAC_VER_61: +- case RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_65: + rtl8125_set_eee_txidle_timer(tp); + break; + default: +@@ -4037,7 +4095,7 @@ static void rtl8169_cleanup(struct rtl81 + RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq); + rtl_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 666); + break; +- case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_65: + rtl_enable_rxdvgate(tp); + fsleep(2000); + break; +@@ -4188,8 +4246,7 @@ static unsigned int rtl_quirk_packet_pad + + switch (tp->mac_version) { + case RTL_GIGA_MAC_VER_34: +- case RTL_GIGA_MAC_VER_61: +- case RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_65: + padto = max_t(unsigned int, padto, ETH_ZLEN); + break; + default: +@@ -5225,7 +5282,7 @@ static void rtl_hw_initialize(struct rtl + case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48: + rtl_hw_init_8168g(tp); + break; +- case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_63: ++ case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_65: + rtl_hw_init_8125(tp); + break; + default: +--- a/drivers/net/ethernet/realtek/r8169_phy_config.c ++++ b/drivers/net/ethernet/realtek/r8169_phy_config.c +@@ -1102,6 +1102,12 @@ static void rtl8125b_hw_phy_config(struc + rtl8125b_config_eee_phy(phydev); + } + ++static void rtl8126a_hw_phy_config(struct rtl8169_private *tp, ++ struct phy_device *phydev) ++{ ++ r8169_apply_firmware(tp); ++} ++ + void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev, + enum mac_version ver) + { +@@ -1152,6 +1158,7 @@ void r8169_hw_phy_config(struct rtl8169_ + [RTL_GIGA_MAC_VER_53] = rtl8117_hw_phy_config, + [RTL_GIGA_MAC_VER_61] = rtl8125a_2_hw_phy_config, + [RTL_GIGA_MAC_VER_63] = rtl8125b_hw_phy_config, ++ [RTL_GIGA_MAC_VER_65] = rtl8126a_hw_phy_config, + }; + + if (phy_configs[ver]) diff --git a/target/linux/generic/backport-6.6/780-04-v6.9-r8169-improve-checking-for-valid-LED-modes.patch b/target/linux/generic/backport-6.6/780-04-v6.9-r8169-improve-checking-for-valid-LED-modes.patch new file mode 100644 index 00000000000000..ae0c821267f9c0 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-04-v6.9-r8169-improve-checking-for-valid-LED-modes.patch @@ -0,0 +1,81 @@ +From 4c49b6824a607af4760fac4f5c0b9954ab902cef Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Wed, 7 Feb 2024 08:16:40 +0100 +Subject: [PATCH] r8169: improve checking for valid LED modes + +After 3a2746320403 ("leds: trigger: netdev: Display only supported link +speed attribute") the check for valid link modes can be simplified. +In addition factor it out, so that it can be re-used by the upcoming +LED support for RTL8125. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Link: https://lore.kernel.org/r/8876a9f4-7a2d-48c3-8eae-0d834f5c27c5@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_leds.c | 38 ++++++++++++----------- + 1 file changed, 20 insertions(+), 18 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169_leds.c ++++ b/drivers/net/ethernet/realtek/r8169_leds.c +@@ -20,11 +20,6 @@ + + #define RTL8168_NUM_LEDS 3 + +-#define RTL8168_SUPPORTED_MODES \ +- (BIT(TRIGGER_NETDEV_LINK_1000) | BIT(TRIGGER_NETDEV_LINK_100) | \ +- BIT(TRIGGER_NETDEV_LINK_10) | BIT(TRIGGER_NETDEV_RX) | \ +- BIT(TRIGGER_NETDEV_TX)) +- + struct r8169_led_classdev { + struct led_classdev led; + struct net_device *ndev; +@@ -33,28 +28,35 @@ struct r8169_led_classdev { + + #define lcdev_to_r8169_ldev(lcdev) container_of(lcdev, struct r8169_led_classdev, led) + ++static bool r8169_trigger_mode_is_valid(unsigned long flags) ++{ ++ bool rx, tx; ++ ++ if (flags & BIT(TRIGGER_NETDEV_HALF_DUPLEX)) ++ return false; ++ if (flags & BIT(TRIGGER_NETDEV_FULL_DUPLEX)) ++ return false; ++ ++ rx = flags & BIT(TRIGGER_NETDEV_RX); ++ tx = flags & BIT(TRIGGER_NETDEV_TX); ++ ++ return rx == tx; ++} ++ + static int rtl8168_led_hw_control_is_supported(struct led_classdev *led_cdev, + unsigned long flags) + { + struct r8169_led_classdev *ldev = lcdev_to_r8169_ldev(led_cdev); + struct rtl8169_private *tp = netdev_priv(ldev->ndev); + int shift = ldev->index * 4; +- bool rx, tx; + +- if (flags & ~RTL8168_SUPPORTED_MODES) +- goto nosupp; +- +- rx = flags & BIT(TRIGGER_NETDEV_RX); +- tx = flags & BIT(TRIGGER_NETDEV_TX); +- if (rx != tx) +- goto nosupp; ++ if (!r8169_trigger_mode_is_valid(flags)) { ++ /* Switch LED off to indicate that mode isn't supported */ ++ rtl8168_led_mod_ctrl(tp, 0x000f << shift, 0); ++ return -EOPNOTSUPP; ++ } + + return 0; +- +-nosupp: +- /* Switch LED off to indicate that mode isn't supported */ +- rtl8168_led_mod_ctrl(tp, 0x000f << shift, 0); +- return -EOPNOTSUPP; + } + + static int rtl8168_led_hw_control_set(struct led_classdev *led_cdev, diff --git a/target/linux/generic/backport-6.6/780-05-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch b/target/linux/generic/backport-6.6/780-05-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch new file mode 100644 index 00000000000000..742ee578b2321d --- /dev/null +++ b/target/linux/generic/backport-6.6/780-05-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch @@ -0,0 +1,244 @@ +From be51ed104ba9929c741afb718ef7198dbcecef94 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Mon, 12 Feb 2024 19:44:11 +0100 +Subject: [PATCH] r8169: add LED support for RTL8125/RTL8126 + +This adds LED support for RTL8125/RTL8126. + +Note: Due to missing datasheets changing the 5Gbps link mode isn't +supported for RTL8126. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/f982602c-9de3-4ca6-85a3-2c1d118dcb15@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169.h | 3 + + drivers/net/ethernet/realtek/r8169_leds.c | 106 ++++++++++++++++++++++ + drivers/net/ethernet/realtek/r8169_main.c | 61 ++++++++++++- + 3 files changed, 166 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169.h ++++ b/drivers/net/ethernet/realtek/r8169.h +@@ -85,3 +85,6 @@ void r8169_get_led_name(struct rtl8169_p + int rtl8168_get_led_mode(struct rtl8169_private *tp); + int rtl8168_led_mod_ctrl(struct rtl8169_private *tp, u16 mask, u16 val); + void rtl8168_init_leds(struct net_device *ndev); ++int rtl8125_get_led_mode(struct rtl8169_private *tp, int index); ++int rtl8125_set_led_mode(struct rtl8169_private *tp, int index, u16 mode); ++void rtl8125_init_leds(struct net_device *ndev); +--- a/drivers/net/ethernet/realtek/r8169_leds.c ++++ b/drivers/net/ethernet/realtek/r8169_leds.c +@@ -18,7 +18,14 @@ + #define RTL8168_LED_CTRL_LINK_100 BIT(1) + #define RTL8168_LED_CTRL_LINK_10 BIT(0) + ++#define RTL8125_LED_CTRL_ACT BIT(9) ++#define RTL8125_LED_CTRL_LINK_2500 BIT(5) ++#define RTL8125_LED_CTRL_LINK_1000 BIT(3) ++#define RTL8125_LED_CTRL_LINK_100 BIT(1) ++#define RTL8125_LED_CTRL_LINK_10 BIT(0) ++ + #define RTL8168_NUM_LEDS 3 ++#define RTL8125_NUM_LEDS 4 + + struct r8169_led_classdev { + struct led_classdev led; +@@ -157,3 +164,102 @@ void rtl8168_init_leds(struct net_device + for (i = 0; i < RTL8168_NUM_LEDS; i++) + rtl8168_setup_ldev(leds + i, ndev, i); + } ++ ++static int rtl8125_led_hw_control_is_supported(struct led_classdev *led_cdev, ++ unsigned long flags) ++{ ++ struct r8169_led_classdev *ldev = lcdev_to_r8169_ldev(led_cdev); ++ struct rtl8169_private *tp = netdev_priv(ldev->ndev); ++ ++ if (!r8169_trigger_mode_is_valid(flags)) { ++ /* Switch LED off to indicate that mode isn't supported */ ++ rtl8125_set_led_mode(tp, ldev->index, 0); ++ return -EOPNOTSUPP; ++ } ++ ++ return 0; ++} ++ ++static int rtl8125_led_hw_control_set(struct led_classdev *led_cdev, ++ unsigned long flags) ++{ ++ struct r8169_led_classdev *ldev = lcdev_to_r8169_ldev(led_cdev); ++ struct rtl8169_private *tp = netdev_priv(ldev->ndev); ++ u16 mode = 0; ++ ++ if (flags & BIT(TRIGGER_NETDEV_LINK_10)) ++ mode |= RTL8125_LED_CTRL_LINK_10; ++ if (flags & BIT(TRIGGER_NETDEV_LINK_100)) ++ mode |= RTL8125_LED_CTRL_LINK_100; ++ if (flags & BIT(TRIGGER_NETDEV_LINK_1000)) ++ mode |= RTL8125_LED_CTRL_LINK_1000; ++ if (flags & BIT(TRIGGER_NETDEV_LINK_2500)) ++ mode |= RTL8125_LED_CTRL_LINK_2500; ++ if (flags & (BIT(TRIGGER_NETDEV_TX) | BIT(TRIGGER_NETDEV_RX))) ++ mode |= RTL8125_LED_CTRL_ACT; ++ ++ return rtl8125_set_led_mode(tp, ldev->index, mode); ++} ++ ++static int rtl8125_led_hw_control_get(struct led_classdev *led_cdev, ++ unsigned long *flags) ++{ ++ struct r8169_led_classdev *ldev = lcdev_to_r8169_ldev(led_cdev); ++ struct rtl8169_private *tp = netdev_priv(ldev->ndev); ++ int mode; ++ ++ mode = rtl8125_get_led_mode(tp, ldev->index); ++ if (mode < 0) ++ return mode; ++ ++ if (mode & RTL8125_LED_CTRL_LINK_10) ++ *flags |= BIT(TRIGGER_NETDEV_LINK_10); ++ if (mode & RTL8125_LED_CTRL_LINK_100) ++ *flags |= BIT(TRIGGER_NETDEV_LINK_100); ++ if (mode & RTL8125_LED_CTRL_LINK_1000) ++ *flags |= BIT(TRIGGER_NETDEV_LINK_1000); ++ if (mode & RTL8125_LED_CTRL_LINK_2500) ++ *flags |= BIT(TRIGGER_NETDEV_LINK_2500); ++ if (mode & RTL8125_LED_CTRL_ACT) ++ *flags |= BIT(TRIGGER_NETDEV_TX) | BIT(TRIGGER_NETDEV_RX); ++ ++ return 0; ++} ++ ++static void rtl8125_setup_led_ldev(struct r8169_led_classdev *ldev, ++ struct net_device *ndev, int index) ++{ ++ struct rtl8169_private *tp = netdev_priv(ndev); ++ struct led_classdev *led_cdev = &ldev->led; ++ char led_name[LED_MAX_NAME_SIZE]; ++ ++ ldev->ndev = ndev; ++ ldev->index = index; ++ ++ r8169_get_led_name(tp, index, led_name, LED_MAX_NAME_SIZE); ++ led_cdev->name = led_name; ++ led_cdev->hw_control_trigger = "netdev"; ++ led_cdev->flags |= LED_RETAIN_AT_SHUTDOWN; ++ led_cdev->hw_control_is_supported = rtl8125_led_hw_control_is_supported; ++ led_cdev->hw_control_set = rtl8125_led_hw_control_set; ++ led_cdev->hw_control_get = rtl8125_led_hw_control_get; ++ led_cdev->hw_control_get_device = r8169_led_hw_control_get_device; ++ ++ /* ignore errors */ ++ devm_led_classdev_register(&ndev->dev, led_cdev); ++} ++ ++void rtl8125_init_leds(struct net_device *ndev) ++{ ++ /* bind resource mgmt to netdev */ ++ struct device *dev = &ndev->dev; ++ struct r8169_led_classdev *leds; ++ int i; ++ ++ leds = devm_kcalloc(dev, RTL8125_NUM_LEDS, sizeof(*leds), GFP_KERNEL); ++ if (!leds) ++ return; ++ ++ for (i = 0; i < RTL8125_NUM_LEDS; i++) ++ rtl8125_setup_led_ldev(leds + i, ndev, i); ++} +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -334,17 +334,23 @@ enum rtl8168_registers { + }; + + enum rtl8125_registers { ++ LEDSEL0 = 0x18, + INT_CFG0_8125 = 0x34, + #define INT_CFG0_ENABLE_8125 BIT(0) + #define INT_CFG0_CLKREQEN BIT(3) + IntrMask_8125 = 0x38, + IntrStatus_8125 = 0x3c, + INT_CFG1_8125 = 0x7a, ++ LEDSEL2 = 0x84, ++ LEDSEL1 = 0x86, + TxPoll_8125 = 0x90, ++ LEDSEL3 = 0x96, + MAC0_BKP = 0x19e0, + EEE_TXIDLE_TIMER_8125 = 0x6048, + }; + ++#define LEDSEL_MASK_8125 0x23f ++ + #define RX_VLAN_INNER_8125 BIT(22) + #define RX_VLAN_OUTER_8125 BIT(23) + #define RX_VLAN_8125 (RX_VLAN_INNER_8125 | RX_VLAN_OUTER_8125) +@@ -835,6 +841,51 @@ int rtl8168_get_led_mode(struct rtl8169_ + return ret; + } + ++static int rtl8125_get_led_reg(int index) ++{ ++ static const int led_regs[] = { LEDSEL0, LEDSEL1, LEDSEL2, LEDSEL3 }; ++ ++ return led_regs[index]; ++} ++ ++int rtl8125_set_led_mode(struct rtl8169_private *tp, int index, u16 mode) ++{ ++ int reg = rtl8125_get_led_reg(index); ++ struct device *dev = tp_to_dev(tp); ++ int ret; ++ u16 val; ++ ++ ret = pm_runtime_resume_and_get(dev); ++ if (ret < 0) ++ return ret; ++ ++ mutex_lock(&tp->led_lock); ++ val = RTL_R16(tp, reg) & ~LEDSEL_MASK_8125; ++ RTL_W16(tp, reg, val | mode); ++ mutex_unlock(&tp->led_lock); ++ ++ pm_runtime_put_sync(dev); ++ ++ return 0; ++} ++ ++int rtl8125_get_led_mode(struct rtl8169_private *tp, int index) ++{ ++ int reg = rtl8125_get_led_reg(index); ++ struct device *dev = tp_to_dev(tp); ++ int ret; ++ ++ ret = pm_runtime_resume_and_get(dev); ++ if (ret < 0) ++ return ret; ++ ++ ret = RTL_R16(tp, reg); ++ ++ pm_runtime_put_sync(dev); ++ ++ return ret; ++} ++ + void r8169_get_led_name(struct rtl8169_private *tp, int idx, + char *buf, int buf_len) + { +@@ -5530,10 +5581,12 @@ static int rtl_init_one(struct pci_dev * + if (rc) + return rc; + +- if (IS_ENABLED(CONFIG_R8169_LEDS) && +- tp->mac_version > RTL_GIGA_MAC_VER_06 && +- tp->mac_version < RTL_GIGA_MAC_VER_61) +- rtl8168_init_leds(dev); ++ if (IS_ENABLED(CONFIG_R8169_LEDS)) { ++ if (rtl_is_8125(tp)) ++ rtl8125_init_leds(dev); ++ else if (tp->mac_version > RTL_GIGA_MAC_VER_06) ++ rtl8168_init_leds(dev); ++ } + + netdev_info(dev, "%s, %pM, XID %03x, IRQ %d\n", + rtl_chip_infos[chipset].name, dev->dev_addr, xid, tp->irq); diff --git a/target/linux/generic/backport-6.6/780-06-v6.9-r8169-add-MODULE_FIRMWARE-entry-for-RTL8126A.patch b/target/linux/generic/backport-6.6/780-06-v6.9-r8169-add-MODULE_FIRMWARE-entry-for-RTL8126A.patch new file mode 100644 index 00000000000000..a6175c824e6625 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-06-v6.9-r8169-add-MODULE_FIRMWARE-entry-for-RTL8126A.patch @@ -0,0 +1,25 @@ +From f4d3e595c0000ce39dec7e4799ea42ce42ab6867 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Sat, 17 Feb 2024 15:48:23 +0100 +Subject: [PATCH] r8169: add MODULE_FIRMWARE entry for RTL8126A + +Add the missing MODULE_FIRMWARE entry for RTL8126A. + +Signed-off-by: Heiner Kallweit +Reviewed-by: Simon Horman +Link: https://lore.kernel.org/r/47ef79d2-59c4-4d44-9595-366c70c4ad87@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_main.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -680,6 +680,7 @@ MODULE_FIRMWARE(FIRMWARE_8168FP_3); + MODULE_FIRMWARE(FIRMWARE_8107E_2); + MODULE_FIRMWARE(FIRMWARE_8125A_3); + MODULE_FIRMWARE(FIRMWARE_8125B_2); ++MODULE_FIRMWARE(FIRMWARE_8126A_2); + + static inline struct device *tp_to_dev(struct rtl8169_private *tp) + { diff --git a/target/linux/generic/backport-6.6/780-07-v6.10-r8169-add-support-for-RTL8168M.patch b/target/linux/generic/backport-6.6/780-07-v6.10-r8169-add-support-for-RTL8168M.patch new file mode 100644 index 00000000000000..557b8b149191cc --- /dev/null +++ b/target/linux/generic/backport-6.6/780-07-v6.10-r8169-add-support-for-RTL8168M.patch @@ -0,0 +1,30 @@ +From 39f59c72ad3a1eaab9a60f0671bc94d2bc826d21 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Sun, 7 Apr 2024 23:19:25 +0200 +Subject: [PATCH] r8169: add support for RTL8168M +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +A user reported an unknown chip version. According to the r8168 vendor +driver it's called RTL8168M, but handling is identical to RTL8168H. +So let's simply treat it as RTL8168H. + +Tested-by: Евгений +Signed-off-by: Heiner Kallweit +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/realtek/r8169_main.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -2212,6 +2212,8 @@ static enum mac_version rtl8169_get_mac_ + * the wild. Let's disable detection. + * { 0x7cf, 0x540, RTL_GIGA_MAC_VER_45 }, + */ ++ /* Realtek calls it RTL8168M, but it's handled like RTL8168H */ ++ { 0x7cf, 0x6c0, RTL_GIGA_MAC_VER_46 }, + + /* 8168G family. */ + { 0x7cf, 0x5c8, RTL_GIGA_MAC_VER_44 }, diff --git a/target/linux/generic/backport-6.6/780-08-v6.10-r8169-fix-LED-related-deadlock-on-module-removal.patch b/target/linux/generic/backport-6.6/780-08-v6.10-r8169-fix-LED-related-deadlock-on-module-removal.patch new file mode 100644 index 00000000000000..52019869a8579f --- /dev/null +++ b/target/linux/generic/backport-6.6/780-08-v6.10-r8169-fix-LED-related-deadlock-on-module-removal.patch @@ -0,0 +1,147 @@ +From 19fa4f2a85d777a8052e869c1b892a2f7556569d Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Mon, 8 Apr 2024 20:47:40 +0200 +Subject: [PATCH] r8169: fix LED-related deadlock on module removal + +Binding devm_led_classdev_register() to the netdev is problematic +because on module removal we get a RTNL-related deadlock. Fix this +by avoiding the device-managed LED functions. + +Note: We can safely call led_classdev_unregister() for a LED even +if registering it failed, because led_classdev_unregister() detects +this and is a no-op in this case. + +Fixes: 18764b883e15 ("r8169: add support for LED's on RTL8168/RTL8101") +Cc: stable@vger.kernel.org +Reported-by: Lukas Wunner +Signed-off-by: Heiner Kallweit +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/realtek/r8169.h | 6 ++-- + drivers/net/ethernet/realtek/r8169_leds.c | 35 +++++++++++++++-------- + drivers/net/ethernet/realtek/r8169_main.c | 8 ++++-- + 3 files changed, 33 insertions(+), 16 deletions(-) + +--- a/drivers/net/ethernet/realtek/r8169.h ++++ b/drivers/net/ethernet/realtek/r8169.h +@@ -73,6 +73,7 @@ enum mac_version { + }; + + struct rtl8169_private; ++struct r8169_led_classdev; + + void r8169_apply_firmware(struct rtl8169_private *tp); + u16 rtl8168h_2_get_adc_bias_ioffset(struct rtl8169_private *tp); +@@ -84,7 +85,8 @@ void r8169_get_led_name(struct rtl8169_p + char *buf, int buf_len); + int rtl8168_get_led_mode(struct rtl8169_private *tp); + int rtl8168_led_mod_ctrl(struct rtl8169_private *tp, u16 mask, u16 val); +-void rtl8168_init_leds(struct net_device *ndev); ++struct r8169_led_classdev *rtl8168_init_leds(struct net_device *ndev); + int rtl8125_get_led_mode(struct rtl8169_private *tp, int index); + int rtl8125_set_led_mode(struct rtl8169_private *tp, int index, u16 mode); +-void rtl8125_init_leds(struct net_device *ndev); ++struct r8169_led_classdev *rtl8125_init_leds(struct net_device *ndev); ++void r8169_remove_leds(struct r8169_led_classdev *leds); +--- a/drivers/net/ethernet/realtek/r8169_leds.c ++++ b/drivers/net/ethernet/realtek/r8169_leds.c +@@ -147,22 +147,22 @@ static void rtl8168_setup_ldev(struct r8 + led_cdev->hw_control_get_device = r8169_led_hw_control_get_device; + + /* ignore errors */ +- devm_led_classdev_register(&ndev->dev, led_cdev); ++ led_classdev_register(&ndev->dev, led_cdev); + } + +-void rtl8168_init_leds(struct net_device *ndev) ++struct r8169_led_classdev *rtl8168_init_leds(struct net_device *ndev) + { +- /* bind resource mgmt to netdev */ +- struct device *dev = &ndev->dev; + struct r8169_led_classdev *leds; + int i; + +- leds = devm_kcalloc(dev, RTL8168_NUM_LEDS, sizeof(*leds), GFP_KERNEL); ++ leds = kcalloc(RTL8168_NUM_LEDS + 1, sizeof(*leds), GFP_KERNEL); + if (!leds) +- return; ++ return NULL; + + for (i = 0; i < RTL8168_NUM_LEDS; i++) + rtl8168_setup_ldev(leds + i, ndev, i); ++ ++ return leds; + } + + static int rtl8125_led_hw_control_is_supported(struct led_classdev *led_cdev, +@@ -246,20 +246,31 @@ static void rtl8125_setup_led_ldev(struc + led_cdev->hw_control_get_device = r8169_led_hw_control_get_device; + + /* ignore errors */ +- devm_led_classdev_register(&ndev->dev, led_cdev); ++ led_classdev_register(&ndev->dev, led_cdev); + } + +-void rtl8125_init_leds(struct net_device *ndev) ++struct r8169_led_classdev *rtl8125_init_leds(struct net_device *ndev) + { +- /* bind resource mgmt to netdev */ +- struct device *dev = &ndev->dev; + struct r8169_led_classdev *leds; + int i; + +- leds = devm_kcalloc(dev, RTL8125_NUM_LEDS, sizeof(*leds), GFP_KERNEL); ++ leds = kcalloc(RTL8125_NUM_LEDS + 1, sizeof(*leds), GFP_KERNEL); + if (!leds) +- return; ++ return NULL; + + for (i = 0; i < RTL8125_NUM_LEDS; i++) + rtl8125_setup_led_ldev(leds + i, ndev, i); ++ ++ return leds; ++} ++ ++void r8169_remove_leds(struct r8169_led_classdev *leds) ++{ ++ if (!leds) ++ return; ++ ++ for (struct r8169_led_classdev *l = leds; l->ndev; l++) ++ led_classdev_unregister(&l->led); ++ ++ kfree(leds); + } +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -651,6 +651,8 @@ struct rtl8169_private { + const char *fw_name; + struct rtl_fw *rtl_fw; + ++ struct r8169_led_classdev *leds; ++ + u32 ocp_base; + }; + +@@ -5126,6 +5128,8 @@ static void rtl_remove_one(struct pci_de + + cancel_work_sync(&tp->wk.work); + ++ r8169_remove_leds(tp->leds); ++ + unregister_netdev(tp->dev); + + if (tp->dash_type != RTL_DASH_NONE) +@@ -5586,9 +5590,9 @@ static int rtl_init_one(struct pci_dev * + + if (IS_ENABLED(CONFIG_R8169_LEDS)) { + if (rtl_is_8125(tp)) +- rtl8125_init_leds(dev); ++ tp->leds = rtl8125_init_leds(dev); + else if (tp->mac_version > RTL_GIGA_MAC_VER_06) +- rtl8168_init_leds(dev); ++ tp->leds = rtl8168_init_leds(dev); + } + + netdev_info(dev, "%s, %pM, XID %03x, IRQ %d\n", diff --git a/target/linux/generic/backport-6.6/780-09-v6.10-r8169-add-missing-conditional-compiling-for-call-to-.patch b/target/linux/generic/backport-6.6/780-09-v6.10-r8169-add-missing-conditional-compiling-for-call-to-.patch new file mode 100644 index 00000000000000..cfe552046e4e86 --- /dev/null +++ b/target/linux/generic/backport-6.6/780-09-v6.10-r8169-add-missing-conditional-compiling-for-call-to-.patch @@ -0,0 +1,31 @@ +From 97e176fcbbf3c0f2bd410c9b241177c051f57176 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Wed, 10 Apr 2024 15:11:28 +0200 +Subject: [PATCH] r8169: add missing conditional compiling for call to + r8169_remove_leds + +Add missing dependency on CONFIG_R8169_LEDS. As-is a link error occurs +if config option CONFIG_R8169_LEDS isn't enabled. + +Fixes: 19fa4f2a85d7 ("r8169: fix LED-related deadlock on module removal") +Reported-by: Venkat Rao Bagalkote +Signed-off-by: Heiner Kallweit +Tested-By: Venkat Rao Bagalkote +Link: https://lore.kernel.org/r/d080038c-eb6b-45ac-9237-b8c1cdd7870f@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/realtek/r8169_main.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -5128,7 +5128,8 @@ static void rtl_remove_one(struct pci_de + + cancel_work_sync(&tp->wk.work); + +- r8169_remove_leds(tp->leds); ++ if (IS_ENABLED(CONFIG_R8169_LEDS)) ++ r8169_remove_leds(tp->leds); + + unregister_netdev(tp->dev); + diff --git a/target/linux/generic/backport-6.6/791-v6.11-01-net-phy-aquantia-move-priv-and-hw-stat-to-header.patch b/target/linux/generic/backport-6.6/791-v6.11-01-net-phy-aquantia-move-priv-and-hw-stat-to-header.patch new file mode 100644 index 00000000000000..62137c3f3ad5a1 --- /dev/null +++ b/target/linux/generic/backport-6.6/791-v6.11-01-net-phy-aquantia-move-priv-and-hw-stat-to-header.patch @@ -0,0 +1,122 @@ +From c11d5dbbe73fa7b450aaa77bb18df86a9714b422 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sat, 1 Jun 2024 01:35:02 +0200 +Subject: [PATCH 1/2] net: phy: aquantia: move priv and hw stat to header + +In preparation for LEDs support, move priv and hw stat to header to +reference priv struct also in other .c outside aquantia.main + +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/phy/aquantia/aquantia.h | 38 ++++++++++++++++++++++++ + drivers/net/phy/aquantia/aquantia_main.c | 37 ----------------------- + 2 files changed, 38 insertions(+), 37 deletions(-) + +--- a/drivers/net/phy/aquantia/aquantia.h ++++ b/drivers/net/phy/aquantia/aquantia.h +@@ -82,6 +82,18 @@ + #define VEND1_GLOBAL_RSVD_STAT9_MODE GENMASK(7, 0) + #define VEND1_GLOBAL_RSVD_STAT9_1000BT2 0x23 + ++/* MDIO_MMD_C22EXT */ ++#define MDIO_C22EXT_STAT_SGMII_RX_GOOD_FRAMES 0xd292 ++#define MDIO_C22EXT_STAT_SGMII_RX_BAD_FRAMES 0xd294 ++#define MDIO_C22EXT_STAT_SGMII_RX_FALSE_CARRIER 0xd297 ++#define MDIO_C22EXT_STAT_SGMII_TX_GOOD_FRAMES 0xd313 ++#define MDIO_C22EXT_STAT_SGMII_TX_BAD_FRAMES 0xd315 ++#define MDIO_C22EXT_STAT_SGMII_TX_FALSE_CARRIER 0xd317 ++#define MDIO_C22EXT_STAT_SGMII_TX_COLLISIONS 0xd318 ++#define MDIO_C22EXT_STAT_SGMII_TX_LINE_COLLISIONS 0xd319 ++#define MDIO_C22EXT_STAT_SGMII_TX_FRAME_ALIGN_ERR 0xd31a ++#define MDIO_C22EXT_STAT_SGMII_TX_RUNT_FRAMES 0xd31b ++ + #define VEND1_GLOBAL_INT_STD_STATUS 0xfc00 + #define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01 + +@@ -108,6 +120,32 @@ + #define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1) + #define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0) + ++struct aqr107_hw_stat { ++ const char *name; ++ int reg; ++ int size; ++}; ++ ++#define SGMII_STAT(n, r, s) { n, MDIO_C22EXT_STAT_SGMII_ ## r, s } ++static const struct aqr107_hw_stat aqr107_hw_stats[] = { ++ SGMII_STAT("sgmii_rx_good_frames", RX_GOOD_FRAMES, 26), ++ SGMII_STAT("sgmii_rx_bad_frames", RX_BAD_FRAMES, 26), ++ SGMII_STAT("sgmii_rx_false_carrier_events", RX_FALSE_CARRIER, 8), ++ SGMII_STAT("sgmii_tx_good_frames", TX_GOOD_FRAMES, 26), ++ SGMII_STAT("sgmii_tx_bad_frames", TX_BAD_FRAMES, 26), ++ SGMII_STAT("sgmii_tx_false_carrier_events", TX_FALSE_CARRIER, 8), ++ SGMII_STAT("sgmii_tx_collisions", TX_COLLISIONS, 8), ++ SGMII_STAT("sgmii_tx_line_collisions", TX_LINE_COLLISIONS, 8), ++ SGMII_STAT("sgmii_tx_frame_alignment_err", TX_FRAME_ALIGN_ERR, 16), ++ SGMII_STAT("sgmii_tx_runt_frames", TX_RUNT_FRAMES, 22), ++}; ++ ++#define AQR107_SGMII_STAT_SZ ARRAY_SIZE(aqr107_hw_stats) ++ ++struct aqr107_priv { ++ u64 sgmii_stats[AQR107_SGMII_STAT_SZ]; ++}; ++ + #if IS_REACHABLE(CONFIG_HWMON) + int aqr_hwmon_probe(struct phy_device *phydev); + #else +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c +@@ -84,49 +84,12 @@ + #define MDIO_AN_RX_VEND_STAT3 0xe832 + #define MDIO_AN_RX_VEND_STAT3_AFR BIT(0) + +-/* MDIO_MMD_C22EXT */ +-#define MDIO_C22EXT_STAT_SGMII_RX_GOOD_FRAMES 0xd292 +-#define MDIO_C22EXT_STAT_SGMII_RX_BAD_FRAMES 0xd294 +-#define MDIO_C22EXT_STAT_SGMII_RX_FALSE_CARRIER 0xd297 +-#define MDIO_C22EXT_STAT_SGMII_TX_GOOD_FRAMES 0xd313 +-#define MDIO_C22EXT_STAT_SGMII_TX_BAD_FRAMES 0xd315 +-#define MDIO_C22EXT_STAT_SGMII_TX_FALSE_CARRIER 0xd317 +-#define MDIO_C22EXT_STAT_SGMII_TX_COLLISIONS 0xd318 +-#define MDIO_C22EXT_STAT_SGMII_TX_LINE_COLLISIONS 0xd319 +-#define MDIO_C22EXT_STAT_SGMII_TX_FRAME_ALIGN_ERR 0xd31a +-#define MDIO_C22EXT_STAT_SGMII_TX_RUNT_FRAMES 0xd31b +- + /* Sleep and timeout for checking if the Processor-Intensive + * MDIO operation is finished + */ + #define AQR107_OP_IN_PROG_SLEEP 1000 + #define AQR107_OP_IN_PROG_TIMEOUT 100000 + +-struct aqr107_hw_stat { +- const char *name; +- int reg; +- int size; +-}; +- +-#define SGMII_STAT(n, r, s) { n, MDIO_C22EXT_STAT_SGMII_ ## r, s } +-static const struct aqr107_hw_stat aqr107_hw_stats[] = { +- SGMII_STAT("sgmii_rx_good_frames", RX_GOOD_FRAMES, 26), +- SGMII_STAT("sgmii_rx_bad_frames", RX_BAD_FRAMES, 26), +- SGMII_STAT("sgmii_rx_false_carrier_events", RX_FALSE_CARRIER, 8), +- SGMII_STAT("sgmii_tx_good_frames", TX_GOOD_FRAMES, 26), +- SGMII_STAT("sgmii_tx_bad_frames", TX_BAD_FRAMES, 26), +- SGMII_STAT("sgmii_tx_false_carrier_events", TX_FALSE_CARRIER, 8), +- SGMII_STAT("sgmii_tx_collisions", TX_COLLISIONS, 8), +- SGMII_STAT("sgmii_tx_line_collisions", TX_LINE_COLLISIONS, 8), +- SGMII_STAT("sgmii_tx_frame_alignment_err", TX_FRAME_ALIGN_ERR, 16), +- SGMII_STAT("sgmii_tx_runt_frames", TX_RUNT_FRAMES, 22), +-}; +-#define AQR107_SGMII_STAT_SZ ARRAY_SIZE(aqr107_hw_stats) +- +-struct aqr107_priv { +- u64 sgmii_stats[AQR107_SGMII_STAT_SZ]; +-}; +- + static int aqr107_get_sset_count(struct phy_device *phydev) + { + return AQR107_SGMII_STAT_SZ; diff --git a/target/linux/generic/pending-6.6/743-net-phy-aquantia-add-support-for-PHY-LEDs.patch b/target/linux/generic/backport-6.6/791-v6.11-02-net-phy-aquantia-add-support-for-PHY-LEDs.patch similarity index 65% rename from target/linux/generic/pending-6.6/743-net-phy-aquantia-add-support-for-PHY-LEDs.patch rename to target/linux/generic/backport-6.6/791-v6.11-02-net-phy-aquantia-add-support-for-PHY-LEDs.patch index ca3a2b5c87accd..dcbe62c68233b0 100644 --- a/target/linux/generic/pending-6.6/743-net-phy-aquantia-add-support-for-PHY-LEDs.patch +++ b/target/linux/generic/backport-6.6/791-v6.11-02-net-phy-aquantia-add-support-for-PHY-LEDs.patch @@ -1,7 +1,7 @@ -From c6a1759365fc35463138a7d9e335ee53f384b8df Mon Sep 17 00:00:00 2001 +From 61578f67937881abf54c8bd258eb913312dbe4c1 Mon Sep 17 00:00:00 2001 From: Daniel Golle -Date: Fri, 10 May 2024 02:53:52 +0100 -Subject: [PATCH] net: phy: aquantia: add support for PHY LEDs +Date: Sat, 1 Jun 2024 01:35:03 +0200 +Subject: [PATCH 2/2] net: phy: aquantia: add support for PHY LEDs Aquantia Ethernet PHYs got 3 LED output pins which are typically used to indicate link status and activity. @@ -10,80 +10,97 @@ with the 'netdev' trigger as well as software-driven forced control of the LEDs. Signed-off-by: Daniel Golle +[ rework indentation, fix checkpatch error and improve some functions ] +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller --- - drivers/net/phy/aquantia/Makefile | 3 + - drivers/net/phy/aquantia/aquantia.h | 84 +++++++++++++ - drivers/net/phy/aquantia/aquantia_leds.c | 152 +++++++++++++++++++++++ - drivers/net/phy/aquantia/aquantia_main.c | 127 +++++++++++++------ - 4 files changed, 329 insertions(+), 37 deletions(-) + drivers/net/phy/aquantia/Makefile | 2 +- + drivers/net/phy/aquantia/aquantia.h | 40 ++++++ + drivers/net/phy/aquantia/aquantia_leds.c | 150 +++++++++++++++++++++++ + drivers/net/phy/aquantia/aquantia_main.c | 63 +++++++++- + 4 files changed, 252 insertions(+), 3 deletions(-) create mode 100644 drivers/net/phy/aquantia/aquantia_leds.c --- a/drivers/net/phy/aquantia/Makefile +++ b/drivers/net/phy/aquantia/Makefile -@@ -3,4 +3,7 @@ aquantia-objs += aquantia_main.o aquan +@@ -1,5 +1,5 @@ + # SPDX-License-Identifier: GPL-2.0 +-aquantia-objs += aquantia_main.o aquantia_firmware.o ++aquantia-objs += aquantia_main.o aquantia_firmware.o aquantia_leds.o ifdef CONFIG_HWMON aquantia-objs += aquantia_hwmon.o endif -+ifdef CONFIG_PHYLIB_LEDS -+aquantia-objs += aquantia_leds.o -+endif - obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o --- a/drivers/net/phy/aquantia/aquantia.h +++ b/drivers/net/phy/aquantia/aquantia.h -@@ -62,6 +62,26 @@ - #define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 - #define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 - #define VEND1_THERMAL_PROV_LOW_TEMP_WARN 0xc424 -+ -+#define AQR_NUM_LEDS 3 -+ +@@ -58,6 +58,28 @@ + #define VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_OVD BIT(6) + #define VEND1_GLOBAL_CONTROL2_UP_RUN_STALL BIT(0) + +#define VEND1_GLOBAL_LED_PROV 0xc430 -+#define AQR_LED_PROV(x) (VEND1_GLOBAL_LED_PROV + x) -+#define VEND1_GLOBAL_LED_PROV_ACT_STRETCH GENMASK(0, 1) -+#define VEND1_GLOBAL_LED_PROV_TX_ACT BIT(2) -+#define VEND1_GLOBAL_LED_PROV_RX_ACT BIT(3) -+#define VEND1_GLOBAL_LED_PROV_LINK_MASK (GENMASK(15, 14) | GENMASK(8, 5)) -+#define VEND1_GLOBAL_LED_PROV_LINK100 BIT(5) -+#define VEND1_GLOBAL_LED_PROV_LINK1000 BIT(6) -+#define VEND1_GLOBAL_LED_PROV_LINK10000 BIT(7) -+#define VEND1_GLOBAL_LED_PROV_FORCE_ON BIT(8) ++#define AQR_LED_PROV(x) (VEND1_GLOBAL_LED_PROV + (x)) +#define VEND1_GLOBAL_LED_PROV_LINK2500 BIT(14) +#define VEND1_GLOBAL_LED_PROV_LINK5000 BIT(15) ++#define VEND1_GLOBAL_LED_PROV_FORCE_ON BIT(8) ++#define VEND1_GLOBAL_LED_PROV_LINK10000 BIT(7) ++#define VEND1_GLOBAL_LED_PROV_LINK1000 BIT(6) ++#define VEND1_GLOBAL_LED_PROV_LINK100 BIT(5) ++#define VEND1_GLOBAL_LED_PROV_RX_ACT BIT(3) ++#define VEND1_GLOBAL_LED_PROV_TX_ACT BIT(2) ++#define VEND1_GLOBAL_LED_PROV_ACT_STRETCH GENMASK(0, 1) ++ ++#define VEND1_GLOBAL_LED_PROV_LINK_MASK (VEND1_GLOBAL_LED_PROV_LINK100 | \ ++ VEND1_GLOBAL_LED_PROV_LINK1000 | \ ++ VEND1_GLOBAL_LED_PROV_LINK10000 | \ ++ VEND1_GLOBAL_LED_PROV_LINK5000 | \ ++ VEND1_GLOBAL_LED_PROV_LINK2500) + +#define VEND1_GLOBAL_LED_DRIVE 0xc438 +#define VEND1_GLOBAL_LED_DRIVE_VDD BIT(1) -+#define AQR_LED_DRIVE(x) (VEND1_GLOBAL_LED_DRIVE + x) ++#define AQR_LED_DRIVE(x) (VEND1_GLOBAL_LED_DRIVE + (x)) ++ + #define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421 + #define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 + #define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 +@@ -120,6 +142,8 @@ + #define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1) + #define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0) + ++#define AQR_MAX_LEDS 3 + - #define VEND1_THERMAL_STAT1 0xc820 - #define VEND1_THERMAL_STAT2 0xc821 - #define VEND1_THERMAL_STAT2_VALID BIT(0) -@@ -115,3 +135,23 @@ static inline int aqr_hwmon_probe(struct + struct aqr107_hw_stat { + const char *name; + int reg; +@@ -144,6 +168,7 @@ static const struct aqr107_hw_stat aqr10 + + struct aqr107_priv { + u64 sgmii_stats[AQR107_SGMII_STAT_SZ]; ++ unsigned long leds_active_low; + }; + + #if IS_REACHABLE(CONFIG_HWMON) +@@ -153,3 +178,18 @@ static inline int aqr_hwmon_probe(struct #endif int aqr_firmware_load(struct phy_device *phydev); + -+#if IS_ENABLED(CONFIG_PHYLIB_LEDS) +int aqr_phy_led_blink_set(struct phy_device *phydev, u8 index, -+ unsigned long *delay_on, -+ unsigned long *delay_off); -+ ++ unsigned long *delay_on, ++ unsigned long *delay_off); +int aqr_phy_led_brightness_set(struct phy_device *phydev, + u8 index, enum led_brightness value); -+ +int aqr_phy_led_hw_is_supported(struct phy_device *phydev, u8 index, + unsigned long rules); -+ +int aqr_phy_led_hw_control_get(struct phy_device *phydev, u8 index, + unsigned long *rules); -+ +int aqr_phy_led_hw_control_set(struct phy_device *phydev, u8 index, + unsigned long rules); -+ -+int aqr_phy_led_polarity_set(struct phy_device *phydev, int index, unsigned long modes); -+#endif ++int aqr_phy_led_active_low_set(struct phy_device *phydev, int index, bool enable); ++int aqr_phy_led_polarity_set(struct phy_device *phydev, int index, ++ unsigned long modes); --- /dev/null +++ b/drivers/net/phy/aquantia/aquantia_leds.c -@@ -0,0 +1,140 @@ +@@ -0,0 +1,150 @@ +// SPDX-License-Identifier: GPL-2.0 +/* LED driver for Aquantia PHY + * @@ -97,29 +114,30 @@ Signed-off-by: Daniel Golle +int aqr_phy_led_brightness_set(struct phy_device *phydev, + u8 index, enum led_brightness value) +{ -+ if (index > 2) ++ if (index >= AQR_MAX_LEDS) + return -EINVAL; + -+ return phy_modify_mmd(phydev, MDIO_MMD_VEND1, AQR_LED_PROV(index), VEND1_GLOBAL_LED_PROV_LINK_MASK | -+ VEND1_GLOBAL_LED_PROV_FORCE_ON | -+ VEND1_GLOBAL_LED_PROV_RX_ACT | -+ VEND1_GLOBAL_LED_PROV_TX_ACT, -+ value ? VEND1_GLOBAL_LED_PROV_FORCE_ON : 0); ++ return phy_modify_mmd(phydev, MDIO_MMD_VEND1, AQR_LED_PROV(index), ++ VEND1_GLOBAL_LED_PROV_LINK_MASK | ++ VEND1_GLOBAL_LED_PROV_FORCE_ON | ++ VEND1_GLOBAL_LED_PROV_RX_ACT | ++ VEND1_GLOBAL_LED_PROV_TX_ACT, ++ value ? VEND1_GLOBAL_LED_PROV_FORCE_ON : 0); +} + -+static const unsigned long supported_triggers = (BIT(TRIGGER_NETDEV_LINK) | -+ BIT(TRIGGER_NETDEV_LINK_100) | -+ BIT(TRIGGER_NETDEV_LINK_1000) | -+ BIT(TRIGGER_NETDEV_LINK_2500) | -+ BIT(TRIGGER_NETDEV_LINK_5000) | ++static const unsigned long supported_triggers = (BIT(TRIGGER_NETDEV_LINK) | ++ BIT(TRIGGER_NETDEV_LINK_100) | ++ BIT(TRIGGER_NETDEV_LINK_1000) | ++ BIT(TRIGGER_NETDEV_LINK_2500) | ++ BIT(TRIGGER_NETDEV_LINK_5000) | + BIT(TRIGGER_NETDEV_LINK_10000) | -+ BIT(TRIGGER_NETDEV_RX) | ++ BIT(TRIGGER_NETDEV_RX) | + BIT(TRIGGER_NETDEV_TX)); + +int aqr_phy_led_hw_is_supported(struct phy_device *phydev, u8 index, + unsigned long rules) +{ -+ if (index >= AQR_NUM_LEDS) ++ if (index >= AQR_MAX_LEDS) + return -EINVAL; + + /* All combinations of the supported triggers are allowed */ @@ -134,7 +152,7 @@ Signed-off-by: Daniel Golle +{ + int val; + -+ if (index >= AQR_NUM_LEDS) ++ if (index >= AQR_MAX_LEDS) + return -EINVAL; + + val = phy_read_mmd(phydev, MDIO_MMD_VEND1, AQR_LED_PROV(index)); @@ -171,7 +189,7 @@ Signed-off-by: Daniel Golle +{ + u16 val = 0; + -+ if (index >= AQR_NUM_LEDS) ++ if (index >= AQR_MAX_LEDS) + return -EINVAL; + + if (rules & (BIT(TRIGGER_NETDEV_LINK_100) | BIT(TRIGGER_NETDEV_LINK))) @@ -196,18 +214,25 @@ Signed-off-by: Daniel Golle + val |= VEND1_GLOBAL_LED_PROV_TX_ACT; + + return phy_modify_mmd(phydev, MDIO_MMD_VEND1, AQR_LED_PROV(index), -+ VEND1_GLOBAL_LED_PROV_LINK_MASK | -+ VEND1_GLOBAL_LED_PROV_FORCE_ON | -+ VEND1_GLOBAL_LED_PROV_RX_ACT | -+ VEND1_GLOBAL_LED_PROV_TX_ACT, val); ++ VEND1_GLOBAL_LED_PROV_LINK_MASK | ++ VEND1_GLOBAL_LED_PROV_FORCE_ON | ++ VEND1_GLOBAL_LED_PROV_RX_ACT | ++ VEND1_GLOBAL_LED_PROV_TX_ACT, val); ++} ++ ++int aqr_phy_led_active_low_set(struct phy_device *phydev, int index, bool enable) ++{ ++ return phy_modify_mmd(phydev, MDIO_MMD_VEND1, AQR_LED_DRIVE(index), ++ VEND1_GLOBAL_LED_DRIVE_VDD, enable); +} + +int aqr_phy_led_polarity_set(struct phy_device *phydev, int index, unsigned long modes) +{ ++ struct aqr107_priv *priv = phydev->priv; + bool active_low = false; + u32 mode; + -+ if (index >= AQR_NUM_LEDS) ++ if (index >= AQR_MAX_LEDS) + return -EINVAL; + + for_each_set_bit(mode, &modes, __PHY_LED_MODES_NUM) { @@ -216,153 +241,155 @@ Signed-off-by: Daniel Golle + active_low = true; + break; + default: -+ return -EINVAL; ++ return -EINVAL; + } + } + -+ return phy_modify_mmd(phydev, MDIO_MMD_VEND1, AQR_LED_DRIVE(index), -+ VEND1_GLOBAL_LED_DRIVE_VDD, -+ active_low ? VEND1_GLOBAL_LED_DRIVE_VDD : 0); ++ /* Save LED driver vdd state to restore on SW reset */ ++ if (active_low) ++ priv->leds_active_low |= BIT(index); ++ ++ return aqr_phy_led_active_low_set(phydev, index, active_low); +} --- a/drivers/net/phy/aquantia/aquantia_main.c +++ b/drivers/net/phy/aquantia/aquantia_main.c -@@ -740,6 +740,13 @@ static struct phy_driver aqr_driver[] = +@@ -475,7 +475,9 @@ static void aqr107_chip_info(struct phy_ + + static int aqr107_config_init(struct phy_device *phydev) + { +- int ret; ++ struct aqr107_priv *priv = phydev->priv; ++ u32 led_active_low; ++ int ret, index = 0; + + /* Check that the PHY interface type is compatible */ + if (phydev->interface != PHY_INTERFACE_MODE_SGMII && +@@ -496,7 +498,19 @@ static int aqr107_config_init(struct phy + if (!ret) + aqr107_chip_info(phydev); + +- return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); ++ ret = aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); ++ if (ret) ++ return ret; ++ ++ /* Restore LED polarity state after reset */ ++ for_each_set_bit(led_active_low, &priv->leds_active_low, AQR_MAX_LEDS) { ++ ret = aqr_phy_led_active_low_set(phydev, index, led_active_low); ++ if (ret) ++ return ret; ++ index++; ++ } ++ ++ return 0; + } + + static int aqcs109_config_init(struct phy_device *phydev) +@@ -703,6 +717,11 @@ static struct phy_driver aqr_driver[] = .get_strings = aqr107_get_strings, .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, -+#if IS_ENABLED(CONFIG_PHYLIB_LEDS) + .led_brightness_set = aqr_phy_led_brightness_set, + .led_hw_is_supported = aqr_phy_led_hw_is_supported, + .led_hw_control_set = aqr_phy_led_hw_control_set, + .led_hw_control_get = aqr_phy_led_hw_control_get, + .led_polarity_set = aqr_phy_led_polarity_set, -+#endif }, { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109), -@@ -759,6 +766,13 @@ static struct phy_driver aqr_driver[] = +@@ -722,6 +741,11 @@ static struct phy_driver aqr_driver[] = .get_strings = aqr107_get_strings, .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, -+#if IS_ENABLED(CONFIG_PHYLIB_LEDS) + .led_brightness_set = aqr_phy_led_brightness_set, + .led_hw_is_supported = aqr_phy_led_hw_is_supported, + .led_hw_control_set = aqr_phy_led_hw_control_set, + .led_hw_control_get = aqr_phy_led_hw_control_get, + .led_polarity_set = aqr_phy_led_polarity_set, -+#endif }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR111), -@@ -778,6 +792,13 @@ static struct phy_driver aqr_driver[] = +@@ -741,6 +765,11 @@ static struct phy_driver aqr_driver[] = .get_strings = aqr107_get_strings, .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, -+#if IS_ENABLED(CONFIG_PHYLIB_LEDS) + .led_brightness_set = aqr_phy_led_brightness_set, + .led_hw_is_supported = aqr_phy_led_hw_is_supported, + .led_hw_control_set = aqr_phy_led_hw_control_set, + .led_hw_control_get = aqr_phy_led_hw_control_get, + .led_polarity_set = aqr_phy_led_polarity_set, -+#endif }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0), -@@ -797,6 +818,13 @@ static struct phy_driver aqr_driver[] = +@@ -760,6 +789,11 @@ static struct phy_driver aqr_driver[] = .get_strings = aqr107_get_strings, .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, -+#if IS_ENABLED(CONFIG_PHYLIB_LEDS) + .led_brightness_set = aqr_phy_led_brightness_set, + .led_hw_is_supported = aqr_phy_led_hw_is_supported, + .led_hw_control_set = aqr_phy_led_hw_control_set, + .led_hw_control_get = aqr_phy_led_hw_control_get, + .led_polarity_set = aqr_phy_led_polarity_set, -+#endif }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR405), -@@ -823,6 +851,13 @@ static struct phy_driver aqr_driver[] = +@@ -786,6 +820,11 @@ static struct phy_driver aqr_driver[] = .get_strings = aqr107_get_strings, .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, -+#if IS_ENABLED(CONFIG_PHYLIB_LEDS) + .led_brightness_set = aqr_phy_led_brightness_set, + .led_hw_is_supported = aqr_phy_led_hw_is_supported, + .led_hw_control_set = aqr_phy_led_hw_control_set, + .led_hw_control_get = aqr_phy_led_hw_control_get, + .led_polarity_set = aqr_phy_led_polarity_set, -+#endif }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR412), -@@ -841,6 +876,13 @@ static struct phy_driver aqr_driver[] = - .get_strings = aqr107_get_strings, - .get_stats = aqr107_get_stats, - .link_change_notify = aqr107_link_change_notify, -+#if IS_ENABLED(CONFIG_PHYLIB_LEDS) -+ .led_brightness_set = aqr_phy_led_brightness_set, -+ .led_hw_is_supported = aqr_phy_led_hw_is_supported, -+ .led_hw_control_set = aqr_phy_led_hw_control_set, -+ .led_hw_control_get = aqr_phy_led_hw_control_get, -+ .led_polarity_set = aqr_phy_led_polarity_set, -+#endif - }, - { - PHY_ID_MATCH_MODEL(PHY_ID_AQR113), -@@ -860,6 +902,13 @@ static struct phy_driver aqr_driver[] = +@@ -823,6 +862,11 @@ static struct phy_driver aqr_driver[] = .get_strings = aqr107_get_strings, .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, -+#if IS_ENABLED(CONFIG_PHYLIB_LEDS) + .led_brightness_set = aqr_phy_led_brightness_set, + .led_hw_is_supported = aqr_phy_led_hw_is_supported, + .led_hw_control_set = aqr_phy_led_hw_control_set, + .led_hw_control_get = aqr_phy_led_hw_control_get, + .led_polarity_set = aqr_phy_led_polarity_set, -+#endif }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C), -@@ -879,6 +928,13 @@ static struct phy_driver aqr_driver[] = +@@ -842,6 +886,11 @@ static struct phy_driver aqr_driver[] = .get_strings = aqr107_get_strings, .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, -+#if IS_ENABLED(CONFIG_PHYLIB_LEDS) + .led_brightness_set = aqr_phy_led_brightness_set, + .led_hw_is_supported = aqr_phy_led_hw_is_supported, + .led_hw_control_set = aqr_phy_led_hw_control_set, + .led_hw_control_get = aqr_phy_led_hw_control_get, + .led_polarity_set = aqr_phy_led_polarity_set, -+#endif }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR114C), -@@ -898,6 +954,13 @@ static struct phy_driver aqr_driver[] = +@@ -861,6 +910,11 @@ static struct phy_driver aqr_driver[] = .get_strings = aqr107_get_strings, .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, -+#if IS_ENABLED(CONFIG_PHYLIB_LEDS) + .led_brightness_set = aqr_phy_led_brightness_set, + .led_hw_is_supported = aqr_phy_led_hw_is_supported, + .led_hw_control_set = aqr_phy_led_hw_control_set, + .led_hw_control_get = aqr_phy_led_hw_control_get, + .led_polarity_set = aqr_phy_led_polarity_set, -+#endif }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR813), -@@ -917,6 +980,13 @@ static struct phy_driver aqr_driver[] = +@@ -880,6 +934,11 @@ static struct phy_driver aqr_driver[] = .get_strings = aqr107_get_strings, .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, -+#if IS_ENABLED(CONFIG_PHYLIB_LEDS) + .led_brightness_set = aqr_phy_led_brightness_set, + .led_hw_is_supported = aqr_phy_led_hw_is_supported, + .led_hw_control_set = aqr_phy_led_hw_control_set, + .led_hw_control_get = aqr_phy_led_hw_control_get, + .led_polarity_set = aqr_phy_led_polarity_set, -+#endif }, }; diff --git a/target/linux/generic/backport-6.6/810-v6.11-hwmon-g672-add-support-for-g761.patch b/target/linux/generic/backport-6.6/810-v6.11-hwmon-g672-add-support-for-g761.patch new file mode 100644 index 00000000000000..96f7a070b2578f --- /dev/null +++ b/target/linux/generic/backport-6.6/810-v6.11-hwmon-g672-add-support-for-g761.patch @@ -0,0 +1,106 @@ +From 6ce402327a6fb714a9f40a0bb59bcbfe383839a5 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Tue, 4 Jun 2024 18:43:43 +0200 +Subject: [PATCH] hwmon: g672: add support for g761 + +Add support for g761 PWM Fan Controller. + +The g761 is a copy of the g763 with the only difference of supporting +and internal clock. The internal clock is used if no clocks property is +defined in device node and in such case the required bit is enabled and +clock handling is skipped. + +The internal clock oscillator runs at 31KHz. + +Signed-off-by: Christian Marangi +Link: https://lore.kernel.org/r/20240604164348.542-3-ansuelsmth@gmail.com +Signed-off-by: Guenter Roeck +--- + drivers/hwmon/g762.c | 33 ++++++++++++++++++++++++++++++--- + 1 file changed, 30 insertions(+), 3 deletions(-) + +--- a/drivers/hwmon/g762.c ++++ b/drivers/hwmon/g762.c +@@ -69,6 +69,7 @@ enum g762_regs { + #define G762_REG_FAN_CMD1_PWM_POLARITY 0x02 /* PWM polarity */ + #define G762_REG_FAN_CMD1_PULSE_PER_REV 0x01 /* pulse per fan revolution */ + ++#define G761_REG_FAN_CMD2_FAN_CLOCK 0x20 /* choose internal clock*/ + #define G762_REG_FAN_CMD2_GEAR_MODE_1 0x08 /* fan gear mode */ + #define G762_REG_FAN_CMD2_GEAR_MODE_0 0x04 + #define G762_REG_FAN_CMD2_FAN_STARTV_1 0x02 /* fan startup voltage */ +@@ -115,6 +116,7 @@ enum g762_regs { + + struct g762_data { + struct i2c_client *client; ++ bool internal_clock; + struct clk *clk; + + /* update mutex */ +@@ -566,6 +568,7 @@ static int do_set_fan_startv(struct devi + + #ifdef CONFIG_OF + static const struct of_device_id g762_dt_match[] = { ++ { .compatible = "gmt,g761" }, + { .compatible = "gmt,g762" }, + { .compatible = "gmt,g763" }, + { }, +@@ -597,6 +600,21 @@ static int g762_of_clock_enable(struct i + if (!client->dev.of_node) + return 0; + ++ data = i2c_get_clientdata(client); ++ ++ /* ++ * Skip CLK detection and handling if we use internal clock. ++ * This is only valid for g761. ++ */ ++ data->internal_clock = of_device_is_compatible(client->dev.of_node, ++ "gmt,g761") && ++ !of_property_present(client->dev.of_node, ++ "clocks"); ++ if (data->internal_clock) { ++ do_set_clk_freq(&client->dev, 32768); ++ return 0; ++ } ++ + clk = of_clk_get(client->dev.of_node, 0); + if (IS_ERR(clk)) { + dev_err(&client->dev, "failed to get clock\n"); +@@ -616,7 +634,6 @@ static int g762_of_clock_enable(struct i + goto clk_unprep; + } + +- data = i2c_get_clientdata(client); + data->clk = clk; + + ret = devm_add_action(&client->dev, g762_of_clock_disable, data); +@@ -1025,16 +1042,26 @@ ATTRIBUTE_GROUPS(g762); + static inline int g762_fan_init(struct device *dev) + { + struct g762_data *data = g762_update_client(dev); ++ int ret; + + if (IS_ERR(data)) + return PTR_ERR(data); + ++ /* internal_clock can only be set with compatible g761 */ ++ if (data->internal_clock) ++ data->fan_cmd2 |= G761_REG_FAN_CMD2_FAN_CLOCK; ++ + data->fan_cmd1 |= G762_REG_FAN_CMD1_DET_FAN_FAIL; + data->fan_cmd1 |= G762_REG_FAN_CMD1_DET_FAN_OOC; + data->valid = false; + +- return i2c_smbus_write_byte_data(data->client, G762_REG_FAN_CMD1, +- data->fan_cmd1); ++ ret = i2c_smbus_write_byte_data(data->client, G762_REG_FAN_CMD1, ++ data->fan_cmd1); ++ if (ret) ++ return ret; ++ ++ return i2c_smbus_write_byte_data(data->client, G762_REG_FAN_CMD2, ++ data->fan_cmd2); + } + + static int g762_probe(struct i2c_client *client) diff --git a/target/linux/generic/backport-6.6/895-01-v6.8-net-phy-add-possible-interfaces.patch b/target/linux/generic/backport-6.6/895-01-v6.8-net-phy-add-possible-interfaces.patch new file mode 100644 index 00000000000000..b86dbea898524c --- /dev/null +++ b/target/linux/generic/backport-6.6/895-01-v6.8-net-phy-add-possible-interfaces.patch @@ -0,0 +1,60 @@ +From 1a7aa058bc92f0edae7a0d1ef1a7b05aec0c643a Mon Sep 17 00:00:00 2001 +From: "Russell King (Oracle)" +Date: Fri, 24 Nov 2023 12:27:52 +0000 +Subject: [PATCH 1/7] net: phy: add possible interfaces + +Add a possible_interfaces member to struct phy_device to indicate which +interfaces a clause 45 PHY may switch between depending on the media. +This must be populated by the PHY driver by the time the .config_init() +method completes according to the PHYs host-side configuration. + +For example, the Marvell 88x3310 PHY can switch between 10GBASE-R, +5GBASE-R, 2500BASE-X, and SGMII on the host side depending on the media +side speed, so all these interface modes are set in the +possible_interfaces member. + +This allows phylib users (such as phylink) to know in advance which +interface modes to expect, which allows them to appropriately restrict +the advertised link modes according to the capabilities of other parts +of the link. + +Tested-by: Luo Jie +Signed-off-by: Russell King (Oracle) +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/E1r6VHk-00DDLN-I7@rmk-PC.armlinux.org.uk +Signed-off-by: Jakub Kicinski +--- + drivers/net/phy/phy_device.c | 2 ++ + include/linux/phy.h | 3 +++ + 2 files changed, 5 insertions(+) + +--- a/drivers/net/phy/phy_device.c ++++ b/drivers/net/phy/phy_device.c +@@ -1247,6 +1247,8 @@ int phy_init_hw(struct phy_device *phyde + if (ret < 0) + return ret; + ++ phy_interface_zero(phydev->possible_interfaces); ++ + if (phydev->drv->config_init) { + ret = phydev->drv->config_init(phydev); + if (ret < 0) +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -609,6 +609,8 @@ struct macsec_ops; + * @irq_rerun: Flag indicating interrupts occurred while PHY was suspended, + * requiring a rerun of the interrupt handler after resume + * @interface: enum phy_interface_t value ++ * @possible_interfaces: bitmap if interface modes that the attached PHY ++ * will switch between depending on media speed. + * @skb: Netlink message for cable diagnostics + * @nest: Netlink nest used for cable diagnostics + * @ehdr: nNtlink header for cable diagnostics +@@ -678,6 +680,7 @@ struct phy_device { + u32 dev_flags; + + phy_interface_t interface; ++ DECLARE_PHY_INTERFACE_MASK(possible_interfaces); + + /* + * forced speed & duplex (no autoneg) diff --git a/target/linux/generic/backport-6.6/895-02-v6.8-net-phylink-use-for_each_set_bit.patch b/target/linux/generic/backport-6.6/895-02-v6.8-net-phylink-use-for_each_set_bit.patch new file mode 100644 index 00000000000000..397780f7fdf73a --- /dev/null +++ b/target/linux/generic/backport-6.6/895-02-v6.8-net-phylink-use-for_each_set_bit.patch @@ -0,0 +1,46 @@ +From 85631f5b33f2acce7d42dec1d0a062ab40de95b8 Mon Sep 17 00:00:00 2001 +From: "Russell King (Oracle)" +Date: Sun, 19 Nov 2023 21:07:43 +0000 +Subject: [PATCH 2/7] net: phylink: use for_each_set_bit() + +Use for_each_set_bit() rather than open coding the for() test_bit() +loop. + +Reviewed-by: Andrew Lunn +Signed-off-by: Russell King (Oracle) +Reviewed-by: Wojciech Drewek +Link: https://lore.kernel.org/r/E1r4p15-00Cpxe-C7@rmk-PC.armlinux.org.uk +Signed-off-by: Paolo Abeni +--- + drivers/net/phy/phylink.c | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -712,18 +712,16 @@ static int phylink_validate_mask(struct + __ETHTOOL_DECLARE_LINK_MODE_MASK(all_s) = { 0, }; + __ETHTOOL_DECLARE_LINK_MODE_MASK(s); + struct phylink_link_state t; +- int intf; ++ int interface; + +- for (intf = 0; intf < PHY_INTERFACE_MODE_MAX; intf++) { +- if (test_bit(intf, interfaces)) { +- linkmode_copy(s, supported); ++ for_each_set_bit(interface, interfaces, PHY_INTERFACE_MODE_MAX) { ++ linkmode_copy(s, supported); + +- t = *state; +- t.interface = intf; +- if (!phylink_validate_mac_and_pcs(pl, s, &t)) { +- linkmode_or(all_s, all_s, s); +- linkmode_or(all_adv, all_adv, t.advertising); +- } ++ t = *state; ++ t.interface = interface; ++ if (!phylink_validate_mac_and_pcs(pl, s, &t)) { ++ linkmode_or(all_s, all_s, s); ++ linkmode_or(all_adv, all_adv, t.advertising); + } + } + diff --git a/target/linux/generic/backport-6.6/895-03-v6.8-net-phylink-split-out-per-interface-validation.patch b/target/linux/generic/backport-6.6/895-03-v6.8-net-phylink-split-out-per-interface-validation.patch new file mode 100644 index 00000000000000..33f64e81c20f4a --- /dev/null +++ b/target/linux/generic/backport-6.6/895-03-v6.8-net-phylink-split-out-per-interface-validation.patch @@ -0,0 +1,76 @@ +From d4788b4383ce5caeb4e68818357c81a02117a3f9 Mon Sep 17 00:00:00 2001 +From: "Russell King (Oracle)" +Date: Fri, 24 Nov 2023 12:28:19 +0000 +Subject: [PATCH 3/7] net: phylink: split out per-interface validation + +Split out the internals of phylink_validate_mask() to make the code +easier to read. + +Tested-by: Luo Jie +Signed-off-by: Russell King (Oracle) +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/E1r6VIB-00DDLr-7g@rmk-PC.armlinux.org.uk +Signed-off-by: Jakub Kicinski +--- + drivers/net/phy/phylink.c | 42 ++++++++++++++++++++++++++++----------- + 1 file changed, 30 insertions(+), 12 deletions(-) + +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -704,26 +704,44 @@ static int phylink_validate_mac_and_pcs( + return phylink_is_empty_linkmode(supported) ? -EINVAL : 0; + } + ++static void phylink_validate_one(struct phylink *pl, ++ const unsigned long *supported, ++ const struct phylink_link_state *state, ++ phy_interface_t interface, ++ unsigned long *accum_supported, ++ unsigned long *accum_advertising) ++{ ++ __ETHTOOL_DECLARE_LINK_MODE_MASK(tmp_supported); ++ struct phylink_link_state tmp_state; ++ ++ linkmode_copy(tmp_supported, supported); ++ ++ tmp_state = *state; ++ tmp_state.interface = interface; ++ ++ if (!phylink_validate_mac_and_pcs(pl, tmp_supported, &tmp_state)) { ++ phylink_dbg(pl, " interface %u (%s) rate match %s supports %*pbl\n", ++ interface, phy_modes(interface), ++ phy_rate_matching_to_str(tmp_state.rate_matching), ++ __ETHTOOL_LINK_MODE_MASK_NBITS, tmp_supported); ++ ++ linkmode_or(accum_supported, accum_supported, tmp_supported); ++ linkmode_or(accum_advertising, accum_advertising, ++ tmp_state.advertising); ++ } ++} ++ + static int phylink_validate_mask(struct phylink *pl, unsigned long *supported, + struct phylink_link_state *state, + const unsigned long *interfaces) + { + __ETHTOOL_DECLARE_LINK_MODE_MASK(all_adv) = { 0, }; + __ETHTOOL_DECLARE_LINK_MODE_MASK(all_s) = { 0, }; +- __ETHTOOL_DECLARE_LINK_MODE_MASK(s); +- struct phylink_link_state t; + int interface; + +- for_each_set_bit(interface, interfaces, PHY_INTERFACE_MODE_MAX) { +- linkmode_copy(s, supported); +- +- t = *state; +- t.interface = interface; +- if (!phylink_validate_mac_and_pcs(pl, s, &t)) { +- linkmode_or(all_s, all_s, s); +- linkmode_or(all_adv, all_adv, t.advertising); +- } +- } ++ for_each_set_bit(interface, interfaces, PHY_INTERFACE_MODE_MAX) ++ phylink_validate_one(pl, supported, state, interface, ++ all_s, all_adv); + + linkmode_copy(supported, all_s); + linkmode_copy(state->advertising, all_adv); diff --git a/target/linux/generic/backport-6.6/895-04-v6.8-net-phylink-pass-PHY-into-phylink_validate_one.patch b/target/linux/generic/backport-6.6/895-04-v6.8-net-phylink-pass-PHY-into-phylink_validate_one.patch new file mode 100644 index 00000000000000..e3915f06091c85 --- /dev/null +++ b/target/linux/generic/backport-6.6/895-04-v6.8-net-phylink-pass-PHY-into-phylink_validate_one.patch @@ -0,0 +1,47 @@ +From ce7273c31fadb3143fc80c96a72a42adc19c2757 Mon Sep 17 00:00:00 2001 +From: "Russell King (Oracle)" +Date: Fri, 24 Nov 2023 12:28:24 +0000 +Subject: [PATCH 4/7] net: phylink: pass PHY into phylink_validate_one() + +Pass the phy (if any) into phylink_validate_one() so that we can +validate each interface with its rate matching setting. + +Tested-by: Luo Jie +Signed-off-by: Russell King (Oracle) +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/E1r6VIG-00DDLx-Cb@rmk-PC.armlinux.org.uk +Signed-off-by: Jakub Kicinski +--- + drivers/net/phy/phylink.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -704,7 +704,7 @@ static int phylink_validate_mac_and_pcs( + return phylink_is_empty_linkmode(supported) ? -EINVAL : 0; + } + +-static void phylink_validate_one(struct phylink *pl, ++static void phylink_validate_one(struct phylink *pl, struct phy_device *phy, + const unsigned long *supported, + const struct phylink_link_state *state, + phy_interface_t interface, +@@ -719,6 +719,9 @@ static void phylink_validate_one(struct + tmp_state = *state; + tmp_state.interface = interface; + ++ if (phy) ++ tmp_state.rate_matching = phy_get_rate_matching(phy, interface); ++ + if (!phylink_validate_mac_and_pcs(pl, tmp_supported, &tmp_state)) { + phylink_dbg(pl, " interface %u (%s) rate match %s supports %*pbl\n", + interface, phy_modes(interface), +@@ -740,7 +743,7 @@ static int phylink_validate_mask(struct + int interface; + + for_each_set_bit(interface, interfaces, PHY_INTERFACE_MODE_MAX) +- phylink_validate_one(pl, supported, state, interface, ++ phylink_validate_one(pl, NULL, supported, state, interface, + all_s, all_adv); + + linkmode_copy(supported, all_s); diff --git a/target/linux/generic/backport-6.6/895-05-v6.8-net-phylink-pass-PHY-into-phylink_validate_mask.patch b/target/linux/generic/backport-6.6/895-05-v6.8-net-phylink-pass-PHY-into-phylink_validate_mask.patch new file mode 100644 index 00000000000000..5f66869ef374cc --- /dev/null +++ b/target/linux/generic/backport-6.6/895-05-v6.8-net-phylink-pass-PHY-into-phylink_validate_mask.patch @@ -0,0 +1,58 @@ +From c6fec66d3cd76d797f70b30f1511bed10ba45a96 Mon Sep 17 00:00:00 2001 +From: "Russell King (Oracle)" +Date: Fri, 24 Nov 2023 12:28:29 +0000 +Subject: [PATCH 5/7] net: phylink: pass PHY into phylink_validate_mask() + +Pass the phy (if any) into phylink_validate_mask() so that we can +validate each interface with its rate matching setting. + +Tested-by: Luo Jie +Signed-off-by: Russell King (Oracle) +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/E1r6VIL-00DDM3-HJ@rmk-PC.armlinux.org.uk +Signed-off-by: Jakub Kicinski +--- + drivers/net/phy/phylink.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -734,7 +734,8 @@ static void phylink_validate_one(struct + } + } + +-static int phylink_validate_mask(struct phylink *pl, unsigned long *supported, ++static int phylink_validate_mask(struct phylink *pl, struct phy_device *phy, ++ unsigned long *supported, + struct phylink_link_state *state, + const unsigned long *interfaces) + { +@@ -743,7 +744,7 @@ static int phylink_validate_mask(struct + int interface; + + for_each_set_bit(interface, interfaces, PHY_INTERFACE_MODE_MAX) +- phylink_validate_one(pl, NULL, supported, state, interface, ++ phylink_validate_one(pl, phy, supported, state, interface, + all_s, all_adv); + + linkmode_copy(supported, all_s); +@@ -758,7 +759,8 @@ static int phylink_validate(struct phyli + const unsigned long *interfaces = pl->config->supported_interfaces; + + if (state->interface == PHY_INTERFACE_MODE_NA) +- return phylink_validate_mask(pl, supported, state, interfaces); ++ return phylink_validate_mask(pl, NULL, supported, state, ++ interfaces); + + if (!test_bit(state->interface, interfaces)) + return -EINVAL; +@@ -3194,7 +3196,8 @@ static int phylink_sfp_config_optical(st + /* For all the interfaces that are supported, reduce the sfp_support + * mask to only those link modes that can be supported. + */ +- ret = phylink_validate_mask(pl, pl->sfp_support, &config, interfaces); ++ ret = phylink_validate_mask(pl, NULL, pl->sfp_support, &config, ++ interfaces); + if (ret) { + phylink_err(pl, "unsupported SFP module: validation with support %*pb failed\n", + __ETHTOOL_LINK_MODE_MASK_NBITS, support); diff --git a/target/linux/generic/backport-6.6/895-06-v6.8-net-phylink-split-out-PHY-validation-from-phylink_br.patch b/target/linux/generic/backport-6.6/895-06-v6.8-net-phylink-split-out-PHY-validation-from-phylink_br.patch new file mode 100644 index 00000000000000..e29503398e0d6a --- /dev/null +++ b/target/linux/generic/backport-6.6/895-06-v6.8-net-phylink-split-out-PHY-validation-from-phylink_br.patch @@ -0,0 +1,95 @@ +From ee0e0ddb910e7e989b65a19d72b6435baa641fc7 Mon Sep 17 00:00:00 2001 +From: "Russell King (Oracle)" +Date: Fri, 24 Nov 2023 12:28:34 +0000 +Subject: [PATCH 6/7] net: phylink: split out PHY validation from + phylink_bringup_phy() + +When bringing up a PHY, we need to work out which ethtool link modes it +should support and advertise. Clause 22 PHYs operate in a single +interface mode, which can be easily dealt with. However, clause 45 PHYs +tend to switch interface mode depending on the media. We need more +flexible validation at this point, so this patch splits out that code +in preparation to changing it. + +Tested-by: Luo Jie +Signed-off-by: Russell King (Oracle) +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/E1r6VIQ-00DDM9-LK@rmk-PC.armlinux.org.uk +Signed-off-by: Jakub Kicinski +--- + drivers/net/phy/phylink.c | 56 ++++++++++++++++++++++----------------- + 1 file changed, 31 insertions(+), 25 deletions(-) + +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -1775,6 +1775,35 @@ static void phylink_phy_change(struct ph + phylink_pause_to_str(pl->phy_state.pause)); + } + ++static int phylink_validate_phy(struct phylink *pl, struct phy_device *phy, ++ unsigned long *supported, ++ struct phylink_link_state *state) ++{ ++ /* Check whether we would use rate matching for the proposed interface ++ * mode. ++ */ ++ state->rate_matching = phy_get_rate_matching(phy, state->interface); ++ ++ /* Clause 45 PHYs may switch their Serdes lane between, e.g. 10GBASE-R, ++ * 5GBASE-R, 2500BASE-X and SGMII if they are not using rate matching. ++ * For some interface modes (e.g. RXAUI, XAUI and USXGMII) switching ++ * their Serdes is either unnecessary or not reasonable. ++ * ++ * For these which switch interface modes, we really need to know which ++ * interface modes the PHY supports to properly work out which ethtool ++ * linkmodes can be supported. For now, as a work-around, we validate ++ * against all interface modes, which may lead to more ethtool link ++ * modes being advertised than are actually supported. ++ */ ++ if (phy->is_c45 && state->rate_matching == RATE_MATCH_NONE && ++ state->interface != PHY_INTERFACE_MODE_RXAUI && ++ state->interface != PHY_INTERFACE_MODE_XAUI && ++ state->interface != PHY_INTERFACE_MODE_USXGMII) ++ state->interface = PHY_INTERFACE_MODE_NA; ++ ++ return phylink_validate(pl, supported, state); ++} ++ + static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, + phy_interface_t interface) + { +@@ -1795,32 +1824,9 @@ static int phylink_bringup_phy(struct ph + memset(&config, 0, sizeof(config)); + linkmode_copy(supported, phy->supported); + linkmode_copy(config.advertising, phy->advertising); ++ config.interface = interface; + +- /* Check whether we would use rate matching for the proposed interface +- * mode. +- */ +- config.rate_matching = phy_get_rate_matching(phy, interface); +- +- /* Clause 45 PHYs may switch their Serdes lane between, e.g. 10GBASE-R, +- * 5GBASE-R, 2500BASE-X and SGMII if they are not using rate matching. +- * For some interface modes (e.g. RXAUI, XAUI and USXGMII) switching +- * their Serdes is either unnecessary or not reasonable. +- * +- * For these which switch interface modes, we really need to know which +- * interface modes the PHY supports to properly work out which ethtool +- * linkmodes can be supported. For now, as a work-around, we validate +- * against all interface modes, which may lead to more ethtool link +- * modes being advertised than are actually supported. +- */ +- if (phy->is_c45 && config.rate_matching == RATE_MATCH_NONE && +- interface != PHY_INTERFACE_MODE_RXAUI && +- interface != PHY_INTERFACE_MODE_XAUI && +- interface != PHY_INTERFACE_MODE_USXGMII) +- config.interface = PHY_INTERFACE_MODE_NA; +- else +- config.interface = interface; +- +- ret = phylink_validate(pl, supported, &config); ++ ret = phylink_validate_phy(pl, phy, supported, &config); + if (ret) { + phylink_warn(pl, "validation of %s with support %*pb and advertisement %*pb failed: %pe\n", + phy_modes(config.interface), diff --git a/target/linux/generic/backport-6.6/895-07-v6.8-net-phylink-use-the-PHY-s-possible_interfaces-if-pop.patch b/target/linux/generic/backport-6.6/895-07-v6.8-net-phylink-use-the-PHY-s-possible_interfaces-if-pop.patch new file mode 100644 index 00000000000000..86ed7a868ecdaf --- /dev/null +++ b/target/linux/generic/backport-6.6/895-07-v6.8-net-phylink-use-the-PHY-s-possible_interfaces-if-pop.patch @@ -0,0 +1,130 @@ +From 8f7a9799c5949f94ecc3acfd71b36437a7ade73b Mon Sep 17 00:00:00 2001 +From: "Russell King (Oracle)" +Date: Fri, 24 Nov 2023 12:28:39 +0000 +Subject: [PATCH 7/7] net: phylink: use the PHY's possible_interfaces if + populated + +Some PHYs such as Aquantia, Broadcom 84881, and Marvell 88X33x0 can +switch between a set of interface types depending on the negotiated +media speed, or can use rate adaption for some or all of these +interface types. + +We currently assume that these are Clause 45 PHYs that are configured +not to use a specific set of interface modes, which has worked so far, +but is just a work-around. In this workaround, we validate using all +interfaces that the MAC supports, which can lead to extra modes being +advertised that can not be supported. + +To properly address this, switch to using the newly introduced PHY +possible_interfaces bitmap which indicates which interface modes will +be used by the PHY as configured. We calculate the union of the PHY's +possible interfaces and MACs supported interfaces, checking that is +non-empty. If the PHY is on a SFP, we further reduce the set by those +which can be used on a SFP module, again checking that is non-empty. +Finally, we validate the subset of interfaces, taking account of +whether rate matching will be used for each individual interface mode. + +This becomes independent of whether the PHY is clause 22 or clause 45. + +It is encouraged that all PHYs that switch interface modes or use +rate matching should populate phydev->possible_interfaces. + +Tested-by: Luo Jie +Signed-off-by: Russell King (Oracle) +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/E1r6VIV-00DDMF-Pi@rmk-PC.armlinux.org.uk +Signed-off-by: Jakub Kicinski +--- + drivers/net/phy/phylink.c | 67 +++++++++++++++++++++++++++++++-------- + 1 file changed, 54 insertions(+), 13 deletions(-) + +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -121,6 +121,19 @@ do { \ + }) + #endif + ++static const phy_interface_t phylink_sfp_interface_preference[] = { ++ PHY_INTERFACE_MODE_25GBASER, ++ PHY_INTERFACE_MODE_USXGMII, ++ PHY_INTERFACE_MODE_10GBASER, ++ PHY_INTERFACE_MODE_5GBASER, ++ PHY_INTERFACE_MODE_2500BASEX, ++ PHY_INTERFACE_MODE_SGMII, ++ PHY_INTERFACE_MODE_1000BASEX, ++ PHY_INTERFACE_MODE_100BASEX, ++}; ++ ++static DECLARE_PHY_INTERFACE_MASK(phylink_sfp_interfaces); ++ + /** + * phylink_set_port_modes() - set the port type modes in the ethtool mask + * @mask: ethtool link mode mask +@@ -1779,6 +1792,47 @@ static int phylink_validate_phy(struct p + unsigned long *supported, + struct phylink_link_state *state) + { ++ DECLARE_PHY_INTERFACE_MASK(interfaces); ++ ++ /* If the PHY provides a bitmap of the interfaces it will be using ++ * depending on the negotiated media speeds, use this to validate ++ * which ethtool link modes can be used. ++ */ ++ if (!phy_interface_empty(phy->possible_interfaces)) { ++ /* We only care about the union of the PHY's interfaces and ++ * those which the host supports. ++ */ ++ phy_interface_and(interfaces, phy->possible_interfaces, ++ pl->config->supported_interfaces); ++ ++ if (phy_interface_empty(interfaces)) { ++ phylink_err(pl, "PHY has no common interfaces\n"); ++ return -EINVAL; ++ } ++ ++ if (phy_on_sfp(phy)) { ++ /* If the PHY is on a SFP, limit the interfaces to ++ * those that can be used with a SFP module. ++ */ ++ phy_interface_and(interfaces, interfaces, ++ phylink_sfp_interfaces); ++ ++ if (phy_interface_empty(interfaces)) { ++ phylink_err(pl, "SFP PHY's possible interfaces becomes empty\n"); ++ return -EINVAL; ++ } ++ } ++ ++ phylink_dbg(pl, "PHY %s uses interfaces %*pbl, validating %*pbl\n", ++ phydev_name(phy), ++ (int)PHY_INTERFACE_MODE_MAX, ++ phy->possible_interfaces, ++ (int)PHY_INTERFACE_MODE_MAX, interfaces); ++ ++ return phylink_validate_mask(pl, phy, supported, state, ++ interfaces); ++ } ++ + /* Check whether we would use rate matching for the proposed interface + * mode. + */ +@@ -3047,19 +3101,6 @@ static void phylink_sfp_detach(void *ups + pl->netdev->sfp_bus = NULL; + } + +-static const phy_interface_t phylink_sfp_interface_preference[] = { +- PHY_INTERFACE_MODE_25GBASER, +- PHY_INTERFACE_MODE_USXGMII, +- PHY_INTERFACE_MODE_10GBASER, +- PHY_INTERFACE_MODE_5GBASER, +- PHY_INTERFACE_MODE_2500BASEX, +- PHY_INTERFACE_MODE_SGMII, +- PHY_INTERFACE_MODE_1000BASEX, +- PHY_INTERFACE_MODE_100BASEX, +-}; +- +-static DECLARE_PHY_INTERFACE_MASK(phylink_sfp_interfaces); +- + static phy_interface_t phylink_choose_sfp_interface(struct phylink *pl, + const unsigned long *intf) + { diff --git a/target/linux/generic/backport-6.6/896-01-v6.9-net-dsa-mv88e6xxx-rename-mv88e6xxx_g2_scratch_gpio_s.patch b/target/linux/generic/backport-6.6/896-01-v6.9-net-dsa-mv88e6xxx-rename-mv88e6xxx_g2_scratch_gpio_s.patch new file mode 100644 index 00000000000000..d9265cad10bdfc --- /dev/null +++ b/target/linux/generic/backport-6.6/896-01-v6.9-net-dsa-mv88e6xxx-rename-mv88e6xxx_g2_scratch_gpio_s.patch @@ -0,0 +1,61 @@ +From 5c5b0c444be3e851046f1c1074459b8d15d2a0f9 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Tue, 27 Feb 2024 18:54:21 +0100 +Subject: [PATCH 1/2] net: dsa: mv88e6xxx: rename + mv88e6xxx_g2_scratch_gpio_set_smi + +The name mv88e6xxx_g2_scratch_gpio_set_smi is a bit ambiguous as it appears +to only be applicable to the 6390 family, so lets rename it to +mv88e6390_g2_scratch_gpio_set_smi to make it more obvious. + +Signed-off-by: Robert Marko +Reviewed-by: Andrew Lunn +Signed-off-by: Paolo Abeni +--- + drivers/net/dsa/mv88e6xxx/chip.c | 2 +- + drivers/net/dsa/mv88e6xxx/global2.h | 2 +- + drivers/net/dsa/mv88e6xxx/global2_scratch.c | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -3668,7 +3668,7 @@ static int mv88e6xxx_mdio_register(struc + + if (external) { + mv88e6xxx_reg_lock(chip); +- err = mv88e6xxx_g2_scratch_gpio_set_smi(chip, true); ++ err = mv88e6390_g2_scratch_gpio_set_smi(chip, true); + mv88e6xxx_reg_unlock(chip); + + if (err) +--- a/drivers/net/dsa/mv88e6xxx/global2.h ++++ b/drivers/net/dsa/mv88e6xxx/global2.h +@@ -378,7 +378,7 @@ extern const struct mv88e6xxx_avb_ops mv + + extern const struct mv88e6xxx_gpio_ops mv88e6352_gpio_ops; + +-int mv88e6xxx_g2_scratch_gpio_set_smi(struct mv88e6xxx_chip *chip, ++int mv88e6390_g2_scratch_gpio_set_smi(struct mv88e6xxx_chip *chip, + bool external); + int mv88e6352_g2_scratch_port_has_serdes(struct mv88e6xxx_chip *chip, int port); + int mv88e6xxx_g2_atu_stats_set(struct mv88e6xxx_chip *chip, u16 kind, u16 bin); +--- a/drivers/net/dsa/mv88e6xxx/global2_scratch.c ++++ b/drivers/net/dsa/mv88e6xxx/global2_scratch.c +@@ -240,7 +240,7 @@ const struct mv88e6xxx_gpio_ops mv88e635 + }; + + /** +- * mv88e6xxx_g2_scratch_gpio_set_smi - set gpio muxing for external smi ++ * mv88e6390_g2_scratch_gpio_set_smi - set gpio muxing for external smi + * @chip: chip private data + * @external: set mux for external smi, or free for gpio usage + * +@@ -248,7 +248,7 @@ const struct mv88e6xxx_gpio_ops mv88e635 + * an external SMI interface, or they may be made free for other + * GPIO uses. + */ +-int mv88e6xxx_g2_scratch_gpio_set_smi(struct mv88e6xxx_chip *chip, ++int mv88e6390_g2_scratch_gpio_set_smi(struct mv88e6xxx_chip *chip, + bool external) + { + int misc_cfg = MV88E6352_G2_SCRATCH_MISC_CFG; diff --git a/target/linux/generic/backport-6.6/896-02-v6.9-net-dsa-mv88e6xxx-add-Amethyst-specific-SMI-GPIO-fun.patch b/target/linux/generic/backport-6.6/896-02-v6.9-net-dsa-mv88e6xxx-add-Amethyst-specific-SMI-GPIO-fun.patch new file mode 100644 index 00000000000000..5661d50adb46c0 --- /dev/null +++ b/target/linux/generic/backport-6.6/896-02-v6.9-net-dsa-mv88e6xxx-add-Amethyst-specific-SMI-GPIO-fun.patch @@ -0,0 +1,92 @@ +From e3ab3267a0bbedc37725bb845a332ec33b247263 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Tue, 27 Feb 2024 18:54:22 +0100 +Subject: [PATCH 2/2] net: dsa: mv88e6xxx: add Amethyst specific SMI GPIO + function + +The existing mv88e6390_g2_scratch_gpio_set_smi() cannot be used on the +88E6393X as it requires certain P0_MODE, it also checks the CPU mode +as it impacts the bit setting value. + +This is all irrelevant for Amethyst (MV88E6191X/6193X/6393X) as only +the default value of the SMI_PHY Config bit is set to CPU_MGD bootstrap +pin value but it can be changed without restrictions so that GPIO pins +9 and 10 are used as SMI pins. + +So, introduce Amethyst specific function and call that if the Amethyst +family wants to setup the external PHY. + +Reviewed-by: Andrew Lunn +Signed-off-by: Robert Marko +Signed-off-by: Paolo Abeni +--- + drivers/net/dsa/mv88e6xxx/chip.c | 5 +++- + drivers/net/dsa/mv88e6xxx/global2.h | 2 ++ + drivers/net/dsa/mv88e6xxx/global2_scratch.c | 31 +++++++++++++++++++++ + 3 files changed, 37 insertions(+), 1 deletion(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -3668,7 +3668,10 @@ static int mv88e6xxx_mdio_register(struc + + if (external) { + mv88e6xxx_reg_lock(chip); +- err = mv88e6390_g2_scratch_gpio_set_smi(chip, true); ++ if (chip->info->family == MV88E6XXX_FAMILY_6393) ++ err = mv88e6393x_g2_scratch_gpio_set_smi(chip, true); ++ else ++ err = mv88e6390_g2_scratch_gpio_set_smi(chip, true); + mv88e6xxx_reg_unlock(chip); + + if (err) +--- a/drivers/net/dsa/mv88e6xxx/global2.h ++++ b/drivers/net/dsa/mv88e6xxx/global2.h +@@ -380,6 +380,8 @@ extern const struct mv88e6xxx_gpio_ops m + + int mv88e6390_g2_scratch_gpio_set_smi(struct mv88e6xxx_chip *chip, + bool external); ++int mv88e6393x_g2_scratch_gpio_set_smi(struct mv88e6xxx_chip *chip, ++ bool external); + int mv88e6352_g2_scratch_port_has_serdes(struct mv88e6xxx_chip *chip, int port); + int mv88e6xxx_g2_atu_stats_set(struct mv88e6xxx_chip *chip, u16 kind, u16 bin); + int mv88e6xxx_g2_atu_stats_get(struct mv88e6xxx_chip *chip, u16 *stats); +--- a/drivers/net/dsa/mv88e6xxx/global2_scratch.c ++++ b/drivers/net/dsa/mv88e6xxx/global2_scratch.c +@@ -291,6 +291,37 @@ int mv88e6390_g2_scratch_gpio_set_smi(st + } + + /** ++ * mv88e6393x_g2_scratch_gpio_set_smi - set gpio muxing for external smi ++ * @chip: chip private data ++ * @external: set mux for external smi, or free for gpio usage ++ * ++ * MV88E6191X/6193X/6393X GPIO pins 9 and 10 can be configured as an ++ * external SMI interface or as regular GPIO-s. ++ * ++ * They however have a different register layout then the existing ++ * function. ++ */ ++ ++int mv88e6393x_g2_scratch_gpio_set_smi(struct mv88e6xxx_chip *chip, ++ bool external) ++{ ++ int misc_cfg = MV88E6352_G2_SCRATCH_MISC_CFG; ++ int err; ++ u8 val; ++ ++ err = mv88e6xxx_g2_scratch_read(chip, misc_cfg, &val); ++ if (err) ++ return err; ++ ++ if (external) ++ val &= ~MV88E6352_G2_SCRATCH_MISC_CFG_NORMALSMI; ++ else ++ val |= MV88E6352_G2_SCRATCH_MISC_CFG_NORMALSMI; ++ ++ return mv88e6xxx_g2_scratch_write(chip, misc_cfg, val); ++} ++ ++/** + * mv88e6352_g2_scratch_port_has_serdes - indicate if a port can have a serdes + * @chip: chip private data + * @port: port number to check for serdes diff --git a/target/linux/generic/backport-6.6/897-01-v6.9-net-phy-qcom-qca808x-add-helper-for-checking-for-1G-.patch b/target/linux/generic/backport-6.6/897-01-v6.9-net-phy-qcom-qca808x-add-helper-for-checking-for-1G-.patch new file mode 100644 index 00000000000000..a11e8049581e0c --- /dev/null +++ b/target/linux/generic/backport-6.6/897-01-v6.9-net-phy-qcom-qca808x-add-helper-for-checking-for-1G-.patch @@ -0,0 +1,50 @@ +From f058b2dd70b1a5503dff899010aeb53b436091e5 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Wed, 28 Feb 2024 18:24:09 +0100 +Subject: [PATCH 1/2] net: phy: qcom: qca808x: add helper for checking for 1G + only model + +There are 2 versions of QCA808x, one 2.5G capable and one 1G capable. +Currently, this matter only in the .get_features call however, it will +be required for filling supported interface modes so lets add a helper +that can be reused. + +Signed-off-by: Robert Marko +Signed-off-by: David S. Miller +--- + drivers/net/phy/qcom/qca808x.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +--- a/drivers/net/phy/qcom/qca808x.c ++++ b/drivers/net/phy/qcom/qca808x.c +@@ -156,6 +156,17 @@ static bool qca808x_has_fast_retrain_or_ + return linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->supported); + } + ++static bool qca808x_is_1g_only(struct phy_device *phydev) ++{ ++ int ret; ++ ++ ret = phy_read_mmd(phydev, MDIO_MMD_AN, QCA808X_PHY_MMD7_CHIP_TYPE); ++ if (ret < 0) ++ return true; ++ ++ return !!(QCA808X_PHY_CHIP_TYPE_1G & ret); ++} ++ + static int qca808x_probe(struct phy_device *phydev) + { + struct device *dev = &phydev->mdio.dev; +@@ -350,11 +361,7 @@ static int qca808x_get_features(struct p + * existed in the bit0 of MMD1.21, we need to remove it manually if + * it is the qca8081 1G chip according to the bit0 of MMD7.0x901d. + */ +- ret = phy_read_mmd(phydev, MDIO_MMD_AN, QCA808X_PHY_MMD7_CHIP_TYPE); +- if (ret < 0) +- return ret; +- +- if (QCA808X_PHY_CHIP_TYPE_1G & ret) ++ if (qca808x_is_1g_only(phydev)) + linkmode_clear_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->supported); + + return 0; diff --git a/target/linux/generic/backport-6.6/897-02-v6.9-net-phy-qcom-qca808x-fill-in-possible_interfaces.patch b/target/linux/generic/backport-6.6/897-02-v6.9-net-phy-qcom-qca808x-fill-in-possible_interfaces.patch new file mode 100644 index 00000000000000..c162fc734812ea --- /dev/null +++ b/target/linux/generic/backport-6.6/897-02-v6.9-net-phy-qcom-qca808x-fill-in-possible_interfaces.patch @@ -0,0 +1,44 @@ +From cb28f702960695e26597c332b0e46776e825cc34 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Wed, 28 Feb 2024 18:24:10 +0100 +Subject: [PATCH 2/2] net: phy: qcom: qca808x: fill in possible_interfaces + +Currently QCA808x driver does not fill the possible_interfaces. +2.5G QCA808x support SGMII and 2500Base-X while 1G model only supports +SGMII, so fill the possible_interfaces accordingly. + +Signed-off-by: Robert Marko +Reviewed-by: Russell King (Oracle) +Signed-off-by: David S. Miller +--- + drivers/net/phy/qcom/qca808x.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/drivers/net/phy/qcom/qca808x.c ++++ b/drivers/net/phy/qcom/qca808x.c +@@ -167,6 +167,16 @@ static bool qca808x_is_1g_only(struct ph + return !!(QCA808X_PHY_CHIP_TYPE_1G & ret); + } + ++static void qca808x_fill_possible_interfaces(struct phy_device *phydev) ++{ ++ unsigned long *possible = phydev->possible_interfaces; ++ ++ __set_bit(PHY_INTERFACE_MODE_SGMII, possible); ++ ++ if (!qca808x_is_1g_only(phydev)) ++ __set_bit(PHY_INTERFACE_MODE_2500BASEX, possible); ++} ++ + static int qca808x_probe(struct phy_device *phydev) + { + struct device *dev = &phydev->mdio.dev; +@@ -231,6 +241,8 @@ static int qca808x_config_init(struct ph + } + } + ++ qca808x_fill_possible_interfaces(phydev); ++ + /* Configure adc threshold as 100mv for the link 10M */ + return at803x_debug_reg_mask(phydev, QCA808X_PHY_DEBUG_ADC_THRESHOLD, + QCA808X_ADC_THRESHOLD_MASK, diff --git a/target/linux/generic/config-6.6 b/target/linux/generic/config-6.6 index 8821ecb162d1b1..20fe98099f286b 100644 --- a/target/linux/generic/config-6.6 +++ b/target/linux/generic/config-6.6 @@ -1,13 +1,11 @@ # CONFIG_104_QUAD_8 is not set CONFIG_32BIT=y -CONFIG_64BIT_TIME=y # CONFIG_6LOWPAN is not set # CONFIG_6LOWPAN_DEBUGFS is not set # CONFIG_6PACK is not set # CONFIG_8139CP is not set # CONFIG_8139TOO is not set # CONFIG_9P_FS is not set -# CONFIG_AB3100_CORE is not set # CONFIG_AB8500_CORE is not set # CONFIG_ABP060MG is not set # CONFIG_ABX500_CORE is not set @@ -60,7 +58,6 @@ CONFIG_64BIT_TIME=y # CONFIG_AD7091R5 is not set # CONFIG_AD7124 is not set # CONFIG_AD7150 is not set -# CONFIG_AD7152 is not set # CONFIG_AD7192 is not set # CONFIG_AD7266 is not set # CONFIG_AD7280 is not set @@ -94,7 +91,6 @@ CONFIG_64BIT_TIME=y # CONFIG_AD9834 is not set # CONFIG_ADA4250 is not set # CONFIG_ADAPTEC_STARFIRE is not set -# CONFIG_ADE7854 is not set # CONFIG_ADF4350 is not set # CONFIG_ADF4371 is not set # CONFIG_ADF4377 is not set @@ -188,9 +184,7 @@ CONFIG_ALLOW_DEV_COREDUMP=y # CONFIG_AMILO_RFKILL is not set # CONFIG_AMPERE_ERRATUM_AC03_CPU_38 is not set # CONFIG_AMT is not set -# CONFIG_ANDROID is not set # CONFIG_ANDROID_BINDER_IPC is not set -CONFIG_ANON_INODES=y # CONFIG_ANON_VMA_NAME is not set # CONFIG_APDS9300 is not set # CONFIG_APDS9802ALS is not set @@ -208,7 +202,6 @@ CONFIG_ANON_INODES=y # CONFIG_AR8216_PHY is not set # CONFIG_AR8216_PHY_LEDS is not set # CONFIG_ARCH_ACTIONS is not set -# CONFIG_ARCH_AGILEX is not set # CONFIG_ARCH_AIROHA is not set # CONFIG_ARCH_ALPINE is not set # CONFIG_ARCH_APPLE is not set @@ -218,14 +211,12 @@ CONFIG_ANON_INODES=y # CONFIG_ARCH_AXXIA is not set # CONFIG_ARCH_BCM is not set # CONFIG_ARCH_BCM2835 is not set -# CONFIG_ARCH_BCM4908 is not set # CONFIG_ARCH_BCMBCA is not set # CONFIG_ARCH_BCM_21664 is not set # CONFIG_ARCH_BCM_23550 is not set # CONFIG_ARCH_BCM_281XX is not set # CONFIG_ARCH_BCM_5301X is not set # CONFIG_ARCH_BCM_53573 is not set -# CONFIG_ARCH_BCM_63XX is not set # CONFIG_ARCH_BCM_CYGNUS is not set # CONFIG_ARCH_BCM_HR2 is not set # CONFIG_ARCH_BCM_IPROC is not set @@ -235,12 +226,10 @@ CONFIG_ARCH_BINFMT_ELF_STATE=y # CONFIG_ARCH_BITMAIN is not set # CONFIG_ARCH_BRCMSTB is not set # CONFIG_ARCH_CLPS711X is not set -# CONFIG_ARCH_CNS3XXX is not set # CONFIG_ARCH_DAVINCI is not set # CONFIG_ARCH_DIGICOLOR is not set # CONFIG_ARCH_DMA_ADDR_T_64BIT is not set # CONFIG_ARCH_DOVE is not set -# CONFIG_ARCH_EBSA110 is not set # CONFIG_ARCH_EP93XX is not set # CONFIG_ARCH_EXYNOS is not set CONFIG_ARCH_FLATMEM_ENABLE=y @@ -253,14 +242,10 @@ CONFIG_ARCH_FORCE_MAX_ORDER=11 # CONFIG_ARCH_HPE is not set # CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_INTEL_SOCFPGA is not set -# CONFIG_ARCH_IOP13XX is not set -# CONFIG_ARCH_IOP32X is not set -# CONFIG_ARCH_IOP33X is not set # CONFIG_ARCH_IXP4XX is not set # CONFIG_ARCH_K3 is not set # CONFIG_ARCH_KEEMBAY is not set # CONFIG_ARCH_KEYSTONE is not set -# CONFIG_ARCH_KS8695 is not set # CONFIG_ARCH_LAYERSCAPE is not set # CONFIG_ARCH_LG1K is not set # CONFIG_ARCH_LPC32XX is not set @@ -283,7 +268,6 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARCH_MXC is not set # CONFIG_ARCH_MXS is not set # CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set -# CONFIG_ARCH_NETX is not set # CONFIG_ARCH_NOMADIK is not set # CONFIG_ARCH_NPCM is not set # CONFIG_ARCH_NSPIRE is not set @@ -295,12 +279,8 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARCH_OMAP3 is not set # CONFIG_ARCH_OMAP4 is not set # CONFIG_ARCH_ORION5X is not set -# CONFIG_ARCH_OXNAS is not set -# CONFIG_ARCH_PICOXCELL is not set -# CONFIG_ARCH_PRIMA2 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_QCOM is not set -# CONFIG_ARCH_RANDOM is not set # CONFIG_ARCH_RDA is not set # CONFIG_ARCH_REALTEK is not set # CONFIG_ARCH_REALVIEW is not set @@ -308,27 +288,21 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARCH_ROCKCHIP is not set # CONFIG_ARCH_RPC is not set # CONFIG_ARCH_S32 is not set -# CONFIG_ARCH_S3C24XX is not set # CONFIG_ARCH_S3C64XX is not set # CONFIG_ARCH_S5PV210 is not set # CONFIG_ARCH_SA1100 is not set # CONFIG_ARCH_SEATTLE is not set # CONFIG_ARCH_SHMOBILE is not set -# CONFIG_ARCH_SIRF is not set -# CONFIG_ARCH_SOCFPGA is not set # CONFIG_ARCH_SPARX5 is not set # CONFIG_ARCH_SPRD is not set # CONFIG_ARCH_STI is not set # CONFIG_ARCH_STM32 is not set -# CONFIG_ARCH_STRATIX10 is not set # CONFIG_ARCH_SUNPLUS is not set # CONFIG_ARCH_SUNXI is not set # CONFIG_ARCH_SYNQUACER is not set -# CONFIG_ARCH_TANGO is not set # CONFIG_ARCH_TEGRA is not set # CONFIG_ARCH_THUNDER is not set # CONFIG_ARCH_THUNDER2 is not set -# CONFIG_ARCH_U300 is not set # CONFIG_ARCH_U8500 is not set # CONFIG_ARCH_UNIPHIER is not set # CONFIG_ARCH_VERSATILE is not set @@ -336,14 +310,11 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARCH_VIRT is not set # CONFIG_ARCH_VISCONTI is not set # CONFIG_ARCH_VT8500 is not set -# CONFIG_ARCH_VULCAN is not set -# CONFIG_ARCH_W90X900 is not set # CONFIG_ARCH_WANTS_THP_SWAP is not set # CONFIG_ARCH_WM8505 is not set # CONFIG_ARCH_WM8750 is not set # CONFIG_ARCH_WM8850 is not set # CONFIG_ARCH_XGENE is not set -# CONFIG_ARCH_ZX is not set # CONFIG_ARCH_ZYNQ is not set # CONFIG_ARCH_ZYNQMP is not set # CONFIG_ARCNET is not set @@ -353,7 +324,6 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARM64_64K_PAGES is not set # CONFIG_ARM64_AMU_EXTN is not set # CONFIG_ARM64_BTI is not set -# CONFIG_ARM64_CRYPTO is not set # CONFIG_ARM64_E0PD is not set # CONFIG_ARM64_ERRATUM_1024718 is not set # CONFIG_ARM64_ERRATUM_1165522 is not set @@ -386,28 +356,22 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARM64_ERRATUM_858921 is not set # CONFIG_ARM64_HW_AFDBM is not set # CONFIG_ARM64_LSE_ATOMICS is not set -CONFIG_ARM64_MODULE_PLTS=y # CONFIG_ARM64_MTE is not set # CONFIG_ARM64_PAN is not set # CONFIG_ARM64_PMEM is not set # CONFIG_ARM64_PSEUDO_NMI is not set -# CONFIG_ARM64_PTDUMP_DEBUGFS is not set # CONFIG_ARM64_PTR_AUTH is not set -# CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set # CONFIG_ARM64_RAS_EXTN is not set # CONFIG_ARM64_RELOC_TEST is not set # CONFIG_ARM64_SME is not set # CONFIG_ARM64_SVE is not set CONFIG_ARM64_SW_TTBR0_PAN=y # CONFIG_ARM64_TLB_RANGE is not set -# CONFIG_ARM64_UAO is not set # CONFIG_ARM64_USE_LSE_ATOMICS is not set # CONFIG_ARM64_VA_BITS_48 is not set -# CONFIG_ARM64_VHE is not set # CONFIG_ARM_APPENDED_DTB is not set # CONFIG_ARM_ARCH_TIMER is not set # CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set -# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set # CONFIG_ARM_CCI is not set # CONFIG_ARM_CCI400_PMU is not set # CONFIG_ARM_CCI5xx_PMU is not set @@ -417,7 +381,6 @@ CONFIG_ARM64_SW_TTBR0_PAN=y # CONFIG_ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU is not set # CONFIG_ARM_CPUIDLE is not set CONFIG_ARM_CPU_TOPOLOGY=y -# CONFIG_ARM_CRYPTO is not set CONFIG_ARM_DMA_MEM_BUFFERABLE=y # CONFIG_ARM_DSU_PMU is not set # CONFIG_ARM_ERRATA_326103 is not set @@ -519,7 +482,6 @@ CONFIG_ATA_SFF=y # CONFIG_ATMEL is not set # CONFIG_ATMEL_PIT is not set # CONFIG_ATMEL_SSC is not set -# CONFIG_ATM_AMBASSADOR is not set # CONFIG_ATM_BR2684 is not set CONFIG_ATM_BR2684_IPFILTER=y # CONFIG_ATM_CLIP is not set @@ -527,10 +489,8 @@ CONFIG_ATM_CLIP_NO_ICMP=y # CONFIG_ATM_DRIVERS is not set # CONFIG_ATM_DUMMY is not set # CONFIG_ATM_ENI is not set -# CONFIG_ATM_FIRESTREAM is not set # CONFIG_ATM_FORE200E is not set # CONFIG_ATM_HE is not set -# CONFIG_ATM_HORIZON is not set # CONFIG_ATM_IA is not set # CONFIG_ATM_IDT77252 is not set # CONFIG_ATM_LANAI is not set @@ -539,13 +499,10 @@ CONFIG_ATM_CLIP_NO_ICMP=y # CONFIG_ATM_NICSTAR is not set # CONFIG_ATM_SOLOS is not set # CONFIG_ATM_TCP is not set -# CONFIG_ATM_ZATM is not set # CONFIG_ATOMIC64_SELFTEST is not set # CONFIG_ATP is not set # CONFIG_AUDIT is not set # CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set -# CONFIG_AURORA_NB8800 is not set -# CONFIG_AUTOFS4_FS is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTO_ZRELADDR is not set # CONFIG_AUXDISPLAY is not set @@ -572,21 +529,17 @@ CONFIG_ATM_CLIP_NO_ICMP=y # CONFIG_BACKLIGHT_ARCXCNN is not set # CONFIG_BACKLIGHT_BD6107 is not set # CONFIG_BACKLIGHT_CLASS_DEVICE is not set -# CONFIG_BACKLIGHT_GENERIC is not set # CONFIG_BACKLIGHT_GPIO is not set # CONFIG_BACKLIGHT_KTD253 is not set # CONFIG_BACKLIGHT_KTZ8866 is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # CONFIG_BACKLIGHT_LED is not set # CONFIG_BACKLIGHT_LM3630A is not set # CONFIG_BACKLIGHT_LM3639 is not set # CONFIG_BACKLIGHT_LP855X is not set # CONFIG_BACKLIGHT_LV5207LP is not set # CONFIG_BACKLIGHT_PANDORA is not set -# CONFIG_BACKLIGHT_PM8941_WLED is not set # CONFIG_BACKLIGHT_PWM is not set # CONFIG_BACKLIGHT_QCOM_WLED is not set -# CONFIG_BACKLIGHT_RPI is not set # CONFIG_BACKLIGHT_SAHARA is not set # CONFIG_BACKTRACE_SELF_TEST is not set # CONFIG_BACKTRACE_VERBOSE is not set @@ -616,7 +569,6 @@ CONFIG_BASE_SMALL=0 # CONFIG_BAYCOM_SER_FDX is not set # CONFIG_BAYCOM_SER_HDX is not set # CONFIG_BCACHE is not set -# CONFIG_BCM2712_MIP is not set # CONFIG_BCM47XX is not set # CONFIG_BCM54140_PHY is not set # CONFIG_BCM63XX is not set @@ -646,7 +598,6 @@ CONFIG_BCMA_POSSIBLE=y # CONFIG_BIG_KEYS is not set # CONFIG_BIG_LITTLE is not set CONFIG_BINARY_PRINTF=y -# CONFIG_BINFMT_AOUT is not set CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_ELF_FDPIC is not set # CONFIG_BINFMT_FLAT is not set @@ -656,89 +607,32 @@ CONFIG_BITREVERSE=y # CONFIG_BLK_CGROUP_IOCOST is not set # CONFIG_BLK_CGROUP_IOLATENCY is not set # CONFIG_BLK_CGROUP_IOPRIO is not set -# CONFIG_BLK_CMDLINE_PARSER is not set # CONFIG_BLK_DEBUG_FS is not set CONFIG_BLK_DEV=y # CONFIG_BLK_DEV_3W_XXXX_RAID is not set -# CONFIG_BLK_DEV_4DRIVES is not set -# CONFIG_BLK_DEV_AEC62XX is not set -# CONFIG_BLK_DEV_ALI14XX is not set -# CONFIG_BLK_DEV_ALI15X3 is not set -# CONFIG_BLK_DEV_AMD74XX is not set -# CONFIG_BLK_DEV_ATIIXP is not set # CONFIG_BLK_DEV_BSG is not set # CONFIG_BLK_DEV_BSGLIB is not set -# CONFIG_BLK_DEV_CMD640 is not set -# CONFIG_BLK_DEV_CMD64X is not set # CONFIG_BLK_DEV_COW_COMMON is not set -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_CS5520 is not set -# CONFIG_BLK_DEV_CS5530 is not set -# CONFIG_BLK_DEV_CS5535 is not set -# CONFIG_BLK_DEV_CS5536 is not set -# CONFIG_BLK_DEV_CY82C693 is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_DELKIN is not set # CONFIG_BLK_DEV_DM is not set # CONFIG_BLK_DEV_DRBD is not set -# CONFIG_BLK_DEV_DTC2278 is not set # CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_GENERIC is not set -# CONFIG_BLK_DEV_HPT366 is not set -# CONFIG_BLK_DEV_HT6560B is not set -# CONFIG_BLK_DEV_IDEACPI is not set -# CONFIG_BLK_DEV_IDECD is not set -# CONFIG_BLK_DEV_IDECS is not set -# CONFIG_BLK_DEV_IDEPCI is not set -# CONFIG_BLK_DEV_IDEPNP is not set -# CONFIG_BLK_DEV_IDETAPE is not set -# CONFIG_BLK_DEV_IDE_AU1XXX is not set -# CONFIG_BLK_DEV_IDE_SATA is not set CONFIG_BLK_DEV_INITRD=y # CONFIG_BLK_DEV_INTEGRITY is not set # CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_BLK_DEV_IT8172 is not set -# CONFIG_BLK_DEV_IT8213 is not set -# CONFIG_BLK_DEV_IT821X is not set -# CONFIG_BLK_DEV_JMICRON is not set # CONFIG_BLK_DEV_LOOP is not set CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 # CONFIG_BLK_DEV_MD is not set # CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_NULL_BLK is not set # CONFIG_BLK_DEV_NVME is not set -# CONFIG_BLK_DEV_OFFBOARD is not set -# CONFIG_BLK_DEV_OPTI621 is not set # CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -# CONFIG_BLK_DEV_PDC202XX_NEW is not set -# CONFIG_BLK_DEV_PDC202XX_OLD is not set -# CONFIG_BLK_DEV_PIIX is not set -# CONFIG_BLK_DEV_PLATFORM is not set # CONFIG_BLK_DEV_PMEM is not set -# CONFIG_BLK_DEV_QD65XX is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_BLK_DEV_RBD is not set -# CONFIG_BLK_DEV_RSXX is not set -# CONFIG_BLK_DEV_RZ1000 is not set -# CONFIG_BLK_DEV_SC1200 is not set # CONFIG_BLK_DEV_SD is not set -# CONFIG_BLK_DEV_SIIMAGE is not set -# CONFIG_BLK_DEV_SIS5513 is not set -# CONFIG_BLK_DEV_SKD is not set -# CONFIG_BLK_DEV_SL82C105 is not set -# CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_SR is not set -# CONFIG_BLK_DEV_SVWKS is not set -# CONFIG_BLK_DEV_SX8 is not set -# CONFIG_BLK_DEV_TC86C001 is not set # CONFIG_BLK_DEV_THROTTLING is not set -# CONFIG_BLK_DEV_TRIFLEX is not set -# CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_UBLK is not set -# CONFIG_BLK_DEV_UMC8672 is not set -# CONFIG_BLK_DEV_UMEM is not set -# CONFIG_BLK_DEV_VIA82CXXX is not set # CONFIG_BLK_DEV_ZONED is not set # CONFIG_BLK_INLINE_ENCRYPTION is not set # CONFIG_BLOCK_NOTIFIERS is not set @@ -867,7 +761,6 @@ CONFIG_BT_HCIUART_H4=y # CONFIG_BT_HCIUART_RTL is not set # CONFIG_BT_HCIVHCI is not set # CONFIG_BT_HIDP is not set -# CONFIG_BT_HS is not set # CONFIG_BT_LE is not set # CONFIG_BT_LEDS is not set CONFIG_BT_LE_L2CAP_ECRED=y @@ -882,9 +775,7 @@ CONFIG_BT_RFCOMM_TTY=y # CONFIG_BT_VIRTIO is not set CONFIG_BUG=y # CONFIG_BUG_ON_DATA_CORRUPTION is not set -CONFIG_BUILDTIME_EXTABLE_SORT=y CONFIG_BUILDTIME_TABLE_SORT=y -# CONFIG_BUILD_BIN2C is not set CONFIG_BUILD_SALT="" # CONFIG_C2PORT is not set # CONFIG_CACHESTAT_SYSCALL is not set @@ -921,12 +812,8 @@ CONFIG_CACHE_L2X0_PMU=y # CONFIG_CAN_UCAN is not set # CONFIG_CAN_VCAN is not set # CONFIG_CAN_VXCAN is not set -# CONFIG_CAPI_AVM is not set -# CONFIG_CAPI_EICON is not set # CONFIG_CAPI_TRACE is not set CONFIG_CARDBUS=y -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set # CONFIG_CARL9170 is not set # CONFIG_CASSINI is not set # CONFIG_CAVIUM_CPT is not set @@ -969,7 +856,6 @@ CONFIG_CFG80211_HEADERS=y # CONFIG_CHARGER_ISP1704 is not set # CONFIG_CHARGER_LP8727 is not set # CONFIG_CHARGER_LT3651 is not set -# CONFIG_CHARGER_LTC3651 is not set # CONFIG_CHARGER_LTC4162L is not set # CONFIG_CHARGER_MANAGER is not set # CONFIG_CHARGER_MAX77976 is not set @@ -983,35 +869,27 @@ CONFIG_CFG80211_HEADERS=y # CONFIG_CHARGER_SMB347 is not set # CONFIG_CHARGER_TWL4030 is not set # CONFIG_CHARGER_UCS1002 is not set -# CONFIG_CHASH_SELFTEST is not set -# CONFIG_CHASH_STATS is not set # CONFIG_CHECKPOINT_RESTORE is not set # CONFIG_CHELSIO_T1 is not set # CONFIG_CHELSIO_T3 is not set # CONFIG_CHELSIO_T4 is not set # CONFIG_CHELSIO_T4VF is not set # CONFIG_CHROME_PLATFORMS is not set -# CONFIG_CHR_DEV_OSST is not set # CONFIG_CHR_DEV_SCH is not set # CONFIG_CHR_DEV_SG is not set # CONFIG_CHR_DEV_ST is not set # CONFIG_CICADA_PHY is not set # CONFIG_CIFS is not set -# CONFIG_CIFS_ACL is not set CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y # CONFIG_CIFS_DEBUG is not set # CONFIG_CIFS_DEBUG2 is not set # CONFIG_CIFS_FSCACHE is not set # CONFIG_CIFS_NFSD_EXPORT is not set CONFIG_CIFS_POSIX=y -# CONFIG_CIFS_SMB2 is not set -# CONFIG_CIFS_STATS is not set # CONFIG_CIFS_STATS2 is not set # CONFIG_CIFS_SWN_UPCALL is not set -# CONFIG_CIFS_WEAK_PW_HASH is not set CONFIG_CIFS_XATTR=y # CONFIG_CIO_DAC is not set -# CONFIG_CLEANCACHE is not set # CONFIG_CLKSRC_PISTACHIO is not set # CONFIG_CLKSRC_VERSATILE is not set # CONFIG_CLK_GFM_LPASS_SM8250 is not set @@ -1019,7 +897,6 @@ CONFIG_CIFS_XATTR=y # CONFIG_CLK_ICST is not set # CONFIG_CLK_QORIQ is not set # CONFIG_CLK_SP810 is not set -# CONFIG_CLOCK_THERMAL is not set CONFIG_CLS_U32_MARK=y # CONFIG_CLS_U32_PERF is not set # CONFIG_CM32181 is not set @@ -1062,8 +939,6 @@ CONFIG_CMDLINE="" # CONFIG_COMMON_CLK_PWM is not set # CONFIG_COMMON_CLK_PXA is not set # CONFIG_COMMON_CLK_QCOM is not set -# CONFIG_COMMON_CLK_RP1 is not set -# CONFIG_COMMON_CLK_RP1_SDIO is not set # CONFIG_COMMON_CLK_RS9_PCIE is not set # CONFIG_COMMON_CLK_SI514 is not set # CONFIG_COMMON_CLK_SI521XX is not set @@ -1107,7 +982,6 @@ CONFIG_CONSTRUCTORS=y # CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set # CONFIG_CPU_FREQ_GOV_SCHEDUTIL is not set -# CONFIG_CPU_FREQ_STAT_DETAILS is not set # CONFIG_CPU_FREQ_THERMAL is not set # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set # CONFIG_CPU_ICACHE_DISABLE is not set @@ -1141,7 +1015,7 @@ CONFIG_CRC32_SARWATE=y # CONFIG_CRC_CCITT is not set # CONFIG_CRC_ITU_T is not set # CONFIG_CRC_T10DIF is not set -CONFIG_CROSS_COMPILE="" +# CONFIG_CROS_HPS_I2C is not set # CONFIG_CROSS_MEMORY_ATTACH is not set CONFIG_CRYPTO=y # CONFIG_CRYPTO_842 is not set @@ -1150,13 +1024,8 @@ CONFIG_CRYPTO_ACOMP2=y CONFIG_CRYPTO_AEAD=y CONFIG_CRYPTO_AEAD2=y # CONFIG_CRYPTO_AEGIS128 is not set -# CONFIG_CRYPTO_AEGIS128L is not set -# CONFIG_CRYPTO_AEGIS128L_AESNI_SSE2 is not set # CONFIG_CRYPTO_AEGIS128_AESNI_SSE2 is not set -# CONFIG_CRYPTO_AEGIS256 is not set -# CONFIG_CRYPTO_AEGIS256_AESNI_SSE2 is not set CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_AES_586 is not set # CONFIG_CRYPTO_AES_ARM is not set # CONFIG_CRYPTO_AES_ARM64 is not set # CONFIG_CRYPTO_AES_ARM64_BS is not set @@ -1222,14 +1091,14 @@ CONFIG_CRYPTO_CTR=y # CONFIG_CRYPTO_DEV_CCREE is not set # CONFIG_CRYPTO_DEV_FSL_CAAM is not set # CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC is not set +# CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set +# CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set +# CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_TEST is not set # CONFIG_CRYPTO_DEV_HIFN_795X is not set # CONFIG_CRYPTO_DEV_HISI_SEC is not set # CONFIG_CRYPTO_DEV_HISI_ZIP is not set # CONFIG_CRYPTO_DEV_IMGTEC_HASH is not set # CONFIG_CRYPTO_DEV_MARVELL_CESA is not set -# CONFIG_CRYPTO_DEV_MEDIATEK is not set -# CONFIG_CRYPTO_DEV_MV_CESA is not set -# CONFIG_CRYPTO_DEV_MXC_SCC is not set # CONFIG_CRYPTO_DEV_MXS_DCP is not set # CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set # CONFIG_CRYPTO_DEV_OCTEONTX_CPT is not set @@ -1260,7 +1129,6 @@ CONFIG_CRYPTO_CTR=y # CONFIG_CRYPTO_FCRYPT is not set # CONFIG_CRYPTO_FIPS is not set CONFIG_CRYPTO_GCM=y -CONFIG_CRYPTO_GF128MUL=y CONFIG_CRYPTO_GHASH=y # CONFIG_CRYPTO_GHASH_ARM64_CE is not set # CONFIG_CRYPTO_GHASH_ARM_CE is not set @@ -1291,22 +1159,14 @@ CONFIG_CRYPTO_LIB_POLY1305_RSIZE=9 CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_MANAGER2=y CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y -# CONFIG_CRYPTO_MCRYPTD is not set # CONFIG_CRYPTO_MD4 is not set # CONFIG_CRYPTO_MD5 is not set # CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_MORUS1280 is not set -# CONFIG_CRYPTO_MORUS1280_AVX2 is not set -# CONFIG_CRYPTO_MORUS1280_SSE2 is not set -# CONFIG_CRYPTO_MORUS640 is not set -# CONFIG_CRYPTO_MORUS640_SSE2 is not set # CONFIG_CRYPTO_NHPOLY1305_NEON is not set CONFIG_CRYPTO_NULL=y CONFIG_CRYPTO_NULL2=y # CONFIG_CRYPTO_OFB is not set # CONFIG_CRYPTO_PCBC is not set -# CONFIG_CRYPTO_PCOMP is not set -# CONFIG_CRYPTO_PCOMP2 is not set CONFIG_CRYPTO_PCRYPT=y # CONFIG_CRYPTO_POLY1305 is not set # CONFIG_CRYPTO_POLY1305_ARM is not set @@ -1351,7 +1211,6 @@ CONFIG_CRYPTO_SKCIPHER2=y # CONFIG_CRYPTO_SM4_ARM64_CE_GCM is not set # CONFIG_CRYPTO_SM4_ARM64_NEON_BLK is not set # CONFIG_CRYPTO_SM4_GENERIC is not set -# CONFIG_CRYPTO_SPECK is not set # CONFIG_CRYPTO_STATS is not set # CONFIG_CRYPTO_STREEBOG is not set # CONFIG_CRYPTO_TEA is not set @@ -1371,7 +1230,6 @@ CONFIG_CRYPTO_SKCIPHER2=y # CONFIG_CRYPTO_XCBC is not set # CONFIG_CRYPTO_XTS is not set # CONFIG_CRYPTO_XXHASH is not set -# CONFIG_CRYPTO_ZLIB is not set # CONFIG_CRYPTO_ZSTD is not set # CONFIG_CS5535_MFGPT is not set # CONFIG_CS89x0 is not set @@ -1380,12 +1238,8 @@ CONFIG_CRYPTO_SKCIPHER2=y # CONFIG_CUSE is not set # CONFIG_CW1200 is not set # CONFIG_CXD2880_SPI_DRV is not set -# CONFIG_CXL_AFU_DRIVER_OPS is not set # CONFIG_CXL_BASE is not set # CONFIG_CXL_BUS is not set -# CONFIG_CXL_EEH is not set -# CONFIG_CXL_KERNEL_API is not set -# CONFIG_CXL_LIB is not set # CONFIG_CYPRESS_FIRMWARE is not set # CONFIG_DA280 is not set # CONFIG_DA311 is not set @@ -1396,14 +1250,11 @@ CONFIG_CRYPTO_SKCIPHER2=y # CONFIG_DDR is not set # CONFIG_DEBUG_ALIGN_RODATA is not set # CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set # CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_DEBUG_CGROUP_REF is not set -# CONFIG_DEBUG_CREDENTIALS is not set # CONFIG_DEBUG_DEVRES is not set # CONFIG_DEBUG_DRIVER is not set # CONFIG_DEBUG_EFI is not set -# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_32B is not set # CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set CONFIG_DEBUG_FS=y @@ -1443,14 +1294,12 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_MUTEXES is not set # CONFIG_DEBUG_NET is not set # CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_NX_TEST is not set # CONFIG_DEBUG_OBJECTS is not set # CONFIG_DEBUG_PAGEALLOC is not set # CONFIG_DEBUG_PAGE_REF is not set # CONFIG_DEBUG_PERF_USE_VMALLOC is not set # CONFIG_DEBUG_PER_CPU_MAPS is not set # CONFIG_DEBUG_PINCTRL is not set -# CONFIG_DEBUG_PI_LIST is not set # CONFIG_DEBUG_PLIST is not set # CONFIG_DEBUG_PREEMPT is not set # CONFIG_DEBUG_RODATA_TEST is not set @@ -1465,12 +1314,10 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_STACKOVERFLOW is not set # CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set # CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set # CONFIG_DEBUG_TIMEKEEPING is not set # CONFIG_DEBUG_UART_8250_PALMCHIP is not set # CONFIG_DEBUG_UART_8250_WORD is not set -# CONFIG_DEBUG_UART_BCM63XX is not set # CONFIG_DEBUG_UART_FLOW_CONTROL is not set # CONFIG_DEBUG_USER is not set # CONFIG_DEBUG_VIRTUAL is not set @@ -1479,15 +1326,12 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_VM_PGFLAGS is not set # CONFIG_DEBUG_VM_PGTABLE is not set # CONFIG_DEBUG_VM_RB is not set -# CONFIG_DEBUG_VM_VMACACHE is not set # CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set # CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set # CONFIG_DEBUG_WX is not set # CONFIG_DEBUG_ZBOOT is not set -# CONFIG_DECNET is not set # CONFIG_DEFAULT_CODEL is not set CONFIG_DEFAULT_CUBIC=y -CONFIG_DEFAULT_DEADLINE=y # CONFIG_DEFAULT_FQ is not set CONFIG_DEFAULT_FQ_CODEL=y # CONFIG_DEFAULT_FQ_PIE is not set @@ -1496,15 +1340,12 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 CONFIG_DEFAULT_INIT="" CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 CONFIG_DEFAULT_NET_SCH="fq_codel" -# CONFIG_DEFAULT_NOOP is not set # CONFIG_DEFAULT_PFIFO_FAST is not set # CONFIG_DEFAULT_RENO is not set -CONFIG_DEFAULT_SECURITY="" CONFIG_DEFAULT_SECURITY_DAC=y # CONFIG_DEFAULT_SECURITY_SELINUX is not set # CONFIG_DEFAULT_SFQ is not set CONFIG_DEFAULT_TCP_CONG="cubic" -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set # CONFIG_DELL_LAPTOP is not set # CONFIG_DELL_RBTN is not set @@ -1512,27 +1353,13 @@ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # CONFIG_DELL_SMO8800 is not set # CONFIG_DEPRECATED_PARAM_STRUCT is not set # CONFIG_DETECT_HUNG_TASK is not set -# CONFIG_DEVKMEM is not set # CONFIG_DEVMEM is not set CONFIG_DEVPORT=y -# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set # CONFIG_DEVTMPFS is not set # CONFIG_DEVTMPFS_MOUNT is not set # CONFIG_DEVTMPFS_SAFE is not set # CONFIG_DEV_DAX is not set -# CONFIG_DGAP is not set -# CONFIG_DGNC is not set # CONFIG_DHT11 is not set -# CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_DISPLAY_CONNECTOR_ANALOG_TV is not set -# CONFIG_DISPLAY_CONNECTOR_DVI is not set -# CONFIG_DISPLAY_CONNECTOR_HDMI is not set -# CONFIG_DISPLAY_ENCODER_TFP410 is not set -# CONFIG_DISPLAY_ENCODER_TPD12S015 is not set -# CONFIG_DISPLAY_PANEL_DPI is not set -# CONFIG_DISPLAY_PANEL_LGPHILIPS_LB035Q02 is not set -# CONFIG_DISPLAY_PANEL_TPO_TD028TTEC1 is not set -# CONFIG_DISPLAY_PANEL_TPO_TD043MTEA1 is not set # CONFIG_DL2K is not set # CONFIG_DLHL60D is not set # CONFIG_DLM is not set @@ -1549,7 +1376,6 @@ CONFIG_DEVPORT=y # CONFIG_DMARD06 is not set # CONFIG_DMARD09 is not set # CONFIG_DMARD10 is not set -# CONFIG_DMASCC is not set # CONFIG_DMATEST is not set # CONFIG_DMA_API_DEBUG is not set CONFIG_DMA_COHERENT_POOL=y @@ -1559,11 +1385,8 @@ CONFIG_DMA_DECLARE_COHERENT=y # CONFIG_DMA_JZ4780 is not set # CONFIG_DMA_MAP_BENCHMARK is not set CONFIG_DMA_NONCOHERENT_MMAP=y -# CONFIG_DMA_NOOP_OPS is not set -# CONFIG_DMA_PERNUMA_CMA is not set # CONFIG_DMA_RESTRICTED_POOL is not set # CONFIG_DMA_SHARED_BUFFER is not set -# CONFIG_DMA_VIRT_OPS is not set # CONFIG_DM_CACHE is not set # CONFIG_DM_CLONE is not set # CONFIG_DM_DEBUG is not set @@ -1575,7 +1398,6 @@ CONFIG_DMA_NONCOHERENT_MMAP=y # CONFIG_DM_INTEGRITY is not set # CONFIG_DM_LOG_USERSPACE is not set # CONFIG_DM_LOG_WRITES is not set -# CONFIG_DM_MQ_DEFAULT is not set # CONFIG_DM_MULTIPATH is not set # CONFIG_DM_RAID is not set # CONFIG_DM_SWITCH is not set @@ -1589,7 +1411,6 @@ CONFIG_DMA_NONCOHERENT_MMAP=y # CONFIG_DNET is not set # CONFIG_DNOTIFY is not set # CONFIG_DNS_RESOLVER is not set -CONFIG_DOUBLEFAULT=y # CONFIG_DP83640_PHY is not set # CONFIG_DP83822_PHY is not set # CONFIG_DP83848_PHY is not set @@ -1606,14 +1427,10 @@ CONFIG_DQL=y # CONFIG_DRM_ACCEL is not set # CONFIG_DRM_AMDGPU is not set # CONFIG_DRM_AMDGPU_CIK is not set -# CONFIG_DRM_AMDGPU_GART_DEBUGFS is not set # CONFIG_DRM_AMDGPU_SI is not set # CONFIG_DRM_AMDGPU_USERPTR is not set # CONFIG_DRM_AMDGPU_WERROR is not set # CONFIG_DRM_AMD_ACP is not set -# CONFIG_DRM_AMD_DC_DCN2_0 is not set -# CONFIG_DRM_AMD_DC_DCN3_0 is not set -# CONFIG_DRM_AMD_DC_HDCP is not set # CONFIG_DRM_AMD_DC_SI is not set # CONFIG_DRM_AMD_SECURE_DISPLAY is not set # CONFIG_DRM_ANALOGIX_ANX6345 is not set @@ -1632,11 +1449,9 @@ CONFIG_DQL=y # CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set # CONFIG_DRM_DEBUG_MM is not set # CONFIG_DRM_DEBUG_MODESET_LOCK is not set -# CONFIG_DRM_DEBUG_SELFTEST is not set # CONFIG_DRM_DISPLAY_CONNECTOR is not set # CONFIG_DRM_DP_AUX_CHARDEV is not set # CONFIG_DRM_DP_CEC is not set -# CONFIG_DRM_DUMB_VGA_DAC is not set # CONFIG_DRM_DW_HDMI_CEC is not set # CONFIG_DRM_ETNAVIV is not set # CONFIG_DRM_EXYNOS is not set @@ -1670,7 +1485,6 @@ CONFIG_DQL=y # CONFIG_DRM_LONTIUM_LT9611UXC is not set # CONFIG_DRM_LOONGSON is not set # CONFIG_DRM_LVDS_CODEC is not set -# CONFIG_DRM_LVDS_ENCODER is not set # CONFIG_DRM_MALI_DISPLAY is not set # CONFIG_DRM_MCDE is not set # CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set @@ -1696,7 +1510,6 @@ CONFIG_DQL=y # CONFIG_DRM_PANEL_HIMAX_HX8394 is not set # CONFIG_DRM_PANEL_ILITEK_IL9322 is not set # CONFIG_DRM_PANEL_ILITEK_ILI9341 is not set -# CONFIG_DRM_PANEL_ILITEK_ILI9806E is not set # CONFIG_DRM_PANEL_ILITEK_ILI9881C is not set # CONFIG_DRM_PANEL_INNOLUX_EJ030NA is not set # CONFIG_DRM_PANEL_INNOLUX_P079ZCA is not set @@ -1730,7 +1543,6 @@ CONFIG_DQL=y # CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set # CONFIG_DRM_PANEL_RAYDIUM_RM67191 is not set # CONFIG_DRM_PANEL_RAYDIUM_RM68200 is not set -# CONFIG_DRM_PANEL_ROCKTECH_JH057N00900 is not set # CONFIG_DRM_PANEL_RONBO_RB070D30 is not set # CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20 is not set # CONFIG_DRM_PANEL_SAMSUNG_DB7430 is not set @@ -1753,7 +1565,6 @@ CONFIG_DQL=y # CONFIG_DRM_PANEL_SITRONIX_ST7701 is not set # CONFIG_DRM_PANEL_SITRONIX_ST7703 is not set # CONFIG_DRM_PANEL_SITRONIX_ST7789V is not set -# CONFIG_DRM_PANEL_SONY_ACX424AKP is not set # CONFIG_DRM_PANEL_SONY_ACX565AKM is not set # CONFIG_DRM_PANEL_SONY_TD4353_JDI is not set # CONFIG_DRM_PANEL_SONY_TULIP_TRULY_NT35521 is not set @@ -1762,12 +1573,10 @@ CONFIG_DQL=y # CONFIG_DRM_PANEL_TPO_TD028TTEC1 is not set # CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set # CONFIG_DRM_PANEL_TPO_TPG110 is not set -# CONFIG_DRM_PANEL_TPO_Y17P is not set # CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set # CONFIG_DRM_PANEL_VISIONOX_R66451 is not set # CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set # CONFIG_DRM_PANEL_VISIONOX_VTDR6130 is not set -# CONFIG_DRM_PANEL_WAVESHARE_TOUCHSCREEN is not set # CONFIG_DRM_PANEL_WIDECHIPS_WS2401 is not set # CONFIG_DRM_PANEL_XINPENG_XPP055C272 is not set # CONFIG_DRM_PANFROST is not set @@ -1782,9 +1591,6 @@ CONFIG_DQL=y # CONFIG_DRM_RCAR_USE_LVDS is not set # CONFIG_DRM_RCAR_USE_MIPI_DSI is not set # CONFIG_DRM_ROCKCHIP is not set -# CONFIG_DRM_RP1_DPI is not set -# CONFIG_DRM_RP1_DSI is not set -# CONFIG_DRM_RP1_VEC is not set # CONFIG_DRM_SAMSUNG_DSIM is not set # CONFIG_DRM_SII902X is not set # CONFIG_DRM_SII9234 is not set @@ -1798,7 +1604,6 @@ CONFIG_DQL=y # CONFIG_DRM_THINE_THC63LVD1024 is not set # CONFIG_DRM_TIDSS is not set # CONFIG_DRM_TILCDC is not set -# CONFIG_DRM_TINYDRM is not set # CONFIG_DRM_TI_DLPC3433 is not set # CONFIG_DRM_TI_SN65DSI83 is not set # CONFIG_DRM_TI_SN65DSI86 is not set @@ -2013,9 +1818,7 @@ CONFIG_EFI_PARTITION=y CONFIG_ELFCORE=y # CONFIG_ELF_CORE is not set # CONFIG_EMAC_ROCKCHIP is not set -CONFIG_EMBEDDED=y # CONFIG_EM_TIMER_STI is not set -CONFIG_ENABLE_WARN_DEPRECATED=y # CONFIG_ENA_ETHERNET is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCLOSURE_SERVICES is not set @@ -2043,14 +1846,12 @@ CONFIG_EXPORTFS=y CONFIG_EXT2_FS_XATTR=y # CONFIG_EXT3_FS is not set # CONFIG_EXT4_DEBUG is not set -# CONFIG_EXT4_ENCRYPTION is not set # CONFIG_EXT4_FS is not set # CONFIG_EXT4_FS_POSIX_ACL is not set # CONFIG_EXT4_FS_SECURITY is not set CONFIG_EXT4_USE_FOR_EXT2=y # CONFIG_EXTCON is not set # CONFIG_EXTCON_ADC_JACK is not set -# CONFIG_EXTCON_ARIZONA is not set # CONFIG_EXTCON_AXP288 is not set # CONFIG_EXTCON_FSA9480 is not set # CONFIG_EXTCON_GPIO is not set @@ -2065,19 +1866,16 @@ CONFIG_EXT4_USE_FOR_EXT2=y CONFIG_EXTRA_FIRMWARE="" CONFIG_EXTRA_TARGETS="" # CONFIG_EXYNOS_ADC is not set -# CONFIG_EXYNOS_VIDEO is not set # CONFIG_EZCHIP_NPS_MANAGEMENT_ENET is not set # CONFIG_EZX_PCAP is not set # CONFIG_F2FS_CHECK_FS is not set # CONFIG_F2FS_FAULT_INJECTION is not set # CONFIG_F2FS_FS is not set # CONFIG_F2FS_FS_COMPRESSION is not set -# CONFIG_F2FS_FS_ENCRYPTION is not set # CONFIG_F2FS_FS_POSIX_ACL is not set # CONFIG_F2FS_FS_SECURITY is not set CONFIG_F2FS_FS_XATTR=y # CONFIG_F2FS_IOSTAT is not set -# CONFIG_F2FS_IO_TRACE is not set CONFIG_F2FS_STAT_FS=y # CONFIG_F2FS_UNFAIR_RWSEM is not set # CONFIG_FAILOVER is not set @@ -2098,10 +1896,8 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_FB_ATMEL is not set # CONFIG_FB_ATY is not set # CONFIG_FB_ATY128 is not set -# CONFIG_FB_AUO_K190X is not set # CONFIG_FB_BACKLIGHT is not set # CONFIG_FB_BIG_ENDIAN is not set -# CONFIG_FB_BOOT_VESA_SUPPORT is not set # CONFIG_FB_BOTH_ENDIAN is not set # CONFIG_FB_BROADSHEET is not set # CONFIG_FB_CARMINE is not set @@ -2114,7 +1910,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_FB_DA8XX is not set # CONFIG_FB_DDC is not set # CONFIG_FB_DEVICE is not set -# CONFIG_FB_FLEX is not set # CONFIG_FB_FOREIGN_ENDIAN is not set # CONFIG_FB_FSL_DIU is not set # CONFIG_FB_GEODE is not set @@ -2132,7 +1927,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_FB_MB862XX is not set # CONFIG_FB_METRONOME is not set # CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_MXS is not set # CONFIG_FB_N411 is not set # CONFIG_FB_NEOMAGIC is not set CONFIG_FB_NOTIFY=y @@ -2146,7 +1940,6 @@ CONFIG_FB_NOTIFY=y # CONFIG_FB_PXA is not set # CONFIG_FB_RADEON is not set # CONFIG_FB_RIVA is not set -# CONFIG_FB_RPISENSE is not set # CONFIG_FB_S1D13XXX is not set # CONFIG_FB_S3 is not set # CONFIG_FB_SAVAGE is not set @@ -2164,7 +1957,6 @@ CONFIG_FB_NOTIFY=y # CONFIG_FB_TFT is not set # CONFIG_FB_TFT_AGM1264K_FL is not set # CONFIG_FB_TFT_BD663474 is not set -# CONFIG_FB_TFT_FBTFT_DEVICE is not set # CONFIG_FB_TFT_HX8340BN is not set # CONFIG_FB_TFT_HX8347D is not set # CONFIG_FB_TFT_HX8353D is not set @@ -2185,7 +1977,6 @@ CONFIG_FB_NOTIFY=y # CONFIG_FB_TFT_SSD1289 is not set # CONFIG_FB_TFT_SSD1305 is not set # CONFIG_FB_TFT_SSD1306 is not set -# CONFIG_FB_TFT_SSD1325 is not set # CONFIG_FB_TFT_SSD1331 is not set # CONFIG_FB_TFT_SSD1351 is not set # CONFIG_FB_TFT_ST7735R is not set @@ -2195,9 +1986,7 @@ CONFIG_FB_NOTIFY=y # CONFIG_FB_TFT_UC1611 is not set # CONFIG_FB_TFT_UC1701 is not set # CONFIG_FB_TFT_UPD161704 is not set -# CONFIG_FB_TFT_WATTEROTT is not set # CONFIG_FB_TILEBLITTING is not set -# CONFIG_FB_TMIO is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_UDL is not set # CONFIG_FB_UVESA is not set @@ -2206,12 +1995,10 @@ CONFIG_FB_NOTIFY=y # CONFIG_FB_VIRTUAL is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_VT8623 is not set -# CONFIG_FB_XGI is not set # CONFIG_FCOE is not set # CONFIG_FCOE_FNIC is not set # CONFIG_FDDI is not set # CONFIG_FEALNX is not set -# CONFIG_FENCE_TRACE is not set # CONFIG_FHANDLE is not set CONFIG_FIB_RULES=y # CONFIG_FIELDBUS_DEV is not set @@ -2219,16 +2006,12 @@ CONFIG_FILE_LOCKING=y # CONFIG_FIND_BIT_BENCHMARK is not set # CONFIG_FIREWIRE is not set # CONFIG_FIREWIRE_NOSY is not set -# CONFIG_FIREWIRE_SERIAL is not set # CONFIG_FIRMWARE_EDID is not set -# CONFIG_FIRMWARE_IN_KERNEL is not set # CONFIG_FIRMWARE_MEMMAP is not set # CONFIG_FIXED_PHY is not set CONFIG_FLATMEM=y CONFIG_FLATMEM_MANUAL=y -CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_FM10K is not set -# CONFIG_FMC is not set # CONFIG_FONTS is not set # CONFIG_FONT_6x8 is not set # CONFIG_FONT_TER16x32 is not set @@ -2242,7 +2025,6 @@ CONFIG_FORTIFY_SOURCE=y # CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set # CONFIG_FRAME_POINTER is not set # CONFIG_FREEZER is not set -# CONFIG_FRONTSWAP is not set # CONFIG_FSCACHE is not set # CONFIG_FSI is not set # CONFIG_FSL_DPAA2_SWITCH is not set @@ -2302,7 +2084,6 @@ CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y CONFIG_GACT_PROB=y # CONFIG_GADGET_UAC1 is not set # CONFIG_GAMEPORT is not set -# CONFIG_GATEWORKS_GW16083 is not set # CONFIG_GCC_PLUGINS is not set # CONFIG_GCOV is not set # CONFIG_GCOV_KERNEL is not set @@ -2323,9 +2104,6 @@ CONFIG_GENERIC_VDSO_TIME_NS=y # CONFIG_GENEVE is not set # CONFIG_GENWQE is not set # CONFIG_GFS2_FS is not set -# CONFIG_GIGASET_CAPI is not set -# CONFIG_GIGASET_DEBUG is not set -# CONFIG_GIGASET_DUMMYLL is not set # CONFIG_GLOB_SELFTEST is not set # CONFIG_GNSS is not set # CONFIG_GOLDFISH is not set @@ -2345,7 +2123,6 @@ CONFIG_GPIOLIB_FASTPATH_LIMIT=512 # CONFIG_GPIO_74X164 is not set # CONFIG_GPIO_74XX_MMIO is not set # CONFIG_GPIO_ADNP is not set -# CONFIG_GPIO_ADP5588 is not set # CONFIG_GPIO_AGGREGATOR is not set # CONFIG_GPIO_ALTERA is not set # CONFIG_GPIO_AMD8111 is not set @@ -2376,7 +2153,6 @@ CONFIG_GPIOLIB_FASTPATH_LIMIT=512 # CONFIG_GPIO_IT87 is not set # CONFIG_GPIO_LATCH is not set # CONFIG_GPIO_LOGICVC is not set -# CONFIG_GPIO_LYNXPOINT is not set # CONFIG_GPIO_MAX3191X is not set # CONFIG_GPIO_MAX7300 is not set # CONFIG_GPIO_MAX7301 is not set @@ -2395,7 +2171,6 @@ CONFIG_GPIOLIB_FASTPATH_LIMIT=512 # CONFIG_GPIO_PCI_IDIO_16 is not set # CONFIG_GPIO_PISOSR is not set # CONFIG_GPIO_PL061 is not set -# CONFIG_GPIO_PWM is not set # CONFIG_GPIO_RCAR is not set # CONFIG_GPIO_RDC321X is not set # CONFIG_GPIO_SAMA5D2_PIOBU is not set @@ -2403,7 +2178,6 @@ CONFIG_GPIOLIB_FASTPATH_LIMIT=512 # CONFIG_GPIO_SCH311X is not set # CONFIG_GPIO_SIFIVE is not set # CONFIG_GPIO_SIM is not set -# CONFIG_GPIO_SX150X is not set # CONFIG_GPIO_SYSCON is not set CONFIG_GPIO_SYSFS=y # CONFIG_GPIO_TPIC2810 is not set @@ -2418,24 +2192,17 @@ CONFIG_GPIO_SYSFS=y # CONFIG_GPIO_XILINX is not set # CONFIG_GPIO_XRA1403 is not set # CONFIG_GPIO_ZEVIO is not set -# CONFIG_GPIO_ZX is not set # CONFIG_GP_PCI1XXXX is not set # CONFIG_GREENASIA_FF is not set # CONFIG_GREYBUS is not set -# CONFIG_GS_FPGABOOT is not set # CONFIG_GTP is not set -# CONFIG_GUP_BENCHMARK is not set # CONFIG_GUP_TEST is not set # CONFIG_GVE is not set -# CONFIG_HABANA_AI is not set # CONFIG_HAMACHI is not set # CONFIG_HAMRADIO is not set # CONFIG_HAPPYMEAL is not set CONFIG_HARDENED_USERCOPY=y -# CONFIG_HARDENED_USERCOPY_FALLBACK is not set -# CONFIG_HARDENED_USERCOPY_PAGESPAN is not set CONFIG_HARDEN_BRANCH_HISTORY=y -CONFIG_HARDEN_EL2_VECTORS=y # CONFIG_HARDLOCKUP_DETECTOR is not set # CONFIG_HAVE_ARM_ARCH_TIMER is not set # CONFIG_HCALL_STATS is not set @@ -2449,14 +2216,10 @@ CONFIG_HARDEN_EL2_VECTORS=y # CONFIG_HDLC_RAW_ETH is not set # CONFIG_HDMI_LPE_AUDIO is not set # CONFIG_HDQ_MASTER_OMAP is not set -# CONFIG_HEADERS_CHECK is not set # CONFIG_HEADERS_INSTALL is not set -# CONFIG_HEADER_TEST is not set # CONFIG_HERMES is not set # CONFIG_HFSPLUS_FS is not set -# CONFIG_HFSPLUS_FS_POSIX_ACL is not set # CONFIG_HFS_FS is not set -# CONFIG_HFS_FS_POSIX_ACL is not set # CONFIG_HI6421V600_IRQ is not set # CONFIG_HI8435 is not set # CONFIG_HIBERNATION is not set @@ -2603,19 +2366,15 @@ CONFIG_HIGH_RES_TIMERS=y # CONFIG_HOTPLUG_CPU is not set # CONFIG_HOTPLUG_PCI is not set # CONFIG_HP03 is not set -# CONFIG_HP100 is not set # CONFIG_HP206C is not set CONFIG_HPET_MMAP_DEFAULT=y # CONFIG_HPFS_FS is not set # CONFIG_HP_ILO is not set # CONFIG_HP_WATCHDOG is not set -# CONFIG_HP_WIRELESS is not set # CONFIG_HSA_AMD is not set # CONFIG_HSI is not set # CONFIG_HSR is not set # CONFIG_HTC_EGPIO is not set -# CONFIG_HTC_I2CPLD is not set -# CONFIG_HTC_PASIC3 is not set # CONFIG_HTE is not set # CONFIG_HTS221 is not set # CONFIG_HTU21 is not set @@ -2655,8 +2414,6 @@ CONFIG_HW_RANDOM_TPM=y # CONFIG_HW_RANDOM_XIPHERA is not set # CONFIG_HX711 is not set # CONFIG_HYPERV is not set -# CONFIG_HYPERV_TSCPAGE is not set -# CONFIG_HYSDN is not set CONFIG_HZ=100 CONFIG_HZ_100=y # CONFIG_HZ_1000 is not set @@ -2733,7 +2490,6 @@ CONFIG_HZ_100=y # CONFIG_I2C_OCORES is not set # CONFIG_I2C_OCTEON is not set # CONFIG_I2C_PARPORT is not set -# CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_PCA_ISA is not set # CONFIG_I2C_PCA_PLATFORM is not set # CONFIG_I2C_PCI1XXXX is not set @@ -2782,12 +2538,7 @@ CONFIG_HZ_100=y # CONFIG_ICP10100 is not set # CONFIG_ICPLUS_PHY is not set # CONFIG_ICS932S401 is not set -# CONFIG_ICST is not set -# CONFIG_IDE is not set # CONFIG_IDEAPAD_LAPTOP is not set -# CONFIG_IDE_GD is not set -# CONFIG_IDE_PROC_FS is not set -# CONFIG_IDE_TASK_IOCTL is not set # CONFIG_IDLE_PAGE_TRACKING is not set # CONFIG_IEEE802154 is not set # CONFIG_IEEE802154_ADF7242 is not set @@ -2804,7 +2555,6 @@ CONFIG_HZ_100=y # CONFIG_IIO_BUFFER_CB is not set # CONFIG_IIO_BUFFER_DMA is not set # CONFIG_IIO_BUFFER_DMAENGINE is not set -# CONFIG_IIO_BUFFER_HDC2010 is not set # CONFIG_IIO_BUFFER_HW_CONSUMER is not set # CONFIG_IIO_CONFIGFS is not set CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 @@ -2813,7 +2563,6 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # CONFIG_IIO_KX022A_I2C is not set # CONFIG_IIO_KX022A_SPI is not set # CONFIG_IIO_MUX is not set -# CONFIG_IIO_PERIODIC_RTC_TRIGGER is not set # CONFIG_IIO_RESCALE is not set # CONFIG_IIO_SIMPLE_DUMMY is not set # CONFIG_IIO_SSP_SENSORHUB is not set @@ -2832,11 +2581,11 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # CONFIG_IKCONFIG_PROC is not set # CONFIG_IKHEADERS is not set # CONFIG_IMA is not set -# CONFIG_IMAGE_CMDLINE_HACK is not set # CONFIG_IMGPDC_WDT is not set # CONFIG_IMG_MDC_DMA is not set # CONFIG_IMX7D_ADC is not set # CONFIG_IMX8QXP_ADC is not set +# CONFIG_IMX93_ADC is not set # CONFIG_IMX_IPUV3_CORE is not set # CONFIG_IMX_THERMAL is not set # CONFIG_INA2XX_ADC is not set @@ -2853,7 +2602,6 @@ CONFIG_INET=y # CONFIG_INET_ESP is not set # CONFIG_INET_ESPINTCP is not set # CONFIG_INET_IPCOMP is not set -# CONFIG_INET_LRO is not set CONFIG_INET_TABLE_PERTURB_ORDER=16 # CONFIG_INET_TCP_DIAG is not set # CONFIG_INET_TUNNEL is not set @@ -2902,11 +2650,9 @@ CONFIG_INOTIFY_USER=y # CONFIG_INPUT_EVBUG is not set # CONFIG_INPUT_EVDEV is not set # CONFIG_INPUT_FF_MEMLESS is not set -# CONFIG_INPUT_GP2A is not set # CONFIG_INPUT_GPIO_BEEPER is not set # CONFIG_INPUT_GPIO_DECODER is not set # CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set -# CONFIG_INPUT_GPIO_TILT_POLLED is not set # CONFIG_INPUT_GPIO_VIBRA is not set # CONFIG_INPUT_IBM_PANEL is not set # CONFIG_INPUT_IDEAPAD_SLIDEBAR is not set @@ -2926,18 +2672,14 @@ CONFIG_INPUT_MISC=y # CONFIG_INPUT_MMA8450 is not set # CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_MPU3050 is not set -# CONFIG_INPUT_MSM_VIBRATOR is not set # CONFIG_INPUT_PALMAS_PWRBUTTON is not set # CONFIG_INPUT_PCF8574 is not set # CONFIG_INPUT_PCSPKR is not set # CONFIG_INPUT_PM8941_PWRKEY is not set # CONFIG_INPUT_PM8XXX_VIBRATOR is not set -# CONFIG_INPUT_POLLDEV is not set # CONFIG_INPUT_POWERMATE is not set # CONFIG_INPUT_PWM_BEEPER is not set # CONFIG_INPUT_PWM_VIBRA is not set -# CONFIG_INPUT_RASPBERRYPI_BUTTON is not set # CONFIG_INPUT_REGULATOR_HAPTIC is not set # CONFIG_INPUT_SOC_BUTTON_ARRAY is not set # CONFIG_INPUT_SPARSEKMAP is not set @@ -2956,7 +2698,6 @@ CONFIG_INPUT_MISC=y # CONFIG_INTEGRITY_SIGNATURE is not set # CONFIG_INTEL_ATOMISP2_LED is not set # CONFIG_INTEL_ATOMISP2_PM is not set -# CONFIG_INTEL_CHT_INT33FE is not set # CONFIG_INTEL_HID_EVENT is not set # CONFIG_INTEL_IDLE is not set # CONFIG_INTEL_IDMA64 is not set @@ -2966,9 +2707,6 @@ CONFIG_INPUT_MISC=y # CONFIG_INTEL_MEI is not set # CONFIG_INTEL_MEI_ME is not set # CONFIG_INTEL_MEI_TXE is not set -# CONFIG_INTEL_MIC_CARD is not set -# CONFIG_INTEL_MIC_HOST is not set -# CONFIG_INTEL_MID_PTI is not set # CONFIG_INTEL_OAKTRAIL is not set # CONFIG_INTEL_PMC_CORE is not set # CONFIG_INTEL_PUNIT_IPC is not set @@ -3053,7 +2791,6 @@ CONFIG_IPW2200_MONITOR=y # CONFIG_IPW2200_QOS is not set # CONFIG_IPW2200_RADIOTAP is not set # CONFIG_IPWIRELESS is not set -# CONFIG_IPX is not set CONFIG_IP_ADVANCED_ROUTER=y # CONFIG_IP_DCCP is not set # CONFIG_IP_FIB_TRIE_STATS is not set @@ -3073,7 +2810,6 @@ CONFIG_IP_MULTIPLE_TABLES=y # CONFIG_IP_NF_MATCH_TTL is not set # CONFIG_IP_NF_RAW is not set # CONFIG_IP_NF_SECURITY is not set -# CONFIG_IP_NF_TARGET_CLUSTERIP is not set # CONFIG_IP_NF_TARGET_ECN is not set # CONFIG_IP_NF_TARGET_MASQUERADE is not set # CONFIG_IP_NF_TARGET_NETMAP is not set @@ -3093,10 +2829,8 @@ CONFIG_IP_ROUTE_VERBOSE=y # CONFIG_IP_VS_MH is not set CONFIG_IP_VS_MH_TAB_INDEX=10 # CONFIG_IP_VS_TWOS is not set -# CONFIG_IRDA is not set # CONFIG_IRQSOFF_TRACER is not set # CONFIG_IRQ_ALL_CPUS is not set -# CONFIG_IRQ_DOMAIN_DEBUG is not set # CONFIG_IRQ_POLL is not set # CONFIG_IRQ_TIME_ACCOUNTING is not set # CONFIG_IRSD200 is not set @@ -3108,14 +2842,12 @@ CONFIG_IP_VS_MH_TAB_INDEX=10 # CONFIG_IR_IMON is not set # CONFIG_IR_IMON_RAW is not set # CONFIG_IR_JVC_DECODER is not set -# CONFIG_IR_LIRC_CODEC is not set # CONFIG_IR_MCEUSB is not set # CONFIG_IR_NEC_DECODER is not set # CONFIG_IR_RC5_DECODER is not set # CONFIG_IR_RC6_DECODER is not set # CONFIG_IR_REDRAT3 is not set # CONFIG_IR_SERIAL is not set -# CONFIG_IR_SIR is not set # CONFIG_IR_SONY_DECODER is not set # CONFIG_IR_STREAMZAP is not set # CONFIG_IR_TOY is not set @@ -3125,18 +2857,7 @@ CONFIG_IP_VS_MH_TAB_INDEX=10 # CONFIG_ISCSI_BOOT_SYSFS is not set # CONFIG_ISCSI_TCP is not set CONFIG_ISDN=y -# CONFIG_ISDN_AUDIO is not set # CONFIG_ISDN_CAPI is not set -# CONFIG_ISDN_CAPI_CAPIDRV is not set -# CONFIG_ISDN_DIVERSION is not set -# CONFIG_ISDN_DRV_ACT2000 is not set -# CONFIG_ISDN_DRV_GIGASET is not set -# CONFIG_ISDN_DRV_HISAX is not set -# CONFIG_ISDN_DRV_ICN is not set -# CONFIG_ISDN_DRV_LOOP is not set -# CONFIG_ISDN_DRV_PCBIT is not set -# CONFIG_ISDN_DRV_SC is not set -# CONFIG_ISDN_I4L is not set # CONFIG_ISL29003 is not set # CONFIG_ISL29020 is not set # CONFIG_ISL29125 is not set @@ -3146,7 +2867,6 @@ CONFIG_ISDN=y # CONFIG_ITG3200 is not set # CONFIG_IWL3945 is not set # CONFIG_IWLWIFI is not set -# CONFIG_IXGB is not set # CONFIG_IXGBE is not set # CONFIG_IXGBEVF is not set # CONFIG_JAILHOUSE_GUEST is not set @@ -3179,7 +2899,6 @@ CONFIG_JOLIET=y # CONFIG_JSA1212 is not set # CONFIG_JUMP_LABEL is not set # CONFIG_JZ4740_WDT is not set -# CONFIG_JZ4770_PHY is not set # CONFIG_KALLSYMS is not set # CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set # CONFIG_KALLSYMS_ALL is not set @@ -3195,7 +2914,6 @@ CONFIG_KASAN_STACK=y CONFIG_KCOV_IRQ_AREA_SIZE=0x40000 # CONFIG_KCSAN is not set # CONFIG_KERNEL_BZIP2 is not set -# CONFIG_KERNEL_CAT is not set # CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_LZ4 is not set # CONFIG_KERNEL_LZMA is not set @@ -3251,9 +2969,7 @@ CONFIG_KERNFS=y # CONFIG_KEY_DH_OPERATIONS is not set # CONFIG_KFENCE is not set # CONFIG_KGDB is not set -# CONFIG_KMEMCHECK is not set # CONFIG_KMX61 is not set -# CONFIG_KPC2000 is not set # CONFIG_KPROBES is not set # CONFIG_KPROBES_SANITY_TEST is not set # CONFIG_KPROBE_EVENTS_ON_NOTRACE is not set @@ -3280,25 +2996,20 @@ CONFIG_KUSER_HELPERS=y # CONFIG_L2TP_V3 is not set # CONFIG_LAN743X is not set # CONFIG_LAN966X_SWITCH is not set -# CONFIG_LANMEDIA is not set # CONFIG_LANTIQ is not set # CONFIG_LAPB is not set -# CONFIG_LASAT is not set # CONFIG_LATENCYTOP is not set # CONFIG_LATTICE_ECP3_CONFIG is not set -CONFIG_LBDAF=y # CONFIG_LCD_AMS369FG06 is not set # CONFIG_LCD_CLASS_DEVICE is not set # CONFIG_LCD_HX8357 is not set # CONFIG_LCD_ILI922X is not set # CONFIG_LCD_ILI9320 is not set # CONFIG_LCD_L4F00242T03 is not set -# CONFIG_LCD_LD9040 is not set # CONFIG_LCD_LMS283GF05 is not set # CONFIG_LCD_LMS501KF03 is not set # CONFIG_LCD_LTV350QV is not set # CONFIG_LCD_OTM3225A is not set -# CONFIG_LCD_S6E63M0 is not set # CONFIG_LCD_TDO24M is not set # CONFIG_LCD_VGG2432A4 is not set CONFIG_LDISC_AUTOLOAD=y @@ -3382,7 +3093,6 @@ CONFIG_LEDS_TRIGGER_TIMER=y # CONFIG_LED_TRIGGER_PHY is not set # CONFIG_LEGACY_PTYS is not set # CONFIG_LEGACY_TIOCSTI is not set -# CONFIG_LGUEST is not set # CONFIG_LIB80211 is not set # CONFIG_LIB80211_CRYPT_CCMP is not set # CONFIG_LIB80211_CRYPT_TKIP is not set @@ -3396,13 +3106,11 @@ CONFIG_LEDS_TRIGGER_TIMER=y # CONFIG_LIBFCOE is not set # CONFIG_LIBIPW_DEBUG is not set # CONFIG_LIBNVDIMM is not set -CONFIG_LIB_MEMNEQ=y # CONFIG_LIDAR_LITE_V2 is not set CONFIG_LINEAR_RANGES=y # CONFIG_LIQUIDIO is not set # CONFIG_LIQUIDIO_VF is not set # CONFIG_LIRC is not set -# CONFIG_LIS3L02DQ is not set # CONFIG_LIST_HARDENED is not set # CONFIG_LITEX_LITEETH is not set # CONFIG_LITEX_SOC_CONTROLLER is not set @@ -3412,7 +3120,6 @@ CONFIG_LLC=y # CONFIG_LLC2 is not set # CONFIG_LMK04832 is not set # CONFIG_LMP91000 is not set -# CONFIG_LNET is not set CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set # CONFIG_LOCKD is not set @@ -3428,7 +3135,6 @@ CONFIG_LOCKD_V4=y CONFIG_LOCK_MM_AND_FIND_VMA=y # CONFIG_LOCK_STAT is not set # CONFIG_LOCK_TORTURE_TEST is not set -# CONFIG_LOGFS is not set # CONFIG_LOGIG940_FF is not set # CONFIG_LOGIRUMBLEPAD2_FF is not set # CONFIG_LOGITECH_FF is not set @@ -3456,10 +3162,8 @@ CONFIG_LSM_MMAP_MIN_ADDR=65536 # CONFIG_LTC2983 is not set # CONFIG_LTE_GDM724X is not set CONFIG_LTO_NONE=y -# CONFIG_LTPC is not set # CONFIG_LTR501 is not set # CONFIG_LTRF216A is not set -# CONFIG_LUSTRE_FS is not set # CONFIG_LV0104CS is not set # CONFIG_LWTUNNEL is not set # CONFIG_LXT_PHY is not set @@ -3486,12 +3190,8 @@ CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 # CONFIG_MACH_LOONGSON64 is not set # CONFIG_MACH_NINTENDO64 is not set # CONFIG_MACH_PIC32 is not set -# CONFIG_MACH_PISTACHIO is not set # CONFIG_MACH_REALTEK_RTL is not set -# CONFIG_MACH_TX39XX is not set # CONFIG_MACH_TX49XX is not set -# CONFIG_MACH_VR41XX is not set -# CONFIG_MACH_XILFPGA is not set # CONFIG_MACINTOSH_DRIVERS is not set # CONFIG_MACSEC is not set # CONFIG_MACVLAN is not set @@ -3505,7 +3205,6 @@ CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE="" # CONFIG_MAILBOX is not set # CONFIG_MANAGER_SBS is not set -# CONFIG_MANDATORY_FILE_LOCKING is not set # CONFIG_MANGLE_BOOTARGS is not set # CONFIG_MARVELL_10G_PHY is not set # CONFIG_MARVELL_88Q2XXX_PHY is not set @@ -3537,7 +3236,6 @@ CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE="" # CONFIG_MAXIM_THERMOCOUPLE is not set # CONFIG_MAXLINEAR_GPHY is not set CONFIG_MAX_SKB_FRAGS=17 -CONFIG_MAY_USE_DEVLINK=y # CONFIG_MB1232 is not set # CONFIG_MC3230 is not set # CONFIG_MCB is not set @@ -3568,7 +3266,6 @@ CONFIG_MAY_USE_DEVLINK=y # CONFIG_MDIO_MVUSB is not set # CONFIG_MDIO_OCTEON is not set # CONFIG_MDIO_THUNDER is not set -# CONFIG_MDIO_XPCS is not set # CONFIG_MDM_GCC_9607 is not set # CONFIG_MD_BITMAP_FILE is not set # CONFIG_MD_FAULTY is not set @@ -3585,7 +3282,6 @@ CONFIG_MAY_USE_DEVLINK=y # CONFIG_MEDIA_PLATFORM_DRIVERS is not set # CONFIG_MEDIA_PLATFORM_SUPPORT is not set # CONFIG_MEDIA_RADIO_SUPPORT is not set -# CONFIG_MEDIA_RC_SUPPORT is not set # CONFIG_MEDIA_SDR_SUPPORT is not set # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set # CONFIG_MEDIA_SUPPORT is not set @@ -3653,7 +3349,6 @@ CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 # CONFIG_MFD_ARIZONA_SPI is not set # CONFIG_MFD_AS3711 is not set # CONFIG_MFD_AS3722 is not set -# CONFIG_MFD_ASIC3 is not set # CONFIG_MFD_ATC260X_I2C is not set # CONFIG_MFD_ATMEL_FLEXCOM is not set # CONFIG_MFD_ATMEL_HLCDC is not set @@ -3663,7 +3358,6 @@ CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 # CONFIG_MFD_BD9571MWV is not set # CONFIG_MFD_CORE is not set # CONFIG_MFD_CPCAP is not set -# CONFIG_MFD_CROS_EC is not set # CONFIG_MFD_CS42L43_I2C is not set # CONFIG_MFD_CS5535 is not set # CONFIG_MFD_DA9052_I2C is not set @@ -3677,7 +3371,6 @@ CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 # CONFIG_MFD_GATEWORKS_GSC is not set # CONFIG_MFD_HI6421_PMIC is not set # CONFIG_MFD_INTEL_M10_BMC_SPI is not set -# CONFIG_MFD_INTEL_PMT is not set # CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set # CONFIG_MFD_IQS62X is not set # CONFIG_MFD_JANZ_CMODIO is not set @@ -3713,52 +3406,39 @@ CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 # CONFIG_MFD_OMAP_USB_HOST is not set # CONFIG_MFD_PALMAS is not set # CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_PM8921_CORE is not set # CONFIG_MFD_PM8XXX is not set # CONFIG_MFD_QCOM_PM8008 is not set -# CONFIG_MFD_RASPBERRYPI_POE_HAT is not set # CONFIG_MFD_RC5T583 is not set # CONFIG_MFD_RDC321X is not set # CONFIG_MFD_RETU is not set -# CONFIG_MFD_RK808 is not set # CONFIG_MFD_RK8XX_I2C is not set # CONFIG_MFD_RK8XX_SPI is not set # CONFIG_MFD_RN5T618 is not set -# CONFIG_MFD_ROHM_BD70528 is not set # CONFIG_MFD_ROHM_BD71828 is not set # CONFIG_MFD_ROHM_BD718XX is not set # CONFIG_MFD_ROHM_BD957XMUF is not set -# CONFIG_MFD_RP1 is not set -# CONFIG_MFD_RPISENSE_CORE is not set # CONFIG_MFD_RSMU_I2C is not set # CONFIG_MFD_RSMU_SPI is not set # CONFIG_MFD_RT4831 is not set # CONFIG_MFD_RT5033 is not set # CONFIG_MFD_RT5120 is not set -# CONFIG_MFD_RTSX_PCI is not set -# CONFIG_MFD_RTSX_USB is not set # CONFIG_MFD_SEC_CORE is not set # CONFIG_MFD_SI476X_CORE is not set # CONFIG_MFD_SKY81452 is not set # CONFIG_MFD_SL28CPLD is not set # CONFIG_MFD_SM501 is not set # CONFIG_MFD_SMPRO is not set -# CONFIG_MFD_SMSC is not set # CONFIG_MFD_STMFX is not set # CONFIG_MFD_STMPE is not set # CONFIG_MFD_STPMIC1 is not set # CONFIG_MFD_SY7636A is not set # CONFIG_MFD_SYSCON is not set -# CONFIG_MFD_T7L66XB is not set # CONFIG_MFD_TC3589X is not set -# CONFIG_MFD_TC6387XB is not set -# CONFIG_MFD_TC6393XB is not set # CONFIG_MFD_TIMBERDALE is not set # CONFIG_MFD_TI_AM335X_TSCADC is not set # CONFIG_MFD_TI_LMU is not set # CONFIG_MFD_TI_LP873X is not set # CONFIG_MFD_TI_LP87565 is not set -# CONFIG_MFD_TMIO is not set # CONFIG_MFD_TPS65086 is not set # CONFIG_MFD_TPS65090 is not set # CONFIG_MFD_TPS65217 is not set @@ -3771,8 +3451,6 @@ CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 # CONFIG_MFD_TPS65912_SPI is not set # CONFIG_MFD_TPS6594_I2C is not set # CONFIG_MFD_TPS6594_SPI is not set -# CONFIG_MFD_TPS68470 is not set -# CONFIG_MFD_TPS80031 is not set # CONFIG_MFD_TQMX86 is not set # CONFIG_MFD_VIPERBOARD is not set # CONFIG_MFD_VX855 is not set @@ -3783,7 +3461,6 @@ CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 # CONFIG_MFD_WM8350_I2C is not set # CONFIG_MFD_WM8400 is not set # CONFIG_MFD_WM8994 is not set -# CONFIG_MG_DISK is not set # CONFIG_MHI_BUS is not set # CONFIG_MHI_BUS_DEBUG is not set # CONFIG_MHI_BUS_EP is not set @@ -3793,7 +3470,6 @@ CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 # CONFIG_MHI_WWAN_MBIM is not set # CONFIG_MICREL_KS8995MA is not set # CONFIG_MICREL_PHY is not set -# CONFIG_MICROCHIP_KSZ is not set # CONFIG_MICROCHIP_PHY is not set # CONFIG_MICROCHIP_PIT64B is not set # CONFIG_MICROCHIP_T1S_PHY is not set @@ -3812,20 +3488,16 @@ CONFIG_MII=y # CONFIG_MIPS_CDMM is not set # CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set # CONFIG_MIPS_CMDLINE_FROM_DTB is not set -# CONFIG_MIPS_CMP is not set # CONFIG_MIPS_COBALT is not set # CONFIG_MIPS_CPS is not set # CONFIG_MIPS_ELF_APPENDED_DTB is not set -# CONFIG_MIPS_FPU_EMULATOR is not set # CONFIG_MIPS_FP_SUPPORT is not set # CONFIG_MIPS_GENERIC is not set # CONFIG_MIPS_GENERIC_KERNEL is not set # CONFIG_MIPS_MALTA is not set # CONFIG_MIPS_O32_FP64_SUPPORT is not set -# CONFIG_MIPS_PARAVIRT is not set # CONFIG_MIPS_PLATFORM_DEVICES is not set # CONFIG_MIPS_RAW_APPENDED_DTB is not set -# CONFIG_MIPS_SEAD3 is not set # CONFIG_MIPS_VA_BITS_48 is not set # CONFIG_MIPS_VPE_LOADER is not set # CONFIG_MISC_ALCOR_PCI is not set @@ -3845,7 +3517,6 @@ CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y # CONFIG_MLX4_CORE is not set # CONFIG_MLX4_EN is not set # CONFIG_MLX5_CORE is not set -# CONFIG_MLX5_EN_MACSEC is not set # CONFIG_MLX5_MACSEC is not set # CONFIG_MLX5_SF is not set # CONFIG_MLX5_VFIO_PCI is not set @@ -3853,7 +3524,6 @@ CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y # CONFIG_MLX90632 is not set # CONFIG_MLXFW is not set # CONFIG_MLXSW_CORE is not set -# CONFIG_MLX_CPLD_PLATFORM is not set # CONFIG_MLX_PLATFORM is not set # CONFIG_MMA7455_I2C is not set # CONFIG_MMA7455_SPI is not set @@ -3866,7 +3536,6 @@ CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y # CONFIG_MMC_ARMMMCI is not set # CONFIG_MMC_AU1X is not set # CONFIG_MMC_BLOCK is not set -CONFIG_MMC_BLOCK_BOUNCE=y CONFIG_MMC_BLOCK_MINORS=8 # CONFIG_MMC_CAVIUM_THUNDERX is not set # CONFIG_MMC_CB710 is not set @@ -3877,7 +3546,6 @@ CONFIG_MMC_BLOCK_MINORS=8 # CONFIG_MMC_JZ4740 is not set # CONFIG_MMC_MTK is not set # CONFIG_MMC_MVSDIO is not set -# CONFIG_MMC_S3C is not set # CONFIG_MMC_SDHCI is not set # CONFIG_MMC_SDHCI_ACPI is not set # CONFIG_MMC_SDHCI_AM654 is not set @@ -3916,7 +3584,6 @@ CONFIG_MMU_GATHER_TABLE_FREE=y CONFIG_MODPROBE_PATH="/sbin/modprobe" CONFIG_MODULES=y # CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set -# CONFIG_MODULE_COMPRESS is not set # CONFIG_MODULE_COMPRESS_GZIP is not set CONFIG_MODULE_COMPRESS_NONE=y # CONFIG_MODULE_COMPRESS_XZ is not set @@ -3992,15 +3659,12 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y # CONFIG_MTD_DATAFLASH is not set # CONFIG_MTD_DOCG3 is not set CONFIG_MTD_GEN_PROBE=y -# CONFIG_MTD_GPIO_ADDR is not set # CONFIG_MTD_HYPERBUS is not set # CONFIG_MTD_IMPA7 is not set # CONFIG_MTD_INTEL_VR_NOR is not set # CONFIG_MTD_JEDECPROBE is not set -# CONFIG_MTD_LATCH_ADDR is not set # CONFIG_MTD_LPDDR is not set # CONFIG_MTD_LPDDR2_NVM is not set -# CONFIG_MTD_M25P80 is not set CONFIG_MTD_MAP_BANK_WIDTH_1=y # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set CONFIG_MTD_MAP_BANK_WIDTH_2=y @@ -4009,18 +3673,12 @@ CONFIG_MTD_MAP_BANK_WIDTH_4=y # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set # CONFIG_MTD_MCHP23K256 is not set # CONFIG_MTD_MCHP48L640 is not set -# CONFIG_MTD_MT81xx_NOR is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_MYLOADER_PARTS is not set -# CONFIG_MTD_NAND is not set # CONFIG_MTD_NAND_AMS_DELTA is not set -# CONFIG_MTD_NAND_AR934X is not set -# CONFIG_MTD_NAND_AR934X_HW_ECC is not set # CONFIG_MTD_NAND_ARASAN is not set # CONFIG_MTD_NAND_ATMEL is not set # CONFIG_MTD_NAND_AU1550 is not set -# CONFIG_MTD_NAND_BCH is not set -# CONFIG_MTD_NAND_BF5XX is not set # CONFIG_MTD_NAND_BRCMNAND is not set # CONFIG_MTD_NAND_BRCMNAND_BCM63XX is not set # CONFIG_MTD_NAND_BRCMNAND_BCMBCA is not set @@ -4028,19 +3686,14 @@ CONFIG_MTD_MAP_BANK_WIDTH_4=y # CONFIG_MTD_NAND_BRCMNAND_IPROC is not set # CONFIG_MTD_NAND_CADENCE is not set # CONFIG_MTD_NAND_CAFE is not set -# CONFIG_MTD_NAND_CM_X270 is not set # CONFIG_MTD_NAND_CS553X is not set # CONFIG_MTD_NAND_DAVINCI is not set # CONFIG_MTD_NAND_DENALI is not set # CONFIG_MTD_NAND_DENALI_DT is not set # CONFIG_MTD_NAND_DENALI_PCI is not set -CONFIG_MTD_NAND_DENALI_SCRATCH_REG_ADDR=0xff108018 # CONFIG_MTD_NAND_DISKONCHIP is not set -# CONFIG_MTD_NAND_DOCG4 is not set # CONFIG_MTD_NAND_ECC is not set -# CONFIG_MTD_NAND_ECC_BCH is not set # CONFIG_MTD_NAND_ECC_MXIC is not set -# CONFIG_MTD_NAND_ECC_SMC is not set # CONFIG_MTD_NAND_ECC_SW_BCH is not set # CONFIG_MTD_NAND_ECC_SW_HAMMING is not set # CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC is not set @@ -4051,9 +3704,7 @@ CONFIG_MTD_NAND_DENALI_SCRATCH_REG_ADDR=0xff108018 # CONFIG_MTD_NAND_GPIO is not set # CONFIG_MTD_NAND_GPMI_NAND is not set # CONFIG_MTD_NAND_HISI504 is not set -CONFIG_MTD_NAND_IDS=y # CONFIG_MTD_NAND_INTEL_LGM is not set -# CONFIG_MTD_NAND_JZ4740 is not set # CONFIG_MTD_NAND_MPC5121_NFC is not set # CONFIG_MTD_NAND_MTK is not set # CONFIG_MTD_NAND_MTK_BMT is not set @@ -4061,22 +3712,16 @@ CONFIG_MTD_NAND_IDS=y # CONFIG_MTD_NAND_MXIC is not set # CONFIG_MTD_NAND_NANDSIM is not set # CONFIG_MTD_NAND_NDFC is not set -# CONFIG_MTD_NAND_NUC900 is not set # CONFIG_MTD_NAND_OMAP2 is not set # CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set # CONFIG_MTD_NAND_ORION is not set # CONFIG_MTD_NAND_PASEMI is not set # CONFIG_MTD_NAND_PLATFORM is not set -# CONFIG_MTD_NAND_PXA3xx is not set -# CONFIG_MTD_NAND_RB4XX is not set -# CONFIG_MTD_NAND_RB750 is not set -# CONFIG_MTD_NAND_RB91X is not set # CONFIG_MTD_NAND_RICOH is not set # CONFIG_MTD_NAND_S3C2410 is not set # CONFIG_MTD_NAND_SHARPSL is not set # CONFIG_MTD_NAND_SH_FLCTL is not set # CONFIG_MTD_NAND_SOCRATES is not set -# CONFIG_MTD_NAND_TMIO is not set # CONFIG_MTD_NAND_TXX9NDFMC is not set CONFIG_MTD_OF_PARTS=y # CONFIG_MTD_ONENAND is not set @@ -4093,8 +3738,6 @@ CONFIG_MTD_OF_PARTS=y # CONFIG_MTD_PHYSMAP_GPIO_ADDR is not set # CONFIG_MTD_PHYSMAP_IXP4XX is not set CONFIG_MTD_PHYSMAP_OF=y -# CONFIG_MTD_PHYSMAP_OF_GEMINI is not set -# CONFIG_MTD_PHYSMAP_OF_VERSATILE is not set # CONFIG_MTD_PHYSMAP_VERSATILE is not set # CONFIG_MTD_PLATRAM is not set # CONFIG_MTD_PMC551 is not set @@ -4110,7 +3753,6 @@ CONFIG_MTD_ROOTFS_ROOT_DEV=y # CONFIG_MTD_SERCOMM_PARTS is not set # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_SM_COMMON is not set -# CONFIG_MTD_SPINAND_MT29F is not set # CONFIG_MTD_SPI_NAND is not set # CONFIG_MTD_SPI_NOR is not set # CONFIG_MTD_SPI_NOR_SWP_DISABLE is not set @@ -4146,10 +3788,8 @@ CONFIG_MTD_SPLIT_SUPPORT=y # CONFIG_MTD_UBI_FASTMAP is not set # CONFIG_MTD_UBI_GLUEBI is not set # CONFIG_MTD_UBI_NVMEM is not set -# CONFIG_MTD_UIMAGE_SPLIT is not set # CONFIG_MTD_VIRT_CONCAT is not set # CONFIG_MTK_DEVAPC is not set -# CONFIG_MTK_MMC is not set # CONFIG_MTK_MMSYS is not set # CONFIG_MTK_T7XX is not set # CONFIG_MTK_THERMAL is not set @@ -4163,7 +3803,6 @@ CONFIG_MULTIUSER=y # CONFIG_MV643XX_ETH is not set # CONFIG_MVMDIO is not set # CONFIG_MVNETA_BM is not set -# CONFIG_MVSW61XX_PHY is not set # CONFIG_MV_XOR_V2 is not set # CONFIG_MWAVE is not set # CONFIG_MWL8K is not set @@ -4176,10 +3815,8 @@ CONFIG_MULTIUSER=y # CONFIG_NAU7802 is not set # CONFIG_NBPFAXI_DMA is not set # CONFIG_NCN26000_PHY is not set -# CONFIG_NCP_FS is not set # CONFIG_NE2000 is not set # CONFIG_NE2K_PCI is not set -# CONFIG_NEC_MARKEINS is not set CONFIG_NET=y # CONFIG_NETCONSOLE is not set # CONFIG_NETCONSOLE_EXTENDED_LOG is not set @@ -4187,7 +3824,6 @@ CONFIG_NETDEVICES=y # CONFIG_NETDEVSIM is not set # CONFIG_NETFILTER is not set # CONFIG_NETFILTER_ADVANCED is not set -# CONFIG_NETFILTER_DEBUG is not set # CONFIG_NETFILTER_EGRESS is not set # CONFIG_NETFILTER_INGRESS is not set # CONFIG_NETFILTER_NETLINK is not set @@ -4273,7 +3909,6 @@ CONFIG_NETDEVICES=y # CONFIG_NETFS_STATS is not set # CONFIG_NETLABEL is not set # CONFIG_NETLINK_DIAG is not set -# CONFIG_NETLINK_MMAP is not set # CONFIG_NETPOLL is not set # CONFIG_NETROM is not set CONFIG_NETWORK_FILESYSTEMS=y @@ -4299,7 +3934,6 @@ CONFIG_NETWORK_FILESYSTEMS=y # CONFIG_NET_ACT_SKBMOD is not set # CONFIG_NET_ACT_TUNNEL_KEY is not set # CONFIG_NET_ACT_VLAN is not set -CONFIG_NET_CADENCE=y # CONFIG_NET_CALXEDA_XGMAC is not set CONFIG_NET_CLS=y # CONFIG_NET_CLS_ACT is not set @@ -4308,11 +3942,8 @@ CONFIG_NET_CLS=y # CONFIG_NET_CLS_FLOW is not set # CONFIG_NET_CLS_FLOWER is not set # CONFIG_NET_CLS_FW is not set -CONFIG_NET_CLS_IND=y # CONFIG_NET_CLS_MATCHALL is not set # CONFIG_NET_CLS_ROUTE4 is not set -# CONFIG_NET_CLS_RSVP is not set -# CONFIG_NET_CLS_RSVP6 is not set # CONFIG_NET_CLS_U32 is not set CONFIG_NET_CORE=y # CONFIG_NET_DEVLINK is not set @@ -4322,22 +3953,14 @@ CONFIG_NET_CORE=y # CONFIG_NET_DSA_AR9331 is not set # CONFIG_NET_DSA_BCM_SF2 is not set # CONFIG_NET_DSA_LANTIQ_GSWIP is not set -# CONFIG_NET_DSA_LEGACY is not set # CONFIG_NET_DSA_LOOP is not set -# CONFIG_NET_DSA_MICROCHIP_KSZ8795 is not set -# CONFIG_NET_DSA_MICROCHIP_KSZ9477 is not set # CONFIG_NET_DSA_MICROCHIP_KSZ_COMMON is not set # CONFIG_NET_DSA_MSCC_FELIX is not set # CONFIG_NET_DSA_MSCC_OCELOT_EXT is not set # CONFIG_NET_DSA_MSCC_SEVILLE is not set # CONFIG_NET_DSA_MT7530 is not set # CONFIG_NET_DSA_MV88E6060 is not set -# CONFIG_NET_DSA_MV88E6123_61_65 is not set -# CONFIG_NET_DSA_MV88E6131 is not set -# CONFIG_NET_DSA_MV88E6171 is not set -# CONFIG_NET_DSA_MV88E6352 is not set # CONFIG_NET_DSA_MV88E6XXX is not set -# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set # CONFIG_NET_DSA_MV88E6XXX_PTP is not set # CONFIG_NET_DSA_QCA8K is not set # CONFIG_NET_DSA_QCA8K_LEDS_SUPPORT is not set @@ -4346,7 +3969,6 @@ CONFIG_NET_CORE=y # CONFIG_NET_DSA_SJA1105 is not set # CONFIG_NET_DSA_SMSC_LAN9303_I2C is not set # CONFIG_NET_DSA_SMSC_LAN9303_MDIO is not set -# CONFIG_NET_DSA_TAG_8021Q is not set # CONFIG_NET_DSA_TAG_AR9331 is not set # CONFIG_NET_DSA_TAG_BRCM is not set # CONFIG_NET_DSA_TAG_BRCM_LEGACY is not set @@ -4401,7 +4023,6 @@ CONFIG_NET_IPGRE_BROADCAST=y # CONFIG_NET_NCSI is not set # CONFIG_NET_NSH is not set # CONFIG_NET_NS_REFCNT_TRACKER is not set -# CONFIG_NET_PACKET_ENGINE is not set # CONFIG_NET_PKTGEN is not set # CONFIG_NET_POLL_CONTROLLER is not set # CONFIG_NET_PTP_CLASSIFY is not set @@ -4439,11 +4060,9 @@ CONFIG_NET_SCH_FQ_CODEL=y # CONFIG_NET_SCH_TAPRIO is not set # CONFIG_NET_SCH_TBF is not set # CONFIG_NET_SCH_TEQL is not set -# CONFIG_NET_SCTPPROBE is not set # CONFIG_NET_SELFTESTS is not set CONFIG_NET_SOCK_MSG=y # CONFIG_NET_SWITCHDEV is not set -# CONFIG_NET_TCPPROBE is not set # CONFIG_NET_TC_SKB_EXT is not set # CONFIG_NET_TEAM is not set # CONFIG_NET_TULIP is not set @@ -4461,7 +4080,6 @@ CONFIG_NET_VENDOR_AQUANTIA=y CONFIG_NET_VENDOR_ARC=y # CONFIG_NET_VENDOR_ASIX is not set CONFIG_NET_VENDOR_ATHEROS=y -CONFIG_NET_VENDOR_AURORA=y CONFIG_NET_VENDOR_BROADCOM=y CONFIG_NET_VENDOR_BROCADE=y CONFIG_NET_VENDOR_CADENCE=y @@ -4475,7 +4093,6 @@ CONFIG_NET_VENDOR_DEC=y CONFIG_NET_VENDOR_DLINK=y CONFIG_NET_VENDOR_EMULEX=y # CONFIG_NET_VENDOR_ENGLEDER is not set -CONFIG_NET_VENDOR_EXAR=y CONFIG_NET_VENDOR_EZCHIP=y CONFIG_NET_VENDOR_FARADAY=y CONFIG_NET_VENDOR_FREESCALE=y @@ -4483,7 +4100,6 @@ CONFIG_NET_VENDOR_FUJITSU=y # CONFIG_NET_VENDOR_FUNGIBLE is not set CONFIG_NET_VENDOR_GOOGLE=y CONFIG_NET_VENDOR_HISILICON=y -CONFIG_NET_VENDOR_HP=y CONFIG_NET_VENDOR_HUAWEI=y CONFIG_NET_VENDOR_I825XX=y CONFIG_NET_VENDOR_IBM=y @@ -4537,7 +4153,6 @@ CONFIG_NEW_LEDS=y # CONFIG_NFSD is not set # CONFIG_NFSD_V2 is not set # CONFIG_NFSD_V2_ACL is not set -CONFIG_NFSD_V3=y # CONFIG_NFSD_V3_ACL is not set # CONFIG_NFSD_V4 is not set # CONFIG_NFS_ACL_SUPPORT is not set @@ -4561,11 +4176,8 @@ CONFIG_NFS_V3=y # CONFIG_NFT_FIB_IPV6 is not set # CONFIG_NFT_FIB_NETDEV is not set # CONFIG_NFT_FLOW_OFFLOAD is not set -# CONFIG_NFT_OBJREF is not set # CONFIG_NFT_OSF is not set # CONFIG_NFT_REJECT_NETDEV is not set -# CONFIG_NFT_RT is not set -# CONFIG_NFT_SET_BITMAP is not set # CONFIG_NFT_SOCKET is not set # CONFIG_NFT_SYNPROXY is not set # CONFIG_NFT_TPROXY is not set @@ -4583,7 +4195,6 @@ CONFIG_NFS_V3=y # CONFIG_NF_CONNTRACK_NETBIOS_NS is not set # CONFIG_NF_CONNTRACK_PPTP is not set CONFIG_NF_CONNTRACK_PROCFS=y -# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set # CONFIG_NF_CONNTRACK_SANE is not set # CONFIG_NF_CONNTRACK_SECMARK is not set # CONFIG_NF_CONNTRACK_SIP is not set @@ -4605,18 +4216,14 @@ CONFIG_NF_CONNTRACK_PROCFS=y # CONFIG_NF_FLOW_TABLE is not set # CONFIG_NF_FLOW_TABLE_PROCFS is not set # CONFIG_NF_LOG_ARP is not set -# CONFIG_NF_LOG_BRIDGE is not set # CONFIG_NF_LOG_IPV4 is not set -# CONFIG_NF_LOG_NETDEV is not set # CONFIG_NF_LOG_SYSLOG is not set # CONFIG_NF_NAT is not set # CONFIG_NF_NAT_AMANDA is not set # CONFIG_NF_NAT_FTP is not set # CONFIG_NF_NAT_H323 is not set # CONFIG_NF_NAT_IRC is not set -# CONFIG_NF_NAT_NEEDED is not set # CONFIG_NF_NAT_PPTP is not set -# CONFIG_NF_NAT_PROTO_GRE is not set # CONFIG_NF_NAT_SIP is not set # CONFIG_NF_NAT_SNMP_BASIC is not set # CONFIG_NF_NAT_TFTP is not set @@ -4631,11 +4238,9 @@ CONFIG_NF_TABLES_INET=y CONFIG_NF_TABLES_IPV4=y CONFIG_NF_TABLES_IPV6=y CONFIG_NF_TABLES_NETDEV=y -# CONFIG_NF_TABLES_SET is not set # CONFIG_NF_TPROXY_IPV4 is not set # CONFIG_NF_TPROXY_IPV6 is not set # CONFIG_NGBE is not set -# CONFIG_NI65 is not set # CONFIG_NI903X_WDT is not set # CONFIG_NIC7018_WDT is not set # CONFIG_NILFS2_FS is not set @@ -4643,8 +4248,6 @@ CONFIG_NF_TABLES_NETDEV=y # CONFIG_NI_XGE_MANAGEMENT_ENET is not set CONFIG_NLATTR=y # CONFIG_NLMON is not set -# CONFIG_NLM_XLP_BOARD is not set -# CONFIG_NLM_XLR_BOARD is not set # CONFIG_NLS is not set # CONFIG_NLS_ASCII is not set # CONFIG_NLS_CODEPAGE_1250 is not set @@ -4697,14 +4300,11 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_MAC_TURKISH is not set # CONFIG_NLS_UCS2_UTILS is not set # CONFIG_NLS_UTF8 is not set -CONFIG_NMI_LOG_BUF_SHIFT=13 # CONFIG_NOA1305 is not set # CONFIG_NOP_USB_XCEIV is not set # CONFIG_NORTEL_HERMES is not set # CONFIG_NOTIFIER_ERROR_INJECTION is not set -# CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT is not set # CONFIG_NOZOMI is not set -# CONFIG_NO_BOOTMEM is not set # CONFIG_NO_HZ is not set # CONFIG_NO_HZ_FULL is not set # CONFIG_NO_HZ_IDLE is not set @@ -4721,7 +4321,6 @@ CONFIG_NMI_LOG_BUF_SHIFT=13 # CONFIG_NULL_TTY is not set # CONFIG_NUMA is not set # CONFIG_NVIDIA_CARMEL_CNP_ERRATUM is not set -# CONFIG_NVM is not set # CONFIG_NVMEM is not set # CONFIG_NVMEM_BCM_OCOTP is not set # CONFIG_NVMEM_BLOCK is not set @@ -4741,8 +4340,6 @@ CONFIG_NMI_LOG_BUF_SHIFT=13 # CONFIG_NV_TCO is not set # CONFIG_NXP_C45_TJA11XX_PHY is not set # CONFIG_NXP_CBTX_PHY is not set -# CONFIG_NXP_STB220 is not set -# CONFIG_NXP_STB225 is not set # CONFIG_NXP_TJA11XX_PHY is not set # CONFIG_N_GSM is not set # CONFIG_OABI_COMPAT is not set @@ -4763,11 +4360,8 @@ CONFIG_OF_RESERVED_MEM=y # CONFIG_OMFS_FS is not set # CONFIG_OPENVSWITCH is not set # CONFIG_OPEN_DICE is not set -# CONFIG_OPROFILE is not set -# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set # CONFIG_OPT3001 is not set # CONFIG_OPT4001 is not set -CONFIG_OPTIMIZE_INLINING=y # CONFIG_ORANGEFS_FS is not set # CONFIG_ORION_WATCHDOG is not set # CONFIG_OSF_PARTITION is not set @@ -4779,7 +4373,6 @@ CONFIG_OVERLAY_FS=y CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y # CONFIG_OVERLAY_FS_REDIRECT_DIR is not set CONFIG_OVERLAY_FS_XINO_AUTO=y -# CONFIG_OWL_LOADER is not set # CONFIG_P54_COMMON is not set # CONFIG_PA12203001 is not set CONFIG_PACKET=y @@ -4808,7 +4401,6 @@ CONFIG_PANIC_TIMEOUT=1 # CONFIG_PARAVIRT_TIME_ACCOUNTING is not set # CONFIG_PARPORT is not set # CONFIG_PARPORT_1284 is not set -# CONFIG_PARPORT_AX88796 is not set # CONFIG_PARPORT_GSC is not set # CONFIG_PARPORT_PC is not set CONFIG_PARTITION_ADVANCED=y @@ -4887,7 +4479,6 @@ CONFIG_PCIE_BUS_DEFAULT=y # CONFIG_PCIE_BUS_PERFORMANCE is not set # CONFIG_PCIE_BUS_SAFE is not set # CONFIG_PCIE_BUS_TUNE_OFF is not set -# CONFIG_PCIE_BW is not set # CONFIG_PCIE_CADENCE_HOST is not set # CONFIG_PCIE_CADENCE_PLAT_HOST is not set # CONFIG_PCIE_DPC is not set @@ -4958,7 +4549,6 @@ CONFIG_PCI_SYSCALL=y # CONFIG_PCS_MTK_USXGMII is not set # CONFIG_PCS_XPCS is not set # CONFIG_PD6729 is not set -# CONFIG_PDA_POWER is not set # CONFIG_PDC_ADMA is not set # CONFIG_PDS_CORE is not set # CONFIG_PECI is not set @@ -4974,7 +4564,6 @@ CONFIG_PCI_SYSCALL=y # CONFIG_PHYLIB_LEDS is not set # CONFIG_PHYS_ADDR_T_64BIT is not set # CONFIG_PHY_BRCM_USB is not set -# CONFIG_PHY_CADENCE_DP is not set # CONFIG_PHY_CADENCE_DPHY is not set # CONFIG_PHY_CADENCE_DPHY_RX is not set # CONFIG_PHY_CADENCE_SALVO is not set @@ -4998,7 +4587,6 @@ CONFIG_PCI_SYSCALL=y # CONFIG_PHY_PISTACHIO_USB is not set # CONFIG_PHY_PXA_28NM_HSIC is not set # CONFIG_PHY_PXA_28NM_USB2 is not set -# CONFIG_PHY_QCOM_DWC3 is not set # CONFIG_PHY_QCOM_USB_HS is not set # CONFIG_PHY_QCOM_USB_HSIC is not set # CONFIG_PHY_SAMSUNG_USB2 is not set @@ -5011,11 +4599,9 @@ CONFIG_PINCONF=y # CONFIG_PINCTRL is not set # CONFIG_PINCTRL_AMD is not set # CONFIG_PINCTRL_AXP209 is not set -# CONFIG_PINCTRL_BCM2712 is not set # CONFIG_PINCTRL_CEDARFORK is not set # CONFIG_PINCTRL_CY8C95X0 is not set # CONFIG_PINCTRL_EXYNOS is not set -# CONFIG_PINCTRL_EXYNOS5440 is not set # CONFIG_PINCTRL_ICELAKE is not set # CONFIG_PINCTRL_INGENIC is not set # CONFIG_PINCTRL_LPASS_LPI is not set @@ -5032,7 +4618,6 @@ CONFIG_PINCONF=y # CONFIG_PINCTRL_MTK_V2 is not set # CONFIG_PINCTRL_OCELOT is not set # CONFIG_PINCTRL_PISTACHIO is not set -# CONFIG_PINCTRL_RP1 is not set # CONFIG_PINCTRL_SC7280 is not set # CONFIG_PINCTRL_SC8180X is not set # CONFIG_PINCTRL_SDX55 is not set @@ -5058,7 +4643,6 @@ CONFIG_PINMUX=y # CONFIG_PLX_HERMES is not set # CONFIG_PM is not set # CONFIG_PMBUS is not set -# CONFIG_PMC_MSP is not set # CONFIG_PMIC_ADP5520 is not set # CONFIG_PMIC_DA903X is not set # CONFIG_PMS7003 is not set @@ -5070,7 +4654,6 @@ CONFIG_PINMUX=y # CONFIG_POSIX_MQUEUE is not set CONFIG_POSIX_TIMERS=y # CONFIG_POWERCAP is not set -# CONFIG_POWER_AVS is not set # CONFIG_POWER_RESET is not set # CONFIG_POWER_RESET_BRCMKONA is not set # CONFIG_POWER_RESET_BRCMSTB is not set @@ -5122,7 +4705,6 @@ CONFIG_PPP_MULTILINK=y # CONFIG_PPTP is not set # CONFIG_PREEMPT is not set # CONFIG_PREEMPTIRQ_DELAY_TEST is not set -# CONFIG_PREEMPTIRQ_EVENTS is not set # CONFIG_PREEMPT_DYNAMIC is not set CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_TRACER is not set @@ -5133,12 +4715,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_PRINTK=y # CONFIG_PRINTK_CALLER is not set # CONFIG_PRINTK_INDEX is not set -CONFIG_PRINTK_NMI=y -CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 # CONFIG_PRINTK_TIME is not set CONFIG_PRINT_STACK_DEPTH=64 # CONFIG_PRISM2_USB is not set -# CONFIG_PRISM54 is not set # CONFIG_PROC_CHILDREN is not set CONFIG_PROC_FS=y # CONFIG_PROC_KCORE is not set @@ -5153,26 +4732,18 @@ CONFIG_PROC_SYSCTL=y # CONFIG_PROVE_RAW_LOCK_NESTING is not set # CONFIG_PROVE_RCU is not set # CONFIG_PROVE_RCU_LIST is not set -# CONFIG_PROVE_RCU_REPEATEDLY is not set # CONFIG_PSAMPLE is not set # CONFIG_PSB6970_PHY is not set # CONFIG_PSE_CONTROLLER is not set # CONFIG_PSI is not set # CONFIG_PSTORE is not set -# CONFIG_PSTORE_842_COMPRESS is not set # CONFIG_PSTORE_BLK is not set # CONFIG_PSTORE_COMPRESS is not set # CONFIG_PSTORE_CONSOLE is not set CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240 -# CONFIG_PSTORE_DEFLATE_COMPRESS is not set -# CONFIG_PSTORE_DEFLATE_COMPRESS_DEFAULT is not set # CONFIG_PSTORE_FTRACE is not set -# CONFIG_PSTORE_LZ4HC_COMPRESS is not set -# CONFIG_PSTORE_LZ4_COMPRESS is not set -# CONFIG_PSTORE_LZO_COMPRESS is not set # CONFIG_PSTORE_PMSG is not set # CONFIG_PSTORE_RAM is not set -# CONFIG_PSTORE_ZSTD_COMPRESS is not set # CONFIG_PTDUMP_DEBUGFS is not set # CONFIG_PTP_1588_CLOCK is not set # CONFIG_PTP_1588_CLOCK_IDT82P33 is not set @@ -5183,7 +4754,6 @@ CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240 # CONFIG_PTP_1588_CLOCK_OCP is not set # CONFIG_PTP_1588_CLOCK_PCH is not set # CONFIG_PTP_1588_CLOCK_VMW is not set -# CONFIG_PUBLIC_KEY_ALGO_RSA is not set # CONFIG_PVPANIC is not set # CONFIG_PWM is not set # CONFIG_PWM_ATMEL_TCB is not set @@ -5196,7 +4766,6 @@ CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240 # CONFIG_PWM_MEDIATEK is not set # CONFIG_PWM_PCA9685 is not set # CONFIG_PWM_RASPBERRYPI_POE is not set -# CONFIG_PWM_RP1 is not set # CONFIG_PWM_XILINX is not set CONFIG_PWRSEQ_EMMC=y # CONFIG_PWRSEQ_SD8787 is not set @@ -5237,18 +4806,15 @@ CONFIG_PWRSEQ_SIMPLE=y # CONFIG_QRTR_MHI is not set # CONFIG_QRTR_TUN is not set # CONFIG_QSEMI_PHY is not set -# CONFIG_QUEUED_LOCK_STAT is not set # CONFIG_QUICC_ENGINE is not set # CONFIG_QUOTA is not set # CONFIG_QUOTACTL is not set # CONFIG_QUOTA_DEBUG is not set # CONFIG_QUOTA_NETLINK_INTERFACE is not set -# CONFIG_R3964 is not set # CONFIG_R6040 is not set # CONFIG_R8169 is not set -# CONFIG_R8188EU is not set +# CONFIG_R8169_LEDS is not set # CONFIG_R8712U is not set -# CONFIG_R8723AU is not set # CONFIG_RADIO_ADAPTERS is not set # CONFIG_RADIO_AZTECH is not set # CONFIG_RADIO_CADET is not set @@ -5270,29 +4836,22 @@ CONFIG_PWRSEQ_SIMPLE=y CONFIG_RANDOMIZE_KSTACK_OFFSET=y # CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is not set # CONFIG_RANDOM_KMALLOC_CACHES is not set -CONFIG_RANDOM_TRUST_BOOTLOADER=y -CONFIG_RANDOM_TRUST_CPU=y # CONFIG_RANDSTRUCT_NONE is not set # CONFIG_RAPIDIO is not set # CONFIG_RAS is not set -# CONFIG_RASPBERRYPI_GPIOMEM is not set # CONFIG_RBTREE_TEST is not set # CONFIG_RCU_BOOST is not set # CONFIG_RCU_CPU_STALL_CPUTIME is not set CONFIG_RCU_CPU_STALL_TIMEOUT=60 # CONFIG_RCU_EQS_DEBUG is not set -# CONFIG_RCU_EXPEDITE_BOOT is not set # CONFIG_RCU_EXPERT is not set CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0 -CONFIG_RCU_KTHREAD_PRIO=0 CONFIG_RCU_NEED_SEGCBLIST=y -# CONFIG_RCU_PERF_TEST is not set # CONFIG_RCU_REF_SCALE_TEST is not set # CONFIG_RCU_SCALE_TEST is not set CONFIG_RCU_STALL_COMMON=y # CONFIG_RCU_STRICT_GRACE_PERIOD is not set # CONFIG_RCU_TORTURE_TEST is not set -CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3 # CONFIG_RCU_TRACE is not set # CONFIG_RC_ATI_REMOTE is not set # CONFIG_RC_CORE is not set @@ -5371,7 +4930,6 @@ CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3 # CONFIG_REGULATOR_QCOM_REFGEN is not set # CONFIG_REGULATOR_RAA215300 is not set # CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY is not set -# CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2 is not set # CONFIG_REGULATOR_RT4801 is not set # CONFIG_REGULATOR_RT4803 is not set # CONFIG_REGULATOR_RT5190A is not set @@ -5423,7 +4981,6 @@ CONFIG_REISERFS_FS_XATTR=y # CONFIG_RESET_PISTACHIO is not set # CONFIG_RESET_SIMPLE is not set # CONFIG_RESET_SOCFPGA is not set -# CONFIG_RESET_STM32 is not set # CONFIG_RESET_SUNXI is not set # CONFIG_RESET_TEGRA_BPMP is not set # CONFIG_RESET_TI_SYSCON is not set @@ -5436,7 +4993,6 @@ CONFIG_RFKILL=y # CONFIG_RFKILL_GPIO is not set # CONFIG_RFKILL_INPUT is not set # CONFIG_RFKILL_LEDS is not set -# CONFIG_RFKILL_REGULATOR is not set # CONFIG_RICHTEK_RTQ6056 is not set # CONFIG_RING_BUFFER_BENCHMARK is not set # CONFIG_RING_BUFFER_STARTUP_TEST is not set @@ -5479,7 +5035,6 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_DS1305 is not set # CONFIG_RTC_DRV_DS1307 is not set # CONFIG_RTC_DRV_DS1307_CENTURY is not set -# CONFIG_RTC_DRV_DS1307_HWMON is not set # CONFIG_RTC_DRV_DS1343 is not set # CONFIG_RTC_DRV_DS1347 is not set # CONFIG_RTC_DRV_DS1374 is not set @@ -5491,7 +5046,6 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_DS1742 is not set # CONFIG_RTC_DRV_DS2404 is not set # CONFIG_RTC_DRV_DS3232 is not set -# CONFIG_RTC_DRV_DS3234 is not set # CONFIG_RTC_DRV_EM3027 is not set # CONFIG_RTC_DRV_EP93XX is not set # CONFIG_RTC_DRV_FM3130 is not set @@ -5502,7 +5056,6 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_HYM8563 is not set # CONFIG_RTC_DRV_ISL12022 is not set # CONFIG_RTC_DRV_ISL12026 is not set -# CONFIG_RTC_DRV_ISL12057 is not set # CONFIG_RTC_DRV_ISL1208 is not set # CONFIG_RTC_DRV_JZ4740 is not set # CONFIG_RTC_DRV_M41T80 is not set @@ -5532,13 +5085,11 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_PL030 is not set # CONFIG_RTC_DRV_PL031 is not set # CONFIG_RTC_DRV_PS3 is not set -# CONFIG_RTC_DRV_PT7C4338 is not set # CONFIG_RTC_DRV_R7301 is not set # CONFIG_RTC_DRV_R9701 is not set # CONFIG_RTC_DRV_RP5C01 is not set # CONFIG_RTC_DRV_RS5C348 is not set # CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_RTC7301 is not set # CONFIG_RTC_DRV_RV3028 is not set # CONFIG_RTC_DRV_RV3029C2 is not set # CONFIG_RTC_DRV_RV3032 is not set @@ -5555,7 +5106,6 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_SUN6I is not set # CONFIG_RTC_DRV_TEGRA is not set # CONFIG_RTC_DRV_TEST is not set -# CONFIG_RTC_DRV_V3020 is not set # CONFIG_RTC_DRV_X1205 is not set # CONFIG_RTC_DRV_XGENE is not set # CONFIG_RTC_DRV_ZYNQMP is not set @@ -5584,10 +5134,8 @@ CONFIG_RTC_SYSTOHC_DEVICE="rtc0" # CONFIG_RTL_CARDS is not set # CONFIG_RTS5208 is not set CONFIG_RT_MUTEXES=y -# CONFIG_RUNTIME_DEBUG is not set CONFIG_RUNTIME_TESTING_MENU=y # CONFIG_RV is not set -CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_RXKAD=y # CONFIG_RXPERF is not set # CONFIG_S2IO is not set @@ -5637,11 +5185,9 @@ CONFIG_SCHED_OMIT_FRAME_POINTER=y # CONFIG_SCHED_SMT is not set CONFIG_SCHED_STACK_END_CHECK=y # CONFIG_SCHED_TRACER is not set -# CONFIG_SCR24X is not set # CONFIG_SCSI is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_3W_SAS is not set -# CONFIG_SCSI_7000FASST is not set # CONFIG_SCSI_AACRAID is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_ADVANSYS is not set @@ -5665,20 +5211,13 @@ CONFIG_SCHED_STACK_END_CHECK=y # CONFIG_SCSI_DH is not set CONFIG_SCSI_DMA=y # CONFIG_SCSI_DMX3191D is not set -# CONFIG_SCSI_DPT_I2O is not set -# CONFIG_SCSI_DTC3280 is not set -# CONFIG_SCSI_EATA is not set # CONFIG_SCSI_ESAS2R is not set # CONFIG_SCSI_FC_ATTRS is not set # CONFIG_SCSI_FDOMAIN_PCI is not set -# CONFIG_SCSI_FUTURE_DOMAIN is not set -# CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set -# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set # CONFIG_SCSI_HISI_SAS is not set # CONFIG_SCSI_HPSA is not set # CONFIG_SCSI_HPTIOP is not set -# CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_IPR is not set @@ -5693,17 +5232,13 @@ CONFIG_SCSI_MOD=y # CONFIG_SCSI_MPI3MR is not set # CONFIG_SCSI_MPT2SAS is not set # CONFIG_SCSI_MPT3SAS is not set -# CONFIG_SCSI_MQ_DEFAULT is not set # CONFIG_SCSI_MVSAS is not set # CONFIG_SCSI_MVSAS_DEBUG is not set # CONFIG_SCSI_MVUMI is not set # CONFIG_SCSI_MYRB is not set # CONFIG_SCSI_MYRS is not set -# CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NETLINK is not set # CONFIG_SCSI_NSP32 is not set -# CONFIG_SCSI_OSD_INITIATOR is not set -# CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PM8001 is not set # CONFIG_SCSI_PMCRAID is not set CONFIG_SCSI_PROC_FS=y @@ -5719,12 +5254,8 @@ CONFIG_SCSI_PROC_FS=y # CONFIG_SCSI_SPI_ATTRS is not set # CONFIG_SCSI_SRP_ATTRS is not set # CONFIG_SCSI_STEX is not set -# CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_T128 is not set -# CONFIG_SCSI_U14_34F is not set # CONFIG_SCSI_UFSHCD is not set -# CONFIG_SCSI_ULTRASTOR is not set # CONFIG_SCSI_VIRTIO is not set # CONFIG_SCSI_WD719X is not set # CONFIG_SC_CAMCC_7180 is not set @@ -5758,10 +5289,8 @@ CONFIG_SECURITY_DMESG_RESTRICT=y # CONFIG_SECURITY_SAFESETID is not set # CONFIG_SECURITY_SELINUX_AVC_STATS is not set # CONFIG_SECURITY_SELINUX_BOOTPARAM is not set -CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=0 # CONFIG_SECURITY_SELINUX_DEBUG is not set # CONFIG_SECURITY_SELINUX_DEVELOP is not set -# CONFIG_SECURITY_SELINUX_DISABLE is not set # CONFIG_SECURITY_SMACK is not set # CONFIG_SECURITY_TOMOYO is not set # CONFIG_SECURITY_YAMA is not set @@ -5787,7 +5316,6 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_ADM1266 is not set # CONFIG_SENSORS_ADM1275 is not set # CONFIG_SENSORS_ADM9240 is not set -# CONFIG_SENSORS_ADS1015 is not set # CONFIG_SENSORS_ADS7828 is not set # CONFIG_SENSORS_ADS7871 is not set # CONFIG_SENSORS_ADT7310 is not set @@ -5810,7 +5338,6 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_AXI_FAN_CONTROL is not set # CONFIG_SENSORS_BEL_PFE is not set # CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_BH1780 is not set # CONFIG_SENSORS_BPA_RS600 is not set # CONFIG_SENSORS_CORETEMP is not set # CONFIG_SENSORS_CORSAIR_CPRO is not set @@ -5845,7 +5372,6 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_HMC5843_I2C is not set # CONFIG_SENSORS_HMC5843_SPI is not set # CONFIG_SENSORS_HS3001 is not set -# CONFIG_SENSORS_HTU21 is not set # CONFIG_SENSORS_I5500 is not set # CONFIG_SENSORS_I5K_AMB is not set # CONFIG_SENSORS_IBM_CFFPS is not set @@ -5957,7 +5483,6 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_Q54SJ108A2 is not set # CONFIG_SENSORS_RM3100_I2C is not set # CONFIG_SENSORS_RM3100_SPI is not set -# CONFIG_SENSORS_RP1_ADC is not set # CONFIG_SENSORS_SBRMI is not set # CONFIG_SENSORS_SBTSI is not set # CONFIG_SENSORS_SCH5627 is not set @@ -5969,7 +5494,6 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_SHT4x is not set # CONFIG_SENSORS_SHTC1 is not set # CONFIG_SENSORS_SIS5595 is not set -# CONFIG_SENSORS_SMM665 is not set # CONFIG_SENSORS_SMSC47B397 is not set # CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_SMSC47M192 is not set @@ -6035,7 +5559,6 @@ CONFIG_SERIAL_8250_DMA=y # CONFIG_SERIAL_8250_LPSS is not set # CONFIG_SERIAL_8250_MANY_PORTS is not set # CONFIG_SERIAL_8250_MID is not set -# CONFIG_SERIAL_8250_MOXA is not set CONFIG_SERIAL_8250_NR_UARTS=2 # CONFIG_SERIAL_8250_PCI is not set # CONFIG_SERIAL_8250_PCI1XXXX is not set @@ -6058,13 +5581,11 @@ CONFIG_SERIAL_EARLYCON=y # CONFIG_SERIAL_FSL_LINFLEXUART is not set # CONFIG_SERIAL_FSL_LPUART is not set # CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set -# CONFIG_SERIAL_IFX6X60 is not set # CONFIG_SERIAL_JSM is not set # CONFIG_SERIAL_MAX3100 is not set # CONFIG_SERIAL_MAX310X is not set # CONFIG_SERIAL_NONSTANDARD is not set # CONFIG_SERIAL_OF_PLATFORM is not set -# CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL is not set # CONFIG_SERIAL_PCH_UART is not set # CONFIG_SERIAL_RP2 is not set # CONFIG_SERIAL_SC16IS7XX is not set @@ -6095,11 +5616,9 @@ CONFIG_SERIAL_EARLYCON=y # CONFIG_SFC is not set # CONFIG_SFC_FALCON is not set # CONFIG_SFC_SIENA is not set -# CONFIG_SFI is not set # CONFIG_SFP is not set # CONFIG_SF_PDMA is not set # CONFIG_SGETMASK_SYSCALL is not set -# CONFIG_SGI_IOC4 is not set # CONFIG_SGI_IP22 is not set # CONFIG_SGI_IP27 is not set # CONFIG_SGI_IP28 is not set @@ -6122,8 +5641,6 @@ CONFIG_SHMEM=y # CONFIG_SI7005 is not set # CONFIG_SI7020 is not set # CONFIG_SIBYTE_BIGSUR is not set -# CONFIG_SIBYTE_CARMEL is not set -# CONFIG_SIBYTE_CRHINE is not set # CONFIG_SIBYTE_CRHONE is not set # CONFIG_SIBYTE_LITTLESUR is not set # CONFIG_SIBYTE_RHONE is not set @@ -6131,15 +5648,12 @@ CONFIG_SHMEM=y # CONFIG_SIBYTE_SWARM is not set CONFIG_SIGNALFD=y # CONFIG_SIGNED_PE_FILE_VERIFICATION is not set -# CONFIG_SIMPLE_GPIO is not set -# CONFIG_SIMPLE_PM_BUS is not set # CONFIG_SIOX is not set # CONFIG_SIS190 is not set # CONFIG_SIS900 is not set # CONFIG_SKGE is not set # CONFIG_SKY2 is not set # CONFIG_SKY2_DEBUG is not set -CONFIG_SLABINFO=y # CONFIG_SLAB_DEPRECATED is not set CONFIG_SLAB_FREELIST_HARDENED=y CONFIG_SLAB_FREELIST_RANDOM=y @@ -6148,17 +5662,14 @@ CONFIG_SLAB_MERGE_DEFAULT=y # CONFIG_SLICOSS is not set # CONFIG_SLIMBUS is not set # CONFIG_SLIP is not set -# CONFIG_SLOB is not set CONFIG_SLUB=y CONFIG_SLUB_CPU_PARTIAL=y # CONFIG_SLUB_DEBUG is not set # CONFIG_SLUB_DEBUG_ON is not set -# CONFIG_SLUB_MEMCG_SYSFS_ON is not set # CONFIG_SLUB_STATS is not set # CONFIG_SLUB_TINY is not set # CONFIG_SMARTJOYPLUS_FF is not set # CONFIG_SMB_SERVER is not set -# CONFIG_SMC911X is not set # CONFIG_SMC9194 is not set # CONFIG_SMC91X is not set # CONFIG_SMP is not set @@ -6197,7 +5708,6 @@ CONFIG_SLUB_CPU_PARTIAL=y # CONFIG_SND_AU8830 is not set # CONFIG_SND_AUDIO_GRAPH_CARD is not set # CONFIG_SND_AUDIO_GRAPH_CARD2 is not set -# CONFIG_SND_AUDIO_GRAPH_SCU_CARD is not set # CONFIG_SND_AW2 is not set # CONFIG_SND_AZT2320 is not set # CONFIG_SND_AZT3328 is not set @@ -6225,7 +5735,6 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_DUMMY is not set # CONFIG_SND_DYNAMIC_MINORS is not set # CONFIG_SND_ECHO3G is not set -# CONFIG_SND_EDMA_SOC is not set # CONFIG_SND_EMU10K1 is not set # CONFIG_SND_EMU10K1X is not set # CONFIG_SND_EMU10K1_SEQ is not set @@ -6244,7 +5753,6 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_GUSMAX is not set # CONFIG_SND_HDA_CODEC_CS8409 is not set # CONFIG_SND_HDA_INTEL is not set -# CONFIG_SND_HDA_INTEL_DETECT_DMIC is not set # CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM is not set CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 CONFIG_SND_HDA_PREALLOC_SIZE=64 @@ -6309,12 +5817,10 @@ CONFIG_SND_PCM_OSS_PLUGINS=y # CONFIG_SND_PPC is not set CONFIG_SND_PROC_FS=y # CONFIG_SND_RAWMIDI is not set -# CONFIG_SND_RAWMIDI_SEQ is not set # CONFIG_SND_RIPTIDE is not set # CONFIG_SND_RME32 is not set # CONFIG_SND_RME96 is not set # CONFIG_SND_RME9652 is not set -# CONFIG_SND_RTCTIMER is not set # CONFIG_SND_SB16 is not set # CONFIG_SND_SB8 is not set # CONFIG_SND_SBAWE is not set @@ -6325,7 +5831,6 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SERIAL_GENERIC is not set # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_SIMPLE_CARD is not set -# CONFIG_SND_SIMPLE_SCU_CARD is not set # CONFIG_SND_SIS7019 is not set # CONFIG_SND_SOC is not set # CONFIG_SND_SOC_AC97_CODEC is not set @@ -6394,7 +5899,6 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_CS53L30 is not set # CONFIG_SND_SOC_CX2072X is not set # CONFIG_SND_SOC_DA7213 is not set -# CONFIG_SND_SOC_DIO2125 is not set # CONFIG_SND_SOC_DMIC is not set # CONFIG_SND_SOC_ES7134 is not set # CONFIG_SND_SOC_ES7241 is not set @@ -6427,10 +5931,8 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_IMX_HDMI is not set # CONFIG_SND_SOC_IMX_RPMSG is not set # CONFIG_SND_SOC_IMX_SPDIF is not set -# CONFIG_SND_SOC_IMX_WM8962 is not set # CONFIG_SND_SOC_INNO_RK3036 is not set # CONFIG_SND_SOC_INTEL_APL is not set -# CONFIG_SND_SOC_INTEL_BAYTRAIL is not set # CONFIG_SND_SOC_INTEL_BDW_RT5677_MACH is not set # CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH is not set # CONFIG_SND_SOC_INTEL_BXT_RT298_MACH is not set @@ -6439,8 +5941,6 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH is not set # CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH is not set # CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH is not set -# CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH is not set -# CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH is not set # CONFIG_SND_SOC_INTEL_CATPT is not set # CONFIG_SND_SOC_INTEL_CFL is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH is not set @@ -6473,7 +5973,6 @@ CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y # CONFIG_SND_SOC_LPASS_TX_MACRO is not set # CONFIG_SND_SOC_LPASS_VA_MACRO is not set # CONFIG_SND_SOC_LPASS_WSA_MACRO is not set -# CONFIG_SND_SOC_MA120X0P is not set # CONFIG_SND_SOC_MAX9759 is not set # CONFIG_SND_SOC_MAX98088 is not set # CONFIG_SND_SOC_MAX98090 is not set @@ -6515,7 +6014,6 @@ CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y # CONFIG_SND_SOC_NAU8824 is not set # CONFIG_SND_SOC_PCM1681 is not set # CONFIG_SND_SOC_PCM1789_I2C is not set -# CONFIG_SND_SOC_PCM1792A is not set # CONFIG_SND_SOC_PCM179X_I2C is not set # CONFIG_SND_SOC_PCM179X_SPI is not set # CONFIG_SND_SOC_PCM186X_I2C is not set @@ -6541,7 +6039,6 @@ CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y # CONFIG_SND_SOC_SGTL5000 is not set # CONFIG_SND_SOC_SIMPLE_AMPLIFIER is not set # CONFIG_SND_SOC_SIMPLE_MUX is not set -# CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set # CONFIG_SND_SOC_SMA1303 is not set # CONFIG_SND_SOC_SOF_TOPLEVEL is not set # CONFIG_SND_SOC_SPDIF is not set @@ -6616,7 +6113,6 @@ CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y # CONFIG_SND_SOC_XILINX_SPDIF is not set # CONFIG_SND_SOC_XTFPGA_I2S is not set # CONFIG_SND_SOC_ZL38060 is not set -# CONFIG_SND_SOC_ZX_AUD96P22 is not set # CONFIG_SND_SONICVIBES is not set # CONFIG_SND_SPI is not set # CONFIG_SND_SSCAPE is not set @@ -6658,7 +6154,6 @@ CONFIG_SND_X86=y # CONFIG_SOC_AM33XX is not set # CONFIG_SOC_AM43XX is not set # CONFIG_SOC_BRCMSTB is not set -# CONFIG_SOC_CAMERA is not set # CONFIG_SOC_DRA7XX is not set # CONFIG_SOC_HAS_OMAP2_SDRC is not set # CONFIG_SOC_OMAP5 is not set @@ -6672,13 +6167,11 @@ CONFIG_SND_X86=y # CONFIG_SOUNDWIRE is not set # CONFIG_SOUND_OSS_CORE is not set # CONFIG_SOUND_OSS_CORE_PRECLAIM is not set -# CONFIG_SOUND_PRIME is not set # CONFIG_SP5100_TCO is not set # CONFIG_SPARSEMEM_MANUAL is not set # CONFIG_SPARSEMEM_STATIC is not set # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set # CONFIG_SPARSE_IRQ is not set -# CONFIG_SPARSE_RCU_POINTER is not set # CONFIG_SPEAKUP is not set # CONFIG_SPI is not set # CONFIG_SPINLOCK_TEST is not set @@ -6702,7 +6195,6 @@ CONFIG_SND_X86=y # CONFIG_SPI_FSL_ESPI is not set # CONFIG_SPI_FSL_SPI is not set # CONFIG_SPI_GPIO is not set -# CONFIG_SPI_GPIO_OLD is not set # CONFIG_SPI_IMG_SPFI is not set # CONFIG_SPI_LANTIQ_SSC is not set # CONFIG_SPI_LM70_LLP is not set @@ -6713,7 +6205,6 @@ CONFIG_SND_X86=y # CONFIG_SPI_MICROCHIP_CORE_QSPI is not set # CONFIG_SPI_MPC52xx is not set # CONFIG_SPI_MPC52xx_PSC is not set -# CONFIG_SPI_MTK_QUADSPI is not set # CONFIG_SPI_MUX is not set # CONFIG_SPI_MXIC is not set # CONFIG_SPI_NXP_FLEXSPI is not set @@ -6739,7 +6230,6 @@ CONFIG_SND_X86=y # CONFIG_SPI_TOPCLIFF_PCH is not set # CONFIG_SPI_XCOMM is not set # CONFIG_SPI_XILINX is not set -# CONFIG_SPI_XWAY is not set # CONFIG_SPI_ZYNQMP_GQSPI is not set CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_SPMI is not set @@ -6766,13 +6256,11 @@ CONFIG_SQUASHFS_XZ=y # CONFIG_SRF04 is not set # CONFIG_SRF08 is not set # CONFIG_SSB is not set -# CONFIG_SSB_DEBUG is not set # CONFIG_SSB_DRIVER_GPIO is not set # CONFIG_SSB_HOST_SOC is not set # CONFIG_SSB_PCMCIAHOST is not set CONFIG_SSB_POSSIBLE=y # CONFIG_SSB_SDIOHOST is not set -# CONFIG_SSB_SILENT is not set # CONFIG_SSFDC is not set # CONFIG_SSIF_IPMI_BMC is not set # CONFIG_STACKPROTECTOR is not set @@ -6781,19 +6269,15 @@ CONFIG_SSB_POSSIBLE=y # CONFIG_STACKTRACE is not set # CONFIG_STACKTRACE_BUILD_ID is not set CONFIG_STACKTRACE_SUPPORT=y -CONFIG_STACK_HASH_ORDER=20 # CONFIG_STACK_TRACER is not set # CONFIG_STACK_VALIDATION is not set CONFIG_STAGING=y # CONFIG_STAGING_BOARD is not set -# CONFIG_STAGING_GASKET_FRAMEWORK is not set # CONFIG_STAGING_MEDIA is not set CONFIG_STANDALONE=y # CONFIG_STATIC_KEYS_SELFTEST is not set # CONFIG_STATIC_USERMODEHELPER is not set -CONFIG_STDBINUTILS=y # CONFIG_STE10XP is not set -# CONFIG_STE_MODEM_RPROC is not set # CONFIG_STK3310 is not set # CONFIG_STK8312 is not set # CONFIG_STK8BA50 is not set @@ -6821,18 +6305,15 @@ CONFIG_STRIP_ASM_SYMS=y # CONFIG_SUNGEM is not set # CONFIG_SUNRPC is not set # CONFIG_SUNRPC_DEBUG is not set -CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES=y # CONFIG_SUNRPC_GSS is not set # CONFIG_SUNXI_SRAM is not set # CONFIG_SUN_PARTITION is not set -# CONFIG_SURFACE_3_BUTTON is not set # CONFIG_SURFACE_PLATFORMS is not set # CONFIG_SUSPEND is not set # CONFIG_SUSPEND_SKIP_SYNC is not set CONFIG_SWAP=y # CONFIG_SWCONFIG is not set # CONFIG_SWCONFIG_B53 is not set -# CONFIG_SWCONFIG_B53_MDIO_DRIVER is not set # CONFIG_SWCONFIG_B53_MMAP_DRIVER is not set # CONFIG_SWCONFIG_B53_SPI_DRIVER is not set # CONFIG_SWCONFIG_B53_SRAB_DRIVER is not set @@ -6846,18 +6327,13 @@ CONFIG_SWAP=y # CONFIG_SX9500 is not set # CONFIG_SXGBE_ETH is not set CONFIG_SYMBOLIC_ERRNAME=y -# CONFIG_SYNCLINK_CS is not set # CONFIG_SYNC_FILE is not set -# CONFIG_SYNOPSYS_DWC_ETH_QOS is not set # CONFIG_SYNTH_EVENTS is not set # CONFIG_SYNTH_EVENT_GEN_TEST is not set CONFIG_SYN_COOKIES=y # CONFIG_SYSCON_REBOOT_MODE is not set CONFIG_SYSCTL=y -# CONFIG_SYSCTL_SYSCALL is not set CONFIG_SYSFS=y -# CONFIG_SYSFS_DEPRECATED is not set -# CONFIG_SYSFS_DEPRECATED_V2 is not set # CONFIG_SYSFS_SYSCALL is not set # CONFIG_SYSTEMPORT is not set # CONFIG_SYSTEM_BLACKLIST_KEYRING is not set @@ -6880,7 +6356,6 @@ CONFIG_SYSVIPC_SYSCTL=y # CONFIG_TCG_FTPM_TEE is not set # CONFIG_TCG_INFINEON is not set # CONFIG_TCG_NSC is not set -# CONFIG_TCG_ST33_I2C is not set # CONFIG_TCG_TIS is not set # CONFIG_TCG_TIS_I2C is not set # CONFIG_TCG_TIS_I2C_ATMEL is not set @@ -6920,7 +6395,6 @@ CONFIG_TCP_CONG_CUBIC=y # CONFIG_TEHUTI is not set # CONFIG_TERANETICS_PHY is not set # CONFIG_TEST_ASYNC_DRIVER_PROBE is not set -# CONFIG_TEST_BITFIELD is not set # CONFIG_TEST_BITMAP is not set # CONFIG_TEST_BITOPS is not set # CONFIG_TEST_BLACKHOLE_DEV is not set @@ -6932,10 +6406,8 @@ CONFIG_TCP_CONG_CUBIC=y # CONFIG_TEST_DYNAMIC_DEBUG is not set # CONFIG_TEST_FIRMWARE is not set # CONFIG_TEST_FREE_PAGES is not set -# CONFIG_TEST_HASH is not set # CONFIG_TEST_HEXDUMP is not set # CONFIG_TEST_IDA is not set -# CONFIG_TEST_KASAN_MODULE is not set # CONFIG_TEST_KMOD is not set # CONFIG_TEST_KSTRTOX is not set # CONFIG_TEST_LIST_SORT is not set @@ -6945,18 +6417,14 @@ CONFIG_TCP_CONG_CUBIC=y # CONFIG_TEST_MEMCAT_P is not set # CONFIG_TEST_MEMINIT is not set # CONFIG_TEST_MIN_HEAP is not set -# CONFIG_TEST_OVERFLOW is not set # CONFIG_TEST_POWER is not set # CONFIG_TEST_PRINTF is not set # CONFIG_TEST_REF_TRACKER is not set # CONFIG_TEST_RHASHTABLE is not set # CONFIG_TEST_SCANF is not set -# CONFIG_TEST_SIPHASH is not set # CONFIG_TEST_SORT is not set -# CONFIG_TEST_STACKINIT is not set # CONFIG_TEST_STATIC_KEYS is not set # CONFIG_TEST_STRING_HELPERS is not set -# CONFIG_TEST_STRSCPY is not set # CONFIG_TEST_SYSCTL is not set # CONFIG_TEST_UBSAN is not set # CONFIG_TEST_UDELAY is not set @@ -6984,10 +6452,8 @@ CONFIG_TEXTSEARCH=y # CONFIG_THERMAL_STATISTICS is not set # CONFIG_THERMAL_WRITABLE_TRIPS is not set # CONFIG_THINKPAD_ACPI is not set -CONFIG_THIN_ARCHIVES=y # CONFIG_THRUSTMASTER_FF is not set # CONFIG_THUMB2_KERNEL is not set -# CONFIG_THUNDERBOLT is not set # CONFIG_THUNDER_NIC_BGX is not set # CONFIG_THUNDER_NIC_PF is not set # CONFIG_THUNDER_NIC_RGX is not set @@ -6999,7 +6465,6 @@ CONFIG_TICK_ONESHOT=y # CONFIG_TIMB_DMA is not set CONFIG_TIMERFD=y # CONFIG_TIMERLAT_TRACER is not set -# CONFIG_TIMER_STATS is not set # CONFIG_TIME_NS is not set # CONFIG_TINYDRM_HX8357D is not set # CONFIG_TINYDRM_ILI9163 is not set @@ -7029,19 +6494,15 @@ CONFIG_TINY_RCU=y # CONFIG_TI_ADS8688 is not set # CONFIG_TI_AM335X_ADC is not set # CONFIG_TI_CPSW is not set -# CONFIG_TI_CPSW_ALE is not set # CONFIG_TI_CPSW_PHY_SEL is not set # CONFIG_TI_CPTS is not set # CONFIG_TI_DAC082S085 is not set # CONFIG_TI_DAC5571 is not set # CONFIG_TI_DAC7311 is not set -# CONFIG_TI_DAC7512 is not set # CONFIG_TI_DAC7612 is not set -# CONFIG_TI_DAVINCI_CPDMA is not set # CONFIG_TI_DAVINCI_MDIO is not set # CONFIG_TI_LMP92064 is not set # CONFIG_TI_ST is not set -# CONFIG_TI_SYSCON_RESET is not set # CONFIG_TI_TLC4541 is not set # CONFIG_TI_TMAG5273 is not set # CONFIG_TI_TSC2046 is not set @@ -7133,12 +6594,9 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_PCAP is not set # CONFIG_TOUCHSCREEN_PENMOUNT is not set # CONFIG_TOUCHSCREEN_PIXCIR is not set -# CONFIG_TOUCHSCREEN_PROPERTIES is not set # CONFIG_TOUCHSCREEN_RASPBERRYPI_FW is not set # CONFIG_TOUCHSCREEN_RM_TS is not set # CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set -# CONFIG_TOUCHSCREEN_RPI_FT5406 is not set -# CONFIG_TOUCHSCREEN_S3C2410 is not set # CONFIG_TOUCHSCREEN_S6SY761 is not set # CONFIG_TOUCHSCREEN_SILEAD is not set # CONFIG_TOUCHSCREEN_SIS_I2C is not set @@ -7161,7 +6619,6 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_TSC2007_IIO is not set # CONFIG_TOUCHSCREEN_TSC200X_CORE is not set # CONFIG_TOUCHSCREEN_TSC_SERIO is not set -# CONFIG_TOUCHSCREEN_UCB1400 is not set # CONFIG_TOUCHSCREEN_USB_3M is not set # CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set # CONFIG_TOUCHSCREEN_USB_DMC_TSC10 is not set @@ -7181,7 +6638,6 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_USB_NEXIO is not set # CONFIG_TOUCHSCREEN_USB_PANJIT is not set # CONFIG_TOUCHSCREEN_USB_ZYTRONIC is not set -# CONFIG_TOUCHSCREEN_W90X900 is not set # CONFIG_TOUCHSCREEN_WACOM_I2C is not set # CONFIG_TOUCHSCREEN_WACOM_W8001 is not set # CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set @@ -7191,7 +6647,6 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_WM9713 is not set # CONFIG_TOUCHSCREEN_WM97XX is not set # CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE is not set -# CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE is not set # CONFIG_TOUCHSCREEN_ZET6223 is not set # CONFIG_TOUCHSCREEN_ZFORCE is not set # CONFIG_TOUCHSCREEN_ZINITIX is not set @@ -7207,13 +6662,10 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TRACE_EVENT_INJECT is not set CONFIG_TRACE_IRQFLAGS_SUPPORT=y # CONFIG_TRACE_MMIO_ACCESS is not set -# CONFIG_TRACE_SINK is not set -# CONFIG_TRACING_EVENTS_GPIO is not set CONFIG_TRACING_SUPPORT=y CONFIG_TRAD_SIGNALS=y # CONFIG_TRANSPARENT_HUGEPAGE is not set # CONFIG_TREE_RCU is not set -# CONFIG_TREE_RCU_TRACE is not set # CONFIG_TRIM_UNUSED_KSYMS is not set # CONFIG_TRUSTED_FOUNDATIONS is not set # CONFIG_TRUSTED_KEYS is not set @@ -7223,7 +6675,6 @@ CONFIG_TRAD_SIGNALS=y # CONFIG_TSL2583 is not set # CONFIG_TSL2591 is not set # CONFIG_TSL2772 is not set -# CONFIG_TSL2x7x is not set # CONFIG_TSL4531 is not set # CONFIG_TSNEP is not set # CONFIG_TSYS01 is not set @@ -7248,7 +6699,6 @@ CONFIG_TTY=y # CONFIG_UBIFS_ATIME_SUPPORT is not set # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set # CONFIG_UBIFS_FS_AUTHENTICATION is not set -# CONFIG_UBIFS_FS_ENCRYPTION is not set CONFIG_UBIFS_FS_LZO=y # CONFIG_UBIFS_FS_SECURITY is not set CONFIG_UBIFS_FS_XATTR=y @@ -7259,11 +6709,8 @@ CONFIG_UBSAN_ALIGNMENT=y CONFIG_UBSAN_BOOL=y # CONFIG_UBSAN_DIV_ZERO is not set CONFIG_UBSAN_ENUM=y -# CONFIG_UBSAN_MISC is not set CONFIG_UBSAN_SHIFT=y # CONFIG_UBSAN_UNREACHABLE is not set -# CONFIG_UCB1400_CORE is not set -# CONFIG_UCSI is not set # CONFIG_UDF_FS is not set # CONFIG_UDMABUF is not set CONFIG_UEVENT_HELPER=y @@ -7276,15 +6723,11 @@ CONFIG_UID16=y # CONFIG_ULTRA is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_UNICODE is not set -# CONFIG_UNISYSSPAR is not set -# CONFIG_UNISYS_VISORBUS is not set CONFIG_UNIX=y CONFIG_UNIX98_PTYS=y # CONFIG_UNIXWARE_DISKLABEL is not set # CONFIG_UNIX_DIAG is not set CONFIG_UNIX_SCM=y -# CONFIG_UNUSED_BOARD_FILES is not set -# CONFIG_UNUSED_SYMBOLS is not set # CONFIG_UNWINDER_FRAME_POINTER is not set # CONFIG_UPROBES is not set # CONFIG_UPROBE_EVENTS is not set @@ -7350,13 +6793,11 @@ CONFIG_USB_DEFAULT_PERSIST=y # CONFIG_USB_DWC3_ULPI is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_EG20T is not set -# CONFIG_USB_EHCI_ATH79 is not set # CONFIG_USB_EHCI_FSL is not set # CONFIG_USB_EHCI_HCD is not set # CONFIG_USB_EHCI_HCD_AT91 is not set # CONFIG_USB_EHCI_HCD_OMAP is not set # CONFIG_USB_EHCI_HCD_PPC_OF is not set -# CONFIG_USB_EHCI_MSM is not set # CONFIG_USB_EHCI_MV is not set CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_EHCI_TT_NEWSCHED=y @@ -7370,7 +6811,6 @@ CONFIG_USB_EHCI_TT_NEWSCHED=y # CONFIG_USB_FOTG210_HCD is not set # CONFIG_USB_FOTG210_UDC is not set # CONFIG_USB_FSL_USB2 is not set -# CONFIG_USB_FTDI_ELAN is not set # CONFIG_USB_FUNCTIONFS is not set # CONFIG_USB_FUSB300 is not set # CONFIG_USB_GADGET is not set @@ -7449,9 +6889,7 @@ CONFIG_USB_GADGET_VBUS_DRAW=2 # CONFIG_USB_HSIC_USB4604 is not set # CONFIG_USB_HSO is not set # CONFIG_USB_HUB_USB251XB is not set -# CONFIG_USB_HWA_HCD is not set # CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_IMX21_HCD is not set # CONFIG_USB_IOWARRIOR is not set # CONFIG_USB_IPHETH is not set # CONFIG_USB_ISIGHTFW is not set @@ -7466,7 +6904,6 @@ CONFIG_USB_GADGET_VBUS_DRAW=2 # CONFIG_USB_LAN78XX is not set # CONFIG_USB_LCD is not set # CONFIG_USB_LD is not set -# CONFIG_USB_LED is not set # CONFIG_USB_LEDS_TRIGGER_USBPORT is not set # CONFIG_USB_LED_TRIG is not set # CONFIG_USB_LEGOTOWER is not set @@ -7483,7 +6920,6 @@ CONFIG_USB_GADGET_VBUS_DRAW=2 # CONFIG_USB_MON is not set # CONFIG_USB_MOUSE is not set # CONFIG_USB_MSI2500 is not set -# CONFIG_USB_MSM_OTG is not set # CONFIG_USB_MTU3 is not set # CONFIG_USB_MUSB_GADGET is not set # CONFIG_USB_MUSB_HDRC is not set @@ -7529,11 +6965,9 @@ CONFIG_USB_GADGET_VBUS_DRAW=2 CONFIG_USB_OHCI_LITTLE_ENDIAN=y # CONFIG_USB_ONBOARD_HUB is not set # CONFIG_USB_OTG is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set # CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set # CONFIG_USB_OTG_FSM is not set # CONFIG_USB_OTG_PRODUCTLIST is not set -# CONFIG_USB_OTG_WHITELIST is not set # CONFIG_USB_OXU210HP_HCD is not set # CONFIG_USB_PCI is not set # CONFIG_USB_PEGASUS is not set @@ -7545,9 +6979,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y # CONFIG_USB_R8A66597 is not set # CONFIG_USB_R8A66597_HCD is not set # CONFIG_USB_RAW_GADGET is not set -# CONFIG_USB_RCAR_PHY is not set # CONFIG_USB_RENESAS_USBHS is not set -# CONFIG_USB_RIO500 is not set # CONFIG_USB_ROLES_INTEL_XHCI is not set # CONFIG_USB_ROLE_SWITCH is not set # CONFIG_USB_RTL8150 is not set @@ -7577,19 +7009,7 @@ CONFIG_USB_SERIAL_GENERIC=y # CONFIG_USB_SERIAL_IR is not set # CONFIG_USB_SERIAL_IUU is not set # CONFIG_USB_SERIAL_KEYSPAN is not set -CONFIG_USB_SERIAL_KEYSPAN_MPR=y # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -CONFIG_USB_SERIAL_KEYSPAN_USA18X=y -CONFIG_USB_SERIAL_KEYSPAN_USA19=y -CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y -CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y -CONFIG_USB_SERIAL_KEYSPAN_USA19W=y -CONFIG_USB_SERIAL_KEYSPAN_USA28=y -CONFIG_USB_SERIAL_KEYSPAN_USA28X=y -CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y -CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y -CONFIG_USB_SERIAL_KEYSPAN_USA49W=y -CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y # CONFIG_USB_SERIAL_KLSI is not set # CONFIG_USB_SERIAL_KOBIL_SCT is not set # CONFIG_USB_SERIAL_MCT_U232 is not set @@ -7619,7 +7039,6 @@ CONFIG_USB_SERIAL_SAFE_PADDED=y # CONFIG_USB_SERIAL_VISOR is not set # CONFIG_USB_SERIAL_WHITEHEAT is not set # CONFIG_USB_SERIAL_WISHBONE is not set -# CONFIG_USB_SERIAL_XIRCOM is not set # CONFIG_USB_SERIAL_XR is not set # CONFIG_USB_SERIAL_XSENS_MT is not set # CONFIG_USB_SEVSEG is not set @@ -7628,7 +7047,6 @@ CONFIG_USB_SERIAL_SAFE_PADDED=y # CONFIG_USB_SL811_HCD is not set # CONFIG_USB_SNP_UDC_PLAT is not set # CONFIG_USB_SPEEDTOUCH is not set -# CONFIG_USB_STKWEBCAM is not set # CONFIG_USB_STORAGE is not set # CONFIG_USB_STORAGE_ALAUDA is not set # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set @@ -7646,7 +7064,6 @@ CONFIG_USB_SERIAL_SAFE_PADDED=y # CONFIG_USB_STORAGE_USBAT is not set # CONFIG_USB_STV06XX is not set # CONFIG_USB_SUPPORT is not set -# CONFIG_USB_SWITCH_FSA9480 is not set # CONFIG_USB_TEST is not set # CONFIG_USB_TMC is not set # CONFIG_USB_TRANCEVIBRATOR is not set @@ -7660,9 +7077,6 @@ CONFIG_USB_SERIAL_SAFE_PADDED=y CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y # CONFIG_USB_VL600 is not set # CONFIG_USB_WDM is not set -# CONFIG_USB_WHCI_HCD is not set -# CONFIG_USB_WUSB is not set -# CONFIG_USB_WUSB_CBAF is not set # CONFIG_USB_XEN_HCD is not set # CONFIG_USB_XHCI_DBGCAP is not set # CONFIG_USB_XHCI_HCD is not set @@ -7672,7 +7086,6 @@ CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y # CONFIG_USB_YUREX is not set # CONFIG_USB_ZD1201 is not set # CONFIG_USB_ZERO is not set -# CONFIG_USB_ZR364XX is not set # CONFIG_USELIB is not set # CONFIG_USERFAULTFD is not set # CONFIG_USERIO is not set @@ -7680,7 +7093,6 @@ CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y # CONFIG_USER_EVENTS is not set # CONFIG_USE_OF is not set # CONFIG_UTS_NS is not set -# CONFIG_UWB is not set # CONFIG_U_SERIAL_CONSOLE is not set # CONFIG_V4L_MEM2MEM_DRIVERS is not set # CONFIG_V4L_PLATFORM_DRIVERS is not set @@ -7714,9 +7126,7 @@ CONFIG_VHOST_MENU=y # CONFIG_VHOST_VSOCK is not set # CONFIG_VIA_RHINE is not set # CONFIG_VIA_VELOCITY is not set -# CONFIG_VIDEO_AD5398 is not set # CONFIG_VIDEO_AD5820 is not set -# CONFIG_VIDEO_AD9389B is not set # CONFIG_VIDEO_ADP1653 is not set # CONFIG_VIDEO_ADV7170 is not set # CONFIG_VIDEO_ADV7175 is not set @@ -7733,20 +7143,15 @@ CONFIG_VHOST_MENU=y # CONFIG_VIDEO_AK881X is not set # CONFIG_VIDEO_AM437X_VPFE is not set # CONFIG_VIDEO_AR0521 is not set -# CONFIG_VIDEO_ARDUCAM_64MP is not set -# CONFIG_VIDEO_ARDUCAM_PIVARIETY is not set # CONFIG_VIDEO_ASPEED is not set # CONFIG_VIDEO_ATMEL_ISC is not set # CONFIG_VIDEO_ATMEL_ISI is not set # CONFIG_VIDEO_AU0828 is not set # CONFIG_VIDEO_BCM2835 is not set -# CONFIG_VIDEO_BCM2835_UNICAM is not set # CONFIG_VIDEO_BT819 is not set # CONFIG_VIDEO_BT848 is not set # CONFIG_VIDEO_BT856 is not set # CONFIG_VIDEO_BT866 is not set -# CONFIG_VIDEO_BU64754 is not set -# CONFIG_VIDEO_CADENCE is not set # CONFIG_VIDEO_CADENCE_CSI2RX is not set # CONFIG_VIDEO_CADENCE_CSI2TX is not set # CONFIG_VIDEO_CAFE_CCIC is not set @@ -7754,7 +7159,6 @@ CONFIG_VHOST_MENU=y # CONFIG_VIDEO_CCS is not set # CONFIG_VIDEO_COBALT is not set # CONFIG_VIDEO_CODA is not set -# CONFIG_VIDEO_CODEC_BCM2835 is not set # CONFIG_VIDEO_CS3308 is not set # CONFIG_VIDEO_CS5345 is not set # CONFIG_VIDEO_CS53L32A is not set @@ -7764,7 +7168,6 @@ CONFIG_VHOST_MENU=y # CONFIG_VIDEO_CX25840 is not set # CONFIG_VIDEO_CX88 is not set # CONFIG_VIDEO_DEV is not set -# CONFIG_VIDEO_DM6446_CCDC is not set # CONFIG_VIDEO_DS90UB913 is not set # CONFIG_VIDEO_DS90UB953 is not set # CONFIG_VIDEO_DS90UB960 is not set @@ -7797,45 +7200,38 @@ CONFIG_VHOST_MENU=y # CONFIG_VIDEO_IMX335 is not set # CONFIG_VIDEO_IMX355 is not set # CONFIG_VIDEO_IMX412 is not set -# CONFIG_VIDEO_IMX477 is not set -# CONFIG_VIDEO_IMX519 is not set -# CONFIG_VIDEO_IMX708 is not set +# CONFIG_VIDEO_IMX7_CSI is not set +# CONFIG_VIDEO_IMX8MQ_MIPI_CSI2 is not set +# CONFIG_VIDEO_IMX8_ISI is not set # CONFIG_VIDEO_IMX8_JPEG is not set # CONFIG_VIDEO_IMX_MIPI_CSIS is not set # CONFIG_VIDEO_IMX_PXP is not set -# CONFIG_VIDEO_IRS1125 is not set # CONFIG_VIDEO_IR_I2C is not set # CONFIG_VIDEO_ISL7998X is not set -# CONFIG_VIDEO_ISP_BCM2835 is not set # CONFIG_VIDEO_IVTV is not set # CONFIG_VIDEO_KS0127 is not set # CONFIG_VIDEO_LM3560 is not set # CONFIG_VIDEO_LM3646 is not set # CONFIG_VIDEO_M52790 is not set -# CONFIG_VIDEO_M5MOLS is not set # CONFIG_VIDEO_MAX9286 is not set # CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set # CONFIG_VIDEO_ML86V7667 is not set # CONFIG_VIDEO_MSP3400 is not set # CONFIG_VIDEO_MT9M001 is not set -# CONFIG_VIDEO_MT9M032 is not set # CONFIG_VIDEO_MT9M111 is not set # CONFIG_VIDEO_MT9P031 is not set -# CONFIG_VIDEO_MT9T001 is not set # CONFIG_VIDEO_MT9T112 is not set # CONFIG_VIDEO_MT9V011 is not set # CONFIG_VIDEO_MT9V032 is not set # CONFIG_VIDEO_MT9V111 is not set # CONFIG_VIDEO_MUX is not set # CONFIG_VIDEO_MXB is not set -# CONFIG_VIDEO_NOON010PC30 is not set # CONFIG_VIDEO_OG01A1B is not set # CONFIG_VIDEO_OMAP2_VOUT is not set # CONFIG_VIDEO_OV02A10 is not set # CONFIG_VIDEO_OV08D10 is not set # CONFIG_VIDEO_OV13858 is not set # CONFIG_VIDEO_OV13B10 is not set -# CONFIG_VIDEO_OV2311 is not set # CONFIG_VIDEO_OV2640 is not set # CONFIG_VIDEO_OV2659 is not set # CONFIG_VIDEO_OV2680 is not set @@ -7849,7 +7245,6 @@ CONFIG_VHOST_MENU=y # CONFIG_VIDEO_OV5675 is not set # CONFIG_VIDEO_OV5693 is not set # CONFIG_VIDEO_OV5695 is not set -# CONFIG_VIDEO_OV64A40 is not set # CONFIG_VIDEO_OV6650 is not set # CONFIG_VIDEO_OV7251 is not set # CONFIG_VIDEO_OV7640 is not set @@ -7858,13 +7253,11 @@ CONFIG_VHOST_MENU=y # CONFIG_VIDEO_OV7740 is not set # CONFIG_VIDEO_OV8856 is not set # CONFIG_VIDEO_OV8865 is not set -# CONFIG_VIDEO_OV9281 is not set # CONFIG_VIDEO_OV9282 is not set # CONFIG_VIDEO_OV9640 is not set # CONFIG_VIDEO_OV9650 is not set # CONFIG_VIDEO_OV9734 is not set # CONFIG_VIDEO_PVRUSB2 is not set -# CONFIG_VIDEO_RASPBERRYPI_PISP_BE is not set # CONFIG_VIDEO_RCAR_CSI2 is not set # CONFIG_VIDEO_RCAR_ISP is not set # CONFIG_VIDEO_RCAR_VIN is not set @@ -7872,12 +7265,9 @@ CONFIG_VHOST_MENU=y # CONFIG_VIDEO_RDACM21 is not set # CONFIG_VIDEO_RJ54N1 is not set # CONFIG_VIDEO_ROCKCHIP_ISP1 is not set -# CONFIG_VIDEO_RP1_CFE is not set # CONFIG_VIDEO_S5C73M3 is not set -# CONFIG_VIDEO_S5K4ECGX is not set # CONFIG_VIDEO_S5K5BAF is not set # CONFIG_VIDEO_S5K6A3 is not set -# CONFIG_VIDEO_S5K6AA is not set # CONFIG_VIDEO_SAA6588 is not set # CONFIG_VIDEO_SAA6752HS is not set # CONFIG_VIDEO_SAA7110 is not set @@ -7887,13 +7277,9 @@ CONFIG_VHOST_MENU=y # CONFIG_VIDEO_SAA7164 is not set # CONFIG_VIDEO_SAA717X is not set # CONFIG_VIDEO_SAA7185 is not set -# CONFIG_VIDEO_SH_MOBILE_CEU is not set -# CONFIG_VIDEO_SMIAPP is not set # CONFIG_VIDEO_SOLO6X10 is not set # CONFIG_VIDEO_SONY_BTF_MPX is not set -# CONFIG_VIDEO_SR030PC30 is not set # CONFIG_VIDEO_STK1160 is not set -# CONFIG_VIDEO_STK1160_COMMON is not set # CONFIG_VIDEO_ST_MIPID02 is not set # CONFIG_VIDEO_SUN4I_CSI is not set # CONFIG_VIDEO_SUN6I_CSI is not set @@ -7907,9 +7293,7 @@ CONFIG_VHOST_MENU=y # CONFIG_VIDEO_TEA6420 is not set # CONFIG_VIDEO_THS7303 is not set # CONFIG_VIDEO_THS8200 is not set -# CONFIG_VIDEO_TIMBERDALE is not set # CONFIG_VIDEO_TLV320AIC23B is not set -# CONFIG_VIDEO_TM6000 is not set # CONFIG_VIDEO_TVAUDIO is not set # CONFIG_VIDEO_TVP514X is not set # CONFIG_VIDEO_TVP5150 is not set @@ -7924,17 +7308,13 @@ CONFIG_VHOST_MENU=y # CONFIG_VIDEO_UPD64031A is not set # CONFIG_VIDEO_UPD64083 is not set # CONFIG_VIDEO_USBTV is not set -# CONFIG_VIDEO_USBVISION is not set -# CONFIG_VIDEO_V4L2 is not set # CONFIG_VIDEO_VP27SMPX is not set # CONFIG_VIDEO_VPX3220 is not set -# CONFIG_VIDEO_VS6624 is not set # CONFIG_VIDEO_WM8739 is not set # CONFIG_VIDEO_WM8775 is not set # CONFIG_VIDEO_XILINX is not set # CONFIG_VIDEO_ZORAN is not set # CONFIG_VIRTIO_BALLOON is not set -# CONFIG_VIRTIO_BLK_SCSI is not set # CONFIG_VIRTIO_CONSOLE is not set # CONFIG_VIRTIO_FS is not set # CONFIG_VIRTIO_INPUT is not set @@ -7945,7 +7325,6 @@ CONFIG_VIRTIO_MENU=y # CONFIG_VIRTUALIZATION is not set # CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set # CONFIG_VIRT_DRIVERS is not set -CONFIG_VIRT_TO_BUS=y # CONFIG_VITESSE_PHY is not set # CONFIG_VL53L0X_I2C is not set # CONFIG_VL6180 is not set @@ -7964,7 +7343,6 @@ CONFIG_VMSPLIT_3G=y # CONFIG_VMWARE_VMCI is not set # CONFIG_VMXNET3 is not set # CONFIG_VM_EVENT_COUNTERS is not set -# CONFIG_VOP_BUS is not set # CONFIG_VORTEX is not set # CONFIG_VSOCKETS is not set # CONFIG_VSOCKETS_DIAG is not set @@ -7972,12 +7350,10 @@ CONFIG_VMSPLIT_3G=y # CONFIG_VT6655 is not set # CONFIG_VT6656 is not set # CONFIG_VXFS_FS is not set -# CONFIG_VXGE is not set # CONFIG_VXLAN is not set # CONFIG_VZ89X is not set # CONFIG_W1 is not set # CONFIG_W1_CON is not set -# CONFIG_W1_MASTER_DS1WM is not set # CONFIG_W1_MASTER_DS2482 is not set # CONFIG_W1_MASTER_DS2490 is not set # CONFIG_W1_MASTER_GPIO is not set @@ -8023,12 +7399,9 @@ CONFIG_WATCHDOG_OPEN_TIMEOUT=0 # CONFIG_WEXT_PRIV is not set # CONFIG_WEXT_PROC is not set # CONFIG_WEXT_SPY is not set -CONFIG_WILINK_PLATFORM_DATA=y -# CONFIG_WIMAX is not set # CONFIG_WIREGUARD is not set CONFIG_WIRELESS=y # CONFIG_WIRELESS_EXT is not set -# CONFIG_WIRELESS_WDS is not set # CONFIG_WIZNET_W5100 is not set # CONFIG_WIZNET_W5300 is not set # CONFIG_WL1251 is not set @@ -8065,7 +7438,6 @@ CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y # CONFIG_X25 is not set # CONFIG_X509_CERTIFICATE_PARSER is not set # CONFIG_X86_PKG_TEMP_THERMAL is not set -CONFIG_X86_SYSFB=y # CONFIG_X9250 is not set # CONFIG_XDP_SOCKETS is not set # CONFIG_XEN is not set @@ -8150,4 +7522,3 @@ CONFIG_ZONE_DMA=y # CONFIG_ZSMALLOC is not set CONFIG_ZSMALLOC_CHAIN_SIZE=8 # CONFIG_ZSWAP is not set -# CONFIG_ZX_TDM is not set diff --git a/target/linux/generic/hack-6.6/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch b/target/linux/generic/hack-6.6/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch index 5ba0000c60778b..dee901fbe334b4 100644 --- a/target/linux/generic/hack-6.6/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch +++ b/target/linux/generic/hack-6.6/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch @@ -15,9 +15,9 @@ Signed-off-by: Alex Marginean --- a/drivers/net/phy/aquantia/aquantia_main.c +++ b/drivers/net/phy/aquantia/aquantia_main.c -@@ -127,6 +127,29 @@ struct aqr107_priv { - u64 sgmii_stats[AQR107_SGMII_STAT_SZ]; - }; +@@ -90,6 +90,29 @@ + #define AQR107_OP_IN_PROG_SLEEP 1000 + #define AQR107_OP_IN_PROG_TIMEOUT 100000 +/* registers in MDIO_MMD_VEND1 region */ +#define AQUANTIA_VND1_GLOBAL_SC 0x000 @@ -45,7 +45,7 @@ Signed-off-by: Alex Marginean static int aqr107_get_sset_count(struct phy_device *phydev) { return AQR107_SGMII_STAT_SZ; -@@ -233,6 +256,51 @@ static int aqr_config_aneg(struct phy_de +@@ -196,6 +219,51 @@ static int aqr_config_aneg(struct phy_de return genphy_c45_check_and_restart_aneg(phydev, changed); } diff --git a/target/linux/generic/hack-6.6/723-net-phy-aquantia-fix-system-side-protocol-mi.patch b/target/linux/generic/hack-6.6/723-net-phy-aquantia-fix-system-side-protocol-mi.patch index 614003a5d8d367..b5e35dfdd75892 100644 --- a/target/linux/generic/hack-6.6/723-net-phy-aquantia-fix-system-side-protocol-mi.patch +++ b/target/linux/generic/hack-6.6/723-net-phy-aquantia-fix-system-side-protocol-mi.patch @@ -14,7 +14,7 @@ Signed-off-by: Alex Marginean --- a/drivers/net/phy/aquantia/aquantia_main.c +++ b/drivers/net/phy/aquantia/aquantia_main.c -@@ -289,10 +289,16 @@ static int aqr_config_aneg_set_prot(stru +@@ -252,10 +252,16 @@ static int aqr_config_aneg_set_prot(stru phy_write_mmd(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GSTART_RATE, aquantia_syscfg[if_type].start_rate); diff --git a/target/linux/generic/hack-6.6/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch b/target/linux/generic/hack-6.6/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch index c2999e5a852670..075b0fc8e29d76 100644 --- a/target/linux/generic/hack-6.6/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch +++ b/target/linux/generic/hack-6.6/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch @@ -24,7 +24,6 @@ Signed-off-by: Daniel Golle @@ -1023,6 +1025,30 @@ static struct phy_driver aqr_driver[] = .led_hw_control_get = aqr_phy_led_hw_control_get, .led_polarity_set = aqr_phy_led_polarity_set, - #endif }, +{ + PHY_ID_MATCH_MODEL(PHY_ID_AQR112C), 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 d313e46b4f8b8c..fd2a3278114efc 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,17 +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 -@@ -228,7 +235,8 @@ static int gpy_ack_interrupt(struct phy_device *phydev) - - /* Clear all pending interrupts */ - ret = phy_read(phydev, PHY_ISTAT); -- return ret < 0 ? ret : 0; -+ if (ret < 0) -+ return ret; - } - - static int gpy_mbox_read(struct phy_device *phydev, u32 addr) -@@ -270,10 +278,41 @@ out: +@@ -270,10 +277,39 @@ out: return ret; } @@ -101,8 +91,7 @@ Signed-off-by: David Bauer static int gpy_config_init(struct phy_device *phydev) { /* Nothing to configure. Configuration Requirement Placeholder */ - return 0; -+ +- return 0; + return gpy_led_write(phydev); } diff --git a/target/linux/generic/pending-6.6/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-6.6/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 6405865c459e7e..defde3f4269c21 100644 --- a/target/linux/generic/pending-6.6/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-6.6/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1258,6 +1258,74 @@ static struct mtd_notifier ubi_mtd_notif +@@ -1258,6 +1258,80 @@ static struct mtd_notifier ubi_mtd_notif .remove = ubi_notify_remove, }; @@ -21,6 +21,7 @@ Signed-off-by: Daniel Golle +{ + int err; + struct mtd_info *mtd; ++ struct device_node *np; + loff_t offset = 0; + size_t len; + char magic[4]; @@ -33,6 +34,11 @@ Signed-off-by: Daniel Golle + if (IS_ERR(mtd)) + return; + ++ /* skip "linux,ubi" mtd as it has already been attached */ ++ np = mtd_get_of_node(mtd); ++ if (of_device_is_compatible(np, "linux,ubi")) ++ goto cleanup; ++ + /* get the first not bad block */ + if (mtd_can_have_bb(mtd)) + while (mtd_block_isbad(mtd, offset)) { @@ -83,7 +89,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init_attach(void) { int err, i, k; -@@ -1308,6 +1376,12 @@ static int __init ubi_init_attach(void) +@@ -1308,6 +1382,12 @@ static int __init ubi_init_attach(void) } } diff --git a/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch b/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch index 26ef29ca87251f..5cc85083d2c662 100644 --- a/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch +++ b/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch @@ -668,7 +668,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.6/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-6.6/703-phy-add-detach-callback-to-struct-phy_driver.patch index c544a06dfc9215..aa8396826334b5 100644 --- a/target/linux/generic/pending-6.6/703-phy-add-detach-callback-to-struct-phy_driver.patch +++ b/target/linux/generic/pending-6.6/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1908,6 +1908,9 @@ void phy_detach(struct phy_device *phyde +@@ -1910,6 +1910,9 @@ void phy_detach(struct phy_device *phyde if (phydev->devlink) device_link_del(phydev->devlink); @@ -23,7 +23,7 @@ Signed-off-by: Gabor Juhos sysfs_remove_link(&dev->dev.kobj, "phydev"); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -976,6 +976,12 @@ struct phy_driver { +@@ -979,6 +979,12 @@ struct phy_driver { /** @handle_interrupt: Override default interrupt handling */ irqreturn_t (*handle_interrupt)(struct phy_device *phydev); diff --git a/target/linux/generic/pending-6.6/732-00-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch b/target/linux/generic/pending-6.6/732-00-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch index cf195231603948..c3297a1087d003 100644 --- a/target/linux/generic/pending-6.6/732-00-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch +++ b/target/linux/generic/pending-6.6/732-00-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -1334,6 +1334,22 @@ struct mtk_mac { +@@ -1336,6 +1336,22 @@ struct mtk_mac { /* the struct describing the SoC. these are declared in the soc_xyz.c files */ extern const struct of_device_id of_mtk_match[]; @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau static inline bool mtk_is_netsys_v1(struct mtk_eth *eth) { return eth->soc->version == 1; -@@ -1348,6 +1364,7 @@ static inline bool mtk_is_netsys_v3_or_g +@@ -1350,6 +1366,7 @@ static inline bool mtk_is_netsys_v3_or_g { return eth->soc->version > 2; } diff --git a/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch b/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch index 3e56661e70db0c..53187934d02a33 100644 --- a/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch +++ b/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch @@ -24,7 +24,7 @@ Signed-off-by: Felix Fietkau #include #include "mtk_eth_soc.h" -@@ -1587,12 +1588,28 @@ static void mtk_wake_queue(struct mtk_et +@@ -1596,12 +1597,28 @@ static void mtk_wake_queue(struct mtk_et } } @@ -53,7 +53,7 @@ Signed-off-by: Felix Fietkau bool gso = false; int tx_num; -@@ -1614,6 +1631,18 @@ static netdev_tx_t mtk_start_xmit(struct +@@ -1623,6 +1640,18 @@ static netdev_tx_t mtk_start_xmit(struct return NETDEV_TX_BUSY; } @@ -72,7 +72,7 @@ Signed-off-by: Felix Fietkau /* TSO: fill MSS info in tcp checksum field */ if (skb_is_gso(skb)) { if (skb_cow_head(skb, 0)) { -@@ -1629,8 +1658,14 @@ static netdev_tx_t mtk_start_xmit(struct +@@ -1638,8 +1667,14 @@ static netdev_tx_t mtk_start_xmit(struct } } diff --git a/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.patch b/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.patch index f81126430f5aea..82ba768fd5c2c9 100644 --- a/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.patch +++ b/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.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 -@@ -2129,7 +2129,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2140,7 +2140,7 @@ static int mtk_poll_rx(struct napi_struc if (ret != XDP_PASS) goto skip_rx; @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau if (unlikely(!skb)) { page_pool_put_full_page(ring->page_pool, page, true); -@@ -2167,7 +2167,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2178,7 +2178,7 @@ static int mtk_poll_rx(struct napi_struc dma_unmap_single(eth->dma_dev, ((u64)trxd.rxd1 | addr64), ring->buf_size, DMA_FROM_DEVICE); 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 ceef9454475974..f9e10e57335f36 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 @@ -214,7 +214,7 @@ Signed-off-by: Daniel Golle #include #include #include -@@ -261,12 +263,8 @@ static const char * const mtk_clks_sourc +@@ -270,12 +272,8 @@ static const char * const mtk_clks_sourc "ethwarp_wocpu2", "ethwarp_wocpu1", "ethwarp_wocpu0", @@ -227,7 +227,7 @@ Signed-off-by: Daniel Golle "top_eth_gmii_sel", "top_eth_refck_50m_sel", "top_eth_sys_200m_sel", -@@ -509,6 +507,30 @@ static void mtk_setup_bridge_switch(stru +@@ -518,6 +516,30 @@ static void mtk_setup_bridge_switch(stru MTK_GSW_CFG); } @@ -258,7 +258,7 @@ Signed-off-by: Daniel Golle static struct phylink_pcs *mtk_mac_select_pcs(struct phylink_config *config, phy_interface_t interface) { -@@ -517,6 +539,21 @@ static struct phylink_pcs *mtk_mac_selec +@@ -526,6 +548,21 @@ static struct phylink_pcs *mtk_mac_selec struct mtk_eth *eth = mac->hw; unsigned int sid; @@ -280,7 +280,7 @@ Signed-off-by: Daniel Golle if (interface == PHY_INTERFACE_MODE_SGMII || phy_interface_mode_is_8023z(interface)) { sid = (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_SGMII)) ? -@@ -568,7 +605,22 @@ static void mtk_mac_config(struct phylin +@@ -577,7 +614,22 @@ static void mtk_mac_config(struct phylin goto init_err; } break; @@ -303,7 +303,7 @@ Signed-off-by: Daniel Golle break; default: goto err_phy; -@@ -615,8 +667,6 @@ static void mtk_mac_config(struct phylin +@@ -624,8 +676,6 @@ static void mtk_mac_config(struct phylin val &= ~SYSCFG0_GE_MODE(SYSCFG0_GE_MASK, mac->id); val |= SYSCFG0_GE_MODE(ge_mode, mac->id); regmap_write(eth->ethsys, ETHSYS_SYSCFG0, val); @@ -312,7 +312,7 @@ Signed-off-by: Daniel Golle } /* SGMII */ -@@ -633,21 +683,40 @@ static void mtk_mac_config(struct phylin +@@ -642,21 +692,40 @@ static void mtk_mac_config(struct phylin /* Save the syscfg0 value for mac_finish */ mac->syscfg0 = val; @@ -360,7 +360,7 @@ Signed-off-by: Daniel Golle return; err_phy: -@@ -660,6 +729,18 @@ init_err: +@@ -669,6 +738,18 @@ init_err: mac->id, phy_modes(state->interface), err); } @@ -379,7 +379,7 @@ Signed-off-by: Daniel Golle static int mtk_mac_finish(struct phylink_config *config, unsigned int mode, phy_interface_t interface) { -@@ -668,6 +749,10 @@ static int mtk_mac_finish(struct phylink +@@ -677,6 +758,10 @@ static int mtk_mac_finish(struct phylink struct mtk_eth *eth = mac->hw; u32 mcr_cur, mcr_new; @@ -390,7 +390,7 @@ Signed-off-by: Daniel Golle /* Enable SGMII */ if (interface == PHY_INTERFACE_MODE_SGMII || phy_interface_mode_is_8023z(interface)) -@@ -692,10 +777,14 @@ static void mtk_mac_link_down(struct phy +@@ -701,10 +786,14 @@ static void mtk_mac_link_down(struct phy { struct mtk_mac *mac = container_of(config, struct mtk_mac, phylink_config); @@ -408,7 +408,7 @@ Signed-off-by: Daniel Golle } static void mtk_set_queue_speed(struct mtk_eth *eth, unsigned int idx, -@@ -767,13 +856,11 @@ static void mtk_set_queue_speed(struct m +@@ -776,13 +865,11 @@ static void mtk_set_queue_speed(struct m mtk_w32(eth, val, soc->reg_map->qdma.qtx_sch + ofs); } @@ -426,7 +426,7 @@ Signed-off-by: Daniel Golle u32 mcr; mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id)); -@@ -807,9 +894,63 @@ static void mtk_mac_link_up(struct phyli +@@ -816,9 +903,63 @@ static void mtk_mac_link_up(struct phyli mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id)); } @@ -490,9 +490,9 @@ Signed-off-by: Daniel Golle .mac_finish = mtk_mac_finish, .mac_link_down = mtk_mac_link_down, .mac_link_up = mtk_mac_link_up, -@@ -3403,6 +3544,9 @@ static int mtk_open(struct net_device *d - struct mtk_eth *eth = mac->hw; - int i, err; +@@ -3407,6 +3548,9 @@ static int mtk_open(struct net_device *d + + ppe_num = eth->soc->ppe_num; + if (mac->pextp) + phy_power_on(mac->pextp); @@ -500,7 +500,7 @@ Signed-off-by: Daniel Golle err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); if (err) { netdev_err(dev, "%s: could not attach PHY: %d\n", __func__, -@@ -3532,6 +3676,9 @@ static int mtk_stop(struct net_device *d +@@ -3557,6 +3701,9 @@ static int mtk_stop(struct net_device *d for (i = 0; i < ARRAY_SIZE(eth->ppe); i++) mtk_ppe_stop(eth->ppe[i]); @@ -893,7 +893,7 @@ Signed-off-by: Daniel Golle struct mtk_tx_dma_desc_info { dma_addr_t addr; -@@ -1322,6 +1379,9 @@ struct mtk_mac { +@@ -1324,6 +1381,9 @@ struct mtk_mac { struct device_node *of_node; struct phylink *phylink; struct phylink_config phylink_config; @@ -903,7 +903,7 @@ Signed-off-by: Daniel Golle struct mtk_eth *hw; struct mtk_hw_stats *hw_stats; __be32 hwlro_ip[MTK_MAX_LRO_IP_CNT]; -@@ -1445,6 +1505,19 @@ static inline u32 mtk_get_ib2_multicast_ +@@ -1447,6 +1507,19 @@ static inline u32 mtk_get_ib2_multicast_ return MTK_FOE_IB2_MULTICAST; } @@ -923,7 +923,7 @@ Signed-off-by: Daniel Golle /* read the hardware status register */ void mtk_stats_update_mac(struct mtk_mac *mac); -@@ -1453,8 +1526,10 @@ u32 mtk_r32(struct mtk_eth *eth, unsigne +@@ -1455,8 +1528,10 @@ u32 mtk_r32(struct mtk_eth *eth, unsigne u32 mtk_m32(struct mtk_eth *eth, u32 mask, u32 set, unsigned int reg); int mtk_gmac_sgmii_path_setup(struct mtk_eth *eth, int mac_id); @@ -932,5 +932,5 @@ Signed-off-by: Daniel Golle int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id); +int mtk_gmac_usxgmii_path_setup(struct mtk_eth *eth, int mac_id); - int mtk_eth_offload_init(struct mtk_eth *eth); + int mtk_eth_offload_init(struct mtk_eth *eth, u8 id); int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type, diff --git a/target/linux/generic/pending-6.6/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-6.6/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch index 56a015b71edba9..15d385c5fd752e 100644 --- a/target/linux/generic/pending-6.6/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-6.6/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -6989,6 +6989,7 @@ static int mv88e6xxx_register_switch(str +@@ -6992,6 +6992,7 @@ static int mv88e6xxx_register_switch(str ds->ops = &mv88e6xxx_switch_ops; ds->ageing_time_min = chip->info->age_time_coeff; ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; diff --git a/target/linux/generic/pending-6.6/999-net-phy-move-LED-polarity-to-phy_init_hw.patch b/target/linux/generic/pending-6.6/999-net-phy-move-LED-polarity-to-phy_init_hw.patch deleted file mode 100644 index 22c47768279703..00000000000000 --- a/target/linux/generic/pending-6.6/999-net-phy-move-LED-polarity-to-phy_init_hw.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 6e6fff51ae5e54092611d174fa45fa78c237a415 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Tue, 21 May 2024 20:01:46 +0200 -Subject: [PATCH] net: phy: move LED polarity to phy_init_hw - -Some PHY reset the polarity on reset and this cause the LED to -malfunction as LED polarity is configured only when LED is -registered. - -To better handle this, move the LED polarity configuration in -phy_init_hw to reconfigure it after PHY reset. - -Signed-off-by: Christian Marangi ---- - drivers/net/phy/phy_device.c | 53 +++++++++++++++++++++++++----------- - 1 file changed, 37 insertions(+), 16 deletions(-) - ---- a/drivers/net/phy/phy_device.c -+++ b/drivers/net/phy/phy_device.c -@@ -1223,6 +1223,37 @@ static int phy_poll_reset(struct phy_dev - return 0; - } - -+static int of_phy_led_init(struct phy_device *phydev) -+{ -+ struct phy_led *phyled; -+ -+ list_for_each_entry(phyled, &phydev->leds, list) { -+ struct led_classdev *cdev = &phyled->led_cdev; -+ struct device_node *np = cdev->dev->of_node; -+ unsigned long modes = 0; -+ int err; -+ -+ if (of_property_read_bool(np, "active-low")) -+ set_bit(PHY_LED_ACTIVE_LOW, &modes); -+ if (of_property_read_bool(np, "inactive-high-impedance")) -+ set_bit(PHY_LED_INACTIVE_HIGH_IMPEDANCE, &modes); -+ -+ if (!modes) -+ continue; -+ -+ /* Return error if asked to set polarity modes but not supported */ -+ if (!phydev->drv->led_polarity_set) -+ return -EINVAL; -+ -+ err = phydev->drv->led_polarity_set(phydev, phyled->index, -+ modes); -+ if (err) -+ return err; -+ } -+ -+ return 0; -+} -+ - int phy_init_hw(struct phy_device *phydev) - { - int ret = 0; -@@ -1259,6 +1290,12 @@ int phy_init_hw(struct phy_device *phyde - return ret; - } - -+ if (IS_ENABLED(CONFIG_PHYLIB_LEDS)) { -+ ret = of_phy_led_init(phydev); -+ if (ret < 0) -+ return ret; -+ } -+ - return 0; - } - EXPORT_SYMBOL(phy_init_hw); -@@ -3204,7 +3241,6 @@ static int of_phy_led(struct phy_device - struct device *dev = &phydev->mdio.dev; - struct led_init_data init_data = {}; - struct led_classdev *cdev; -- unsigned long modes = 0; - struct phy_led *phyled; - u32 index; - int err; -@@ -3222,21 +3258,6 @@ static int of_phy_led(struct phy_device - if (index > U8_MAX) - return -EINVAL; - -- if (of_property_read_bool(led, "active-low")) -- set_bit(PHY_LED_ACTIVE_LOW, &modes); -- if (of_property_read_bool(led, "inactive-high-impedance")) -- set_bit(PHY_LED_INACTIVE_HIGH_IMPEDANCE, &modes); -- -- if (modes) { -- /* Return error if asked to set polarity modes but not supported */ -- if (!phydev->drv->led_polarity_set) -- return -EINVAL; -- -- err = phydev->drv->led_polarity_set(phydev, index, modes); -- if (err) -- return err; -- } -- - phyled->index = index; - if (phydev->drv->led_brightness_set) - cdev->brightness_set_blocking = phy_led_set_brightness; diff --git a/tools/Makefile b/tools/Makefile index 009778a4956c20..b16c5d9c5b1e6c 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -96,7 +96,7 @@ $(curdir)/bison/compile := $(curdir)/flex/compile $(curdir)/cbootimage/compile += $(curdir)/automake/compile $(curdir)/cmake/compile += $(curdir)/libressl/compile $(curdir)/ninja/compile $(curdir)/expat/compile $(curdir)/xz/compile $(curdir)/zlib/compile $(curdir)/zstd/compile $(curdir)/dosfstools/compile := $(curdir)/automake/compile -$(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile +$(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile $(curdir)/util-linux/compile $(curdir)/elfutils/compile := $(curdir)/m4/compile $(curdir)/zlib/compile $(curdir)/gnulib/compile $(curdir)/libtool/compile $(curdir)/fakeroot/compile := $(curdir)/libtool/compile $(curdir)/findutils/compile := $(curdir)/bison/compile @@ -121,7 +121,7 @@ $(curdir)/mklibs/compile := $(curdir)/libtool/compile $(curdir)/mold/compile := $(curdir)/cmake/compile $(curdir)/zlib/compile $(curdir)/zstd/compile $(curdir)/mpc/compile := $(curdir)/mpfr/compile $(curdir)/gmp/compile $(curdir)/mpfr/compile := $(curdir)/gmp/compile -$(curdir)/mtd-utils/compile := $(curdir)/libtool/compile $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile +$(curdir)/mtd-utils/compile := $(curdir)/libtool/compile $(curdir)/zlib/compile $(curdir)/util-linux/compile $(curdir)/padjffs2/compile := $(curdir)/findutils/compile $(curdir)/patchelf/compile := $(curdir)/libtool/compile $(curdir)/pkgconf/compile := $(curdir)/meson/compile @@ -129,7 +129,7 @@ $(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compil $(curdir)/sdcc/compile := $(curdir)/bison/compile $(curdir)/squashfs3-lzma/compile := $(curdir)/lzma-old/compile $(curdir)/squashfs4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile -$(curdir)/util-linux/compile := $(curdir)/bison/compile +$(curdir)/util-linux/compile := $(curdir)/bison/compile $(curdir)/automake/compile $(curdir)/yafut/compile := $(curdir)/cmake/compile ifneq ($(HOST_OS),Linux) diff --git a/tools/coreutils/Makefile b/tools/coreutils/Makefile index 5ef780d7d2f8ef..73b95912ee140b 100644 --- a/tools/coreutils/Makefile +++ b/tools/coreutils/Makefile @@ -29,7 +29,6 @@ HOST_GNULIB_SKIP := \ lib/locale.in.h HOST_CONFIGURE_ARGS += \ - --disable-year2038 \ --enable-install-program=$(subst $(space),$(comma),$(strip $(PKG_PROGRAMS))) HOST_MAKE_FLAGS += \ diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile index 567e6a4c9a8ffb..2c35adfa8f9b07 100644 --- a/tools/e2fsprogs/Makefile +++ b/tools/e2fsprogs/Makefile @@ -11,7 +11,6 @@ PKG_NAME:=e2fsprogs PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs PKG_VERSION:=1.47.0 PKG_HASH:=0b4fe723d779b0927fb83c9ae709bc7b40f66d7df36433bef143e41c54257084 -PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/ @@ -27,7 +26,7 @@ HOST_CFLAGS += $(HOST_FPIC) HOST_CONFIGURE_ARGS += \ --disable-elf-shlibs \ - --enable-libuuid \ + --disable-libuuid \ --disable-tls \ --disable-nls \ --enable-threads=pth \ @@ -39,17 +38,13 @@ define Host/Prepare endef define Host/Install - $(Host/Install/Default) - $(MAKE) -C $(HOST_BUILD_DIR)/lib/uuid install - mkdir -p $(STAGING_DIR_HOST)/include/e2fsprogs - $(CP) $(STAGING_DIR_HOST)/include/uuid $(STAGING_DIR_HOST)/include/e2fsprogs/ - rm -rf $(STAGING_DIR_HOST)/include/uuid - $(INSTALL_DATA) $(HOST_BUILD_DIR)/lib/uuid/libuuid.a $(STAGING_DIR_HOST)/lib/ + $(call Host/Install/Default) + $(SED) 's|^DIR=.*|DIR=$$$${STAGING_DIR_HOST}/share/et|' $(STAGING_DIR_HOST)/bin/compile_et + $(SED) 's|^DIR=.*|DIR=$$$${STAGING_DIR_HOST}/share/ss|' $(STAGING_DIR_HOST)/bin/mk_cmds endef -define Host/Clean - rm -f $(STAGING_DIR_HOST)/bin/e2fsck - rm -f $(STAGING_DIR_HOST)/bin/tune2fs +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) endef $(eval $(call HostBuild)) diff --git a/tools/llvm-bpf/Makefile b/tools/llvm-bpf/Makefile index bb3179016c7b5c..b8c2005de8850e 100644 --- a/tools/llvm-bpf/Makefile +++ b/tools/llvm-bpf/Makefile @@ -7,12 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=llvm-project -PKG_VERSION:=15.0.7 -PKG_RELEASE:=1 +PKG_VERSION:=18.1.7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tar.xz PKG_SOURCE_URL:=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(PKG_VERSION) -PKG_HASH:=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6 +PKG_HASH:=74446ab6943f686391954cbda0d77ae92e8a60c432eff437b8666e121d748ec4 PKG_CPE_ID:=cpe:/a:llvm:llvm HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION).src @@ -28,16 +27,27 @@ LLVM_BPF_PREFIX = llvm-bpf-$(PKG_VERSION).$(HOST_OS)-$(HOST_ARCH) CMAKE_HOST_INSTALL_PREFIX = $(STAGING_DIR_HOST)/$(LLVM_BPF_PREFIX) CMAKE_HOST_OPTIONS += \ - -DLLVM_ENABLE_BINDINGS=OFF \ - -DLLVM_INCLUDE_DOCS=OFF \ - -DLLVM_INCLUDE_EXAMPLES=OFF \ - -DLLVM_INCLUDE_TESTS=OFF \ - -DLLVM_ENABLE_PROJECTS="clang;lld" \ -DLLVM_TARGETS_TO_BUILD=BPF \ - -DCLANG_BUILD_EXAMPLES=OFF \ + -DLLVM_DEFAULT_TARGET_TRIPLE=bpf \ + -DLLVM_ENABLE_PROJECTS="clang;lld" \ -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \ -DLLVM_LINK_LLVM_DYLIB=ON \ -DLLVM_TOOLCHAIN_TOOLS="llvm-objcopy;llvm-objdump;llvm-readelf;llvm-strip;llvm-ar;llvm-as;llvm-dis;llvm-link;llvm-nm;llvm-ranlib;llc;opt" \ + -DLLVM_INCLUDE_BENCHMARKS=OFF \ + -DLLVM_INCLUDE_DOCS=OFF \ + -DLLVM_INCLUDE_EXAMPLES=OFF \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DLLVM_ENABLE_BINDINGS=OFF \ + -DLLVM_ENABLE_IDE=OFF \ + -DLLVM_ENABLE_LIBEDIT=OFF \ + -DLLVM_ENABLE_LIBPFM=OFF \ + -DLLVM_ENABLE_LIBXML2=OFF \ + -DLLVM_ENABLE_OCAMLDOC=OFF \ + -DLLVM_ENABLE_TERMINFO=OFF \ + -DLLVM_ENABLE_Z3_SOLVER=OFF \ + -DLLVM_ENABLE_ZLIB=OFF \ + -DLLVM_ENABLE_ZSTD=OFF \ + -DLLVM_PARALLEL_LINK_JOBS=1 \ -DCMAKE_SKIP_RPATH=OFF define Host/Install diff --git a/tools/mkimage/Makefile b/tools/mkimage/Makefile index 6d2cc5f7643846..0a1712bc678a89 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) diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile index 59b1716072c1a7..3bcfabc3ad587c 100644 --- a/tools/mtd-utils/Makefile +++ b/tools/mtd-utils/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd-utils -PKG_VERSION:=2.1.6 -PKG_RELEASE:=1 +PKG_VERSION:=2.2.0 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://infraroot.at/pub/mtd/ -PKG_HASH:=c1d853bc4adf83bcabd2792fc95af33bdd8643c97e8f7b3f0180af36af76f0e5 +PKG_HASH:=250d082f67375ca8451b5fcfc9a23a53ced3ebebd8312c288daf2507bbab1324 PKG_CPE_ID:=cpe:/a:mtd-utils_project:mtd-utils PKG_FIXUP:=autoreconf @@ -29,15 +29,13 @@ ifneq ($(HOST_OS),Linux) -include fls.h endif -HOST_CONFIGURE_VARS+= \ - UUID_CFLAGS="-I$(STAGING_DIR_HOST)/include/e2fsprogs/uuid" - HOST_CONFIGURE_ARGS+= \ - --disable-tests \ + --without-tests \ --without-crypto \ --without-xattr \ --without-zstd \ - --without-lzo + --without-lzo \ + --with-lzma HOST_MAKE_FLAGS += \ PROGRAMS="mkfs.jffs2 ubinize mkfs.ubifs" diff --git a/tools/mtd-utils/patches/110-portability.patch b/tools/mtd-utils/patches/110-portability.patch index e25fd82bb3c296..7e17f807365a22 100644 --- a/tools/mtd-utils/patches/110-portability.patch +++ b/tools/mtd-utils/patches/110-portability.patch @@ -1,9 +1,9 @@ --- a/jffsX-utils/compr_lzo.c +++ b/jffsX-utils/compr_lzo.c -@@ -26,7 +26,6 @@ +@@ -24,7 +24,6 @@ + #include + #include #include - - #ifndef WITHOUT_LZO -#include #include #include @@ -70,7 +70,7 @@ #include --- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c +++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c -@@ -1542,6 +1542,7 @@ static int add_inode(struct stat *st, in +@@ -1554,6 +1554,7 @@ static int add_inode(struct stat *st, in if (c->default_compr != UBIFS_COMPR_NONE) use_flags |= UBIFS_COMPR_FL; @@ -78,7 +78,7 @@ if (flags & FS_COMPR_FL) use_flags |= UBIFS_COMPR_FL; if (flags & FS_SYNC_FL) -@@ -1554,6 +1555,7 @@ static int add_inode(struct stat *st, in +@@ -1566,6 +1567,7 @@ static int add_inode(struct stat *st, in use_flags |= UBIFS_DIRSYNC_FL; if (fctx) use_flags |= UBIFS_CRYPT_FL; @@ -86,7 +86,7 @@ memset(ino, 0, UBIFS_INO_NODE_SZ); ino_key_init(&key, inum); -@@ -1639,7 +1641,9 @@ static int add_dir_inode(const char *pat +@@ -1651,7 +1653,9 @@ static int add_dir_inode(const char *pat fd = dirfd(dir); if (fd == -1) return sys_err_msg("dirfd failed"); @@ -96,23 +96,23 @@ flags = 0; } -@@ -1850,6 +1854,7 @@ static int add_file(const char *path_nam +@@ -1862,6 +1866,7 @@ static int add_file(const char *path_nam dn->ch.node_type = UBIFS_DATA_NODE; key_write(&key, &dn->key); out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ; +#ifndef NO_NATIVE_SUPPORT if (c->default_compr == UBIFS_COMPR_NONE && !c->encrypted && (flags & FS_COMPR_FL)) - #ifdef WITHOUT_LZO -@@ -1858,6 +1863,7 @@ static int add_file(const char *path_nam - use_compr = UBIFS_COMPR_LZO; + #ifdef WITH_LZO +@@ -1872,6 +1877,7 @@ static int add_file(const char *path_nam + use_compr = UBIFS_COMPR_NONE; #endif else +#endif use_compr = c->default_compr; compr_type = compress_data(buf, bytes_read, &dn->data, &out_len, use_compr); -@@ -1917,7 +1923,9 @@ static int add_non_dir(const char *path_ +@@ -1931,7 +1937,9 @@ static int add_non_dir(const char *path_ if (fd == -1) return sys_err_msg("failed to open file '%s'", path_name); diff --git a/tools/mtd-utils/patches/130-lzma_jffs2.patch b/tools/mtd-utils/patches/130-lzma_jffs2.patch index db683063d58950..32b7d6c7256804 100644 --- a/tools/mtd-utils/patches/130-lzma_jffs2.patch +++ b/tools/mtd-utils/patches/130-lzma_jffs2.patch @@ -1,25 +1,9 @@ --- a/jffsX-utils/Makemodule.am +++ b/jffsX-utils/Makemodule.am -@@ -4,7 +4,10 @@ mkfs_jffs2_SOURCES = \ - jffsX-utils/compr_zlib.c \ - jffsX-utils/compr.h \ - jffsX-utils/rbtree.c \ -- jffsX-utils/compr_lzo.c \ -+ jffsX-utils/compr_lzma.c \ -+ jffsX-utils/lzma/LzFind.c \ -+ jffsX-utils/lzma/LzmaEnc.c \ -+ jffsX-utils/lzma/LzmaDec.c \ - jffsX-utils/compr.c \ - jffsX-utils/compr_rtime.c \ - jffsX-utils/compr.h \ -@@ -12,8 +15,13 @@ mkfs_jffs2_SOURCES = \ +@@ -10,8 +10,9 @@ mkfs_jffs2_SOURCES = \ jffsX-utils/summary.h \ include/linux/jffs2.h \ include/mtd/jffs2-user.h -+ -+if !WITHOUT_LZO -+mkfs_jffs2_SOURCES += jffsX-utils/compr_lzo.c -+endif + mkfs_jffs2_LDADD = libmtd.a $(ZLIB_LIBS) $(LZO_LIBS) -mkfs_jffs2_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) @@ -27,36 +11,45 @@ jffs2reader_SOURCES = jffsX-utils/jffs2reader.c include/mtd/jffs2-user.h jffs2reader_LDADD = libmtd.a $(ZLIB_LIBS) $(LZO_LIBS) +@@ -33,6 +34,14 @@ if WITH_ZLIB + mkfs_jffs2_SOURCES += jffsX-utils/compr_zlib.c + endif + ++if WITH_LZMA ++mkfs_jffs2_SOURCES += \ ++ jffsX-utils/compr_lzma.c \ ++ jffsX-utils/lzma/LzFind.c \ ++ jffsX-utils/lzma/LzmaEnc.c \ ++ jffsX-utils/lzma/LzmaDec.c ++endif ++ + EXTRA_DIST += jffsX-utils/device_table.txt jffsX-utils/mkfs.jffs2.1 + + dist_man1_MANS += jffsX-utils/mkfs.jffs2.1 --- a/jffsX-utils/compr.c +++ b/jffsX-utils/compr.c @@ -520,6 +520,9 @@ int jffs2_compressors_init(void) - #ifdef CONFIG_JFFS2_LZO + #ifdef WITH_LZO jffs2_lzo_init(); #endif -+#ifdef CONFIG_JFFS2_LZMA ++#ifdef WITH_LZMA + jffs2_lzma_init(); +#endif return 0; } @@ -534,5 +537,8 @@ int jffs2_compressors_exit(void) - #ifdef CONFIG_JFFS2_LZO + #ifdef WITH_LZO jffs2_lzo_exit(); #endif -+#ifdef CONFIG_JFFS2_LZMA ++#ifdef WITH_LZMA + jffs2_lzma_exit(); +#endif return 0; } --- a/jffsX-utils/compr.h +++ b/jffsX-utils/compr.h -@@ -18,13 +18,14 @@ - - #define CONFIG_JFFS2_ZLIB - #define CONFIG_JFFS2_RTIME --#define CONFIG_JFFS2_LZO -+#define CONFIG_JFFS2_LZMA - +@@ -21,8 +21,9 @@ #define JFFS2_RUBINMIPS_PRIORITY 10 #define JFFS2_DYNRUBIN_PRIORITY 20 #define JFFS2_RTIME_PRIORITY 50 @@ -68,11 +61,11 @@ #define JFFS2_COMPR_MODE_NONE 0 #define JFFS2_COMPR_MODE_PRIORITY 1 -@@ -115,5 +116,10 @@ void jffs2_rtime_exit(void); +@@ -113,5 +114,10 @@ void jffs2_rtime_exit(void); int jffs2_lzo_init(void); void jffs2_lzo_exit(void); #endif -+#ifdef CONFIG_JFFS2_LZMA ++#ifdef WITH_LZMA +int jffs2_lzma_init(void); +void jffs2_lzma_exit(void); +#endif @@ -5036,3 +5029,45 @@ } break; } +--- a/Makefile.am ++++ b/Makefile.am +@@ -19,6 +19,10 @@ if WITH_ZSTD + AM_CPPFLAGS += -DWITH_ZSTD + endif + ++if WITH_LZMA ++AM_CPPFLAGS += -DWITH_LZMA ++endif ++ + if WITH_SELINUX + AM_CPPFLAGS += -DWITH_SELINUX + endif +--- a/configure.ac ++++ b/configure.ac +@@ -96,6 +96,10 @@ AC_ARG_WITH([zstd], + [AS_HELP_STRING([--with-zstd], [Support for ZSTD compression])], + [], [with_zstd="check"]) + ++AC_ARG_WITH([lzma], ++ [AS_HELP_STRING([--with-lzma], [Support for LZMA compression])], ++ [], [with_lzma="check"]) ++ + AC_ARG_WITH([selinux], + [AS_HELP_STRING([--with-selinux], + [Support for selinux extended attributes])], +@@ -268,6 +272,7 @@ fi + AM_CONDITIONAL([WITH_LZO], [test "x$with_lzo" = "xyes"]) + AM_CONDITIONAL([WITH_ZLIB], [test "x$with_zlib" = "xyes"]) + AM_CONDITIONAL([WITH_ZSTD], [test "x$with_zstd" = "xyes"]) ++AM_CONDITIONAL([WITH_LZMA], [test "x$with_lzma" = "xyes"]) + AM_CONDITIONAL([WITH_XATTR], [test "x$with_xattr" = "xyes"]) + AM_CONDITIONAL([WITH_SELINUX], [test "x$with_selinux" = "xyes"]) + AM_CONDITIONAL([WITH_CRYPTO], [test "x$with_crypto" = "xyes"]) +@@ -312,6 +317,7 @@ AC_MSG_RESULT([ + lzo support: ${with_lzo} + zlib support: ${with_zlib} + zstd support: ${with_zstd} ++ lzma support: ${with_lzma} + xattr/acl support: ${with_xattr} + SELinux support: ${with_selinux} + fscrypt support: ${with_crypto} diff --git a/tools/util-linux/Makefile b/tools/util-linux/Makefile index 76416b81f71614..0394907a96d24f 100644 --- a/tools/util-linux/Makefile +++ b/tools/util-linux/Makefile @@ -14,6 +14,8 @@ PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.40 PKG_HASH:=8e396eececae2b3b68db232c33b8810faa7c31f6df19f98f512739293d5829b7 PKG_CPE_ID:=cpe:/a:kernel:util-linux +PKG_FIXUP:=autoreconf + HOST_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/host-build.mk @@ -46,12 +48,8 @@ HOST_CONFIGURE_ARGS += \ --without-python \ --without-cryptsetup -define Host/Install - $(INSTALL_BIN) $(HOST_BUILD_DIR)/hexdump $(STAGING_DIR_HOST)/bin/ -endef - define Host/Uninstall - rm -f $(STAGING_DIR_HOST)/bin/hexdump + -$(call Host/Compile/Default,uninstall) endef $(eval $(call HostBuild)) diff --git a/tools/util-linux/patches/0001-hexdump-allow-enabling-with-disable-all-programs.patch b/tools/util-linux/patches/0001-hexdump-allow-enabling-with-disable-all-programs.patch new file mode 100644 index 00000000000000..c0c1f04d06aa92 --- /dev/null +++ b/tools/util-linux/patches/0001-hexdump-allow-enabling-with-disable-all-programs.patch @@ -0,0 +1,28 @@ +From 37641f246ee9df7289b4e3054b3ded3912773722 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Tue, 25 Jun 2024 17:32:08 +0200 +Subject: [PATCH] hexdump: allow enabling with --disable-all-programs + +Currently, if --disable-all-programs is used hexdump cannot be built +as --enable-hexdump is not recognized, so lets add support for it. + +Signed-off-by: Robert Marko +--- + configure.ac | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -2237,7 +2237,11 @@ UL_BUILD_INIT([column], [check]) + UL_REQUIRES_BUILD([column], [libsmartcols]) + AM_CONDITIONAL([BUILD_COLUMN], [test "x$build_column" = xyes]) + +-UL_BUILD_INIT([hexdump], [yes]) ++AC_ARG_ENABLE([hexdump], ++ AS_HELP_STRING([--disable-hexdump], [do not build hexdump]), ++ [], [UL_DEFAULT_ENABLE([hexdump], [check])] ++) ++UL_BUILD_INIT([hexdump]) + AM_CONDITIONAL([BUILD_HEXDUMP], [test "x$build_hexdump" = xyes]) + + UL_BUILD_INIT([rev], [yes]) diff --git a/tools/util-linux/patches/101-macos-weak-aliases.patch b/tools/util-linux/patches/101-macos-weak-aliases.patch new file mode 100644 index 00000000000000..e5d0f9d0b839c8 --- /dev/null +++ b/tools/util-linux/patches/101-macos-weak-aliases.patch @@ -0,0 +1,26 @@ +From 9445f477cfcfb3615ffde8f93b1b98c809ee4eca Mon Sep 17 00:00:00 2001 +From: Eugene Gershnik +Date: Mon, 6 May 2024 09:29:39 -0700 +Subject: [PATCH] This re-enables build on macOS. + +Weak aliases are not supported by clang on Darwin. +Instead this fix uses inline asm to make `_uuid_time` and alias to `___uuid_time` + +Fixes util-linux/util-linux#2873 +--- + libuuid/src/uuid_time.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/libuuid/src/uuid_time.c ++++ b/libuuid/src/uuid_time.c +@@ -85,6 +85,10 @@ time_t __uuid_time(const uuid_t uu, stru + } + #if defined(__USE_TIME_BITS64) && defined(__GLIBC__) + extern time_t uuid_time64(const uuid_t uu, struct timeval *ret_tv) __attribute__((weak, alias("__uuid_time"))); ++#elif defined(__clang__) && defined(__APPLE__) ++__asm__(".globl _uuid_time"); ++__asm__(".set _uuid_time, ___uuid_time"); ++extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv); + #else + extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv) __attribute__((weak, alias("__uuid_time"))); + #endif