From: Martin Schiller Date: Tue, 14 May 2024 09:05:34 +0000 (+0200) Subject: lantiq: Refresh patches and configuration for linux 6.6 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6ec7711d00b123e1c2c0dd731ac0763d7c4b50b7;p=openwrt%2Fstaging%2Fnbd.git lantiq: Refresh patches and configuration for linux 6.6 Make all the patches apply. This also refreshes some of the kernel configurations. Signed-off-by: Martin Schiller --- diff --git a/target/linux/lantiq/config-6.6 b/target/linux/lantiq/config-6.6 index e037a63068..1890d82ff8 100644 --- a/target/linux/lantiq/config-6.6 +++ b/target/linux/lantiq/config-6.6 @@ -20,16 +20,17 @@ CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS32_R1 is not set CONFIG_CPU_MIPS32_R2=y CONFIG_CPU_MIPSR2=y +CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HIGHMEM=y CONFIG_CPU_SUPPORTS_MSA=y CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_GF128MUL=y CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2 CONFIG_CRYPTO_LIB_SHA1=y CONFIG_CRYPTO_LIB_UTILS=y -CONFIG_CRYPTO_RNG2=y CONFIG_CSRC_R4K=y CONFIG_DEBUG_INFO=y CONFIG_DMA_NONCOHERENT=y @@ -38,16 +39,18 @@ CONFIG_DTC=y CONFIG_EARLY_PRINTK=y CONFIG_EXCLUSIVE_SYSTEM_RAM=y CONFIG_FIXED_PHY=y +CONFIG_FS_IOMAP=y +CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y CONFIG_GCC10_NO_ARRAY_BOUNDS=y -CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_CPU_AUTOPROBE=y CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y CONFIG_GENERIC_IOMAP=y CONFIG_GENERIC_IRQ_CHIP=y CONFIG_GENERIC_IRQ_SHOW=y @@ -67,6 +70,7 @@ CONFIG_GPIO_STP_XWAY=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y CONFIG_HAS_IOPORT_MAP=y CONFIG_HZ_PERIODIC=y CONFIG_INITRAMFS_SOURCE="" @@ -86,7 +90,6 @@ CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MDIO_DEVRES=y -CONFIG_MEMFD_CREATE=y CONFIG_MFD_CORE=y CONFIG_MFD_SYSCON=y CONFIG_MIGRATION=y @@ -97,11 +100,11 @@ CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set CONFIG_MIPS_CMDLINE_FROM_DTB=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_MIPS_LD_CAN_LINK_VDSO=y # CONFIG_MIPS_MT_SMP is not set # CONFIG_MIPS_NO_APPENDED_DTB is not set CONFIG_MIPS_RAW_APPENDED_DTB=y CONFIG_MIPS_SPRAM=y +CONFIG_MMU_LAZY_TLB_REFCOUNT=y CONFIG_MODULES_USE_ELF_REL=y CONFIG_MTD_CFI_ADV_OPTIONS=y CONFIG_MTD_CFI_GEOMETRY=y @@ -116,7 +119,11 @@ CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_EGRESS=y +CONFIG_NET_INGRESS=y CONFIG_NET_SELFTESTS=y +CONFIG_NET_XGRESS=y +CONFIG_NO_EXCEPT_FILL=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y CONFIG_NVMEM=y CONFIG_NVMEM_LAYOUTS=y @@ -125,6 +132,7 @@ CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y +CONFIG_OF_GPIO_MM_GPIOCHIP=y CONFIG_OF_IRQ=y CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y @@ -162,7 +170,7 @@ CONFIG_SPI=y CONFIG_SPI_LANTIQ_SSC=y CONFIG_SPI_MASTER=y CONFIG_SPI_MEM=y -CONFIG_SRCU=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y CONFIG_SWAP_IO_SPACE=y CONFIG_SWPHY=y CONFIG_SYSCTL_EXCEPTION_TRACE=y diff --git a/target/linux/lantiq/patches-6.6/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-6.6/0001-MIPS-lantiq-add-pcie-driver.patch index b8f3116bb4..3e23c0f23d 100644 --- a/target/linux/lantiq/patches-6.6/0001-MIPS-lantiq-add-pcie-driver.patch +++ b/target/linux/lantiq/patches-6.6/0001-MIPS-lantiq-add-pcie-driver.patch @@ -4162,7 +4162,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 -@@ -305,3 +305,30 @@ char *__init pcibios_setup(char *str) +@@ -304,3 +304,30 @@ char *__init pcibios_setup(char *str) return pcibios_plat_setup(str); return str; } @@ -5514,7 +5514,7 @@ Signed-off-by: John Crispin + --- a/drivers/pci/pcie/Kconfig +++ b/drivers/pci/pcie/Kconfig -@@ -51,6 +51,7 @@ config PCIEAER_INJECT +@@ -55,6 +55,7 @@ config PCIEAER_INJECT config PCIE_ECRC bool "PCI Express ECRC settings control" depends on PCIEAER @@ -5524,7 +5524,7 @@ Signed-off-by: John Crispin (transaction layer end-to-end CRC checking). --- a/include/linux/pci.h +++ b/include/linux/pci.h -@@ -1558,6 +1558,8 @@ void pci_walk_bus_locked(struct pci_bus +@@ -1599,6 +1599,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 +5535,7 @@ Signed-off-by: John Crispin unsigned long type); --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h -@@ -1097,6 +1097,12 @@ +@@ -1108,6 +1108,12 @@ #define PCI_DEVICE_ID_SGI_IOC3 0x0003 #define PCI_DEVICE_ID_SGI_LITHIUM 0x1002 diff --git a/target/linux/lantiq/patches-6.6/0004-MIPS-lantiq-add-atm-hack.patch b/target/linux/lantiq/patches-6.6/0004-MIPS-lantiq-add-atm-hack.patch index e32e4e2daa..2e36b41beb 100644 --- a/target/linux/lantiq/patches-6.6/0004-MIPS-lantiq-add-atm-hack.patch +++ b/target/linux/lantiq/patches-6.6/0004-MIPS-lantiq-add-atm-hack.patch @@ -424,7 +424,7 @@ Signed-off-by: John Crispin --- a/arch/mips/lantiq/irq.c +++ b/arch/mips/lantiq/irq.c @@ -13,6 +13,7 @@ - #include + #include #include #include +#include @@ -441,7 +441,7 @@ Signed-off-by: John Crispin { --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c -@@ -63,6 +63,10 @@ void (*_dma_cache_wback_inv)(unsigned lo +@@ -80,6 +80,10 @@ void (*_dma_cache_wback_inv)(unsigned lo void (*_dma_cache_wback)(unsigned long start, unsigned long size); void (*_dma_cache_inv)(unsigned long start, unsigned long size); diff --git a/target/linux/lantiq/patches-6.6/0018-MTD-nand-lots-of-xrx200-fixes.patch b/target/linux/lantiq/patches-6.6/0018-MTD-nand-lots-of-xrx200-fixes.patch index f420d8cde5..90af62364a 100644 --- a/target/linux/lantiq/patches-6.6/0018-MTD-nand-lots-of-xrx200-fixes.patch +++ b/target/linux/lantiq/patches-6.6/0018-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 -@@ -61,6 +61,24 @@ +@@ -62,6 +62,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; -@@ -92,10 +110,22 @@ static void xway_select_chip(struct nand +@@ -93,10 +111,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; -@@ -108,6 +138,11 @@ static void xway_cmd_ctrl(struct nand_ch +@@ -109,6 +139,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; -@@ -118,6 +153,24 @@ static void xway_cmd_ctrl(struct nand_ch +@@ -119,6 +154,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) -@@ -169,6 +222,7 @@ static int xway_nand_probe(struct platfo +@@ -170,6 +223,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), -@@ -204,6 +258,15 @@ static int xway_nand_probe(struct platfo +@@ -205,6 +259,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.6/0020-MTD-lantiq-handle-NO_XIP-on-cfi0001-flash.patch b/target/linux/lantiq/patches-6.6/0020-MTD-lantiq-handle-NO_XIP-on-cfi0001-flash.patch index c1fc59487a..ffd07b5f10 100644 --- a/target/linux/lantiq/patches-6.6/0020-MTD-lantiq-handle-NO_XIP-on-cfi0001-flash.patch +++ b/target/linux/lantiq/patches-6.6/0020-MTD-lantiq-handle-NO_XIP-on-cfi0001-flash.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/mtd/maps/lantiq-flash.c +++ b/drivers/mtd/maps/lantiq-flash.c -@@ -129,7 +129,11 @@ ltq_mtd_probe(struct platform_device *pd +@@ -127,7 +127,11 @@ ltq_mtd_probe(struct platform_device *pd if (!ltq_mtd->map) return -ENOMEM; @@ -21,5 +21,5 @@ Signed-off-by: John Crispin + ltq_mtd->map->phys = ltq_mtd->res->start; + ltq_mtd->res->start; ltq_mtd->map->size = resource_size(ltq_mtd->res); - ltq_mtd->map->virt = devm_ioremap_resource(&pdev->dev, ltq_mtd->res); - if (IS_ERR(ltq_mtd->map->virt)) + + ltq_mtd->map->name = ltq_map_name; diff --git a/target/linux/lantiq/patches-6.6/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch b/target/linux/lantiq/patches-6.6/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch index b5f79e95a8..e3b18be709 100644 --- a/target/linux/lantiq/patches-6.6/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch +++ b/target/linux/lantiq/patches-6.6/0031-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 -@@ -795,6 +795,16 @@ config I2C_MICROCHIP_CORE +@@ -817,6 +817,16 @@ config I2C_MICROCHIP_CORE This driver can also be built as a module. If so, the module will be called i2c-microchip-core. @@ -43,8 +43,8 @@ Signed-off-by: John Crispin obj-$(CONFIG_I2C_KEMPLD) += i2c-kempld.o +obj-$(CONFIG_I2C_LANTIQ) += i2c-lantiq.o obj-$(CONFIG_I2C_LPC2K) += i2c-lpc2k.o + obj-$(CONFIG_I2C_LS2X) += i2c-ls2x.o obj-$(CONFIG_I2C_MESON) += i2c-meson.o - obj-$(CONFIG_I2C_MICROCHIP_CORE) += i2c-microchip-corei2c.o --- /dev/null +++ b/drivers/i2c/busses/i2c-lantiq.c @@ -0,0 +1,747 @@ diff --git a/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch b/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch index aea5716596..b06c5ab47c 100644 --- a/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch +++ b/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch @@ -16,7 +16,7 @@ Signed-off-by: John Crispin --- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h +++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h -@@ -102,5 +102,8 @@ int xrx200_gphy_boot(struct device *dev, +@@ -99,5 +99,8 @@ extern __iomem void *ltq_cgu_membase; extern void ltq_pmu_enable(unsigned int module); extern void ltq_pmu_disable(unsigned int module); diff --git a/target/linux/lantiq/patches-6.6/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch b/target/linux/lantiq/patches-6.6/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch index a3bbda7c33..5099c0bb9e 100644 --- a/target/linux/lantiq/patches-6.6/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch +++ b/target/linux/lantiq/patches-6.6/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch @@ -23,8 +23,8 @@ Signed-off-by: Hauke Mehrtens --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c -@@ -115,7 +115,15 @@ static void dwc2_set_rk_params(struct dw - p->power_down = DWC2_POWER_DOWN_PARAM_NONE; +@@ -132,7 +132,15 @@ static void dwc2_set_rk_params(struct dw + p->hird_threshold_en = false; } -static void dwc2_set_ltq_params(struct dwc2_hsotg *hsotg) @@ -40,7 +40,7 @@ Signed-off-by: Hauke Mehrtens { struct dwc2_core_params *p = &hsotg->params; -@@ -124,12 +132,21 @@ static void dwc2_set_ltq_params(struct d +@@ -141,12 +149,21 @@ static void dwc2_set_ltq_params(struct d p->host_rx_fifo_size = 288; p->host_nperio_tx_fifo_size = 128; p->host_perio_tx_fifo_size = 96; @@ -64,7 +64,7 @@ Signed-off-by: Hauke Mehrtens static void dwc2_set_amlogic_params(struct dwc2_hsotg *hsotg) { struct dwc2_core_params *p = &hsotg->params; -@@ -241,8 +258,11 @@ const struct of_device_id dwc2_of_match_ +@@ -277,8 +294,11 @@ const struct of_device_id dwc2_of_match_ { .compatible = "ingenic,x1830-otg", .data = dwc2_set_x1600_params }, { .compatible = "ingenic,x2000-otg", .data = dwc2_set_x2000_params }, { .compatible = "rockchip,rk3066-usb", .data = dwc2_set_rk_params }, diff --git a/target/linux/lantiq/patches-6.6/0051-MIPS-lantiq-improve-USB-initialization.patch b/target/linux/lantiq/patches-6.6/0051-MIPS-lantiq-improve-USB-initialization.patch index dca9880e8f..29d696af27 100644 --- a/target/linux/lantiq/patches-6.6/0051-MIPS-lantiq-improve-USB-initialization.patch +++ b/target/linux/lantiq/patches-6.6/0051-MIPS-lantiq-improve-USB-initialization.patch @@ -15,7 +15,7 @@ Signed-off-by: Hauke Mehrtens --- a/arch/mips/lantiq/xway/sysctrl.c +++ b/arch/mips/lantiq/xway/sysctrl.c -@@ -248,6 +248,25 @@ static void pmu_disable(struct clk *clk) +@@ -247,6 +247,25 @@ static void pmu_disable(struct clk *clk) pr_warn("deactivating PMU module failed!"); } @@ -41,7 +41,7 @@ Signed-off-by: Hauke Mehrtens /* the pci enable helper */ static int pci_enable(struct clk *clk) { -@@ -589,4 +608,5 @@ void __init ltq_soc_init(void) +@@ -588,4 +607,5 @@ void __init ltq_soc_init(void) clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE); clkdev_add_pmu("1e100400.serial", NULL, 1, 0, PMU_ASC0); } diff --git a/target/linux/lantiq/patches-6.6/0152-lantiq-VPE.patch b/target/linux/lantiq/patches-6.6/0152-lantiq-VPE.patch index 51810fe924..e83094f28c 100644 --- a/target/linux/lantiq/patches-6.6/0152-lantiq-VPE.patch +++ b/target/linux/lantiq/patches-6.6/0152-lantiq-VPE.patch @@ -15,7 +15,7 @@ Signed-off-by: Stefan Koch --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2306,6 +2306,12 @@ config MIPS_VPE_LOADER +@@ -2259,6 +2259,12 @@ config MIPS_VPE_LOADER Includes a loader for loading an elf relocatable object onto another VPE and running it. @@ -25,7 +25,7 @@ Signed-off-by: Stefan Koch + help + IFX included extensions in APRP + - config MIPS_VPE_LOADER_CMP + config MIPS_VPE_LOADER_MT bool default "y" --- a/arch/mips/include/asm/mipsmtregs.h @@ -51,7 +51,7 @@ Signed-off-by: Stefan Koch #define read_vpe_c0_status() mftc0(12, 0) --- a/arch/mips/include/asm/vpe.h +++ b/arch/mips/include/asm/vpe.h -@@ -124,4 +124,13 @@ void cleanup_tc(struct tc *tc); +@@ -119,4 +119,13 @@ void cleanup_tc(struct tc *tc); int __init vpe_module_init(void); void __exit vpe_module_exit(void); @@ -67,7 +67,7 @@ Signed-off-by: Stefan Koch #endif /* _ASM_VPE_H */ --- a/arch/mips/kernel/vpe-mt.c +++ b/arch/mips/kernel/vpe-mt.c -@@ -416,6 +416,8 @@ int __init vpe_module_init(void) +@@ -414,6 +414,8 @@ int __init vpe_module_init(void) } v->ntcs = hw_tcs - aprp_cpu_index(); @@ -76,7 +76,7 @@ Signed-off-by: Stefan Koch /* add the tc to the list of this vpe's tc's. */ list_add(&t->tc, &v->tc); -@@ -519,3 +521,47 @@ void __exit vpe_module_exit(void) +@@ -517,3 +519,47 @@ void __exit vpe_module_exit(void) release_vpe(v); } } @@ -170,7 +170,7 @@ Signed-off-by: Stefan Koch { --- a/arch/mips/lantiq/prom.c +++ b/arch/mips/lantiq/prom.c -@@ -42,10 +42,14 @@ extern const struct plat_smp_ops vsmp_sm +@@ -36,10 +36,14 @@ extern const struct plat_smp_ops vsmp_sm static struct plat_smp_ops lantiq_smp_ops; #endif diff --git a/target/linux/lantiq/patches-6.6/0155-lantiq-VPE-nosmp.patch b/target/linux/lantiq/patches-6.6/0155-lantiq-VPE-nosmp.patch index 015acabcfe..6426ee717b 100644 --- a/target/linux/lantiq/patches-6.6/0155-lantiq-VPE-nosmp.patch +++ b/target/linux/lantiq/patches-6.6/0155-lantiq-VPE-nosmp.patch @@ -10,7 +10,7 @@ Signed-off-by: Stefan Koch --- a/arch/mips/kernel/vpe-mt.c +++ b/arch/mips/kernel/vpe-mt.c -@@ -131,7 +131,10 @@ int vpe_run(struct vpe *v) +@@ -130,7 +130,10 @@ int vpe_run(struct vpe *v) * kernels need to turn it on, even if that wasn't the pre-dvpe() state. */ #ifdef CONFIG_SMP diff --git a/target/linux/lantiq/patches-6.6/0160-owrt-lantiq-multiple-flash.patch b/target/linux/lantiq/patches-6.6/0160-owrt-lantiq-multiple-flash.patch index a83325c094..1556a32aa6 100644 --- a/target/linux/lantiq/patches-6.6/0160-owrt-lantiq-multiple-flash.patch +++ b/target/linux/lantiq/patches-6.6/0160-owrt-lantiq-multiple-flash.patch @@ -3,6 +3,8 @@ From: Maikel Bloemendal Date: Fri, 14 Nov 2014 17:06:00 +0000 Subject: [PATCH] owrt: lantiq: multiple flash +Concatenate multiple flash chips for lantiq-flash. + Signed-off-by: Maikel Bloemendal --- drivers/mtd/maps/lantiq-flash.c | 168 +++++++++++++++++++++----------- @@ -83,14 +85,40 @@ Signed-off-by: Maikel Bloemendal ltq_mtd = devm_kzalloc(&pdev->dev, sizeof(struct ltq_mtd), GFP_KERNEL); if (!ltq_mtd) -@@ -118,75 +154,89 @@ ltq_mtd_probe(struct platform_device *pd +@@ -118,70 +154,89 @@ ltq_mtd_probe(struct platform_device *pd platform_set_drvdata(pdev, ltq_mtd); -- ltq_mtd->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- if (!ltq_mtd->res) { -- dev_err(&pdev->dev, "failed to get memory resource\n"); -- return -ENOENT; +- ltq_mtd->map->virt = devm_platform_get_and_ioremap_resource(pdev, 0, <q_mtd->res); +- if (IS_ERR(ltq_mtd->map->virt)) +- return PTR_ERR(ltq_mtd->map->virt); +- +- ltq_mtd->map = devm_kzalloc(&pdev->dev, sizeof(struct map_info), +- GFP_KERNEL); +- if (!ltq_mtd->map) +- return -ENOMEM; +- +- if (of_find_property(pdev->dev.of_node, "lantiq,noxip", NULL)) +- ltq_mtd->map->phys = NO_XIP; +- else +- ltq_mtd->map->phys = ltq_mtd->res->start; +- ltq_mtd->res->start; +- ltq_mtd->map->size = resource_size(ltq_mtd->res); +- +- ltq_mtd->map->name = ltq_map_name; +- ltq_mtd->map->bankwidth = 2; +- ltq_mtd->map->read = ltq_read16; +- ltq_mtd->map->write = ltq_write16; +- ltq_mtd->map->copy_from = ltq_copy_from; +- ltq_mtd->map->copy_to = ltq_copy_to; +- +- ltq_mtd->map->map_priv_1 = LTQ_NOR_PROBING; +- ltq_mtd->mtd = do_map_probe("cfi_probe", ltq_mtd->map); +- ltq_mtd->map->map_priv_1 = LTQ_NOR_NORMAL; +- +- if (!ltq_mtd->mtd) { +- dev_err(&pdev->dev, "probing failed\n"); +- return -ENXIO; + for (i = 0; i < pdev->num_resources; i++) { + printk(KERN_NOTICE "lantiq nor flash device: %.8llx at %.8llx\n", + (unsigned long long)resource_size(&pdev->resource[i]), @@ -147,35 +175,8 @@ Signed-off-by: Maikel Bloemendal + cfi->addr_unlock2 ^= 1; } -- ltq_mtd->map = devm_kzalloc(&pdev->dev, sizeof(struct map_info), -- GFP_KERNEL); -- if (!ltq_mtd->map) -- return -ENOMEM; -- -- if (of_find_property(pdev->dev.of_node, "lantiq,noxip", NULL)) -- ltq_mtd->map->phys = NO_XIP; -- else -- ltq_mtd->map->phys = ltq_mtd->res->start; -- ltq_mtd->res->start; -- ltq_mtd->map->size = resource_size(ltq_mtd->res); -- ltq_mtd->map->virt = devm_ioremap_resource(&pdev->dev, ltq_mtd->res); -- if (IS_ERR(ltq_mtd->map->virt)) -- return PTR_ERR(ltq_mtd->map->virt); -- -- ltq_mtd->map->name = ltq_map_name; -- ltq_mtd->map->bankwidth = 2; -- ltq_mtd->map->read = ltq_read16; -- ltq_mtd->map->write = ltq_write16; -- ltq_mtd->map->copy_from = ltq_copy_from; -- ltq_mtd->map->copy_to = ltq_copy_to; -- -- ltq_mtd->map->map_priv_1 = LTQ_NOR_PROBING; -- ltq_mtd->mtd = do_map_probe("cfi_probe", ltq_mtd->map); -- ltq_mtd->map->map_priv_1 = LTQ_NOR_NORMAL; -- -- if (!ltq_mtd->mtd) { -- dev_err(&pdev->dev, "probing failed\n"); -- return -ENXIO; +- ltq_mtd->mtd->dev.parent = &pdev->dev; +- mtd_set_of_node(ltq_mtd->mtd, pdev->dev.of_node); + if (devices_found == 1) { + ltq_mtd->cmtd = ltq_mtd->mtd[0]; + } else if (devices_found > 1) { @@ -185,11 +186,8 @@ Signed-off-by: Maikel Bloemendal + ltq_mtd->cmtd = mtd_concat_create(ltq_mtd->mtd, devices_found, dev_name(&pdev->dev)); + if (ltq_mtd->cmtd == NULL) + err = -ENXIO; - } ++ } -- ltq_mtd->mtd->dev.parent = &pdev->dev; -- mtd_set_of_node(ltq_mtd->mtd, pdev->dev.of_node); -- - cfi = ltq_mtd->map->fldrv_priv; - cfi->addr_unlock1 ^= 1; - cfi->addr_unlock2 ^= 1; diff --git a/target/linux/lantiq/patches-6.6/0200-MIPS-lantiq-xway-vmmc-use-platform_get_irq-to-get-ir.patch b/target/linux/lantiq/patches-6.6/0200-MIPS-lantiq-xway-vmmc-use-platform_get_irq-to-get-ir.patch index f057ba324e..6db051b6a9 100644 --- a/target/linux/lantiq/patches-6.6/0200-MIPS-lantiq-xway-vmmc-use-platform_get_irq-to-get-ir.patch +++ b/target/linux/lantiq/patches-6.6/0200-MIPS-lantiq-xway-vmmc-use-platform_get_irq-to-get-ir.patch @@ -18,7 +18,7 @@ Signed-off-by: Martin Schiller --- a/arch/mips/lantiq/xway/vmmc.c +++ b/arch/mips/lantiq/xway/vmmc.c -@@ -14,6 +14,10 @@ +@@ -15,6 +15,10 @@ static unsigned int *cp1_base; @@ -29,7 +29,7 @@ Signed-off-by: Martin Schiller unsigned int *ltq_get_cp1_base(void) { if (!cp1_base) -@@ -23,6 +27,33 @@ unsigned int *ltq_get_cp1_base(void) +@@ -24,6 +28,33 @@ unsigned int *ltq_get_cp1_base(void) } EXPORT_SYMBOL(ltq_get_cp1_base); @@ -63,7 +63,7 @@ Signed-off-by: Martin Schiller static int vmmc_probe(struct platform_device *pdev) { #define CP1_SIZE (1 << 20) -@@ -30,11 +61,33 @@ static int vmmc_probe(struct platform_de +@@ -31,11 +62,33 @@ static int vmmc_probe(struct platform_de int gpio_count; dma_addr_t dma; int error; diff --git a/target/linux/lantiq/patches-6.6/0300-MTD-cfi-cmdset-0001-disable-buffered-writes.patch b/target/linux/lantiq/patches-6.6/0300-MTD-cfi-cmdset-0001-disable-buffered-writes.patch index f62d167078..7abe1fbbeb 100644 --- a/target/linux/lantiq/patches-6.6/0300-MTD-cfi-cmdset-0001-disable-buffered-writes.patch +++ b/target/linux/lantiq/patches-6.6/0300-MTD-cfi-cmdset-0001-disable-buffered-writes.patch @@ -10,7 +10,7 @@ Signed-off-by: Matti Laakso --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c -@@ -39,7 +39,7 @@ +@@ -40,7 +40,7 @@ /* #define CMDSET0001_DISABLE_WRITE_SUSPEND */ // debugging, turns off buffer write mode if set to 1 diff --git a/target/linux/lantiq/patches-6.6/0301-xrx200-add-gphy-clk-src-device-tree-binding.patch b/target/linux/lantiq/patches-6.6/0301-xrx200-add-gphy-clk-src-device-tree-binding.patch index e46790b2c3..459e415e1b 100644 --- a/target/linux/lantiq/patches-6.6/0301-xrx200-add-gphy-clk-src-device-tree-binding.patch +++ b/target/linux/lantiq/patches-6.6/0301-xrx200-add-gphy-clk-src-device-tree-binding.patch @@ -10,7 +10,7 @@ Signed-off-by: Mathias Kresin --- a/arch/mips/lantiq/xway/sysctrl.c +++ b/arch/mips/lantiq/xway/sysctrl.c -@@ -440,6 +440,20 @@ static void clkdev_add_clkout(void) +@@ -439,6 +439,20 @@ static void clkdev_add_clkout(void) } } @@ -31,7 +31,7 @@ Signed-off-by: Mathias Kresin /* bring up all register ranges that we need for basic system control */ void __init ltq_soc_init(void) { -@@ -609,4 +623,6 @@ void __init ltq_soc_init(void) +@@ -608,4 +622,6 @@ void __init ltq_soc_init(void) clkdev_add_pmu("1e100400.serial", NULL, 1, 0, PMU_ASC0); } usb_set_clock(); diff --git a/target/linux/lantiq/patches-6.6/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch b/target/linux/lantiq/patches-6.6/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch index c43d9d4b35..1eadb56dd8 100644 --- a/target/linux/lantiq/patches-6.6/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch +++ b/target/linux/lantiq/patches-6.6/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch @@ -17,7 +17,7 @@ Signed-off-by: Aleksander Jan Bajkowski --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c -@@ -61,8 +61,10 @@ +@@ -62,8 +62,10 @@ static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); @@ -28,7 +28,7 @@ Signed-off-by: Aleksander Jan Bajkowski static int cfi_intelext_erase_varsize(struct mtd_info *, struct erase_info *); static void cfi_intelext_sync (struct mtd_info *); static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len); -@@ -304,6 +306,7 @@ static void fixup_use_point(struct mtd_i +@@ -305,6 +307,7 @@ static void fixup_use_point(struct mtd_i } } @@ -36,7 +36,7 @@ Signed-off-by: Aleksander Jan Bajkowski static void fixup_use_write_buffers(struct mtd_info *mtd) { struct map_info *map = mtd->priv; -@@ -314,6 +317,7 @@ static void fixup_use_write_buffers(stru +@@ -315,6 +318,7 @@ static void fixup_use_write_buffers(stru mtd->_writev = cfi_intelext_writev; } } @@ -44,7 +44,7 @@ Signed-off-by: Aleksander Jan Bajkowski /* * Some chips power-up with all sectors locked by default. -@@ -1719,6 +1723,7 @@ static int cfi_intelext_write_words (str +@@ -1720,6 +1724,7 @@ static int cfi_intelext_write_words (str } @@ -52,7 +52,7 @@ Signed-off-by: Aleksander Jan Bajkowski static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, unsigned long adr, const struct kvec **pvec, unsigned long *pvec_seek, int len) -@@ -1947,6 +1952,7 @@ static int cfi_intelext_write_buffers (s +@@ -1948,6 +1953,7 @@ static int cfi_intelext_write_buffers (s return cfi_intelext_writev(mtd, &vec, 1, to, retlen); } diff --git a/target/linux/lantiq/patches-6.6/0400-mtd-rawnand-xway-don-t-yield-while-holding-spinlock.patch b/target/linux/lantiq/patches-6.6/0400-mtd-rawnand-xway-don-t-yield-while-holding-spinlock.patch index edf0626860..663b0dbfb3 100644 --- a/target/linux/lantiq/patches-6.6/0400-mtd-rawnand-xway-don-t-yield-while-holding-spinlock.patch +++ b/target/linux/lantiq/patches-6.6/0400-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 -@@ -175,7 +175,13 @@ static void xway_cmd_ctrl(struct nand_ch +@@ -176,7 +176,13 @@ static void xway_cmd_ctrl(struct nand_ch static int xway_dev_ready(struct nand_chip *chip) { diff --git a/target/linux/lantiq/xrx200/config-6.6 b/target/linux/lantiq/xrx200/config-6.6 index dc41fe0ca8..4819c962c8 100644 --- a/target/linux/lantiq/xrx200/config-6.6 +++ b/target/linux/lantiq/xrx200/config-6.6 @@ -47,6 +47,7 @@ CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_NEED_SRCU_NMI_SAFE=y CONFIG_NET_DEVLINK=y CONFIG_NET_DSA=y CONFIG_NET_DSA_LANTIQ_GSWIP=y diff --git a/target/linux/lantiq/xway/config-6.6 b/target/linux/lantiq/xway/config-6.6 index 1fc821575e..a51e0f9c2d 100644 --- a/target/linux/lantiq/xway/config-6.6 +++ b/target/linux/lantiq/xway/config-6.6 @@ -37,6 +37,7 @@ CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_NEED_SRCU_NMI_SAFE=y CONFIG_NET_FLOW_LIMIT=y CONFIG_NLS=y CONFIG_NR_CPUS=2