From dbb9c556110e9d523d0a55050fe3e0546f169355 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Thu, 8 May 2025 23:11:06 +0800 Subject: [PATCH] lantiq: refresh 6.12 kernel patches Manually rebased: 001-MIPS-lantiq-add-pcie-driver.patch 028-NET-lantiq-various-etop-fixes.patch 152-lantiq-VPE.patch 160-owrt-lantiq-multiple-flash.patch Signed-off-by: Shiji Yang --- .../001-MIPS-lantiq-add-pcie-driver.patch | 22 +++++++------------ .../018-MTD-nand-lots-of-xrx200-fixes.patch | 12 +++++----- .../028-NET-lantiq-various-etop-fixes.patch | 8 +++---- ...PS-lantiq-add-FALC-ON-i2c-bus-master.patch | 6 ++--- .../lantiq/patches-6.12/152-lantiq-VPE.patch | 20 ++++++++--------- .../160-owrt-lantiq-multiple-flash.patch | 6 ++--- ...y-don-t-yield-while-holding-spinlock.patch | 2 +- 7 files changed, 34 insertions(+), 42 deletions(-) diff --git a/target/linux/lantiq/patches-6.12/001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-6.12/001-MIPS-lantiq-add-pcie-driver.patch index 3dd996bccc8..a125b6bfb33 100644 --- a/target/linux/lantiq/patches-6.12/001-MIPS-lantiq-add-pcie-driver.patch +++ b/target/linux/lantiq/patches-6.12/001-MIPS-lantiq-add-pcie-driver.patch @@ -153,27 +153,21 @@ Signed-off-by: John Crispin + ifx_pcie_rc_class_early_fixup); --- a/arch/mips/pci/fixup-lantiq.c +++ b/arch/mips/pci/fixup-lantiq.c -@@ -6,12 +6,19 @@ +@@ -6,13 +6,24 @@ - #include #include + #include +#include +#include "ifxmips_pci_common.h" - int (*ltq_pci_plat_arch_init)(struct pci_dev *dev) = NULL; - int (*ltq_pci_plat_dev_init)(struct pci_dev *dev) = NULL; - int pcibios_plat_dev_init(struct pci_dev *dev) { +#ifdef CONFIG_PCIE_LANTIQ + if (pci_find_capability(dev, PCI_CAP_ID_EXP)) + ifx_pcie_bios_plat_dev_init(dev); +#endif -+ - if (ltq_pci_plat_arch_init) - return ltq_pci_plat_arch_init(dev); - -@@ -23,5 +30,10 @@ int pcibios_plat_dev_init(struct pci_dev + return 0; + } int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) { @@ -4162,7 +4156,7 @@ Signed-off-by: John Crispin +#endif /* IFXMIPS_PCIE_VR9_H */ --- a/arch/mips/pci/pci-legacy.c +++ b/arch/mips/pci/pci-legacy.c -@@ -304,3 +304,30 @@ char *__init pcibios_setup(char *str) +@@ -312,3 +312,30 @@ char *__init pcibios_setup(char *str) return pcibios_plat_setup(str); return str; } @@ -5514,7 +5508,7 @@ Signed-off-by: John Crispin + --- a/drivers/pci/pcie/Kconfig +++ b/drivers/pci/pcie/Kconfig -@@ -55,6 +55,7 @@ config PCIEAER_INJECT +@@ -64,6 +64,7 @@ config PCIEAER_CXL config PCIE_ECRC bool "PCI Express ECRC settings control" depends on PCIEAER @@ -5524,7 +5518,7 @@ Signed-off-by: John Crispin (transaction layer end-to-end CRC checking). --- a/include/linux/pci.h +++ b/include/linux/pci.h -@@ -1602,6 +1602,8 @@ void pci_walk_bus_locked(struct pci_bus +@@ -1629,6 +1629,8 @@ void pci_walk_bus_locked(struct pci_bus void *userdata); int pci_cfg_space_size(struct pci_dev *dev); unsigned char pci_bus_max_busnr(struct pci_bus *bus); @@ -5535,7 +5529,7 @@ Signed-off-by: John Crispin unsigned long type); --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h -@@ -1110,6 +1110,12 @@ +@@ -1111,6 +1111,12 @@ #define PCI_DEVICE_ID_SGI_IOC3 0x0003 #define PCI_DEVICE_ID_SGI_LITHIUM 0x1002 diff --git a/target/linux/lantiq/patches-6.12/018-MTD-nand-lots-of-xrx200-fixes.patch b/target/linux/lantiq/patches-6.12/018-MTD-nand-lots-of-xrx200-fixes.patch index 90af62364a4..f420d8cde5f 100644 --- a/target/linux/lantiq/patches-6.12/018-MTD-nand-lots-of-xrx200-fixes.patch +++ b/target/linux/lantiq/patches-6.12/018-MTD-nand-lots-of-xrx200-fixes.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/mtd/nand/raw/xway_nand.c +++ b/drivers/mtd/nand/raw/xway_nand.c -@@ -62,6 +62,24 @@ +@@ -61,6 +61,24 @@ #define NAND_CON_CSMUX (1 << 1) #define NAND_CON_NANDM 1 @@ -35,7 +35,7 @@ Signed-off-by: John Crispin struct xway_nand_data { struct nand_controller controller; struct nand_chip chip; -@@ -93,10 +111,22 @@ static void xway_select_chip(struct nand +@@ -92,10 +110,22 @@ static void xway_select_chip(struct nand case -1: ltq_ebu_w32_mask(NAND_CON_CE, 0, EBU_NAND_CON); ltq_ebu_w32_mask(NAND_CON_NANDM, 0, EBU_NAND_CON); @@ -58,7 +58,7 @@ Signed-off-by: John Crispin ltq_ebu_w32_mask(0, NAND_CON_NANDM, EBU_NAND_CON); ltq_ebu_w32_mask(0, NAND_CON_CE, EBU_NAND_CON); break; -@@ -109,6 +139,11 @@ static void xway_cmd_ctrl(struct nand_ch +@@ -108,6 +138,11 @@ static void xway_cmd_ctrl(struct nand_ch { struct mtd_info *mtd = nand_to_mtd(chip); @@ -70,7 +70,7 @@ Signed-off-by: John Crispin if (cmd == NAND_CMD_NONE) return; -@@ -119,6 +154,24 @@ static void xway_cmd_ctrl(struct nand_ch +@@ -118,6 +153,24 @@ static void xway_cmd_ctrl(struct nand_ch while ((ltq_ebu_r32(EBU_NAND_WAIT) & NAND_WAIT_WR_C) == 0) ; @@ -95,7 +95,7 @@ Signed-off-by: John Crispin } static int xway_dev_ready(struct nand_chip *chip) -@@ -170,6 +223,7 @@ static int xway_nand_probe(struct platfo +@@ -169,6 +222,7 @@ static int xway_nand_probe(struct platfo int err; u32 cs; u32 cs_flag = 0; @@ -103,7 +103,7 @@ Signed-off-by: John Crispin /* Allocate memory for the device structure (and zero it) */ data = devm_kzalloc(&pdev->dev, sizeof(struct xway_nand_data), -@@ -205,6 +259,15 @@ static int xway_nand_probe(struct platfo +@@ -204,6 +258,15 @@ static int xway_nand_probe(struct platfo if (!err && cs == 1) cs_flag = NAND_CON_IN_CS1 | NAND_CON_OUT_CS1; diff --git a/target/linux/lantiq/patches-6.12/028-NET-lantiq-various-etop-fixes.patch b/target/linux/lantiq/patches-6.12/028-NET-lantiq-various-etop-fixes.patch index c761757c1c9..fff60cefafe 100644 --- a/target/linux/lantiq/patches-6.12/028-NET-lantiq-various-etop-fixes.patch +++ b/target/linux/lantiq/patches-6.12/028-NET-lantiq-various-etop-fixes.patch @@ -700,7 +700,7 @@ Signed-off-by: John Crispin unsigned long flags; + int max; - dev->mtu = new_mtu; + WRITE_ONCE(dev->mtu, new_mtu); + max = ETH_HLEN + VLAN_HLEN + new_mtu + ETH_FCS_LEN; + @@ -848,8 +848,8 @@ Signed-off-by: John Crispin err = register_netdev(dev); if (err) -@@ -735,31 +968,22 @@ ltq_etop_remove(struct platform_device * - return 0; +@@ -733,31 +966,22 @@ static void ltq_etop_remove(struct platf + } } +static const struct of_device_id ltq_etop_match[] = { @@ -860,7 +860,7 @@ Signed-off-by: John Crispin + static struct platform_driver ltq_mii_driver = { + .probe = ltq_etop_probe, - .remove = ltq_etop_remove, + .remove_new = ltq_etop_remove, .driver = { .name = "ltq_etop", + .of_match_table = ltq_etop_match, diff --git a/target/linux/lantiq/patches-6.12/031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch b/target/linux/lantiq/patches-6.12/031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch index 73eb59f1664..bb78a470e1c 100644 --- a/target/linux/lantiq/patches-6.12/031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch +++ b/target/linux/lantiq/patches-6.12/031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch @@ -18,7 +18,7 @@ Signed-off-by: John Crispin --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig -@@ -819,6 +819,16 @@ config I2C_MICROCHIP_CORE +@@ -857,6 +857,16 @@ config I2C_MICROCHIP_CORE This driver can also be built as a module. If so, the module will be called i2c-microchip-core. @@ -37,9 +37,9 @@ Signed-off-by: John Crispin depends on PPC --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile -@@ -76,6 +76,7 @@ obj-$(CONFIG_I2C_IMX_LPI2C) += i2c-imx-l - obj-$(CONFIG_I2C_IOP3XX) += i2c-iop3xx.o +@@ -78,6 +78,7 @@ obj-$(CONFIG_I2C_IOP3XX) += i2c-iop3xx.o obj-$(CONFIG_I2C_JZ4780) += i2c-jz4780.o + obj-$(CONFIG_I2C_KEBA) += i2c-keba.o obj-$(CONFIG_I2C_KEMPLD) += i2c-kempld.o +obj-$(CONFIG_I2C_LANTIQ) += i2c-lantiq.o obj-$(CONFIG_I2C_LPC2K) += i2c-lpc2k.o diff --git a/target/linux/lantiq/patches-6.12/152-lantiq-VPE.patch b/target/linux/lantiq/patches-6.12/152-lantiq-VPE.patch index 00e075dee00..7e6d843dc1c 100644 --- a/target/linux/lantiq/patches-6.12/152-lantiq-VPE.patch +++ b/target/linux/lantiq/patches-6.12/152-lantiq-VPE.patch @@ -15,7 +15,7 @@ Signed-off-by: Stefan Koch --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2259,6 +2259,12 @@ config MIPS_VPE_LOADER +@@ -2251,6 +2251,12 @@ config MIPS_VPE_LOADER Includes a loader for loading an elf relocatable object onto another VPE and running it. @@ -40,15 +40,15 @@ Signed-off-by: Stefan Koch #define read_c0_tcstatus() __read_32bit_c0_register($2, 1) #define write_c0_tcstatus(val) __write_32bit_c0_register($2, 1, val) -@@ -377,6 +380,8 @@ do { \ - #define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val) - #define read_vpe_c0_vpeconf1() mftc0(1, 3) - #define write_vpe_c0_vpeconf1(val) mttc0(1, 3, val) -+#define read_vpe_c0_vpeopt() mftc0(1, 7) -+#define write_vpe_c0_vpeopt(val) mttc0(1, 7, val) - #define read_vpe_c0_count() mftc0(9, 0) - #define write_vpe_c0_count(val) mttc0(9, 0, val) - #define read_vpe_c0_status() mftc0(12, 0) +@@ -429,6 +432,8 @@ do { \ + #define write_vpe_c0_vpeconf0(val) mttc0($1, 2, val) + #define read_vpe_c0_vpeconf1() mftc0($1, 3) + #define write_vpe_c0_vpeconf1(val) mttc0($1, 3, val) ++#define read_vpe_c0_vpeopt() mftc0($1, 7) ++#define write_vpe_c0_vpeopt(val) mttc0($1, 7, val) + #define read_vpe_c0_count() mftc0($9, 0) + #define write_vpe_c0_count(val) mttc0($9, 0, val) + #define read_vpe_c0_status() mftc0($12, 0) --- a/arch/mips/include/asm/vpe.h +++ b/arch/mips/include/asm/vpe.h @@ -119,4 +119,13 @@ void cleanup_tc(struct tc *tc); diff --git a/target/linux/lantiq/patches-6.12/160-owrt-lantiq-multiple-flash.patch b/target/linux/lantiq/patches-6.12/160-owrt-lantiq-multiple-flash.patch index 1556a32aa60..0f427df8675 100644 --- a/target/linux/lantiq/patches-6.12/160-owrt-lantiq-multiple-flash.patch +++ b/target/linux/lantiq/patches-6.12/160-owrt-lantiq-multiple-flash.patch @@ -85,7 +85,7 @@ Signed-off-by: Maikel Bloemendal ltq_mtd = devm_kzalloc(&pdev->dev, sizeof(struct ltq_mtd), GFP_KERNEL); if (!ltq_mtd) -@@ -118,70 +154,89 @@ ltq_mtd_probe(struct platform_device *pd +@@ -118,68 +154,89 @@ ltq_mtd_probe(struct platform_device *pd platform_set_drvdata(pdev, ltq_mtd); @@ -211,8 +211,7 @@ Signed-off-by: Maikel Bloemendal return err; } --static int --ltq_mtd_remove(struct platform_device *pdev) +-static void ltq_mtd_remove(struct platform_device *pdev) -{ - struct ltq_mtd *ltq_mtd = platform_get_drvdata(pdev); - @@ -220,7 +219,6 @@ Signed-off-by: Maikel Bloemendal - mtd_device_unregister(ltq_mtd->mtd); - map_destroy(ltq_mtd->mtd); - } -- return 0; -} - static const struct of_device_id ltq_mtd_match[] = { diff --git a/target/linux/lantiq/patches-6.12/400-mtd-rawnand-xway-don-t-yield-while-holding-spinlock.patch b/target/linux/lantiq/patches-6.12/400-mtd-rawnand-xway-don-t-yield-while-holding-spinlock.patch index 663b0dbfb37..edf06268609 100644 --- a/target/linux/lantiq/patches-6.12/400-mtd-rawnand-xway-don-t-yield-while-holding-spinlock.patch +++ b/target/linux/lantiq/patches-6.12/400-mtd-rawnand-xway-don-t-yield-while-holding-spinlock.patch @@ -21,7 +21,7 @@ Signed-off-by: Thomas Nixon --- a/drivers/mtd/nand/raw/xway_nand.c +++ b/drivers/mtd/nand/raw/xway_nand.c -@@ -176,7 +176,13 @@ static void xway_cmd_ctrl(struct nand_ch +@@ -175,7 +175,13 @@ static void xway_cmd_ctrl(struct nand_ch static int xway_dev_ready(struct nand_chip *chip) {