From: Robert Marko Date: Mon, 19 Feb 2024 20:32:06 +0000 (+0100) Subject: airoha: 6.1: make patches apply X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=0122eae6b8559007a391ef5ef1cf837fa1bfc2c6;p=openwrt%2Fstaging%2Fthess.git airoha: 6.1: make patches apply Drop upstreamed patches and refresh the left SPI controller patch. Signed-off-by: Robert Marko --- diff --git a/target/linux/airoha/patches-6.1/0001-add-airoha-platform.patch b/target/linux/airoha/patches-6.1/0001-add-airoha-platform.patch deleted file mode 100644 index 5b356ea23e..0000000000 --- a/target/linux/airoha/patches-6.1/0001-add-airoha-platform.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -572,6 +572,18 @@ config ARCH_VIRT - select HAVE_ARM_ARCH_TIMER - select ARCH_SUPPORTS_BIG_ENDIAN - -+config ARCH_AIROHA -+ bool "Airoha SoC Support" -+ depends on ARCH_MULTI_V7 -+ select ARM_AMBA -+ select ARM_GIC -+ select ARM_GIC_V3 -+ select ARM_PSCI -+ select HAVE_ARM_ARCH_TIMER -+ select COMMON_CLK -+ help -+ Support for Airoha EN7523 SoCs -+ - # - # This is sorted alphabetically by mach-* pathname. However, plat-* - # Kconfigs may be included either alphabetically (according to the ---- a/arch/arm/Makefile -+++ b/arch/arm/Makefile -@@ -156,6 +156,7 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x003080 - # Machine directory name. This list is sorted alphanumerically - # by CONFIG_* macro name. - machine-$(CONFIG_ARCH_ACTIONS) += actions -+machine-$(CONFIG_ARCH_AIROHA) += airoha - machine-$(CONFIG_ARCH_ALPINE) += alpine - machine-$(CONFIG_ARCH_ARTPEC) += artpec - machine-$(CONFIG_ARCH_ASPEED) += aspeed diff --git a/target/linux/airoha/patches-6.1/0002-add-airoha-en7523-clk-driver.patch b/target/linux/airoha/patches-6.1/0002-add-airoha-en7523-clk-driver.patch deleted file mode 100644 index bae5cacc5e..0000000000 --- a/target/linux/airoha/patches-6.1/0002-add-airoha-en7523-clk-driver.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/drivers/clk/Kconfig -+++ b/drivers/clk/Kconfig -@@ -192,6 +192,15 @@ config COMMON_CLK_CS2000_CP - help - If you say yes here you get support for the CS2000 clock multiplier. - -+config COMMON_CLK_EN7523 -+ bool "Clock driver for Airoha EN7523 SoC system clocks" -+ depends on OF -+ depends on ARCH_AIROHA || COMPILE_TEST -+ default ARCH_AIROHA -+ help -+ This driver provides the fixed clocks and gates present on Airoha -+ ARM silicon. -+ - config COMMON_CLK_FSL_FLEXSPI - tristate "Clock driver for FlexSPI on Layerscape SoCs" - depends on ARCH_LAYERSCAPE || COMPILE_TEST ---- a/drivers/clk/Makefile -+++ b/drivers/clk/Makefile -@@ -27,6 +27,7 @@ obj-$(CONFIG_COMMON_CLK_CDCE925) += clk- - obj-$(CONFIG_ARCH_CLPS711X) += clk-clps711x.o - obj-$(CONFIG_COMMON_CLK_CS2000_CP) += clk-cs2000-cp.o - obj-$(CONFIG_ARCH_SPARX5) += clk-sparx5.o -+obj-$(CONFIG_COMMON_CLK_EN7523) += clk-en7523.o - obj-$(CONFIG_COMMON_CLK_FIXED_MMIO) += clk-fixed-mmio.o - obj-$(CONFIG_COMMON_CLK_FSL_FLEXSPI) += clk-fsl-flexspi.o - obj-$(CONFIG_COMMON_CLK_FSL_SAI) += clk-fsl-sai.o diff --git a/target/linux/airoha/patches-6.1/0003-add-airoha-en7523-gpio-driver.patch b/target/linux/airoha/patches-6.1/0003-add-airoha-en7523-gpio-driver.patch deleted file mode 100644 index 319336257b..0000000000 --- a/target/linux/airoha/patches-6.1/0003-add-airoha-en7523-gpio-driver.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/drivers/gpio/Kconfig -+++ b/drivers/gpio/Kconfig -@@ -247,6 +247,16 @@ config GPIO_EM - help - Say yes here to support GPIO on Renesas Emma Mobile SoCs. - -+config GPIO_EN7523 -+ tristate "Airoha GPIO support" -+ depends on ARCH_AIROHA -+ default ARCH_AIROHA -+ select GPIO_GENERIC -+ select GPIOLIB_IRQCHIP -+ help -+ Say Y or M here to support the GPIO controller block on the -+ Airoha EN7523 SoC. It supports two banks of 32 GPIOs. -+ - config GPIO_EP93XX - def_bool y - depends on ARCH_EP93XX ---- a/drivers/gpio/Makefile -+++ b/drivers/gpio/Makefile -@@ -57,6 +57,7 @@ obj-$(CONFIG_GPIO_DLN2) += gpio-dln2.o - obj-$(CONFIG_GPIO_DWAPB) += gpio-dwapb.o - obj-$(CONFIG_GPIO_EIC_SPRD) += gpio-eic-sprd.o - obj-$(CONFIG_GPIO_EM) += gpio-em.o -+obj-$(CONFIG_GPIO_EN7523) += gpio-en7523.o - obj-$(CONFIG_GPIO_EP93XX) += gpio-ep93xx.o - obj-$(CONFIG_GPIO_EXAR) += gpio-exar.o - obj-$(CONFIG_GPIO_F7188X) += gpio-f7188x.o diff --git a/target/linux/airoha/patches-6.1/0004-ARM-9124-1-uncompress-Parse-linux-usable-memory-rang.patch b/target/linux/airoha/patches-6.1/0004-ARM-9124-1-uncompress-Parse-linux-usable-memory-rang.patch deleted file mode 100644 index 0f0cbaa10f..0000000000 --- a/target/linux/airoha/patches-6.1/0004-ARM-9124-1-uncompress-Parse-linux-usable-memory-rang.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 48342ae751c797ac73ac9c894b3f312df18ffd21 Mon Sep 17 00:00:00 2001 -From: Geert Uytterhoeven -Date: Wed, 15 Sep 2021 13:46:20 +0100 -Subject: [PATCH] ARM: 9124/1: uncompress: Parse "linux,usable-memory-range" DT - property - -Add support for parsing the "linux,usable-memory-range" DT property. -This property is used to describe the usable memory reserved for the -crash dump kernel, and thus makes the memory reservation explicit. -If present, Linux no longer needs to mask the program counter, and rely -on the "mem=" kernel parameter to obtain the start and size of usable -memory. - -For backwards compatibility, the traditional method to derive the start -of memory is still used if "linux,usable-memory-range" is absent. - -Signed-off-by: Geert Uytterhoeven -Signed-off-by: Russell King (Oracle) -Signed-off-by: Daniel Danzberger ---- - .../arm/boot/compressed/fdt_check_mem_start.c | 48 ++++++++++++++++--- - 1 file changed, 42 insertions(+), 6 deletions(-) - ---- a/arch/arm/boot/compressed/fdt_check_mem_start.c -+++ b/arch/arm/boot/compressed/fdt_check_mem_start.c -@@ -55,16 +55,17 @@ static uint64_t get_val(const fdt32_t *c - * DTB, and, if out-of-range, replace it by the real start address. - * To preserve backwards compatibility (systems reserving a block of memory - * at the start of physical memory, kdump, ...), the traditional method is -- * always used if it yields a valid address. -+ * used if it yields a valid address, unless the "linux,usable-memory-range" -+ * property is present. - * - * Return value: start address of physical memory to use - */ - uint32_t fdt_check_mem_start(uint32_t mem_start, const void *fdt) - { -- uint32_t addr_cells, size_cells, base; -+ uint32_t addr_cells, size_cells, usable_base, base; - uint32_t fdt_mem_start = 0xffffffff; -- const fdt32_t *reg, *endp; -- uint64_t size, end; -+ const fdt32_t *usable, *reg, *endp; -+ uint64_t size, usable_end, end; - const char *type; - int offset, len; - -@@ -80,6 +81,27 @@ uint32_t fdt_check_mem_start(uint32_t me - if (addr_cells > 2 || size_cells > 2) - return mem_start; - -+ /* -+ * Usable memory in case of a crash dump kernel -+ * This property describes a limitation: memory within this range is -+ * only valid when also described through another mechanism -+ */ -+ usable = get_prop(fdt, "/chosen", "linux,usable-memory-range", -+ (addr_cells + size_cells) * sizeof(fdt32_t)); -+ if (usable) { -+ size = get_val(usable + addr_cells, size_cells); -+ if (!size) -+ return mem_start; -+ -+ if (addr_cells > 1 && fdt32_ld(usable)) { -+ /* Outside 32-bit address space */ -+ return mem_start; -+ } -+ -+ usable_base = fdt32_ld(usable + addr_cells - 1); -+ usable_end = usable_base + size; -+ } -+ - /* Walk all memory nodes and regions */ - for (offset = fdt_next_node(fdt, -1, NULL); offset >= 0; - offset = fdt_next_node(fdt, offset, NULL)) { -@@ -107,7 +129,20 @@ uint32_t fdt_check_mem_start(uint32_t me - - base = fdt32_ld(reg + addr_cells - 1); - end = base + size; -- if (mem_start >= base && mem_start < end) { -+ if (usable) { -+ /* -+ * Clip to usable range, which takes precedence -+ * over mem_start -+ */ -+ if (base < usable_base) -+ base = usable_base; -+ -+ if (end > usable_end) -+ end = usable_end; -+ -+ if (end <= base) -+ continue; -+ } else if (mem_start >= base && mem_start < end) { - /* Calculated address is valid, use it */ - return mem_start; - } -@@ -123,7 +158,8 @@ uint32_t fdt_check_mem_start(uint32_t me - } - - /* -- * The calculated address is not usable. -+ * The calculated address is not usable, or was overridden by the -+ * "linux,usable-memory-range" property. - * Use the lowest usable physical memory address from the DTB instead, - * and make sure this is a multiple of 2 MiB for phys/virt patching. - */ diff --git a/target/linux/airoha/patches-6.1/0005-spi-Add-support-for-the-Airoha-EN7523-SoC-SPI-contro.patch b/target/linux/airoha/patches-6.1/0005-spi-Add-support-for-the-Airoha-EN7523-SoC-SPI-contro.patch index 6c21666ed1..dc28bd1df9 100644 --- a/target/linux/airoha/patches-6.1/0005-spi-Add-support-for-the-Airoha-EN7523-SoC-SPI-contro.patch +++ b/target/linux/airoha/patches-6.1/0005-spi-Add-support-for-the-Airoha-EN7523-SoC-SPI-contro.patch @@ -1,6 +1,6 @@ --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -307,6 +307,12 @@ config SPI_DLN2 +@@ -330,6 +330,12 @@ config SPI_DLN2 This driver can also be built as a module. If so, the module will be called spi-dln2. @@ -15,7 +15,7 @@ depends on ARCH_EP93XX || COMPILE_TEST --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile -@@ -45,6 +45,7 @@ obj-$(CONFIG_SPI_DW_BT1) += spi-dw-bt1. +@@ -47,6 +47,7 @@ obj-$(CONFIG_SPI_DW_BT1) += spi-dw-bt1. obj-$(CONFIG_SPI_DW_MMIO) += spi-dw-mmio.o obj-$(CONFIG_SPI_DW_PCI) += spi-dw-pci.o obj-$(CONFIG_SPI_EP93XX) += spi-ep93xx.o diff --git a/target/linux/airoha/patches-6.1/0006-PCI-mediatek-Allow-building-for-ARCH_AIROHA.patch b/target/linux/airoha/patches-6.1/0006-PCI-mediatek-Allow-building-for-ARCH_AIROHA.patch deleted file mode 100644 index 4659809074..0000000000 --- a/target/linux/airoha/patches-6.1/0006-PCI-mediatek-Allow-building-for-ARCH_AIROHA.patch +++ /dev/null @@ -1,31 +0,0 @@ -From b3b76fc86f0fb4d98918f48c784138bfa950dff6 Mon Sep 17 00:00:00 2001 -From: Felix Fietkau -Date: Wed, 15 Jun 2022 14:53:34 +0200 -Subject: [PATCH] PCI: mediatek: Allow building for ARCH_AIROHA - -Allow selecting the pcie-mediatek driver if ARCH_AIROHA is set, because the -Airoha EN7523 SoC uses the same controller as MT7622. - -The driver itself is not modified. The PCIe controller DT node should use -mediatek,mt7622-pcie after airoha,en7523-pcie. - -Link: https://lore.kernel.org/r/20220615125335.96089-2-nbd@nbd.name -Signed-off-by: Felix Fietkau -Signed-off-by: Bjorn Helgaas -Acked-by: Lorenzo Pieralisi -Signed-off-by: Daniel Danzberger ---- - drivers/pci/controller/Kconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/pci/controller/Kconfig -+++ b/drivers/pci/controller/Kconfig -@@ -233,7 +233,7 @@ config PCIE_ROCKCHIP_EP - - config PCIE_MEDIATEK - tristate "MediaTek PCIe controller" -- depends on ARCH_MEDIATEK || COMPILE_TEST -+ depends on ARCH_AIROHA || ARCH_MEDIATEK || COMPILE_TEST - depends on OF - depends on PCI_MSI_IRQ_DOMAIN - help