From 8d0c2546519561aa538004da882304c1cd758cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 16 Mar 2023 19:16:11 +0100 Subject: [PATCH 01/44] bmips: update patches sent upstream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update bmips patches with the latest version sent upstream Signed-off-by: Álvaro Fernández Rojas --- ...isable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch | 44 +++++++++++-------- ...1-net-dsa-b53-mmap-fix-enabled_ports.patch | 18 +++++++- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/target/linux/bmips/patches-5.15/202-mips-bmips-BCM6358-disable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch b/target/linux/bmips/patches-5.15/202-mips-bmips-BCM6358-disable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch index 0ed2353a505..3c5501209bd 100644 --- a/target/linux/bmips/patches-5.15/202-mips-bmips-BCM6358-disable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch +++ b/target/linux/bmips/patches-5.15/202-mips-bmips-BCM6358-disable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch @@ -1,12 +1,13 @@ -From 84c06b4a1dfa3e021fdbcafaff8cebfdec462402 Mon Sep 17 00:00:00 2001 +From f48c93e4c4b5dbad1c0fbd623fd68f55f1667527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Tue, 23 Feb 2021 10:39:48 +0100 -Subject: [PATCH] mips: bmips: BCM6358: disable ARCH_HAS_SYNC_DMA_FOR_CPU_ALL +Date: Fri, 10 Mar 2023 13:05:10 +0100 +Subject: [PATCH] mips: bmips: BCM6358: disable arch_sync_dma_for_cpu_all() for + TP1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Enabling this option causes kernel panics on BCM6358 with EHCI/OHCI: +arch_sync_dma_for_cpu_all() causes kernel panics on BCM6358 with EHCI/OHCI: [ 3.881739] usb 1-1: new high-speed USB device number 2 using ehci-platform [ 3.895011] Reserved instruction in kernel code[#1]: [ 3.900113] CPU: 0 PID: 1 Comm: init Not tainted 5.10.16 #0 @@ -45,27 +46,28 @@ Enabling this option causes kernel panics on BCM6358 with EHCI/OHCI: [ 4.087374] Kernel panic - not syncing: Fatal exception [ 4.092753] Rebooting in 1 seconds.. +This only happens when booting from TP1 instead of TP0. + Signed-off-by: Álvaro Fernández Rojas --- - arch/mips/bmips/dma.c - arch/mips/bmips/setup.c + arch/mips/bmips/dma.c | 5 +++++ + arch/mips/bmips/setup.c | 9 +++++++++ + 2 files changed, 14 insertions(+) --- a/arch/mips/bmips/dma.c +++ b/arch/mips/bmips/dma.c -@@ -19,6 +19,8 @@ - #include - #include +@@ -64,11 +64,16 @@ phys_addr_t dma_to_phys(struct device *d + return dma_addr; + } -+int bmips_dma_sync_enabled = 1; ++int bmips_dma_sync_disable = 0; + - /* - * BCM338x has configurable address translation windows which allow the - * peripherals' DMA addresses to be different from the Zephyr-visible -@@ -69,6 +71,9 @@ void arch_sync_dma_for_cpu_all(void) + void arch_sync_dma_for_cpu_all(void) + { void __iomem *cbr = BMIPS_GET_CBR(); u32 cfg; -+ if (!bmips_dma_sync_enabled) ++ if (bmips_dma_sync_disable) + return; + if (boot_cpu_type() != CPU_BMIPS3300 && @@ -77,18 +79,22 @@ Signed-off-by: Álvaro Fernández Rojas #define DDR_CSEND_REG 0x8 -+extern int bmips_dma_sync_enabled; ++extern int bmips_dma_sync_disable; + static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000; struct bmips_cpufreq { -@@ -168,6 +170,9 @@ static void bcm6358_quirks(void) +@@ -168,6 +170,13 @@ static void bcm6358_quirks(void) * disable SMP for now */ bmips_smp_enabled = 0; + -+ /* ARCH_HAS_SYNC_DMA_FOR_CPU_ALL causes kernel panics on BCM6358 */ -+ bmips_dma_sync_enabled = 0; ++ /* ++ * ARCH_HAS_SYNC_DMA_FOR_CPU_ALL causes kernel panics on BCM6358 when ++ * booting from TP1 ++ */ ++ if (read_c0_brcm_cmt_local() & (1 << 31)) ++ bmips_dma_sync_disable = 1; } static void bcm6368_quirks(void) diff --git a/target/linux/bmips/patches-5.15/501-net-dsa-b53-mmap-fix-enabled_ports.patch b/target/linux/bmips/patches-5.15/501-net-dsa-b53-mmap-fix-enabled_ports.patch index 7d1fb7105d5..375f391ba88 100644 --- a/target/linux/bmips/patches-5.15/501-net-dsa-b53-mmap-fix-enabled_ports.patch +++ b/target/linux/bmips/patches-5.15/501-net-dsa-b53-mmap-fix-enabled_ports.patch @@ -1,3 +1,19 @@ +From dadd7a1aa1eaebd5a03dee933c9051eae3724f00 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Thu, 9 Mar 2023 19:18:07 +0100 +Subject: [PATCH] net: dsa: b53: mmap: fix device tree support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +CPU port should also be enabled in order to get a working switch. + +Fixes: a5538a777b73 ("net: dsa: b53: mmap: Add device tree support") +Signed-off-by: Álvaro Fernández Rojas +--- + drivers/net/dsa/b53/b53_mmap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + --- a/drivers/net/dsa/b53/b53_mmap.c +++ b/drivers/net/dsa/b53/b53_mmap.c @@ -263,7 +263,7 @@ static int b53_mmap_probe_of(struct plat @@ -5,7 +21,7 @@ continue; - if (reg < B53_CPU_PORT) -+ if (reg <= B53_CPU_PORT) ++ if (reg < B53_N_PORTS) pdata->enabled_ports |= BIT(reg); } From 9fc98b19566e4fca563b516790c0ac251a1dde52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 16 Mar 2023 19:20:23 +0100 Subject: [PATCH 02/44] bmips: irq-bcm6345-l1: register memory region MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add new patch sent upstream for requesting the memory region in the bcm6345-l1 interrupt controller. Signed-off-by: Álvaro Fernández Rojas --- ...ip-bcm-6345-l1-request-memory-region.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 target/linux/bmips/patches-5.15/210-irqchip-bcm-6345-l1-request-memory-region.patch diff --git a/target/linux/bmips/patches-5.15/210-irqchip-bcm-6345-l1-request-memory-region.patch b/target/linux/bmips/patches-5.15/210-irqchip-bcm-6345-l1-request-memory-region.patch new file mode 100644 index 00000000000..7db38f294fe --- /dev/null +++ b/target/linux/bmips/patches-5.15/210-irqchip-bcm-6345-l1-request-memory-region.patch @@ -0,0 +1,38 @@ +From b5c07b7bceed9287647697408423acd08f97db73 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Thu, 16 Mar 2023 18:42:41 +0100 +Subject: [PATCH] irqchip/bcm-6345-l1: request memory region +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Request memory region in order to display it in /proc/iomem. +Also stop printing the MMIO address since it just displays (ptrval). + +Signed-off-by: Álvaro Fernández Rojas +--- + drivers/irqchip/irq-bcm6345-l1.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/irqchip/irq-bcm6345-l1.c ++++ b/drivers/irqchip/irq-bcm6345-l1.c +@@ -261,6 +261,9 @@ static int __init bcm6345_l1_init_one(st + if (!cpu->map_base) + return -ENOMEM; + ++ if (!request_mem_region(res.start, sz, res.name)) ++ pr_err("Failed to request intc memory"); ++ + for (i = 0; i < n_words; i++) { + cpu->enable_cache[i] = 0; + __raw_writel(0, cpu->map_base + reg_enable(intc, i)); +@@ -339,8 +342,7 @@ static int __init bcm6345_l1_of_init(str + for_each_cpu(idx, &intc->cpumask) { + struct bcm6345_l1_cpu *cpu = intc->cpus[idx]; + +- pr_info(" CPU%u at MMIO 0x%p (irq = %d)\n", idx, +- cpu->map_base, cpu->parent_irq); ++ pr_info(" CPU%u (irq = %d)\n", idx, cpu->parent_irq); + } + + return 0; From c2836c4d27401102db1f89b02f5009ee8a430c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 16 Mar 2023 19:38:31 +0100 Subject: [PATCH 03/44] bmips: tweak Kconfig options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add patch to reduce and improve selected bmips kernel config options. Signed-off-by: Álvaro Fernández Rojas --- target/linux/bmips/config-5.15 | 15 ++----- ...220-mips-bmips-tweak-Kconfig-options.patch | 42 +++++++++++++++++++ .../600-mips-bmips-add-pci-support.patch | 8 ++-- 3 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 target/linux/bmips/patches-5.15/220-mips-bmips-tweak-Kconfig-options.patch diff --git a/target/linux/bmips/config-5.15 b/target/linux/bmips/config-5.15 index a66443eabad..f1d7752bd86 100644 --- a/target/linux/bmips/config-5.15 +++ b/target/linux/bmips/config-5.15 @@ -12,9 +12,7 @@ CONFIG_BCM6345_EXT_IRQ=y CONFIG_BCM6345_L1_IRQ=y CONFIG_BCM6368_ENETSW=y CONFIG_BCM63XX_POWER=y -CONFIG_BCM7038_L1_IRQ=y CONFIG_BCM7038_WDT=y -CONFIG_BCM7120_L2_IRQ=y CONFIG_BCMA=y CONFIG_BCMA_BLOCKIO=y # CONFIG_BCMA_DEBUG is not set @@ -28,8 +26,6 @@ CONFIG_BCMA_HOST_PCI_POSSIBLE=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y CONFIG_BMIPS_GENERIC=y -CONFIG_BOARD_SCACHE=y -CONFIG_BRCMSTB_L2_IRQ=y CONFIG_CEVT_R4K=y CONFIG_CLK_BCM63268_TIMER=y CONFIG_CLK_BCM_63XX_GATE=y @@ -41,7 +37,6 @@ CONFIG_CPU_BMIPS=y CONFIG_CPU_BMIPS32_3300=y CONFIG_CPU_BMIPS4350=y CONFIG_CPU_BMIPS4380=y -CONFIG_CPU_BMIPS5000=y CONFIG_CPU_GENERIC_DUMP_TLB=y CONFIG_CPU_HAS_PREFETCH=y CONFIG_CPU_HAS_RIXI=y @@ -56,7 +51,6 @@ CONFIG_CPU_SUPPORTS_CPUFREQ=y CONFIG_CPU_SUPPORTS_HIGHMEM=y CONFIG_CRASH_DUMP=y CONFIG_CRC16=y -CONFIG_CRYPTO_BLAKE2S=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2 @@ -151,12 +145,11 @@ CONFIG_MIPS_ASID_SHIFT=0 CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set CONFIG_MIPS_CMDLINE_FROM_DTB=y -CONFIG_MIPS_CPU_SCACHE=y CONFIG_MIPS_EBPF_JIT=y CONFIG_MIPS_EXTERNAL_TIMER=y -CONFIG_MIPS_L1_CACHE_SHIFT=7 +CONFIG_MIPS_L1_CACHE_SHIFT=6 +CONFIG_MIPS_L1_CACHE_SHIFT_4=y CONFIG_MIPS_L1_CACHE_SHIFT_6=y -CONFIG_MIPS_L1_CACHE_SHIFT_7=y CONFIG_MIPS_LD_CAN_LINK_VDSO=y # CONFIG_MIPS_NO_APPENDED_DTB is not set CONFIG_MIPS_NR_CPU_NR_MAP=2 @@ -196,6 +189,7 @@ CONFIG_OF_IRQ=y CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y CONFIG_PADATA=y +CONFIG_PAHOLE_VERSION=0 CONFIG_PCI=y CONFIG_PCIEPORTBUS=y CONFIG_PCIE_BCM6318=y @@ -271,13 +265,10 @@ CONFIG_SYS_HAS_CPU_BMIPS=y CONFIG_SYS_HAS_CPU_BMIPS32_3300=y CONFIG_SYS_HAS_CPU_BMIPS4350=y CONFIG_SYS_HAS_CPU_BMIPS4380=y -CONFIG_SYS_HAS_CPU_BMIPS5000=y CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y CONFIG_SYS_SUPPORTS_ARBIT_HZ=y CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y -CONFIG_SYS_SUPPORTS_HIGHMEM=y CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y -CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y CONFIG_SYS_SUPPORTS_SMP=y CONFIG_TARGET_ISA_REV=0 CONFIG_TICK_CPU_ACCOUNTING=y diff --git a/target/linux/bmips/patches-5.15/220-mips-bmips-tweak-Kconfig-options.patch b/target/linux/bmips/patches-5.15/220-mips-bmips-tweak-Kconfig-options.patch new file mode 100644 index 00000000000..83684fc1b79 --- /dev/null +++ b/target/linux/bmips/patches-5.15/220-mips-bmips-tweak-Kconfig-options.patch @@ -0,0 +1,42 @@ +From 20a4b57c0fafd23ae0f6bcab5b5adf4af4c80280 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Thu, 16 Mar 2023 19:31:21 +0100 +Subject: [PATCH] mips: bmips: tweak Kconfig options +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Álvaro Fernández Rojas +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -274,25 +274,20 @@ config BMIPS_GENERIC + select SYNC_R4K + select COMMON_CLK + select BCM6345_L1_IRQ +- select BCM7038_L1_IRQ +- select BCM7120_L2_IRQ +- select BRCMSTB_L2_IRQ + select IRQ_MIPS_CPU + select DMA_NONCOHERENT + select SYS_SUPPORTS_32BIT_KERNEL +- select SYS_SUPPORTS_LITTLE_ENDIAN + select SYS_SUPPORTS_BIG_ENDIAN +- select SYS_SUPPORTS_HIGHMEM + select SYS_HAS_CPU_BMIPS32_3300 + select SYS_HAS_CPU_BMIPS4350 + select SYS_HAS_CPU_BMIPS4380 +- select SYS_HAS_CPU_BMIPS5000 + select SWAP_IO_SPACE + select USB_EHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN + select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN + select USB_OHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN + select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN + select HARDIRQS_SW_RESEND ++ select MIPS_L1_CACHE_SHIFT_4 + help + Build a generic DT-based kernel image that boots on select + BCM33xx cable modem chips, BCM63xx DSL chips, and BCM7xxx set-top diff --git a/target/linux/bmips/patches-5.15/600-mips-bmips-add-pci-support.patch b/target/linux/bmips/patches-5.15/600-mips-bmips-add-pci-support.patch index b10dd8d4329..0d0967fa97e 100644 --- a/target/linux/bmips/patches-5.15/600-mips-bmips-add-pci-support.patch +++ b/target/linux/bmips/patches-5.15/600-mips-bmips-add-pci-support.patch @@ -1,9 +1,9 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -277,6 +277,7 @@ config BMIPS_GENERIC - select BCM7038_L1_IRQ - select BCM7120_L2_IRQ - select BRCMSTB_L2_IRQ +@@ -274,6 +274,7 @@ config BMIPS_GENERIC + select SYNC_R4K + select COMMON_CLK + select BCM6345_L1_IRQ + select HAVE_PCI select IRQ_MIPS_CPU select DMA_NONCOHERENT From ffaabee9b8d9da7c15a50f52897ae5f70b40b4e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 16 Mar 2023 20:28:47 +0100 Subject: [PATCH 04/44] bcm4908: backport v6.4 pending DTS changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki --- ...Update-cache-properties-for-broadcom.patch | 134 +++++++ ...adcom-bcmbca-Add-spi-controller-node.patch | 367 ++++++++++++++++++ ...om-bcmbca-bcm4908-fix-NAND-interrupt.patch | 33 ++ ...com-bcmbca-bcm4908-fix-LED-nodenames.patch | 66 ++++ ...om-bcmbca-bcm4908-fix-procmon-nodena.patch | 30 ++ ...om-bcmbca-bcm4908-add-on-SoC-USB-por.patch | 81 ++++ ...om-bcmbca-bcm4908-add-Netgear-R8000P.patch | 38 ++ ...om-bcmbca-bcm4908-add-TP-Link-C2300-.patch | 41 ++ ...om-bcmbca-bcm4908-limit-amount-of-GP.patch | 2 +- ...Update-cache-properties-for-broadcom.patch | 134 +++++++ ...adcom-bcmbca-Add-spi-controller-node.patch | 367 ++++++++++++++++++ ...om-bcmbca-bcm4908-fix-NAND-interrupt.patch | 33 ++ ...com-bcmbca-bcm4908-fix-LED-nodenames.patch | 66 ++++ ...om-bcmbca-bcm4908-fix-procmon-nodena.patch | 30 ++ ...om-bcmbca-bcm4908-add-on-SoC-USB-por.patch | 81 ++++ ...om-bcmbca-bcm4908-add-Netgear-R8000P.patch | 38 ++ ...om-bcmbca-bcm4908-add-TP-Link-C2300-.patch | 41 ++ ...om-bcmbca-bcm4908-limit-amount-of-GP.patch | 2 +- 18 files changed, 1582 insertions(+), 2 deletions(-) create mode 100644 target/linux/bcm4908/patches-5.10/039-v6.2-0003-arm64-dts-Update-cache-properties-for-broadcom.patch create mode 100644 target/linux/bcm4908/patches-5.10/040-v6.4-0001-arm64-dts-broadcom-bcmbca-Add-spi-controller-node.patch create mode 100644 target/linux/bcm4908/patches-5.10/040-v6.4-0002-arm64-dts-broadcom-bcmbca-bcm4908-fix-NAND-interrupt.patch create mode 100644 target/linux/bcm4908/patches-5.10/040-v6.4-0003-arm64-dts-broadcom-bcmbca-bcm4908-fix-LED-nodenames.patch create mode 100644 target/linux/bcm4908/patches-5.10/040-v6.4-0004-arm64-dts-broadcom-bcmbca-bcm4908-fix-procmon-nodena.patch create mode 100644 target/linux/bcm4908/patches-5.10/040-v6.4-0005-arm64-dts-broadcom-bcmbca-bcm4908-add-on-SoC-USB-por.patch create mode 100644 target/linux/bcm4908/patches-5.10/040-v6.4-0006-arm64-dts-broadcom-bcmbca-bcm4908-add-Netgear-R8000P.patch create mode 100644 target/linux/bcm4908/patches-5.10/040-v6.4-0007-arm64-dts-broadcom-bcmbca-bcm4908-add-TP-Link-C2300-.patch create mode 100644 target/linux/bcm4908/patches-5.15/035-v6.2-0003-arm64-dts-Update-cache-properties-for-broadcom.patch create mode 100644 target/linux/bcm4908/patches-5.15/036-v6.4-0001-arm64-dts-broadcom-bcmbca-Add-spi-controller-node.patch create mode 100644 target/linux/bcm4908/patches-5.15/036-v6.4-0002-arm64-dts-broadcom-bcmbca-bcm4908-fix-NAND-interrupt.patch create mode 100644 target/linux/bcm4908/patches-5.15/036-v6.4-0003-arm64-dts-broadcom-bcmbca-bcm4908-fix-LED-nodenames.patch create mode 100644 target/linux/bcm4908/patches-5.15/036-v6.4-0004-arm64-dts-broadcom-bcmbca-bcm4908-fix-procmon-nodena.patch create mode 100644 target/linux/bcm4908/patches-5.15/036-v6.4-0005-arm64-dts-broadcom-bcmbca-bcm4908-add-on-SoC-USB-por.patch create mode 100644 target/linux/bcm4908/patches-5.15/036-v6.4-0006-arm64-dts-broadcom-bcmbca-bcm4908-add-Netgear-R8000P.patch create mode 100644 target/linux/bcm4908/patches-5.15/036-v6.4-0007-arm64-dts-broadcom-bcmbca-bcm4908-add-TP-Link-C2300-.patch diff --git a/target/linux/bcm4908/patches-5.10/039-v6.2-0003-arm64-dts-Update-cache-properties-for-broadcom.patch b/target/linux/bcm4908/patches-5.10/039-v6.2-0003-arm64-dts-Update-cache-properties-for-broadcom.patch new file mode 100644 index 00000000000..a19ab8cf8fd --- /dev/null +++ b/target/linux/bcm4908/patches-5.10/039-v6.2-0003-arm64-dts-Update-cache-properties-for-broadcom.patch @@ -0,0 +1,134 @@ +From e567e58d6819adc002c57b81e16b88da24d3b4aa Mon Sep 17 00:00:00 2001 +From: Pierre Gondois +Date: Tue, 22 Nov 2022 17:32:07 +0100 +Subject: [PATCH] arm64: dts: Update cache properties for broadcom + +The DeviceTree Specification v0.3 specifies that the cache node +'compatible' and 'cache-level' properties are 'required'. Cf. +s3.8 Multi-level and Shared Cache Nodes +The 'cache-unified' property should be present if one of the +properties for unified cache is present ('cache-size', ...). + +Update the Device Trees accordingly. + +Acked-by: William Zhang +Signed-off-by: Pierre Gondois +Link: https://lore.kernel.org/r/20221122163208.3810985-3-pierre.gondois@arm.com +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi | 1 + + arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi | 1 + + arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi | 4 ++++ + 9 files changed, 12 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -63,6 +63,7 @@ + + l2: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi +@@ -51,6 +51,7 @@ + + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi +@@ -35,6 +35,7 @@ + + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi +@@ -51,6 +51,7 @@ + + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi +@@ -51,6 +51,7 @@ + + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi +@@ -35,6 +35,7 @@ + + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi +@@ -50,6 +50,7 @@ + }; + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi ++++ b/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi +@@ -79,6 +79,7 @@ + + CLUSTER0_L2: l2-cache@0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi ++++ b/arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi +@@ -108,18 +108,22 @@ + + CLUSTER0_L2: l2-cache@0 { + compatible = "cache"; ++ cache-level = <2>; + }; + + CLUSTER1_L2: l2-cache@100 { + compatible = "cache"; ++ cache-level = <2>; + }; + + CLUSTER2_L2: l2-cache@200 { + compatible = "cache"; ++ cache-level = <2>; + }; + + CLUSTER3_L2: l2-cache@300 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + diff --git a/target/linux/bcm4908/patches-5.10/040-v6.4-0001-arm64-dts-broadcom-bcmbca-Add-spi-controller-node.patch b/target/linux/bcm4908/patches-5.10/040-v6.4-0001-arm64-dts-broadcom-bcmbca-Add-spi-controller-node.patch new file mode 100644 index 00000000000..e8e12281793 --- /dev/null +++ b/target/linux/bcm4908/patches-5.10/040-v6.4-0001-arm64-dts-broadcom-bcmbca-Add-spi-controller-node.patch @@ -0,0 +1,367 @@ +From f5d83b714e304d5f3229da434af2eeea033c4f5d Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Mon, 6 Feb 2023 22:58:15 -0800 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: Add spi controller node + +Add support for HSSPI controller in ARMv8 chip dts files. + +Signed-off-by: William Zhang +Link: https://lore.kernel.org/r/20230207065826.285013-5-william.zhang@broadcom.com +Signed-off-by: Florian Fainelli +--- + .../boot/dts/broadcom/bcmbca/bcm4908.dtsi | 18 +++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm4912.dtsi | 20 +++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm63146.dtsi | 19 ++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm63158.dtsi | 19 ++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm6813.dtsi | 20 +++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm6856.dtsi | 18 +++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm6858.dtsi | 18 +++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm94908.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm94912.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm963146.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm963158.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm96813.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm96856.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm96858.dts | 4 ++++ + 14 files changed, 160 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -107,6 +107,12 @@ + clock-frequency = <50000000>; + clock-output-names = "periph"; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <400000000>; ++ }; + }; + + soc { +@@ -531,6 +537,18 @@ + #size-cells = <0>; + }; + ++ hsspi: spi@1000{ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm4908-hsspi", "brcm,bcmbca-hsspi-v1.0"; ++ reg = <0x1000 0x600>; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; ++ + nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi +@@ -79,6 +79,7 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ + uart_clk: uart-clk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; +@@ -86,6 +87,12 @@ + clock-div = <4>; + clock-mult = <1>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; + }; + + psci { +@@ -117,6 +124,19 @@ + #size-cells = <1>; + ranges = <0x0 0x0 0xff800000 0x800000>; + ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm4912-hsspi", "brcm,bcmbca-hsspi-v1.1"; ++ reg = <0x1000 0x600>, <0x2610 0x4>; ++ reg-names = "hsspi", "spim-ctrl"; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; ++ + uart0: serial@12000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x12000 0x1000>; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi +@@ -60,6 +60,7 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ + uart_clk: uart-clk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; +@@ -67,6 +68,12 @@ + clock-div = <4>; + clock-mult = <1>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; + }; + + psci { +@@ -99,6 +106,18 @@ + #size-cells = <1>; + ranges = <0x0 0x0 0xff800000 0x800000>; + ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm63146-hsspi", "brcm,bcmbca-hsspi-v1.0"; ++ reg = <0x1000 0x600>; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; ++ + uart0: serial@12000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x12000 0x1000>; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi +@@ -79,6 +79,7 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ + uart_clk: uart-clk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; +@@ -86,6 +87,12 @@ + clock-div = <4>; + clock-mult = <1>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <400000000>; ++ }; + }; + + psci { +@@ -117,6 +124,18 @@ + #size-cells = <1>; + ranges = <0x0 0x0 0xff800000 0x800000>; + ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm63158-hsspi", "brcm,bcmbca-hsspi-v1.0"; ++ reg = <0x1000 0x600>; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; ++ + uart0: serial@12000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x12000 0x1000>; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi +@@ -79,6 +79,7 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ + uart_clk: uart-clk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; +@@ -86,6 +87,12 @@ + clock-div = <4>; + clock-mult = <1>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; + }; + + psci { +@@ -117,6 +124,19 @@ + #size-cells = <1>; + ranges = <0x0 0x0 0xff800000 0x800000>; + ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm6813-hsspi", "brcm,bcmbca-hsspi-v1.1"; ++ reg = <0x1000 0x600>, <0x2610 0x4>; ++ reg-names = "hsspi", "spim-ctrl"; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; ++ + uart0: serial@12000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x12000 0x1000>; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi +@@ -60,6 +60,12 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <400000000>; ++ }; + }; + + psci { +@@ -100,5 +106,17 @@ + clock-names = "refclk"; + status = "disabled"; + }; ++ ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm6856-hsspi", "brcm,bcmbca-hsspi-v1.0"; ++ reg = <0x1000 0x600>; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi +@@ -78,6 +78,12 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <400000000>; ++ }; + }; + + psci { +@@ -137,5 +143,17 @@ + clock-names = "refclk"; + status = "disabled"; + }; ++ ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm6858-hsspi", "brcm,bcmbca-hsspi-v1.0"; ++ reg = <0x1000 0x600>; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; diff --git a/target/linux/bcm4908/patches-5.10/040-v6.4-0002-arm64-dts-broadcom-bcmbca-bcm4908-fix-NAND-interrupt.patch b/target/linux/bcm4908/patches-5.10/040-v6.4-0002-arm64-dts-broadcom-bcmbca-bcm4908-fix-NAND-interrupt.patch new file mode 100644 index 00000000000..b121200a256 --- /dev/null +++ b/target/linux/bcm4908/patches-5.10/040-v6.4-0002-arm64-dts-broadcom-bcmbca-bcm4908-fix-NAND-interrupt.patch @@ -0,0 +1,33 @@ +From 5cca02449490e767289bda38db1577e2c375c084 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:43:58 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: fix NAND interrupt + name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes: +arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: nand-controller@1800: interrupt-names:0: 'nand_ctlrdy' was expected + From schema: Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml +arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: nand-controller@1800: Unevaluated properties are not allowed ('interrupt-names' was unexpected) + From schema: Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144400.21689-1-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -556,7 +556,7 @@ + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + interrupts = ; +- interrupt-names = "nand"; ++ interrupt-names = "nand_ctlrdy"; + status = "okay"; + + nandcs: nand@0 { diff --git a/target/linux/bcm4908/patches-5.10/040-v6.4-0003-arm64-dts-broadcom-bcmbca-bcm4908-fix-LED-nodenames.patch b/target/linux/bcm4908/patches-5.10/040-v6.4-0003-arm64-dts-broadcom-bcmbca-bcm4908-fix-LED-nodenames.patch new file mode 100644 index 00000000000..7ce17c1870f --- /dev/null +++ b/target/linux/bcm4908/patches-5.10/040-v6.4-0003-arm64-dts-broadcom-bcmbca-bcm4908-fix-LED-nodenames.patch @@ -0,0 +1,66 @@ +From 23be9f68f933adee8163b8efc9c6bff71410cc7c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:43:59 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: fix LED nodenames +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes: +arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dtb: leds@800: 'led-lan@19', 'led-power@11', 'led-wan-red@12', 'led-wan-white@15', 'led-wps@14' do not match any of the regexes: '^led@[a-f0-9]+$', 'pinctrl-[0-9]+' + From schema: Documentation/devicetree/bindings/leds/leds-bcm63138.yaml + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144400.21689-2-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts +@@ -120,7 +120,7 @@ + }; + + &leds { +- led-power@11 { ++ led@11 { + reg = <0x11>; + function = LED_FUNCTION_POWER; + color = ; +@@ -130,7 +130,7 @@ + pinctrl-0 = <&pins_led_17_a>; + }; + +- led-wan-red@12 { ++ led@12 { + reg = <0x12>; + function = LED_FUNCTION_WAN; + color = ; +@@ -139,7 +139,7 @@ + pinctrl-0 = <&pins_led_18_a>; + }; + +- led-wps@14 { ++ led@14 { + reg = <0x14>; + function = LED_FUNCTION_WPS; + color = ; +@@ -148,7 +148,7 @@ + pinctrl-0 = <&pins_led_20_a>; + }; + +- led-wan-white@15 { ++ led@15 { + reg = <0x15>; + function = LED_FUNCTION_WAN; + color = ; +@@ -157,7 +157,7 @@ + pinctrl-0 = <&pins_led_21_a>; + }; + +- led-lan@19 { ++ led@19 { + reg = <0x19>; + function = LED_FUNCTION_LAN; + color = ; diff --git a/target/linux/bcm4908/patches-5.10/040-v6.4-0004-arm64-dts-broadcom-bcmbca-bcm4908-fix-procmon-nodena.patch b/target/linux/bcm4908/patches-5.10/040-v6.4-0004-arm64-dts-broadcom-bcmbca-bcm4908-fix-procmon-nodena.patch new file mode 100644 index 00000000000..a469a32a2c0 --- /dev/null +++ b/target/linux/bcm4908/patches-5.10/040-v6.4-0004-arm64-dts-broadcom-bcmbca-bcm4908-fix-procmon-nodena.patch @@ -0,0 +1,30 @@ +From f16a8294dd7a02c7ad042cd2e3acc5ea06698dc1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:44:00 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: fix procmon nodename +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes: +arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: syscon@280000: $nodename:0: 'syscon@280000' does not match '^([a-z][a-z0-9\\-]+-bus|bus|localbus|soc|axi|ahb|apb)(@.+)?$' + From schema: schemas/simple-bus.yaml + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144400.21689-3-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -260,7 +260,7 @@ + }; + }; + +- procmon: syscon@280000 { ++ procmon: bus@280000 { + compatible = "simple-bus"; + reg = <0x280000 0x1000>; + ranges; diff --git a/target/linux/bcm4908/patches-5.10/040-v6.4-0005-arm64-dts-broadcom-bcmbca-bcm4908-add-on-SoC-USB-por.patch b/target/linux/bcm4908/patches-5.10/040-v6.4-0005-arm64-dts-broadcom-bcmbca-bcm4908-add-on-SoC-USB-por.patch new file mode 100644 index 00000000000..47b2455ae63 --- /dev/null +++ b/target/linux/bcm4908/patches-5.10/040-v6.4-0005-arm64-dts-broadcom-bcmbca-bcm4908-add-on-SoC-USB-por.patch @@ -0,0 +1,81 @@ +From 477cad715de1dfc256a20da3ed83b62f3cb2944d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:45:18 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add on-SoC USB ports +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +BCM4908 has 3 USB controllers each with 2 USB ports. Home routers often +have LEDs indicating state of selected USB ports. Describe those SoC USB +ports to allow using them as LED trigger sources. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144520.21816-1-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + .../boot/dts/broadcom/bcmbca/bcm4908.dtsi | 39 +++++++++++++++++++ + 1 file changed, 39 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -148,6 +148,19 @@ + interrupts = ; + phys = <&usb_phy PHY_TYPE_USB2>; + status = "disabled"; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ehci_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ ehci_port2: port@2 { ++ reg = <2>; ++ #trigger-source-cells = <0>; ++ }; + }; + + ohci: usb@c400 { +@@ -156,6 +169,19 @@ + interrupts = ; + phys = <&usb_phy PHY_TYPE_USB2>; + status = "disabled"; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ohci_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ ohci_port2: port@2 { ++ reg = <2>; ++ #trigger-source-cells = <0>; ++ }; + }; + + xhci: usb@d000 { +@@ -164,6 +190,19 @@ + interrupts = ; + phys = <&usb_phy PHY_TYPE_USB3>; + status = "disabled"; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ xhci_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ xhci_port2: port@2 { ++ reg = <2>; ++ #trigger-source-cells = <0>; ++ }; + }; + + bus@80000 { diff --git a/target/linux/bcm4908/patches-5.10/040-v6.4-0006-arm64-dts-broadcom-bcmbca-bcm4908-add-Netgear-R8000P.patch b/target/linux/bcm4908/patches-5.10/040-v6.4-0006-arm64-dts-broadcom-bcmbca-bcm4908-add-Netgear-R8000P.patch new file mode 100644 index 00000000000..3e210d68e11 --- /dev/null +++ b/target/linux/bcm4908/patches-5.10/040-v6.4-0006-arm64-dts-broadcom-bcmbca-bcm4908-add-Netgear-R8000P.patch @@ -0,0 +1,38 @@ +From 889e53ccccc29ff4bf8d4c89cca34e8768845747 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:45:19 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add Netgear R8000P USB + LED triggers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This device has 2 USB LEDs meant to be triggered by devices in relevant +USB ports. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144520.21816-2-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + .../arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts +@@ -58,12 +58,16 @@ + function = "usb2"; + color = ; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ohci_port1>, <&ehci_port1>; ++ linux,default-trigger = "usbport"; + }; + + led-usb3 { + function = "usb3"; + color = ; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ohci_port2>, <&ehci_port2>, <&xhci_port2>; ++ linux,default-trigger = "usbport"; + }; + + led-wifi { diff --git a/target/linux/bcm4908/patches-5.10/040-v6.4-0007-arm64-dts-broadcom-bcmbca-bcm4908-add-TP-Link-C2300-.patch b/target/linux/bcm4908/patches-5.10/040-v6.4-0007-arm64-dts-broadcom-bcmbca-bcm4908-add-TP-Link-C2300-.patch new file mode 100644 index 00000000000..959ccd4fa34 --- /dev/null +++ b/target/linux/bcm4908/patches-5.10/040-v6.4-0007-arm64-dts-broadcom-bcmbca-bcm4908-add-TP-Link-C2300-.patch @@ -0,0 +1,41 @@ +From e6d356b146b75f1f77621aab7950a1eb550859f9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:45:20 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add TP-Link C2300 USB + LED triggers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This device has 2 USB LEDs meant to be triggered by devices in relevant +USB ports. + +While at it fix typo in USB LED name. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144520.21816-3-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1.dts | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1.dts +@@ -64,12 +64,16 @@ + function = "usb2"; + color = ; + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ohci_port1>, <&ehci_port1>; ++ linux,default-trigger = "usbport"; + }; + + led-usb3 { +- function = "usbd3"; ++ function = "usb3"; + color = ; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ohci_port2>, <&ehci_port2>, <&xhci_port2>; ++ linux,default-trigger = "usbport"; + }; + + led-brightness { diff --git a/target/linux/bcm4908/patches-5.10/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch b/target/linux/bcm4908/patches-5.10/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch index bc0743c800c..a7c6d0102fe 100644 --- a/target/linux/bcm4908/patches-5.10/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch +++ b/target/linux/bcm4908/patches-5.10/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch @@ -12,7 +12,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi -@@ -297,7 +297,7 @@ +@@ -343,7 +343,7 @@ gpio0: gpio-controller@500 { compatible = "brcm,bcm6345-gpio"; reg-names = "dirout", "dat"; diff --git a/target/linux/bcm4908/patches-5.15/035-v6.2-0003-arm64-dts-Update-cache-properties-for-broadcom.patch b/target/linux/bcm4908/patches-5.15/035-v6.2-0003-arm64-dts-Update-cache-properties-for-broadcom.patch new file mode 100644 index 00000000000..a19ab8cf8fd --- /dev/null +++ b/target/linux/bcm4908/patches-5.15/035-v6.2-0003-arm64-dts-Update-cache-properties-for-broadcom.patch @@ -0,0 +1,134 @@ +From e567e58d6819adc002c57b81e16b88da24d3b4aa Mon Sep 17 00:00:00 2001 +From: Pierre Gondois +Date: Tue, 22 Nov 2022 17:32:07 +0100 +Subject: [PATCH] arm64: dts: Update cache properties for broadcom + +The DeviceTree Specification v0.3 specifies that the cache node +'compatible' and 'cache-level' properties are 'required'. Cf. +s3.8 Multi-level and Shared Cache Nodes +The 'cache-unified' property should be present if one of the +properties for unified cache is present ('cache-size', ...). + +Update the Device Trees accordingly. + +Acked-by: William Zhang +Signed-off-by: Pierre Gondois +Link: https://lore.kernel.org/r/20221122163208.3810985-3-pierre.gondois@arm.com +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi | 1 + + arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi | 1 + + arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi | 4 ++++ + 9 files changed, 12 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -63,6 +63,7 @@ + + l2: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi +@@ -51,6 +51,7 @@ + + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi +@@ -35,6 +35,7 @@ + + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi +@@ -51,6 +51,7 @@ + + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi +@@ -51,6 +51,7 @@ + + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi +@@ -35,6 +35,7 @@ + + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi +@@ -50,6 +50,7 @@ + }; + L2_0: l2-cache0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi ++++ b/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi +@@ -79,6 +79,7 @@ + + CLUSTER0_L2: l2-cache@0 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + +--- a/arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi ++++ b/arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi +@@ -108,18 +108,22 @@ + + CLUSTER0_L2: l2-cache@0 { + compatible = "cache"; ++ cache-level = <2>; + }; + + CLUSTER1_L2: l2-cache@100 { + compatible = "cache"; ++ cache-level = <2>; + }; + + CLUSTER2_L2: l2-cache@200 { + compatible = "cache"; ++ cache-level = <2>; + }; + + CLUSTER3_L2: l2-cache@300 { + compatible = "cache"; ++ cache-level = <2>; + }; + }; + diff --git a/target/linux/bcm4908/patches-5.15/036-v6.4-0001-arm64-dts-broadcom-bcmbca-Add-spi-controller-node.patch b/target/linux/bcm4908/patches-5.15/036-v6.4-0001-arm64-dts-broadcom-bcmbca-Add-spi-controller-node.patch new file mode 100644 index 00000000000..e8e12281793 --- /dev/null +++ b/target/linux/bcm4908/patches-5.15/036-v6.4-0001-arm64-dts-broadcom-bcmbca-Add-spi-controller-node.patch @@ -0,0 +1,367 @@ +From f5d83b714e304d5f3229da434af2eeea033c4f5d Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Mon, 6 Feb 2023 22:58:15 -0800 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: Add spi controller node + +Add support for HSSPI controller in ARMv8 chip dts files. + +Signed-off-by: William Zhang +Link: https://lore.kernel.org/r/20230207065826.285013-5-william.zhang@broadcom.com +Signed-off-by: Florian Fainelli +--- + .../boot/dts/broadcom/bcmbca/bcm4908.dtsi | 18 +++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm4912.dtsi | 20 +++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm63146.dtsi | 19 ++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm63158.dtsi | 19 ++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm6813.dtsi | 20 +++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm6856.dtsi | 18 +++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm6858.dtsi | 18 +++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm94908.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm94912.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm963146.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm963158.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm96813.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm96856.dts | 4 ++++ + .../boot/dts/broadcom/bcmbca/bcm96858.dts | 4 ++++ + 14 files changed, 160 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -107,6 +107,12 @@ + clock-frequency = <50000000>; + clock-output-names = "periph"; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <400000000>; ++ }; + }; + + soc { +@@ -531,6 +537,18 @@ + #size-cells = <0>; + }; + ++ hsspi: spi@1000{ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm4908-hsspi", "brcm,bcmbca-hsspi-v1.0"; ++ reg = <0x1000 0x600>; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; ++ + nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi +@@ -79,6 +79,7 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ + uart_clk: uart-clk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; +@@ -86,6 +87,12 @@ + clock-div = <4>; + clock-mult = <1>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; + }; + + psci { +@@ -117,6 +124,19 @@ + #size-cells = <1>; + ranges = <0x0 0x0 0xff800000 0x800000>; + ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm4912-hsspi", "brcm,bcmbca-hsspi-v1.1"; ++ reg = <0x1000 0x600>, <0x2610 0x4>; ++ reg-names = "hsspi", "spim-ctrl"; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; ++ + uart0: serial@12000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x12000 0x1000>; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi +@@ -60,6 +60,7 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ + uart_clk: uart-clk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; +@@ -67,6 +68,12 @@ + clock-div = <4>; + clock-mult = <1>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; + }; + + psci { +@@ -99,6 +106,18 @@ + #size-cells = <1>; + ranges = <0x0 0x0 0xff800000 0x800000>; + ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm63146-hsspi", "brcm,bcmbca-hsspi-v1.0"; ++ reg = <0x1000 0x600>; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; ++ + uart0: serial@12000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x12000 0x1000>; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi +@@ -79,6 +79,7 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ + uart_clk: uart-clk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; +@@ -86,6 +87,12 @@ + clock-div = <4>; + clock-mult = <1>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <400000000>; ++ }; + }; + + psci { +@@ -117,6 +124,18 @@ + #size-cells = <1>; + ranges = <0x0 0x0 0xff800000 0x800000>; + ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm63158-hsspi", "brcm,bcmbca-hsspi-v1.0"; ++ reg = <0x1000 0x600>; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; ++ + uart0: serial@12000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x12000 0x1000>; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi +@@ -79,6 +79,7 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ + uart_clk: uart-clk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; +@@ -86,6 +87,12 @@ + clock-div = <4>; + clock-mult = <1>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; + }; + + psci { +@@ -117,6 +124,19 @@ + #size-cells = <1>; + ranges = <0x0 0x0 0xff800000 0x800000>; + ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm6813-hsspi", "brcm,bcmbca-hsspi-v1.1"; ++ reg = <0x1000 0x600>, <0x2610 0x4>; ++ reg-names = "hsspi", "spim-ctrl"; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; ++ + uart0: serial@12000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x12000 0x1000>; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi +@@ -60,6 +60,12 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <400000000>; ++ }; + }; + + psci { +@@ -100,5 +106,17 @@ + clock-names = "refclk"; + status = "disabled"; + }; ++ ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm6856-hsspi", "brcm,bcmbca-hsspi-v1.0"; ++ reg = <0x1000 0x600>; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi +@@ -78,6 +78,12 @@ + #clock-cells = <0>; + clock-frequency = <200000000>; + }; ++ ++ hsspi_pll: hsspi-pll { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <400000000>; ++ }; + }; + + psci { +@@ -137,5 +143,17 @@ + clock-names = "refclk"; + status = "disabled"; + }; ++ ++ hsspi: spi@1000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,bcm6858-hsspi", "brcm,bcmbca-hsspi-v1.0"; ++ reg = <0x1000 0x600>; ++ interrupts = ; ++ clocks = <&hsspi_pll &hsspi_pll>; ++ clock-names = "hsspi", "pll"; ++ num-cs = <8>; ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts +@@ -28,3 +28,7 @@ + &uart0 { + status = "okay"; + }; ++ ++&hsspi { ++ status = "okay"; ++}; diff --git a/target/linux/bcm4908/patches-5.15/036-v6.4-0002-arm64-dts-broadcom-bcmbca-bcm4908-fix-NAND-interrupt.patch b/target/linux/bcm4908/patches-5.15/036-v6.4-0002-arm64-dts-broadcom-bcmbca-bcm4908-fix-NAND-interrupt.patch new file mode 100644 index 00000000000..b121200a256 --- /dev/null +++ b/target/linux/bcm4908/patches-5.15/036-v6.4-0002-arm64-dts-broadcom-bcmbca-bcm4908-fix-NAND-interrupt.patch @@ -0,0 +1,33 @@ +From 5cca02449490e767289bda38db1577e2c375c084 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:43:58 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: fix NAND interrupt + name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes: +arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: nand-controller@1800: interrupt-names:0: 'nand_ctlrdy' was expected + From schema: Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml +arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: nand-controller@1800: Unevaluated properties are not allowed ('interrupt-names' was unexpected) + From schema: Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144400.21689-1-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -556,7 +556,7 @@ + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + interrupts = ; +- interrupt-names = "nand"; ++ interrupt-names = "nand_ctlrdy"; + status = "okay"; + + nandcs: nand@0 { diff --git a/target/linux/bcm4908/patches-5.15/036-v6.4-0003-arm64-dts-broadcom-bcmbca-bcm4908-fix-LED-nodenames.patch b/target/linux/bcm4908/patches-5.15/036-v6.4-0003-arm64-dts-broadcom-bcmbca-bcm4908-fix-LED-nodenames.patch new file mode 100644 index 00000000000..7ce17c1870f --- /dev/null +++ b/target/linux/bcm4908/patches-5.15/036-v6.4-0003-arm64-dts-broadcom-bcmbca-bcm4908-fix-LED-nodenames.patch @@ -0,0 +1,66 @@ +From 23be9f68f933adee8163b8efc9c6bff71410cc7c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:43:59 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: fix LED nodenames +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes: +arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dtb: leds@800: 'led-lan@19', 'led-power@11', 'led-wan-red@12', 'led-wan-white@15', 'led-wps@14' do not match any of the regexes: '^led@[a-f0-9]+$', 'pinctrl-[0-9]+' + From schema: Documentation/devicetree/bindings/leds/leds-bcm63138.yaml + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144400.21689-2-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts +@@ -120,7 +120,7 @@ + }; + + &leds { +- led-power@11 { ++ led@11 { + reg = <0x11>; + function = LED_FUNCTION_POWER; + color = ; +@@ -130,7 +130,7 @@ + pinctrl-0 = <&pins_led_17_a>; + }; + +- led-wan-red@12 { ++ led@12 { + reg = <0x12>; + function = LED_FUNCTION_WAN; + color = ; +@@ -139,7 +139,7 @@ + pinctrl-0 = <&pins_led_18_a>; + }; + +- led-wps@14 { ++ led@14 { + reg = <0x14>; + function = LED_FUNCTION_WPS; + color = ; +@@ -148,7 +148,7 @@ + pinctrl-0 = <&pins_led_20_a>; + }; + +- led-wan-white@15 { ++ led@15 { + reg = <0x15>; + function = LED_FUNCTION_WAN; + color = ; +@@ -157,7 +157,7 @@ + pinctrl-0 = <&pins_led_21_a>; + }; + +- led-lan@19 { ++ led@19 { + reg = <0x19>; + function = LED_FUNCTION_LAN; + color = ; diff --git a/target/linux/bcm4908/patches-5.15/036-v6.4-0004-arm64-dts-broadcom-bcmbca-bcm4908-fix-procmon-nodena.patch b/target/linux/bcm4908/patches-5.15/036-v6.4-0004-arm64-dts-broadcom-bcmbca-bcm4908-fix-procmon-nodena.patch new file mode 100644 index 00000000000..a469a32a2c0 --- /dev/null +++ b/target/linux/bcm4908/patches-5.15/036-v6.4-0004-arm64-dts-broadcom-bcmbca-bcm4908-fix-procmon-nodena.patch @@ -0,0 +1,30 @@ +From f16a8294dd7a02c7ad042cd2e3acc5ea06698dc1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:44:00 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: fix procmon nodename +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes: +arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: syscon@280000: $nodename:0: 'syscon@280000' does not match '^([a-z][a-z0-9\\-]+-bus|bus|localbus|soc|axi|ahb|apb)(@.+)?$' + From schema: schemas/simple-bus.yaml + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144400.21689-3-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -260,7 +260,7 @@ + }; + }; + +- procmon: syscon@280000 { ++ procmon: bus@280000 { + compatible = "simple-bus"; + reg = <0x280000 0x1000>; + ranges; diff --git a/target/linux/bcm4908/patches-5.15/036-v6.4-0005-arm64-dts-broadcom-bcmbca-bcm4908-add-on-SoC-USB-por.patch b/target/linux/bcm4908/patches-5.15/036-v6.4-0005-arm64-dts-broadcom-bcmbca-bcm4908-add-on-SoC-USB-por.patch new file mode 100644 index 00000000000..47b2455ae63 --- /dev/null +++ b/target/linux/bcm4908/patches-5.15/036-v6.4-0005-arm64-dts-broadcom-bcmbca-bcm4908-add-on-SoC-USB-por.patch @@ -0,0 +1,81 @@ +From 477cad715de1dfc256a20da3ed83b62f3cb2944d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:45:18 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add on-SoC USB ports +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +BCM4908 has 3 USB controllers each with 2 USB ports. Home routers often +have LEDs indicating state of selected USB ports. Describe those SoC USB +ports to allow using them as LED trigger sources. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144520.21816-1-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + .../boot/dts/broadcom/bcmbca/bcm4908.dtsi | 39 +++++++++++++++++++ + 1 file changed, 39 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -148,6 +148,19 @@ + interrupts = ; + phys = <&usb_phy PHY_TYPE_USB2>; + status = "disabled"; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ehci_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ ehci_port2: port@2 { ++ reg = <2>; ++ #trigger-source-cells = <0>; ++ }; + }; + + ohci: usb@c400 { +@@ -156,6 +169,19 @@ + interrupts = ; + phys = <&usb_phy PHY_TYPE_USB2>; + status = "disabled"; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ohci_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ ohci_port2: port@2 { ++ reg = <2>; ++ #trigger-source-cells = <0>; ++ }; + }; + + xhci: usb@d000 { +@@ -164,6 +190,19 @@ + interrupts = ; + phys = <&usb_phy PHY_TYPE_USB3>; + status = "disabled"; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ xhci_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ xhci_port2: port@2 { ++ reg = <2>; ++ #trigger-source-cells = <0>; ++ }; + }; + + bus@80000 { diff --git a/target/linux/bcm4908/patches-5.15/036-v6.4-0006-arm64-dts-broadcom-bcmbca-bcm4908-add-Netgear-R8000P.patch b/target/linux/bcm4908/patches-5.15/036-v6.4-0006-arm64-dts-broadcom-bcmbca-bcm4908-add-Netgear-R8000P.patch new file mode 100644 index 00000000000..3e210d68e11 --- /dev/null +++ b/target/linux/bcm4908/patches-5.15/036-v6.4-0006-arm64-dts-broadcom-bcmbca-bcm4908-add-Netgear-R8000P.patch @@ -0,0 +1,38 @@ +From 889e53ccccc29ff4bf8d4c89cca34e8768845747 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:45:19 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add Netgear R8000P USB + LED triggers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This device has 2 USB LEDs meant to be triggered by devices in relevant +USB ports. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144520.21816-2-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + .../arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts +@@ -58,12 +58,16 @@ + function = "usb2"; + color = ; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ohci_port1>, <&ehci_port1>; ++ linux,default-trigger = "usbport"; + }; + + led-usb3 { + function = "usb3"; + color = ; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ohci_port2>, <&ehci_port2>, <&xhci_port2>; ++ linux,default-trigger = "usbport"; + }; + + led-wifi { diff --git a/target/linux/bcm4908/patches-5.15/036-v6.4-0007-arm64-dts-broadcom-bcmbca-bcm4908-add-TP-Link-C2300-.patch b/target/linux/bcm4908/patches-5.15/036-v6.4-0007-arm64-dts-broadcom-bcmbca-bcm4908-add-TP-Link-C2300-.patch new file mode 100644 index 00000000000..959ccd4fa34 --- /dev/null +++ b/target/linux/bcm4908/patches-5.15/036-v6.4-0007-arm64-dts-broadcom-bcmbca-bcm4908-add-TP-Link-C2300-.patch @@ -0,0 +1,41 @@ +From e6d356b146b75f1f77621aab7950a1eb550859f9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 28 Feb 2023 15:45:20 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add TP-Link C2300 USB + LED triggers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This device has 2 USB LEDs meant to be triggered by devices in relevant +USB ports. + +While at it fix typo in USB LED name. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/all/20230228144520.21816-3-zajec5@gmail.com/ +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1.dts | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1.dts ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1.dts +@@ -64,12 +64,16 @@ + function = "usb2"; + color = ; + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ohci_port1>, <&ehci_port1>; ++ linux,default-trigger = "usbport"; + }; + + led-usb3 { +- function = "usbd3"; ++ function = "usb3"; + color = ; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ohci_port2>, <&ehci_port2>, <&xhci_port2>; ++ linux,default-trigger = "usbport"; + }; + + led-brightness { diff --git a/target/linux/bcm4908/patches-5.15/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch b/target/linux/bcm4908/patches-5.15/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch index bc0743c800c..a7c6d0102fe 100644 --- a/target/linux/bcm4908/patches-5.15/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch +++ b/target/linux/bcm4908/patches-5.15/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch @@ -12,7 +12,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi -@@ -297,7 +297,7 @@ +@@ -343,7 +343,7 @@ gpio0: gpio-controller@500 { compatible = "brcm,bcm6345-gpio"; reg-names = "dirout", "dat"; From cb2661844a5d54d44230ee564d4f17605a794a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 16 Mar 2023 22:01:51 +0100 Subject: [PATCH 05/44] bcm4908: include usbport trigger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki --- target/linux/bcm4908/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/bcm4908/Makefile b/target/linux/bcm4908/Makefile index b5f98a29daf..943aeb58a3d 100644 --- a/target/linux/bcm4908/Makefile +++ b/target/linux/bcm4908/Makefile @@ -23,6 +23,7 @@ KERNELNAME:=Image dtbs DEFAULT_PACKAGES += \ bcm4908img fdt-utils uboot-envtools \ kmod-gpio-button-hotplug \ - kmod-usb-ohci kmod-usb2 kmod-usb3 + kmod-usb-ohci kmod-usb2 kmod-usb3 \ + kmod-usb-ledtrig-usbport $(eval $(call BuildTarget)) From 86cf0f93f1ce603771ea06e581c8937ba1ad8918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 16 Mar 2023 23:34:37 +0100 Subject: [PATCH 06/44] bcm4908: add HVC workaround for booting kernel 5.15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki --- .../301-arm64-don-t-issue-HVC-on-boot.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 target/linux/bcm4908/patches-5.15/301-arm64-don-t-issue-HVC-on-boot.patch diff --git a/target/linux/bcm4908/patches-5.15/301-arm64-don-t-issue-HVC-on-boot.patch b/target/linux/bcm4908/patches-5.15/301-arm64-don-t-issue-HVC-on-boot.patch new file mode 100644 index 00000000000..d167c2ed00d --- /dev/null +++ b/target/linux/bcm4908/patches-5.15/301-arm64-don-t-issue-HVC-on-boot.patch @@ -0,0 +1,30 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 12 Aug 2021 11:52:42 +0200 +Subject: [PATCH] arm64: don't issue HVC on boot +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Broadcom's CFE loader seems to miss setting SCR_EL3.HCE which results in +generating an UNDEF and kernel panic on the first HVC. + +HVC gets issued by kernels 5.12+ while booting, by kexec and KVM. Until +someone finds a workaround we have to avoid all above. + +Workarounds: 0c93df9622d4 ("arm64: Initialise as nVHE before switching to VHE") +Signed-off-by: Rafał Miłecki +--- + arch/arm64/kernel/hyp-stub.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/kernel/hyp-stub.S ++++ b/arch/arm64/kernel/hyp-stub.S +@@ -238,7 +238,7 @@ SYM_FUNC_START(switch_to_vhe) + + // Turn the world upside down + mov x0, #HVC_VHE_RESTART +- hvc #0 ++// hvc #0 + 1: + ret + SYM_FUNC_END(switch_to_vhe) From c44c1e1a1f18394cb855c389795ba10822e29d46 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sun, 5 Feb 2023 23:12:05 +0100 Subject: [PATCH 07/44] toolchain/binutils: enable zstd support Debug sections can now be compressed using zstd. Signed-off-by: Andre Heider --- toolchain/binutils/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile index 42778d8d698..ae7e953eb92 100644 --- a/toolchain/binutils/Makefile +++ b/toolchain/binutils/Makefile @@ -50,7 +50,7 @@ HOST_CONFIGURE_ARGS = \ --target=$(REAL_GNU_TARGET_NAME) \ --with-sysroot=$(TOOLCHAIN_DIR) \ --with-system-zlib \ - --without-zstd \ + --with-zstd \ --enable-deterministic-archives \ --enable-plugins \ --enable-lto \ From acc8c2d829fb5e0e0b2495d720e058f91ea164b0 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sun, 5 Feb 2023 23:21:46 +0100 Subject: [PATCH 08/44] toolchain/gcc: enable zstd support LTO object files will now be compressed using zstd. Compressing debug sections with zstd will have to wait for GCC 13, which adds support for -gz=zstd. NOTE: wiping the ccache is strongly recommended, not doing so might yield build error later on: "lto1: internal compiler error: original not compressed with zstd" Signed-off-by: Andre Heider --- toolchain/gcc/common.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index e885141538c..25f7e1ef702 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -66,6 +66,9 @@ TAR_OPTIONS += \ --exclude-from='$(CURDIR)/../exclude-testsuite' --exclude=gcc/ada/*.ad* \ --exclude=libjava +# this needs to be without -L/-lzstd flags or other parts fail to build +# use an absolute path to ensure it really picks up our version +export ac_cv_search_ZSTD_compress=$(STAGING_DIR_HOST)/lib/libzstd.a -pthread export libgcc_cv_fixed_point=no ifdef CONFIG_INSTALL_GCCGO export libgo_cv_c_split_stack_supported=no @@ -103,7 +106,7 @@ GCC_CONFIGURE:= \ $(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \ $(if $(CONFIG_powerpc64), $(if $(CONFIG_USE_MUSL),--with-abi=elfv2)) \ --with-system-zlib=$(STAGING_DIR_HOST) \ - --without-zstd \ + --with-zstd=$(STAGING_DIR_HOST) \ --with-gmp=$(STAGING_DIR_HOST) \ --with-mpfr=$(STAGING_DIR_HOST) \ --with-mpc=$(STAGING_DIR_HOST) \ From 6634fb00dd2720bd2b61e5bc47a12d3954a34c4b Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 14 Mar 2023 22:34:48 +0100 Subject: [PATCH 09/44] rpcd: bump to latest git HEAD d978830 rc: add option to get info for a single script in list method 632b4fc rc: add option to skip running check for list method 5577db9 rc: add support for scanning USE_PROCD and skip running if not supported 4de3f02 rc: fix and improve script scanning START and STOP Signed-off-by: Christian Marangi --- package/system/rpcd/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index 70d61fa9ad2..6221da8c8ef 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rpcd -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git -PKG_MIRROR_HASH:=7038ab08dc67f7440effbf04ab2f083915c819f758ab16b0fbdf846bd3b87773 -PKG_SOURCE_DATE:=2023-01-21 -PKG_SOURCE_VERSION:=c0df2a7af7d6284f4a446de15d0dab17124d9448 +PKG_MIRROR_HASH:=d636b6e08a69578d615b2a294d6ca2c7ef73791de2a8314f1afb741655d8a143 +PKG_SOURCE_DATE:=2023-03-14 +PKG_SOURCE_VERSION:=d97883005ffb5be251872c3e4abe04f71732f9bd PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC From 513d15cb799eade5ad85a44fae03862a56790a8b Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 22 Feb 2023 19:57:45 +0100 Subject: [PATCH 10/44] layerscape: switch to Kernel 5.15 by default Getting ready for the next release. Tested-by: Pawel Dembicki Signed-off-by: Paul Spooren --- target/linux/layerscape/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/linux/layerscape/Makefile b/target/linux/layerscape/Makefile index a974c019291..23672602529 100644 --- a/target/linux/layerscape/Makefile +++ b/target/linux/layerscape/Makefile @@ -6,8 +6,9 @@ include $(TOPDIR)/rules.mk BOARD:=layerscape BOARDNAME:=NXP Layerscape -KERNEL_PATCHVER:=5.10 -KERNEL_TESTING_PATCHVER:=5.15 + +KERNEL_PATCHVER:=5.15 + FEATURES:=squashfs nand usb pcie gpio fpu ubifs ext4 rootfs-part boot-part SUBTARGETS:=armv8_64b armv7 From 93b7f0f0ed5ba31ef29bdd862fd2d29da625183f Mon Sep 17 00:00:00 2001 From: Mantas Pucka Date: Thu, 16 Mar 2023 16:30:13 +0200 Subject: [PATCH 11/44] ipq-wifi: bump to latest git HEAD and add 8devices boards 2dae618 ipq-wifi: update 8devices Jalapeno BDF 08e92db ipq-wifi: update 8devices Habanero BDF Signed-off-by: Mantas Pucka [ split ipq40xx changes in separate commit ] Signed-off-by: Christian Marangi --- package/firmware/ipq-wifi/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index f1c60a77820..8e5ef549669 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2023-02-12 -PKG_SOURCE_VERSION:=c3ece63d6879e14c8d65a8dc3e32f47e0f891f27 -PKG_MIRROR_HASH:=7637fb1df3ad577650284b526ffaa4c038e1ba6b196a88724d63e4d1c1ab3c53 +PKG_SOURCE_DATE:=2023-03-16 +PKG_SOURCE_VERSION:=2dae61830c42ebdcc29a13048b81a0485d7b5b95 +PKG_MIRROR_HASH:=1c9b3fa2044de952e336a49b2864784b6e9cf3729fb05198f47ac4a71df13320 PKG_FLAGS:=nonshared @@ -28,6 +28,8 @@ endef # ALLWIFIBOARDS:= \ + 8dev_habanero \ + 8dev_jalapeno \ aruba_ap-365 \ buffalo_wxr-5950ax12 \ devolo_magic-2-wifi-next \ @@ -128,6 +130,8 @@ endef # Place files in this directory as board-. # Add $(eval $(call generate-ipq-wifi-package,,)) +$(eval $(call generate-ipq-wifi-package,8dev_habanero,8devices Habanero)) +$(eval $(call generate-ipq-wifi-package,8dev_jalapeno,8devices Jalapeno)) $(eval $(call generate-ipq-wifi-package,aruba_ap-365,Aruba AP-365)) $(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX12)) $(eval $(call generate-ipq-wifi-package,devolo_magic-2-wifi-next,devolo Magic 2 WiFi next)) From fce0379d308adca5a331522d890e6c403e020f36 Mon Sep 17 00:00:00 2001 From: Mantas Pucka Date: Fri, 17 Mar 2023 02:00:48 +0100 Subject: [PATCH 12/44] ipq40xx: set specific BDF file for 8devices Habanero/Jalapeno Set specific BDF file for 8devices Habanero/Jalapeno in ipq40xx generic.mk Signed-off-by: Mantas Pucka [ split ipq40xx changes in separate commit ] Signed-off-by: Christian Marangi --- target/linux/ipq40xx/image/generic.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index a0ad63cfcec..4302f5ec224 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -132,6 +132,7 @@ define Device/8dev_habanero-dvk IMAGE_SIZE := 30976k SOC := qcom-ipq4019 IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | check-size | append-metadata + DEVICE_PACKAGES := ipq-wifi-8dev_habanero endef TARGET_DEVICES += 8dev_habanero-dvk @@ -141,6 +142,7 @@ define Device/8dev_jalapeno-common BLOCKSIZE := 128k PAGESIZE := 2048 SOC := qcom-ipq4018 + DEVICE_PACKAGES := ipq-wifi-8dev_jalapeno endef define Device/8dev_jalapeno From d7ba312a1458f3ae5ea104fbc350cf4b26c81e8f Mon Sep 17 00:00:00 2001 From: Mantas Pucka Date: Wed, 15 Mar 2023 09:50:06 +0200 Subject: [PATCH 13/44] ipq40xx: update Crisis Innovation Lab MeshPoint.One BDF Make sure it uses updated Jalapeno BDF inherited from Device/8dev_jalapeno-common Fixes: 146eb4925c7f ("ipq40xx: add support for Crisis Innovation Lab MeshPoint.One") Signed-off-by: Mantas Pucka [ fix Fixes tag to correct format and fix commit title ] Signed-off-by: Christian Marangi --- target/linux/ipq40xx/image/generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 4302f5ec224..68a45dbf9be 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -338,7 +338,7 @@ define Device/cilab_meshpoint-one $(call Device/8dev_jalapeno-common) DEVICE_VENDOR := Crisis Innovation Lab DEVICE_MODEL := MeshPoint.One - DEVICE_PACKAGES := kmod-i2c-gpio kmod-iio-bmp280-i2c kmod-hwmon-ina2xx kmod-rtc-pcf2127 + DEVICE_PACKAGES += kmod-i2c-gpio kmod-iio-bmp280-i2c kmod-hwmon-ina2xx kmod-rtc-pcf2127 endef # Missing DSA Setup #TARGET_DEVICES += cilab_meshpoint-one From 6ac6f2402da7ced5b6295e446693a78179923fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 17 Mar 2023 16:36:08 +0100 Subject: [PATCH 14/44] kernel: update v6.3 of patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Use final (accepted) patches 2. Add two more required for v6.4 nvmem stuff Signed-off-by: Rafał Miłecki --- ...-of_parse_phandle_with_optional_args.patch | 6 ++- ...ke-.-cells-optional-for-simple-props.patch | 14 +++--- ...operty-add-nvmem-cell-cells-property.patch | 6 ++- ...vice-Ignore-modalias-of-reused-nodes.patch | 37 ++++++++++++++++ ...-ignore-error-code-in-of_device_ueve.patch | 29 ++++++++++++ ...roperty-fix-nvmem-cell-cells-parsing.patch | 44 ------------------- ...-of_parse_phandle_with_optional_args.patch | 6 ++- ...ke-.-cells-optional-for-simple-props.patch | 14 +++--- ...operty-add-nvmem-cell-cells-property.patch | 6 ++- ...vice-Ignore-modalias-of-reused-nodes.patch | 37 ++++++++++++++++ ...-ignore-error-code-in-of_device_ueve.patch | 29 ++++++++++++ ...roperty-fix-nvmem-cell-cells-parsing.patch | 44 ------------------- 12 files changed, 164 insertions(+), 108 deletions(-) create mode 100644 target/linux/generic/backport-5.10/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch create mode 100644 target/linux/generic/backport-5.10/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch delete mode 100644 target/linux/generic/backport-5.10/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch create mode 100644 target/linux/generic/backport-5.15/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch create mode 100644 target/linux/generic/backport-5.15/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch delete mode 100644 target/linux/generic/backport-5.15/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch diff --git a/target/linux/generic/backport-5.10/827-v6.3-0001-of-base-add-of_parse_phandle_with_optional_args.patch b/target/linux/generic/backport-5.10/827-v6.3-0001-of-base-add-of_parse_phandle_with_optional_args.patch index a3df3ce75c6..3606034b9b2 100644 --- a/target/linux/generic/backport-5.10/827-v6.3-0001-of-base-add-of_parse_phandle_with_optional_args.patch +++ b/target/linux/generic/backport-5.10/827-v6.3-0001-of-base-add-of_parse_phandle_with_optional_args.patch @@ -1,6 +1,6 @@ -From 8eddceb280f5deb8046fcb660de9f9f683b408b9 Mon Sep 17 00:00:00 2001 +From c5d264d4b527c96ae8903376a4b195df47b05203 Mon Sep 17 00:00:00 2001 From: Michael Walle -Date: Tue, 6 Dec 2022 21:07:21 +0100 +Date: Mon, 6 Feb 2023 13:43:43 +0000 Subject: [PATCH] of: base: add of_parse_phandle_with_optional_args() Add a new variant of the of_parse_phandle_with_args() which treats the @@ -16,6 +16,8 @@ this property. Signed-off-by: Michael Walle Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20230206134356.839737-10-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman --- include/linux/of.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/target/linux/generic/backport-5.10/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch b/target/linux/generic/backport-5.10/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch index 95b0e60d564..0c45679e9dd 100644 --- a/target/linux/generic/backport-5.10/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch +++ b/target/linux/generic/backport-5.10/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch @@ -1,6 +1,6 @@ -From 4f4145c9fee8c7a445dbbbadceccce5391e6b287 Mon Sep 17 00:00:00 2001 +From ff24fed10ba414d19579e26e60b126fad2f2bb07 Mon Sep 17 00:00:00 2001 From: Michael Walle -Date: Tue, 6 Dec 2022 21:07:22 +0100 +Date: Mon, 6 Feb 2023 13:43:44 +0000 Subject: [PATCH] of: property: make #.*-cells optional for simple props Sometimes, future bindings for phandles will get additional arguments. @@ -13,19 +13,21 @@ Signed-off-by: Michael Walle Tested-by: Miquel Raynal Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20230206134356.839737-11-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman --- drivers/of/property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/of/property.c +++ b/drivers/of/property.c -@@ -1267,8 +1267,8 @@ static struct device_node *parse_suffix_ - if (strcmp_suffix(prop_name, suffix)) +@@ -1213,8 +1213,8 @@ static struct device_node *parse_prop_ce + if (strcmp(prop_name, list_name)) return NULL; -- if (of_parse_phandle_with_args(np, prop_name, cells_name, index, +- if (of_parse_phandle_with_args(np, list_name, cells_name, index, - &sup_args)) -+ if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index, ++ if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index, + &sup_args)) return NULL; diff --git a/target/linux/generic/backport-5.10/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch b/target/linux/generic/backport-5.10/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch index 5d1df95ff1e..75ade392324 100644 --- a/target/linux/generic/backport-5.10/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch +++ b/target/linux/generic/backport-5.10/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch @@ -1,6 +1,6 @@ -From 9cf9486a6a7e8a3d76154d0c506051ba3740e8b6 Mon Sep 17 00:00:00 2001 +From e2d8172043d2e50df19fcd59c11e5593de8188d7 Mon Sep 17 00:00:00 2001 From: Michael Walle -Date: Tue, 6 Dec 2022 21:07:23 +0100 +Date: Mon, 6 Feb 2023 13:43:45 +0000 Subject: [PATCH] of: property: add #nvmem-cell-cells property Bindings describe the new '#nvmem-cell-cells' property. Now that the @@ -11,6 +11,8 @@ Signed-off-by: Michael Walle Tested-by: Miquel Raynal Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20230206134356.839737-12-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman --- drivers/of/property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/generic/backport-5.10/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch b/target/linux/generic/backport-5.10/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch new file mode 100644 index 00000000000..eed9dcc54e4 --- /dev/null +++ b/target/linux/generic/backport-5.10/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch @@ -0,0 +1,37 @@ +From 553bd29700145e1849698985e9800f14e967da49 Mon Sep 17 00:00:00 2001 +From: Alexander Stein +Date: Tue, 7 Feb 2023 12:05:29 +0100 +Subject: [PATCH] of: device: Ignore modalias of reused nodes + +If of_node is reused, do not use that node's modalias. This will hide +the name of the actual device. This is rather prominent in USB glue +drivers creating a platform device for the host controller. + +Signed-off-by: Alexander Stein +Reviewed-by: Rob Herring +Link: https://lore.kernel.org/r/20230207110531.1060252-2-alexander.stein@ew.tq-group.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/of/device.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/of/device.c ++++ b/drivers/of/device.c +@@ -223,7 +223,7 @@ static ssize_t of_device_get_modalias(st + ssize_t csize; + ssize_t tsize; + +- if ((!dev) || (!dev->of_node)) ++ if ((!dev) || (!dev->of_node) || dev->of_node_reused) + return -ENODEV; + + /* Name & Type */ +@@ -338,7 +338,7 @@ int of_device_uevent_modalias(struct dev + { + int sl; + +- if ((!dev) || (!dev->of_node)) ++ if ((!dev) || (!dev->of_node) || dev->of_node_reused) + return -ENODEV; + + /* Devicetree modalias is tricky, we add it in 2 steps */ diff --git a/target/linux/generic/backport-5.10/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch b/target/linux/generic/backport-5.10/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch new file mode 100644 index 00000000000..64a2a20aa2c --- /dev/null +++ b/target/linux/generic/backport-5.10/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch @@ -0,0 +1,29 @@ +From 2295bed9bebe8d1eef276194fed5b5fbe89c5363 Mon Sep 17 00:00:00 2001 +From: Alexander Stein +Date: Tue, 7 Feb 2023 12:05:30 +0100 +Subject: [PATCH] of: device: Do not ignore error code in + of_device_uevent_modalias + +of_device_get_modalias might return an error code, propagate that one. +Otherwise the negative, signed integer is propagated to unsigned integer +for the comparison resulting in a huge 'sl' size. + +Signed-off-by: Alexander Stein +Reviewed-by: Rob Herring +Link: https://lore.kernel.org/r/20230207110531.1060252-3-alexander.stein@ew.tq-group.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/of/device.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/of/device.c ++++ b/drivers/of/device.c +@@ -347,6 +347,8 @@ int of_device_uevent_modalias(struct dev + + sl = of_device_get_modalias(dev, &env->buf[env->buflen-1], + sizeof(env->buf) - env->buflen); ++ if (sl < 0) ++ return sl; + if (sl >= (sizeof(env->buf) - env->buflen)) + return -ENOMEM; + env->buflen += sl; diff --git a/target/linux/generic/backport-5.10/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch b/target/linux/generic/backport-5.10/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch deleted file mode 100644 index 848ec3731ba..00000000000 --- a/target/linux/generic/backport-5.10/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch +++ /dev/null @@ -1,44 +0,0 @@ -From ef26c0349eb5a615dab2272d08d1d5de4ac9cd4c Mon Sep 17 00:00:00 2001 -From: Michael Walle -Date: Wed, 11 Jan 2023 00:30:56 +0100 -Subject: [PATCH] of: property: fix #nvmem-cell-cells parsing - -Commit 67b8497f005f ("of: property: make #.*-cells optional for simple -props") claims to make the cells-name property optional for simple -properties, but changed the code for the wrong property, i.e. for -DEFINE_SUFFIX_PROP(). Fix that. - -Fixes: 67b8497f005f ("of: property: make #.*-cells optional for simple props") -Reported-by: Peng Fan -Signed-off-by: Michael Walle -Acked-by: Rob Herring -Tested-by: Robert Marko -Signed-off-by: Srinivas Kandagatla ---- - drivers/of/property.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/drivers/of/property.c -+++ b/drivers/of/property.c -@@ -1213,8 +1213,8 @@ static struct device_node *parse_prop_ce - if (strcmp(prop_name, list_name)) - return NULL; - -- if (of_parse_phandle_with_args(np, list_name, cells_name, index, -- &sup_args)) -+ if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index, -+ &sup_args)) - return NULL; - - return sup_args.np; -@@ -1267,8 +1267,8 @@ static struct device_node *parse_suffix_ - if (strcmp_suffix(prop_name, suffix)) - return NULL; - -- if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index, -- &sup_args)) -+ if (of_parse_phandle_with_args(np, prop_name, cells_name, index, -+ &sup_args)) - return NULL; - - return sup_args.np; diff --git a/target/linux/generic/backport-5.15/827-v6.3-0001-of-base-add-of_parse_phandle_with_optional_args.patch b/target/linux/generic/backport-5.15/827-v6.3-0001-of-base-add-of_parse_phandle_with_optional_args.patch index b829f21cfac..2b2a60e096b 100644 --- a/target/linux/generic/backport-5.15/827-v6.3-0001-of-base-add-of_parse_phandle_with_optional_args.patch +++ b/target/linux/generic/backport-5.15/827-v6.3-0001-of-base-add-of_parse_phandle_with_optional_args.patch @@ -1,6 +1,6 @@ -From 8eddceb280f5deb8046fcb660de9f9f683b408b9 Mon Sep 17 00:00:00 2001 +From c5d264d4b527c96ae8903376a4b195df47b05203 Mon Sep 17 00:00:00 2001 From: Michael Walle -Date: Tue, 6 Dec 2022 21:07:21 +0100 +Date: Mon, 6 Feb 2023 13:43:43 +0000 Subject: [PATCH] of: base: add of_parse_phandle_with_optional_args() Add a new variant of the of_parse_phandle_with_args() which treats the @@ -16,6 +16,8 @@ this property. Signed-off-by: Michael Walle Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20230206134356.839737-10-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman --- include/linux/of.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/target/linux/generic/backport-5.15/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch b/target/linux/generic/backport-5.15/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch index 4cf11ca34bb..39d9fae7239 100644 --- a/target/linux/generic/backport-5.15/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch +++ b/target/linux/generic/backport-5.15/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch @@ -1,6 +1,6 @@ -From 4f4145c9fee8c7a445dbbbadceccce5391e6b287 Mon Sep 17 00:00:00 2001 +From ff24fed10ba414d19579e26e60b126fad2f2bb07 Mon Sep 17 00:00:00 2001 From: Michael Walle -Date: Tue, 6 Dec 2022 21:07:22 +0100 +Date: Mon, 6 Feb 2023 13:43:44 +0000 Subject: [PATCH] of: property: make #.*-cells optional for simple props Sometimes, future bindings for phandles will get additional arguments. @@ -13,19 +13,21 @@ Signed-off-by: Michael Walle Tested-by: Miquel Raynal Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20230206134356.839737-11-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman --- drivers/of/property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/of/property.c +++ b/drivers/of/property.c -@@ -1227,8 +1227,8 @@ static struct device_node *parse_suffix_ - if (strcmp_suffix(prop_name, suffix)) +@@ -1173,8 +1173,8 @@ static struct device_node *parse_prop_ce + if (strcmp(prop_name, list_name)) return NULL; -- if (of_parse_phandle_with_args(np, prop_name, cells_name, index, +- if (of_parse_phandle_with_args(np, list_name, cells_name, index, - &sup_args)) -+ if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index, ++ if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index, + &sup_args)) return NULL; diff --git a/target/linux/generic/backport-5.15/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch b/target/linux/generic/backport-5.15/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch index 8c047e685d3..774e793ca5a 100644 --- a/target/linux/generic/backport-5.15/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch +++ b/target/linux/generic/backport-5.15/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch @@ -1,6 +1,6 @@ -From 9cf9486a6a7e8a3d76154d0c506051ba3740e8b6 Mon Sep 17 00:00:00 2001 +From e2d8172043d2e50df19fcd59c11e5593de8188d7 Mon Sep 17 00:00:00 2001 From: Michael Walle -Date: Tue, 6 Dec 2022 21:07:23 +0100 +Date: Mon, 6 Feb 2023 13:43:45 +0000 Subject: [PATCH] of: property: add #nvmem-cell-cells property Bindings describe the new '#nvmem-cell-cells' property. Now that the @@ -11,6 +11,8 @@ Signed-off-by: Michael Walle Tested-by: Miquel Raynal Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20230206134356.839737-12-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman --- drivers/of/property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/generic/backport-5.15/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch b/target/linux/generic/backport-5.15/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch new file mode 100644 index 00000000000..39e4df09a25 --- /dev/null +++ b/target/linux/generic/backport-5.15/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch @@ -0,0 +1,37 @@ +From 553bd29700145e1849698985e9800f14e967da49 Mon Sep 17 00:00:00 2001 +From: Alexander Stein +Date: Tue, 7 Feb 2023 12:05:29 +0100 +Subject: [PATCH] of: device: Ignore modalias of reused nodes + +If of_node is reused, do not use that node's modalias. This will hide +the name of the actual device. This is rather prominent in USB glue +drivers creating a platform device for the host controller. + +Signed-off-by: Alexander Stein +Reviewed-by: Rob Herring +Link: https://lore.kernel.org/r/20230207110531.1060252-2-alexander.stein@ew.tq-group.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/of/device.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/of/device.c ++++ b/drivers/of/device.c +@@ -249,7 +249,7 @@ static ssize_t of_device_get_modalias(st + ssize_t csize; + ssize_t tsize; + +- if ((!dev) || (!dev->of_node)) ++ if ((!dev) || (!dev->of_node) || dev->of_node_reused) + return -ENODEV; + + /* Name & Type */ +@@ -369,7 +369,7 @@ int of_device_uevent_modalias(struct dev + { + int sl; + +- if ((!dev) || (!dev->of_node)) ++ if ((!dev) || (!dev->of_node) || dev->of_node_reused) + return -ENODEV; + + /* Devicetree modalias is tricky, we add it in 2 steps */ diff --git a/target/linux/generic/backport-5.15/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch b/target/linux/generic/backport-5.15/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch new file mode 100644 index 00000000000..b06e0f5c113 --- /dev/null +++ b/target/linux/generic/backport-5.15/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch @@ -0,0 +1,29 @@ +From 2295bed9bebe8d1eef276194fed5b5fbe89c5363 Mon Sep 17 00:00:00 2001 +From: Alexander Stein +Date: Tue, 7 Feb 2023 12:05:30 +0100 +Subject: [PATCH] of: device: Do not ignore error code in + of_device_uevent_modalias + +of_device_get_modalias might return an error code, propagate that one. +Otherwise the negative, signed integer is propagated to unsigned integer +for the comparison resulting in a huge 'sl' size. + +Signed-off-by: Alexander Stein +Reviewed-by: Rob Herring +Link: https://lore.kernel.org/r/20230207110531.1060252-3-alexander.stein@ew.tq-group.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/of/device.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/of/device.c ++++ b/drivers/of/device.c +@@ -378,6 +378,8 @@ int of_device_uevent_modalias(struct dev + + sl = of_device_get_modalias(dev, &env->buf[env->buflen-1], + sizeof(env->buf) - env->buflen); ++ if (sl < 0) ++ return sl; + if (sl >= (sizeof(env->buf) - env->buflen)) + return -ENOMEM; + env->buflen += sl; diff --git a/target/linux/generic/backport-5.15/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch b/target/linux/generic/backport-5.15/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch deleted file mode 100644 index f17cc1f4fa1..00000000000 --- a/target/linux/generic/backport-5.15/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch +++ /dev/null @@ -1,44 +0,0 @@ -From ef26c0349eb5a615dab2272d08d1d5de4ac9cd4c Mon Sep 17 00:00:00 2001 -From: Michael Walle -Date: Wed, 11 Jan 2023 00:30:56 +0100 -Subject: [PATCH] of: property: fix #nvmem-cell-cells parsing - -Commit 67b8497f005f ("of: property: make #.*-cells optional for simple -props") claims to make the cells-name property optional for simple -properties, but changed the code for the wrong property, i.e. for -DEFINE_SUFFIX_PROP(). Fix that. - -Fixes: 67b8497f005f ("of: property: make #.*-cells optional for simple props") -Reported-by: Peng Fan -Signed-off-by: Michael Walle -Acked-by: Rob Herring -Tested-by: Robert Marko -Signed-off-by: Srinivas Kandagatla ---- - drivers/of/property.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/drivers/of/property.c -+++ b/drivers/of/property.c -@@ -1173,8 +1173,8 @@ static struct device_node *parse_prop_ce - if (strcmp(prop_name, list_name)) - return NULL; - -- if (of_parse_phandle_with_args(np, list_name, cells_name, index, -- &sup_args)) -+ if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index, -+ &sup_args)) - return NULL; - - return sup_args.np; -@@ -1227,8 +1227,8 @@ static struct device_node *parse_suffix_ - if (strcmp_suffix(prop_name, suffix)) - return NULL; - -- if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index, -- &sup_args)) -+ if (of_parse_phandle_with_args(np, prop_name, cells_name, index, -+ &sup_args)) - return NULL; - - return sup_args.np; From 4662adef2ad02dc5903516f69da017dcecf392c9 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Fri, 17 Feb 2023 08:12:40 -0300 Subject: [PATCH 15/44] uencrypt: add support for mbedtls This commit includes some additional changes: - better handling of iv and keys in openssl/wolfssl variants - fix compiler warnings and whitespace - build all 3 variants as separate packages - adjust the new package name in targets' DEVICE_PACKAGES - remove PKG_FLAGS:=nonshared [Beeline SmartBox Flash - OK] Tested-by: Mikhail Zhilkin [after test: replaced a hardcoded IV size of 16 by cipher_info->iv_size] Signed-off-by: Eneas U de Queiroz --- package/utils/uencrypt/Makefile | 81 ++++--- package/utils/uencrypt/src/CMakeLists.txt | 25 ++- package/utils/uencrypt/src/uencrypt-mbedtls.c | 212 ++++++++++++++++++ .../src/{uencrypt.c => uencrypt-openssl.c} | 47 ++-- target/linux/ath79/image/generic-tp-link.mk | 2 +- target/linux/ramips/image/mt7621.mk | 4 +- 6 files changed, 314 insertions(+), 57 deletions(-) create mode 100644 package/utils/uencrypt/src/uencrypt-mbedtls.c rename package/utils/uencrypt/src/{uencrypt.c => uencrypt-openssl.c} (73%) diff --git a/package/utils/uencrypt/Makefile b/package/utils/uencrypt/Makefile index a9779e28258..21d2d96f4d2 100644 --- a/package/utils/uencrypt/Makefile +++ b/package/utils/uencrypt/Makefile @@ -4,55 +4,80 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uencrypt -PKG_RELEASE:=3 +PKG_RELEASE:=4 -PKG_FLAGS:=nonshared PKG_LICENSE:=GPL-2.0-or-later PKG_MAINTAINER:=Eneas U de Queiroz -PKG_CONFIG_DEPENDS:=\ - CONFIG_UENCRYPT_OPENSSL \ - CONFIG_UENCRYPT_WOLFSSL include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk CMAKE_INSTALL:=1 -CMAKE_OPTIONS+=$(if $(CONFIG_UENCRYPT_WOLFSSL),-DUSE_WOLFSSL=1) +ifeq ($(BUILD_VARIANT),mbedtls) + CMAKE_OPTIONS+=-DUSE_MBEDTLS=1 +else ifeq ($(BUILD_VARIANT),wolfssl) + CMAKE_OPTIONS+=-DUSE_WOLFSSL=1 +endif -define Package/uencrypt +define Package/uencrypt/default SECTION:=utils CATEGORY:=Base system - TITLE:=Decryption utility for Arcadyan WG4xx223 and TP-Link Deco S4 - DEPENDS:=+UENCRYPT_WOLFSSL:libwolfssl +UENCRYPT_OPENSSL:libopenssl + TITLE:=Small Decryption utility endef -define Package/uencrypt/description +define Package/uencrypt/default/description This is a small encrypton/decryption program. It defaults to AES-128-CBC, but supports any encryption provided by - the available openssl/wolfssl library. Even though it can - be used for regular encryption and decryption operations, + the crypto library. Even though it can be used for + non-critical* regular encryption and decryption operations, it is included here to unencrypt the configuration from mtd - on Arcadyan WG430223/WG443223 and TP-Link Deco S4 routers + on some devices. + + * Key and IV are exposed on cmdline + + This variant uses $(1) as crypto provider endef -define Package/uencrypt/config - if PACKAGE_uencrypt - choice - prompt "Crypto provider" - default UENCRYPT_WOLFSSL - - config UENCRYPT_OPENSSL - bool "OpenSSL" - - config UENCRYPT_WOLFSSL - bool "wolfSSL" - endchoice - endif +define Package/uencrypt-mbedtls + $(Package/uencrypt/default) + VARIANT:=mbedtls + TITLE+= using mbedTLS + DEPENDS:=+libmbedtls + CONFLICTS:=uencrypt-openssl uencrypt-wolfssl endef -define Package/uencrypt/install +Package/uencrypt-mbedtls/description= \ + $(call Package/uencrypt/default/description,mbedTLS) + +define Package/uencrypt-openssl + $(Package/uencrypt/default) + VARIANT:=openssl + TITLE+= using OpenSSL + DEPENDS:=+libopenssl + CONFLICTS:=uencrypt-wolfssl +endef + +Package/uencrypt-openssl/description= \ + $(call Package/uencrypt/default/description,OpenSSL) + +define Package/uencrypt-wolfssl + $(Package/uencrypt/default) + VARIANT:=wolfssl + TITLE+= using wolfSSL + DEPENDS:=+libwolfssl +endef + +Package/uencrypt-wolfssl/description= \ + $(call Package/uencrypt/default/description,wolfSSL) + +define Package/uencrypt/default/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/uencrypt $(1)/usr/bin endef +Package/uencrypt-openssl/install = $(Package/uencrypt/default/install) +Package/uencrypt-wolfssl/install = $(Package/uencrypt/default/install) +Package/uencrypt-mbedtls/install = $(Package/uencrypt/default/install) -$(eval $(call BuildPackage,uencrypt)) +$(eval $(call BuildPackage,uencrypt-mbedtls)) +$(eval $(call BuildPackage,uencrypt-openssl)) +$(eval $(call BuildPackage,uencrypt-wolfssl)) diff --git a/package/utils/uencrypt/src/CMakeLists.txt b/package/utils/uencrypt/src/CMakeLists.txt index cd25d2f12f6..eadb2eadb37 100644 --- a/package/utils/uencrypt/src/CMakeLists.txt +++ b/package/utils/uencrypt/src/CMakeLists.txt @@ -5,16 +5,27 @@ cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) project(uencrypt LANGUAGES C) option(USE_WOLFSSL "Use WolfSSL as crypto provider" OFF) -if (USE_WOLFSSL) - add_definitions(-DUSE_WOLFSSL) - find_library(WOLFSSL_LIBRARY wolfssl REQUIRED) - set(CRYPTO_LIBRARIES ${WOLFSSL_LIBRARY}) +option(USE_MBEDTLS "Use mbedTLS as crypto provider" OFF) +if (USE_MBEDTLS) + if (USE_WOLFSSL) + message(WARNING "USE_MBEDTLS and USE_WOLFSSL are both set. Building with USE_MBEDTLS.") + endif() + add_definitions(-DUSE_MBEDTLS) + find_library(MBEDCRYPTO_LIBRARY mbedcrypto REQUIRED) + set(CRYPTO_LIBRARIES ${MBEDCRYPTO_LIBRARY}) + add_executable(${PROJECT_NAME} ${PROJECT_NAME}-mbedtls.c) else() - find_package(OpenSSL REQUIRED) - set(CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) + add_executable(${PROJECT_NAME} ${PROJECT_NAME}-openssl.c) + if (USE_WOLFSSL) + add_definitions(-DUSE_WOLFSSL) + find_library(WOLFSSL_LIBRARY wolfssl REQUIRED) + set(CRYPTO_LIBRARIES ${WOLFSSL_LIBRARY}) + else() + find_package(OpenSSL REQUIRED) + set(CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) + endif() endif() -add_executable(${PROJECT_NAME} ${PROJECT_NAME}.c) target_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBRARIES}) install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) diff --git a/package/utils/uencrypt/src/uencrypt-mbedtls.c b/package/utils/uencrypt/src/uencrypt-mbedtls.c new file mode 100644 index 00000000000..731beaad0f6 --- /dev/null +++ b/package/utils/uencrypt/src/uencrypt-mbedtls.c @@ -0,0 +1,212 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright (C) 2023 Eneas Ulir de Queiroz + */ + +#include +#include +#include +#include +#include +#include +#include + +int do_crypt(FILE *infile, FILE *outfile, const mbedtls_cipher_info_t *cipher_info, + const unsigned char *key, const unsigned char *iv, int enc, int padding) +{ + mbedtls_cipher_context_t ctx; + unsigned char inbuf[1024], outbuf[1024 + MBEDTLS_MAX_BLOCK_LENGTH]; + size_t inlen, outlen; + int ret = 0; + int step; + + mbedtls_cipher_init(&ctx); + if ((ret = mbedtls_cipher_setup(&ctx, cipher_info))) { + fprintf(stderr, "Error: mbedtls_cipher_setup: %d\n", ret); + goto out; + } + step = iv ? 1024 : mbedtls_cipher_get_block_size(&ctx); + if ((ret = mbedtls_cipher_setkey(&ctx, key, (int) mbedtls_cipher_get_key_bitlen(&ctx), + enc ? MBEDTLS_ENCRYPT : MBEDTLS_DECRYPT))) { + fprintf(stderr, "Error: mbedtls_cipher_setkey: %d\n", ret); + goto out; + } + if (iv && (ret = mbedtls_cipher_set_iv(&ctx, iv, cipher_info->iv_size))) { + fprintf(stderr, "Error: mbedtls_cipher_set_iv: %d\n", ret); + goto out; + } + + if (cipher_info->block_size > 1) { + if (cipher_info->mode == MBEDTLS_MODE_CBC) { + if ((ret = mbedtls_cipher_set_padding_mode(&ctx, + padding ? MBEDTLS_PADDING_PKCS7 + : MBEDTLS_PADDING_NONE))) { + fprintf(stderr, "Error: mbedtls_cipher_set_padding_mode: %d\n", ret); + goto out; + } + } else { + if (cipher_info->mode != MBEDTLS_MODE_CBC && padding) { + fprintf(stderr, "Error: mbedTLS only supports padding with CBC ciphers.\n"); + goto out; + } + } + } + + if ((ret = mbedtls_cipher_reset(&ctx))) { + fprintf(stderr, "Error: mbedtls_cipher_reset: %d\n", ret); + goto out; + } + + for (;;) { + inlen = fread(inbuf, 1, step, infile); + if (inlen <= 0) + break; + if ((ret = mbedtls_cipher_update(&ctx, inbuf, inlen, outbuf, &outlen))) { + fprintf(stderr, "Error: mbedtls_cipher_update: %d\n", ret); + goto out; + } + fwrite(outbuf, 1, outlen, outfile); + } + if ((ret = mbedtls_cipher_finish(&ctx, outbuf, &outlen))) { + fprintf(stderr, "Error: mbedtls_cipher_finish: %d\n", ret); + goto out; + } + fwrite(outbuf, 1, outlen, outfile); + +out: + mbedtls_cipher_free(&ctx); + return ret; +} + +static void check_enc_dec(const int enc) +{ + if (enc == -1) + return; + fprintf(stderr, "Error: both -d and -e were specified.\n"); + exit(EXIT_FAILURE); +} + +static void check_cipher(const mbedtls_cipher_info_t *cipher_info) +{ + const int *list; + + if (cipher_info == NULL) { + fprintf(stderr, "Error: invalid cipher: %s.\n", optarg); + fprintf(stderr, "Supported ciphers: \n"); + for (list = mbedtls_cipher_list(); *list; list++) { + cipher_info = mbedtls_cipher_info_from_type(*list); + if (!cipher_info) + continue; + fprintf(stderr, "\t%s\n", cipher_info->name); + } + exit(EXIT_FAILURE); + } +} + +static void show_usage(const char* name) +{ + fprintf(stderr, "Usage: %s: [-d | -e] [-n] -k key [-i iv] [-c cipher]\n" + "-d = decrypt; -e = encrypt; -n = no padding\n", name); +} + +char *hexstr2buf(const char *str, size_t *len) +{ + char *buf; + size_t inlen = strlen(str); + + *len = 0; + if (inlen % 2) + return NULL; + + *len = inlen >> 1; + buf = malloc(*len); + for (size_t x = 0; x < *len; x++) + sscanf(str + x * 2, "%2hhx", buf + x); + return buf; +} + +static char* upperstr(char *str) { + for (char *s = str; *s; s++) + *s = toupper((unsigned char) *s); + return str; +} + +int main(int argc, char *argv[]) +{ + int enc = -1; + unsigned char *iv = NULL; + unsigned char *key = NULL; + size_t keylen = 0, ivlen = 0; + int opt; + int padding = 1; + const mbedtls_cipher_info_t *cipher_info = + mbedtls_cipher_info_from_type (MBEDTLS_CIPHER_AES_128_CBC); + int ret; + + while ((opt = getopt(argc, argv, "c:dei:k:n")) != -1) { + switch (opt) { + case 'c': + cipher_info = mbedtls_cipher_info_from_string(upperstr(optarg)); + check_cipher(cipher_info); + break; + case 'd': + check_enc_dec(enc); + enc = 0; + break; + case 'e': + check_enc_dec(enc); + enc = 1; + break; + case 'i': + iv = (unsigned char *) hexstr2buf((const char *)optarg, &ivlen); + if (iv == NULL) { + fprintf(stderr, "Error setting IV to %s. The IV should be encoded in hex.\n", + optarg); + exit(EINVAL); + } + break; + case 'k': + key = (unsigned char *) hexstr2buf((const char *)optarg, &keylen); + if (key == NULL) { + fprintf(stderr, "Error setting key to %s. The key should be encoded in hex.\n", + optarg); + exit(EINVAL); + } + break; + case 'n': + padding = 0; + break; + default: + show_usage(argv[0]); + exit(EINVAL); + } + } + if (cipher_info->iv_size) { + if (iv == NULL) { + fprintf(stderr, "Error: iv not set.\n"); + show_usage(argv[0]); + exit(EXIT_FAILURE); + } + if (ivlen != cipher_info->iv_size) { + fprintf(stderr, "Error: IV must be %d bytes; given IV is %zd bytes.\n", + cipher_info->iv_size, ivlen); + exit(EXIT_FAILURE); + } + } + if (key == NULL) { + fprintf(stderr, "Error: key not set.\n"); + show_usage(argv[0]); + exit(EXIT_FAILURE); + } + if (keylen != cipher_info->key_bitlen >> 3) { + fprintf(stderr, "Error: key must be %d bytes; given key is %zd bytes.\n", + cipher_info->key_bitlen >> 3, keylen); + exit(EXIT_FAILURE); + } + ret = do_crypt(stdin, stdout, cipher_info, key, iv, !!enc, padding); + if (iv) + memset(iv, 0, ivlen); + memset(key, 0, keylen); + free(iv); + free(key); + return ret; +} diff --git a/package/utils/uencrypt/src/uencrypt.c b/package/utils/uencrypt/src/uencrypt-openssl.c similarity index 73% rename from package/utils/uencrypt/src/uencrypt.c rename to package/utils/uencrypt/src/uencrypt-openssl.c index ab9a202cec0..ed094664438 100644 --- a/package/utils/uencrypt/src/uencrypt.c +++ b/package/utils/uencrypt/src/uencrypt-openssl.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-or-later - * Copyright (C) 2022 Eneas Ulir de Queiroz + * Copyright (C) 2022-2023 Eneas Ulir de Queiroz */ #include @@ -15,8 +15,8 @@ # include #endif -int do_crypt(FILE *infile, FILE *outfile, const EVP_CIPHER *cipher, const char *key, const char *iv, - int enc, int padding) +int do_crypt(FILE *infile, FILE *outfile, const EVP_CIPHER *cipher, const unsigned char *key, + const unsigned char *iv, int enc, int padding) { EVP_CIPHER_CTX *ctx; unsigned char inbuf[1024], outbuf[1024 + EVP_MAX_BLOCK_LENGTH]; @@ -63,12 +63,12 @@ static void print_ciphers(const OBJ_NAME *name,void *arg) { static void check_cipher(const EVP_CIPHER *cipher) { if (cipher == NULL) { - fprintf(stderr, "Error: invalid cipher: %s.\n", optarg); + fprintf(stderr, "Error: invalid cipher: %s.\n", optarg); #ifndef USE_WOLFSSL - fprintf(stderr, "Supported ciphers: \n", optarg); - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, print_ciphers, stderr); + fprintf(stderr, "Supported ciphers: \n"); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, print_ciphers, stderr); #endif - exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } @@ -83,10 +83,10 @@ int main(int argc, char *argv[]) int enc = -1; unsigned char *iv = NULL; unsigned char *key = NULL; - long len; + long ivlen = 0, keylen = 0; + int cipher_ivlen, cipher_keylen; int opt; int padding = 1; - int need_iv = 1; const EVP_CIPHER *cipher = EVP_aes_128_cbc(); int ret; @@ -95,9 +95,6 @@ int main(int argc, char *argv[]) case 'c': cipher = EVP_get_cipherbyname(optarg); check_cipher(cipher); - int arglen = strlen(optarg); - if (arglen > 3 && strncmp(optarg+arglen-3, "ecb", 3) == 0) //if ends with "ecb" - need_iv = 0; break; case 'd': check_enc_dec(enc); @@ -108,7 +105,7 @@ int main(int argc, char *argv[]) enc = 1; break; case 'i': - iv = OPENSSL_hexstr2buf((const char *)optarg, &len); + iv = OPENSSL_hexstr2buf((const char *)optarg, &ivlen); if (iv == NULL) { fprintf(stderr, "Error setting IV to %s. The IV should be encoded in hex.\n", optarg); @@ -116,7 +113,7 @@ int main(int argc, char *argv[]) } break; case 'k': - key = OPENSSL_hexstr2buf((const char *)optarg, &len); + key = OPENSSL_hexstr2buf((const char *)optarg, &keylen); if (key == NULL) { fprintf(stderr, "Error setting key to %s. The key should be encoded in hex.\n", optarg); @@ -131,16 +128,28 @@ int main(int argc, char *argv[]) exit(EINVAL); } } - if (need_iv && iv == NULL) { - fprintf(stderr, "Error: iv not set.\n"); - show_usage(argv[0]); - exit(EXIT_FAILURE); - } if (key == NULL) { fprintf(stderr, "Error: key not set.\n"); show_usage(argv[0]); exit(EXIT_FAILURE); } + if ((cipher_keylen = EVP_CIPHER_key_length(cipher)) != keylen) { + fprintf(stderr, "Error: key must be %d bytes; given key is %ld bytes.\n", + cipher_keylen, keylen); + exit(EXIT_FAILURE); + } + if ((cipher_ivlen = EVP_CIPHER_iv_length(cipher))) { + if (iv == NULL) { + fprintf(stderr, "Error: IV not set.\n"); + show_usage(argv[0]); + exit(EXIT_FAILURE); + } + if (cipher_ivlen != ivlen) { + fprintf(stderr, "Error: IV must be %d bytes; given IV is %ld bytes.\n", + cipher_ivlen, ivlen); + exit(EXIT_FAILURE); + } + } ret = do_crypt(stdin, stdout, cipher, key, iv, !!enc, padding); if (ret) fprintf(stderr, "Error during crypt operation.\n"); diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 314ece1e033..83361892937 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -509,7 +509,7 @@ define Device/tplink_deco-s4-v2 IMAGE_SIZE := 13824k DEVICE_MODEL := Deco S4 DEVICE_VARIANT := v2 - DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct uencrypt + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct uencrypt-mbedtls SUPPORTED_DEVICES += deco-s4-v2 TPLINK_BOARD_ID := DECO-S4-V2 endef diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 90b8bba2a56..07e63a5cf19 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -379,7 +379,7 @@ define Device/beeline_smartbox-flash IMAGES += factory.trx IMAGE/factory.trx := append-kernel | append-ubi | check-size IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware uencrypt + DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware uencrypt-mbedtls endef TARGET_DEVICES += beeline_smartbox-flash @@ -1587,7 +1587,7 @@ define Device/mts_wg430223 IMAGES += factory.trx IMAGE/factory.trx := append-kernel | append-ubi | check-size IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - DEVICE_PACKAGES := kmod-mt7615-firmware uencrypt + DEVICE_PACKAGES := kmod-mt7615-firmware uencrypt-mbedtls endef TARGET_DEVICES += mts_wg430223 From 1781e7408a62de72193ddff5dbf5d9ff772a5847 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Sat, 18 Feb 2023 23:19:31 -0300 Subject: [PATCH 16/44] uencrypt: split common and library-specific code This splits the code in 4 files: - uencrypt.h - uencrypt.c - main program - uencrypt-openssl.c - OpenSSL/wolfSSL implementation - uencrypt-mbedtls - mbedTLS implementation Other changes, accounting for ~400 bytes increase in ipk size: - more error condition checking and reporting, - hide key and iv command line arguments Signed-off-by: Eneas U de Queiroz --- package/utils/uencrypt/Makefile | 4 +- package/utils/uencrypt/src/CMakeLists.txt | 5 +- package/utils/uencrypt/src/uencrypt-mbedtls.c | 322 ++++++++---------- package/utils/uencrypt/src/uencrypt-openssl.c | 209 +++++------- package/utils/uencrypt/src/uencrypt.c | 105 ++++++ package/utils/uencrypt/src/uencrypt.h | 49 +++ 6 files changed, 391 insertions(+), 303 deletions(-) create mode 100644 package/utils/uencrypt/src/uencrypt.c create mode 100644 package/utils/uencrypt/src/uencrypt.h diff --git a/package/utils/uencrypt/Makefile b/package/utils/uencrypt/Makefile index 21d2d96f4d2..70ca655b6e8 100644 --- a/package/utils/uencrypt/Makefile +++ b/package/utils/uencrypt/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uencrypt -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_LICENSE:=GPL-2.0-or-later PKG_MAINTAINER:=Eneas U de Queiroz @@ -19,6 +19,8 @@ else ifeq ($(BUILD_VARIANT),wolfssl) CMAKE_OPTIONS+=-DUSE_WOLFSSL=1 endif +TARGET_CFLAGS+=-Wall + define Package/uencrypt/default SECTION:=utils CATEGORY:=Base system diff --git a/package/utils/uencrypt/src/CMakeLists.txt b/package/utils/uencrypt/src/CMakeLists.txt index eadb2eadb37..5e09954f0a2 100644 --- a/package/utils/uencrypt/src/CMakeLists.txt +++ b/package/utils/uencrypt/src/CMakeLists.txt @@ -13,9 +13,9 @@ if (USE_MBEDTLS) add_definitions(-DUSE_MBEDTLS) find_library(MBEDCRYPTO_LIBRARY mbedcrypto REQUIRED) set(CRYPTO_LIBRARIES ${MBEDCRYPTO_LIBRARY}) - add_executable(${PROJECT_NAME} ${PROJECT_NAME}-mbedtls.c) + set(CRYPTO_SOURCES ${PROJECT_NAME}-mbedtls.c) else() - add_executable(${PROJECT_NAME} ${PROJECT_NAME}-openssl.c) + set(CRYPTO_SOURCES ${PROJECT_NAME}-openssl.c) if (USE_WOLFSSL) add_definitions(-DUSE_WOLFSSL) find_library(WOLFSSL_LIBRARY wolfssl REQUIRED) @@ -25,6 +25,7 @@ else() set(CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) endif() endif() +add_executable(${PROJECT_NAME} ${PROJECT_NAME}.c ${PROJECT_NAME}.h ${CRYPTO_SOURCES}) target_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBRARIES}) diff --git a/package/utils/uencrypt/src/uencrypt-mbedtls.c b/package/utils/uencrypt/src/uencrypt-mbedtls.c index 731beaad0f6..34851261b79 100644 --- a/package/utils/uencrypt/src/uencrypt-mbedtls.c +++ b/package/utils/uencrypt/src/uencrypt-mbedtls.c @@ -3,115 +3,16 @@ */ #include -#include #include #include #include #include -#include +#include "uencrypt.h" -int do_crypt(FILE *infile, FILE *outfile, const mbedtls_cipher_info_t *cipher_info, - const unsigned char *key, const unsigned char *iv, int enc, int padding) +unsigned char *hexstr2buf(const char *str, long *len) { - mbedtls_cipher_context_t ctx; - unsigned char inbuf[1024], outbuf[1024 + MBEDTLS_MAX_BLOCK_LENGTH]; - size_t inlen, outlen; - int ret = 0; - int step; - - mbedtls_cipher_init(&ctx); - if ((ret = mbedtls_cipher_setup(&ctx, cipher_info))) { - fprintf(stderr, "Error: mbedtls_cipher_setup: %d\n", ret); - goto out; - } - step = iv ? 1024 : mbedtls_cipher_get_block_size(&ctx); - if ((ret = mbedtls_cipher_setkey(&ctx, key, (int) mbedtls_cipher_get_key_bitlen(&ctx), - enc ? MBEDTLS_ENCRYPT : MBEDTLS_DECRYPT))) { - fprintf(stderr, "Error: mbedtls_cipher_setkey: %d\n", ret); - goto out; - } - if (iv && (ret = mbedtls_cipher_set_iv(&ctx, iv, cipher_info->iv_size))) { - fprintf(stderr, "Error: mbedtls_cipher_set_iv: %d\n", ret); - goto out; - } - - if (cipher_info->block_size > 1) { - if (cipher_info->mode == MBEDTLS_MODE_CBC) { - if ((ret = mbedtls_cipher_set_padding_mode(&ctx, - padding ? MBEDTLS_PADDING_PKCS7 - : MBEDTLS_PADDING_NONE))) { - fprintf(stderr, "Error: mbedtls_cipher_set_padding_mode: %d\n", ret); - goto out; - } - } else { - if (cipher_info->mode != MBEDTLS_MODE_CBC && padding) { - fprintf(stderr, "Error: mbedTLS only supports padding with CBC ciphers.\n"); - goto out; - } - } - } - - if ((ret = mbedtls_cipher_reset(&ctx))) { - fprintf(stderr, "Error: mbedtls_cipher_reset: %d\n", ret); - goto out; - } - - for (;;) { - inlen = fread(inbuf, 1, step, infile); - if (inlen <= 0) - break; - if ((ret = mbedtls_cipher_update(&ctx, inbuf, inlen, outbuf, &outlen))) { - fprintf(stderr, "Error: mbedtls_cipher_update: %d\n", ret); - goto out; - } - fwrite(outbuf, 1, outlen, outfile); - } - if ((ret = mbedtls_cipher_finish(&ctx, outbuf, &outlen))) { - fprintf(stderr, "Error: mbedtls_cipher_finish: %d\n", ret); - goto out; - } - fwrite(outbuf, 1, outlen, outfile); - -out: - mbedtls_cipher_free(&ctx); - return ret; -} - -static void check_enc_dec(const int enc) -{ - if (enc == -1) - return; - fprintf(stderr, "Error: both -d and -e were specified.\n"); - exit(EXIT_FAILURE); -} - -static void check_cipher(const mbedtls_cipher_info_t *cipher_info) -{ - const int *list; - - if (cipher_info == NULL) { - fprintf(stderr, "Error: invalid cipher: %s.\n", optarg); - fprintf(stderr, "Supported ciphers: \n"); - for (list = mbedtls_cipher_list(); *list; list++) { - cipher_info = mbedtls_cipher_info_from_type(*list); - if (!cipher_info) - continue; - fprintf(stderr, "\t%s\n", cipher_info->name); - } - exit(EXIT_FAILURE); - } -} - -static void show_usage(const char* name) -{ - fprintf(stderr, "Usage: %s: [-d | -e] [-n] -k key [-i iv] [-c cipher]\n" - "-d = decrypt; -e = encrypt; -n = no padding\n", name); -} - -char *hexstr2buf(const char *str, size_t *len) -{ - char *buf; - size_t inlen = strlen(str); + unsigned char *buf; + long inlen = strlen(str); *len = 0; if (inlen % 2) @@ -119,94 +20,167 @@ char *hexstr2buf(const char *str, size_t *len) *len = inlen >> 1; buf = malloc(*len); - for (size_t x = 0; x < *len; x++) + for (long x = 0; x < *len; x++) sscanf(str + x * 2, "%2hhx", buf + x); return buf; } +const cipher_t *get_default_cipher(void) +{ + return mbedtls_cipher_info_from_type (MBEDTLS_CIPHER_AES_128_CBC); +} + static char* upperstr(char *str) { for (char *s = str; *s; s++) *s = toupper((unsigned char) *s); return str; } -int main(int argc, char *argv[]) +const cipher_t *get_cipher_or_print_error(char *name) { - int enc = -1; - unsigned char *iv = NULL; - unsigned char *key = NULL; - size_t keylen = 0, ivlen = 0; - int opt; - int padding = 1; - const mbedtls_cipher_info_t *cipher_info = - mbedtls_cipher_info_from_type (MBEDTLS_CIPHER_AES_128_CBC); + const mbedtls_cipher_info_t *cipher; + + cipher = mbedtls_cipher_info_from_string(upperstr(name)); + if (cipher) + return cipher; + + fprintf(stderr, "Error: invalid cipher: %s.\n", name); + fprintf(stderr, "Supported ciphers: \n"); + for (const int *list = mbedtls_cipher_list(); *list; list++) { + cipher = mbedtls_cipher_info_from_type(*list); + if (!cipher) + continue; + fprintf(stderr, "\t%s\n", cipher->name); + } + return NULL; +} + +int get_cipher_ivsize(const cipher_t *cipher) +{ + const mbedtls_cipher_info_t *c = cipher; + + return c->iv_size; +} + +int get_cipher_keysize(const cipher_t *cipher) +{ + const mbedtls_cipher_info_t *c = cipher; + + return c->key_bitlen >> 3; +} + +ctx_t *create_ctx(const cipher_t *cipher, const unsigned char *key, + const unsigned char *iv, int enc, int padding) +{ + mbedtls_cipher_context_t *ctx; + const mbedtls_cipher_info_t *cipher_info=cipher; int ret; - while ((opt = getopt(argc, argv, "c:dei:k:n")) != -1) { - switch (opt) { - case 'c': - cipher_info = mbedtls_cipher_info_from_string(upperstr(optarg)); - check_cipher(cipher_info); - break; - case 'd': - check_enc_dec(enc); - enc = 0; - break; - case 'e': - check_enc_dec(enc); - enc = 1; - break; - case 'i': - iv = (unsigned char *) hexstr2buf((const char *)optarg, &ivlen); - if (iv == NULL) { - fprintf(stderr, "Error setting IV to %s. The IV should be encoded in hex.\n", - optarg); - exit(EINVAL); - } - break; - case 'k': - key = (unsigned char *) hexstr2buf((const char *)optarg, &keylen); - if (key == NULL) { - fprintf(stderr, "Error setting key to %s. The key should be encoded in hex.\n", - optarg); - exit(EINVAL); - } - break; - case 'n': - padding = 0; - break; - default: - show_usage(argv[0]); - exit(EINVAL); + ctx = malloc(sizeof (mbedtls_cipher_context_t)); + if (!ctx) { + fprintf (stderr, "Error: create_ctx: out of memory.\n"); + return NULL; + } + + mbedtls_cipher_init(ctx); + ret = mbedtls_cipher_setup(ctx, cipher_info); + if (ret) { + fprintf(stderr, "Error: mbedtls_cipher_setup: %d\n", ret); + goto abort; + } + ret = mbedtls_cipher_setkey(ctx, key, + (int) mbedtls_cipher_get_key_bitlen(ctx), + enc ? MBEDTLS_ENCRYPT : MBEDTLS_DECRYPT); + if (ret) { + fprintf(stderr, "Error: mbedtls_cipher_setkey: %d\n", ret); + goto abort; + } + if (iv) { + ret = mbedtls_cipher_set_iv(ctx, iv, mbedtls_cipher_get_iv_size(ctx)); + if (ret) { + fprintf(stderr, "Error: mbedtls_cipher_set_iv: %d\n", ret); + goto abort; } } - if (cipher_info->iv_size) { - if (iv == NULL) { - fprintf(stderr, "Error: iv not set.\n"); - show_usage(argv[0]); - exit(EXIT_FAILURE); + + if (cipher_info->mode == MBEDTLS_MODE_CBC) { + ret = mbedtls_cipher_set_padding_mode(ctx, padding ? + MBEDTLS_PADDING_PKCS7 : + MBEDTLS_PADDING_NONE); + if (ret) { + fprintf(stderr, "Error: mbedtls_cipher_set_padding_mode: %d\n", + ret); + goto abort; } - if (ivlen != cipher_info->iv_size) { - fprintf(stderr, "Error: IV must be %d bytes; given IV is %zd bytes.\n", - cipher_info->iv_size, ivlen); - exit(EXIT_FAILURE); + } else { + if (cipher_info->block_size > 1 && padding) { + fprintf(stderr, + "Error: mbedTLS only allows padding with CBC ciphers.\n"); + goto abort; } } - if (key == NULL) { - fprintf(stderr, "Error: key not set.\n"); - show_usage(argv[0]); - exit(EXIT_FAILURE); + + ret = mbedtls_cipher_reset(ctx); + if (ret) { + fprintf(stderr, "Error: mbedtls_cipher_reset: %d\n", ret); + goto abort; + } + return ctx; + +abort: + free_ctx(ctx); + return NULL; +} + +int do_crypt(FILE *infile, FILE *outfile, ctx_t *ctx) +{ + unsigned char inbuf[CRYPT_BUF_SIZE]; + unsigned char outbuf[CRYPT_BUF_SIZE + MBEDTLS_MAX_BLOCK_LENGTH]; + size_t inlen, outlen, step; + int ret; + + if (mbedtls_cipher_get_cipher_mode(ctx) == MBEDTLS_MODE_ECB) { + step = mbedtls_cipher_get_block_size(ctx); + if (step > CRYPT_BUF_SIZE) { + step = CRYPT_BUF_SIZE; + } + } else { + step = CRYPT_BUF_SIZE; + } + + for (;;) { + inlen = fread(inbuf, 1, step, infile); + if (inlen <= 0) + break; + ret = mbedtls_cipher_update(ctx, inbuf, inlen, outbuf, &outlen); + if (ret) { + fprintf(stderr, "Error: mbedtls_cipher_update: %d\n", ret); + return ret; + } + ret = fwrite(outbuf, 1, outlen, outfile); + if (ret != outlen) { + fprintf(stderr, "Error: cipher_update short write.\n"); + return ret - outlen; + } + } + ret = mbedtls_cipher_finish(ctx, outbuf, &outlen); + if (ret) { + fprintf(stderr, "Error: mbedtls_cipher_finish: %d\n", ret); + return ret; + } + ret = fwrite(outbuf, 1, outlen, outfile); + if (ret != outlen) { + fprintf(stderr, "Error: cipher_finish short write.\n"); + return ret - outlen; + } + + return 0; +} + +void free_ctx(ctx_t *ctx) +{ + if (ctx) { + mbedtls_cipher_free(ctx); + free(ctx); } - if (keylen != cipher_info->key_bitlen >> 3) { - fprintf(stderr, "Error: key must be %d bytes; given key is %zd bytes.\n", - cipher_info->key_bitlen >> 3, keylen); - exit(EXIT_FAILURE); - } - ret = do_crypt(stdin, stdout, cipher_info, key, iv, !!enc, padding); - if (iv) - memset(iv, 0, ivlen); - memset(key, 0, keylen); - free(iv); - free(key); - return ret; } diff --git a/package/utils/uencrypt/src/uencrypt-openssl.c b/package/utils/uencrypt/src/uencrypt-openssl.c index ed094664438..d9182be2bae 100644 --- a/package/utils/uencrypt/src/uencrypt-openssl.c +++ b/package/utils/uencrypt/src/uencrypt-openssl.c @@ -2,56 +2,15 @@ * Copyright (C) 2022-2023 Eneas Ulir de Queiroz */ -#include #include #include #include #include +#include "uencrypt.h" -#ifdef USE_WOLFSSL -# include -# include -#else -# include -#endif - -int do_crypt(FILE *infile, FILE *outfile, const EVP_CIPHER *cipher, const unsigned char *key, - const unsigned char *iv, int enc, int padding) +const cipher_t *get_default_cipher(void) { - EVP_CIPHER_CTX *ctx; - unsigned char inbuf[1024], outbuf[1024 + EVP_MAX_BLOCK_LENGTH]; - int inlen, outlen; - - ctx = EVP_CIPHER_CTX_new(); - EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc); - EVP_CIPHER_CTX_set_padding(ctx, padding); - - for (;;) { - inlen = fread(inbuf, 1, 1024, infile); - if (inlen <= 0) - break; - if (!EVP_CipherUpdate(ctx, outbuf, &outlen, inbuf, inlen)) { - EVP_CIPHER_CTX_free(ctx); - return -1; - } - fwrite(outbuf, 1, outlen, outfile); - } - if (!EVP_CipherFinal_ex(ctx, outbuf, &outlen)) { - EVP_CIPHER_CTX_free(ctx); - return -1; - } - fwrite(outbuf, 1, outlen, outfile); - - EVP_CIPHER_CTX_free(ctx); - return 0; -} - -static void check_enc_dec(const int enc) -{ - if (enc == -1) - return; - fprintf(stderr, "Error: both -d and -e were specified.\n"); - exit(EXIT_FAILURE); + return EVP_aes_128_cbc(); } #ifndef USE_WOLFSSL @@ -60,100 +19,98 @@ static void print_ciphers(const OBJ_NAME *name,void *arg) { } #endif -static void check_cipher(const EVP_CIPHER *cipher) +const cipher_t *get_cipher_or_print_error(char *name) { - if (cipher == NULL) { - fprintf(stderr, "Error: invalid cipher: %s.\n", optarg); + const EVP_CIPHER *cipher; + + if ((cipher = EVP_get_cipherbyname(name))) + return cipher; + + fprintf(stderr, "Error: invalid cipher: %s.\n", name); #ifndef USE_WOLFSSL - fprintf(stderr, "Supported ciphers: \n"); - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, print_ciphers, stderr); + fprintf(stderr, "Supported ciphers: \n"); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, print_ciphers, stderr); #endif - exit(EXIT_FAILURE); - } + return NULL; } -static void show_usage(const char* name) +int get_cipher_ivsize(const cipher_t *cipher) { - fprintf(stderr, "Usage: %s: [-d | -e] [-n] -k key [-i iv] [-c cipher]\n" - "-d = decrypt; -e = encrypt; -n = no padding\n", name); + return EVP_CIPHER_iv_length(cipher); } -int main(int argc, char *argv[]) +int get_cipher_keysize(const cipher_t *cipher) { - int enc = -1; - unsigned char *iv = NULL; - unsigned char *key = NULL; - long ivlen = 0, keylen = 0; - int cipher_ivlen, cipher_keylen; - int opt; - int padding = 1; - const EVP_CIPHER *cipher = EVP_aes_128_cbc(); + return EVP_CIPHER_key_length(cipher); +} + +ctx_t *create_ctx(const cipher_t *cipher, const unsigned char *key, + const unsigned char *iv, int enc, int padding) +{ + EVP_CIPHER_CTX *ctx; int ret; - while ((opt = getopt(argc, argv, "c:dei:k:n")) != -1) { - switch (opt) { - case 'c': - cipher = EVP_get_cipherbyname(optarg); - check_cipher(cipher); - break; - case 'd': - check_enc_dec(enc); - enc = 0; - break; - case 'e': - check_enc_dec(enc); - enc = 1; - break; - case 'i': - iv = OPENSSL_hexstr2buf((const char *)optarg, &ivlen); - if (iv == NULL) { - fprintf(stderr, "Error setting IV to %s. The IV should be encoded in hex.\n", - optarg); - exit(EINVAL); - } - break; - case 'k': - key = OPENSSL_hexstr2buf((const char *)optarg, &keylen); - if (key == NULL) { - fprintf(stderr, "Error setting key to %s. The key should be encoded in hex.\n", - optarg); - exit(EINVAL); - } - break; - case 'n': - padding = 0; - break; - default: - show_usage(argv[0]); - exit(EINVAL); - } + ctx = EVP_CIPHER_CTX_new(); + if (!ctx) { + fprintf (stderr, "Error: create_ctx: out of memory.\n"); + return NULL; } - if (key == NULL) { - fprintf(stderr, "Error: key not set.\n"); - show_usage(argv[0]); - exit(EXIT_FAILURE); + ret = EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc); + if (!ret) { + fprintf(stderr, "Error:EVP_CipherInit_ex: %d\n", ret); + goto abort; } - if ((cipher_keylen = EVP_CIPHER_key_length(cipher)) != keylen) { - fprintf(stderr, "Error: key must be %d bytes; given key is %ld bytes.\n", - cipher_keylen, keylen); - exit(EXIT_FAILURE); + ret = EVP_CIPHER_CTX_set_padding(ctx, padding); + if (!ret) { + fprintf(stderr, "Error:EVP_CIPHER_CTX_set_padding: %d\n", ret); + goto abort; } - if ((cipher_ivlen = EVP_CIPHER_iv_length(cipher))) { - if (iv == NULL) { - fprintf(stderr, "Error: IV not set.\n"); - show_usage(argv[0]); - exit(EXIT_FAILURE); - } - if (cipher_ivlen != ivlen) { - fprintf(stderr, "Error: IV must be %d bytes; given IV is %ld bytes.\n", - cipher_ivlen, ivlen); - exit(EXIT_FAILURE); - } - } - ret = do_crypt(stdin, stdout, cipher, key, iv, !!enc, padding); - if (ret) - fprintf(stderr, "Error during crypt operation.\n"); - OPENSSL_free(iv); - OPENSSL_free(key); - return ret; + + return ctx; + +abort: + free_ctx(ctx); + return NULL; +} + + +int do_crypt(FILE *infile, FILE *outfile, ctx_t *ctx) +{ + unsigned char inbuf[CRYPT_BUF_SIZE]; + unsigned char outbuf[CRYPT_BUF_SIZE + EVP_MAX_BLOCK_LENGTH]; + int inlen, outlen; + int ret; + + for (;;) { + inlen = fread(inbuf, 1, CRYPT_BUF_SIZE, infile); + if (inlen <= 0) + break; + ret = EVP_CipherUpdate(ctx, outbuf, &outlen, inbuf, inlen); + if (!ret) { + fprintf(stderr, "Error: EVP_CipherUpdate: %d\n", ret); + return ret; + } + ret = fwrite(outbuf, 1, outlen, outfile); + if (ret != outlen) { + fprintf(stderr, "Error: CipherUpdate short write.\n"); + return ret - outlen; + } + } + ret = EVP_CipherFinal_ex(ctx, outbuf, &outlen); + if (!ret) { + fprintf(stderr, "Error: EVP_CipherFinal: %d\n", ret); + return ret; + } + ret = fwrite(outbuf, 1, outlen, outfile); + if (ret != outlen) { + fprintf(stderr, "Error: CipherFinal short write.\n"); + return ret - outlen; + } + + return 0; +} + +void free_ctx(ctx_t *ctx) +{ + EVP_CIPHER_CTX_free(ctx); } diff --git a/package/utils/uencrypt/src/uencrypt.c b/package/utils/uencrypt/src/uencrypt.c new file mode 100644 index 00000000000..36e17e220bb --- /dev/null +++ b/package/utils/uencrypt/src/uencrypt.c @@ -0,0 +1,105 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright (C) 2023 Eneas Ulir de Queiroz + */ + +#include +#include +#include +#include +#include + +#include "uencrypt.h" + +static void check_enc_dec(const int enc) +{ + if (enc == -1) + return; + fprintf(stderr, "Error: both -d and -e were specified.\n"); + exit(EXIT_FAILURE); +} + +static void show_usage(const char* name) +{ + fprintf(stderr, "Usage: %s: [-d | -e] [-n] -k key [-i iv] [-c cipher]\n" + "-d = decrypt; -e = encrypt; -n = no padding\n", name); +} + +static void uencrypt_clear_free(void *ptr, size_t len) +{ + if (ptr) { + memset(ptr, 0, len); + free(ptr); + } +} + +int main(int argc, char *argv[]) +{ + int enc = -1; + unsigned char *iv = NULL; + unsigned char *key = NULL; + long keylen = 0, ivlen = 0; + int opt; + int padding = 1; + const cipher_t *cipher = get_default_cipher(); + ctx_t* ctx; + int ret = EXIT_FAILURE; + + while ((opt = getopt(argc, argv, "c:dei:k:n")) != -1) { + switch (opt) { + case 'c': + if (!(cipher = get_cipher_or_print_error(optarg))) + exit(EXIT_FAILURE); + break; + case 'd': + check_enc_dec(enc); + enc = 0; + break; + case 'e': + check_enc_dec(enc); + enc = 1; + break; + case 'i': + iv = hexstr2buf(optarg, &ivlen); + if (iv == NULL) { + fprintf(stderr, "Error setting IV to %s. The IV should be encoded in hex.\n", + optarg); + exit(EINVAL); + } + memset(optarg, '*', strlen(optarg)); + break; + case 'k': + key = hexstr2buf(optarg, &keylen); + if (key == NULL) { + fprintf(stderr, "Error setting key to %s. The key should be encoded in hex.\n", + optarg); + exit(EINVAL); + } + memset(optarg, '*', strlen(optarg)); + break; + case 'n': + padding = 0; + break; + default: + show_usage(argv[0]); + exit(EINVAL); + } + } + if (ivlen != get_cipher_ivsize(cipher)) { + fprintf(stderr, "Error: IV must be %d bytes; given IV is %zd bytes.\n", + get_cipher_ivsize(cipher), ivlen); + exit(EXIT_FAILURE); + } + if (keylen != get_cipher_keysize(cipher)) { + fprintf(stderr, "Error: key must be %d bytes; given key is %zd bytes.\n", + get_cipher_keysize(cipher), keylen); + exit(EXIT_FAILURE); + } + ctx = create_ctx(cipher, key, iv, !!enc, padding); + if (ctx) { + ret = do_crypt(stdin, stdout, ctx); + free_ctx(ctx); + } + uencrypt_clear_free(iv, ivlen); + uencrypt_clear_free(key, keylen); + return ret; +} diff --git a/package/utils/uencrypt/src/uencrypt.h b/package/utils/uencrypt/src/uencrypt.h new file mode 100644 index 00000000000..a4fe1f33762 --- /dev/null +++ b/package/utils/uencrypt/src/uencrypt.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright (C) 2022-2023 Eneas Ulir de Queiroz + */ + +#include + +#define CRYPT_BUF_SIZE 1024 + +#ifdef USE_MBEDTLS +# include + +# if defined(MBEDTLS_MAX_BLOCK_LENGTH) \ + && MBEDTLS_MAX_BLOCK_LENGTH > CRYPT_BUF_SIZE +# undef CRYPT_BUF_SIZE +# define CRYPT_BUF_SIZE MAX_BLOCK_LENGTH +# endif + +unsigned char *hexstr2buf(const char* str, long *len); + +#else /* USE_MBEDTLS */ +# ifdef USE_WOLFSSL +# include +# include +# else +# include +# endif + +# if defined(EVP_MAX_BLOCK_LENGTH) \ + && EVP_MAX_BLOCK_LENGTH > CRYPT_BUF_SIZE +# undef CRYPT_BUF_SIZE +# define CRYPT_BUF_SIZE EVP_MAX_BLOCK_LENGTH +# endif + +# define hexstr2buf OPENSSL_hexstr2buf + +#endif /* USE_MBEDTLS */ + +typedef void cipher_t; +typedef void ctx_t; + +const cipher_t *get_default_cipher(void); +const cipher_t *get_cipher_or_print_error(char *name); +int get_cipher_ivsize(const cipher_t *cipher); +int get_cipher_keysize(const cipher_t *cipher); + +ctx_t *create_ctx(const cipher_t *cipher, const unsigned char *key, + const unsigned char *iv, int enc, int padding); +int do_crypt(FILE *infile, FILE *outfile, ctx_t *ctx); +void free_ctx(ctx_t *ctx); From 4692cffeaaadd144983c7b3ec0f2186895ff1f47 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sat, 11 Mar 2023 10:28:02 -0500 Subject: [PATCH 17/44] x86: set deprecated CONFIG_MICROCODE_OLD_INTERACE We use late loading[1] so need to set this option despite upstream adding a kernel taint when this option is set. See discussion in PR#12149 for more details. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/arch/x86/Kconfig?id=v5.15.100&id2=v5.15.98 1. https://github.com/openwrt/openwrt/blob/master/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode Signed-off-by: John Audia --- target/linux/x86/config-5.15 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/x86/config-5.15 b/target/linux/x86/config-5.15 index fba8dbac292..a3d8db26ae2 100644 --- a/target/linux/x86/config-5.15 +++ b/target/linux/x86/config-5.15 @@ -221,7 +221,7 @@ CONFIG_MEMFD_CREATE=y CONFIG_MICROCODE=y CONFIG_MICROCODE_AMD=y CONFIG_MICROCODE_INTEL=y -CONFIG_MICROCODE_OLD_INTERFACE=y +CONFIG_MICROCODE_LATE_LOADING=y CONFIG_MIGRATION=y # CONFIG_MK6 is not set # CONFIG_MK7 is not set From fbfec3286e8bfce3a78749b7bcb67e658665f197 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sat, 11 Mar 2023 10:42:26 -0500 Subject: [PATCH 18/44] kernel: tcindex classifier has been retired https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/net/sched?h=v5.15.100&id=7c183dc0af472dec33d2c0786a5e356baa8cad19 Signed-off-by: John Audia --- package/kernel/linux/modules/netsupport.mk | 3 +-- target/linux/generic/config-5.15 | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 22c39e86189..1f4f4363247 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -690,7 +690,7 @@ endef $(eval $(call KernelPackage,mppe)) -SCHED_MODULES_CORE = sch_ingress sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_gact act_mirred act_skbedit cls_matchall +SCHED_MODULES_CORE = sch_ingress sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_u32 em_u32 act_gact act_mirred act_skbedit cls_matchall SCHED_FILES_CORE = $(foreach mod,$(SCHED_MODULES_CORE),$(LINUX_DIR)/net/sched/$(mod).ko) define KernelPackage/sched-core @@ -708,7 +708,6 @@ define KernelPackage/sched-core CONFIG_NET_CLS_FLOW \ CONFIG_NET_CLS_FW \ CONFIG_NET_CLS_ROUTE4 \ - CONFIG_NET_CLS_TCINDEX \ CONFIG_NET_CLS_U32 \ CONFIG_NET_ACT_GACT \ CONFIG_NET_ACT_MIRRED \ diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index 5157b831db2..fbdfd5c68eb 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -4038,7 +4038,6 @@ CONFIG_NET_CLS_IND=y # CONFIG_NET_CLS_ROUTE4 is not set # CONFIG_NET_CLS_RSVP is not set # CONFIG_NET_CLS_RSVP6 is not set -# CONFIG_NET_CLS_TCINDEX is not set # CONFIG_NET_CLS_U32 is not set CONFIG_NET_CORE=y # CONFIG_NET_DEVLINK is not set From d6d8851d12e4c44badb8e268f9344d359d006ef0 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sun, 12 Mar 2023 10:16:50 -0400 Subject: [PATCH 19/44] kernel: bump 5.15 to 5.15.100 Manually rebased: bcm27xx/patches-5.15/950-0421-Support-RPi-DPI-interface-in-mode6-for-18-bit-color.patch bcm27xx/patches-5.15/950-0706-media-i2c-imx219-Scale-the-pixel-clock-rate-for-the-.patch ramips/patches-5.15/810-uvc-add-iPassion-iP2970-support.patch Removed upstreamed: bcm27xx/patches-5.15/950-0707-drm-vc4-For-DPI-MEDIA_BUS_FMT_RGB565_1X16-is-mode-1-.patch[1] bcm27xx/patches-5.15/950-0596-drm-vc4-dpi-Add-option-for-inverting-pixel-clock-and.patch[2] ipq807x/0006-v5.16-arm64-dts-qcom-Fix-IPQ8074-PCIe-PHY-nodes.patch [3] ipq807x/0034-v6.1-arm64-dts-qcom-ipq8074-fix-PCIe-PHY-serdes-size.patch [4] ipq807x/0103-arm64-dts-qcom-ipq8074-fix-Gen2-PCIe-QMP-PHY.patch [5] ipq807x/0104-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-QMP-PHY.patch [6] ipq807x/0105-arm64-dts-qcom-ipq8074-correct-Gen2-PCIe-ranges.patch [7] ipq807x/0108-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-node.patch [8] ipq807x/0109-arm64-dts-qcom-ipq8074-correct-PCIe-QMP-PHY-output-c.patch [9] ipq807x/0132-arm64-dts-qcom-ipq8074-correct-USB3-QMP-PHY-s-clock-.patch [10] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.99&id=d2991e6b30020e286f2dd9d3b4f43548c547caa6 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/gpu/drm/vc4/vc4_dpi.c?h=v5.15.100&id=8e04aaffb6de5f1ae61de7b671c1531172ccf429 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=a55a645aa303a3f7ec37db69822d5420657626da 4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=d9df682bcea57fa25f37bbf17eae56fa05662635 5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=7e6eeb5fb3aa9e5feffdb6e137dcc06f5f6410e1 6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=e88204931d9a60634cd50bbc679f045439c4b91d 7. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=1563af0f28afd3b6d64ac79a2aecced3969c90bf 8. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=feb8c71f015d416f1afe90e1f62cf51e47376c67 9. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=69c7a270357a7d50ffd3471b14c60250041200e3 10. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=dd3d021ae5471d98adf81f1e897431c8657d0a18 Build system: x86_64 Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3 Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia Tested-by: Robert Marko #ipq807x/Dynalink WRX36 Tested-by: Stefan Lippers-Hollmann #ipq807x/ax3600, x86_64/FW-7543B, ath79/tl-wdr3600, ipq806x/g10, ipq806x/nbg6817 --- include/kernel-5.15 | 4 +- ...for-the-Airoha-EN7523-SoC-SPI-contro.patch | 2 +- ...or-support-mtd-name-from-device-tree.patch | 4 +- .../patches-5.15/920-mikrotik-rb4xx.patch | 2 +- ...it-the-CEC-disable-enable-functions-.patch | 4 +- ...e-sure-the-device-is-powered-with-CE.patch | 4 +- ...c4-hdmi-Raise-the-maximum-clock-rate.patch | 2 +- ...-a-spinlock-to-protect-register-acce.patch | 80 ++++++------ ...-a-mutex-to-prevent-concurrent-frame.patch | 42 +++---- ...vent-access-to-crtc-state-outside-of.patch | 12 +- ...mi-Check-the-device-state-in-prepare.patch | 4 +- ...dmi-Introduce-an-output_enabled-flag.patch | 4 +- ...4-hdmi-Introduce-a-scdc_enabled-flag.patch | 2 +- ...rage-the-load-tracker-on-the-BCM2711.patch | 2 +- ...ually-check-for-the-connector-status.patch | 2 +- ...Set-base-to-0-give-expected-gpio-num.patch | 4 +- ...Better-coalescing-parameter-defaults.patch | 4 +- ...-link-energy-detect-powerdown-for-ex.patch | 2 +- ...t-Workaround-2-for-Pi4-Ethernet-fail.patch | 2 +- ...trl-bcm2835-Remove-gpiochip-on-error.patch | 2 +- ...et-bcmgenet-Reset-RBUF-on-first-open.patch | 8 +- ...-interface-in-mode6-for-18-bit-color.patch | 42 +++---- ...lane-Add-support-for-DRM_FORMAT_P030.patch | 12 +- ...d-support-for-YUV-color-encodings-an.patch | 12 +- ...gfs-node-that-dumps-the-current-disp.patch | 2 +- ...the-HDMI-registers-into-the-debugfs-.patch | 4 +- ...he-default-DPI-format-to-being-18bpp.patch | 6 +- ...mplify-the-connector-state-retrieval.patch | 2 +- ...-Sensor-should-report-RAW-color-spac.patch | 4 +- ...vc4-Add-support-for-gamma-on-BCM2711.patch | 2 +- ...gfs-node-that-dumps-the-vc5-gamma-PW.patch | 2 +- ...c4-Don-t-try-disabling-SCDC-on-Pi0-3.patch | 2 +- ...pport-for-composite-syncs-to-vc4_dpi.patch | 2 +- ...c4_hdmi-doesn-t-use-2711-HPD-registe.patch | 6 +- ...drm-vc4-Move-HDMI-reset-to-pm_resume.patch | 10 +- ...option-for-inverting-pixel-clock-and.patch | 114 ------------------ ...-Ensure-a-default-format-is-selected.patch | 12 +- ...ertise-embedded-data-node-on-media-p.patch | 32 ++--- ...c4_hdmi-output_enabled-for-allowing-.patch | 6 +- ...4-Fix-build-without-DRM_VC4_HDMI_CEC.patch | 2 +- ...4-Skip-writes-to-disabled-packet-RAM.patch | 4 +- ...drm_hdmi_avi_infoframe_colorspace-to.patch | 4 +- ...m-vc4-hdmi-Add-full-range-RGB-helper.patch | 2 +- ...e-full-range-helper-in-csc-functions.patch | 2 +- ...c4-hdmi-Move-XBAR-setup-to-csc_setup.patch | 2 +- ...lace-CSC_CTL-hardcoded-value-by-defi.patch | 2 +- ...4-hdmi-Change-CSC-callback-prototype.patch | 2 +- ...e-clock-validation-to-its-own-functi.patch | 6 +- ...e-clock-calculation-into-its-own-fun.patch | 6 +- ...e-the-sink-maximum-TMDS-clock-into-a.patch | 2 +- ...e-bpp-into-account-for-the-scrambler.patch | 2 +- ...i-Always-try-to-have-the-highest-bpc.patch | 8 +- ...drm-vc4-hdmi-Support-HDMI-YUV-output.patch | 14 +-- ...-Fix-no-video-output-on-DVI-monitors.patch | 2 +- ...ha_blend_mode-property-to-each-plane.patch | 8 +- ...-clock-value-used-for-validating-hdm.patch | 2 +- ...2c-Add-configuration-for-RPi-POE-HAT.patch | 2 +- ...-Broadcast-RGB-property-to-allow-ove.patch | 2 +- ...d-DRM-210101010-RGB-formats-for-hvs5.patch | 2 +- ...ort-DPI-interface-in-mode3-for-RGB56.patch | 4 +- ...-Scale-the-pixel-clock-rate-for-the-.patch | 42 +++---- ...MEDIA_BUS_FMT_RGB565_1X16-is-mode-1-.patch | 25 ---- ...4-hvs-Defer-dlist-slots-deallocation.patch | 2 +- ...1-drm-vc4-Support-zpos-on-all-planes.patch | 6 +- ...e-Keep-fractional-source-coords-insi.patch | 32 ++--- ...ractional-coordinates-using-the-phas.patch | 6 +- ...-Make-use-of-chroma-siting-parameter.patch | 6 +- ...2835-Only-return-non-GPIOs-to-inputs.patch | 4 +- ...4-hvs-Defer-dlist-slots-deallocation.patch | 2 +- ..._hdmi-Force-modeset-when-bpc-changes.patch | 4 +- ...VC4_HDMI_SCHEDULER_CONTROL_VERT_ALWA.patch | 2 +- ...i-Rework-hdmi_enable_4kp60-detection.patch | 4 +- ...event-async-update-if-we-don-t-have-.patch | 2 +- ...-Consolidate-Hardware-Revision-Check.patch | 12 +- ...gister-a-different-drm_plane_helper_.patch | 4 +- ...ild-use-Wdeclaration-after-statement.patch | 2 +- ...05-v5.17-02-Kbuild-move-to-std-gnu11.patch | 2 +- ...-use-std-gnu11-for-KBUILD_USERCFLAGS.patch | 2 +- ...-mm-multigenerational-lru-groundwork.patch | 2 +- ...multigenerational-lru-mm_struct-list.patch | 6 +- ...ek-mt7622-add-support-for-coherent-D.patch | 2 +- ...ek-mt7622-introduce-nodes-for-Wirele.patch | 6 +- ..._eth_soc-use-standard-property-for-c.patch | 2 +- ...Support-public-address-configuration.patch | 4 +- ...Fix-application-of-sizeof-to-pointer.patch | 2 +- ...Add-a-new-PID-VID-13d3-3567-for-MT79.patch | 2 +- ...Add-a-new-PID-VID-0489-e0c8-for-MT79.patch | 2 +- ...Add-a-new-VID-PID-0e8d-0608-for-MT79.patch | 2 +- .../721-net-add-packet-mangeling.patch | 2 +- .../generic/hack-5.15/902-debloat_proc.patch | 2 +- .../103-kbuild-export-SUBARCH.patch | 2 +- ...support-for-minor-aligned-partitions.patch | 6 +- ...mtd-device-named-ubi-or-data-on-boot.patch | 4 +- ...etfilter_match_bypass_default_checks.patch | 2 +- ...ng-with-source-address-failed-policy.patch | 14 +-- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 10 +- ...ns-init-debugfs-only-with-successful.patch | 2 +- ...-arm64-dts-qcom-ipq8074-add-SPMI-bus.patch | 2 +- ...pdate-BAM-DMA-node-name-per-DT-schem.patch | 2 +- ...4-dts-qcom-ipq8074-Add-QUP5-I2C-node.patch | 2 +- ...sm8996-Move-clock-cells-to-QMP-PHY-c.patch | 4 +- ...-dts-qcom-Fix-IPQ8074-PCIe-PHY-nodes.patch | 94 --------------- ...-arm64-dts-qcom-ipq8074-add-MDIO-bus.patch | 2 +- ...64-dts-qcom-ipq8074-add-SMEM-support.patch | 2 +- ...om-ipq8074-enable-the-GICv2m-support.patch | 2 +- ...pq8074-drop-the-clock-frequency-prop.patch | 2 +- ...lign-dmas-in-I2C-SPI-UART-with-DT-sc.patch | 8 +- ...lign-clocks-in-I2C-SPI-with-DT-schem.patch | 8 +- ...orrect-DWC3-node-names-and-unit-addr.patch | 4 +- ...pq8074-add-dedicated-qcom-ipq8074-dw.patch | 4 +- ...align-DWC3-USB-clocks-with-DT-schema.patch | 4 +- ...ts-qcom-Fix-sdhci-node-names-use-mmc.patch | 2 +- ...ix-ordering-of-clocks-clock-names-fo.patch | 2 +- ...s-qcom-ipq8074-add-USB-power-domains.patch | 6 +- ...pq8074-move-ARMv8-timer-out-of-SoC-n.patch | 4 +- ...-dts-qcom-ipq8074-add-reset-to-SDHCI.patch | 2 +- ...com-ipq8074-drop-USB-PHY-clock-index.patch | 4 +- ...arm64-dts-qcom-ipq8074-add-APCS-node.patch | 2 +- ...align-SDHCI-reg-names-with-DT-schema.patch | 2 +- ...com-ipq8074-fix-PCIe-PHY-serdes-size.patch | 37 ------ ...64-dts-qcom-ipq8074-add-A53-PLL-node.patch | 2 +- ...pq8074-correct-APCS-register-space-s.patch | 2 +- ...tsens-Add-support-for-combined-inter.patch | 6 +- ...tsens-Allow-configuring-min-and-max-.patch | 4 +- ...al-drivers-tsens-Add-IPQ8074-support.patch | 2 +- ...4-dts-qcom-ipq8074-add-thermal-nodes.patch | 4 +- ...-dts-qcom-ipq8074-add-clocks-to-APCS.patch | 2 +- ...pq8074-pass-XO-and-sleep-clocks-to-G.patch | 2 +- ...pq8074-align-TLMM-pin-configuration-.patch | 2 +- ...s-qcom-ipq8074-fix-Gen2-PCIe-QMP-PHY.patch | 28 ----- ...s-qcom-ipq8074-fix-Gen3-PCIe-QMP-PHY.patch | 55 --------- ...com-ipq8074-correct-Gen2-PCIe-ranges.patch | 29 ----- ...-dts-qcom-ipq8074-fix-Gen3-PCIe-node.patch | 97 --------------- ...pq8074-correct-PCIe-QMP-PHY-output-c.patch | 40 ------ ...pq8074-correct-USB3-QMP-PHY-s-clock-.patch | 52 -------- .../0001-MIPS-lantiq-add-pcie-driver.patch | 2 +- ...nor-Use-1-bit-mode-of-spansion-s25fs.patch | 2 +- .../104-mt7622-add-snor-irq.patch | 2 +- ...ver-for-MTK-SPI-NAND-Flash-Interface.patch | 2 +- ...dts-mediatek-add-mtk-snfi-for-mt7622.patch | 2 +- ...2-specify-the-number-of-DMA-requests.patch | 2 +- ...ek-Split-PCIe-node-for-MT2712-and-MT.patch | 2 +- ...s-mediatek-add-mt7622-pcie-slot-node.patch | 4 +- ...ediatek-add-support-for-coherent-DMA.patch | 4 +- ...a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch | 2 +- ...r-Gateworks-PLX-PEX860x-switch-with-.patch | 2 +- ...or-support-mtd-name-from-device-tree.patch | 4 +- .../810-uvc-add-iPassion-iP2970-support.patch | 22 ++-- ...SPI-ralink-add-Ralink-SoC-spi-driver.patch | 2 +- 149 files changed, 393 insertions(+), 966 deletions(-) delete mode 100644 target/linux/bcm27xx/patches-5.15/950-0596-drm-vc4-dpi-Add-option-for-inverting-pixel-clock-and.patch delete mode 100644 target/linux/bcm27xx/patches-5.15/950-0707-drm-vc4-For-DPI-MEDIA_BUS_FMT_RGB565_1X16-is-mode-1-.patch delete mode 100644 target/linux/ipq807x/patches-5.15/0006-v5.16-arm64-dts-qcom-Fix-IPQ8074-PCIe-PHY-nodes.patch delete mode 100644 target/linux/ipq807x/patches-5.15/0034-v6.1-arm64-dts-qcom-ipq8074-fix-PCIe-PHY-serdes-size.patch delete mode 100644 target/linux/ipq807x/patches-5.15/0103-arm64-dts-qcom-ipq8074-fix-Gen2-PCIe-QMP-PHY.patch delete mode 100644 target/linux/ipq807x/patches-5.15/0104-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-QMP-PHY.patch delete mode 100644 target/linux/ipq807x/patches-5.15/0105-arm64-dts-qcom-ipq8074-correct-Gen2-PCIe-ranges.patch delete mode 100644 target/linux/ipq807x/patches-5.15/0108-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-node.patch delete mode 100644 target/linux/ipq807x/patches-5.15/0109-arm64-dts-qcom-ipq8074-correct-PCIe-QMP-PHY-output-c.patch delete mode 100644 target/linux/ipq807x/patches-5.15/0132-arm64-dts-qcom-ipq8074-correct-USB3-QMP-PHY-s-clock-.patch diff --git a/include/kernel-5.15 b/include/kernel-5.15 index c251b660874..a05318146a9 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .98 -LINUX_KERNEL_HASH-5.15.98 = 7dc62cd3a45f95c9b60316a5886ea9406aee256308869dac1e4ec088fbb37787 +LINUX_VERSION-5.15 = .100 +LINUX_KERNEL_HASH-5.15.100 = f7a4ce870fc1ad879b49887f7f77ee79babdb66937d5acdb1465d53b388c1427 diff --git a/target/linux/airoha/patches-5.15/0005-spi-Add-support-for-the-Airoha-EN7523-SoC-SPI-contro.patch b/target/linux/airoha/patches-5.15/0005-spi-Add-support-for-the-Airoha-EN7523-SoC-SPI-contro.patch index 2c590f7fab9..8df11630c75 100644 --- a/target/linux/airoha/patches-5.15/0005-spi-Add-support-for-the-Airoha-EN7523-SoC-SPI-contro.patch +++ b/target/linux/airoha/patches-5.15/0005-spi-Add-support-for-the-Airoha-EN7523-SoC-SPI-contro.patch @@ -1,6 +1,6 @@ --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -308,6 +308,12 @@ config SPI_DLN2 +@@ -307,6 +307,12 @@ config SPI_DLN2 This driver can also be built as a module. If so, the module will be called spi-dln2. diff --git a/target/linux/ath79/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/ath79/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch index da3ca270fa4..163bafdb2e5 100644 --- a/target/linux/ath79/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch +++ b/target/linux/ath79/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch @@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -3098,6 +3098,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -3107,6 +3107,7 @@ int spi_nor_scan(struct spi_nor *nor, co struct device *dev = nor->dev; struct mtd_info *mtd = &nor->mtd; struct device_node *np = spi_nor_get_flash_node(nor); @@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma int ret; int i; -@@ -3152,7 +3153,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -3161,7 +3162,12 @@ int spi_nor_scan(struct spi_nor *nor, co if (ret) return ret; diff --git a/target/linux/ath79/patches-5.15/920-mikrotik-rb4xx.patch b/target/linux/ath79/patches-5.15/920-mikrotik-rb4xx.patch index d287b6de19b..4743ad46e25 100644 --- a/target/linux/ath79/patches-5.15/920-mikrotik-rb4xx.patch +++ b/target/linux/ath79/patches-5.15/920-mikrotik-rb4xx.patch @@ -45,7 +45,7 @@ Submitted-by: Christopher Hill --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig -@@ -2175,6 +2175,14 @@ config RAVE_SP_CORE +@@ -2176,6 +2176,14 @@ config RAVE_SP_CORE Select this to get support for the Supervisory Processor device found on several devices in RAVE line of hardware. diff --git a/target/linux/bcm27xx/patches-5.15/950-0001-drm-vc4-hdmi-Split-the-CEC-disable-enable-functions-.patch b/target/linux/bcm27xx/patches-5.15/950-0001-drm-vc4-hdmi-Split-the-CEC-disable-enable-functions-.patch index bb0b56fff16..b12b6843dfa 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0001-drm-vc4-hdmi-Split-the-CEC-disable-enable-functions-.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0001-drm-vc4-hdmi-Split-the-CEC-disable-enable-functions-.patch @@ -17,7 +17,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-5-maxi --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1748,7 +1748,7 @@ static irqreturn_t vc4_cec_irq_handler(i +@@ -1749,7 +1749,7 @@ static irqreturn_t vc4_cec_irq_handler(i return ret; } @@ -26,7 +26,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-5-maxi { struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); /* clock period in microseconds */ -@@ -1761,38 +1761,53 @@ static int vc4_hdmi_cec_adap_enable(stru +@@ -1762,38 +1762,53 @@ static int vc4_hdmi_cec_adap_enable(stru val |= ((4700 / usecs) << VC4_HDMI_CEC_CNT_TO_4700_US_SHIFT) | ((4500 / usecs) << VC4_HDMI_CEC_CNT_TO_4500_US_SHIFT); diff --git a/target/linux/bcm27xx/patches-5.15/950-0002-drm-vc4-hdmi-Make-sure-the-device-is-powered-with-CE.patch b/target/linux/bcm27xx/patches-5.15/950-0002-drm-vc4-hdmi-Make-sure-the-device-is-powered-with-CE.patch index 6132b810bdf..1904f182249 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0002-drm-vc4-hdmi-Make-sure-the-device-is-powered-with-CE.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0002-drm-vc4-hdmi-Make-sure-the-device-is-powered-with-CE.patch @@ -24,7 +24,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-6-maxi --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1753,8 +1753,14 @@ static int vc4_hdmi_cec_enable(struct ce +@@ -1754,8 +1754,14 @@ static int vc4_hdmi_cec_enable(struct ce struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); /* clock period in microseconds */ const u32 usecs = 1000000 / CEC_CLOCK_FREQ; @@ -40,7 +40,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-6-maxi val &= ~(VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET | VC4_HDMI_CEC_CNT_TO_4700_US_MASK | VC4_HDMI_CEC_CNT_TO_4500_US_MASK); -@@ -1797,6 +1803,8 @@ static int vc4_hdmi_cec_disable(struct c +@@ -1798,6 +1804,8 @@ static int vc4_hdmi_cec_disable(struct c HDMI_WRITE(HDMI_CEC_CNTRL_5, HDMI_READ(HDMI_CEC_CNTRL_5) | VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET); diff --git a/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch b/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch index 21d3148af75..020b56b8776 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch @@ -20,7 +20,7 @@ Link: https://lore.kernel.org/r/20211025152903.1088803-9-maxime@cerno.tech --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2386,7 +2386,7 @@ static const struct vc4_hdmi_variant bcm +@@ -2387,7 +2387,7 @@ static const struct vc4_hdmi_variant bcm .encoder_type = VC4_ENCODER_TYPE_HDMI0, .debugfs_name = "hdmi0_regs", .card_name = "vc4-hdmi-0", diff --git a/target/linux/bcm27xx/patches-5.15/950-0007-drm-vc4-hdmi-Add-a-spinlock-to-protect-register-acce.patch b/target/linux/bcm27xx/patches-5.15/950-0007-drm-vc4-hdmi-Add-a-spinlock-to-protect-register-acce.patch index fc802e56aa8..8691fdc49a1 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0007-drm-vc4-hdmi-Add-a-spinlock-to-protect-register-acce.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0007-drm-vc4-hdmi-Add-a-spinlock-to-protect-register-acce.patch @@ -281,9 +281,9 @@ Signed-off-by: Maxime Ripard } static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, -@@ -789,10 +856,13 @@ static void vc5_hdmi_set_timings(struct +@@ -790,10 +857,13 @@ static void vc5_hdmi_set_timings(struct VC4_SET_FIELD(mode->crtc_vtotal - - mode->crtc_vsync_end - interlaced, + mode->crtc_vsync_end, VC4_HDMI_VERTB_VBP)); + unsigned long flags; unsigned char gcp; @@ -295,7 +295,7 @@ Signed-off-by: Maxime Ripard HDMI_WRITE(HDMI_VEC_INTERFACE_XBAR, 0x354021); HDMI_WRITE(HDMI_HORZA, (vsync_pos ? VC5_HDMI_HORZA_VPOS : 0) | -@@ -856,13 +926,18 @@ static void vc5_hdmi_set_timings(struct +@@ -857,13 +927,18 @@ static void vc5_hdmi_set_timings(struct HDMI_WRITE(HDMI_MISC_CONTROL, reg); HDMI_WRITE(HDMI_CLOCK_STOP, 0); @@ -314,7 +314,7 @@ Signed-off-by: Maxime Ripard drift = HDMI_READ(HDMI_FIFO_CTL); drift &= VC4_HDMI_FIFO_VALID_WRITE_MASK; -@@ -870,12 +945,20 @@ static void vc4_hdmi_recenter_fifo(struc +@@ -871,12 +946,20 @@ static void vc4_hdmi_recenter_fifo(struc drift & ~VC4_HDMI_FIFO_CTL_RECENTER); HDMI_WRITE(HDMI_FIFO_CTL, drift | VC4_HDMI_FIFO_CTL_RECENTER); @@ -335,7 +335,7 @@ Signed-off-by: Maxime Ripard ret = wait_for(HDMI_READ(HDMI_FIFO_CTL) & VC4_HDMI_FIFO_CTL_RECENTER_DONE, 1); WARN_ONCE(ret, "Timeout waiting for " -@@ -909,6 +992,7 @@ static void vc4_hdmi_encoder_pre_crtc_co +@@ -910,6 +993,7 @@ static void vc4_hdmi_encoder_pre_crtc_co struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); unsigned long pixel_rate = vc4_conn_state->pixel_rate; unsigned long bvb_rate, hsm_rate; @@ -343,7 +343,7 @@ Signed-off-by: Maxime Ripard int ret; /* -@@ -977,11 +1061,15 @@ static void vc4_hdmi_encoder_pre_crtc_co +@@ -978,11 +1062,15 @@ static void vc4_hdmi_encoder_pre_crtc_co if (vc4_hdmi->variant->phy_init) vc4_hdmi->variant->phy_init(vc4_hdmi, vc4_conn_state); @@ -359,7 +359,7 @@ Signed-off-by: Maxime Ripard if (vc4_hdmi->variant->set_timings) vc4_hdmi->variant->set_timings(vc4_hdmi, conn_state, mode); -@@ -1001,6 +1089,7 @@ static void vc4_hdmi_encoder_pre_crtc_en +@@ -1002,6 +1090,7 @@ static void vc4_hdmi_encoder_pre_crtc_en struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode; struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); @@ -367,7 +367,7 @@ Signed-off-by: Maxime Ripard if (vc4_encoder->hdmi_monitor && drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED) { -@@ -1015,7 +1104,9 @@ static void vc4_hdmi_encoder_pre_crtc_en +@@ -1016,7 +1105,9 @@ static void vc4_hdmi_encoder_pre_crtc_en vc4_encoder->limited_rgb_range = false; } @@ -377,7 +377,7 @@ Signed-off-by: Maxime Ripard } static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, -@@ -1026,8 +1117,11 @@ static void vc4_hdmi_encoder_post_crtc_e +@@ -1027,8 +1118,11 @@ static void vc4_hdmi_encoder_post_crtc_e struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; @@ -389,7 +389,7 @@ Signed-off-by: Maxime Ripard HDMI_WRITE(HDMI_VID_CTL, VC4_HD_VID_CTL_ENABLE | VC4_HD_VID_CTL_CLRRGB | -@@ -1044,6 +1138,8 @@ static void vc4_hdmi_encoder_post_crtc_e +@@ -1045,6 +1139,8 @@ static void vc4_hdmi_encoder_post_crtc_e HDMI_READ(HDMI_SCHEDULER_CONTROL) | VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); @@ -398,7 +398,7 @@ Signed-off-by: Maxime Ripard ret = wait_for(HDMI_READ(HDMI_SCHEDULER_CONTROL) & VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE, 1000); WARN_ONCE(ret, "Timeout waiting for " -@@ -1056,6 +1152,8 @@ static void vc4_hdmi_encoder_post_crtc_e +@@ -1057,6 +1153,8 @@ static void vc4_hdmi_encoder_post_crtc_e HDMI_READ(HDMI_SCHEDULER_CONTROL) & ~VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); @@ -407,7 +407,7 @@ Signed-off-by: Maxime Ripard ret = wait_for(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) & VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE), 1000); WARN_ONCE(ret, "Timeout waiting for " -@@ -1063,6 +1161,8 @@ static void vc4_hdmi_encoder_post_crtc_e +@@ -1064,6 +1162,8 @@ static void vc4_hdmi_encoder_post_crtc_e } if (vc4_encoder->hdmi_monitor) { @@ -416,7 +416,7 @@ Signed-off-by: Maxime Ripard WARN_ON(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) & VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE)); HDMI_WRITE(HDMI_SCHEDULER_CONTROL, -@@ -1072,6 +1172,8 @@ static void vc4_hdmi_encoder_post_crtc_e +@@ -1073,6 +1173,8 @@ static void vc4_hdmi_encoder_post_crtc_e HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, VC4_HDMI_RAM_PACKET_ENABLE); @@ -425,7 +425,7 @@ Signed-off-by: Maxime Ripard vc4_hdmi_set_infoframes(encoder); } -@@ -1195,6 +1297,7 @@ static void vc4_hdmi_audio_set_mai_clock +@@ -1196,6 +1298,7 @@ static void vc4_hdmi_audio_set_mai_clock unsigned int samplerate) { u32 hsm_clock = clk_get_rate(vc4_hdmi->audio_clock); @@ -433,7 +433,7 @@ Signed-off-by: Maxime Ripard unsigned long n, m; rational_best_approximation(hsm_clock, samplerate, -@@ -1204,9 +1307,11 @@ static void vc4_hdmi_audio_set_mai_clock +@@ -1205,9 +1308,11 @@ static void vc4_hdmi_audio_set_mai_clock VC4_HD_MAI_SMP_M_SHIFT) + 1, &n, &m); @@ -445,7 +445,7 @@ Signed-off-by: Maxime Ripard } static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate) -@@ -1217,6 +1322,8 @@ static void vc4_hdmi_set_n_cts(struct vc +@@ -1218,6 +1323,8 @@ static void vc4_hdmi_set_n_cts(struct vc u32 n, cts; u64 tmp; @@ -454,7 +454,7 @@ Signed-off-by: Maxime Ripard n = 128 * samplerate / 1000; tmp = (u64)(mode->clock * 1000) * n; do_div(tmp, 128 * samplerate); -@@ -1246,6 +1353,7 @@ static int vc4_hdmi_audio_startup(struct +@@ -1247,6 +1354,7 @@ static int vc4_hdmi_audio_startup(struct { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; @@ -462,7 +462,7 @@ Signed-off-by: Maxime Ripard /* * If the HDMI encoder hasn't probed, or the encoder is -@@ -1257,12 +1365,14 @@ static int vc4_hdmi_audio_startup(struct +@@ -1258,12 +1366,14 @@ static int vc4_hdmi_audio_startup(struct vc4_hdmi->audio.streaming = true; @@ -477,7 +477,7 @@ Signed-off-by: Maxime Ripard if (vc4_hdmi->variant->phy_rng_enable) vc4_hdmi->variant->phy_rng_enable(vc4_hdmi); -@@ -1274,6 +1384,7 @@ static void vc4_hdmi_audio_reset(struct +@@ -1275,6 +1385,7 @@ static void vc4_hdmi_audio_reset(struct { struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; struct device *dev = &vc4_hdmi->pdev->dev; @@ -485,7 +485,7 @@ Signed-off-by: Maxime Ripard int ret; vc4_hdmi->audio.streaming = false; -@@ -1281,20 +1392,29 @@ static void vc4_hdmi_audio_reset(struct +@@ -1282,20 +1393,29 @@ static void vc4_hdmi_audio_reset(struct if (ret) dev_err(dev, "Failed to stop audio infoframe: %d\n", ret); @@ -515,7 +515,7 @@ Signed-off-by: Maxime Ripard if (vc4_hdmi->variant->phy_rng_disable) vc4_hdmi->variant->phy_rng_disable(vc4_hdmi); -@@ -1349,6 +1469,7 @@ static int vc4_hdmi_audio_prepare(struct +@@ -1350,6 +1470,7 @@ static int vc4_hdmi_audio_prepare(struct struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; unsigned int sample_rate = params->sample_rate; unsigned int channels = params->channels; @@ -523,7 +523,7 @@ Signed-off-by: Maxime Ripard u32 audio_packet_config, channel_mask; u32 channel_map; u32 mai_audio_format; -@@ -1357,14 +1478,15 @@ static int vc4_hdmi_audio_prepare(struct +@@ -1358,14 +1479,15 @@ static int vc4_hdmi_audio_prepare(struct dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__, sample_rate, params->sample_width, channels); @@ -541,7 +541,7 @@ Signed-off-by: Maxime Ripard mai_sample_rate = sample_rate_to_mai_fmt(sample_rate); if (params->iec.status[0] & IEC958_AES0_NONAUDIO && params->channels == 8) -@@ -1402,8 +1524,11 @@ static int vc4_hdmi_audio_prepare(struct +@@ -1403,8 +1525,11 @@ static int vc4_hdmi_audio_prepare(struct channel_map = vc4_hdmi->variant->channel_map(vc4_hdmi, channel_mask); HDMI_WRITE(HDMI_MAI_CHANNEL_MAP, channel_map); HDMI_WRITE(HDMI_AUDIO_PACKET_CONFIG, audio_packet_config); @@ -553,7 +553,7 @@ Signed-off-by: Maxime Ripard memcpy(&vc4_hdmi->audio.infoframe, ¶ms->cea, sizeof(params->cea)); vc4_hdmi_set_audio_infoframe(encoder); -@@ -1677,6 +1802,8 @@ static void vc4_cec_read_msg(struct vc4_ +@@ -1678,6 +1803,8 @@ static void vc4_cec_read_msg(struct vc4_ struct cec_msg *msg = &vc4_hdmi->cec_rx_msg; unsigned int i; @@ -562,7 +562,7 @@ Signed-off-by: Maxime Ripard msg->len = 1 + ((cntrl1 & VC4_HDMI_CEC_REC_WRD_CNT_MASK) >> VC4_HDMI_CEC_REC_WRD_CNT_SHIFT); -@@ -1695,11 +1822,12 @@ static void vc4_cec_read_msg(struct vc4_ +@@ -1696,11 +1823,12 @@ static void vc4_cec_read_msg(struct vc4_ } } @@ -577,7 +577,7 @@ Signed-off-by: Maxime Ripard cntrl1 = HDMI_READ(HDMI_CEC_CNTRL_1); vc4_hdmi->cec_tx_ok = cntrl1 & VC4_HDMI_CEC_TX_STATUS_GOOD; cntrl1 &= ~VC4_HDMI_CEC_START_XMIT_BEGIN; -@@ -1708,11 +1836,24 @@ static irqreturn_t vc4_cec_irq_handler_t +@@ -1709,11 +1837,24 @@ static irqreturn_t vc4_cec_irq_handler_t return IRQ_WAKE_THREAD; } @@ -603,7 +603,7 @@ Signed-off-by: Maxime Ripard vc4_hdmi->cec_rx_msg.len = 0; cntrl1 = HDMI_READ(HDMI_CEC_CNTRL_1); vc4_cec_read_msg(vc4_hdmi, cntrl1); -@@ -1725,6 +1866,18 @@ static irqreturn_t vc4_cec_irq_handler_r +@@ -1726,6 +1867,18 @@ static irqreturn_t vc4_cec_irq_handler_r return IRQ_WAKE_THREAD; } @@ -622,7 +622,7 @@ Signed-off-by: Maxime Ripard static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) { struct vc4_hdmi *vc4_hdmi = priv; -@@ -1735,14 +1888,17 @@ static irqreturn_t vc4_cec_irq_handler(i +@@ -1736,14 +1889,17 @@ static irqreturn_t vc4_cec_irq_handler(i if (!(stat & VC4_HDMI_CPU_CEC)) return IRQ_NONE; @@ -642,7 +642,7 @@ Signed-off-by: Maxime Ripard return ret; } -@@ -1751,6 +1907,7 @@ static int vc4_hdmi_cec_enable(struct ce +@@ -1752,6 +1908,7 @@ static int vc4_hdmi_cec_enable(struct ce struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); /* clock period in microseconds */ const u32 usecs = 1000000 / CEC_CLOCK_FREQ; @@ -650,7 +650,7 @@ Signed-off-by: Maxime Ripard u32 val; int ret; -@@ -1758,6 +1915,8 @@ static int vc4_hdmi_cec_enable(struct ce +@@ -1759,6 +1916,8 @@ static int vc4_hdmi_cec_enable(struct ce if (ret) return ret; @@ -659,7 +659,7 @@ Signed-off-by: Maxime Ripard val = HDMI_READ(HDMI_CEC_CNTRL_5); val &= ~(VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET | VC4_HDMI_CEC_CNT_TO_4700_US_MASK | -@@ -1788,12 +1947,17 @@ static int vc4_hdmi_cec_enable(struct ce +@@ -1789,12 +1948,17 @@ static int vc4_hdmi_cec_enable(struct ce if (!vc4_hdmi->variant->external_irq_controller) HDMI_WRITE(HDMI_CEC_CPU_MASK_CLEAR, VC4_HDMI_CPU_CEC); @@ -677,7 +677,7 @@ Signed-off-by: Maxime Ripard if (!vc4_hdmi->variant->external_irq_controller) HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, VC4_HDMI_CPU_CEC); -@@ -1801,6 +1965,8 @@ static int vc4_hdmi_cec_disable(struct c +@@ -1802,6 +1966,8 @@ static int vc4_hdmi_cec_disable(struct c HDMI_WRITE(HDMI_CEC_CNTRL_5, HDMI_READ(HDMI_CEC_CNTRL_5) | VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET); @@ -686,7 +686,7 @@ Signed-off-by: Maxime Ripard pm_runtime_put(&vc4_hdmi->pdev->dev); return 0; -@@ -1817,10 +1983,14 @@ static int vc4_hdmi_cec_adap_enable(stru +@@ -1818,10 +1984,14 @@ static int vc4_hdmi_cec_adap_enable(stru static int vc4_hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) { struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); @@ -701,7 +701,7 @@ Signed-off-by: Maxime Ripard return 0; } -@@ -1829,6 +1999,7 @@ static int vc4_hdmi_cec_adap_transmit(st +@@ -1830,6 +2000,7 @@ static int vc4_hdmi_cec_adap_transmit(st { struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); struct drm_device *dev = vc4_hdmi->connector.dev; @@ -709,7 +709,7 @@ Signed-off-by: Maxime Ripard u32 val; unsigned int i; -@@ -1837,6 +2008,8 @@ static int vc4_hdmi_cec_adap_transmit(st +@@ -1838,6 +2009,8 @@ static int vc4_hdmi_cec_adap_transmit(st return -ENOMEM; } @@ -718,7 +718,7 @@ Signed-off-by: Maxime Ripard for (i = 0; i < msg->len; i += 4) HDMI_WRITE(HDMI_CEC_TX_DATA_1 + (i >> 2), (msg->msg[i]) | -@@ -1852,6 +2025,9 @@ static int vc4_hdmi_cec_adap_transmit(st +@@ -1853,6 +2026,9 @@ static int vc4_hdmi_cec_adap_transmit(st val |= VC4_HDMI_CEC_START_XMIT_BEGIN; HDMI_WRITE(HDMI_CEC_CNTRL_1, val); @@ -728,7 +728,7 @@ Signed-off-by: Maxime Ripard return 0; } -@@ -1866,6 +2042,7 @@ static int vc4_hdmi_cec_init(struct vc4_ +@@ -1867,6 +2043,7 @@ static int vc4_hdmi_cec_init(struct vc4_ struct cec_connector_info conn_info; struct platform_device *pdev = vc4_hdmi->pdev; struct device *dev = &pdev->dev; @@ -736,7 +736,7 @@ Signed-off-by: Maxime Ripard u32 value; int ret; -@@ -1886,10 +2063,12 @@ static int vc4_hdmi_cec_init(struct vc4_ +@@ -1887,10 +2064,12 @@ static int vc4_hdmi_cec_init(struct vc4_ cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector); cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info); @@ -749,7 +749,7 @@ Signed-off-by: Maxime Ripard vc4_hdmi_cec_update_clk_div(vc4_hdmi); -@@ -1908,7 +2087,9 @@ static int vc4_hdmi_cec_init(struct vc4_ +@@ -1909,7 +2088,9 @@ static int vc4_hdmi_cec_init(struct vc4_ if (ret) goto err_remove_cec_rx_handler; } else { @@ -759,7 +759,7 @@ Signed-off-by: Maxime Ripard ret = request_threaded_irq(platform_get_irq(pdev, 0), vc4_cec_irq_handler, -@@ -2178,6 +2359,7 @@ static int vc4_hdmi_bind(struct device * +@@ -2179,6 +2360,7 @@ static int vc4_hdmi_bind(struct device * vc4_hdmi = devm_kzalloc(dev, sizeof(*vc4_hdmi), GFP_KERNEL); if (!vc4_hdmi) return -ENOMEM; diff --git a/target/linux/bcm27xx/patches-5.15/950-0008-drm-vc4-hdmi-Use-a-mutex-to-prevent-concurrent-frame.patch b/target/linux/bcm27xx/patches-5.15/950-0008-drm-vc4-hdmi-Use-a-mutex-to-prevent-concurrent-frame.patch index 2ca86efaa50..49470cdb472 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0008-drm-vc4-hdmi-Use-a-mutex-to-prevent-concurrent-frame.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0008-drm-vc4-hdmi-Use-a-mutex-to-prevent-concurrent-frame.patch @@ -169,7 +169,7 @@ Signed-off-by: Maxime Ripard } static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder) -@@ -995,6 +1024,8 @@ static void vc4_hdmi_encoder_pre_crtc_co +@@ -996,6 +1025,8 @@ static void vc4_hdmi_encoder_pre_crtc_co unsigned long flags; int ret; @@ -178,7 +178,7 @@ Signed-off-by: Maxime Ripard /* * As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must * be faster than pixel clock, infinitesimally faster, tested in -@@ -1015,13 +1046,13 @@ static void vc4_hdmi_encoder_pre_crtc_co +@@ -1016,13 +1047,13 @@ static void vc4_hdmi_encoder_pre_crtc_co ret = clk_set_min_rate(vc4_hdmi->hsm_clock, hsm_rate); if (ret) { DRM_ERROR("Failed to set HSM clock rate: %d\n", ret); @@ -194,7 +194,7 @@ Signed-off-by: Maxime Ripard } ret = clk_set_rate(vc4_hdmi->pixel_clock, pixel_rate); -@@ -1073,13 +1104,16 @@ static void vc4_hdmi_encoder_pre_crtc_co +@@ -1074,13 +1105,16 @@ static void vc4_hdmi_encoder_pre_crtc_co if (vc4_hdmi->variant->set_timings) vc4_hdmi->variant->set_timings(vc4_hdmi, conn_state, mode); @@ -212,7 +212,7 @@ Signed-off-by: Maxime Ripard return; } -@@ -1091,6 +1125,8 @@ static void vc4_hdmi_encoder_pre_crtc_en +@@ -1092,6 +1126,8 @@ static void vc4_hdmi_encoder_pre_crtc_en struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); unsigned long flags; @@ -221,7 +221,7 @@ Signed-off-by: Maxime Ripard if (vc4_encoder->hdmi_monitor && drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED) { if (vc4_hdmi->variant->csc_setup) -@@ -1107,6 +1143,8 @@ static void vc4_hdmi_encoder_pre_crtc_en +@@ -1108,6 +1144,8 @@ static void vc4_hdmi_encoder_pre_crtc_en spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N); spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); @@ -230,7 +230,7 @@ Signed-off-by: Maxime Ripard } static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, -@@ -1120,6 +1158,8 @@ static void vc4_hdmi_encoder_post_crtc_e +@@ -1121,6 +1159,8 @@ static void vc4_hdmi_encoder_post_crtc_e unsigned long flags; int ret; @@ -239,7 +239,7 @@ Signed-off-by: Maxime Ripard spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_VID_CTL, -@@ -1179,6 +1219,8 @@ static void vc4_hdmi_encoder_post_crtc_e +@@ -1180,6 +1220,8 @@ static void vc4_hdmi_encoder_post_crtc_e vc4_hdmi_recenter_fifo(vc4_hdmi); vc4_hdmi_enable_scrambling(encoder); @@ -248,7 +248,7 @@ Signed-off-by: Maxime Ripard } static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) -@@ -1322,6 +1364,7 @@ static void vc4_hdmi_set_n_cts(struct vc +@@ -1323,6 +1365,7 @@ static void vc4_hdmi_set_n_cts(struct vc u32 n, cts; u64 tmp; @@ -256,7 +256,7 @@ Signed-off-by: Maxime Ripard lockdep_assert_held(&vc4_hdmi->hw_lock); n = 128 * samplerate / 1000; -@@ -1355,13 +1398,17 @@ static int vc4_hdmi_audio_startup(struct +@@ -1356,13 +1399,17 @@ static int vc4_hdmi_audio_startup(struct struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; unsigned long flags; @@ -275,7 +275,7 @@ Signed-off-by: Maxime Ripard vc4_hdmi->audio.streaming = true; -@@ -1377,6 +1424,8 @@ static int vc4_hdmi_audio_startup(struct +@@ -1378,6 +1425,8 @@ static int vc4_hdmi_audio_startup(struct if (vc4_hdmi->variant->phy_rng_enable) vc4_hdmi->variant->phy_rng_enable(vc4_hdmi); @@ -284,7 +284,7 @@ Signed-off-by: Maxime Ripard return 0; } -@@ -1387,6 +1436,8 @@ static void vc4_hdmi_audio_reset(struct +@@ -1388,6 +1437,8 @@ static void vc4_hdmi_audio_reset(struct unsigned long flags; int ret; @@ -293,7 +293,7 @@ Signed-off-by: Maxime Ripard vc4_hdmi->audio.streaming = false; ret = vc4_hdmi_stop_packet(encoder, HDMI_INFOFRAME_TYPE_AUDIO, false); if (ret) -@@ -1406,6 +1457,8 @@ static void vc4_hdmi_audio_shutdown(stru +@@ -1407,6 +1458,8 @@ static void vc4_hdmi_audio_shutdown(stru struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); unsigned long flags; @@ -302,7 +302,7 @@ Signed-off-by: Maxime Ripard spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_MAI_CTL, -@@ -1420,6 +1473,8 @@ static void vc4_hdmi_audio_shutdown(stru +@@ -1421,6 +1474,8 @@ static void vc4_hdmi_audio_shutdown(stru vc4_hdmi->audio.streaming = false; vc4_hdmi_audio_reset(vc4_hdmi); @@ -311,7 +311,7 @@ Signed-off-by: Maxime Ripard } static int sample_rate_to_mai_fmt(int samplerate) -@@ -1478,6 +1533,8 @@ static int vc4_hdmi_audio_prepare(struct +@@ -1479,6 +1534,8 @@ static int vc4_hdmi_audio_prepare(struct dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__, sample_rate, params->sample_width, channels); @@ -320,7 +320,7 @@ Signed-off-by: Maxime Ripard vc4_hdmi_audio_set_mai_clock(vc4_hdmi, sample_rate); spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); -@@ -1532,6 +1589,8 @@ static int vc4_hdmi_audio_prepare(struct +@@ -1533,6 +1590,8 @@ static int vc4_hdmi_audio_prepare(struct memcpy(&vc4_hdmi->audio.infoframe, ¶ms->cea, sizeof(params->cea)); vc4_hdmi_set_audio_infoframe(encoder); @@ -329,7 +329,7 @@ Signed-off-by: Maxime Ripard return 0; } -@@ -1574,7 +1633,9 @@ static int vc4_hdmi_audio_get_eld(struct +@@ -1575,7 +1634,9 @@ static int vc4_hdmi_audio_get_eld(struct struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); struct drm_connector *connector = &vc4_hdmi->connector; @@ -339,7 +339,7 @@ Signed-off-by: Maxime Ripard return 0; } -@@ -1911,6 +1972,17 @@ static int vc4_hdmi_cec_enable(struct ce +@@ -1912,6 +1973,17 @@ static int vc4_hdmi_cec_enable(struct ce u32 val; int ret; @@ -357,7 +357,7 @@ Signed-off-by: Maxime Ripard ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); if (ret) return ret; -@@ -1957,6 +2029,17 @@ static int vc4_hdmi_cec_disable(struct c +@@ -1958,6 +2030,17 @@ static int vc4_hdmi_cec_disable(struct c struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); unsigned long flags; @@ -375,7 +375,7 @@ Signed-off-by: Maxime Ripard spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); if (!vc4_hdmi->variant->external_irq_controller) -@@ -1985,6 +2068,17 @@ static int vc4_hdmi_cec_adap_log_addr(st +@@ -1986,6 +2069,17 @@ static int vc4_hdmi_cec_adap_log_addr(st struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); unsigned long flags; @@ -393,7 +393,7 @@ Signed-off-by: Maxime Ripard spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_CEC_CNTRL_1, (HDMI_READ(HDMI_CEC_CNTRL_1) & ~VC4_HDMI_CEC_ADDR_MASK) | -@@ -2003,6 +2097,17 @@ static int vc4_hdmi_cec_adap_transmit(st +@@ -2004,6 +2098,17 @@ static int vc4_hdmi_cec_adap_transmit(st u32 val; unsigned int i; @@ -411,7 +411,7 @@ Signed-off-by: Maxime Ripard if (msg->len > 16) { drm_err(dev, "Attempting to transmit too much data (%d)\n", msg->len); return -ENOMEM; -@@ -2359,6 +2464,7 @@ static int vc4_hdmi_bind(struct device * +@@ -2360,6 +2465,7 @@ static int vc4_hdmi_bind(struct device * vc4_hdmi = devm_kzalloc(dev, sizeof(*vc4_hdmi), GFP_KERNEL); if (!vc4_hdmi) return -ENOMEM; diff --git a/target/linux/bcm27xx/patches-5.15/950-0009-drm-vc4-hdmi-Prevent-access-to-crtc-state-outside-of.patch b/target/linux/bcm27xx/patches-5.15/950-0009-drm-vc4-hdmi-Prevent-access-to-crtc-state-outside-of.patch index 117ccf3b06b..c298d2cdee9 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0009-drm-vc4-hdmi-Prevent-access-to-crtc-state-outside-of.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0009-drm-vc4-hdmi-Prevent-access-to-crtc-state-outside-of.patch @@ -73,7 +73,7 @@ Signed-off-by: Maxime Ripard return; if (delayed_work_pending(&vc4_hdmi->scrambling_work)) -@@ -1017,8 +1019,8 @@ static void vc4_hdmi_encoder_pre_crtc_co +@@ -1018,8 +1020,8 @@ static void vc4_hdmi_encoder_pre_crtc_co vc4_hdmi_encoder_get_connector_state(encoder, state); struct vc4_hdmi_connector_state *vc4_conn_state = conn_state_to_vc4_hdmi_conn_state(conn_state); @@ -83,7 +83,7 @@ Signed-off-by: Maxime Ripard unsigned long pixel_rate = vc4_conn_state->pixel_rate; unsigned long bvb_rate, hsm_rate; unsigned long flags; -@@ -1120,9 +1122,9 @@ out: +@@ -1121,9 +1123,9 @@ out: static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { @@ -95,7 +95,7 @@ Signed-off-by: Maxime Ripard unsigned long flags; mutex_lock(&vc4_hdmi->mutex); -@@ -1150,8 +1152,8 @@ static void vc4_hdmi_encoder_pre_crtc_en +@@ -1151,8 +1153,8 @@ static void vc4_hdmi_encoder_pre_crtc_en static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { @@ -105,7 +105,7 @@ Signed-off-by: Maxime Ripard struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; -@@ -1227,6 +1229,19 @@ static void vc4_hdmi_encoder_enable(stru +@@ -1228,6 +1230,19 @@ static void vc4_hdmi_encoder_enable(stru { } @@ -125,7 +125,7 @@ Signed-off-by: Maxime Ripard #define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL #define WIFI_2_4GHz_CH1_MAX_FREQ 2422000000ULL -@@ -1305,6 +1320,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_e +@@ -1306,6 +1321,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_e static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { .atomic_check = vc4_hdmi_encoder_atomic_check, @@ -133,7 +133,7 @@ Signed-off-by: Maxime Ripard .mode_valid = vc4_hdmi_encoder_mode_valid, .disable = vc4_hdmi_encoder_disable, .enable = vc4_hdmi_encoder_enable, -@@ -1358,9 +1374,7 @@ static void vc4_hdmi_audio_set_mai_clock +@@ -1359,9 +1375,7 @@ static void vc4_hdmi_audio_set_mai_clock static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate) { diff --git a/target/linux/bcm27xx/patches-5.15/950-0010-drm-vc4-hdmi-Check-the-device-state-in-prepare.patch b/target/linux/bcm27xx/patches-5.15/950-0010-drm-vc4-hdmi-Check-the-device-state-in-prepare.patch index cf78bb0b13f..31243f81048 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0010-drm-vc4-hdmi-Check-the-device-state-in-prepare.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0010-drm-vc4-hdmi-Check-the-device-state-in-prepare.patch @@ -19,7 +19,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1406,20 +1406,36 @@ static inline struct vc4_hdmi *dai_to_hd +@@ -1407,20 +1407,36 @@ static inline struct vc4_hdmi *dai_to_hd return snd_soc_card_get_drvdata(card); } @@ -63,7 +63,7 @@ Signed-off-by: Maxime Ripard mutex_unlock(&vc4_hdmi->mutex); return -ENODEV; } -@@ -1549,6 +1565,11 @@ static int vc4_hdmi_audio_prepare(struct +@@ -1550,6 +1566,11 @@ static int vc4_hdmi_audio_prepare(struct mutex_lock(&vc4_hdmi->mutex); diff --git a/target/linux/bcm27xx/patches-5.15/950-0011-drm-vc4-hdmi-Introduce-an-output_enabled-flag.patch b/target/linux/bcm27xx/patches-5.15/950-0011-drm-vc4-hdmi-Introduce-an-output_enabled-flag.patch index 40927805cf5..326fd7526bd 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0011-drm-vc4-hdmi-Introduce-an-output_enabled-flag.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0011-drm-vc4-hdmi-Introduce-an-output_enabled-flag.patch @@ -32,7 +32,7 @@ Signed-off-by: Maxime Ripard } static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable) -@@ -1227,6 +1232,11 @@ static void vc4_hdmi_encoder_post_crtc_e +@@ -1228,6 +1233,11 @@ static void vc4_hdmi_encoder_post_crtc_e static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) { @@ -44,7 +44,7 @@ Signed-off-by: Maxime Ripard } static void vc4_hdmi_encoder_atomic_mode_set(struct drm_encoder *encoder, -@@ -1408,14 +1418,12 @@ static inline struct vc4_hdmi *dai_to_hd +@@ -1409,14 +1419,12 @@ static inline struct vc4_hdmi *dai_to_hd static bool vc4_hdmi_audio_can_stream(struct vc4_hdmi *vc4_hdmi) { diff --git a/target/linux/bcm27xx/patches-5.15/950-0012-drm-vc4-hdmi-Introduce-a-scdc_enabled-flag.patch b/target/linux/bcm27xx/patches-5.15/950-0012-drm-vc4-hdmi-Introduce-a-scdc_enabled-flag.patch index b11ea057055..2a7ac223a76 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0012-drm-vc4-hdmi-Introduce-a-scdc_enabled-flag.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0012-drm-vc4-hdmi-Introduce-a-scdc_enabled-flag.patch @@ -69,7 +69,7 @@ Signed-off-by: Maxime Ripard if (delayed_work_pending(&vc4_hdmi->scrambling_work)) cancel_delayed_work_sync(&vc4_hdmi->scrambling_work); -@@ -2522,6 +2516,14 @@ static int vc4_hdmi_bind(struct device * +@@ -2523,6 +2517,14 @@ static int vc4_hdmi_bind(struct device * vc4_hdmi->pdev = pdev; vc4_hdmi->variant = variant; diff --git a/target/linux/bcm27xx/patches-5.15/950-0017-drm-vc4-Leverage-the-load-tracker-on-the-BCM2711.patch b/target/linux/bcm27xx/patches-5.15/950-0017-drm-vc4-Leverage-the-load-tracker-on-the-BCM2711.patch index 6f26f0f2817..f13a8c73ec3 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0017-drm-vc4-Leverage-the-load-tracker-on-the-BCM2711.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0017-drm-vc4-Leverage-the-load-tracker-on-the-BCM2711.patch @@ -109,7 +109,7 @@ Signed-off-by: Maxime Ripard */ --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -525,11 +525,6 @@ static void vc4_plane_calc_load(struct d +@@ -527,11 +527,6 @@ static void vc4_plane_calc_load(struct d struct vc4_plane_state *vc4_state; struct drm_crtc_state *crtc_state; unsigned int vscale_factor; diff --git a/target/linux/bcm27xx/patches-5.15/950-0021-drm-vc4-hdmi-Actually-check-for-the-connector-status.patch b/target/linux/bcm27xx/patches-5.15/950-0021-drm-vc4-hdmi-Actually-check-for-the-connector-status.patch index 54c5d9302c6..96913ed7b7c 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0021-drm-vc4-hdmi-Actually-check-for-the-connector-status.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0021-drm-vc4-hdmi-Actually-check-for-the-connector-status.patch @@ -44,7 +44,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1801,10 +1801,11 @@ static void vc4_hdmi_audio_exit(struct v +@@ -1802,10 +1802,11 @@ static void vc4_hdmi_audio_exit(struct v static irqreturn_t vc4_hdmi_hpd_irq_thread(int irq, void *priv) { struct vc4_hdmi *vc4_hdmi = priv; diff --git a/target/linux/bcm27xx/patches-5.15/950-0062-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch b/target/linux/bcm27xx/patches-5.15/950-0062-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch index c4360e12e8b..e4aef40745b 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0062-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0062-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch @@ -20,7 +20,7 @@ Signed-off-by: Phil Elwell --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c -@@ -378,7 +378,7 @@ static const struct gpio_chip bcm2835_gp +@@ -376,7 +376,7 @@ static const struct gpio_chip bcm2835_gp .get = bcm2835_gpio_get, .set = bcm2835_gpio_set, .set_config = gpiochip_generic_config, @@ -29,7 +29,7 @@ Signed-off-by: Phil Elwell .ngpio = BCM2835_NUM_GPIOS, .can_sleep = false, .of_gpio_ranges_fallback = bcm2835_of_gpio_ranges_fallback, -@@ -395,7 +395,7 @@ static const struct gpio_chip bcm2711_gp +@@ -393,7 +393,7 @@ static const struct gpio_chip bcm2711_gp .get = bcm2835_gpio_get, .set = bcm2835_gpio_set, .set_config = gpiochip_generic_config, diff --git a/target/linux/bcm27xx/patches-5.15/950-0144-bcmgenet-Better-coalescing-parameter-defaults.patch b/target/linux/bcm27xx/patches-5.15/950-0144-bcmgenet-Better-coalescing-parameter-defaults.patch index 17512cfcc2d..243605680b3 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0144-bcmgenet-Better-coalescing-parameter-defaults.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0144-bcmgenet-Better-coalescing-parameter-defaults.patch @@ -18,7 +18,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c -@@ -2608,7 +2608,7 @@ static void bcmgenet_init_tx_ring(struct +@@ -2616,7 +2616,7 @@ static void bcmgenet_init_tx_ring(struct bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_PROD_INDEX); bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_CONS_INDEX); @@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell /* Disable rate control for now */ bcmgenet_tdma_ring_writel(priv, index, flow_period_val, TDMA_FLOW_PERIOD); -@@ -4075,9 +4075,12 @@ static int bcmgenet_probe(struct platfor +@@ -4083,9 +4083,12 @@ static int bcmgenet_probe(struct platfor netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1); /* Set default coalescing parameters */ diff --git a/target/linux/bcm27xx/patches-5.15/950-0145-net-genet-enable-link-energy-detect-powerdown-for-ex.patch b/target/linux/bcm27xx/patches-5.15/950-0145-net-genet-enable-link-energy-detect-powerdown-for-ex.patch index f817fbc2b24..cde33a576e8 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0145-net-genet-enable-link-energy-detect-powerdown-for-ex.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0145-net-genet-enable-link-energy-detect-powerdown-for-ex.patch @@ -20,7 +20,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c -@@ -293,6 +293,8 @@ int bcmgenet_mii_probe(struct net_device +@@ -286,6 +286,8 @@ int bcmgenet_mii_probe(struct net_device /* Communicate the integrated PHY revision */ if (priv->internal_phy) phy_flags = priv->gphy_rev; diff --git a/target/linux/bcm27xx/patches-5.15/950-0165-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch b/target/linux/bcm27xx/patches-5.15/950-0165-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch index b2f4e6c8c0f..b1820827637 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0165-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0165-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch @@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell static inline void bcmgenet_writel(u32 value, void __iomem *offset) { -@@ -2439,6 +2442,11 @@ static void reset_umac(struct bcmgenet_p +@@ -2447,6 +2450,11 @@ static void reset_umac(struct bcmgenet_p bcmgenet_rbuf_ctrl_set(priv, 0); udelay(10); diff --git a/target/linux/bcm27xx/patches-5.15/950-0192-pinctrl-bcm2835-Remove-gpiochip-on-error.patch b/target/linux/bcm27xx/patches-5.15/950-0192-pinctrl-bcm2835-Remove-gpiochip-on-error.patch index 5f4c605a8e4..3c065b0ef10 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0192-pinctrl-bcm2835-Remove-gpiochip-on-error.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0192-pinctrl-bcm2835-Remove-gpiochip-on-error.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c -@@ -1339,7 +1339,7 @@ static int bcm2835_pinctrl_probe(struct +@@ -1337,7 +1337,7 @@ static int bcm2835_pinctrl_probe(struct girq->default_type = IRQ_TYPE_NONE; girq->handler = handle_level_irq; diff --git a/target/linux/bcm27xx/patches-5.15/950-0292-net-bcmgenet-Reset-RBUF-on-first-open.patch b/target/linux/bcm27xx/patches-5.15/950-0292-net-bcmgenet-Reset-RBUF-on-first-open.patch index 42df30457bd..cd50ba1802a 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0292-net-bcmgenet-Reset-RBUF-on-first-open.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0292-net-bcmgenet-Reset-RBUF-on-first-open.patch @@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c -@@ -3257,7 +3257,7 @@ static void bcmgenet_get_hw_addr(struct +@@ -3265,7 +3265,7 @@ static void bcmgenet_get_hw_addr(struct } /* Returns a reusable dma control register value */ @@ -33,7 +33,7 @@ Signed-off-by: Phil Elwell { unsigned int i; u32 reg; -@@ -3282,6 +3282,14 @@ static u32 bcmgenet_dma_disable(struct b +@@ -3290,6 +3290,14 @@ static u32 bcmgenet_dma_disable(struct b udelay(10); bcmgenet_umac_writel(priv, 0, UMAC_TX_FLUSH); @@ -48,7 +48,7 @@ Signed-off-by: Phil Elwell return dma_ctrl; } -@@ -3345,8 +3353,8 @@ static int bcmgenet_open(struct net_devi +@@ -3353,8 +3361,8 @@ static int bcmgenet_open(struct net_devi bcmgenet_set_hw_addr(priv, dev->dev_addr); @@ -59,7 +59,7 @@ Signed-off-by: Phil Elwell /* Reinitialize TDMA and RDMA and SW housekeeping */ ret = bcmgenet_init_dma(priv); -@@ -4204,7 +4212,7 @@ static int bcmgenet_resume(struct device +@@ -4212,7 +4220,7 @@ static int bcmgenet_resume(struct device bcmgenet_hfb_create_rxnfc_filter(priv, rule); /* Disable RX/TX DMA and flush TX queues */ diff --git a/target/linux/bcm27xx/patches-5.15/950-0421-Support-RPi-DPI-interface-in-mode6-for-18-bit-color.patch b/target/linux/bcm27xx/patches-5.15/950-0421-Support-RPi-DPI-interface-in-mode6-for-18-bit-color.patch index ef115fe2f5a..b4d5908aa0b 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0421-Support-RPi-DPI-interface-in-mode6-for-18-bit-color.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0421-Support-RPi-DPI-interface-in-mode6-for-18-bit-color.patch @@ -169,27 +169,27 @@ Signed-off-by: Joerg Quinten }, { --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c -@@ -165,10 +165,20 @@ static void vc4_dpi_encoder_enable(struc - dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, - DPI_FORMAT); - break; -+ case MEDIA_BUS_FMT_BGR666_1X24_CPADHI: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, -+ DPI_FORMAT); -+ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER); -+ break; - case MEDIA_BUS_FMT_RGB666_1X18: - dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, - DPI_FORMAT); - break; -+ case MEDIA_BUS_FMT_BGR666_1X18: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, -+ DPI_FORMAT); -+ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER); -+ break; - case MEDIA_BUS_FMT_RGB565_1X16: - dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3, - DPI_FORMAT); +@@ -167,10 +167,20 @@ static void vc4_dpi_encoder_enable(struc + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, + DPI_FORMAT); + break; ++ case MEDIA_BUS_FMT_BGR666_1X24_CPADHI: ++ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, ++ DPI_FORMAT); ++ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER); ++ break; + case MEDIA_BUS_FMT_RGB666_1X18: + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, + DPI_FORMAT); + break; ++ case MEDIA_BUS_FMT_BGR666_1X18: ++ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, ++ DPI_FORMAT); ++ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER); ++ break; + case MEDIA_BUS_FMT_RGB565_1X16: + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_1, + DPI_FORMAT); --- a/include/uapi/linux/media-bus-format.h +++ b/include/uapi/linux/media-bus-format.h @@ -34,7 +34,7 @@ diff --git a/target/linux/bcm27xx/patches-5.15/950-0422-drm-vc4-plane-Add-support-for-DRM_FORMAT_P030.patch b/target/linux/bcm27xx/patches-5.15/950-0422-drm-vc4-plane-Add-support-for-DRM_FORMAT_P030.patch index 3dc01372ead..43da4fad4e1 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0422-drm-vc4-plane-Add-support-for-DRM_FORMAT_P030.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0422-drm-vc4-plane-Add-support-for-DRM_FORMAT_P030.patch @@ -26,7 +26,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-3-maxime@cerno.tech } hvs_formats[] = { { .drm = DRM_FORMAT_XRGB8888, -@@ -128,6 +129,12 @@ static const struct hvs_format { +@@ -130,6 +131,12 @@ static const struct hvs_format { .hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_2PLANE, .pixel_order = HVS_PIXEL_ORDER_XYCRCB, }, @@ -39,7 +39,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-3-maxime@cerno.tech }; static const struct hvs_format *vc4_get_hvs_format(u32 drm_format) -@@ -758,47 +765,90 @@ static int vc4_plane_mode_set(struct drm +@@ -760,47 +767,90 @@ static int vc4_plane_mode_set(struct drm case DRM_FORMAT_MOD_BROADCOM_SAND128: case DRM_FORMAT_MOD_BROADCOM_SAND256: { uint32_t param = fourcc_mod_broadcom_param(fb->modifier); @@ -157,7 +157,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-3-maxime@cerno.tech } pitch0 = VC4_SET_FIELD(param, SCALER_TILE_HEIGHT); -@@ -951,7 +1001,8 @@ static int vc4_plane_mode_set(struct drm +@@ -953,7 +1003,8 @@ static int vc4_plane_mode_set(struct drm /* Pitch word 1/2 */ for (i = 1; i < num_planes; i++) { @@ -167,7 +167,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-3-maxime@cerno.tech vc4_dlist_write(vc4_state, VC4_SET_FIELD(fb->pitches[i], SCALER_SRC_PITCH)); -@@ -1311,6 +1362,13 @@ static bool vc4_format_mod_supported(str +@@ -1313,6 +1364,13 @@ static bool vc4_format_mod_supported(str default: return false; } @@ -181,7 +181,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-3-maxime@cerno.tech case DRM_FORMAT_RGBX1010102: case DRM_FORMAT_BGRX1010102: case DRM_FORMAT_RGBA1010102: -@@ -1343,8 +1401,11 @@ struct drm_plane *vc4_plane_init(struct +@@ -1345,8 +1403,11 @@ struct drm_plane *vc4_plane_init(struct struct drm_plane *plane = NULL; struct vc4_plane *vc4_plane; u32 formats[ARRAY_SIZE(hvs_formats)]; @@ -193,7 +193,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-3-maxime@cerno.tech static const uint64_t modifiers[] = { DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED, DRM_FORMAT_MOD_BROADCOM_SAND128, -@@ -1359,13 +1420,17 @@ struct drm_plane *vc4_plane_init(struct +@@ -1361,13 +1422,17 @@ struct drm_plane *vc4_plane_init(struct if (!vc4_plane) return ERR_PTR(-ENOMEM); diff --git a/target/linux/bcm27xx/patches-5.15/950-0423-drm-vc4-plane-Add-support-for-YUV-color-encodings-an.patch b/target/linux/bcm27xx/patches-5.15/950-0423-drm-vc4-plane-Add-support-for-YUV-color-encodings-an.patch index 8620d083dd5..d230566e61a 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0423-drm-vc4-plane-Add-support-for-YUV-color-encodings-an.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0423-drm-vc4-plane-Add-support-for-YUV-color-encodings-an.patch @@ -21,7 +21,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-4-maxime@cerno.tech --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -619,6 +619,51 @@ static int vc4_plane_allocate_lbm(struct +@@ -621,6 +621,51 @@ static int vc4_plane_allocate_lbm(struct return 0; } @@ -73,7 +73,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-4-maxime@cerno.tech /* Writes out a full display list for an active plane to the plane's * private dlist state. */ -@@ -1013,9 +1058,20 @@ static int vc4_plane_mode_set(struct drm +@@ -1015,9 +1060,20 @@ static int vc4_plane_mode_set(struct drm /* Colorspace conversion words */ if (vc4_state->is_yuv) { @@ -97,7 +97,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-4-maxime@cerno.tech } vc4_state->lbm_offset = 0; -@@ -1444,6 +1500,15 @@ struct drm_plane *vc4_plane_init(struct +@@ -1446,6 +1502,15 @@ struct drm_plane *vc4_plane_init(struct DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y); @@ -115,7 +115,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-4-maxime@cerno.tech --- a/drivers/gpu/drm/vc4/vc4_regs.h +++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -983,7 +983,10 @@ enum hvs_pixel_format { +@@ -989,7 +989,10 @@ enum hvs_pixel_format { #define SCALER_CSC0_COEF_CR_OFS_SHIFT 0 #define SCALER_CSC0_ITR_R_601_5 0x00f00000 #define SCALER_CSC0_ITR_R_709_3 0x00f00000 @@ -126,7 +126,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-4-maxime@cerno.tech /* S2.8 contribution of Cb to Green */ #define SCALER_CSC1_COEF_CB_GRN_MASK VC4_MASK(31, 22) -@@ -998,8 +1001,11 @@ enum hvs_pixel_format { +@@ -1004,8 +1007,11 @@ enum hvs_pixel_format { #define SCALER_CSC1_COEF_CR_BLU_MASK VC4_MASK(1, 0) #define SCALER_CSC1_COEF_CR_BLU_SHIFT 0 #define SCALER_CSC1_ITR_R_601_5 0xe73304a8 @@ -140,7 +140,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-4-maxime@cerno.tech /* S2.8 contribution of Cb to Red */ #define SCALER_CSC2_COEF_CB_RED_MASK VC4_MASK(29, 20) -@@ -1010,9 +1016,12 @@ enum hvs_pixel_format { +@@ -1016,9 +1022,12 @@ enum hvs_pixel_format { /* S2.8 contribution of Cb to Blue */ #define SCALER_CSC2_COEF_CB_BLU_MASK VC4_MASK(19, 10) #define SCALER_CSC2_COEF_CB_BLU_SHIFT 10 diff --git a/target/linux/bcm27xx/patches-5.15/950-0426-drm-vc4-Add-debugfs-node-that-dumps-the-current-disp.patch b/target/linux/bcm27xx/patches-5.15/950-0426-drm-vc4-Add-debugfs-node-that-dumps-the-current-disp.patch index 3fff69a674c..d7a5dcaff9f 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0426-drm-vc4-Add-debugfs-node-that-dumps-the-current-disp.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0426-drm-vc4-Add-debugfs-node-that-dumps-the-current-disp.patch @@ -59,7 +59,7 @@ Signed-off-by: Dave Stevenson /* The filter kernel is composed of dwords each containing 3 9-bit * signed integers packed next to each other. */ -@@ -728,6 +767,8 @@ static int vc4_hvs_bind(struct device *d +@@ -739,6 +778,8 @@ static int vc4_hvs_bind(struct device *d vc4_debugfs_add_regset32(drm, "hvs_regs", &hvs->regset); vc4_debugfs_add_file(drm, "hvs_underrun", vc4_hvs_debugfs_underrun, NULL); diff --git a/target/linux/bcm27xx/patches-5.15/950-0427-drm-vc4-Add-all-the-HDMI-registers-into-the-debugfs-.patch b/target/linux/bcm27xx/patches-5.15/950-0427-drm-vc4-Add-all-the-HDMI-registers-into-the-debugfs-.patch index f25a7254767..5ae2b9f480f 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0427-drm-vc4-Add-all-the-HDMI-registers-into-the-debugfs-.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0427-drm-vc4-Add-all-the-HDMI-registers-into-the-debugfs-.patch @@ -29,7 +29,7 @@ Signed-off-by: Dave Stevenson return 0; } -@@ -2369,6 +2375,7 @@ static int vc5_hdmi_init_resources(struc +@@ -2370,6 +2376,7 @@ static int vc5_hdmi_init_resources(struc struct platform_device *pdev = vc4_hdmi->pdev; struct device *dev = &pdev->dev; struct resource *res; @@ -37,7 +37,7 @@ Signed-off-by: Dave Stevenson res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi"); if (!res) -@@ -2465,6 +2472,38 @@ static int vc5_hdmi_init_resources(struc +@@ -2466,6 +2473,38 @@ static int vc5_hdmi_init_resources(struc return PTR_ERR(vc4_hdmi->reset); } diff --git a/target/linux/bcm27xx/patches-5.15/950-0431-drm-vc4-Change-the-default-DPI-format-to-being-18bpp.patch b/target/linux/bcm27xx/patches-5.15/950-0431-drm-vc4-Change-the-default-DPI-format-to-being-18bpp.patch index b278eb4dd25..8770de9f4ee 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0431-drm-vc4-Change-the-default-DPI-format-to-being-18bpp.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0431-drm-vc4-Change-the-default-DPI-format-to-being-18bpp.patch @@ -21,9 +21,9 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c -@@ -188,8 +188,8 @@ static void vc4_dpi_encoder_enable(struc - break; - } +@@ -198,8 +198,8 @@ static void vc4_dpi_encoder_enable(struc + if (connector->display_info.bus_flags & DRM_BUS_FLAG_DE_LOW) + dpi_c |= DPI_OUTPUT_ENABLE_INVERT; } else { - /* Default to 24bit if no connector found. */ - dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, DPI_FORMAT); diff --git a/target/linux/bcm27xx/patches-5.15/950-0442-drm-vc4-hdmi-Simplify-the-connector-state-retrieval.patch b/target/linux/bcm27xx/patches-5.15/950-0442-drm-vc4-hdmi-Simplify-the-connector-state-retrieval.patch index aa7f0b5ae59..01d9daa05ab 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0442-drm-vc4-hdmi-Simplify-the-connector-state-retrieval.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0442-drm-vc4-hdmi-Simplify-the-connector-state-retrieval.patch @@ -15,7 +15,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1011,30 +1011,15 @@ static void vc4_hdmi_recenter_fifo(struc +@@ -1012,30 +1012,15 @@ static void vc4_hdmi_recenter_fifo(struc "VC4_HDMI_FIFO_CTL_RECENTER_DONE"); } diff --git a/target/linux/bcm27xx/patches-5.15/950-0535-media-i2c-imx219-Sensor-should-report-RAW-color-spac.patch b/target/linux/bcm27xx/patches-5.15/950-0535-media-i2c-imx219-Sensor-should-report-RAW-color-spac.patch index 6a4f26252ff..c63a136ac90 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0535-media-i2c-imx219-Sensor-should-report-RAW-color-spac.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0535-media-i2c-imx219-Sensor-should-report-RAW-color-spac.patch @@ -13,7 +13,7 @@ Signed-off-by: David Plowman --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c -@@ -674,7 +674,7 @@ static void imx219_set_default_format(st +@@ -584,7 +584,7 @@ static void imx219_set_default_format(st fmt = &imx219->fmt; fmt->code = MEDIA_BUS_FMT_SRGGB10_1X10; @@ -22,7 +22,7 @@ Signed-off-by: David Plowman fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace); fmt->quantization = V4L2_MAP_QUANTIZATION_DEFAULT(true, fmt->colorspace, -@@ -844,7 +844,7 @@ static int imx219_enum_frame_size(struct +@@ -754,7 +754,7 @@ static int imx219_enum_frame_size(struct static void imx219_reset_colorspace(struct v4l2_mbus_framefmt *fmt) { diff --git a/target/linux/bcm27xx/patches-5.15/950-0551-drm-vc4-Add-support-for-gamma-on-BCM2711.patch b/target/linux/bcm27xx/patches-5.15/950-0551-drm-vc4-Add-support-for-gamma-on-BCM2711.patch index 555636515c3..302adfe984c 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0551-drm-vc4-Add-support-for-gamma-on-BCM2711.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0551-drm-vc4-Add-support-for-gamma-on-BCM2711.patch @@ -241,7 +241,7 @@ Signed-off-by: Maxime Ripard /* Unsetting DISPBKGND_GAMMA skips the gamma lut step --- a/drivers/gpu/drm/vc4/vc4_regs.h +++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -499,6 +499,28 @@ +@@ -505,6 +505,28 @@ #define SCALER_DLIST_START 0x00002000 #define SCALER_DLIST_SIZE 0x00004000 diff --git a/target/linux/bcm27xx/patches-5.15/950-0552-drm-vc4-Add-debugfs-node-that-dumps-the-vc5-gamma-PW.patch b/target/linux/bcm27xx/patches-5.15/950-0552-drm-vc4-Add-debugfs-node-that-dumps-the-vc5-gamma-PW.patch index 7dbc6483dca..4708dca62fb 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0552-drm-vc4-Add-debugfs-node-that-dumps-the-vc5-gamma-PW.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0552-drm-vc4-Add-debugfs-node-that-dumps-the-vc5-gamma-PW.patch @@ -102,7 +102,7 @@ Signed-off-by: Maxime Ripard /* The filter kernel is composed of dwords each containing 3 9-bit * signed integers packed next to each other. */ -@@ -848,6 +926,9 @@ static int vc4_hvs_bind(struct device *d +@@ -859,6 +937,9 @@ static int vc4_hvs_bind(struct device *d NULL); vc4_debugfs_add_file(drm, "hvs_dlists", vc4_hvs_debugfs_dlist, NULL); diff --git a/target/linux/bcm27xx/patches-5.15/950-0572-drm-vc4-Don-t-try-disabling-SCDC-on-Pi0-3.patch b/target/linux/bcm27xx/patches-5.15/950-0572-drm-vc4-Don-t-try-disabling-SCDC-on-Pi0-3.patch index 6b7acd8e4a4..3bb136f3c0f 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0572-drm-vc4-Don-t-try-disabling-SCDC-on-Pi0-3.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0572-drm-vc4-Don-t-try-disabling-SCDC-on-Pi0-3.patch @@ -20,7 +20,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2557,7 +2557,8 @@ static int vc4_hdmi_bind(struct device * +@@ -2558,7 +2558,8 @@ static int vc4_hdmi_bind(struct device * * vc4_hdmi_disable_scrambling() will thus run at boot, make * sure it's disabled, and avoid any inconsistency. */ diff --git a/target/linux/bcm27xx/patches-5.15/950-0579-drm-vc4-Add-support-for-composite-syncs-to-vc4_dpi.patch b/target/linux/bcm27xx/patches-5.15/950-0579-drm-vc4-Add-support-for-composite-syncs-to-vc4_dpi.patch index 9d815d39b56..a9e79d25ba8 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0579-drm-vc4-Add-support-for-composite-syncs-to-vc4_dpi.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0579-drm-vc4-Add-support-for-composite-syncs-to-vc4_dpi.patch @@ -22,7 +22,7 @@ Signed-off-by: Dave Stevenson int ret; /* Look up the connector attached to DPI so we can get the -@@ -192,15 +192,22 @@ static void vc4_dpi_encoder_enable(struc +@@ -202,15 +202,22 @@ static void vc4_dpi_encoder_enable(struc dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, DPI_FORMAT); } diff --git a/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch b/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch index 73f7ea871a0..689a3d9525e 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch @@ -36,7 +36,7 @@ Signed-off-by: Dave Stevenson connected = true; } -@@ -1355,6 +1349,18 @@ static u32 vc5_hdmi_channel_map(struct v +@@ -1356,6 +1350,18 @@ static u32 vc5_hdmi_channel_map(struct v return channel_map; } @@ -55,7 +55,7 @@ Signed-off-by: Dave Stevenson /* HDMI audio codec callbacks */ static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate) -@@ -2777,6 +2783,7 @@ static const struct vc4_hdmi_variant bcm +@@ -2778,6 +2784,7 @@ static const struct vc4_hdmi_variant bcm .phy_rng_disable = vc5_hdmi_phy_rng_disable, .channel_map = vc5_hdmi_channel_map, .supports_hdr = true, @@ -63,7 +63,7 @@ Signed-off-by: Dave Stevenson }; static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { -@@ -2805,6 +2812,7 @@ static const struct vc4_hdmi_variant bcm +@@ -2806,6 +2813,7 @@ static const struct vc4_hdmi_variant bcm .phy_rng_disable = vc5_hdmi_phy_rng_disable, .channel_map = vc5_hdmi_channel_map, .supports_hdr = true, diff --git a/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch b/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch index 25dd5b54275..6a8ef0ebdf2 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch @@ -22,7 +22,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2193,7 +2193,6 @@ static int vc4_hdmi_cec_init(struct vc4_ +@@ -2194,7 +2194,6 @@ static int vc4_hdmi_cec_init(struct vc4_ struct platform_device *pdev = vc4_hdmi->pdev; struct device *dev = &pdev->dev; unsigned long flags; @@ -30,7 +30,7 @@ Signed-off-by: Dave Stevenson int ret; if (!of_find_property(dev->of_node, "interrupts", NULL)) { -@@ -2213,15 +2212,6 @@ static int vc4_hdmi_cec_init(struct vc4_ +@@ -2214,15 +2213,6 @@ static int vc4_hdmi_cec_init(struct vc4_ cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector); cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info); @@ -46,7 +46,7 @@ Signed-off-by: Dave Stevenson if (vc4_hdmi->variant->external_irq_controller) { ret = request_threaded_irq(platform_get_irq_byname(pdev, "cec-rx"), vc4_cec_irq_handler_rx_bare, -@@ -2284,6 +2274,29 @@ static void vc4_hdmi_cec_exit(struct vc4 +@@ -2285,6 +2275,29 @@ static void vc4_hdmi_cec_exit(struct vc4 cec_unregister_adapter(vc4_hdmi->cec_adap); } @@ -76,7 +76,7 @@ Signed-off-by: Dave Stevenson #else static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) { -@@ -2292,6 +2305,10 @@ static int vc4_hdmi_cec_init(struct vc4_ +@@ -2293,6 +2306,10 @@ static int vc4_hdmi_cec_init(struct vc4_ static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) {}; @@ -87,7 +87,7 @@ Signed-off-by: Dave Stevenson #endif static int vc4_hdmi_build_regset(struct vc4_hdmi *vc4_hdmi, -@@ -2526,6 +2543,15 @@ static int vc4_hdmi_runtime_resume(struc +@@ -2527,6 +2544,15 @@ static int vc4_hdmi_runtime_resume(struc if (ret) return ret; diff --git a/target/linux/bcm27xx/patches-5.15/950-0596-drm-vc4-dpi-Add-option-for-inverting-pixel-clock-and.patch b/target/linux/bcm27xx/patches-5.15/950-0596-drm-vc4-dpi-Add-option-for-inverting-pixel-clock-and.patch deleted file mode 100644 index feea66713a0..00000000000 --- a/target/linux/bcm27xx/patches-5.15/950-0596-drm-vc4-dpi-Add-option-for-inverting-pixel-clock-and.patch +++ /dev/null @@ -1,114 +0,0 @@ -From e664a91ea54b3488d6c08dd82dac2af1239c3275 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Thu, 2 Dec 2021 18:21:46 +0000 -Subject: [PATCH] drm/vc4: dpi: Add option for inverting pixel clock - and output enable - -DRM provides flags for inverting pixel clock and output enable -signals, but these were not mapped to the relevant registers. - -Add those mappings. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_dpi.c | 89 ++++++++++++++++++++--------------- - 1 file changed, 51 insertions(+), 38 deletions(-) - ---- a/drivers/gpu/drm/vc4/vc4_dpi.c -+++ b/drivers/gpu/drm/vc4/vc4_dpi.c -@@ -148,45 +148,58 @@ static void vc4_dpi_encoder_enable(struc - } - drm_connector_list_iter_end(&conn_iter); - -- if (connector && connector->display_info.num_bus_formats) { -- u32 bus_format = connector->display_info.bus_formats[0]; -+ if (connector) { -+ if (connector->display_info.num_bus_formats) { -+ u32 bus_format = connector->display_info.bus_formats[0]; - -- switch (bus_format) { -- case MEDIA_BUS_FMT_RGB888_1X24: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, -- DPI_FORMAT); -- break; -- case MEDIA_BUS_FMT_BGR888_1X24: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, -- DPI_FORMAT); -- dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER); -- break; -- case MEDIA_BUS_FMT_RGB666_1X24_CPADHI: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, -- DPI_FORMAT); -- break; -- case MEDIA_BUS_FMT_BGR666_1X24_CPADHI: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, -- DPI_FORMAT); -- dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER); -- break; -- case MEDIA_BUS_FMT_RGB666_1X18: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, -- DPI_FORMAT); -- break; -- case MEDIA_BUS_FMT_BGR666_1X18: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, -- DPI_FORMAT); -- dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER); -- break; -- case MEDIA_BUS_FMT_RGB565_1X16: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3, -- DPI_FORMAT); -- break; -- default: -- DRM_ERROR("Unknown media bus format %d\n", bus_format); -- break; -+ switch (bus_format) { -+ case MEDIA_BUS_FMT_RGB888_1X24: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, -+ DPI_FORMAT); -+ break; -+ case MEDIA_BUS_FMT_BGR888_1X24: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, -+ DPI_FORMAT); -+ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, -+ DPI_ORDER); -+ break; -+ case MEDIA_BUS_FMT_RGB666_1X24_CPADHI: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, -+ DPI_FORMAT); -+ break; -+ case MEDIA_BUS_FMT_BGR666_1X24_CPADHI: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, -+ DPI_FORMAT); -+ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, -+ DPI_ORDER); -+ break; -+ case MEDIA_BUS_FMT_RGB666_1X18: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, -+ DPI_FORMAT); -+ break; -+ case MEDIA_BUS_FMT_BGR666_1X18: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, -+ DPI_FORMAT); -+ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, -+ DPI_ORDER); -+ break; -+ case MEDIA_BUS_FMT_RGB565_1X16: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3, -+ DPI_FORMAT); -+ break; -+ default: -+ DRM_ERROR("Unknown media bus format %d\n", -+ bus_format); -+ break; -+ } - } -+ -+ if (connector->display_info.bus_flags & -+ DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE) -+ dpi_c |= DPI_PIXEL_CLK_INVERT; -+ -+ if (connector->display_info.bus_flags & DRM_BUS_FLAG_DE_LOW) -+ dpi_c |= DPI_OUTPUT_ENABLE_INVERT; - } else { - /* Default to 18bit if no connector found. */ - dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, DPI_FORMAT); diff --git a/target/linux/bcm27xx/patches-5.15/950-0597-drm-vc4-dpi-Ensure-a-default-format-is-selected.patch b/target/linux/bcm27xx/patches-5.15/950-0597-drm-vc4-dpi-Ensure-a-default-format-is-selected.patch index 7897f8af8b0..ab836cbcb89 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0597-drm-vc4-dpi-Ensure-a-default-format-is-selected.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0597-drm-vc4-dpi-Ensure-a-default-format-is-selected.patch @@ -15,9 +15,9 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c -@@ -173,6 +173,10 @@ static void vc4_dpi_encoder_enable(struc - dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, - DPI_ORDER); +@@ -172,6 +172,10 @@ static void vc4_dpi_encoder_enable(struc + DPI_FORMAT); + dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER); break; + default: + DRM_ERROR("Unknown media bus format %d\n", @@ -26,8 +26,8 @@ Signed-off-by: Dave Stevenson case MEDIA_BUS_FMT_RGB666_1X18: dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, DPI_FORMAT); -@@ -187,11 +191,12 @@ static void vc4_dpi_encoder_enable(struc - dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3, +@@ -185,11 +189,12 @@ static void vc4_dpi_encoder_enable(struc + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_1, DPI_FORMAT); break; - default: @@ -42,4 +42,4 @@ Signed-off-by: Dave Stevenson + } - if (connector->display_info.bus_flags & + if (connector->display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE) diff --git a/target/linux/bcm27xx/patches-5.15/950-0602-media-imx219-Advertise-embedded-data-node-on-media-p.patch b/target/linux/bcm27xx/patches-5.15/950-0602-media-imx219-Advertise-embedded-data-node-on-media-p.patch index 79487b60cfb..9e677885889 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0602-media-imx219-Advertise-embedded-data-node-on-media-p.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0602-media-imx219-Advertise-embedded-data-node-on-media-p.patch @@ -22,7 +22,7 @@ Signed-off-by: Jean-Michel Hautbois --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c -@@ -118,6 +118,16 @@ +@@ -124,6 +124,16 @@ #define IMX219_PIXEL_ARRAY_WIDTH 3280U #define IMX219_PIXEL_ARRAY_HEIGHT 2464U @@ -39,7 +39,7 @@ Signed-off-by: Jean-Michel Hautbois struct imx219_reg { u16 address; u8 val; -@@ -538,7 +548,7 @@ static const struct imx219_mode supporte +@@ -448,7 +458,7 @@ static const struct imx219_mode supporte struct imx219 { struct v4l2_subdev sd; @@ -48,7 +48,7 @@ Signed-off-by: Jean-Michel Hautbois struct v4l2_mbus_framefmt fmt; -@@ -688,18 +698,26 @@ static void imx219_set_default_format(st +@@ -598,18 +608,26 @@ static void imx219_set_default_format(st static int imx219_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { struct imx219 *imx219 = to_imx219(sd); @@ -83,7 +83,7 @@ Signed-off-by: Jean-Michel Hautbois /* Initialize try_crop rectangle. */ try_crop = v4l2_subdev_get_try_crop(sd, fh->state, 0); -@@ -808,12 +826,21 @@ static int imx219_enum_mbus_code(struct +@@ -718,12 +736,21 @@ static int imx219_enum_mbus_code(struct { struct imx219 *imx219 = to_imx219(sd); @@ -109,7 +109,7 @@ Signed-off-by: Jean-Michel Hautbois return 0; } -@@ -823,21 +850,30 @@ static int imx219_enum_frame_size(struct +@@ -733,21 +760,30 @@ static int imx219_enum_frame_size(struct struct v4l2_subdev_frame_size_enum *fse) { struct imx219 *imx219 = to_imx219(sd); @@ -151,7 +151,7 @@ Signed-off-by: Jean-Michel Hautbois return 0; } -@@ -852,9 +888,9 @@ static void imx219_reset_colorspace(stru +@@ -762,9 +798,9 @@ static void imx219_reset_colorspace(stru fmt->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(fmt->colorspace); } @@ -164,7 +164,7 @@ Signed-off-by: Jean-Michel Hautbois { fmt->format.width = mode->width; fmt->format.height = mode->height; -@@ -862,21 +898,39 @@ static void imx219_update_pad_format(str +@@ -772,21 +808,39 @@ static void imx219_update_pad_format(str imx219_reset_colorspace(&fmt->format); } @@ -208,7 +208,7 @@ Signed-off-by: Jean-Michel Hautbois } return 0; -@@ -906,51 +960,74 @@ static int imx219_set_pad_format(struct +@@ -816,51 +870,74 @@ static int imx219_set_pad_format(struct int exposure_max, exposure_def, hblank; unsigned int i; @@ -326,7 +326,7 @@ Signed-off-by: Jean-Michel Hautbois } mutex_unlock(&imx219->mutex); -@@ -1037,9 +1114,11 @@ static int imx219_start_streaming(struct +@@ -976,9 +1053,11 @@ static int imx219_start_streaming(struct const struct imx219_reg_list *reg_list; int ret; @@ -338,9 +338,9 @@ Signed-off-by: Jean-Michel Hautbois return ret; + } - /* Apply default values of current mode */ - reg_list = &imx219->mode->reg_list; -@@ -1133,21 +1212,22 @@ err_unlock: + /* Send all registers that are common to all modes */ + ret = imx219_write_regs(imx219, imx219_common_regs, ARRAY_SIZE(imx219_common_regs)); +@@ -1086,21 +1165,22 @@ err_unlock: /* Power/clock management functions */ static int imx219_power_on(struct device *dev) { @@ -366,7 +366,7 @@ Signed-off-by: Jean-Michel Hautbois __func__); goto reg_off; } -@@ -1166,7 +1246,8 @@ reg_off: +@@ -1119,7 +1199,8 @@ reg_off: static int imx219_power_off(struct device *dev) { @@ -376,7 +376,7 @@ Signed-off-by: Jean-Michel Hautbois struct imx219 *imx219 = to_imx219(sd); gpiod_set_value_cansleep(imx219->reset_gpio, 0); -@@ -1178,7 +1259,8 @@ static int imx219_power_off(struct devic +@@ -1131,7 +1212,8 @@ static int imx219_power_off(struct devic static int __maybe_unused imx219_suspend(struct device *dev) { @@ -386,7 +386,7 @@ Signed-off-by: Jean-Michel Hautbois struct imx219 *imx219 = to_imx219(sd); if (imx219->streaming) -@@ -1189,7 +1271,8 @@ static int __maybe_unused imx219_suspend +@@ -1142,7 +1224,8 @@ static int __maybe_unused imx219_suspend static int __maybe_unused imx219_resume(struct device *dev) { @@ -396,7 +396,7 @@ Signed-off-by: Jean-Michel Hautbois struct imx219 *imx219 = to_imx219(sd); int ret; -@@ -1525,13 +1608,14 @@ static int imx219_probe(struct i2c_clien +@@ -1478,13 +1561,14 @@ static int imx219_probe(struct i2c_clien V4L2_SUBDEV_FL_HAS_EVENTS; imx219->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; diff --git a/target/linux/bcm27xx/patches-5.15/950-0603-vc4-drm-Ignore-vc4_hdmi-output_enabled-for-allowing-.patch b/target/linux/bcm27xx/patches-5.15/950-0603-vc4-drm-Ignore-vc4_hdmi-output_enabled-for-allowing-.patch index 9ecf5db11d3..cb0daf15f00 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0603-vc4-drm-Ignore-vc4_hdmi-output_enabled-for-allowing-.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0603-vc4-drm-Ignore-vc4_hdmi-output_enabled-for-allowing-.patch @@ -38,7 +38,7 @@ Signed-off-by: Dom Cobley static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable) { unsigned long flags; -@@ -1219,15 +1211,6 @@ static void vc4_hdmi_encoder_post_crtc_e +@@ -1220,15 +1212,6 @@ static void vc4_hdmi_encoder_post_crtc_e mutex_unlock(&vc4_hdmi->mutex); } @@ -54,7 +54,7 @@ Signed-off-by: Dom Cobley static void vc4_hdmi_encoder_atomic_mode_set(struct drm_encoder *encoder, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state) -@@ -1321,8 +1304,6 @@ static const struct drm_encoder_helper_f +@@ -1322,8 +1305,6 @@ static const struct drm_encoder_helper_f .atomic_check = vc4_hdmi_encoder_atomic_check, .atomic_mode_set = vc4_hdmi_encoder_atomic_mode_set, .mode_valid = vc4_hdmi_encoder_mode_valid, @@ -63,7 +63,7 @@ Signed-off-by: Dom Cobley }; static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask) -@@ -1422,16 +1403,10 @@ static bool vc4_hdmi_audio_can_stream(st +@@ -1423,16 +1404,10 @@ static bool vc4_hdmi_audio_can_stream(st lockdep_assert_held(&vc4_hdmi->mutex); /* diff --git a/target/linux/bcm27xx/patches-5.15/950-0607-drm-vc4-Fix-build-without-DRM_VC4_HDMI_CEC.patch b/target/linux/bcm27xx/patches-5.15/950-0607-drm-vc4-Fix-build-without-DRM_VC4_HDMI_CEC.patch index ac2e8e9839b..777cdda54ff 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0607-drm-vc4-Fix-build-without-DRM_VC4_HDMI_CEC.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0607-drm-vc4-Fix-build-without-DRM_VC4_HDMI_CEC.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2280,7 +2280,7 @@ static int vc4_hdmi_cec_init(struct vc4_ +@@ -2281,7 +2281,7 @@ static int vc4_hdmi_cec_init(struct vc4_ static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) {}; diff --git a/target/linux/bcm27xx/patches-5.15/950-0622-drm-vc4-Skip-writes-to-disabled-packet-RAM.patch b/target/linux/bcm27xx/patches-5.15/950-0622-drm-vc4-Skip-writes-to-disabled-packet-RAM.patch index fd1c51dd48e..ab4587cb12f 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0622-drm-vc4-Skip-writes-to-disabled-packet-RAM.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0622-drm-vc4-Skip-writes-to-disabled-packet-RAM.patch @@ -23,7 +23,7 @@ Signed-off-by: Dom Cobley spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0); -@@ -1201,6 +1202,7 @@ static void vc4_hdmi_encoder_post_crtc_e +@@ -1202,6 +1203,7 @@ static void vc4_hdmi_encoder_post_crtc_e VC4_HDMI_RAM_PACKET_ENABLE); spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); @@ -31,7 +31,7 @@ Signed-off-by: Dom Cobley vc4_hdmi_set_infoframes(encoder); } -@@ -1606,7 +1608,8 @@ static int vc4_hdmi_audio_prepare(struct +@@ -1607,7 +1609,8 @@ static int vc4_hdmi_audio_prepare(struct spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); memcpy(&vc4_hdmi->audio.infoframe, ¶ms->cea, sizeof(params->cea)); diff --git a/target/linux/bcm27xx/patches-5.15/950-0623-drm-edid-Rename-drm_hdmi_avi_infoframe_colorspace-to.patch b/target/linux/bcm27xx/patches-5.15/950-0623-drm-edid-Rename-drm_hdmi_avi_infoframe_colorspace-to.patch index de80fe4628f..a9269e4cad9 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0623-drm-edid-Rename-drm_hdmi_avi_infoframe_colorspace-to.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0623-drm-edid-Rename-drm_hdmi_avi_infoframe_colorspace-to.patch @@ -26,7 +26,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c -@@ -5743,13 +5743,13 @@ static const u32 hdmi_colorimetry_val[] +@@ -5746,13 +5746,13 @@ static const u32 hdmi_colorimetry_val[] #undef ACE /** @@ -43,7 +43,7 @@ Signed-off-by: Maxime Ripard const struct drm_connector_state *conn_state) { u32 colorimetry_val; -@@ -5768,7 +5768,7 @@ drm_hdmi_avi_infoframe_colorspace(struct +@@ -5771,7 +5771,7 @@ drm_hdmi_avi_infoframe_colorspace(struct frame->extended_colorimetry = (colorimetry_val >> 2) & EXTENDED_COLORIMETRY_MASK; } diff --git a/target/linux/bcm27xx/patches-5.15/950-0624-drm-vc4-hdmi-Add-full-range-RGB-helper.patch b/target/linux/bcm27xx/patches-5.15/950-0624-drm-vc4-hdmi-Add-full-range-RGB-helper.patch index 75d96d74e37..f590f4fa40f 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0624-drm-vc4-hdmi-Add-full-range-RGB-helper.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0624-drm-vc4-hdmi-Add-full-range-RGB-helper.patch @@ -31,7 +31,7 @@ Signed-off-by: Maxime Ripard static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) { struct drm_info_node *node = (struct drm_info_node *)m->private; -@@ -1116,8 +1125,7 @@ static void vc4_hdmi_encoder_pre_crtc_en +@@ -1117,8 +1126,7 @@ static void vc4_hdmi_encoder_pre_crtc_en mutex_lock(&vc4_hdmi->mutex); diff --git a/target/linux/bcm27xx/patches-5.15/950-0625-drm-vc4-hdmi-Use-full-range-helper-in-csc-functions.patch b/target/linux/bcm27xx/patches-5.15/950-0625-drm-vc4-hdmi-Use-full-range-helper-in-csc-functions.patch index 5ec3643a501..9f3b81e5480 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0625-drm-vc4-hdmi-Use-full-range-helper-in-csc-functions.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0625-drm-vc4-hdmi-Use-full-range-helper-in-csc-functions.patch @@ -79,7 +79,7 @@ Signed-off-by: Maxime Ripard /* CEA VICs other than #1 requre limited range RGB * output unless overridden by an AVI infoframe. * Apply a colorspace conversion to squash 0-255 down -@@ -1120,22 +1121,12 @@ static void vc4_hdmi_encoder_pre_crtc_en +@@ -1121,22 +1122,12 @@ static void vc4_hdmi_encoder_pre_crtc_en { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; diff --git a/target/linux/bcm27xx/patches-5.15/950-0626-drm-vc4-hdmi-Move-XBAR-setup-to-csc_setup.patch b/target/linux/bcm27xx/patches-5.15/950-0626-drm-vc4-hdmi-Move-XBAR-setup-to-csc_setup.patch index 879be397b9f..aba91b55721 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0626-drm-vc4-hdmi-Move-XBAR-setup-to-csc_setup.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0626-drm-vc4-hdmi-Move-XBAR-setup-to-csc_setup.patch @@ -24,7 +24,7 @@ Signed-off-by: Maxime Ripard if (!vc4_hdmi_is_full_range_rgb(vc4_hdmi, mode)) { /* CEA VICs other than #1 requre limited range RGB * output unless overridden by an AVI infoframe. -@@ -906,7 +908,6 @@ static void vc5_hdmi_set_timings(struct +@@ -907,7 +909,6 @@ static void vc5_hdmi_set_timings(struct spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); diff --git a/target/linux/bcm27xx/patches-5.15/950-0627-drm-vc4-hdmi-Replace-CSC_CTL-hardcoded-value-by-defi.patch b/target/linux/bcm27xx/patches-5.15/950-0627-drm-vc4-hdmi-Replace-CSC_CTL-hardcoded-value-by-defi.patch index 37dbb8c9420..c4349f55bc0 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0627-drm-vc4-hdmi-Replace-CSC_CTL-hardcoded-value-by-defi.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0627-drm-vc4-hdmi-Replace-CSC_CTL-hardcoded-value-by-defi.patch @@ -30,7 +30,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_regs.h +++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -804,6 +804,9 @@ enum { +@@ -810,6 +810,9 @@ enum { # define VC4_HD_CSC_CTL_RGB2YCC BIT(1) # define VC4_HD_CSC_CTL_ENABLE BIT(0) diff --git a/target/linux/bcm27xx/patches-5.15/950-0629-drm-vc4-hdmi-Change-CSC-callback-prototype.patch b/target/linux/bcm27xx/patches-5.15/950-0629-drm-vc4-hdmi-Change-CSC-callback-prototype.patch index 61911b4825f..5a1328fa5e9 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0629-drm-vc4-hdmi-Change-CSC-callback-prototype.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0629-drm-vc4-hdmi-Change-CSC-callback-prototype.patch @@ -33,7 +33,7 @@ Signed-off-by: Maxime Ripard const struct drm_display_mode *mode) { unsigned long flags; -@@ -1141,13 +1143,16 @@ static void vc4_hdmi_encoder_pre_crtc_en +@@ -1142,13 +1144,16 @@ static void vc4_hdmi_encoder_pre_crtc_en struct drm_atomic_state *state) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); diff --git a/target/linux/bcm27xx/patches-5.15/950-0630-drm-vc4-hdmi-Move-clock-validation-to-its-own-functi.patch b/target/linux/bcm27xx/patches-5.15/950-0630-drm-vc4-hdmi-Move-clock-validation-to-its-own-functi.patch index f0b5b48149e..539d62c3abf 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0630-drm-vc4-hdmi-Move-clock-validation-to-its-own-functi.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0630-drm-vc4-hdmi-Move-clock-validation-to-its-own-functi.patch @@ -14,7 +14,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1251,6 +1251,19 @@ static void vc4_hdmi_encoder_atomic_mode +@@ -1252,6 +1252,19 @@ static void vc4_hdmi_encoder_atomic_mode mutex_unlock(&vc4_hdmi->mutex); } @@ -34,7 +34,7 @@ Signed-off-by: Maxime Ripard #define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL #define WIFI_2_4GHz_CH1_MAX_FREQ 2422000000ULL -@@ -1295,10 +1308,7 @@ static int vc4_hdmi_encoder_atomic_check +@@ -1296,10 +1309,7 @@ static int vc4_hdmi_encoder_atomic_check if (mode->flags & DRM_MODE_FLAG_DBLCLK) pixel_rate = pixel_rate * 2; @@ -46,7 +46,7 @@ Signed-off-by: Maxime Ripard return -EINVAL; vc4_state->pixel_rate = pixel_rate; -@@ -1318,13 +1328,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_e +@@ -1319,13 +1329,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_e (mode->hsync_end % 2) || (mode->htotal % 2))) return MODE_H_ILLEGAL; diff --git a/target/linux/bcm27xx/patches-5.15/950-0631-drm-vc4-hdmi-Move-clock-calculation-into-its-own-fun.patch b/target/linux/bcm27xx/patches-5.15/950-0631-drm-vc4-hdmi-Move-clock-calculation-into-its-own-fun.patch index 7b99321e6d7..04a32b2396c 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0631-drm-vc4-hdmi-Move-clock-calculation-into-its-own-fun.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0631-drm-vc4-hdmi-Move-clock-calculation-into-its-own-fun.patch @@ -15,7 +15,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1264,6 +1264,35 @@ vc4_hdmi_encoder_clock_valid(const struc +@@ -1265,6 +1265,35 @@ vc4_hdmi_encoder_clock_valid(const struc return MODE_OK; } @@ -51,7 +51,7 @@ Signed-off-by: Maxime Ripard #define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL #define WIFI_2_4GHz_CH1_MAX_FREQ 2422000000ULL -@@ -1276,6 +1305,7 @@ static int vc4_hdmi_encoder_atomic_check +@@ -1277,6 +1306,7 @@ static int vc4_hdmi_encoder_atomic_check struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); unsigned long long pixel_rate = mode->clock * 1000; unsigned long long tmds_rate; @@ -59,7 +59,7 @@ Signed-off-by: Maxime Ripard if (vc4_hdmi->variant->unsupported_odd_h_timings && !(mode->flags & DRM_MODE_FLAG_DBLCLK) && -@@ -1297,21 +1327,10 @@ static int vc4_hdmi_encoder_atomic_check +@@ -1298,21 +1328,10 @@ static int vc4_hdmi_encoder_atomic_check pixel_rate = mode->clock * 1000; } diff --git a/target/linux/bcm27xx/patches-5.15/950-0632-drm-vc4-hdmi-Take-the-sink-maximum-TMDS-clock-into-a.patch b/target/linux/bcm27xx/patches-5.15/950-0632-drm-vc4-hdmi-Take-the-sink-maximum-TMDS-clock-into-a.patch index ee520595f72..8f999472d2c 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0632-drm-vc4-hdmi-Take-the-sink-maximum-TMDS-clock-into-a.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0632-drm-vc4-hdmi-Take-the-sink-maximum-TMDS-clock-into-a.patch @@ -19,7 +19,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1255,12 +1255,18 @@ static enum drm_mode_status +@@ -1256,12 +1256,18 @@ static enum drm_mode_status vc4_hdmi_encoder_clock_valid(const struct vc4_hdmi *vc4_hdmi, unsigned long long clock) { diff --git a/target/linux/bcm27xx/patches-5.15/950-0633-drm-vc4-hdmi-Take-bpp-into-account-for-the-scrambler.patch b/target/linux/bcm27xx/patches-5.15/950-0633-drm-vc4-hdmi-Take-bpp-into-account-for-the-scrambler.patch index 608cc18fda9..db29d11f387 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0633-drm-vc4-hdmi-Take-bpp-into-account-for-the-scrambler.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0633-drm-vc4-hdmi-Take-bpp-into-account-for-the-scrambler.patch @@ -57,7 +57,7 @@ Signed-off-by: Maxime Ripard return; drm_scdc_set_high_tmds_clock_ratio(vc4_hdmi->ddc, true); -@@ -1245,6 +1253,7 @@ static void vc4_hdmi_encoder_atomic_mode +@@ -1246,6 +1254,7 @@ static void vc4_hdmi_encoder_atomic_mode struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); mutex_lock(&vc4_hdmi->mutex); diff --git a/target/linux/bcm27xx/patches-5.15/950-0634-drm-vc4-hdmi-Always-try-to-have-the-highest-bpc.patch b/target/linux/bcm27xx/patches-5.15/950-0634-drm-vc4-hdmi-Always-try-to-have-the-highest-bpc.patch index 50bbb7a5077..869fa19643d 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0634-drm-vc4-hdmi-Always-try-to-have-the-highest-bpc.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0634-drm-vc4-hdmi-Always-try-to-have-the-highest-bpc.patch @@ -38,7 +38,7 @@ Signed-off-by: Maxime Ripard bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; -@@ -961,7 +964,7 @@ static void vc5_hdmi_set_timings(struct +@@ -962,7 +965,7 @@ static void vc5_hdmi_set_timings(struct HDMI_WRITE(HDMI_VERTB0, vertb_even); HDMI_WRITE(HDMI_VERTB1, vertb); @@ -47,7 +47,7 @@ Signed-off-by: Maxime Ripard case 12: gcp = 6; gcp_en = true; -@@ -1251,9 +1254,11 @@ static void vc4_hdmi_encoder_atomic_mode +@@ -1252,9 +1255,11 @@ static void vc4_hdmi_encoder_atomic_mode struct drm_connector_state *conn_state) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); @@ -60,7 +60,7 @@ Signed-off-by: Maxime Ripard memcpy(&vc4_hdmi->saved_adjusted_mode, &crtc_state->adjusted_mode, sizeof(vc4_hdmi->saved_adjusted_mode)); -@@ -1308,6 +1313,38 @@ vc4_hdmi_encoder_compute_clock(const str +@@ -1309,6 +1314,38 @@ vc4_hdmi_encoder_compute_clock(const str return 0; } @@ -99,7 +99,7 @@ Signed-off-by: Maxime Ripard #define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL #define WIFI_2_4GHz_CH1_MAX_FREQ 2422000000ULL -@@ -1342,8 +1379,7 @@ static int vc4_hdmi_encoder_atomic_check +@@ -1343,8 +1380,7 @@ static int vc4_hdmi_encoder_atomic_check pixel_rate = mode->clock * 1000; } diff --git a/target/linux/bcm27xx/patches-5.15/950-0635-drm-vc4-hdmi-Support-HDMI-YUV-output.patch b/target/linux/bcm27xx/patches-5.15/950-0635-drm-vc4-hdmi-Support-HDMI-YUV-output.patch index 47db6abaf5e..4c92bc29614 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0635-drm-vc4-hdmi-Support-HDMI-YUV-output.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0635-drm-vc4-hdmi-Support-HDMI-YUV-output.patch @@ -234,7 +234,7 @@ Signed-off-by: Maxime Ripard HDMI_WRITE(HDMI_CSC_CTL, csc_ctl); spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); -@@ -980,6 +1093,15 @@ static void vc5_hdmi_set_timings(struct +@@ -981,6 +1094,15 @@ static void vc5_hdmi_set_timings(struct break; } @@ -250,7 +250,7 @@ Signed-off-by: Maxime Ripard reg = HDMI_READ(HDMI_DEEP_COLOR_CONFIG_1); reg &= ~(VC5_HDMI_DEEP_COLOR_CONFIG_1_INIT_PACK_PHASE_MASK | VC5_HDMI_DEEP_COLOR_CONFIG_1_COLOR_DEPTH_MASK); -@@ -1259,12 +1381,97 @@ static void vc4_hdmi_encoder_atomic_mode +@@ -1260,12 +1382,97 @@ static void vc4_hdmi_encoder_atomic_mode mutex_lock(&vc4_hdmi->mutex); vc4_hdmi->output_bpc = vc4_state->output_bpc; @@ -348,7 +348,7 @@ Signed-off-by: Maxime Ripard static enum drm_mode_status vc4_hdmi_encoder_clock_valid(const struct vc4_hdmi *vc4_hdmi, unsigned long long clock) -@@ -1286,13 +1493,17 @@ vc4_hdmi_encoder_clock_valid(const struc +@@ -1287,13 +1494,17 @@ vc4_hdmi_encoder_clock_valid(const struc static unsigned long long vc4_hdmi_encoder_compute_mode_clock(const struct drm_display_mode *mode, @@ -367,7 +367,7 @@ Signed-off-by: Maxime Ripard return clock * bpc / 8; } -@@ -1300,11 +1511,11 @@ static int +@@ -1301,11 +1512,11 @@ static int vc4_hdmi_encoder_compute_clock(const struct vc4_hdmi *vc4_hdmi, struct vc4_hdmi_connector_state *vc4_state, const struct drm_display_mode *mode, @@ -381,7 +381,7 @@ Signed-off-by: Maxime Ripard if (vc4_hdmi_encoder_clock_valid(vc4_hdmi, clock) != MODE_OK) return -EINVAL; -@@ -1314,10 +1525,55 @@ vc4_hdmi_encoder_compute_clock(const str +@@ -1315,10 +1526,55 @@ vc4_hdmi_encoder_compute_clock(const str } static int @@ -437,7 +437,7 @@ Signed-off-by: Maxime Ripard struct drm_connector_state *conn_state = &vc4_state->base; unsigned int max_bpc = clamp_t(unsigned int, conn_state->max_bpc, 8, 12); unsigned int bpc; -@@ -1326,17 +1582,18 @@ vc4_hdmi_encoder_compute_config(const st +@@ -1327,17 +1583,18 @@ vc4_hdmi_encoder_compute_config(const st for (bpc = max_bpc; bpc >= 8; bpc -= 2) { drm_dbg(dev, "Trying with a %d bpc output\n", bpc); @@ -548,7 +548,7 @@ Signed-off-by: Maxime Ripard static inline --- a/drivers/gpu/drm/vc4/vc4_regs.h +++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -804,11 +804,27 @@ enum { +@@ -810,11 +810,27 @@ enum { # define VC4_HD_CSC_CTL_RGB2YCC BIT(1) # define VC4_HD_CSC_CTL_ENABLE BIT(0) diff --git a/target/linux/bcm27xx/patches-5.15/950-0643-drm-vc4-hdmi-Fix-no-video-output-on-DVI-monitors.patch b/target/linux/bcm27xx/patches-5.15/950-0643-drm-vc4-hdmi-Fix-no-video-output-on-DVI-monitors.patch index 8e1f4bb6812..644ea123d57 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0643-drm-vc4-hdmi-Fix-no-video-output-on-DVI-monitors.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0643-drm-vc4-hdmi-Fix-no-video-output-on-DVI-monitors.patch @@ -17,7 +17,7 @@ Signed-off-by: Matthias Reichl --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1415,9 +1415,6 @@ vc4_hdmi_sink_supports_format_bpc(const +@@ -1416,9 +1416,6 @@ vc4_hdmi_sink_supports_format_bpc(const case VC4_HDMI_OUTPUT_RGB: drm_dbg(dev, "RGB Format, checking the constraints.\n"); diff --git a/target/linux/bcm27xx/patches-5.15/950-0650-drm-vc4-Add-alpha_blend_mode-property-to-each-plane.patch b/target/linux/bcm27xx/patches-5.15/950-0650-drm-vc4-Add-alpha_blend_mode-property-to-each-plane.patch index f1b3a2af8f5..80e9a728541 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0650-drm-vc4-Add-alpha_blend_mode-property-to-each-plane.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0650-drm-vc4-Add-alpha_blend_mode-property-to-each-plane.patch @@ -14,7 +14,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -664,6 +664,48 @@ static const u32 colorspace_coeffs[2][DR +@@ -666,6 +666,48 @@ static const u32 colorspace_coeffs[2][DR } }; @@ -63,7 +63,7 @@ Signed-off-by: Dave Stevenson /* Writes out a full display list for an active plane to the plane's * private dlist state. */ -@@ -946,13 +988,8 @@ static int vc4_plane_mode_set(struct drm +@@ -948,13 +990,8 @@ static int vc4_plane_mode_set(struct drm /* Position Word 2: Source Image Size, Alpha */ vc4_state->pos2_offset = vc4_state->dlist_count; vc4_dlist_write(vc4_state, @@ -78,7 +78,7 @@ Signed-off-by: Dave Stevenson VC4_SET_FIELD(vc4_state->src_w[0], SCALER_POS2_WIDTH) | VC4_SET_FIELD(vc4_state->src_h[0], -@@ -997,14 +1034,9 @@ static int vc4_plane_mode_set(struct drm +@@ -999,14 +1036,9 @@ static int vc4_plane_mode_set(struct drm vc4_dlist_write(vc4_state, VC4_SET_FIELD(state->alpha >> 4, SCALER5_CTL2_ALPHA) | @@ -95,7 +95,7 @@ Signed-off-by: Dave Stevenson ); /* Position Word 1: Scaled Image Dimensions. */ -@@ -1494,6 +1526,10 @@ struct drm_plane *vc4_plane_init(struct +@@ -1496,6 +1528,10 @@ struct drm_plane *vc4_plane_init(struct drm_plane_helper_add(plane, &vc4_plane_helper_funcs); drm_plane_create_alpha_property(plane); diff --git a/target/linux/bcm27xx/patches-5.15/950-0655-drm-vc4-hdmi-Fix-clock-value-used-for-validating-hdm.patch b/target/linux/bcm27xx/patches-5.15/950-0655-drm-vc4-hdmi-Fix-clock-value-used-for-validating-hdm.patch index 815bdd0a321..67fbf40e761 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0655-drm-vc4-hdmi-Fix-clock-value-used-for-validating-hdm.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0655-drm-vc4-hdmi-Fix-clock-value-used-for-validating-hdm.patch @@ -18,7 +18,7 @@ Signed-off-by: Dom Cobley --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1496,7 +1496,7 @@ vc4_hdmi_encoder_compute_mode_clock(cons +@@ -1497,7 +1497,7 @@ vc4_hdmi_encoder_compute_mode_clock(cons unsigned int bpc, enum vc4_hdmi_output_format fmt) { diff --git a/target/linux/bcm27xx/patches-5.15/950-0657-mfd-simple-mfd-i2c-Add-configuration-for-RPi-POE-HAT.patch b/target/linux/bcm27xx/patches-5.15/950-0657-mfd-simple-mfd-i2c-Add-configuration-for-RPi-POE-HAT.patch index 41ac28a6730..5396b7b193c 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0657-mfd-simple-mfd-i2c-Add-configuration-for-RPi-POE-HAT.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0657-mfd-simple-mfd-i2c-Add-configuration-for-RPi-POE-HAT.patch @@ -18,7 +18,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig -@@ -1093,6 +1093,16 @@ config MFD_SPMI_PMIC +@@ -1094,6 +1094,16 @@ config MFD_SPMI_PMIC Say M here if you want to include support for the SPMI PMIC series as a module. The module will be called "qcom-spmi-pmic". diff --git a/target/linux/bcm27xx/patches-5.15/950-0669-drm-vc4_hdmi-Add-Broadcast-RGB-property-to-allow-ove.patch b/target/linux/bcm27xx/patches-5.15/950-0669-drm-vc4_hdmi-Add-Broadcast-RGB-property-to-allow-ove.patch index 00324e11e91..cfad9fc7afc 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0669-drm-vc4_hdmi-Add-Broadcast-RGB-property-to-allow-ove.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0669-drm-vc4_hdmi-Add-Broadcast-RGB-property-to-allow-ove.patch @@ -167,7 +167,7 @@ Signed-off-by: Dave Stevenson drm_connector_attach_encoder(connector, encoder); return 0; -@@ -1385,6 +1487,7 @@ static void vc4_hdmi_encoder_atomic_mode +@@ -1386,6 +1488,7 @@ static void vc4_hdmi_encoder_atomic_mode mutex_lock(&vc4_hdmi->mutex); vc4_hdmi->output_bpc = vc4_state->output_bpc; vc4_hdmi->output_format = vc4_state->output_format; diff --git a/target/linux/bcm27xx/patches-5.15/950-0678-drm-vc4-Add-DRM-210101010-RGB-formats-for-hvs5.patch b/target/linux/bcm27xx/patches-5.15/950-0678-drm-vc4-Add-DRM-210101010-RGB-formats-for-hvs5.patch index 76b5ee5dbbe..0eb0af1afaf 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0678-drm-vc4-Add-DRM-210101010-RGB-formats-for-hvs5.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0678-drm-vc4-Add-DRM-210101010-RGB-formats-for-hvs5.patch @@ -14,7 +14,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -135,6 +135,34 @@ static const struct hvs_format { +@@ -137,6 +137,34 @@ static const struct hvs_format { .pixel_order = HVS_PIXEL_ORDER_XYCBCR, .hvs5_only = true, }, diff --git a/target/linux/bcm27xx/patches-5.15/950-0683-drm-vc4-dpi-Support-DPI-interface-in-mode3-for-RGB56.patch b/target/linux/bcm27xx/patches-5.15/950-0683-drm-vc4-dpi-Support-DPI-interface-in-mode3-for-RGB56.patch index 52721d6e990..ccbb2c636dd 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0683-drm-vc4-dpi-Support-DPI-interface-in-mode3-for-RGB56.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0683-drm-vc4-dpi-Support-DPI-interface-in-mode3-for-RGB56.patch @@ -18,8 +18,8 @@ Reviewed-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c -@@ -191,6 +191,10 @@ static void vc4_dpi_encoder_enable(struc - dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3, +@@ -189,6 +189,10 @@ static void vc4_dpi_encoder_enable(struc + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_1, DPI_FORMAT); break; + case MEDIA_BUS_FMT_RGB565_1X24_CPADHI: diff --git a/target/linux/bcm27xx/patches-5.15/950-0706-media-i2c-imx219-Scale-the-pixel-clock-rate-for-the-.patch b/target/linux/bcm27xx/patches-5.15/950-0706-media-i2c-imx219-Scale-the-pixel-clock-rate-for-the-.patch index 124117ce8bf..83bf71c265b 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0706-media-i2c-imx219-Scale-the-pixel-clock-rate-for-the-.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0706-media-i2c-imx219-Scale-the-pixel-clock-rate-for-the-.patch @@ -15,53 +15,53 @@ Signed-off-by: Naushir Patuck --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c -@@ -153,6 +153,9 @@ struct imx219_mode { +@@ -162,6 +162,9 @@ struct imx219_mode { - /* Default register values */ - struct imx219_reg_list reg_list; + /* 2x2 binning is used */ + bool binning; + + /* Relative pixel clock rate factor for the mode. */ + unsigned int rate_factor; }; - /* -@@ -495,6 +498,7 @@ static const struct imx219_mode supporte - .num_of_regs = ARRAY_SIZE(mode_3280x2464_regs), + static const struct imx219_reg imx219_common_regs[] = { +@@ -402,6 +405,7 @@ static const struct imx219_mode supporte .regs = mode_3280x2464_regs, }, + .binning = false, + .rate_factor = 1, }, { /* 1080P 30fps cropped */ -@@ -511,6 +515,7 @@ static const struct imx219_mode supporte - .num_of_regs = ARRAY_SIZE(mode_1920_1080_regs), +@@ -419,6 +423,7 @@ static const struct imx219_mode supporte .regs = mode_1920_1080_regs, }, + .binning = false, + .rate_factor = 1, }, { /* 2x2 binned 30fps mode */ -@@ -527,6 +532,7 @@ static const struct imx219_mode supporte - .num_of_regs = ARRAY_SIZE(mode_1640_1232_regs), +@@ -436,6 +441,7 @@ static const struct imx219_mode supporte .regs = mode_1640_1232_regs, }, + .binning = true, + .rate_factor = 1, }, { /* 640x480 30fps mode */ -@@ -543,6 +549,11 @@ static const struct imx219_mode supporte - .num_of_regs = ARRAY_SIZE(mode_640_480_regs), +@@ -453,6 +459,11 @@ static const struct imx219_mode supporte .regs = mode_640_480_regs, }, + .binning = true, + /* -+ * This mode uses a special 2x2 binning that doubles the -+ * the internal pixel clock rate. -+ */ ++ * This mode uses a special 2x2 binning that doubles the ++ * the internal pixel clock rate. ++ */ + .rate_factor = 2, }, }; -@@ -765,7 +776,8 @@ static int imx219_set_ctrl(struct v4l2_c +@@ -675,7 +686,8 @@ static int imx219_set_ctrl(struct v4l2_c break; case V4L2_CID_EXPOSURE: ret = imx219_write_reg(imx219, IMX219_REG_EXPOSURE, @@ -71,7 +71,7 @@ Signed-off-by: Naushir Patuck break; case V4L2_CID_DIGITAL_GAIN: ret = imx219_write_reg(imx219, IMX219_REG_DIGITAL_GAIN, -@@ -785,7 +797,8 @@ static int imx219_set_ctrl(struct v4l2_c +@@ -695,7 +707,8 @@ static int imx219_set_ctrl(struct v4l2_c case V4L2_CID_VBLANK: ret = imx219_write_reg(imx219, IMX219_REG_VTS, IMX219_REG_VALUE_16BIT, @@ -81,7 +81,7 @@ Signed-off-by: Naushir Patuck break; case V4L2_CID_TEST_PATTERN_RED: ret = imx219_write_reg(imx219, IMX219_REG_TESTP_RED, -@@ -957,7 +970,7 @@ static int imx219_set_pad_format(struct +@@ -867,7 +880,7 @@ static int imx219_set_pad_format(struct struct imx219 *imx219 = to_imx219(sd); const struct imx219_mode *mode; struct v4l2_mbus_framefmt *framefmt; @@ -90,7 +90,7 @@ Signed-off-by: Naushir Patuck unsigned int i; if (fmt->pad >= NUM_PADS) -@@ -1018,6 +1031,12 @@ static int imx219_set_pad_format(struct +@@ -928,6 +941,12 @@ static int imx219_set_pad_format(struct hblank = IMX219_PPL_DEFAULT - mode->width; __v4l2_ctrl_modify_range(imx219->hblank, hblank, hblank, 1, hblank); @@ -103,7 +103,7 @@ Signed-off-by: Naushir Patuck } } else { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { -@@ -1362,7 +1381,7 @@ static int imx219_init_controls(struct i +@@ -1315,7 +1334,7 @@ static int imx219_init_controls(struct i struct v4l2_ctrl_handler *ctrl_hdlr; unsigned int height = imx219->mode->height; struct v4l2_fwnode_device_properties props; @@ -112,7 +112,7 @@ Signed-off-by: Naushir Patuck int i, ret; ctrl_hdlr = &imx219->ctrl_handler; -@@ -1374,11 +1393,11 @@ static int imx219_init_controls(struct i +@@ -1327,11 +1346,11 @@ static int imx219_init_controls(struct i ctrl_hdlr->lock = &imx219->mutex; /* By default, PIXEL_RATE is read only */ diff --git a/target/linux/bcm27xx/patches-5.15/950-0707-drm-vc4-For-DPI-MEDIA_BUS_FMT_RGB565_1X16-is-mode-1-.patch b/target/linux/bcm27xx/patches-5.15/950-0707-drm-vc4-For-DPI-MEDIA_BUS_FMT_RGB565_1X16-is-mode-1-.patch deleted file mode 100644 index 9e4b56d1115..00000000000 --- a/target/linux/bcm27xx/patches-5.15/950-0707-drm-vc4-For-DPI-MEDIA_BUS_FMT_RGB565_1X16-is-mode-1-.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 4626e370de018aed097d54247bae5a29391198ee Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Mon, 14 Feb 2022 15:34:51 +0000 -Subject: [PATCH] drm/vc4: For DPI, MEDIA_BUS_FMT_RGB565_1X16 is mode - 1, not 3. - -The mapping is incorrect for RGB565_1X16 as it should be -DPI_FORMAT_18BIT_666_RGB_1 instead of DPI_FORMAT_18BIT_666_RGB_3. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_dpi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/gpu/drm/vc4/vc4_dpi.c -+++ b/drivers/gpu/drm/vc4/vc4_dpi.c -@@ -188,7 +188,7 @@ static void vc4_dpi_encoder_enable(struc - DPI_ORDER); - break; - case MEDIA_BUS_FMT_RGB565_1X16: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3, -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_1, - DPI_FORMAT); - break; - case MEDIA_BUS_FMT_RGB565_1X24_CPADHI: diff --git a/target/linux/bcm27xx/patches-5.15/950-0742-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch b/target/linux/bcm27xx/patches-5.15/950-0742-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch index 8f699626402..9fce5fec6b6 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0742-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0742-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch @@ -399,7 +399,7 @@ Signed-off-by: Maxime Ripard * overwrite the setup from the bootloader (just 128b out of --- a/drivers/gpu/drm/vc4/vc4_regs.h +++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -234,6 +234,7 @@ +@@ -240,6 +240,7 @@ # define SCALER_DISPCTRL_DSPEIEOLN(x) BIT(8 + ((x) * 2)) /* Enables Display 0 EOF contribution to SCALER_DISPSTAT_IRQDISP0 */ # define SCALER_DISPCTRL_DSPEIEOF(x) BIT(7 + ((x) * 2)) diff --git a/target/linux/bcm27xx/patches-5.15/950-0781-drm-vc4-Support-zpos-on-all-planes.patch b/target/linux/bcm27xx/patches-5.15/950-0781-drm-vc4-Support-zpos-on-all-planes.patch index 8c1b0ec8053..d9e2b16b41b 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0781-drm-vc4-Support-zpos-on-all-planes.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0781-drm-vc4-Support-zpos-on-all-planes.patch @@ -88,7 +88,7 @@ Signed-off-by: Dave Stevenson if (ret) --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -1573,9 +1573,14 @@ struct drm_plane *vc4_plane_init(struct +@@ -1575,9 +1575,14 @@ struct drm_plane *vc4_plane_init(struct DRM_COLOR_YCBCR_BT709, DRM_COLOR_YCBCR_LIMITED_RANGE); @@ -103,7 +103,7 @@ Signed-off-by: Dave Stevenson int vc4_plane_create_additional_planes(struct drm_device *drm) { struct drm_plane *cursor_plane; -@@ -1591,7 +1596,7 @@ int vc4_plane_create_additional_planes(s +@@ -1593,7 +1598,7 @@ int vc4_plane_create_additional_planes(s * modest number of planes to expose, that should hopefully * still cover any sane usecase. */ @@ -112,7 +112,7 @@ Signed-off-by: Dave Stevenson struct drm_plane *plane = vc4_plane_init(drm, DRM_PLANE_TYPE_OVERLAY); -@@ -1600,17 +1605,28 @@ int vc4_plane_create_additional_planes(s +@@ -1602,17 +1607,28 @@ int vc4_plane_create_additional_planes(s plane->possible_crtcs = GENMASK(drm->mode_config.num_crtc - 1, 0); diff --git a/target/linux/bcm27xx/patches-5.15/950-0787-vc4-drm-vc4_plane-Keep-fractional-source-coords-insi.patch b/target/linux/bcm27xx/patches-5.15/950-0787-vc4-drm-vc4_plane-Keep-fractional-source-coords-insi.patch index 7bb57aafa5a..ba27bbc6d5d 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0787-vc4-drm-vc4_plane-Keep-fractional-source-coords-insi.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0787-vc4-drm-vc4_plane-Keep-fractional-source-coords-insi.patch @@ -23,7 +23,7 @@ Signed-off-by: Dom Cobley u32 src_w[2], src_h[2]; --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -179,9 +179,9 @@ static const struct hvs_format *vc4_get_ +@@ -181,9 +181,9 @@ static const struct hvs_format *vc4_get_ static enum vc4_scaling_mode vc4_get_scaling_mode(u32 src, u32 dst) { @@ -35,7 +35,7 @@ Signed-off-by: Dom Cobley return VC4_SCALING_PPF; else return VC4_SCALING_TPZ; -@@ -388,15 +388,10 @@ static int vc4_plane_setup_clipping_and_ +@@ -390,15 +390,10 @@ static int vc4_plane_setup_clipping_and_ for (i = 0; i < num_planes; i++) vc4_state->offsets[i] = bo->paddr + fb->offsets[i]; @@ -55,7 +55,7 @@ Signed-off-by: Dom Cobley vc4_state->crtc_x = state->dst.x1; vc4_state->crtc_y = state->dst.y1; -@@ -449,7 +444,7 @@ static void vc4_write_tpz(struct vc4_pla +@@ -451,7 +446,7 @@ static void vc4_write_tpz(struct vc4_pla { u32 scale, recip; @@ -64,7 +64,7 @@ Signed-off-by: Dom Cobley /* The specs note that while the reciprocal would be defined * as (1<<32)/scale, ~0 is close enough. -@@ -495,7 +490,7 @@ static u32 vc4_lbm_size(struct drm_plane +@@ -497,7 +492,7 @@ static u32 vc4_lbm_size(struct drm_plane if (vc4_state->x_scaling[0] == VC4_SCALING_TPZ) pix_per_line = vc4_state->crtc_w; else @@ -73,7 +73,7 @@ Signed-off-by: Dom Cobley if (!vc4_state->is_yuv) { if (vc4_state->y_scaling[0] == VC4_SCALING_TPZ) -@@ -586,7 +581,8 @@ static void vc4_plane_calc_load(struct d +@@ -588,7 +583,8 @@ static void vc4_plane_calc_load(struct d for (i = 0; i < fb->format->num_planes; i++) { /* Even if the bandwidth/plane required for a single frame is * @@ -83,7 +83,7 @@ Signed-off-by: Dom Cobley * * when downscaling, we have to read more pixels per line in * the time frame reserved for a single line, so the bandwidth -@@ -595,11 +591,11 @@ static void vc4_plane_calc_load(struct d +@@ -597,11 +593,11 @@ static void vc4_plane_calc_load(struct d * load by this number. We're likely over-estimating the read * demand, but that's better than under-estimating it. */ @@ -99,7 +99,7 @@ Signed-off-by: Dom Cobley vc4_state->hvs_load += vc4_state->crtc_h * vc4_state->crtc_w; } -@@ -752,7 +748,8 @@ static int vc4_plane_mode_set(struct drm +@@ -754,7 +750,8 @@ static int vc4_plane_mode_set(struct drm bool mix_plane_alpha; bool covers_screen; u32 scl0, scl1, pitch0; @@ -109,7 +109,7 @@ Signed-off-by: Dom Cobley u32 hvs_format = format->hvs; unsigned int rotation; int ret, i; -@@ -764,6 +761,9 @@ static int vc4_plane_mode_set(struct drm +@@ -766,6 +763,9 @@ static int vc4_plane_mode_set(struct drm if (ret) return ret; @@ -119,7 +119,7 @@ Signed-off-by: Dom Cobley /* SCL1 is used for Cb/Cr scaling of planar formats. For RGB * and 4:4:4, scl1 should be set to scl0 so both channels of * the scaler do the same thing. For YUV, the Y plane needs -@@ -784,9 +784,11 @@ static int vc4_plane_mode_set(struct drm +@@ -786,9 +786,11 @@ static int vc4_plane_mode_set(struct drm DRM_MODE_REFLECT_Y); /* We must point to the last line when Y reflection is enabled. */ @@ -133,7 +133,7 @@ Signed-off-by: Dom Cobley switch (base_format_mod) { case DRM_FORMAT_MOD_LINEAR: -@@ -801,7 +803,7 @@ static int vc4_plane_mode_set(struct drm +@@ -803,7 +805,7 @@ static int vc4_plane_mode_set(struct drm (i ? v_subsample : 1) * fb->pitches[i]; @@ -142,7 +142,7 @@ Signed-off-by: Dom Cobley (i ? h_subsample : 1) * fb->format->cpp[i]; } -@@ -824,7 +826,7 @@ static int vc4_plane_mode_set(struct drm +@@ -826,7 +828,7 @@ static int vc4_plane_mode_set(struct drm * pitch * tile_h == tile_size * tiles_per_row */ u32 tiles_w = fb->pitches[0] >> (tile_size_shift - tile_h_shift); @@ -151,7 +151,7 @@ Signed-off-by: Dom Cobley u32 tiles_r = tiles_w - tiles_l; u32 tiles_t = src_y >> tile_h_shift; /* Intra-tile offsets, which modify the base address (the -@@ -834,7 +836,7 @@ static int vc4_plane_mode_set(struct drm +@@ -836,7 +838,7 @@ static int vc4_plane_mode_set(struct drm u32 tile_y = (src_y >> 4) & 1; u32 subtile_y = (src_y >> 2) & 3; u32 utile_y = src_y & 3; @@ -160,7 +160,7 @@ Signed-off-by: Dom Cobley u32 y_off = src_y & tile_h_mask; /* When Y reflection is requested we must set the -@@ -930,7 +932,7 @@ static int vc4_plane_mode_set(struct drm +@@ -932,7 +934,7 @@ static int vc4_plane_mode_set(struct drm * of the 12-pixels in that 128-bit word is the * first pixel to be used */ @@ -169,7 +169,7 @@ Signed-off-by: Dom Cobley u32 aligned = remaining_pixels / 12; u32 last_bits = remaining_pixels % 12; -@@ -952,12 +954,12 @@ static int vc4_plane_mode_set(struct drm +@@ -954,12 +956,12 @@ static int vc4_plane_mode_set(struct drm return -EINVAL; } pix_per_tile = tile_w / fb->format->cpp[0]; @@ -184,7 +184,7 @@ Signed-off-by: Dom Cobley vc4_state->offsets[i] += param * tile_w * tile; vc4_state->offsets[i] += src_y / -@@ -1018,10 +1020,8 @@ static int vc4_plane_mode_set(struct drm +@@ -1020,10 +1022,8 @@ static int vc4_plane_mode_set(struct drm vc4_dlist_write(vc4_state, (mix_plane_alpha ? SCALER_POS2_ALPHA_MIX : 0) | vc4_hvs4_get_alpha_blend_mode(state) | @@ -197,7 +197,7 @@ Signed-off-by: Dom Cobley /* Position Word 3: Context. Written by the HVS. */ vc4_dlist_write(vc4_state, 0xc0c0c0c0); -@@ -1079,10 +1079,8 @@ static int vc4_plane_mode_set(struct drm +@@ -1081,10 +1081,8 @@ static int vc4_plane_mode_set(struct drm /* Position Word 2: Source Image Size */ vc4_state->pos2_offset = vc4_state->dlist_count; vc4_dlist_write(vc4_state, diff --git a/target/linux/bcm27xx/patches-5.15/950-0788-vc4-drm-Handle-fractional-coordinates-using-the-phas.patch b/target/linux/bcm27xx/patches-5.15/950-0788-vc4-drm-Handle-fractional-coordinates-using-the-phas.patch index bfd8b07a295..92aed82aee2 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0788-vc4-drm-Handle-fractional-coordinates-using-the-phas.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0788-vc4-drm-Handle-fractional-coordinates-using-the-phas.patch @@ -11,7 +11,7 @@ Signed-off-by: Dom Cobley --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -458,14 +458,47 @@ static void vc4_write_tpz(struct vc4_pla +@@ -460,14 +460,47 @@ static void vc4_write_tpz(struct vc4_pla VC4_SET_FIELD(recip, SCALER_TPZ1_RECIP)); } @@ -62,7 +62,7 @@ Signed-off-by: Dom Cobley } static u32 vc4_lbm_size(struct drm_plane_state *state) -@@ -524,13 +557,13 @@ static void vc4_write_scaling_parameters +@@ -526,13 +559,13 @@ static void vc4_write_scaling_parameters /* Ch0 H-PPF Word 0: Scaling Parameters */ if (vc4_state->x_scaling[channel] == VC4_SCALING_PPF) { vc4_write_ppf(vc4_state, @@ -78,7 +78,7 @@ Signed-off-by: Dom Cobley vc4_dlist_write(vc4_state, 0xc0c0c0c0); } -@@ -978,6 +1011,24 @@ static int vc4_plane_mode_set(struct drm +@@ -980,6 +1013,24 @@ static int vc4_plane_mode_set(struct drm return -EINVAL; } diff --git a/target/linux/bcm27xx/patches-5.15/950-0790-vc4-drm-plane-Make-use-of-chroma-siting-parameter.patch b/target/linux/bcm27xx/patches-5.15/950-0790-vc4-drm-plane-Make-use-of-chroma-siting-parameter.patch index 74ffa102008..afbde785f14 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0790-vc4-drm-plane-Make-use-of-chroma-siting-parameter.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0790-vc4-drm-plane-Make-use-of-chroma-siting-parameter.patch @@ -10,7 +10,7 @@ Signed-off-by: Dom Cobley --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -461,17 +461,18 @@ static void vc4_write_tpz(struct vc4_pla +@@ -463,17 +463,18 @@ static void vc4_write_tpz(struct vc4_pla /* phase magnitude bits */ #define PHASE_BITS 6 @@ -31,7 +31,7 @@ Signed-off-by: Dom Cobley offset += -(1 << PHASE_BITS >> 2); } else { /* the phase is relative to scale_src->x, so shift it for display list's x value */ -@@ -557,13 +558,15 @@ static void vc4_write_scaling_parameters +@@ -559,13 +560,15 @@ static void vc4_write_scaling_parameters /* Ch0 H-PPF Word 0: Scaling Parameters */ if (vc4_state->x_scaling[channel] == VC4_SCALING_PPF) { vc4_write_ppf(vc4_state, @@ -49,7 +49,7 @@ Signed-off-by: Dom Cobley vc4_dlist_write(vc4_state, 0xc0c0c0c0); } -@@ -1622,6 +1625,8 @@ struct drm_plane *vc4_plane_init(struct +@@ -1624,6 +1627,8 @@ struct drm_plane *vc4_plane_init(struct DRM_COLOR_YCBCR_BT709, DRM_COLOR_YCBCR_LIMITED_RANGE); diff --git a/target/linux/bcm27xx/patches-5.15/950-0801-pinctrl-bcm2835-Only-return-non-GPIOs-to-inputs.patch b/target/linux/bcm27xx/patches-5.15/950-0801-pinctrl-bcm2835-Only-return-non-GPIOs-to-inputs.patch index 34000774158..831f54a0816 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0801-pinctrl-bcm2835-Only-return-non-GPIOs-to-inputs.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0801-pinctrl-bcm2835-Only-return-non-GPIOs-to-inputs.patch @@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c -@@ -910,9 +910,12 @@ static int bcm2835_pmx_free(struct pinct +@@ -908,9 +908,12 @@ static int bcm2835_pmx_free(struct pinct unsigned offset) { struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); @@ -28,7 +28,7 @@ Signed-off-by: Phil Elwell return 0; } -@@ -954,10 +957,7 @@ static void bcm2835_pmx_gpio_disable_fre +@@ -952,10 +955,7 @@ static void bcm2835_pmx_gpio_disable_fre struct pinctrl_gpio_range *range, unsigned offset) { diff --git a/target/linux/bcm27xx/patches-5.15/950-0807-Revert-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch b/target/linux/bcm27xx/patches-5.15/950-0807-Revert-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch index 9a14da02b18..afc0957f6ff 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0807-Revert-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0807-Revert-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch @@ -332,7 +332,7 @@ This reverts commit e99a1b69da07ee3b89a6b8005b854e6c04bfb450. * overwrite the setup from the bootloader (just 128b out of --- a/drivers/gpu/drm/vc4/vc4_regs.h +++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -234,7 +234,6 @@ +@@ -240,7 +240,6 @@ # define SCALER_DISPCTRL_DSPEIEOLN(x) BIT(8 + ((x) * 2)) /* Enables Display 0 EOF contribution to SCALER_DISPSTAT_IRQDISP0 */ # define SCALER_DISPCTRL_DSPEIEOF(x) BIT(7 + ((x) * 2)) diff --git a/target/linux/bcm27xx/patches-5.15/950-0808-drm-vc4_hdmi-Force-modeset-when-bpc-changes.patch b/target/linux/bcm27xx/patches-5.15/950-0808-drm-vc4_hdmi-Force-modeset-when-bpc-changes.patch index 7e145873482..2eb71df0270 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0808-drm-vc4_hdmi-Force-modeset-when-bpc-changes.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0808-drm-vc4_hdmi-Force-modeset-when-bpc-changes.patch @@ -25,7 +25,7 @@ Signed-off-by: Dom Cobley --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1809,6 +1809,9 @@ static int vc4_hdmi_encoder_atomic_check +@@ -1810,6 +1810,9 @@ static int vc4_hdmi_encoder_atomic_check struct vc4_hdmi_connector_state *vc4_state = conn_state_to_vc4_hdmi_conn_state(conn_state); struct drm_display_mode *mode = &crtc_state->adjusted_mode; struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); @@ -35,7 +35,7 @@ Signed-off-by: Dom Cobley unsigned long long pixel_rate = mode->clock * 1000; unsigned long long tmds_rate; int ret; -@@ -1837,6 +1840,11 @@ static int vc4_hdmi_encoder_atomic_check +@@ -1838,6 +1841,11 @@ static int vc4_hdmi_encoder_atomic_check if (ret) return ret; diff --git a/target/linux/bcm27xx/patches-5.15/950-0829-vc4_hdmi-Remove-VC4_HDMI_SCHEDULER_CONTROL_VERT_ALWA.patch b/target/linux/bcm27xx/patches-5.15/950-0829-vc4_hdmi-Remove-VC4_HDMI_SCHEDULER_CONTROL_VERT_ALWA.patch index 4b811662d0f..fb521499a2f 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0829-vc4_hdmi-Remove-VC4_HDMI_SCHEDULER_CONTROL_VERT_ALWA.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0829-vc4_hdmi-Remove-VC4_HDMI_SCHEDULER_CONTROL_VERT_ALWA.patch @@ -14,7 +14,7 @@ Signed-off-by: Dom Cobley --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1551,9 +1551,6 @@ static void vc4_hdmi_encoder_post_crtc_e +@@ -1552,9 +1552,6 @@ static void vc4_hdmi_encoder_post_crtc_e WARN_ON(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) & VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE)); diff --git a/target/linux/bcm27xx/patches-5.15/950-0868-drm-vc4-hdmi-Rework-hdmi_enable_4kp60-detection.patch b/target/linux/bcm27xx/patches-5.15/950-0868-drm-vc4-hdmi-Rework-hdmi_enable_4kp60-detection.patch index 8776f648faf..d54597355cd 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0868-drm-vc4-hdmi-Rework-hdmi_enable_4kp60-detection.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0868-drm-vc4-hdmi-Rework-hdmi_enable_4kp60-detection.patch @@ -65,7 +65,7 @@ Signed-off-by: Maxime Ripard struct drm_device *drm = connector->dev; struct drm_display_mode *mode; -@@ -1672,11 +1673,12 @@ vc4_hdmi_encoder_clock_valid(const struc +@@ -1673,11 +1674,12 @@ vc4_hdmi_encoder_clock_valid(const struc { const struct drm_connector *connector = &vc4_hdmi->connector; const struct drm_display_info *info = &connector->display_info; @@ -79,7 +79,7 @@ Signed-off-by: Maxime Ripard return MODE_CLOCK_HIGH; if (info->max_tmds_clock && clock > (info->max_tmds_clock * 1000)) -@@ -3157,14 +3159,6 @@ static int vc4_hdmi_bind(struct device * +@@ -3158,14 +3160,6 @@ static int vc4_hdmi_bind(struct device * vc4_hdmi->disable_wifi_frequencies = of_property_read_bool(dev->of_node, "wifi-2.4ghz-coexistence"); diff --git a/target/linux/bcm27xx/patches-5.15/950-0897-drm-vc4-plane-Prevent-async-update-if-we-don-t-have-.patch b/target/linux/bcm27xx/patches-5.15/950-0897-drm-vc4-plane-Prevent-async-update-if-we-don-t-have-.patch index a6d539ecdf0..d02f52c5579 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0897-drm-vc4-plane-Prevent-async-update-if-we-don-t-have-.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0897-drm-vc4-plane-Prevent-async-update-if-we-don-t-have-.patch @@ -24,7 +24,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -1429,6 +1429,10 @@ static int vc4_plane_atomic_async_check( +@@ -1431,6 +1431,10 @@ static int vc4_plane_atomic_async_check( old_vc4_state = to_vc4_plane_state(plane->state); new_vc4_state = to_vc4_plane_state(new_plane_state); diff --git a/target/linux/bcm27xx/patches-5.15/950-0898-drm-vc4-Consolidate-Hardware-Revision-Check.patch b/target/linux/bcm27xx/patches-5.15/950-0898-drm-vc4-Consolidate-Hardware-Revision-Check.patch index 8699bed008e..78237355b70 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0898-drm-vc4-Consolidate-Hardware-Revision-Check.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0898-drm-vc4-Consolidate-Hardware-Revision-Check.patch @@ -227,7 +227,7 @@ Signed-off-by: Maxime Ripard /* 48k words of 2x12-bit pixels */ drm_mm_init(&hvs->lbm_mm, 0, 48 * 1024); else -@@ -1008,7 +1008,7 @@ static int vc4_hvs_bind(struct device *d +@@ -1019,7 +1019,7 @@ static int vc4_hvs_bind(struct device *d NULL); vc4_debugfs_add_file(drm, "hvs_dlists", vc4_hvs_debugfs_dlist, NULL); @@ -294,7 +294,7 @@ Signed-off-by: Maxime Ripard } else { --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -542,10 +542,10 @@ static u32 vc4_lbm_size(struct drm_plane +@@ -544,10 +544,10 @@ static u32 vc4_lbm_size(struct drm_plane } /* Align it to 64 or 128 (hvs5) bytes */ @@ -307,7 +307,7 @@ Signed-off-by: Maxime Ripard return lbm; } -@@ -664,7 +664,7 @@ static int vc4_plane_allocate_lbm(struct +@@ -666,7 +666,7 @@ static int vc4_plane_allocate_lbm(struct ret = drm_mm_insert_node_generic(&vc4->hvs->lbm_mm, &vc4_state->lbm, lbm_size, @@ -316,7 +316,7 @@ Signed-off-by: Maxime Ripard 0, 0); spin_unlock_irqrestore(&vc4->hvs->mm_lock, irqflags); -@@ -1039,7 +1039,7 @@ static int vc4_plane_mode_set(struct drm +@@ -1041,7 +1041,7 @@ static int vc4_plane_mode_set(struct drm mix_plane_alpha = state->alpha != DRM_BLEND_ALPHA_OPAQUE && fb->format->has_alpha; @@ -325,7 +325,7 @@ Signed-off-by: Maxime Ripard /* Control word */ vc4_dlist_write(vc4_state, SCALER_CTL0_VALID | -@@ -1570,14 +1570,13 @@ static const struct drm_plane_funcs vc4_ +@@ -1572,14 +1572,13 @@ static const struct drm_plane_funcs vc4_ struct drm_plane *vc4_plane_init(struct drm_device *dev, enum drm_plane_type type) { @@ -341,7 +341,7 @@ Signed-off-by: Maxime Ripard static const uint64_t modifiers[] = { DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED, DRM_FORMAT_MOD_BROADCOM_SAND128, -@@ -1593,7 +1592,7 @@ struct drm_plane *vc4_plane_init(struct +@@ -1595,7 +1594,7 @@ struct drm_plane *vc4_plane_init(struct return ERR_PTR(-ENOMEM); for (i = 0; i < ARRAY_SIZE(hvs_formats); i++) { diff --git a/target/linux/bcm27xx/patches-5.15/950-0903-drm-vc4-plane-Register-a-different-drm_plane_helper_.patch b/target/linux/bcm27xx/patches-5.15/950-0903-drm-vc4-plane-Register-a-different-drm_plane_helper_.patch index c861170b426..e44aa408cc9 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0903-drm-vc4-plane-Register-a-different-drm_plane_helper_.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0903-drm-vc4-plane-Register-a-different-drm_plane_helper_.patch @@ -20,7 +20,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -1502,6 +1502,13 @@ static const struct drm_plane_helper_fun +@@ -1504,6 +1504,13 @@ static const struct drm_plane_helper_fun .atomic_async_update = vc4_plane_atomic_async_update, }; @@ -34,7 +34,7 @@ Signed-off-by: Maxime Ripard static bool vc4_format_mod_supported(struct drm_plane *plane, uint32_t format, uint64_t modifier) -@@ -1606,7 +1613,10 @@ struct drm_plane *vc4_plane_init(struct +@@ -1608,7 +1615,10 @@ struct drm_plane *vc4_plane_init(struct if (ret) return ERR_PTR(ret); diff --git a/target/linux/generic/backport-5.15/005-v5.17-01-Kbuild-use-Wdeclaration-after-statement.patch b/target/linux/generic/backport-5.15/005-v5.17-01-Kbuild-use-Wdeclaration-after-statement.patch index 092addcd5d2..b481dd30617 100644 --- a/target/linux/generic/backport-5.15/005-v5.17-01-Kbuild-use-Wdeclaration-after-statement.patch +++ b/target/linux/generic/backport-5.15/005-v5.17-01-Kbuild-use-Wdeclaration-after-statement.patch @@ -37,7 +37,7 @@ Signed-off-by: Masahiro Yamada --- a/Makefile +++ b/Makefile -@@ -433,7 +433,8 @@ endif +@@ -440,7 +440,8 @@ endif HOSTPKG_CONFIG = pkg-config export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \ diff --git a/target/linux/generic/backport-5.15/005-v5.17-02-Kbuild-move-to-std-gnu11.patch b/target/linux/generic/backport-5.15/005-v5.17-02-Kbuild-move-to-std-gnu11.patch index 3bcf480cb22..94fc52fd8e0 100644 --- a/target/linux/generic/backport-5.15/005-v5.17-02-Kbuild-move-to-std-gnu11.patch +++ b/target/linux/generic/backport-5.15/005-v5.17-02-Kbuild-move-to-std-gnu11.patch @@ -49,7 +49,7 @@ Signed-off-by: Masahiro Yamada --- a/Makefile +++ b/Makefile -@@ -517,7 +517,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror +@@ -524,7 +524,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \ -Werror=implicit-function-declaration -Werror=implicit-int \ -Werror=return-type -Wno-format-security \ diff --git a/target/linux/generic/backport-5.15/005-v5.17-03-Kbuild-use-std-gnu11-for-KBUILD_USERCFLAGS.patch b/target/linux/generic/backport-5.15/005-v5.17-03-Kbuild-use-std-gnu11-for-KBUILD_USERCFLAGS.patch index 91121b7bacb..e34acbba171 100644 --- a/target/linux/generic/backport-5.15/005-v5.17-03-Kbuild-use-std-gnu11-for-KBUILD_USERCFLAGS.patch +++ b/target/linux/generic/backport-5.15/005-v5.17-03-Kbuild-use-std-gnu11-for-KBUILD_USERCFLAGS.patch @@ -32,7 +32,7 @@ Signed-off-by: Masahiro Yamada --- a/Makefile +++ b/Makefile -@@ -433,7 +433,7 @@ endif +@@ -440,7 +440,7 @@ endif HOSTPKG_CONFIG = pkg-config export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \ diff --git a/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch b/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch index 5f2bada00a2..1cb82d1b8f9 100644 --- a/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch +++ b/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch @@ -593,7 +593,7 @@ Change-Id: I71de7cd15b8dfa6f9fdd838023474693c4fee0a7 VM_BUG_ON_PAGE(tail > 2 && page_tail->mapping != TAIL_MAPPING, --- a/mm/memcontrol.c +++ b/mm/memcontrol.c -@@ -5237,6 +5237,7 @@ static struct mem_cgroup *mem_cgroup_all +@@ -5241,6 +5241,7 @@ static struct mem_cgroup *mem_cgroup_all memcg->deferred_split_queue.split_queue_len = 0; #endif idr_replace(&mem_cgroup_idr, memcg, memcg->id.id); diff --git a/target/linux/generic/backport-5.15/020-v6.1-05-mm-multigenerational-lru-mm_struct-list.patch b/target/linux/generic/backport-5.15/020-v6.1-05-mm-multigenerational-lru-mm_struct-list.patch index 833d3f97f40..a1c6e0f75d9 100644 --- a/target/linux/generic/backport-5.15/020-v6.1-05-mm-multigenerational-lru-mm_struct-list.patch +++ b/target/linux/generic/backport-5.15/020-v6.1-05-mm-multigenerational-lru-mm_struct-list.patch @@ -339,7 +339,7 @@ Change-Id: I25d9eda8c6bdc7c3653b9f210a159d6c247c81e8 /* will mmdrop() in finish_task_switch(). */ --- a/mm/memcontrol.c +++ b/mm/memcontrol.c -@@ -5174,6 +5174,7 @@ static void __mem_cgroup_free(struct mem +@@ -5178,6 +5178,7 @@ static void __mem_cgroup_free(struct mem static void mem_cgroup_free(struct mem_cgroup *memcg) { @@ -347,7 +347,7 @@ Change-Id: I25d9eda8c6bdc7c3653b9f210a159d6c247c81e8 memcg_wb_domain_exit(memcg); __mem_cgroup_free(memcg); } -@@ -6206,6 +6207,29 @@ static void mem_cgroup_move_task(void) +@@ -6210,6 +6211,29 @@ static void mem_cgroup_move_task(void) } #endif @@ -377,7 +377,7 @@ Change-Id: I25d9eda8c6bdc7c3653b9f210a159d6c247c81e8 static int seq_puts_memcg_tunable(struct seq_file *m, unsigned long value) { if (value == PAGE_COUNTER_MAX) -@@ -6549,6 +6573,7 @@ struct cgroup_subsys memory_cgrp_subsys +@@ -6553,6 +6577,7 @@ struct cgroup_subsys memory_cgrp_subsys .css_reset = mem_cgroup_css_reset, .css_rstat_flush = mem_cgroup_css_rstat_flush, .can_attach = mem_cgroup_can_attach, diff --git a/target/linux/generic/backport-5.15/702-v5.19-01-arm64-dts-mediatek-mt7622-add-support-for-coherent-D.patch b/target/linux/generic/backport-5.15/702-v5.19-01-arm64-dts-mediatek-mt7622-add-support-for-coherent-D.patch index d9015d4805d..9f2512a1d05 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-01-arm64-dts-mediatek-mt7622-add-support-for-coherent-D.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-01-arm64-dts-mediatek-mt7622-add-support-for-coherent-D.patch @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau interface-type = "ace"; reg = <0x5000 0x1000>; }; -@@ -937,6 +937,8 @@ +@@ -938,6 +938,8 @@ power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>; mediatek,ethsys = <ðsys>; mediatek,sgmiisys = <&sgmiisys>; diff --git a/target/linux/generic/backport-5.15/702-v5.19-04-arm64-dts-mediatek-mt7622-introduce-nodes-for-Wirele.patch b/target/linux/generic/backport-5.15/702-v5.19-04-arm64-dts-mediatek-mt7622-introduce-nodes-for-Wirele.patch index f59a364a736..2c6e3fd3cd3 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-04-arm64-dts-mediatek-mt7622-introduce-nodes-for-Wirele.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-04-arm64-dts-mediatek-mt7622-introduce-nodes-for-Wirele.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -893,6 +893,11 @@ +@@ -894,6 +894,11 @@ }; }; @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau ethsys: syscon@1b000000 { compatible = "mediatek,mt7622-ethsys", "syscon"; -@@ -911,6 +916,26 @@ +@@ -912,6 +917,26 @@ #dma-cells = <1>; }; @@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau eth: ethernet@1b100000 { compatible = "mediatek,mt7622-eth", "mediatek,mt2701-eth", -@@ -938,6 +963,9 @@ +@@ -939,6 +964,9 @@ mediatek,ethsys = <ðsys>; mediatek,sgmiisys = <&sgmiisys>; mediatek,cci-control = <&cci_control2>; diff --git a/target/linux/generic/backport-5.15/702-v5.19-13-net-ethernet-mtk_eth_soc-use-standard-property-for-c.patch b/target/linux/generic/backport-5.15/702-v5.19-13-net-ethernet-mtk_eth_soc-use-standard-property-for-c.patch index 0a2c1435f75..c893d8c8bbe 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-13-net-ethernet-mtk_eth_soc-use-standard-property-for-c.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-13-net-ethernet-mtk_eth_soc-use-standard-property-for-c.patch @@ -13,7 +13,7 @@ Signed-off-by: David S. Miller --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -962,7 +962,7 @@ +@@ -963,7 +963,7 @@ power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>; mediatek,ethsys = <ðsys>; mediatek,sgmiisys = <&sgmiisys>; diff --git a/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch b/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch index cf39ba1abd8..98687126487 100644 --- a/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch +++ b/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch @@ -17,7 +17,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -2268,6 +2268,23 @@ struct btmtk_section_map { +@@ -2272,6 +2272,23 @@ struct btmtk_section_map { }; } __packed; @@ -41,7 +41,7 @@ Signed-off-by: Marcel Holtmann static void btusb_mtk_wmt_recv(struct urb *urb) { struct hci_dev *hdev = urb->context; -@@ -3919,6 +3936,7 @@ static int btusb_probe(struct usb_interf +@@ -3923,6 +3940,7 @@ static int btusb_probe(struct usb_interf hdev->shutdown = btusb_mtk_shutdown; hdev->manufacturer = 70; hdev->cmd_timeout = btusb_mtk_cmd_timeout; diff --git a/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch b/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch index 9b8d8635a85..cff537a8669 100644 --- a/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch +++ b/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch @@ -18,7 +18,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -2273,7 +2273,7 @@ static int btusb_set_bdaddr_mtk(struct h +@@ -2277,7 +2277,7 @@ static int btusb_set_bdaddr_mtk(struct h struct sk_buff *skb; long ret; diff --git a/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch b/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch index 549005c5a76..d670195da1f 100644 --- a/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch +++ b/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch @@ -58,7 +58,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -460,6 +460,9 @@ static const struct usb_device_id blackl +@@ -464,6 +464,9 @@ static const struct usb_device_id blackl { USB_DEVICE(0x13d3, 0x3564), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH | BTUSB_VALID_LE_STATES }, diff --git a/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch b/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch index 54e3388860c..be9dc734215 100644 --- a/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch +++ b/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch @@ -56,7 +56,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -451,6 +451,9 @@ static const struct usb_device_id blackl +@@ -455,6 +455,9 @@ static const struct usb_device_id blackl BTUSB_VALID_LE_STATES }, /* Additional MediaTek MT7921 Bluetooth devices */ diff --git a/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch b/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch index 8957ff8e22b..24ec68a2ca5 100644 --- a/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch +++ b/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch @@ -54,7 +54,7 @@ Signed-off-by: Luiz Augusto von Dentz --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -469,6 +469,9 @@ static const struct usb_device_id blackl +@@ -473,6 +473,9 @@ static const struct usb_device_id blackl { USB_DEVICE(0x0489, 0xe0cd), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH | BTUSB_VALID_LE_STATES }, diff --git a/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch index 595318fa52a..9dc86303a7a 100644 --- a/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch +++ b/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch @@ -116,7 +116,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3588,6 +3588,11 @@ static int xmit_one(struct sk_buff *skb, +@@ -3590,6 +3590,11 @@ static int xmit_one(struct sk_buff *skb, if (dev_nit_active(dev)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-5.15/902-debloat_proc.patch b/target/linux/generic/hack-5.15/902-debloat_proc.patch index 102baa0bf4d..ef2fe47ae9a 100644 --- a/target/linux/generic/hack-5.15/902-debloat_proc.patch +++ b/target/linux/generic/hack-5.15/902-debloat_proc.patch @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3857,6 +3857,8 @@ static __net_initdata struct pernet_oper +@@ -3866,6 +3866,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/pending-5.15/103-kbuild-export-SUBARCH.patch b/target/linux/generic/pending-5.15/103-kbuild-export-SUBARCH.patch index 2bedd94642b..120b6e4cf89 100644 --- a/target/linux/generic/pending-5.15/103-kbuild-export-SUBARCH.patch +++ b/target/linux/generic/pending-5.15/103-kbuild-export-SUBARCH.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -527,7 +527,7 @@ KBUILD_LDFLAGS_MODULE := +@@ -534,7 +534,7 @@ KBUILD_LDFLAGS_MODULE := KBUILD_LDFLAGS := CLANG_FLAGS := diff --git a/target/linux/generic/pending-5.15/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch b/target/linux/generic/pending-5.15/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch index f600976065a..de76d6918b7 100644 --- a/target/linux/generic/pending-5.15/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch +++ b/target/linux/generic/pending-5.15/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch @@ -202,7 +202,7 @@ Reported-by: Dan Carpenter return !!nor->params->erase_map.uniform_erase_type; } -@@ -2391,6 +2393,7 @@ static int spi_nor_select_erase(struct s +@@ -2400,6 +2402,7 @@ static int spi_nor_select_erase(struct s { struct spi_nor_erase_map *map = &nor->params->erase_map; const struct spi_nor_erase_type *erase = NULL; @@ -210,7 +210,7 @@ Reported-by: Dan Carpenter struct mtd_info *mtd = &nor->mtd; u32 wanted_size = nor->info->sector_size; int i; -@@ -2423,8 +2426,9 @@ static int spi_nor_select_erase(struct s +@@ -2432,8 +2435,9 @@ static int spi_nor_select_erase(struct s */ for (i = SNOR_ERASE_TYPE_MAX - 1; i >= 0; i--) { if (map->erase_type[i].size) { @@ -222,7 +222,7 @@ Reported-by: Dan Carpenter } } -@@ -2432,6 +2436,9 @@ static int spi_nor_select_erase(struct s +@@ -2441,6 +2445,9 @@ static int spi_nor_select_erase(struct s return -EINVAL; mtd->erasesize = erase->size; diff --git a/target/linux/generic/pending-5.15/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-5.15/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index b120548d2e7..393308f7175 100644 --- a/target/linux/generic/pending-5.15/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-5.15/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 -@@ -1184,6 +1184,73 @@ static struct mtd_info * __init open_mtd +@@ -1191,6 +1191,73 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -82,7 +82,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1267,6 +1334,12 @@ static int __init ubi_init(void) +@@ -1274,6 +1341,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/pending-5.15/610-netfilter_match_bypass_default_checks.patch b/target/linux/generic/pending-5.15/610-netfilter_match_bypass_default_checks.patch index 457703121cd..c1e050e935e 100644 --- a/target/linux/generic/pending-5.15/610-netfilter_match_bypass_default_checks.patch +++ b/target/linux/generic/pending-5.15/610-netfilter_match_bypass_default_checks.patch @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau for (i = sizeof(struct ipt_entry); i < e->target_offset; i += m->u.match_size) { -@@ -1223,12 +1260,15 @@ compat_copy_entry_to_user(struct ipt_ent +@@ -1222,12 +1259,15 @@ compat_copy_entry_to_user(struct ipt_ent compat_uint_t origsize; const struct xt_entry_match *ematch; int ret = 0; diff --git a/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index a1899708230..86bd9664e55 100644 --- a/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -6300,6 +6331,8 @@ static int ip6_route_dev_notify(struct n +@@ -6301,6 +6332,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -6311,6 +6344,7 @@ static int ip6_route_dev_notify(struct n +@@ -6312,6 +6345,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -6502,6 +6536,8 @@ static int __net_init ip6_route_net_init +@@ -6503,6 +6537,8 @@ static int __net_init ip6_route_net_init #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.fib6_has_custom_rules = false; @@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template, sizeof(*net->ipv6.ip6_prohibit_entry), GFP_KERNEL); -@@ -6512,11 +6548,21 @@ static int __net_init ip6_route_net_init +@@ -6513,11 +6549,21 @@ static int __net_init ip6_route_net_init ip6_template_metrics, true); INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached); @@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); -@@ -6543,6 +6589,8 @@ out: +@@ -6544,6 +6590,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -6562,6 +6610,7 @@ static void __net_exit ip6_route_net_exi +@@ -6563,6 +6611,7 @@ static void __net_exit ip6_route_net_exi kfree(net->ipv6.ip6_null_entry); #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); @@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski kfree(net->ipv6.ip6_blk_hole_entry); #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); -@@ -6645,6 +6694,9 @@ void __init ip6_route_init_special_entri +@@ -6646,6 +6695,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 2b291813861..2d3efb73d00 100644 --- a/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u8 inner_protocol_type:1; --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6063,6 +6063,9 @@ static enum gro_result dev_gro_receive(s +@@ -6065,6 +6065,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -8077,6 +8080,48 @@ static void __netdev_adjacent_dev_unlink +@@ -8079,6 +8082,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -8128,6 +8173,7 @@ static int __netdev_upper_dev_link(struc +@@ -8130,6 +8175,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -8224,6 +8270,7 @@ static void __netdev_upper_dev_unlink(st +@@ -8226,6 +8272,7 @@ static void __netdev_upper_dev_unlink(st __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -9043,6 +9090,7 @@ int dev_set_mac_address(struct net_devic +@@ -9045,6 +9092,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/ipq806x/patches-5.15/110-01-thermal-qcom-tsens-init-debugfs-only-with-successful.patch b/target/linux/ipq806x/patches-5.15/110-01-thermal-qcom-tsens-init-debugfs-only-with-successful.patch index ef851dfc946..4caa2a9560e 100644 --- a/target/linux/ipq806x/patches-5.15/110-01-thermal-qcom-tsens-init-debugfs-only-with-successful.patch +++ b/target/linux/ipq806x/patches-5.15/110-01-thermal-qcom-tsens-init-debugfs-only-with-successful.patch @@ -25,7 +25,7 @@ Acked-by: Thara Gopinath err_put_device: put_device(&op->dev); return ret; -@@ -1157,7 +1155,12 @@ static int tsens_probe(struct platform_d +@@ -1163,7 +1161,12 @@ static int tsens_probe(struct platform_d } } diff --git a/target/linux/ipq807x/patches-5.15/0001-v5.16-arm64-dts-qcom-ipq8074-add-SPMI-bus.patch b/target/linux/ipq807x/patches-5.15/0001-v5.16-arm64-dts-qcom-ipq8074-add-SPMI-bus.patch index c988814156c..f1c09233012 100644 --- a/target/linux/ipq807x/patches-5.15/0001-v5.16-arm64-dts-qcom-ipq8074-add-SPMI-bus.patch +++ b/target/linux/ipq807x/patches-5.15/0001-v5.16-arm64-dts-qcom-ipq8074-add-SPMI-bus.patch @@ -15,7 +15,7 @@ Link: https://lore.kernel.org/r/20210905165816.655275-1-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -293,6 +293,25 @@ +@@ -320,6 +320,25 @@ #reset-cells = <0x1>; }; diff --git a/target/linux/ipq807x/patches-5.15/0002-v5.16-arm64-dts-qcom-Update-BAM-DMA-node-name-per-DT-schem.patch b/target/linux/ipq807x/patches-5.15/0002-v5.16-arm64-dts-qcom-Update-BAM-DMA-node-name-per-DT-schem.patch index ec4c3552f05..0e31970a829 100644 --- a/target/linux/ipq807x/patches-5.15/0002-v5.16-arm64-dts-qcom-Update-BAM-DMA-node-name-per-DT-schem.patch +++ b/target/linux/ipq807x/patches-5.15/0002-v5.16-arm64-dts-qcom-Update-BAM-DMA-node-name-per-DT-schem.patch @@ -15,7 +15,7 @@ Link: https://lore.kernel.org/r/20210831052325.21229-1-shawn.guo@linaro.org --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -212,7 +212,7 @@ +@@ -239,7 +239,7 @@ status = "disabled"; }; diff --git a/target/linux/ipq807x/patches-5.15/0003-v5.16-arm64-dts-qcom-ipq8074-Add-QUP5-I2C-node.patch b/target/linux/ipq807x/patches-5.15/0003-v5.16-arm64-dts-qcom-ipq8074-Add-QUP5-I2C-node.patch index 4cc81e64c43..b20cbe1b37c 100644 --- a/target/linux/ipq807x/patches-5.15/0003-v5.16-arm64-dts-qcom-ipq8074-Add-QUP5-I2C-node.patch +++ b/target/linux/ipq807x/patches-5.15/0003-v5.16-arm64-dts-qcom-ipq8074-Add-QUP5-I2C-node.patch @@ -16,7 +16,7 @@ Link: https://lore.kernel.org/r/20211001145421.18302-1-amadeus@jmu.edu.cn --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -430,6 +430,21 @@ +@@ -457,6 +457,21 @@ status = "disabled"; }; diff --git a/target/linux/ipq807x/patches-5.15/0004-v5.16-arm64-dts-qcom-msm8996-Move-clock-cells-to-QMP-PHY-c.patch b/target/linux/ipq807x/patches-5.15/0004-v5.16-arm64-dts-qcom-msm8996-Move-clock-cells-to-QMP-PHY-c.patch index b001e81b3a5..94fc27750c8 100644 --- a/target/linux/ipq807x/patches-5.15/0004-v5.16-arm64-dts-qcom-msm8996-Move-clock-cells-to-QMP-PHY-c.patch +++ b/target/linux/ipq807x/patches-5.15/0004-v5.16-arm64-dts-qcom-msm8996-Move-clock-cells-to-QMP-PHY-c.patch @@ -34,7 +34,7 @@ Link: https://lore.kernel.org/r/20210929034253.24570-4-shawn.guo@linaro.org + #clock-cells = <1>; clocks = <&gcc GCC_USB1_PIPE_CLK>; clock-names = "pipe0"; - clock-output-names = "gcc_usb1_pipe_clk_src"; + clock-output-names = "usb3phy_1_cc_pipe_clk"; @@ -134,7 +134,6 @@ ssphy_0: phy@78000 { compatible = "qcom,ipq8074-qmp-usb3-phy"; @@ -50,4 +50,4 @@ Link: https://lore.kernel.org/r/20210929034253.24570-4-shawn.guo@linaro.org + #clock-cells = <1>; clocks = <&gcc GCC_USB0_PIPE_CLK>; clock-names = "pipe0"; - clock-output-names = "gcc_usb0_pipe_clk_src"; + clock-output-names = "usb3phy_0_cc_pipe_clk"; diff --git a/target/linux/ipq807x/patches-5.15/0006-v5.16-arm64-dts-qcom-Fix-IPQ8074-PCIe-PHY-nodes.patch b/target/linux/ipq807x/patches-5.15/0006-v5.16-arm64-dts-qcom-Fix-IPQ8074-PCIe-PHY-nodes.patch deleted file mode 100644 index 51b58ed238f..00000000000 --- a/target/linux/ipq807x/patches-5.15/0006-v5.16-arm64-dts-qcom-Fix-IPQ8074-PCIe-PHY-nodes.patch +++ /dev/null @@ -1,94 +0,0 @@ -From a9ab8f5de2fc752e37918cfd5dcd16d625d9ecb2 Mon Sep 17 00:00:00 2001 -From: Shawn Guo -Date: Wed, 29 Sep 2021 11:42:51 +0800 -Subject: [PATCH] arm64: dts: qcom: Fix IPQ8074 PCIe PHY nodes - -IPQ8074 PCIe PHY nodes are broken in the many ways: - -- '#address-cells', '#size-cells' and 'ranges' are missing. -- Child phy/lane node is missing, and the child properties like - '#phy-cells' and 'clocks' are mistakenly put into parent node. -- The clocks properties for parent node are missing. - -Fix them to get the nodes comply with the bindings schema. - -Signed-off-by: Shawn Guo -Signed-off-by: Bjorn Andersson -Link: https://lore.kernel.org/r/20210929034253.24570-9-shawn.guo@linaro.org ---- - arch/arm64/boot/dts/qcom/ipq8074.dtsi | 46 +++++++++++++++++++++------ - 1 file changed, 36 insertions(+), 10 deletions(-) - ---- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -174,34 +174,60 @@ - status = "disabled"; - }; - -- pcie_phy0: phy@86000 { -+ pcie_qmp0: phy@86000 { - compatible = "qcom,ipq8074-qmp-pcie-phy"; - reg = <0x00086000 0x1000>; -- #phy-cells = <0>; -- clocks = <&gcc GCC_PCIE0_PIPE_CLK>; -- clock-names = "pipe_clk"; -- clock-output-names = "pcie20_phy0_pipe_clk"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; - -+ clocks = <&gcc GCC_PCIE0_AUX_CLK>, -+ <&gcc GCC_PCIE0_AHB_CLK>; -+ clock-names = "aux", "cfg_ahb"; - resets = <&gcc GCC_PCIE0_PHY_BCR>, - <&gcc GCC_PCIE0PHY_PHY_BCR>; - reset-names = "phy", - "common"; - status = "disabled"; -+ -+ pcie_phy0: phy@86200 { -+ reg = <0x86200 0x16c>, -+ <0x86400 0x200>, -+ <0x86800 0x4f4>; -+ #phy-cells = <0>; -+ #clock-cells = <0>; -+ clocks = <&gcc GCC_PCIE0_PIPE_CLK>; -+ clock-names = "pipe0"; -+ clock-output-names = "pcie_0_pipe_clk"; -+ }; - }; - -- pcie_phy1: phy@8e000 { -+ pcie_qmp1: phy@8e000 { - compatible = "qcom,ipq8074-qmp-pcie-phy"; - reg = <0x0008e000 0x1000>; -- #phy-cells = <0>; -- clocks = <&gcc GCC_PCIE1_PIPE_CLK>; -- clock-names = "pipe_clk"; -- clock-output-names = "pcie20_phy1_pipe_clk"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; - -+ clocks = <&gcc GCC_PCIE1_AUX_CLK>, -+ <&gcc GCC_PCIE1_AHB_CLK>; -+ clock-names = "aux", "cfg_ahb"; - resets = <&gcc GCC_PCIE1_PHY_BCR>, - <&gcc GCC_PCIE1PHY_PHY_BCR>; - reset-names = "phy", - "common"; - status = "disabled"; -+ -+ pcie_phy1: phy@8e200 { -+ reg = <0x8e200 0x16c>, -+ <0x8e400 0x200>, -+ <0x8e800 0x4f4>; -+ #phy-cells = <0>; -+ #clock-cells = <0>; -+ clocks = <&gcc GCC_PCIE1_PIPE_CLK>; -+ clock-names = "pipe0"; -+ clock-output-names = "pcie_1_pipe_clk"; -+ }; - }; - - prng: rng@e3000 { diff --git a/target/linux/ipq807x/patches-5.15/0007-v5.17-arm64-dts-qcom-ipq8074-add-MDIO-bus.patch b/target/linux/ipq807x/patches-5.15/0007-v5.17-arm64-dts-qcom-ipq8074-add-MDIO-bus.patch index 30f09db23ad..b31c06cb582 100644 --- a/target/linux/ipq807x/patches-5.15/0007-v5.17-arm64-dts-qcom-ipq8074-add-MDIO-bus.patch +++ b/target/linux/ipq807x/patches-5.15/0007-v5.17-arm64-dts-qcom-ipq8074-add-MDIO-bus.patch @@ -15,7 +15,7 @@ Link: https://lore.kernel.org/r/20211007115846.26255-1-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -230,6 +230,18 @@ +@@ -231,6 +231,18 @@ }; }; diff --git a/target/linux/ipq807x/patches-5.15/0008-v5.18-arm64-dts-qcom-ipq8074-add-SMEM-support.patch b/target/linux/ipq807x/patches-5.15/0008-v5.18-arm64-dts-qcom-ipq8074-add-SMEM-support.patch index df8edfc8d9b..afaa2bae829 100644 --- a/target/linux/ipq807x/patches-5.15/0008-v5.18-arm64-dts-qcom-ipq8074-add-SMEM-support.patch +++ b/target/linux/ipq807x/patches-5.15/0008-v5.18-arm64-dts-qcom-ipq8074-add-SMEM-support.patch @@ -36,7 +36,7 @@ Link: https://lore.kernel.org/r/20220106212512.1970828-1-robimarko@gmail.com firmware { scm { compatible = "qcom,scm-ipq8074", "qcom,scm"; -@@ -331,6 +345,12 @@ +@@ -332,6 +346,12 @@ #reset-cells = <0x1>; }; diff --git a/target/linux/ipq807x/patches-5.15/0010-v5.18-arm64-dts-qcom-ipq8074-enable-the-GICv2m-support.patch b/target/linux/ipq807x/patches-5.15/0010-v5.18-arm64-dts-qcom-ipq8074-enable-the-GICv2m-support.patch index 6c4bf78fabc..3d5372a6e61 100644 --- a/target/linux/ipq807x/patches-5.15/0010-v5.18-arm64-dts-qcom-ipq8074-enable-the-GICv2m-support.patch +++ b/target/linux/ipq807x/patches-5.15/0010-v5.18-arm64-dts-qcom-ipq8074-enable-the-GICv2m-support.patch @@ -15,7 +15,7 @@ Link: https://lore.kernel.org/r/1644334525-11577-2-git-send-email-quic_kathirav@ --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -634,9 +634,18 @@ +@@ -635,9 +635,18 @@ intc: interrupt-controller@b000000 { compatible = "qcom,msm-qgic2"; diff --git a/target/linux/ipq807x/patches-5.15/0011-v5.18-arm64-dts-qcom-ipq8074-drop-the-clock-frequency-prop.patch b/target/linux/ipq807x/patches-5.15/0011-v5.18-arm64-dts-qcom-ipq8074-drop-the-clock-frequency-prop.patch index 09236e3c8c6..9018087e407 100644 --- a/target/linux/ipq807x/patches-5.15/0011-v5.18-arm64-dts-qcom-ipq8074-drop-the-clock-frequency-prop.patch +++ b/target/linux/ipq807x/patches-5.15/0011-v5.18-arm64-dts-qcom-ipq8074-drop-the-clock-frequency-prop.patch @@ -15,7 +15,7 @@ Link: https://lore.kernel.org/r/1643819709-5410-2-git-send-email-quic_kathirav@q --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -670,7 +670,6 @@ +@@ -671,7 +671,6 @@ ranges; compatible = "arm,armv7-timer-mem"; reg = <0x0b120000 0x1000>; diff --git a/target/linux/ipq807x/patches-5.15/0012-v5.19-arm64-dts-qcom-align-dmas-in-I2C-SPI-UART-with-DT-sc.patch b/target/linux/ipq807x/patches-5.15/0012-v5.19-arm64-dts-qcom-align-dmas-in-I2C-SPI-UART-with-DT-sc.patch index d7d31cae894..19be9bd861b 100644 --- a/target/linux/ipq807x/patches-5.15/0012-v5.19-arm64-dts-qcom-align-dmas-in-I2C-SPI-UART-with-DT-sc.patch +++ b/target/linux/ipq807x/patches-5.15/0012-v5.19-arm64-dts-qcom-align-dmas-in-I2C-SPI-UART-with-DT-sc.patch @@ -15,7 +15,7 @@ Link: https://lore.kernel.org/r/20220405063451.12011-2-krzysztof.kozlowski@linar --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -471,8 +471,8 @@ +@@ -472,8 +472,8 @@ <&gcc GCC_BLSP1_QUP2_I2C_APPS_CLK>; clock-names = "iface", "core"; clock-frequency = <400000>; @@ -26,7 +26,7 @@ Link: https://lore.kernel.org/r/20220405063451.12011-2-krzysztof.kozlowski@linar pinctrl-0 = <&i2c_0_pins>; pinctrl-names = "default"; status = "disabled"; -@@ -488,8 +488,8 @@ +@@ -489,8 +489,8 @@ <&gcc GCC_BLSP1_QUP3_I2C_APPS_CLK>; clock-names = "iface", "core"; clock-frequency = <100000>; @@ -37,7 +37,7 @@ Link: https://lore.kernel.org/r/20220405063451.12011-2-krzysztof.kozlowski@linar status = "disabled"; }; -@@ -503,8 +503,8 @@ +@@ -504,8 +504,8 @@ <&gcc GCC_BLSP1_QUP5_I2C_APPS_CLK>; clock-names = "iface", "core"; clock-frequency = <400000>; @@ -48,7 +48,7 @@ Link: https://lore.kernel.org/r/20220405063451.12011-2-krzysztof.kozlowski@linar status = "disabled"; }; -@@ -518,8 +518,8 @@ +@@ -519,8 +519,8 @@ <&gcc GCC_BLSP1_QUP6_I2C_APPS_CLK>; clock-names = "iface", "core"; clock-frequency = <100000>; diff --git a/target/linux/ipq807x/patches-5.15/0013-v5.19-arm64-dts-qcom-align-clocks-in-I2C-SPI-with-DT-schem.patch b/target/linux/ipq807x/patches-5.15/0013-v5.19-arm64-dts-qcom-align-clocks-in-I2C-SPI-with-DT-schem.patch index 82701209255..d1c214c2c78 100644 --- a/target/linux/ipq807x/patches-5.15/0013-v5.19-arm64-dts-qcom-align-clocks-in-I2C-SPI-with-DT-schem.patch +++ b/target/linux/ipq807x/patches-5.15/0013-v5.19-arm64-dts-qcom-align-clocks-in-I2C-SPI-with-DT-schem.patch @@ -14,7 +14,7 @@ Link: https://lore.kernel.org/r/20220405063451.12011-3-krzysztof.kozlowski@linar --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -467,9 +467,9 @@ +@@ -468,9 +468,9 @@ #size-cells = <0>; reg = <0x078b6000 0x600>; interrupts = ; @@ -27,7 +27,7 @@ Link: https://lore.kernel.org/r/20220405063451.12011-3-krzysztof.kozlowski@linar clock-frequency = <400000>; dmas = <&blsp_dma 14>, <&blsp_dma 15>; dma-names = "tx", "rx"; -@@ -484,9 +484,9 @@ +@@ -485,9 +485,9 @@ #size-cells = <0>; reg = <0x078b7000 0x600>; interrupts = ; @@ -40,7 +40,7 @@ Link: https://lore.kernel.org/r/20220405063451.12011-3-krzysztof.kozlowski@linar clock-frequency = <100000>; dmas = <&blsp_dma 16>, <&blsp_dma 17>; dma-names = "tx", "rx"; -@@ -499,9 +499,9 @@ +@@ -500,9 +500,9 @@ #size-cells = <0>; reg = <0x78b9000 0x600>; interrupts = ; @@ -53,7 +53,7 @@ Link: https://lore.kernel.org/r/20220405063451.12011-3-krzysztof.kozlowski@linar clock-frequency = <400000>; dmas = <&blsp_dma 20>, <&blsp_dma 21>; dma-names = "tx", "rx"; -@@ -514,9 +514,9 @@ +@@ -515,9 +515,9 @@ #size-cells = <0>; reg = <0x078ba000 0x600>; interrupts = ; diff --git a/target/linux/ipq807x/patches-5.15/0014-v5.19-arm64-dts-qcom-correct-DWC3-node-names-and-unit-addr.patch b/target/linux/ipq807x/patches-5.15/0014-v5.19-arm64-dts-qcom-correct-DWC3-node-names-and-unit-addr.patch index 923bffadece..1b41f970024 100644 --- a/target/linux/ipq807x/patches-5.15/0014-v5.19-arm64-dts-qcom-correct-DWC3-node-names-and-unit-addr.patch +++ b/target/linux/ipq807x/patches-5.15/0014-v5.19-arm64-dts-qcom-correct-DWC3-node-names-and-unit-addr.patch @@ -16,7 +16,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -578,7 +578,7 @@ +@@ -579,7 +579,7 @@ resets = <&gcc GCC_USB0_BCR>; status = "disabled"; @@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman compatible = "snps,dwc3"; reg = <0x8a00000 0xcd00>; interrupts = ; -@@ -618,7 +618,7 @@ +@@ -619,7 +619,7 @@ resets = <&gcc GCC_USB1_BCR>; status = "disabled"; diff --git a/target/linux/ipq807x/patches-5.15/0015-v5.19-arm64-dts-qcom-ipq8074-add-dedicated-qcom-ipq8074-dw.patch b/target/linux/ipq807x/patches-5.15/0015-v5.19-arm64-dts-qcom-ipq8074-add-dedicated-qcom-ipq8074-dw.patch index 5ec722cf6c1..68173e81d2d 100644 --- a/target/linux/ipq807x/patches-5.15/0015-v5.19-arm64-dts-qcom-ipq8074-add-dedicated-qcom-ipq8074-dw.patch +++ b/target/linux/ipq807x/patches-5.15/0015-v5.19-arm64-dts-qcom-ipq8074-add-dedicated-qcom-ipq8074-dw.patch @@ -16,7 +16,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -553,7 +553,7 @@ +@@ -554,7 +554,7 @@ }; usb_0: usb@8af8800 { @@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman reg = <0x08af8800 0x400>; #address-cells = <1>; #size-cells = <1>; -@@ -593,7 +593,7 @@ +@@ -594,7 +594,7 @@ }; usb_1: usb@8cf8800 { diff --git a/target/linux/ipq807x/patches-5.15/0016-v5.19-arm64-dts-qcom-align-DWC3-USB-clocks-with-DT-schema.patch b/target/linux/ipq807x/patches-5.15/0016-v5.19-arm64-dts-qcom-align-DWC3-USB-clocks-with-DT-schema.patch index cc4c3482335..de7c3eaffcd 100644 --- a/target/linux/ipq807x/patches-5.15/0016-v5.19-arm64-dts-qcom-align-DWC3-USB-clocks-with-DT-schema.patch +++ b/target/linux/ipq807x/patches-5.15/0016-v5.19-arm64-dts-qcom-align-DWC3-USB-clocks-with-DT-schema.patch @@ -15,7 +15,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -563,8 +563,8 @@ +@@ -564,8 +564,8 @@ <&gcc GCC_USB0_MASTER_CLK>, <&gcc GCC_USB0_SLEEP_CLK>, <&gcc GCC_USB0_MOCK_UTMI_CLK>; @@ -26,7 +26,7 @@ Signed-off-by: Greg Kroah-Hartman "sleep", "mock_utmi"; -@@ -603,8 +603,8 @@ +@@ -604,8 +604,8 @@ <&gcc GCC_USB1_MASTER_CLK>, <&gcc GCC_USB1_SLEEP_CLK>, <&gcc GCC_USB1_MOCK_UTMI_CLK>; diff --git a/target/linux/ipq807x/patches-5.15/0018-v6.0-arm64-dts-qcom-Fix-sdhci-node-names-use-mmc.patch b/target/linux/ipq807x/patches-5.15/0018-v6.0-arm64-dts-qcom-Fix-sdhci-node-names-use-mmc.patch index 529f6715f2c..20f7dc926d9 100644 --- a/target/linux/ipq807x/patches-5.15/0018-v6.0-arm64-dts-qcom-Fix-sdhci-node-names-use-mmc.patch +++ b/target/linux/ipq807x/patches-5.15/0018-v6.0-arm64-dts-qcom-Fix-sdhci-node-names-use-mmc.patch @@ -23,7 +23,7 @@ Link: https://lore.kernel.org/r/20220514215424.1007718-2-bhupesh.sharma@linaro.o --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -375,7 +375,7 @@ +@@ -376,7 +376,7 @@ cell-index = <0>; }; diff --git a/target/linux/ipq807x/patches-5.15/0019-v6.0-arm64-dts-qcom-Fix-ordering-of-clocks-clock-names-fo.patch b/target/linux/ipq807x/patches-5.15/0019-v6.0-arm64-dts-qcom-Fix-ordering-of-clocks-clock-names-fo.patch index 0fe6b3ab479..24fd7fc9f79 100644 --- a/target/linux/ipq807x/patches-5.15/0019-v6.0-arm64-dts-qcom-Fix-ordering-of-clocks-clock-names-fo.patch +++ b/target/linux/ipq807x/patches-5.15/0019-v6.0-arm64-dts-qcom-Fix-ordering-of-clocks-clock-names-fo.patch @@ -30,7 +30,7 @@ Link: https://lore.kernel.org/r/20220514215424.1007718-5-bhupesh.sharma@linaro.o --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -384,10 +384,10 @@ +@@ -385,10 +385,10 @@ ; interrupt-names = "hc_irq", "pwr_irq"; diff --git a/target/linux/ipq807x/patches-5.15/0024-v6.0-arm64-dts-qcom-ipq8074-add-USB-power-domains.patch b/target/linux/ipq807x/patches-5.15/0024-v6.0-arm64-dts-qcom-ipq8074-add-USB-power-domains.patch index 99ff26577d4..d515ec90762 100644 --- a/target/linux/ipq807x/patches-5.15/0024-v6.0-arm64-dts-qcom-ipq8074-add-USB-power-domains.patch +++ b/target/linux/ipq807x/patches-5.15/0024-v6.0-arm64-dts-qcom-ipq8074-add-USB-power-domains.patch @@ -15,7 +15,7 @@ Link: https://lore.kernel.org/r/20220515210048.483898-11-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -347,6 +347,7 @@ +@@ -348,6 +348,7 @@ compatible = "qcom,gcc-ipq8074"; reg = <0x01800000 0x80000>; #clock-cells = <0x1>; @@ -23,7 +23,7 @@ Link: https://lore.kernel.org/r/20220515210048.483898-11-robimarko@gmail.com #reset-cells = <0x1>; }; -@@ -575,6 +576,8 @@ +@@ -576,6 +577,8 @@ <133330000>, <19200000>; @@ -32,7 +32,7 @@ Link: https://lore.kernel.org/r/20220515210048.483898-11-robimarko@gmail.com resets = <&gcc GCC_USB0_BCR>; status = "disabled"; -@@ -615,6 +618,8 @@ +@@ -616,6 +619,8 @@ <133330000>, <19200000>; diff --git a/target/linux/ipq807x/patches-5.15/0025-v6.0-arm64-dts-qcom-ipq8074-move-ARMv8-timer-out-of-SoC-n.patch b/target/linux/ipq807x/patches-5.15/0025-v6.0-arm64-dts-qcom-ipq8074-move-ARMv8-timer-out-of-SoC-n.patch index 8f3dd35991a..6d86122bd0b 100644 --- a/target/linux/ipq807x/patches-5.15/0025-v6.0-arm64-dts-qcom-ipq8074-move-ARMv8-timer-out-of-SoC-n.patch +++ b/target/linux/ipq807x/patches-5.15/0025-v6.0-arm64-dts-qcom-ipq8074-move-ARMv8-timer-out-of-SoC-n.patch @@ -20,7 +20,7 @@ Link: https://lore.kernel.org/r/20220704113318.623102-1-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -653,14 +653,6 @@ +@@ -654,14 +654,6 @@ }; }; @@ -35,7 +35,7 @@ Link: https://lore.kernel.org/r/20220704113318.623102-1-robimarko@gmail.com watchdog: watchdog@b017000 { compatible = "qcom,kpss-wdt"; reg = <0xb017000 0x1000>; -@@ -852,4 +844,12 @@ +@@ -857,4 +849,12 @@ status = "disabled"; }; }; diff --git a/target/linux/ipq807x/patches-5.15/0026-v6.0-arm64-dts-qcom-ipq8074-add-reset-to-SDHCI.patch b/target/linux/ipq807x/patches-5.15/0026-v6.0-arm64-dts-qcom-ipq8074-add-reset-to-SDHCI.patch index b1a3010bf80..b262a804b37 100644 --- a/target/linux/ipq807x/patches-5.15/0026-v6.0-arm64-dts-qcom-ipq8074-add-reset-to-SDHCI.patch +++ b/target/linux/ipq807x/patches-5.15/0026-v6.0-arm64-dts-qcom-ipq8074-add-reset-to-SDHCI.patch @@ -17,7 +17,7 @@ Link: https://lore.kernel.org/r/20220704143554.1180927-2-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -389,6 +389,7 @@ +@@ -390,6 +390,7 @@ <&gcc GCC_SDCC1_APPS_CLK>, <&xo>; clock-names = "iface", "core", "xo"; diff --git a/target/linux/ipq807x/patches-5.15/0027-v6.0-arm64-dts-qcom-ipq8074-drop-USB-PHY-clock-index.patch b/target/linux/ipq807x/patches-5.15/0027-v6.0-arm64-dts-qcom-ipq8074-drop-USB-PHY-clock-index.patch index f69159a8494..c058c5abe4e 100644 --- a/target/linux/ipq807x/patches-5.15/0027-v6.0-arm64-dts-qcom-ipq8074-drop-USB-PHY-clock-index.patch +++ b/target/linux/ipq807x/patches-5.15/0027-v6.0-arm64-dts-qcom-ipq8074-drop-USB-PHY-clock-index.patch @@ -24,7 +24,7 @@ Link: https://lore.kernel.org/r/20220705114032.22787-5-johan+linaro@kernel.org + #clock-cells = <0>; clocks = <&gcc GCC_USB1_PIPE_CLK>; clock-names = "pipe0"; - clock-output-names = "gcc_usb1_pipe_clk_src"; + clock-output-names = "usb3phy_1_cc_pipe_clk"; @@ -173,7 +173,7 @@ <0x00078800 0x1f8>, /* PCS */ <0x00078600 0x044>; /* PCS misc*/ @@ -33,4 +33,4 @@ Link: https://lore.kernel.org/r/20220705114032.22787-5-johan+linaro@kernel.org + #clock-cells = <0>; clocks = <&gcc GCC_USB0_PIPE_CLK>; clock-names = "pipe0"; - clock-output-names = "gcc_usb0_pipe_clk_src"; + clock-output-names = "usb3phy_0_cc_pipe_clk"; diff --git a/target/linux/ipq807x/patches-5.15/0030-v6.0-arm64-dts-qcom-ipq8074-add-APCS-node.patch b/target/linux/ipq807x/patches-5.15/0030-v6.0-arm64-dts-qcom-ipq8074-add-APCS-node.patch index 92414d43191..87a1fe82e73 100644 --- a/target/linux/ipq807x/patches-5.15/0030-v6.0-arm64-dts-qcom-ipq8074-add-APCS-node.patch +++ b/target/linux/ipq807x/patches-5.15/0030-v6.0-arm64-dts-qcom-ipq8074-add-APCS-node.patch @@ -20,7 +20,7 @@ Link: https://lore.kernel.org/r/20220707173733.404947-4-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -662,6 +662,14 @@ +@@ -663,6 +663,14 @@ timeout-sec = <30>; }; diff --git a/target/linux/ipq807x/patches-5.15/0033-v6.1-arm64-dts-qcom-align-SDHCI-reg-names-with-DT-schema.patch b/target/linux/ipq807x/patches-5.15/0033-v6.1-arm64-dts-qcom-align-SDHCI-reg-names-with-DT-schema.patch index 566c26399e9..f2fce43e5e0 100644 --- a/target/linux/ipq807x/patches-5.15/0033-v6.1-arm64-dts-qcom-align-SDHCI-reg-names-with-DT-schema.patch +++ b/target/linux/ipq807x/patches-5.15/0033-v6.1-arm64-dts-qcom-align-SDHCI-reg-names-with-DT-schema.patch @@ -17,7 +17,7 @@ Link: https://lore.kernel.org/r/20220712144245.17417-4-krzysztof.kozlowski@linar --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -383,7 +383,7 @@ +@@ -384,7 +384,7 @@ sdhc_1: mmc@7824900 { compatible = "qcom,sdhci-msm-v4"; reg = <0x7824900 0x500>, <0x7824000 0x800>; diff --git a/target/linux/ipq807x/patches-5.15/0034-v6.1-arm64-dts-qcom-ipq8074-fix-PCIe-PHY-serdes-size.patch b/target/linux/ipq807x/patches-5.15/0034-v6.1-arm64-dts-qcom-ipq8074-fix-PCIe-PHY-serdes-size.patch deleted file mode 100644 index c2a9e029273..00000000000 --- a/target/linux/ipq807x/patches-5.15/0034-v6.1-arm64-dts-qcom-ipq8074-fix-PCIe-PHY-serdes-size.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 8f63346a74c8b3e37ffab2c7a2ddb3c08793dcc2 Mon Sep 17 00:00:00 2001 -From: Johan Hovold -Date: Thu, 15 Sep 2022 16:34:30 +0200 -Subject: [PATCH] arm64: dts: qcom: ipq8074: fix PCIe PHY serdes size - -The size of the PCIe PHY serdes register region is 0x1c4 and the -corresponding 'reg' property should specifically not include the -adjacent regions that are defined in the child node (e.g. tx and rx). - -Fixes: 33057e1672fe ("ARM: dts: ipq8074: Add pcie nodes") -Signed-off-by: Johan Hovold -Signed-off-by: Bjorn Andersson -Link: https://lore.kernel.org/r/20220915143431.19842-1-johan+linaro@kernel.org ---- - arch/arm64/boot/dts/qcom/ipq8074.dtsi | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -199,7 +199,7 @@ - - pcie_qmp0: phy@86000 { - compatible = "qcom,ipq8074-qmp-pcie-phy"; -- reg = <0x00086000 0x1000>; -+ reg = <0x00086000 0x1c4>; - #address-cells = <1>; - #size-cells = <1>; - ranges; -@@ -227,7 +227,7 @@ - - pcie_qmp1: phy@8e000 { - compatible = "qcom,ipq8074-qmp-pcie-phy"; -- reg = <0x0008e000 0x1000>; -+ reg = <0x0008e000 0x1c4>; - #address-cells = <1>; - #size-cells = <1>; - ranges; diff --git a/target/linux/ipq807x/patches-5.15/0040-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch b/target/linux/ipq807x/patches-5.15/0040-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch index ab9bd5f5892..dd57eae360b 100644 --- a/target/linux/ipq807x/patches-5.15/0040-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch +++ b/target/linux/ipq807x/patches-5.15/0040-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch @@ -15,7 +15,7 @@ Link: https://lore.kernel.org/r/20220818220628.339366-9-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -674,6 +674,14 @@ +@@ -675,6 +675,14 @@ #mbox-cells = <1>; }; diff --git a/target/linux/ipq807x/patches-5.15/0041-v6.1-arm64-dts-qcom-ipq8074-correct-APCS-register-space-s.patch b/target/linux/ipq807x/patches-5.15/0041-v6.1-arm64-dts-qcom-ipq8074-correct-APCS-register-space-s.patch index f06e456a2cf..5c8ca8c5477 100644 --- a/target/linux/ipq807x/patches-5.15/0041-v6.1-arm64-dts-qcom-ipq8074-correct-APCS-register-space-s.patch +++ b/target/linux/ipq807x/patches-5.15/0041-v6.1-arm64-dts-qcom-ipq8074-correct-APCS-register-space-s.patch @@ -21,7 +21,7 @@ Link: https://lore.kernel.org/r/20220818220628.339366-8-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -668,7 +668,7 @@ +@@ -669,7 +669,7 @@ apcs_glb: mailbox@b111000 { compatible = "qcom,ipq8074-apcs-apps-global"; diff --git a/target/linux/ipq807x/patches-5.15/0042-v6.2-thermal-drivers-tsens-Add-support-for-combined-inter.patch b/target/linux/ipq807x/patches-5.15/0042-v6.2-thermal-drivers-tsens-Add-support-for-combined-inter.patch index 63b4cf176bc..2c6e70b14d4 100644 --- a/target/linux/ipq807x/patches-5.15/0042-v6.2-thermal-drivers-tsens-Add-support-for-combined-inter.patch +++ b/target/linux/ipq807x/patches-5.15/0042-v6.2-thermal-drivers-tsens-Add-support-for-combined-inter.patch @@ -31,7 +31,7 @@ Signed-off-by: Daniel Lezcano .max_sensors = 11, --- a/drivers/thermal/qcom/tsens-v0_1.c +++ b/drivers/thermal/qcom/tsens-v0_1.c -@@ -539,6 +539,7 @@ static int calibrate_9607(struct tsens_p +@@ -549,6 +549,7 @@ static int __init init_8939(struct tsens static struct tsens_features tsens_v0_1_feat = { .ver_major = VER_0_1, .crit_int = 0, @@ -41,7 +41,7 @@ Signed-off-by: Daniel Lezcano .max_sensors = 11, --- a/drivers/thermal/qcom/tsens-v1.c +++ b/drivers/thermal/qcom/tsens-v1.c -@@ -302,6 +302,7 @@ static int calibrate_8976(struct tsens_p +@@ -273,6 +273,7 @@ static int calibrate_8976(struct tsens_p static struct tsens_features tsens_v1_feat = { .ver_major = VER_1_X, .crit_int = 0, @@ -89,7 +89,7 @@ Signed-off-by: Daniel Lezcano static int tsens_set_trips(void *_sensor, int low, int high) { struct tsens_sensor *s = _sensor; -@@ -1075,13 +1096,18 @@ static int tsens_register(struct tsens_p +@@ -1081,13 +1102,18 @@ static int tsens_register(struct tsens_p tsens_mC_to_hw(priv->sensor, 0)); } diff --git a/target/linux/ipq807x/patches-5.15/0043-v6.2-thermal-drivers-tsens-Allow-configuring-min-and-max-.patch b/target/linux/ipq807x/patches-5.15/0043-v6.2-thermal-drivers-tsens-Allow-configuring-min-and-max-.patch index 7354d544649..5a571a36b62 100644 --- a/target/linux/ipq807x/patches-5.15/0043-v6.2-thermal-drivers-tsens-Allow-configuring-min-and-max-.patch +++ b/target/linux/ipq807x/patches-5.15/0043-v6.2-thermal-drivers-tsens-Allow-configuring-min-and-max-.patch @@ -35,7 +35,7 @@ Signed-off-by: Daniel Lezcano struct tsens_plat_data data_8960 = { --- a/drivers/thermal/qcom/tsens-v0_1.c +++ b/drivers/thermal/qcom/tsens-v0_1.c -@@ -543,6 +543,8 @@ static struct tsens_features tsens_v0_1_ +@@ -553,6 +553,8 @@ static struct tsens_features tsens_v0_1_ .adc = 1, .srot_split = 1, .max_sensors = 11, @@ -46,7 +46,7 @@ Signed-off-by: Daniel Lezcano static const struct reg_field tsens_v0_1_regfields[MAX_REGFIELDS] = { --- a/drivers/thermal/qcom/tsens-v1.c +++ b/drivers/thermal/qcom/tsens-v1.c -@@ -306,6 +306,8 @@ static struct tsens_features tsens_v1_fe +@@ -277,6 +277,8 @@ static struct tsens_features tsens_v1_fe .adc = 1, .srot_split = 1, .max_sensors = 11, diff --git a/target/linux/ipq807x/patches-5.15/0044-v6.2-thermal-drivers-tsens-Add-IPQ8074-support.patch b/target/linux/ipq807x/patches-5.15/0044-v6.2-thermal-drivers-tsens-Add-IPQ8074-support.patch index 89e21c01945..3e3e77a0a89 100644 --- a/target/linux/ipq807x/patches-5.15/0044-v6.2-thermal-drivers-tsens-Add-IPQ8074-support.patch +++ b/target/linux/ipq807x/patches-5.15/0044-v6.2-thermal-drivers-tsens-Add-IPQ8074-support.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Lezcano --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -599,6 +599,6 @@ extern struct tsens_plat_data data_8916, - extern struct tsens_plat_data data_tsens_v1, data_8976; + extern struct tsens_plat_data data_tsens_v1, data_8976, data_8956; /* TSENS v2 targets */ -extern struct tsens_plat_data data_8996, data_tsens_v2; diff --git a/target/linux/ipq807x/patches-5.15/0045-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch b/target/linux/ipq807x/patches-5.15/0045-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch index c142acf63f6..b320c08032c 100644 --- a/target/linux/ipq807x/patches-5.15/0045-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch +++ b/target/linux/ipq807x/patches-5.15/0045-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch @@ -20,7 +20,7 @@ Link: https://lore.kernel.org/r/20220818220245.338396-5-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -273,6 +273,16 @@ +@@ -274,6 +274,16 @@ status = "disabled"; }; @@ -37,7 +37,7 @@ Link: https://lore.kernel.org/r/20220818220245.338396-5-robimarko@gmail.com cryptobam: dma-controller@704000 { compatible = "qcom,bam-v1.7.0"; reg = <0x00704000 0x20000>; -@@ -873,4 +883,90 @@ +@@ -878,4 +888,90 @@ , ; }; diff --git a/target/linux/ipq807x/patches-5.15/0046-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch b/target/linux/ipq807x/patches-5.15/0046-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch index ff992378a2b..e229851649c 100644 --- a/target/linux/ipq807x/patches-5.15/0046-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch +++ b/target/linux/ipq807x/patches-5.15/0046-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch @@ -18,7 +18,7 @@ Link: https://lore.kernel.org/r/20220818220849.339732-4-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -679,6 +679,8 @@ +@@ -680,6 +680,8 @@ apcs_glb: mailbox@b111000 { compatible = "qcom,ipq8074-apcs-apps-global"; reg = <0x0b111000 0x1000>; diff --git a/target/linux/ipq807x/patches-5.15/0053-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch b/target/linux/ipq807x/patches-5.15/0053-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch index 2594d26cfed..1f99de002bb 100644 --- a/target/linux/ipq807x/patches-5.15/0053-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch +++ b/target/linux/ipq807x/patches-5.15/0053-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch @@ -20,7 +20,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-3-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -360,9 +360,11 @@ +@@ -361,9 +361,11 @@ gcc: gcc@1800000 { compatible = "qcom,gcc-ipq8074"; reg = <0x01800000 0x80000>; diff --git a/target/linux/ipq807x/patches-5.15/0070-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch b/target/linux/ipq807x/patches-5.15/0070-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch index 81cd0358040..1ce11406828 100644 --- a/target/linux/ipq807x/patches-5.15/0070-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch +++ b/target/linux/ipq807x/patches-5.15/0070-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch @@ -17,7 +17,7 @@ Link: https://lore.kernel.org/r/20221108142357.67202-2-krzysztof.kozlowski@linar --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -317,35 +317,35 @@ +@@ -318,35 +318,35 @@ interrupt-controller; #interrupt-cells = <0x2>; diff --git a/target/linux/ipq807x/patches-5.15/0103-arm64-dts-qcom-ipq8074-fix-Gen2-PCIe-QMP-PHY.patch b/target/linux/ipq807x/patches-5.15/0103-arm64-dts-qcom-ipq8074-fix-Gen2-PCIe-QMP-PHY.patch deleted file mode 100644 index 6eb282c7aa1..00000000000 --- a/target/linux/ipq807x/patches-5.15/0103-arm64-dts-qcom-ipq8074-fix-Gen2-PCIe-QMP-PHY.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 075b3ca8a4223742abc6da2406afe206d97f3d52 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 16 Nov 2022 22:48:33 +0100 -Subject: [PATCH] arm64: dts: qcom: ipq8074: fix Gen2 PCIe QMP PHY - -Serdes register space sizes are incorrect, update them to match the -actual sizes from downstream QCA 5.4 kernel. - -Fixes: 942bcd33ed45 ("arm64: dts: qcom: Fix IPQ8074 PCIe PHY nodes") -Signed-off-by: Robert Marko ---- - arch/arm64/boot/dts/qcom/ipq8074.dtsi | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -277,9 +277,9 @@ - status = "disabled"; - - pcie_phy1: phy@8e200 { -- reg = <0x8e200 0x16c>, -+ reg = <0x8e200 0x130>, - <0x8e400 0x200>, -- <0x8e800 0x4f4>; -+ <0x8e800 0x1f8>; - #phy-cells = <0>; - #clock-cells = <0>; - clocks = <&gcc GCC_PCIE1_PIPE_CLK>; diff --git a/target/linux/ipq807x/patches-5.15/0104-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-QMP-PHY.patch b/target/linux/ipq807x/patches-5.15/0104-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-QMP-PHY.patch deleted file mode 100644 index a44757a2e33..00000000000 --- a/target/linux/ipq807x/patches-5.15/0104-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-QMP-PHY.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 6f49bc0ee169c90b5c26a1e3d27a4728142f0ddb Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 16 Nov 2022 22:48:34 +0100 -Subject: [PATCH] arm64: dts: qcom: ipq8074: fix Gen3 PCIe QMP PHY - -IPQ8074 comes in 2 silicon versions: -* v1 with 2x Gen2 PCIe ports and QMP PHY-s -* v2 with 1x Gen3 and 1x Gen2 PCIe ports and QMP PHY-s - -v2 is the final and production version that is actually supported by the -kernel, however it looks like PCIe related nodes were added for the v1 SoC. - -Now that we have Gen3 QMP PHY support, we can start fixing the PCIe support -by fixing the Gen3 QMP PHY node first. - -Change the compatible to the Gen3 QMP PHY, correct the register space start -and size, add the missing misc PCS register space. - -Fixes: 33057e1672fe ("ARM: dts: ipq8074: Add pcie nodes") -Signed-off-by: Robert Marko ---- - arch/arm64/boot/dts/qcom/ipq8074.dtsi | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - ---- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -232,9 +232,9 @@ - status = "disabled"; - }; - -- pcie_qmp0: phy@86000 { -- compatible = "qcom,ipq8074-qmp-pcie-phy"; -- reg = <0x00086000 0x1c4>; -+ pcie_qmp0: phy@84000 { -+ compatible = "qcom,ipq8074-qmp-gen3-pcie-phy"; -+ reg = <0x00084000 0x1bc>; - #address-cells = <1>; - #size-cells = <1>; - ranges; -@@ -248,10 +248,11 @@ - "common"; - status = "disabled"; - -- pcie_phy0: phy@86200 { -- reg = <0x86200 0x16c>, -- <0x86400 0x200>, -- <0x86800 0x4f4>; -+ pcie_phy0: phy@84200 { -+ reg = <0x84200 0x16c>, -+ <0x84400 0x200>, -+ <0x84800 0x1f0>, -+ <0x84c00 0xf4>; - #phy-cells = <0>; - #clock-cells = <0>; - clocks = <&gcc GCC_PCIE0_PIPE_CLK>; diff --git a/target/linux/ipq807x/patches-5.15/0105-arm64-dts-qcom-ipq8074-correct-Gen2-PCIe-ranges.patch b/target/linux/ipq807x/patches-5.15/0105-arm64-dts-qcom-ipq8074-correct-Gen2-PCIe-ranges.patch deleted file mode 100644 index 049109015de..00000000000 --- a/target/linux/ipq807x/patches-5.15/0105-arm64-dts-qcom-ipq8074-correct-Gen2-PCIe-ranges.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 52a48e8ed546339122983329410be801a2b9adf5 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 16 Nov 2022 22:48:35 +0100 -Subject: [PATCH] arm64: dts: qcom: ipq8074: correct Gen2 PCIe ranges - -Current ranges property set in Gen2 PCIe node is incorrect, replace it -with the downstream 5.4 QCA kernel value. - -Fixes: 33057e1672fe ("ARM: dts: ipq8074: Add pcie nodes") -Signed-off-by: Robert Marko ---- - arch/arm64/boot/dts/qcom/ipq8074.dtsi | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -808,9 +808,9 @@ - phy-names = "pciephy"; - - ranges = <0x81000000 0 0x10200000 0x10200000 -- 0 0x100000 /* downstream I/O */ -- 0x82000000 0 0x10300000 0x10300000 -- 0 0xd00000>; /* non-prefetchable memory */ -+ 0 0x10000>, /* downstream I/O */ -+ <0x82000000 0 0x10220000 0x10220000 -+ 0 0xfde0000>; /* non-prefetchable memory */ - - interrupts = ; - interrupt-names = "msi"; diff --git a/target/linux/ipq807x/patches-5.15/0108-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-node.patch b/target/linux/ipq807x/patches-5.15/0108-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-node.patch deleted file mode 100644 index fc4db15ea2e..00000000000 --- a/target/linux/ipq807x/patches-5.15/0108-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-node.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 625c90a8266e432ea15e109123ca941062b63f76 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 16 Nov 2022 22:48:40 +0100 -Subject: [PATCH] arm64: dts: qcom: ipq8074: fix Gen3 PCIe node - -IPQ8074 comes in 2 silicon versions: -* v1 with 2x Gen2 PCIe ports and QMP PHY-s -* v2 with 1x Gen3 and 1x Gen2 PCIe ports and QMP PHY-s - -v2 is the final and production version that is actually supported by the -kernel, however it looks like PCIe related nodes were added for the v1 SoC. - -Finish the PCIe fixup by using the correct compatible, adding missing ATU -register space, declaring max-link-speed, use correct ranges, add missing -clocks and resets. - -Fixes: 33057e1672fe ("ARM: dts: ipq8074: Add pcie nodes") -Signed-off-by: Robert Marko ---- - arch/arm64/boot/dts/qcom/ipq8074.dtsi | 30 +++++++++++++++------------ - 1 file changed, 17 insertions(+), 13 deletions(-) - ---- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -854,16 +854,18 @@ - }; - - pcie0: pci@20000000 { -- compatible = "qcom,pcie-ipq8074"; -+ compatible = "qcom,pcie-ipq8074-gen3"; - reg = <0x20000000 0xf1d>, - <0x20000f20 0xa8>, -- <0x00080000 0x2000>, -+ <0x20001000 0x1000>, -+ <0x00080000 0x4000>, - <0x20100000 0x1000>; -- reg-names = "dbi", "elbi", "parf", "config"; -+ reg-names = "dbi", "elbi", "atu", "parf", "config"; - device_type = "pci"; - linux,pci-domain = <0>; - bus-range = <0x00 0xff>; - num-lanes = <1>; -+ max-link-speed = <3>; - #address-cells = <3>; - #size-cells = <2>; - -@@ -871,9 +873,9 @@ - phy-names = "pciephy"; - - ranges = <0x81000000 0 0x20200000 0x20200000 -- 0 0x100000 /* downstream I/O */ -- 0x82000000 0 0x20300000 0x20300000 -- 0 0xd00000>; /* non-prefetchable memory */ -+ 0 0x10000>, /* downstream I/O */ -+ <0x82000000 0 0x20220000 0x20220000 -+ 0 0xfde0000>; /* non-prefetchable memory */ - - interrupts = ; - interrupt-names = "msi"; -@@ -891,28 +893,30 @@ - clocks = <&gcc GCC_SYS_NOC_PCIE0_AXI_CLK>, - <&gcc GCC_PCIE0_AXI_M_CLK>, - <&gcc GCC_PCIE0_AXI_S_CLK>, -- <&gcc GCC_PCIE0_AHB_CLK>, -- <&gcc GCC_PCIE0_AUX_CLK>; -- -+ <&gcc GCC_PCIE0_AXI_S_BRIDGE_CLK>, -+ <&gcc GCC_PCIE0_RCHNG_CLK>; - clock-names = "iface", - "axi_m", - "axi_s", -- "ahb", -- "aux"; -+ "axi_bridge", -+ "rchng"; -+ - resets = <&gcc GCC_PCIE0_PIPE_ARES>, - <&gcc GCC_PCIE0_SLEEP_ARES>, - <&gcc GCC_PCIE0_CORE_STICKY_ARES>, - <&gcc GCC_PCIE0_AXI_MASTER_ARES>, - <&gcc GCC_PCIE0_AXI_SLAVE_ARES>, - <&gcc GCC_PCIE0_AHB_ARES>, -- <&gcc GCC_PCIE0_AXI_MASTER_STICKY_ARES>; -+ <&gcc GCC_PCIE0_AXI_MASTER_STICKY_ARES>, -+ <&gcc GCC_PCIE0_AXI_SLAVE_STICKY_ARES>; - reset-names = "pipe", - "sleep", - "sticky", - "axi_m", - "axi_s", - "ahb", -- "axi_m_sticky"; -+ "axi_m_sticky", -+ "axi_s_sticky"; - status = "disabled"; - }; - }; diff --git a/target/linux/ipq807x/patches-5.15/0109-arm64-dts-qcom-ipq8074-correct-PCIe-QMP-PHY-output-c.patch b/target/linux/ipq807x/patches-5.15/0109-arm64-dts-qcom-ipq8074-correct-PCIe-QMP-PHY-output-c.patch deleted file mode 100644 index 9bd4a6fa754..00000000000 --- a/target/linux/ipq807x/patches-5.15/0109-arm64-dts-qcom-ipq8074-correct-PCIe-QMP-PHY-output-c.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0311903940046649e20bd23bca837169eb4525dc Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 16 Nov 2022 22:48:41 +0100 -Subject: [PATCH] arm64: dts: qcom: ipq8074: correct PCIe QMP PHY output clock - names - -Current PCIe QMP PHY output name were changed in ("arm64: dts: qcom: Fix -IPQ8074 PCIe PHY nodes") however it did not account for the fact that GCC -driver is relying on the old names to match them as they are being used as -the parent for the gcc_pcie0_pipe_clk and gcc_pcie1_pipe_clk. - -This broke parenting as GCC could not find the parent clock, so fix it by -changing to the names that driver is expecting. - -Fixes: 942bcd33ed45 ("arm64: dts: qcom: Fix IPQ8074 PCIe PHY nodes") -Signed-off-by: Robert Marko ---- - arch/arm64/boot/dts/qcom/ipq8074.dtsi | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -257,7 +257,7 @@ - #clock-cells = <0>; - clocks = <&gcc GCC_PCIE0_PIPE_CLK>; - clock-names = "pipe0"; -- clock-output-names = "pcie_0_pipe_clk"; -+ clock-output-names = "pcie20_phy0_pipe_clk"; - }; - }; - -@@ -285,7 +285,7 @@ - #clock-cells = <0>; - clocks = <&gcc GCC_PCIE1_PIPE_CLK>; - clock-names = "pipe0"; -- clock-output-names = "pcie_1_pipe_clk"; -+ clock-output-names = "pcie20_phy1_pipe_clk"; - }; - }; - diff --git a/target/linux/ipq807x/patches-5.15/0132-arm64-dts-qcom-ipq8074-correct-USB3-QMP-PHY-s-clock-.patch b/target/linux/ipq807x/patches-5.15/0132-arm64-dts-qcom-ipq8074-correct-USB3-QMP-PHY-s-clock-.patch deleted file mode 100644 index 58dfba6e9c8..00000000000 --- a/target/linux/ipq807x/patches-5.15/0132-arm64-dts-qcom-ipq8074-correct-USB3-QMP-PHY-s-clock-.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 1bfcec16a591622b4993c043e6cc4d07f3690767 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Sun, 8 Jan 2023 13:39:55 +0100 -Subject: [PATCH] arm64: dts: qcom: ipq8074: correct USB3 QMP PHY-s clock - output names - -It seems that clock-output-names for the USB3 QMP PHY-s where set without -actually checking what is the GCC clock driver expecting, so clock core -could never actually find the parents for usb0_pipe_clk_src and -usb1_pipe_clk_src clocks in the GCC driver. - -So, correct the names to be what the driver expects so that parenting -works. - -Before: -gcc_usb0_pipe_clk_src 0 0 0 125000000 0 0 50000 Y -gcc_usb1_pipe_clk_src 0 0 0 125000000 0 0 50000 Y - -After: - usb3phy_0_cc_pipe_clk 1 1 0 125000000 0 0 50000 Y - usb0_pipe_clk_src 1 1 0 125000000 0 0 50000 Y - gcc_usb0_pipe_clk 1 1 0 125000000 0 0 50000 Y - usb3phy_1_cc_pipe_clk 1 1 0 125000000 0 0 50000 Y - usb1_pipe_clk_src 1 1 0 125000000 0 0 50000 Y - gcc_usb1_pipe_clk 1 1 0 125000000 0 0 50000 Y - -Fixes: 5e09bc51d07b ("arm64: dts: ipq8074: enable USB support") -Signed-off-by: Robert Marko ---- - arch/arm64/boot/dts/qcom/ipq8074.dtsi | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -263,7 +263,7 @@ - #clock-cells = <0>; - clocks = <&gcc GCC_USB1_PIPE_CLK>; - clock-names = "pipe0"; -- clock-output-names = "gcc_usb1_pipe_clk_src"; -+ clock-output-names = "usb3phy_1_cc_pipe_clk"; - }; - }; - -@@ -306,7 +306,7 @@ - #clock-cells = <0>; - clocks = <&gcc GCC_USB0_PIPE_CLK>; - clock-names = "pipe0"; -- clock-output-names = "gcc_usb0_pipe_clk_src"; -+ clock-output-names = "usb3phy_0_cc_pipe_clk"; - }; - }; - diff --git a/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch index 2276b38c6e8..ab88b108631 100644 --- a/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch +++ b/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch @@ -5479,7 +5479,7 @@ Signed-off-by: John Crispin (transaction layer end-to-end CRC checking). --- a/include/linux/pci.h +++ b/include/linux/pci.h -@@ -1480,6 +1480,8 @@ void pci_walk_bus(struct pci_bus *top, i +@@ -1481,6 +1481,8 @@ void pci_walk_bus(struct pci_bus *top, i void *userdata); int pci_cfg_space_size(struct pci_dev *dev); unsigned char pci_bus_max_busnr(struct pci_bus *bus); diff --git a/target/linux/layerscape/patches-5.15/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch b/target/linux/layerscape/patches-5.15/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch index 7f1e8ae332f..8ba7971e8a8 100644 --- a/target/linux/layerscape/patches-5.15/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch +++ b/target/linux/layerscape/patches-5.15/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch @@ -15,7 +15,7 @@ Signed-off-by: Kuldeep Singh --- a/drivers/mtd/spi-nor/spansion.c +++ b/drivers/mtd/spi-nor/spansion.c -@@ -227,7 +227,7 @@ static const struct flash_info spansion_ +@@ -232,7 +232,7 @@ static const struct flash_info spansion_ SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) }, { "s25fs512s", INFO6(0x010220, 0x4d0081, 256 * 1024, 256, diff --git a/target/linux/mediatek/patches-5.15/104-mt7622-add-snor-irq.patch b/target/linux/mediatek/patches-5.15/104-mt7622-add-snor-irq.patch index fa2cd96f971..79b051147a3 100644 --- a/target/linux/mediatek/patches-5.15/104-mt7622-add-snor-irq.patch +++ b/target/linux/mediatek/patches-5.15/104-mt7622-add-snor-irq.patch @@ -1,6 +1,6 @@ --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -558,6 +558,7 @@ +@@ -559,6 +559,7 @@ compatible = "mediatek,mt7622-nor", "mediatek,mt8173-nor"; reg = <0 0x11014000 0 0xe0>; diff --git a/target/linux/mediatek/patches-5.15/120-12-v5.19-spi-add-driver-for-MTK-SPI-NAND-Flash-Interface.patch b/target/linux/mediatek/patches-5.15/120-12-v5.19-spi-add-driver-for-MTK-SPI-NAND-Flash-Interface.patch index b77b4ad4c47..ed209050123 100644 --- a/target/linux/mediatek/patches-5.15/120-12-v5.19-spi-add-driver-for-MTK-SPI-NAND-Flash-Interface.patch +++ b/target/linux/mediatek/patches-5.15/120-12-v5.19-spi-add-driver-for-MTK-SPI-NAND-Flash-Interface.patch @@ -35,7 +35,7 @@ Changes since v5: --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -530,6 +530,16 @@ config SPI_MTK_NOR +@@ -529,6 +529,16 @@ config SPI_MTK_NOR SPI interface as well as several SPI NOR specific instructions via SPI MEM interface. diff --git a/target/linux/mediatek/patches-5.15/120-14-v5.19-arm64-dts-mediatek-add-mtk-snfi-for-mt7622.patch b/target/linux/mediatek/patches-5.15/120-14-v5.19-arm64-dts-mediatek-add-mtk-snfi-for-mt7622.patch index d5285676fec..15d26713723 100644 --- a/target/linux/mediatek/patches-5.15/120-14-v5.19-arm64-dts-mediatek-add-mtk-snfi-for-mt7622.patch +++ b/target/linux/mediatek/patches-5.15/120-14-v5.19-arm64-dts-mediatek-add-mtk-snfi-for-mt7622.patch @@ -14,7 +14,7 @@ Signed-off-by: Chuanhong Guo --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -552,6 +552,18 @@ +@@ -553,6 +553,18 @@ status = "disabled"; }; diff --git a/target/linux/mediatek/patches-5.15/192-v5.19-arm64-dts-mt7622-specify-the-number-of-DMA-requests.patch b/target/linux/mediatek/patches-5.15/192-v5.19-arm64-dts-mt7622-specify-the-number-of-DMA-requests.patch index 905d84d317b..4fef9aea22d 100644 --- a/target/linux/mediatek/patches-5.15/192-v5.19-arm64-dts-mt7622-specify-the-number-of-DMA-requests.patch +++ b/target/linux/mediatek/patches-5.15/192-v5.19-arm64-dts-mt7622-specify-the-number-of-DMA-requests.patch @@ -112,7 +112,7 @@ Signed-off-by: Rui Salvaterra --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -941,6 +941,7 @@ +@@ -942,6 +942,7 @@ clock-names = "hsdma"; power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>; #dma-cells = <1>; diff --git a/target/linux/mediatek/patches-5.15/600-v5.16-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-and-MT.patch b/target/linux/mediatek/patches-5.15/600-v5.16-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-and-MT.patch index cdcb8eefd02..6a84ff47db1 100644 --- a/target/linux/mediatek/patches-5.15/600-v5.16-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-and-MT.patch +++ b/target/linux/mediatek/patches-5.15/600-v5.16-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-and-MT.patch @@ -194,7 +194,7 @@ Signed-off-by: Matthias Brugger &pio { --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -808,75 +808,83 @@ +@@ -809,75 +809,83 @@ #reset-cells = <1>; }; diff --git a/target/linux/mediatek/patches-5.15/602-arm64-dts-mediatek-add-mt7622-pcie-slot-node.patch b/target/linux/mediatek/patches-5.15/602-arm64-dts-mediatek-add-mt7622-pcie-slot-node.patch index 0ecceecebef..bf479ab53b2 100644 --- a/target/linux/mediatek/patches-5.15/602-arm64-dts-mediatek-add-mt7622-pcie-slot-node.patch +++ b/target/linux/mediatek/patches-5.15/602-arm64-dts-mediatek-add-mt7622-pcie-slot-node.patch @@ -1,6 +1,6 @@ --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -848,6 +848,12 @@ +@@ -849,6 +849,12 @@ #address-cells = <0>; #interrupt-cells = <1>; }; @@ -13,7 +13,7 @@ }; pcie1: pcie@1a145000 { -@@ -886,6 +892,12 @@ +@@ -887,6 +893,12 @@ #address-cells = <0>; #interrupt-cells = <1>; }; diff --git a/target/linux/mediatek/patches-5.15/710-pci-pcie-mediatek-add-support-for-coherent-DMA.patch b/target/linux/mediatek/patches-5.15/710-pci-pcie-mediatek-add-support-for-coherent-DMA.patch index 4c4db9f0498..de64eda8277 100644 --- a/target/linux/mediatek/patches-5.15/710-pci-pcie-mediatek-add-support-for-coherent-DMA.patch +++ b/target/linux/mediatek/patches-5.15/710-pci-pcie-mediatek-add-support-for-coherent-DMA.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -836,6 +836,9 @@ +@@ -837,6 +837,9 @@ bus-range = <0x00 0xff>; ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x8000000>; status = "disabled"; @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 7>; -@@ -880,6 +883,9 @@ +@@ -881,6 +884,9 @@ bus-range = <0x00 0xff>; ranges = <0x82000000 0 0x28000000 0x0 0x28000000 0 0x8000000>; status = "disabled"; diff --git a/target/linux/mvebu/patches-5.15/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch b/target/linux/mvebu/patches-5.15/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch index c043a99c8b7..0e546b426ed 100644 --- a/target/linux/mvebu/patches-5.15/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch +++ b/target/linux/mvebu/patches-5.15/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch @@ -26,7 +26,7 @@ Cc: Robert Marko --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig -@@ -2188,6 +2188,15 @@ config SGI_MFD_IOC3 +@@ -2189,6 +2189,15 @@ config SGI_MFD_IOC3 If you have an SGI Origin, Octane, or a PCI IOC3 card, then say Y. Otherwise say N. diff --git a/target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch b/target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch index e3a008f4a65..5b0db92d9e4 100644 --- a/target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch +++ b/target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch @@ -22,7 +22,7 @@ Signed-off-by: Tim Harvey #include #include #include -@@ -5831,3 +5832,34 @@ static void nvidia_ion_ahci_fixup(struct +@@ -5854,3 +5855,34 @@ static void nvidia_ion_ahci_fixup(struct pdev->dev_flags |= PCI_DEV_FLAGS_HAS_MSI_MASKING; } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0ab8, nvidia_ion_ahci_fixup); diff --git a/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch index da3ca270fa4..163bafdb2e5 100644 --- a/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch +++ b/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch @@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -3098,6 +3098,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -3107,6 +3107,7 @@ int spi_nor_scan(struct spi_nor *nor, co struct device *dev = nor->dev; struct mtd_info *mtd = &nor->mtd; struct device_node *np = spi_nor_get_flash_node(nor); @@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma int ret; int i; -@@ -3152,7 +3153,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -3161,7 +3162,12 @@ int spi_nor_scan(struct spi_nor *nor, co if (ret) return ret; diff --git a/target/linux/ramips/patches-5.15/810-uvc-add-iPassion-iP2970-support.patch b/target/linux/ramips/patches-5.15/810-uvc-add-iPassion-iP2970-support.patch index ae7e886f949..2d56440610e 100644 --- a/target/linux/ramips/patches-5.15/810-uvc-add-iPassion-iP2970-support.patch +++ b/target/linux/ramips/patches-5.15/810-uvc-add-iPassion-iP2970-support.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c -@@ -3164,6 +3164,18 @@ static const struct usb_device_id uvc_id +@@ -3152,6 +3152,18 @@ static const struct usb_device_id uvc_id .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_INFO_META(V4L2_META_FMT_D4XX) }, @@ -34,7 +34,7 @@ Signed-off-by: John Crispin { USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_15) }, --- a/drivers/media/usb/uvc/uvc_status.c +++ b/drivers/media/usb/uvc/uvc_status.c -@@ -223,6 +223,7 @@ static void uvc_status_complete(struct u +@@ -224,6 +224,7 @@ static void uvc_status_complete(struct u if (uvc_event_control(urb, status, len)) /* The URB will be resubmitted in work context. */ return; @@ -42,7 +42,7 @@ Signed-off-by: John Crispin break; } -@@ -271,6 +272,7 @@ int uvc_status_init(struct uvc_device *d +@@ -272,6 +273,7 @@ int uvc_status_init(struct uvc_device *d } pipe = usb_rcvintpipe(dev->udev, ep->desc.bEndpointAddress); @@ -214,7 +214,7 @@ Signed-off-by: John Crispin /* Mark the buffer as done if the EOF marker is set. */ if (data[1] & UVC_STREAM_EOF && buf->bytesused != 0) { uvc_dbg(stream->dev, FRAME, "Frame complete (EOF found)\n"); -@@ -1799,6 +1944,8 @@ static int uvc_init_video_isoc(struct uv +@@ -1801,6 +1946,8 @@ static int uvc_init_video_isoc(struct uv if (npackets == 0) return -ENOMEM; @@ -225,18 +225,16 @@ Signed-off-by: John Crispin for_each_uvc_urb(uvc_urb, stream) { --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h -@@ -209,7 +209,9 @@ - #define UVC_QUIRK_RESTORE_CTRLS_ON_INIT 0x00000400 +@@ -210,6 +210,8 @@ #define UVC_QUIRK_FORCE_Y8 0x00000800 #define UVC_QUIRK_FORCE_BPP 0x00001000 -- -+#define UVC_QUIRK_MOTION 0x00001000 -+#define UVC_QUIRK_SINGLE_ISO 0x00002000 -+ + #define UVC_QUIRK_WAKE_AUTOSUSPEND 0x00002000 ++#define UVC_QUIRK_MOTION 0x00004000 ++#define UVC_QUIRK_SINGLE_ISO 0x00008000 + /* Format flags */ #define UVC_FMT_FLAG_COMPRESSED 0x00000001 - #define UVC_FMT_FLAG_STREAM 0x00000002 -@@ -700,6 +702,7 @@ struct uvc_device { +@@ -701,6 +703,7 @@ struct uvc_device { u8 *status; struct input_dev *input; char input_phys[64]; diff --git a/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch b/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch index 342350d0c6a..5fb05375394 100644 --- a/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch +++ b/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch @@ -16,7 +16,7 @@ Acked-by: John Crispin --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -719,6 +719,12 @@ config SPI_QCOM_GENI +@@ -718,6 +718,12 @@ config SPI_QCOM_GENI This driver can also be built as a module. If so, the module will be called spi-geni-qcom. From 87db7f3dffa6f18e6b1660d345e01babfcdcc067 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sun, 12 Mar 2023 11:07:58 -0400 Subject: [PATCH 20/44] kernel: bump 5.15 to 5.15.101 No patches rebased as a function of this bump. Build system: x86_64 Build-tested: ramips/tplink_archer-a6-v3 Run-tested: ramips/tplink_archer-a6-v3 Signed-off-by: John Audia --- include/kernel-5.15 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/kernel-5.15 b/include/kernel-5.15 index a05318146a9..503b3dc8334 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .100 -LINUX_KERNEL_HASH-5.15.100 = f7a4ce870fc1ad879b49887f7f77ee79babdb66937d5acdb1465d53b388c1427 +LINUX_VERSION-5.15 = .101 +LINUX_KERNEL_HASH-5.15.101 = b9392066b0ab671585a1a4cb74bd107264efa462395a56dc0817ccc0f1d0c02d From e467856cb34961f0688efcf5a4dc69cb0130675b Mon Sep 17 00:00:00 2001 From: John Audia Date: Mon, 13 Mar 2023 09:04:36 -0400 Subject: [PATCH 21/44] kernel: bump 5.15 to 5.15.102 No patches needed to be rebased. Signed-off-by: John Audia Tested-by: Robert Marko #ipq807x/Dynalink WRX36 Tested-by: Stefan Lippers-Hollmann #ipq807x/ax3600, x86_64/FW-7543B, ath79/tl-wdr3600, ipq806x/g10, ipq806x/nbg6817 --- include/kernel-5.15 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 503b3dc8334..c50a5eb61fa 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .101 -LINUX_KERNEL_HASH-5.15.101 = b9392066b0ab671585a1a4cb74bd107264efa462395a56dc0817ccc0f1d0c02d +LINUX_VERSION-5.15 = .102 +LINUX_KERNEL_HASH-5.15.102 = 441cddfb970b97759eebdb9b142673662ce0770500e3ae8bcd4b90af369b01e6 From 66c4c2f02362d127fda7cb587a661f6ee7aea0d2 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 18 Mar 2023 11:08:26 +0100 Subject: [PATCH 22/44] ipq40xx: mf18a: Add missing variant to PCI ath10k card Add missing variant to PCI ath10k card to allign to BDF changes for ZTE MF18A. Signed-off-by: Christian Marangi --- .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts index 75b5fd39a9e..23d0b910251 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts @@ -474,6 +474,7 @@ nvmem-cell-names = "pre-calibration", "mac-address"; nvmem-cells = <&precal_art_9000>, <&macaddr_config_0>; mac-address-increment = <3>; + qcom,ath10k-calibration-variant = "ZTE-MF18A"; reg = <0x00010000 0 0 0 0>; }; }; From 13fefc54fc05a67212cc5f545b91937a96fcad06 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 18 Mar 2023 11:42:27 +0100 Subject: [PATCH 23/44] ipq40xx: rutx10: Add missing variant to ath10k wifi Add missing variant to ath10k wifi to allign to BDF changes for Teltonika RUTX10. Signed-off-by: Christian Marangi --- .../files/arch/arm/boot/dts/qcom-ipq4018-rutx10.dts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx10.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx10.dts index d1d632568c6..31d14aa6ae1 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx10.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx10.dts @@ -24,3 +24,13 @@ }; }; }; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "Teltonika-RUTX10"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "Teltonika-RUTX10"; +}; From 880b4811c2d31569434de19f30a584cfd2c7dec8 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 18 Mar 2023 12:01:04 +0100 Subject: [PATCH 24/44] ipq-wifi: bump to latest git HEAD 1f35a8c ath10k-firmware: IPQ4019 hw1.0: Add variant to Teltonika RUTX10 specific BDF a49672f ath10k-firmware: QCA99X0 hw2.0: Add variant to ZTE MF18A specific BDF Signed-off-by: Christian Marangi --- package/firmware/ipq-wifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 8e5ef549669..03897591038 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2023-03-16 -PKG_SOURCE_VERSION:=2dae61830c42ebdcc29a13048b81a0485d7b5b95 -PKG_MIRROR_HASH:=1c9b3fa2044de952e336a49b2864784b6e9cf3729fb05198f47ac4a71df13320 +PKG_SOURCE_DATE:=2023-03-18 +PKG_SOURCE_VERSION:=1f35a8c965097119d2a0433fa37d2ff18cfea31e +PKG_MIRROR_HASH:=b6ace2c4136f1a04340321cdd460427e94cc417074f6de95c6f354409af258a6 PKG_FLAGS:=nonshared From 2e72ee1b2313ddbadd35e77e6ae6d3361c176930 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 18 Mar 2023 12:46:33 +0100 Subject: [PATCH 25/44] ipq-wifi: bump to latest git HEAD 86180c4 ath10k-firmware: IPQ4019 hw1.0: Rename variant to ZTE MF18A specific BDF Signed-off-by: Christian Marangi --- package/firmware/ipq-wifi/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 03897591038..992ecba839a 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -7,8 +7,8 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git PKG_SOURCE_DATE:=2023-03-18 -PKG_SOURCE_VERSION:=1f35a8c965097119d2a0433fa37d2ff18cfea31e -PKG_MIRROR_HASH:=b6ace2c4136f1a04340321cdd460427e94cc417074f6de95c6f354409af258a6 +PKG_SOURCE_VERSION:=86180c4c07330e303edf0afd6c017932903ee080 +PKG_MIRROR_HASH:=283d6651f8a9088981065d476c01c7c0794279e108a96377468d5fcdc3882a12 PKG_FLAGS:=nonshared From 4bfbecbd9a1829c8d04287ca4e085e1f0812aed1 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 18 Mar 2023 12:47:48 +0100 Subject: [PATCH 26/44] ipq40xx: mf18a: rename wifi0 calibration variant to ZTE-MF18A Rename wifi0 calibration variant to ZTE-MF18A to allign to BDF changes for ZTE MF18A. Signed-off-by: Christian Marangi --- .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts index 23d0b910251..80d71ac0cc8 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts @@ -453,7 +453,7 @@ nvmem-cell-names = "pre-calibration", "mac-address"; nvmem-cells = <&precal_art_1000>, <&macaddr_config_0>; mac-address-increment = <2>; - qcom,ath10k-calibration-variant = "zte,mf18a"; + qcom,ath10k-calibration-variant = "ZTE-MF18A"; }; //* This node is used for 5Ghz on QCA9982 */ From 8d975708fc1a0e426f4f87aac36cf54be5c5dd81 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Fri, 10 Mar 2023 18:48:51 +0100 Subject: [PATCH 27/44] libnftnl: update to 1.2.5 Upstream switched to "tar.xz". Release Notes: https://www.spinics.net/lists/netfilter/msg61016.html Signed-off-by: Nick Hainke --- package/libs/libnftnl/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/libnftnl/Makefile b/package/libs/libnftnl/Makefile index 50ad11a2cff..f92fb91eea1 100644 --- a/package/libs/libnftnl/Makefile +++ b/package/libs/libnftnl/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnftnl PKG_CPE_ID:=cpe:/a:netfilter:libnftnl -PKG_VERSION:=1.2.4 +PKG_VERSION:=1.2.5 PKG_RELEASE:=$(AUTORELEASE) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files -PKG_HASH:=c0fe233be4cdfd703e7d5977ef8eb63fcbf1d0052b6044e1b23d47ca3562477f +PKG_HASH:=966de0a8120c8a53db859889749368bfb2cba0c4f0b4c1a30d264eccc45f1226 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0-or-later From ab514c28a8ca3a07a3b9c85965f8ac60bb63ea0f Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Mon, 13 Mar 2023 23:24:24 +0100 Subject: [PATCH 28/44] nftables: update to 1.0.7 Release Notes: https://marc.info/?l=netfilter-devel&m=167873533214563&w=2 Signed-off-by: Nick Hainke --- package/network/utils/nftables/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index 2010aaf65c7..9a180a09539 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables -PKG_VERSION:=1.0.6 +PKG_VERSION:=1.0.7 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files -PKG_HASH:=2407430ddd82987670e48dc2fda9e280baa8307abec04ab18d609df3db005e4c +PKG_HASH:=c12ac941fff9adaedf17367d5ce213789b98a0d314277bc22b3d71e10891f412 PKG_MAINTAINER:= PKG_LICENSE:=GPL-2.0 From a32def781f5a840697e503f1da29de455a875bbc Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Sun, 12 Mar 2023 10:59:21 +0100 Subject: [PATCH 29/44] lantiq: xway: add phy reset pin to AVM Fritz!Box 7320 This commit adds the PHY reset gpio for the LAN1 port to the dts. According to the GPL sources, gpios 34 and 36 are used on the AVM FritzBox 7320 and 7330. The second port is unsupported. The gpio assignment has been verified on the FritzBox 7330. Signed-off-by: Aleksander Jan Bajkowski --- .../mips/boot/dts/lantiq/ar9_avm_fritz7320.dts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts index 44b8a18dae9..cd7b29ca6d1 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts @@ -98,9 +98,20 @@ &gsw { phy-mode = "mii"; + phy-handle = <&phy0>; nvmem-cells = <&macaddr_ath9k_cal_a91>; nvmem-cell-names = "mac-address"; mac-address-increment = <(-2)>; + + mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + reset-gpios = <&gpio 36 GPIO_ACTIVE_LOW>; + }; + }; }; &gpio { @@ -108,6 +119,12 @@ pinctrl-0 = <&state_default>; state_default: pinmux { + phy-rst { + lantiq,pins = "io36"; + lantiq,pull = <0>; + lantiq,open-drain; + lantiq,output = <1>; + }; usb0_vbus { lantiq,pins = "io50"; lantiq,pull = <0>; From f574b535ebee1a94bed87746af68c1b60b53a663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristjan=20Kru=C5=A1i=C4=8D?= Date: Sat, 4 Feb 2023 17:00:57 +0100 Subject: [PATCH 30/44] ipq806x: add support for Nokia Airscale AC400i MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hardware -------- SoC: Qualcomm IPQ8065 RAM: 512 MB DDR3 Flash: 256 MB NAND (Macronix MX30UF2G18AC) (split into 2x128MB) 4 MB SPI-NOR (Macronix MX25U3235F) WLAN: Qualcomm Atheros QCA9984 - 2.4Ghz Qualcomm Atheros QCA9984 - 5Ghz ETH: eth0 - POE (100Mbps in U-Boot, 1000Mbps in OpenWrt) eth1 - (1000Mbps in both) Auto-negotiation broken on both. USB: USB 2.0 LED: 5G, 2.4G, ETH1, ETH2, CTRL, PWR (All support green and red) BTN: Reset Other: SD card slot (non-functional) Serial: 115200bps, near the Ethernet transformers, labeled 9X. Connections from the arrow to the 9X text: [NC] - [TXD] - [GND] - [RXD] - [NC] Installation ------------ 0. Connect to the device Plug your computer into LAN2 (1000Mbps connection required). If you use the LAN1/POE port, set your computer to force a 100Mbps link. Connect to the device via TTL (Serial) 115200n8. Locate the header (or solder pads) labeled 9X, near the Ethernet jacks/transformers. There should be an arrow on the other side of the header marking. The connections should go like this: (from the arrow to the 9X text): NC - TXD - GND - RXD - NC 1. Prepare for installation While the AP is powering up, interrupt the startup process. MAKE SURE TO CHECK YOUR CURRENT PARTITION! If you see: "Current Partition is : partB" or "Need to switch partition from partA to partB", you have to force the device into partA mode, before continuing. This can be done by changing the PKRstCnt to 5 and resetting the device. setenv PKRstCnt 5 saveenv reset After you interrupt the startup process again, you should see: Need to switch partition from partB to partA You can now continue to the next step. If you see: "Current Partition is : partA", you can continue to the next step. 2. Prevent partition switching. To prevent the device from switching partitions, we are going to modify the startup command. set bootcmd "setenv PKRstCnt 0; saveenv; bootipq" setenv 3. First boot Now, we have to boot the OpenWrt intifs. The easiest way to do this is by using Tiny PXE. You can also use the normal U-Boot tftp method. Run "bootp" this will get an IP from the DHCP server and possibly the firmware image. If it doesn't download the firmware image, run "tftpboot". Now run "bootm" to run the image. You might see: "ERROR: new format image overwritten - must RESET the board to recover" this means that the image you are trying to load is too big. Use a smaller image for the initial boot. 4. Install OpenWrt from initfs Once you are booted into OpenWrt, transfer the OpenWrt upgrade image and use sysupgrade to install OpenWrt to the device. Signed-off-by: Kristjan Krušič --- package/boot/uboot-envtools/files/ipq806x | 3 + package/firmware/ipq-wifi/Makefile | 2 + .../ipq806x/base-files/etc/board.d/01_leds | 8 + .../ipq806x/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 8 + .../base-files/lib/upgrade/platform.sh | 1 + .../arch/arm/boot/dts/qcom-ipq8065-ac400i.dts | 318 ++++++++++++++++++ target/linux/ipq806x/image/generic.mk | 14 + 8 files changed, 355 insertions(+) create mode 100644 target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8065-ac400i.dts diff --git a/package/boot/uboot-envtools/files/ipq806x b/package/boot/uboot-envtools/files/ipq806x index 77dfefbcd81..01a86c7b19f 100644 --- a/package/boot/uboot-envtools/files/ipq806x +++ b/package/boot/uboot-envtools/files/ipq806x @@ -45,6 +45,9 @@ linksys,ea8500) netgear,r7800) ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x040000" "0x20000" ;; +nokia,ac400i) + ubootenv_add_uci_config "/dev/mtd20" "0x0" "0x040000" "0x20000" + ;; qcom,ipq8064-ap148|\ qcom,ipq8064-db149) ubootenv_add_uci_config $(ubootenv_mtdinfo) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 992ecba839a..b3fbc36d33d 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -44,6 +44,7 @@ ALLWIFIBOARDS:= \ glinet_gl-s1300 \ linksys_ea8300 \ linksys_whw03v2 \ + nokia_ac400i \ p2w_r619ac \ pakedge_wr-1 \ qnap_301w \ @@ -146,6 +147,7 @@ $(eval $(call generate-ipq-wifi-package,glinet_gl-ap1300,GL.iNet GL-AP1300)) $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300)) $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) $(eval $(call generate-ipq-wifi-package,linksys_whw03v2,Linksys WHW03 V2)) +$(eval $(call generate-ipq-wifi-package,nokia_ac400i,Nokia AC400i)) $(eval $(call generate-ipq-wifi-package,p2w_r619ac,P&W R619AC)) $(eval $(call generate-ipq-wifi-package,pakedge_wr-1,Pakedge WR-1)) $(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w)) diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index 2b259b90361..82ca270dd6b 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -43,6 +43,14 @@ netgear,xr500) ucidef_set_led_switch "wan" "WAN" "white:wan" "switch0" "0x20" ucidef_set_led_ide "esata" "eSATA" "white:esata" ;; +nokia,ac400i) + ucidef_set_led_wlan "wlan5g" "5G" "green:wlan5g" "wlan0" + ucidef_set_led_wlan "wlan2g" "2.4G" "green:wlan2g" "wlan1" + ucidef_set_led_netdev "eth1" "ETH1" "green:eth1" "eth0" + ucidef_set_led_netdev "eth2" "ETH2" "green:eth2" "eth1" + ucidef_set_led_default "ctrl" "CTRL" "green:ctrl" "0" + ucidef_set_led_default "pwr" "PWR" "green:power" "1" + ;; tplink,ad7200) ucidef_set_led_usbport "usb1" "USB 1" "blue:usb1" "usb1-port1" "usb2-port1" ucidef_set_led_usbport "usb2" "USB 2" "blue:usb3" "usb3-port1" "usb4-port1" diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index f38876b69f0..8dd52452b17 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -85,6 +85,7 @@ tplink,onhub) ucidef_add_switch "switch0" \ "1:lan" "6@eth1" "2:wan" "0@eth0" ;; +nokia,ac400i |\ ubnt,unifi-ac-hd) ucidef_set_interface_lan "eth0 eth1" ;; diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index a0e2e9d1237..4c5019cf5bd 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -52,6 +52,10 @@ case "$FIRMWARE" in CI_UBIPART=art caldata_extract_ubi "ART" 0x1000 0x2f20 ;; + nokia,ac400i) + caldata_extract "0:art" 0x1000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) +2) + ;; zyxel,nbg6817) caldata_extract "0:art" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1) @@ -84,6 +88,10 @@ case "$FIRMWARE" in CI_UBIPART=art caldata_extract_ubi "ART" 0x5000 0x2f20 ;; + nokia,ac400i) + caldata_extract "0:art" 0x5000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) +3) + ;; zyxel,nbg6817) caldata_extract "0:art" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr) diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index 67ceaab24fb..5ec4f513bd3 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -18,6 +18,7 @@ platform_do_upgrade() { netgear,r7500v2 |\ netgear,r7800 |\ netgear,xr500 |\ + nokia,ac400i |\ qcom,ipq8064-ap148 |\ qcom,ipq8064-ap161) nand_do_upgrade "$1" diff --git a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8065-ac400i.dts b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8065-ac400i.dts new file mode 100644 index 00000000000..7151f8de525 --- /dev/null +++ b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8065-ac400i.dts @@ -0,0 +1,318 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq8065-smb208.dtsi" +#include + +/ { + model = "Nokia AC400i"; + compatible = "nokia,ac400i", "qcom,ipq8065", "qcom,ipq8064"; + + aliases { + mdio-gpio0 = &mdio0; + ethernet0 = &gmac0; + ethernet1 = &gmac1; + + led-boot = &pwr_red; + led-failsafe = &pwr_red; + led-running = &pwr_green; + led-upgrade = &pwr_green; + }; + + chosen { + bootargs-override = " console=ttyMSM0,115200n8 ubi.mtd=ubi root=/dev/ubiblock0_2"; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; + + 5g_red { + label = "red:5g"; + gpios = <&qcom_pinmux 65 GPIO_ACTIVE_HIGH>; + }; + + 5g_green { + label = "green:5g"; + gpios = <&qcom_pinmux 64 GPIO_ACTIVE_HIGH>; + }; + + 2g_red { + label = "red:2g"; + gpios = <&qcom_pinmux 53 GPIO_ACTIVE_HIGH>; + }; + + 2g_green { + label = "green:2g"; + gpios = <&qcom_pinmux 54 GPIO_ACTIVE_HIGH>; + }; + + eth1_red { + label = "red:eth1"; + gpios = <&qcom_pinmux 68 GPIO_ACTIVE_HIGH>; + }; + + eth1_green { + label = "green:eth1"; + gpios = <&qcom_pinmux 22 GPIO_ACTIVE_LOW>; + }; + + eth2_red { + label = "red:eth2"; + gpios = <&qcom_pinmux 67 GPIO_ACTIVE_HIGH>; + }; + + eth2_green { + label = "green:eth2"; + gpios = <&qcom_pinmux 23 GPIO_ACTIVE_LOW>; + }; + + ctrl_red { + label = "red:ctrl"; + gpios = <&qcom_pinmux 55 GPIO_ACTIVE_HIGH>; + }; + + ctrl_green { + label = "green:ctrl"; + gpios = <&qcom_pinmux 56 GPIO_ACTIVE_HIGH>; + }; + + pwr_red: pwr_red { + label = "red:pwr"; + gpios = <&qcom_pinmux 2 GPIO_ACTIVE_LOW>; + }; + + pwr_green: pwr_green { + label = "green:pwr"; + gpios = <&qcom_pinmux 26 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&qcom_pinmux { + spi_pins: spi_pins { + mux { + pins = "gpio18", "gpio19"; + function = "gsbi5"; + drive-strength = <10>; + bias-pull-down; + }; + + clk { + pins = "gpio21"; + function = "gsbi5"; + drive-strength = <12>; + bias-pull-down; + }; + + cs { + pins = "gpio20"; + function = "gpio"; + drive-strength = <10>; + bias-pull-up; + }; + }; + + led_pins: led_pins { + mux { + pins = "gpio65", "gpio64", + "gpio53", "gpio54", + "gpio68", "gpio22", + "gpio67", "gpio23", + "gpio55", "gpio56", + "gpio2", "gpio26"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + button_pins: button_pins { + mux { + pins = "gpio15"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + +}; + +&gsbi5 { + qcom,mode = ; + status = "okay"; + + spi4: spi@1a280000 { + status = "okay"; + spi-max-frequency = <50000000>; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; + + m25p80@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <50000000>; + reg = <0>; + + partitions { + compatible = "qcom,smem-part"; + }; + }; + }; +}; + +&usb3_0 { + status = "okay"; +}; + +&usb3_1 { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + + /delete-property/ pinctrl-0; + /delete-property/ pinctrl-names; + /delete-property/ perst-gpios; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + qcom,ath10k-calibration-variant = "Nokia-AC400i"; + }; + }; +}; + +&pcie1 { + status = "okay"; + + /delete-property/ pinctrl-0; + /delete-property/ pinctrl-names; + /delete-property/ perst-gpios; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + qcom,ath10k-calibration-variant = "Nokia-AC400i"; + }; + }; +}; + +&mdio0 { + status = "okay"; + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + phy0: ethernet-phy@0 { + reg = <0>; + }; + + phy1: ethernet-phy@1 { + reg = <1>; + }; + +}; + +//POE +&gmac0 { + status = "okay"; + qcom,id = <0>; + + pinctrl-0 = <&rgmii2_pins>; + pinctrl-names = "default"; + + mdiobus = <&mdio0>; + phy-handle = <&phy0>; + phy-mode = "rgmii"; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +//LAN1 +&gmac1 { + status = "okay"; + qcom,id = <1>; + + mdiobus = <&mdio0>; + phy-handle = <&phy1>; + phy-mode = "rgmii"; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&nand { + status = "okay"; + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + nand@0 { + reg = <0>; + compatible = "qcom,nandcs"; + + nand-ecc-strength = <4>; + nand-bus-width = <8>; + nand-ecc-step-size = <512>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + rootfs@0 { + label = "rootfs"; + reg = <0x0000000 0x4000000>; + }; + + rootfs_1@4000000 { + label = "rootfs_1"; + reg = <0x4000000 0x4000000>; + }; + + cfg@8000000 { + label = "cfg"; + reg = <0x8000000 0x8000000>; + }; + }; + }; +}; + +&adm_dma { + status = "okay"; +}; diff --git a/target/linux/ipq806x/image/generic.mk b/target/linux/ipq806x/image/generic.mk index 91739bc8587..3e9b366c396 100644 --- a/target/linux/ipq806x/image/generic.mk +++ b/target/linux/ipq806x/image/generic.mk @@ -335,6 +335,20 @@ define Device/netgear_xr500 endef TARGET_DEVICES += netgear_xr500 +define Device/nokia_ac400i + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Nokia + DEVICE_MODEL := AC400i + SOC := qcom-ipq8065 + DEVICE_DTS := qcom-ipq8065-ac400i + BLOCKSIZE := 128k + PAGESIZE := 2048 + BOARD_NAME := ac400i + DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-nokia-ac400i +endef +TARGET_DEVICES += nokia_ac400i + define Device/qcom_ipq8064-ap148 $(call Device/FitImage) $(call Device/UbiFit) From cd47a58b73068958ef012b273158254e63a8711c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristjan=20Kru=C5=A1i=C4=8D?= Date: Sun, 19 Mar 2023 17:58:16 +0100 Subject: [PATCH 31/44] ipq-wifi: bump to latest git HEAD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 31ff96d ipq806x: add support for Nokia Airscale AC400i 1af1df2 ath11k: ipq8074: add Netgear WAX218 Signed-off-by: Kristjan Krušič --- package/firmware/ipq-wifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index b3fbc36d33d..87608a3abc0 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2023-03-18 -PKG_SOURCE_VERSION:=86180c4c07330e303edf0afd6c017932903ee080 -PKG_MIRROR_HASH:=283d6651f8a9088981065d476c01c7c0794279e108a96377468d5fcdc3882a12 +PKG_SOURCE_DATE:=2023-03-19 +PKG_SOURCE_VERSION:=31ff96d9f99f993cb43d79f0c411fe6bf55633bb +PKG_MIRROR_HASH:=8005a884059925a627024b9022ed06a36ebf4ed7a20e8aab191585afbdd6895f PKG_FLAGS:=nonshared From d033c3ba87afe99012269b39b4990abefc340c09 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 18 Mar 2023 19:43:22 +0100 Subject: [PATCH 32/44] mac80211: mark patches accepted upstream Add kernel tags to the patches that got accepted upstream. Signed-off-by: Nick Hainke --- ....2-wifi-mac80211-add-internal-handler-for-wake_tx_queue.patch} | 0 ...6.2-wifi-mac80211-add-wake_tx_queue-callback-to-drivers.patch} | 0 ...306-03-v6.2-wifi-mac80211-Drop-support-for-TX-push-path.patch} | 0 ...06-04-v6.2-wifi-realtek-remove-duplicated-wake_tx_queue.patch} | 0 ....2-wifi-mac80211-fix-initialization-of-rx-link-and-rx-l.patch} | 0 ...k.patch => 308-v6.2-wifi-mac80211-fix-MLO-AP_VLAN-check.patch} | 0 ....2-mac80211-add-support-for-restricting-netdev-features.patch} | 0 ....2-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch} | 0 ....3-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch} | 0 ....3-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch} | 0 ....3-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch} | 0 ....3-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch} | 0 ....3-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch} | 0 ....3-wifi-mac80211-Add-VHT-MU-MIMO-related-flags-in-ieee8.patch} | 0 ....3-wifi-mac80211-Add-HE-MU-MIMO-related-flags-in-ieee80.patch} | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename package/kernel/mac80211/patches/subsys/{306-01-wifi-mac80211-add-internal-handler-for-wake_tx_queue.patch => 306-01-v6.2-wifi-mac80211-add-internal-handler-for-wake_tx_queue.patch} (100%) rename package/kernel/mac80211/patches/subsys/{306-02-wifi-mac80211-add-wake_tx_queue-callback-to-drivers.patch => 306-02-v6.2-wifi-mac80211-add-wake_tx_queue-callback-to-drivers.patch} (100%) rename package/kernel/mac80211/patches/subsys/{306-03-wifi-mac80211-Drop-support-for-TX-push-path.patch => 306-03-v6.2-wifi-mac80211-Drop-support-for-TX-push-path.patch} (100%) rename package/kernel/mac80211/patches/subsys/{306-04-wifi-realtek-remove-duplicated-wake_tx_queue.patch => 306-04-v6.2-wifi-realtek-remove-duplicated-wake_tx_queue.patch} (100%) rename package/kernel/mac80211/patches/subsys/{307-wifi-mac80211-fix-initialization-of-rx-link-and-rx-l.patch => 307-v6.2-wifi-mac80211-fix-initialization-of-rx-link-and-rx-l.patch} (100%) rename package/kernel/mac80211/patches/subsys/{308-wifi-mac80211-fix-MLO-AP_VLAN-check.patch => 308-v6.2-wifi-mac80211-fix-MLO-AP_VLAN-check.patch} (100%) rename package/kernel/mac80211/patches/subsys/{310-mac80211-add-support-for-restricting-netdev-features.patch => 310-v6.2-mac80211-add-support-for-restricting-netdev-features.patch} (100%) rename package/kernel/mac80211/patches/subsys/{311-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch => 311-v6.2-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch} (100%) rename package/kernel/mac80211/patches/subsys/{312-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch => 312-v6.3-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch} (100%) rename package/kernel/mac80211/patches/subsys/{313-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch => 313-v6.3-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch} (100%) rename package/kernel/mac80211/patches/subsys/{314-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch => 314-v6.3-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch} (100%) rename package/kernel/mac80211/patches/subsys/{315-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch => 315-v6.3-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch} (100%) rename package/kernel/mac80211/patches/subsys/{316-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch => 316-v6.3-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch} (100%) rename package/kernel/mac80211/patches/subsys/{323-wifi-mac80211-Add-VHT-MU-MIMO-related-flags-in-ieee8.patch => 323-v6.3-wifi-mac80211-Add-VHT-MU-MIMO-related-flags-in-ieee8.patch} (100%) rename package/kernel/mac80211/patches/subsys/{324-wifi-mac80211-Add-HE-MU-MIMO-related-flags-in-ieee80.patch => 324-v6.3-wifi-mac80211-Add-HE-MU-MIMO-related-flags-in-ieee80.patch} (100%) diff --git a/package/kernel/mac80211/patches/subsys/306-01-wifi-mac80211-add-internal-handler-for-wake_tx_queue.patch b/package/kernel/mac80211/patches/subsys/306-01-v6.2-wifi-mac80211-add-internal-handler-for-wake_tx_queue.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/306-01-wifi-mac80211-add-internal-handler-for-wake_tx_queue.patch rename to package/kernel/mac80211/patches/subsys/306-01-v6.2-wifi-mac80211-add-internal-handler-for-wake_tx_queue.patch diff --git a/package/kernel/mac80211/patches/subsys/306-02-wifi-mac80211-add-wake_tx_queue-callback-to-drivers.patch b/package/kernel/mac80211/patches/subsys/306-02-v6.2-wifi-mac80211-add-wake_tx_queue-callback-to-drivers.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/306-02-wifi-mac80211-add-wake_tx_queue-callback-to-drivers.patch rename to package/kernel/mac80211/patches/subsys/306-02-v6.2-wifi-mac80211-add-wake_tx_queue-callback-to-drivers.patch diff --git a/package/kernel/mac80211/patches/subsys/306-03-wifi-mac80211-Drop-support-for-TX-push-path.patch b/package/kernel/mac80211/patches/subsys/306-03-v6.2-wifi-mac80211-Drop-support-for-TX-push-path.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/306-03-wifi-mac80211-Drop-support-for-TX-push-path.patch rename to package/kernel/mac80211/patches/subsys/306-03-v6.2-wifi-mac80211-Drop-support-for-TX-push-path.patch diff --git a/package/kernel/mac80211/patches/subsys/306-04-wifi-realtek-remove-duplicated-wake_tx_queue.patch b/package/kernel/mac80211/patches/subsys/306-04-v6.2-wifi-realtek-remove-duplicated-wake_tx_queue.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/306-04-wifi-realtek-remove-duplicated-wake_tx_queue.patch rename to package/kernel/mac80211/patches/subsys/306-04-v6.2-wifi-realtek-remove-duplicated-wake_tx_queue.patch diff --git a/package/kernel/mac80211/patches/subsys/307-wifi-mac80211-fix-initialization-of-rx-link-and-rx-l.patch b/package/kernel/mac80211/patches/subsys/307-v6.2-wifi-mac80211-fix-initialization-of-rx-link-and-rx-l.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/307-wifi-mac80211-fix-initialization-of-rx-link-and-rx-l.patch rename to package/kernel/mac80211/patches/subsys/307-v6.2-wifi-mac80211-fix-initialization-of-rx-link-and-rx-l.patch diff --git a/package/kernel/mac80211/patches/subsys/308-wifi-mac80211-fix-MLO-AP_VLAN-check.patch b/package/kernel/mac80211/patches/subsys/308-v6.2-wifi-mac80211-fix-MLO-AP_VLAN-check.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/308-wifi-mac80211-fix-MLO-AP_VLAN-check.patch rename to package/kernel/mac80211/patches/subsys/308-v6.2-wifi-mac80211-fix-MLO-AP_VLAN-check.patch diff --git a/package/kernel/mac80211/patches/subsys/310-mac80211-add-support-for-restricting-netdev-features.patch b/package/kernel/mac80211/patches/subsys/310-v6.2-mac80211-add-support-for-restricting-netdev-features.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/310-mac80211-add-support-for-restricting-netdev-features.patch rename to package/kernel/mac80211/patches/subsys/310-v6.2-mac80211-add-support-for-restricting-netdev-features.patch diff --git a/package/kernel/mac80211/patches/subsys/311-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch b/package/kernel/mac80211/patches/subsys/311-v6.2-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/311-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch rename to package/kernel/mac80211/patches/subsys/311-v6.2-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch diff --git a/package/kernel/mac80211/patches/subsys/312-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch b/package/kernel/mac80211/patches/subsys/312-v6.3-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/312-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch rename to package/kernel/mac80211/patches/subsys/312-v6.3-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch diff --git a/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch b/package/kernel/mac80211/patches/subsys/313-v6.3-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch rename to package/kernel/mac80211/patches/subsys/313-v6.3-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch diff --git a/package/kernel/mac80211/patches/subsys/314-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch b/package/kernel/mac80211/patches/subsys/314-v6.3-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/314-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch rename to package/kernel/mac80211/patches/subsys/314-v6.3-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch diff --git a/package/kernel/mac80211/patches/subsys/315-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch b/package/kernel/mac80211/patches/subsys/315-v6.3-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/315-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch rename to package/kernel/mac80211/patches/subsys/315-v6.3-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch diff --git a/package/kernel/mac80211/patches/subsys/316-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch b/package/kernel/mac80211/patches/subsys/316-v6.3-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/316-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch rename to package/kernel/mac80211/patches/subsys/316-v6.3-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch diff --git a/package/kernel/mac80211/patches/subsys/323-wifi-mac80211-Add-VHT-MU-MIMO-related-flags-in-ieee8.patch b/package/kernel/mac80211/patches/subsys/323-v6.3-wifi-mac80211-Add-VHT-MU-MIMO-related-flags-in-ieee8.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/323-wifi-mac80211-Add-VHT-MU-MIMO-related-flags-in-ieee8.patch rename to package/kernel/mac80211/patches/subsys/323-v6.3-wifi-mac80211-Add-VHT-MU-MIMO-related-flags-in-ieee8.patch diff --git a/package/kernel/mac80211/patches/subsys/324-wifi-mac80211-Add-HE-MU-MIMO-related-flags-in-ieee80.patch b/package/kernel/mac80211/patches/subsys/324-v6.3-wifi-mac80211-Add-HE-MU-MIMO-related-flags-in-ieee80.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/324-wifi-mac80211-Add-HE-MU-MIMO-related-flags-in-ieee80.patch rename to package/kernel/mac80211/patches/subsys/324-v6.3-wifi-mac80211-Add-HE-MU-MIMO-related-flags-in-ieee80.patch From c98e09f01bc6788644d22ffd02cd7aaaef63f5ea Mon Sep 17 00:00:00 2001 From: Mathew McBride Date: Thu, 23 Feb 2023 16:51:36 +1100 Subject: [PATCH 33/44] tools: update elf.h OpenWrt contains a 2012 copy of glibc's elf.h, which predates the introduction of some newer architectures like Arm64 and RISC-V. Linux 5.13 introduced the "gen-hyprel" tool into the kernel compile (when virtualization/KVM is enabled) which requires EM_AARCH64 to be defined. arch/arm64/kvm/hyp/nvhe/gen-hyprel.c: In function 'init_elf': arch/arm64/kvm/hyp/nvhe/gen-hyprel.c:289:43: error: 'EM_AARCH64' undeclared (first use in this function); did you mean 'EM_IA_64'? 289 | assert_eq(elf16toh(elf.ehdr->e_machine), EM_AARCH64, "%u"); | ^~~~~~~~~~ Update the copy of elf.h from the latest glibc to fix this. Compile-tested: ath79, armvirt, mpc85xx, x86 Run-tested: armvirt Signed-off-by: Mathew McBride --- tools/include/elf.h | 1740 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 1530 insertions(+), 210 deletions(-) diff --git a/tools/include/elf.h b/tools/include/elf.h index 036a176345e..4bc0e4299c3 100644 --- a/tools/include/elf.h +++ b/tools/include/elf.h @@ -1,5 +1,5 @@ /* This file defines standard ELF types, structures, and macros. - Copyright (C) 1995-2012 Free Software Foundation, Inc. + Copyright (C) 1995-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ #ifndef _ELF_H #define _ELF_H 1 @@ -168,86 +168,203 @@ typedef struct /* Legal values for e_machine (architecture). */ -#define EM_NONE 0 /* No machine */ -#define EM_M32 1 /* AT&T WE 32100 */ -#define EM_SPARC 2 /* SUN SPARC */ -#define EM_386 3 /* Intel 80386 */ -#define EM_68K 4 /* Motorola m68k family */ -#define EM_88K 5 /* Motorola m88k family */ -#define EM_860 7 /* Intel 80860 */ -#define EM_MIPS 8 /* MIPS R3000 big-endian */ -#define EM_S370 9 /* IBM System/370 */ -#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */ +#define EM_NONE 0 /* No machine */ +#define EM_M32 1 /* AT&T WE 32100 */ +#define EM_SPARC 2 /* SUN SPARC */ +#define EM_386 3 /* Intel 80386 */ +#define EM_68K 4 /* Motorola m68k family */ +#define EM_88K 5 /* Motorola m88k family */ +#define EM_IAMCU 6 /* Intel MCU */ +#define EM_860 7 /* Intel 80860 */ +#define EM_MIPS 8 /* MIPS R3000 big-endian */ +#define EM_S370 9 /* IBM System/370 */ +#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */ + /* reserved 11-14 */ +#define EM_PARISC 15 /* HPPA */ + /* reserved 16 */ +#define EM_VPP500 17 /* Fujitsu VPP500 */ +#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ +#define EM_960 19 /* Intel 80960 */ +#define EM_PPC 20 /* PowerPC */ +#define EM_PPC64 21 /* PowerPC 64-bit */ +#define EM_S390 22 /* IBM S390 */ +#define EM_SPU 23 /* IBM SPU/SPC */ + /* reserved 24-35 */ +#define EM_V800 36 /* NEC V800 series */ +#define EM_FR20 37 /* Fujitsu FR20 */ +#define EM_RH32 38 /* TRW RH-32 */ +#define EM_RCE 39 /* Motorola RCE */ +#define EM_ARM 40 /* ARM */ +#define EM_FAKE_ALPHA 41 /* Digital Alpha */ +#define EM_SH 42 /* Hitachi SH */ +#define EM_SPARCV9 43 /* SPARC v9 64-bit */ +#define EM_TRICORE 44 /* Siemens Tricore */ +#define EM_ARC 45 /* Argonaut RISC Core */ +#define EM_H8_300 46 /* Hitachi H8/300 */ +#define EM_H8_300H 47 /* Hitachi H8/300H */ +#define EM_H8S 48 /* Hitachi H8S */ +#define EM_H8_500 49 /* Hitachi H8/500 */ +#define EM_IA_64 50 /* Intel Merced */ +#define EM_MIPS_X 51 /* Stanford MIPS-X */ +#define EM_COLDFIRE 52 /* Motorola Coldfire */ +#define EM_68HC12 53 /* Motorola M68HC12 */ +#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator */ +#define EM_PCP 55 /* Siemens PCP */ +#define EM_NCPU 56 /* Sony nCPU embeeded RISC */ +#define EM_NDR1 57 /* Denso NDR1 microprocessor */ +#define EM_STARCORE 58 /* Motorola Start*Core processor */ +#define EM_ME16 59 /* Toyota ME16 processor */ +#define EM_ST100 60 /* STMicroelectronic ST100 processor */ +#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam */ +#define EM_X86_64 62 /* AMD x86-64 architecture */ +#define EM_PDSP 63 /* Sony DSP Processor */ +#define EM_PDP10 64 /* Digital PDP-10 */ +#define EM_PDP11 65 /* Digital PDP-11 */ +#define EM_FX66 66 /* Siemens FX66 microcontroller */ +#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */ +#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */ +#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */ +#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */ +#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */ +#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */ +#define EM_SVX 73 /* Silicon Graphics SVx */ +#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */ +#define EM_VAX 75 /* Digital VAX */ +#define EM_CRIS 76 /* Axis Communications 32-bit emb.proc */ +#define EM_JAVELIN 77 /* Infineon Technologies 32-bit emb.proc */ +#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */ +#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */ +#define EM_MMIX 80 /* Donald Knuth's educational 64-bit proc */ +#define EM_HUANY 81 /* Harvard University machine-independent object files */ +#define EM_PRISM 82 /* SiTera Prism */ +#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ +#define EM_FR30 84 /* Fujitsu FR30 */ +#define EM_D10V 85 /* Mitsubishi D10V */ +#define EM_D30V 86 /* Mitsubishi D30V */ +#define EM_V850 87 /* NEC v850 */ +#define EM_M32R 88 /* Mitsubishi M32R */ +#define EM_MN10300 89 /* Matsushita MN10300 */ +#define EM_MN10200 90 /* Matsushita MN10200 */ +#define EM_PJ 91 /* picoJava */ +#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ +#define EM_ARC_COMPACT 93 /* ARC International ARCompact */ +#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ +#define EM_VIDEOCORE 95 /* Alphamosaic VideoCore */ +#define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Proc */ +#define EM_NS32K 97 /* National Semi. 32000 */ +#define EM_TPC 98 /* Tenor Network TPC */ +#define EM_SNP1K 99 /* Trebia SNP 1000 */ +#define EM_ST200 100 /* STMicroelectronics ST200 */ +#define EM_IP2K 101 /* Ubicom IP2xxx */ +#define EM_MAX 102 /* MAX processor */ +#define EM_CR 103 /* National Semi. CompactRISC */ +#define EM_F2MC16 104 /* Fujitsu F2MC16 */ +#define EM_MSP430 105 /* Texas Instruments msp430 */ +#define EM_BLACKFIN 106 /* Analog Devices Blackfin DSP */ +#define EM_SE_C33 107 /* Seiko Epson S1C33 family */ +#define EM_SEP 108 /* Sharp embedded microprocessor */ +#define EM_ARCA 109 /* Arca RISC */ +#define EM_UNICORE 110 /* PKU-Unity & MPRC Peking Uni. mc series */ +#define EM_EXCESS 111 /* eXcess configurable cpu */ +#define EM_DXP 112 /* Icera Semi. Deep Execution Processor */ +#define EM_ALTERA_NIOS2 113 /* Altera Nios II */ +#define EM_CRX 114 /* National Semi. CompactRISC CRX */ +#define EM_XGATE 115 /* Motorola XGATE */ +#define EM_C166 116 /* Infineon C16x/XC16x */ +#define EM_M16C 117 /* Renesas M16C */ +#define EM_DSPIC30F 118 /* Microchip Technology dsPIC30F */ +#define EM_CE 119 /* Freescale Communication Engine RISC */ +#define EM_M32C 120 /* Renesas M32C */ + /* reserved 121-130 */ +#define EM_TSK3000 131 /* Altium TSK3000 */ +#define EM_RS08 132 /* Freescale RS08 */ +#define EM_SHARC 133 /* Analog Devices SHARC family */ +#define EM_ECOG2 134 /* Cyan Technology eCOG2 */ +#define EM_SCORE7 135 /* Sunplus S+core7 RISC */ +#define EM_DSP24 136 /* New Japan Radio (NJR) 24-bit DSP */ +#define EM_VIDEOCORE3 137 /* Broadcom VideoCore III */ +#define EM_LATTICEMICO32 138 /* RISC for Lattice FPGA */ +#define EM_SE_C17 139 /* Seiko Epson C17 */ +#define EM_TI_C6000 140 /* Texas Instruments TMS320C6000 DSP */ +#define EM_TI_C2000 141 /* Texas Instruments TMS320C2000 DSP */ +#define EM_TI_C5500 142 /* Texas Instruments TMS320C55x DSP */ +#define EM_TI_ARP32 143 /* Texas Instruments App. Specific RISC */ +#define EM_TI_PRU 144 /* Texas Instruments Prog. Realtime Unit */ + /* reserved 145-159 */ +#define EM_MMDSP_PLUS 160 /* STMicroelectronics 64bit VLIW DSP */ +#define EM_CYPRESS_M8C 161 /* Cypress M8C */ +#define EM_R32C 162 /* Renesas R32C */ +#define EM_TRIMEDIA 163 /* NXP Semi. TriMedia */ +#define EM_QDSP6 164 /* QUALCOMM DSP6 */ +#define EM_8051 165 /* Intel 8051 and variants */ +#define EM_STXP7X 166 /* STMicroelectronics STxP7x */ +#define EM_NDS32 167 /* Andes Tech. compact code emb. RISC */ +#define EM_ECOG1X 168 /* Cyan Technology eCOG1X */ +#define EM_MAXQ30 169 /* Dallas Semi. MAXQ30 mc */ +#define EM_XIMO16 170 /* New Japan Radio (NJR) 16-bit DSP */ +#define EM_MANIK 171 /* M2000 Reconfigurable RISC */ +#define EM_CRAYNV2 172 /* Cray NV2 vector architecture */ +#define EM_RX 173 /* Renesas RX */ +#define EM_METAG 174 /* Imagination Tech. META */ +#define EM_MCST_ELBRUS 175 /* MCST Elbrus */ +#define EM_ECOG16 176 /* Cyan Technology eCOG16 */ +#define EM_CR16 177 /* National Semi. CompactRISC CR16 */ +#define EM_ETPU 178 /* Freescale Extended Time Processing Unit */ +#define EM_SLE9X 179 /* Infineon Tech. SLE9X */ +#define EM_L10M 180 /* Intel L10M */ +#define EM_K10M 181 /* Intel K10M */ + /* reserved 182 */ +#define EM_AARCH64 183 /* ARM AARCH64 */ + /* reserved 184 */ +#define EM_AVR32 185 /* Amtel 32-bit microprocessor */ +#define EM_STM8 186 /* STMicroelectronics STM8 */ +#define EM_TILE64 187 /* Tilera TILE64 */ +#define EM_TILEPRO 188 /* Tilera TILEPro */ +#define EM_MICROBLAZE 189 /* Xilinx MicroBlaze */ +#define EM_CUDA 190 /* NVIDIA CUDA */ +#define EM_TILEGX 191 /* Tilera TILE-Gx */ +#define EM_CLOUDSHIELD 192 /* CloudShield */ +#define EM_COREA_1ST 193 /* KIPO-KAIST Core-A 1st gen. */ +#define EM_COREA_2ND 194 /* KIPO-KAIST Core-A 2nd gen. */ +#define EM_ARCV2 195 /* Synopsys ARCv2 ISA. */ +#define EM_OPEN8 196 /* Open8 RISC */ +#define EM_RL78 197 /* Renesas RL78 */ +#define EM_VIDEOCORE5 198 /* Broadcom VideoCore V */ +#define EM_78KOR 199 /* Renesas 78KOR */ +#define EM_56800EX 200 /* Freescale 56800EX DSC */ +#define EM_BA1 201 /* Beyond BA1 */ +#define EM_BA2 202 /* Beyond BA2 */ +#define EM_XCORE 203 /* XMOS xCORE */ +#define EM_MCHP_PIC 204 /* Microchip 8-bit PIC(r) */ +#define EM_INTELGT 205 /* Intel Graphics Technology */ + /* reserved 206-209 */ +#define EM_KM32 210 /* KM211 KM32 */ +#define EM_KMX32 211 /* KM211 KMX32 */ +#define EM_EMX16 212 /* KM211 KMX16 */ +#define EM_EMX8 213 /* KM211 KMX8 */ +#define EM_KVARC 214 /* KM211 KVARC */ +#define EM_CDP 215 /* Paneve CDP */ +#define EM_COGE 216 /* Cognitive Smart Memory Processor */ +#define EM_COOL 217 /* Bluechip CoolEngine */ +#define EM_NORC 218 /* Nanoradio Optimized RISC */ +#define EM_CSR_KALIMBA 219 /* CSR Kalimba */ +#define EM_Z80 220 /* Zilog Z80 */ +#define EM_VISIUM 221 /* Controls and Data Services VISIUMcore */ +#define EM_FT32 222 /* FTDI Chip FT32 */ +#define EM_MOXIE 223 /* Moxie processor */ +#define EM_AMDGPU 224 /* AMD GPU */ + /* reserved 225-242 */ +#define EM_RISCV 243 /* RISC-V */ -#define EM_PARISC 15 /* HPPA */ -#define EM_VPP500 17 /* Fujitsu VPP500 */ -#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ -#define EM_960 19 /* Intel 80960 */ -#define EM_PPC 20 /* PowerPC */ -#define EM_PPC64 21 /* PowerPC 64-bit */ -#define EM_S390 22 /* IBM S390 */ +#define EM_BPF 247 /* Linux BPF -- in-kernel virtual machine */ +#define EM_CSKY 252 /* C-SKY */ +#define EM_LOONGARCH 258 /* LoongArch */ -#define EM_V800 36 /* NEC V800 series */ -#define EM_FR20 37 /* Fujitsu FR20 */ -#define EM_RH32 38 /* TRW RH-32 */ -#define EM_RCE 39 /* Motorola RCE */ -#define EM_ARM 40 /* ARM */ -#define EM_FAKE_ALPHA 41 /* Digital Alpha */ -#define EM_SH 42 /* Hitachi SH */ -#define EM_SPARCV9 43 /* SPARC v9 64-bit */ -#define EM_TRICORE 44 /* Siemens Tricore */ -#define EM_ARC 45 /* Argonaut RISC Core */ -#define EM_H8_300 46 /* Hitachi H8/300 */ -#define EM_H8_300H 47 /* Hitachi H8/300H */ -#define EM_H8S 48 /* Hitachi H8S */ -#define EM_H8_500 49 /* Hitachi H8/500 */ -#define EM_IA_64 50 /* Intel Merced */ -#define EM_MIPS_X 51 /* Stanford MIPS-X */ -#define EM_COLDFIRE 52 /* Motorola Coldfire */ -#define EM_68HC12 53 /* Motorola M68HC12 */ -#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/ -#define EM_PCP 55 /* Siemens PCP */ -#define EM_NCPU 56 /* Sony nCPU embeeded RISC */ -#define EM_NDR1 57 /* Denso NDR1 microprocessor */ -#define EM_STARCORE 58 /* Motorola Start*Core processor */ -#define EM_ME16 59 /* Toyota ME16 processor */ -#define EM_ST100 60 /* STMicroelectronic ST100 processor */ -#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/ -#define EM_X86_64 62 /* AMD x86-64 architecture */ -#define EM_PDSP 63 /* Sony DSP Processor */ +#define EM_NUM 259 -#define EM_FX66 66 /* Siemens FX66 microcontroller */ -#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */ -#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */ -#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */ -#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */ -#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */ -#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */ -#define EM_SVX 73 /* Silicon Graphics SVx */ -#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */ -#define EM_VAX 75 /* Digital VAX */ -#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ -#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */ -#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */ -#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */ -#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */ -#define EM_HUANY 81 /* Harvard University machine-independent object files */ -#define EM_PRISM 82 /* SiTera Prism */ -#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ -#define EM_FR30 84 /* Fujitsu FR30 */ -#define EM_D10V 85 /* Mitsubishi D10V */ -#define EM_D30V 86 /* Mitsubishi D30V */ -#define EM_V850 87 /* NEC v850 */ -#define EM_M32R 88 /* Mitsubishi M32R */ -#define EM_MN10300 89 /* Matsushita MN10300 */ -#define EM_MN10200 90 /* Matsushita MN10200 */ -#define EM_PJ 91 /* picoJava */ -#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ -#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ -#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ -#define EM_TILEPRO 188 /* Tilera TILEPro */ -#define EM_TILEGX 191 /* Tilera TILE-Gx */ -#define EM_NUM 192 +/* Old spellings/synonyms. */ + +#define EM_ARC_A5 EM_ARC_COMPACT /* If it is necessary to assign new unofficial EM_* values, please pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the @@ -326,8 +443,9 @@ typedef struct #define SHT_FINI_ARRAY 15 /* Array of destructors */ #define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */ #define SHT_GROUP 17 /* Section group */ -#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */ -#define SHT_NUM 19 /* Number of defined types. */ +#define SHT_SYMTAB_SHNDX 18 /* Extended section indices */ +#define SHT_RELR 19 /* RELR relative relocations */ +#define SHT_NUM 20 /* Number of defined types. */ #define SHT_LOOS 0x60000000 /* Start OS-specific. */ #define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */ #define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */ @@ -360,13 +478,40 @@ typedef struct required */ #define SHF_GROUP (1 << 9) /* Section is member of a group. */ #define SHF_TLS (1 << 10) /* Section hold thread-local data. */ +#define SHF_COMPRESSED (1 << 11) /* Section with compressed data. */ #define SHF_MASKOS 0x0ff00000 /* OS-specific. */ #define SHF_MASKPROC 0xf0000000 /* Processor-specific */ +#define SHF_GNU_RETAIN (1 << 21) /* Not to be GCed by linker. */ #define SHF_ORDERED (1 << 30) /* Special ordering requirement (Solaris). */ -#define SHF_EXCLUDE (1 << 31) /* Section is excluded unless +#define SHF_EXCLUDE (1U << 31) /* Section is excluded unless referenced or allocated (Solaris).*/ +/* Section compression header. Used when SHF_COMPRESSED is set. */ + +typedef struct +{ + Elf32_Word ch_type; /* Compression format. */ + Elf32_Word ch_size; /* Uncompressed data size. */ + Elf32_Word ch_addralign; /* Uncompressed data alignment. */ +} Elf32_Chdr; + +typedef struct +{ + Elf64_Word ch_type; /* Compression format. */ + Elf64_Word ch_reserved; + Elf64_Xword ch_size; /* Uncompressed data size. */ + Elf64_Xword ch_addralign; /* Uncompressed data alignment. */ +} Elf64_Chdr; + +/* Legal values for ch_type (compression algorithm). */ +#define ELFCOMPRESS_ZLIB 1 /* ZLIB/DEFLATE algorithm. */ +#define ELFCOMPRESS_ZSTD 2 /* Zstandard algorithm. */ +#define ELFCOMPRESS_LOOS 0x60000000 /* Start of OS-specific. */ +#define ELFCOMPRESS_HIOS 0x6fffffff /* End of OS-specific. */ +#define ELFCOMPRESS_LOPROC 0x70000000 /* Start of processor-specific. */ +#define ELFCOMPRESS_HIPROC 0x7fffffff /* End of processor-specific. */ + /* Section group handling. */ #define GRP_COMDAT 0x1 /* Mark group as COMDAT. */ @@ -520,6 +665,11 @@ typedef struct Elf64_Sxword r_addend; /* Addend */ } Elf64_Rela; +/* RELR relocation table entry */ + +typedef Elf32_Word Elf32_Relr; +typedef Elf64_Xword Elf64_Relr; + /* How to extract and insert information held in the r_info field. */ #define ELF32_R_SYM(val) ((val) >> 8) @@ -577,6 +727,7 @@ typedef struct #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ +#define PT_GNU_PROPERTY 0x6474e553 /* GNU property */ #define PT_LOSUNW 0x6ffffffa #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ @@ -596,6 +747,8 @@ typedef struct /* Legal values for note segment descriptor types for core files. */ #define NT_PRSTATUS 1 /* Contains copy of prstatus struct */ +#define NT_PRFPREG 2 /* Contains copy of fpregset + struct. */ #define NT_FPREGSET 2 /* Contains copy of fpregset struct */ #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ #define NT_PRXREG 4 /* Contains copy of prxregset struct */ @@ -611,13 +764,82 @@ typedef struct #define NT_LWPSTATUS 16 /* Contains copy of lwpstatus struct */ #define NT_LWPSINFO 17 /* Contains copy of lwpinfo struct */ #define NT_PRFPXREG 20 /* Contains copy of fprxregset struct */ +#define NT_SIGINFO 0x53494749 /* Contains copy of siginfo_t, + size might increase */ +#define NT_FILE 0x46494c45 /* Contains information about mapped + files */ #define NT_PRXFPREG 0x46e62b7f /* Contains copy of user_fxsr_struct */ #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ #define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ +#define NT_PPC_TAR 0x103 /* Target Address Register */ +#define NT_PPC_PPR 0x104 /* Program Priority Register */ +#define NT_PPC_DSCR 0x105 /* Data Stream Control Register */ +#define NT_PPC_EBB 0x106 /* Event Based Branch Registers */ +#define NT_PPC_PMU 0x107 /* Performance Monitor Registers */ +#define NT_PPC_TM_CGPR 0x108 /* TM checkpointed GPR Registers */ +#define NT_PPC_TM_CFPR 0x109 /* TM checkpointed FPR Registers */ +#define NT_PPC_TM_CVMX 0x10a /* TM checkpointed VMX Registers */ +#define NT_PPC_TM_CVSX 0x10b /* TM checkpointed VSX Registers */ +#define NT_PPC_TM_SPR 0x10c /* TM Special Purpose Registers */ +#define NT_PPC_TM_CTAR 0x10d /* TM checkpointed Target Address + Register */ +#define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority + Register */ +#define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control + Register */ +#define NT_PPC_PKEY 0x110 /* Memory Protection Keys + registers. */ #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ #define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ +#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */ +#define NT_S390_TIMER 0x301 /* s390 timer register */ +#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */ +#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */ +#define NT_S390_CTRS 0x304 /* s390 control registers */ +#define NT_S390_PREFIX 0x305 /* s390 prefix register */ +#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ +#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ +#define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */ +#define NT_S390_VXRS_LOW 0x309 /* s390 vector registers 0-15 + upper half. */ +#define NT_S390_VXRS_HIGH 0x30a /* s390 vector registers 16-31. */ +#define NT_S390_GS_CB 0x30b /* s390 guarded storage registers. */ +#define NT_S390_GS_BC 0x30c /* s390 guarded storage + broadcast control block. */ +#define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation. */ +#define NT_S390_PV_CPU_DATA 0x30e /* s390 protvirt cpu dump data. */ +#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ +#define NT_ARM_TLS 0x401 /* ARM TLS register */ +#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */ +#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */ +#define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */ +#define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension + registers */ +#define NT_ARM_PAC_MASK 0x406 /* ARM pointer authentication + code masks. */ +#define NT_ARM_PACA_KEYS 0x407 /* ARM pointer authentication + address keys. */ +#define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication + generic key. */ +#define NT_ARM_TAGGED_ADDR_CTRL 0x409 /* AArch64 tagged address + control. */ +#define NT_ARM_PAC_ENABLED_KEYS 0x40a /* AArch64 pointer authentication + enabled keys. */ +#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */ +#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */ +#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */ +#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers. */ +#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */ +#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and + status registers. */ +#define NT_LOONGARCH_LSX 0xa02 /* LoongArch Loongson SIMD + Extension registers. */ +#define NT_LOONGARCH_LASX 0xa03 /* LoongArch Loongson Advanced + SIMD Extension registers. */ +#define NT_LOONGARCH_LBT 0xa04 /* LoongArch Loongson Binary + Translation registers. */ /* Legal values for the note segment descriptor types for object files. */ @@ -682,7 +904,11 @@ typedef struct #define DT_ENCODING 32 /* Start of encoded range */ #define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/ #define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */ -#define DT_NUM 34 /* Number used */ +#define DT_SYMTAB_SHNDX 34 /* Address of SYMTAB_SHNDX section */ +#define DT_RELRSZ 35 /* Total size of RELR relative relocations */ +#define DT_RELR 36 /* Address of RELR relative relocations */ +#define DT_RELRENT 37 /* Size of one RELR relative relocaction */ +#define DT_NUM 38 /* Number used */ #define DT_LOOS 0x6000000d /* Start of OS-specific */ #define DT_HIOS 0x6ffff000 /* End of OS-specific */ #define DT_LOPROC 0x70000000 /* Start of processor-specific */ @@ -781,6 +1007,20 @@ typedef struct #define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */ #define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */ #define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. */ +#define DF_1_NODIRECT 0x00020000 /* Object has no-direct binding. */ +#define DF_1_IGNMULDEF 0x00040000 +#define DF_1_NOKSYMS 0x00080000 +#define DF_1_NOHDR 0x00100000 +#define DF_1_EDITED 0x00200000 /* Object is modified after built. */ +#define DF_1_NORELOC 0x00400000 +#define DF_1_SYMINTPOSE 0x00800000 /* Object has individual interposers. */ +#define DF_1_GLOBAUDIT 0x01000000 /* Global auditing required. */ +#define DF_1_SINGLETON 0x02000000 /* Singleton symbols are used. */ +#define DF_1_STUB 0x04000000 +#define DF_1_PIE 0x08000000 +#define DF_1_KMOD 0x10000000 +#define DF_1_WEAKFILTER 0x20000000 +#define DF_1_NOCOMMON 0x40000000 /* Flags for the feature selection in DT_FEATURE_1. */ #define DTF_1_PARINIT 0x00000001 @@ -825,7 +1065,8 @@ typedef struct /* Legal values for vd_flags (version information flags). */ #define VER_FLG_BASE 0x1 /* Version definition of file itself */ -#define VER_FLG_WEAK 0x2 /* Weak version identifier */ +#define VER_FLG_WEAK 0x2 /* Weak version identifier. Also + used by vna_flags below. */ /* Versym symbol index values. */ #define VER_NDX_LOCAL 0 /* Symbol is local. */ @@ -833,7 +1074,7 @@ typedef struct #define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */ #define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */ -/* Auxialiary version information. */ +/* Auxiliary version information. */ typedef struct { @@ -903,10 +1144,6 @@ typedef struct } Elf64_Vernaux; -/* Legal values for vna_flags. */ -#define VER_FLG_WEAK 0x2 /* Weak version identifier */ - - /* Auxiliary vector. */ /* This vector is normally only used by the program interpreter. The @@ -961,7 +1198,7 @@ typedef struct /* Some more special a_type values describing the hardware. */ #define AT_PLATFORM 15 /* String identifying platform. */ -#define AT_HWCAP 16 /* Machine dependent hints about +#define AT_HWCAP 16 /* Machine-dependent hints about processor capabilities. */ /* This entry gives some information about the FPU initialization @@ -983,6 +1220,9 @@ typedef struct #define AT_RANDOM 25 /* Address of 16 random bytes. */ +#define AT_HWCAP2 26 /* More machine-dependent hints about + processor capabilities. */ + #define AT_EXECFN 31 /* Filename of executable. */ /* Pointer to the global system page used for system calls and other @@ -997,6 +1237,20 @@ typedef struct #define AT_L2_CACHESHAPE 36 #define AT_L3_CACHESHAPE 37 +/* Shapes of the caches, with more room to describe them. + *GEOMETRY are comprised of cache line size in bytes in the bottom 16 bits + and the cache associativity in the next 16 bits. */ +#define AT_L1I_CACHESIZE 40 +#define AT_L1I_CACHEGEOMETRY 41 +#define AT_L1D_CACHESIZE 42 +#define AT_L1D_CACHEGEOMETRY 43 +#define AT_L2_CACHESIZE 44 +#define AT_L2_CACHEGEOMETRY 45 +#define AT_L3_CACHESIZE 46 +#define AT_L3_CACHEGEOMETRY 47 + +#define AT_MINSIGSTKSZ 51 /* Stack needed for signal delivery */ + /* Note section contents. Each entry in the note section begins with a header of a fixed form. */ @@ -1022,6 +1276,8 @@ typedef struct /* Note entries for GNU systems have this name. */ #define ELF_NOTE_GNU "GNU" +/* Note entries for freedesktop.org have this name. */ +#define ELF_NOTE_FDO "FDO" /* Defined types of notes for Solaris. */ @@ -1062,6 +1318,84 @@ typedef struct /* Version note generated by GNU gold containing a version string. */ #define NT_GNU_GOLD_VERSION 4 +/* Program property. */ +#define NT_GNU_PROPERTY_TYPE_0 5 + +/* Packaging metadata as defined on + https://systemd.io/COREDUMP_PACKAGE_METADATA/ */ +#define NT_FDO_PACKAGING_METADATA 0xcafe1a7e + +/* Note section name of program property. */ +#define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property" + +/* Values used in GNU .note.gnu.property notes (NT_GNU_PROPERTY_TYPE_0). */ + +/* Stack size. */ +#define GNU_PROPERTY_STACK_SIZE 1 +/* No copy relocation on protected data symbol. */ +#define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 + +/* A 4-byte unsigned integer property: A bit is set if it is set in all + relocatable inputs. */ +#define GNU_PROPERTY_UINT32_AND_LO 0xb0000000 +#define GNU_PROPERTY_UINT32_AND_HI 0xb0007fff + +/* A 4-byte unsigned integer property: A bit is set if it is set in any + relocatable inputs. */ +#define GNU_PROPERTY_UINT32_OR_LO 0xb0008000 +#define GNU_PROPERTY_UINT32_OR_HI 0xb000ffff + +/* The needed properties by the object file. */ +#define GNU_PROPERTY_1_NEEDED GNU_PROPERTY_UINT32_OR_LO + +/* Set if the object file requires canonical function pointers and + cannot be used with copy relocation. */ +#define GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS (1U << 0) + +/* Processor-specific semantics, lo */ +#define GNU_PROPERTY_LOPROC 0xc0000000 +/* Processor-specific semantics, hi */ +#define GNU_PROPERTY_HIPROC 0xdfffffff +/* Application-specific semantics, lo */ +#define GNU_PROPERTY_LOUSER 0xe0000000 +/* Application-specific semantics, hi */ +#define GNU_PROPERTY_HIUSER 0xffffffff + +/* AArch64 specific GNU properties. */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000 + +#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0) +#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1) + +/* The x86 instruction sets indicated by the corresponding bits are + used in program. Their support in the hardware is optional. */ +#define GNU_PROPERTY_X86_ISA_1_USED 0xc0010002 +/* The x86 instruction sets indicated by the corresponding bits are + used in program and they must be supported by the hardware. */ +#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0008002 +/* X86 processor-specific features used in program. */ +#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002 + +/* GNU_PROPERTY_X86_ISA_1_BASELINE: CMOV, CX8 (cmpxchg8b), FPU (fld), + MMX, OSFXSR (fxsave), SCE (syscall), SSE and SSE2. */ +#define GNU_PROPERTY_X86_ISA_1_BASELINE (1U << 0) +/* GNU_PROPERTY_X86_ISA_1_V2: GNU_PROPERTY_X86_ISA_1_BASELINE, + CMPXCHG16B (cmpxchg16b), LAHF-SAHF (lahf), POPCNT (popcnt), SSE3, + SSSE3, SSE4.1 and SSE4.2. */ +#define GNU_PROPERTY_X86_ISA_1_V2 (1U << 1) +/* GNU_PROPERTY_X86_ISA_1_V3: GNU_PROPERTY_X86_ISA_1_V2, AVX, AVX2, BMI1, + BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE. */ +#define GNU_PROPERTY_X86_ISA_1_V3 (1U << 2) +/* GNU_PROPERTY_X86_ISA_1_V4: GNU_PROPERTY_X86_ISA_1_V3, AVX512F, + AVX512BW, AVX512CD, AVX512DQ and AVX512VL. */ +#define GNU_PROPERTY_X86_ISA_1_V4 (1U << 3) + +/* This indicates that all executable sections are compatible with + IBT. */ +#define GNU_PROPERTY_X86_FEATURE_1_IBT (1U << 0) +/* This indicates that all executable sections are compatible with + SHSTK. */ +#define GNU_PROPERTY_X86_FEATURE_1_SHSTK (1U << 1) /* Move records. */ typedef struct @@ -1198,7 +1532,7 @@ typedef struct #define R_386_TLS_DTPMOD32 35 /* ID of module containing symbol */ #define R_386_TLS_DTPOFF32 36 /* Offset in TLS block */ #define R_386_TLS_TPOFF32 37 /* Negated offset in static TLS block */ -/* 38? */ +#define R_386_SIZE32 38 /* 32-bit symbol size */ #define R_386_TLS_GOTDESC 39 /* GOT offset for TLS descriptor. */ #define R_386_TLS_DESC_CALL 40 /* Marker of call through TLS descriptor for @@ -1208,8 +1542,10 @@ typedef struct argument, returning the TLS offset for the symbol. */ #define R_386_IRELATIVE 42 /* Adjust indirectly by program base */ +#define R_386_GOT32X 43 /* Load from 32 bit GOT entry, + relaxable. */ /* Keep this the last entry. */ -#define R_386_NUM 43 +#define R_386_NUM 44 /* SUN SPARC specific definitions. */ @@ -1334,102 +1670,107 @@ typedef struct /* For Sparc64, legal values for d_tag of Elf64_Dyn. */ -#define DT_SPARC_REGISTER 0x70000001 -#define DT_SPARC_NUM 2 +#define DT_SPARC_REGISTER 0x70000001 +#define DT_SPARC_NUM 2 /* MIPS R3000 specific definitions. */ /* Legal values for e_flags field of Elf32_Ehdr. */ -#define EF_MIPS_NOREORDER 1 /* A .noreorder directive was used */ -#define EF_MIPS_PIC 2 /* Contains PIC code */ -#define EF_MIPS_CPIC 4 /* Uses PIC calling sequence */ -#define EF_MIPS_XGOT 8 -#define EF_MIPS_64BIT_WHIRL 16 -#define EF_MIPS_ABI2 32 -#define EF_MIPS_ABI_ON32 64 -#define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level */ +#define EF_MIPS_NOREORDER 1 /* A .noreorder directive was used. */ +#define EF_MIPS_PIC 2 /* Contains PIC code. */ +#define EF_MIPS_CPIC 4 /* Uses PIC calling sequence. */ +#define EF_MIPS_XGOT 8 +#define EF_MIPS_64BIT_WHIRL 16 +#define EF_MIPS_ABI2 32 +#define EF_MIPS_ABI_ON32 64 +#define EF_MIPS_FP64 512 /* Uses FP64 (12 callee-saved). */ +#define EF_MIPS_NAN2008 1024 /* Uses IEEE 754-2008 NaN encoding. */ +#define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level. */ /* Legal values for MIPS architecture level. */ -#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ -#define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ -#define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ -#define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */ -#define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ -#define EF_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */ -#define EF_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */ +#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ +#define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ +#define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ +#define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */ +#define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ +#define EF_MIPS_ARCH_32 0x50000000 /* MIPS32 code. */ +#define EF_MIPS_ARCH_64 0x60000000 /* MIPS64 code. */ +#define EF_MIPS_ARCH_32R2 0x70000000 /* MIPS32r2 code. */ +#define EF_MIPS_ARCH_64R2 0x80000000 /* MIPS64r2 code. */ -/* The following are non-official names and should not be used. */ +/* The following are unofficial names and should not be used. */ -#define E_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ -#define E_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ -#define E_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ -#define E_MIPS_ARCH_4 0x30000000 /* -mips4 code. */ -#define E_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ -#define E_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */ -#define E_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */ +#define E_MIPS_ARCH_1 EF_MIPS_ARCH_1 +#define E_MIPS_ARCH_2 EF_MIPS_ARCH_2 +#define E_MIPS_ARCH_3 EF_MIPS_ARCH_3 +#define E_MIPS_ARCH_4 EF_MIPS_ARCH_4 +#define E_MIPS_ARCH_5 EF_MIPS_ARCH_5 +#define E_MIPS_ARCH_32 EF_MIPS_ARCH_32 +#define E_MIPS_ARCH_64 EF_MIPS_ARCH_64 /* Special section indices. */ -#define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols */ -#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */ -#define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */ -#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */ -#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */ +#define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols. */ +#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */ +#define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */ +#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols. */ +#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols. */ /* Legal values for sh_type field of Elf32_Shdr. */ -#define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link */ -#define SHT_MIPS_MSYM 0x70000001 -#define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols */ -#define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes */ -#define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */ -#define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging information*/ -#define SHT_MIPS_REGINFO 0x70000006 /* Register usage information */ -#define SHT_MIPS_PACKAGE 0x70000007 -#define SHT_MIPS_PACKSYM 0x70000008 -#define SHT_MIPS_RELD 0x70000009 -#define SHT_MIPS_IFACE 0x7000000b -#define SHT_MIPS_CONTENT 0x7000000c -#define SHT_MIPS_OPTIONS 0x7000000d /* Miscellaneous options. */ -#define SHT_MIPS_SHDR 0x70000010 -#define SHT_MIPS_FDESC 0x70000011 -#define SHT_MIPS_EXTSYM 0x70000012 -#define SHT_MIPS_DENSE 0x70000013 -#define SHT_MIPS_PDESC 0x70000014 -#define SHT_MIPS_LOCSYM 0x70000015 -#define SHT_MIPS_AUXSYM 0x70000016 -#define SHT_MIPS_OPTSYM 0x70000017 -#define SHT_MIPS_LOCSTR 0x70000018 -#define SHT_MIPS_LINE 0x70000019 -#define SHT_MIPS_RFDESC 0x7000001a -#define SHT_MIPS_DELTASYM 0x7000001b -#define SHT_MIPS_DELTAINST 0x7000001c -#define SHT_MIPS_DELTACLASS 0x7000001d -#define SHT_MIPS_DWARF 0x7000001e /* DWARF debugging information. */ -#define SHT_MIPS_DELTADECL 0x7000001f -#define SHT_MIPS_SYMBOL_LIB 0x70000020 -#define SHT_MIPS_EVENTS 0x70000021 /* Event section. */ -#define SHT_MIPS_TRANSLATE 0x70000022 -#define SHT_MIPS_PIXIE 0x70000023 -#define SHT_MIPS_XLATE 0x70000024 -#define SHT_MIPS_XLATE_DEBUG 0x70000025 -#define SHT_MIPS_WHIRL 0x70000026 -#define SHT_MIPS_EH_REGION 0x70000027 -#define SHT_MIPS_XLATE_OLD 0x70000028 -#define SHT_MIPS_PDR_EXCEPTION 0x70000029 +#define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link. */ +#define SHT_MIPS_MSYM 0x70000001 +#define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols. */ +#define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes. */ +#define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */ +#define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging info. */ +#define SHT_MIPS_REGINFO 0x70000006 /* Register usage information. */ +#define SHT_MIPS_PACKAGE 0x70000007 +#define SHT_MIPS_PACKSYM 0x70000008 +#define SHT_MIPS_RELD 0x70000009 +#define SHT_MIPS_IFACE 0x7000000b +#define SHT_MIPS_CONTENT 0x7000000c +#define SHT_MIPS_OPTIONS 0x7000000d /* Miscellaneous options. */ +#define SHT_MIPS_SHDR 0x70000010 +#define SHT_MIPS_FDESC 0x70000011 +#define SHT_MIPS_EXTSYM 0x70000012 +#define SHT_MIPS_DENSE 0x70000013 +#define SHT_MIPS_PDESC 0x70000014 +#define SHT_MIPS_LOCSYM 0x70000015 +#define SHT_MIPS_AUXSYM 0x70000016 +#define SHT_MIPS_OPTSYM 0x70000017 +#define SHT_MIPS_LOCSTR 0x70000018 +#define SHT_MIPS_LINE 0x70000019 +#define SHT_MIPS_RFDESC 0x7000001a +#define SHT_MIPS_DELTASYM 0x7000001b +#define SHT_MIPS_DELTAINST 0x7000001c +#define SHT_MIPS_DELTACLASS 0x7000001d +#define SHT_MIPS_DWARF 0x7000001e /* DWARF debugging information. */ +#define SHT_MIPS_DELTADECL 0x7000001f +#define SHT_MIPS_SYMBOL_LIB 0x70000020 +#define SHT_MIPS_EVENTS 0x70000021 /* Event section. */ +#define SHT_MIPS_TRANSLATE 0x70000022 +#define SHT_MIPS_PIXIE 0x70000023 +#define SHT_MIPS_XLATE 0x70000024 +#define SHT_MIPS_XLATE_DEBUG 0x70000025 +#define SHT_MIPS_WHIRL 0x70000026 +#define SHT_MIPS_EH_REGION 0x70000027 +#define SHT_MIPS_XLATE_OLD 0x70000028 +#define SHT_MIPS_PDR_EXCEPTION 0x70000029 +#define SHT_MIPS_XHASH 0x7000002b /* Legal values for sh_flags field of Elf32_Shdr. */ -#define SHF_MIPS_GPREL 0x10000000 /* Must be part of global data area */ -#define SHF_MIPS_MERGE 0x20000000 -#define SHF_MIPS_ADDR 0x40000000 -#define SHF_MIPS_STRINGS 0x80000000 -#define SHF_MIPS_NOSTRIP 0x08000000 -#define SHF_MIPS_LOCAL 0x04000000 -#define SHF_MIPS_NAMES 0x02000000 -#define SHF_MIPS_NODUPE 0x01000000 +#define SHF_MIPS_GPREL 0x10000000 /* Must be in global data area. */ +#define SHF_MIPS_MERGE 0x20000000 +#define SHF_MIPS_ADDR 0x40000000 +#define SHF_MIPS_STRINGS 0x80000000 +#define SHF_MIPS_NOSTRIP 0x08000000 +#define SHF_MIPS_LOCAL 0x04000000 +#define SHF_MIPS_NAMES 0x02000000 +#define SHF_MIPS_NODUPE 0x01000000 /* Symbol tables. */ @@ -1451,23 +1792,23 @@ typedef union { struct { - Elf32_Word gt_current_g_value; /* -G value used for compilation */ - Elf32_Word gt_unused; /* Not used */ - } gt_header; /* First entry in section */ + Elf32_Word gt_current_g_value; /* -G value used for compilation. */ + Elf32_Word gt_unused; /* Not used. */ + } gt_header; /* First entry in section. */ struct { - Elf32_Word gt_g_value; /* If this value were used for -G */ - Elf32_Word gt_bytes; /* This many bytes would be used */ - } gt_entry; /* Subsequent entries in section */ + Elf32_Word gt_g_value; /* If this value were used for -G. */ + Elf32_Word gt_bytes; /* This many bytes would be used. */ + } gt_entry; /* Subsequent entries in section. */ } Elf32_gptab; /* Entry found in sections of type SHT_MIPS_REGINFO. */ typedef struct { - Elf32_Word ri_gprmask; /* General registers used */ - Elf32_Word ri_cprmask[4]; /* Coprocessor registers used */ - Elf32_Sword ri_gp_value; /* $gp register value */ + Elf32_Word ri_gprmask; /* General registers used. */ + Elf32_Word ri_cprmask[4]; /* Coprocessor registers used. */ + Elf32_Sword ri_gp_value; /* $gp register value. */ } Elf32_RegInfo; /* Entries found in sections of type SHT_MIPS_OPTIONS. */ @@ -1593,9 +1934,10 @@ typedef struct /* Legal values for p_type field of Elf32_Phdr. */ -#define PT_MIPS_REGINFO 0x70000000 /* Register usage information */ -#define PT_MIPS_RTPROC 0x70000001 /* Runtime procedure table. */ -#define PT_MIPS_OPTIONS 0x70000002 +#define PT_MIPS_REGINFO 0x70000000 /* Register usage information. */ +#define PT_MIPS_RTPROC 0x70000001 /* Runtime procedure table. */ +#define PT_MIPS_OPTIONS 0x70000002 +#define PT_MIPS_ABIFLAGS 0x70000003 /* FP mode requirement. */ /* Special program header types. */ @@ -1661,7 +2003,13 @@ typedef struct PLT is writable. For a non-writable PLT, this is omitted or has a zero value. */ #define DT_MIPS_RWPLT 0x70000034 -#define DT_MIPS_NUM 0x35 +/* An alternative description of the classic MIPS RLD_MAP that is usable + in a PIE as it stores a relative offset from the address of the tag + rather than an absolute address. */ +#define DT_MIPS_RLD_MAP_REL 0x70000035 +/* GNU-style hash table with xlat. */ +#define DT_MIPS_XHASH 0x70000036 +#define DT_MIPS_NUM 0x37 /* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */ @@ -1717,6 +2065,101 @@ typedef struct typedef Elf32_Addr Elf32_Conflict; +typedef struct +{ + /* Version of flags structure. */ + Elf32_Half version; + /* The level of the ISA: 1-5, 32, 64. */ + unsigned char isa_level; + /* The revision of ISA: 0 for MIPS V and below, 1-n otherwise. */ + unsigned char isa_rev; + /* The size of general purpose registers. */ + unsigned char gpr_size; + /* The size of co-processor 1 registers. */ + unsigned char cpr1_size; + /* The size of co-processor 2 registers. */ + unsigned char cpr2_size; + /* The floating-point ABI. */ + unsigned char fp_abi; + /* Processor-specific extension. */ + Elf32_Word isa_ext; + /* Mask of ASEs used. */ + Elf32_Word ases; + /* Mask of general flags. */ + Elf32_Word flags1; + Elf32_Word flags2; +} Elf_MIPS_ABIFlags_v0; + +/* Values for the register size bytes of an abi flags structure. */ + +#define MIPS_AFL_REG_NONE 0x00 /* No registers. */ +#define MIPS_AFL_REG_32 0x01 /* 32-bit registers. */ +#define MIPS_AFL_REG_64 0x02 /* 64-bit registers. */ +#define MIPS_AFL_REG_128 0x03 /* 128-bit registers. */ + +/* Masks for the ases word of an ABI flags structure. */ + +#define MIPS_AFL_ASE_DSP 0x00000001 /* DSP ASE. */ +#define MIPS_AFL_ASE_DSPR2 0x00000002 /* DSP R2 ASE. */ +#define MIPS_AFL_ASE_EVA 0x00000004 /* Enhanced VA Scheme. */ +#define MIPS_AFL_ASE_MCU 0x00000008 /* MCU (MicroController) ASE. */ +#define MIPS_AFL_ASE_MDMX 0x00000010 /* MDMX ASE. */ +#define MIPS_AFL_ASE_MIPS3D 0x00000020 /* MIPS-3D ASE. */ +#define MIPS_AFL_ASE_MT 0x00000040 /* MT ASE. */ +#define MIPS_AFL_ASE_SMARTMIPS 0x00000080 /* SmartMIPS ASE. */ +#define MIPS_AFL_ASE_VIRT 0x00000100 /* VZ ASE. */ +#define MIPS_AFL_ASE_MSA 0x00000200 /* MSA ASE. */ +#define MIPS_AFL_ASE_MIPS16 0x00000400 /* MIPS16 ASE. */ +#define MIPS_AFL_ASE_MICROMIPS 0x00000800 /* MICROMIPS ASE. */ +#define MIPS_AFL_ASE_XPA 0x00001000 /* XPA ASE. */ +#define MIPS_AFL_ASE_MASK 0x00001fff /* All ASEs. */ + +/* Values for the isa_ext word of an ABI flags structure. */ + +#define MIPS_AFL_EXT_XLR 1 /* RMI Xlr instruction. */ +#define MIPS_AFL_EXT_OCTEON2 2 /* Cavium Networks Octeon2. */ +#define MIPS_AFL_EXT_OCTEONP 3 /* Cavium Networks OcteonP. */ +#define MIPS_AFL_EXT_LOONGSON_3A 4 /* Loongson 3A. */ +#define MIPS_AFL_EXT_OCTEON 5 /* Cavium Networks Octeon. */ +#define MIPS_AFL_EXT_5900 6 /* MIPS R5900 instruction. */ +#define MIPS_AFL_EXT_4650 7 /* MIPS R4650 instruction. */ +#define MIPS_AFL_EXT_4010 8 /* LSI R4010 instruction. */ +#define MIPS_AFL_EXT_4100 9 /* NEC VR4100 instruction. */ +#define MIPS_AFL_EXT_3900 10 /* Toshiba R3900 instruction. */ +#define MIPS_AFL_EXT_10000 11 /* MIPS R10000 instruction. */ +#define MIPS_AFL_EXT_SB1 12 /* Broadcom SB-1 instruction. */ +#define MIPS_AFL_EXT_4111 13 /* NEC VR4111/VR4181 instruction. */ +#define MIPS_AFL_EXT_4120 14 /* NEC VR4120 instruction. */ +#define MIPS_AFL_EXT_5400 15 /* NEC VR5400 instruction. */ +#define MIPS_AFL_EXT_5500 16 /* NEC VR5500 instruction. */ +#define MIPS_AFL_EXT_LOONGSON_2E 17 /* ST Microelectronics Loongson 2E. */ +#define MIPS_AFL_EXT_LOONGSON_2F 18 /* ST Microelectronics Loongson 2F. */ + +/* Masks for the flags1 word of an ABI flags structure. */ +#define MIPS_AFL_FLAGS1_ODDSPREG 1 /* Uses odd single-precision registers. */ + +/* Object attribute values. */ +enum +{ + /* Not tagged or not using any ABIs affected by the differences. */ + Val_GNU_MIPS_ABI_FP_ANY = 0, + /* Using hard-float -mdouble-float. */ + Val_GNU_MIPS_ABI_FP_DOUBLE = 1, + /* Using hard-float -msingle-float. */ + Val_GNU_MIPS_ABI_FP_SINGLE = 2, + /* Using soft-float. */ + Val_GNU_MIPS_ABI_FP_SOFT = 3, + /* Using -mips32r2 -mfp64. */ + Val_GNU_MIPS_ABI_FP_OLD_64 = 4, + /* Using -mfpxx. */ + Val_GNU_MIPS_ABI_FP_XX = 5, + /* Using -mips32r2 -mfp64. */ + Val_GNU_MIPS_ABI_FP_64 = 6, + /* Using -mips32r2 -mfp64 -mno-odd-spreg. */ + Val_GNU_MIPS_ABI_FP_64A = 7, + /* Maximum allocated FP ABI value. */ + Val_GNU_MIPS_ABI_FP_MAX = 7 +}; /* HPPA specific definitions. */ @@ -1737,9 +2180,9 @@ typedef Elf32_Addr Elf32_Conflict; #define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */ #define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */ -/* Additional section indeces. */ +/* Additional section indices. */ -#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared +#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tentatively declared symbols in ANSI C. */ #define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */ @@ -2058,6 +2501,8 @@ typedef Elf32_Addr Elf32_Conflict; #define R_PPC_GOT_DTPREL16_LO 92 /* half16* (sym+add)@got@dtprel@l */ #define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */ #define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */ +#define R_PPC_TLSGD 95 /* none (sym+add)@tlsgd */ +#define R_PPC_TLSLD 96 /* none (sym+add)@tlsld */ /* The remaining relocs are from the Embedded ELF ABI, and are not in the SVR4 ELF ABI. */ @@ -2101,7 +2546,11 @@ typedef Elf32_Addr Elf32_Conflict; /* PowerPC specific values for the Dyn d_tag field. */ #define DT_PPC_GOT (DT_LOPROC + 0) -#define DT_PPC_NUM 1 +#define DT_PPC_OPT (DT_LOPROC + 1) +#define DT_PPC_NUM 2 + +/* PowerPC specific values for the DT_PPC_OPT Dyn entry. */ +#define PPC_OPT_TLS 1 /* PowerPC64 relocations defined by the ABIs */ #define R_PPC64_NONE R_PPC_NONE @@ -2214,6 +2663,17 @@ typedef Elf32_Addr Elf32_Conflict; #define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */ #define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */ #define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */ +#define R_PPC64_TLSGD 107 /* none (sym+add)@tlsgd */ +#define R_PPC64_TLSLD 108 /* none (sym+add)@tlsld */ +#define R_PPC64_TOCSAVE 109 /* none */ + +/* Added when HA and HI relocs were changed to report overflows. */ +#define R_PPC64_ADDR16_HIGH 110 +#define R_PPC64_ADDR16_HIGHA 111 +#define R_PPC64_TPREL16_HIGH 112 +#define R_PPC64_TPREL16_HIGHA 113 +#define R_PPC64_DTPREL16_HIGH 114 +#define R_PPC64_DTPREL16_HIGHA 115 /* GNU extension to support local ifunc. */ #define R_PPC64_JMP_IREL 247 @@ -2223,11 +2683,29 @@ typedef Elf32_Addr Elf32_Conflict; #define R_PPC64_REL16_HI 251 /* half16 (sym+add-.)@h */ #define R_PPC64_REL16_HA 252 /* half16 (sym+add-.)@ha */ +/* e_flags bits specifying ABI. + 1 for original function descriptor using ABI, + 2 for revised ABI without function descriptors, + 0 for unspecified or not using any features affected by the differences. */ +#define EF_PPC64_ABI 3 + /* PowerPC64 specific values for the Dyn d_tag field. */ #define DT_PPC64_GLINK (DT_LOPROC + 0) #define DT_PPC64_OPD (DT_LOPROC + 1) #define DT_PPC64_OPDSZ (DT_LOPROC + 2) -#define DT_PPC64_NUM 3 +#define DT_PPC64_OPT (DT_LOPROC + 3) +#define DT_PPC64_NUM 4 + +/* PowerPC64 specific bits in the DT_PPC64_OPT Dyn entry. */ +#define PPC64_OPT_TLS 1 +#define PPC64_OPT_MULTI_TOC 2 +#define PPC64_OPT_LOCALENTRY 4 + +/* PowerPC64 specific values for the Elf64_Sym st_other field. */ +#define STO_PPC64_LOCAL_BIT 5 +#define STO_PPC64_LOCAL_MASK (7 << STO_PPC64_LOCAL_BIT) +#define PPC64_LOCAL_ENTRY_OFFSET(other) \ + (((1 << (((other) & STO_PPC64_LOCAL_MASK) >> STO_PPC64_LOCAL_BIT)) >> 2) << 2) /* ARM specific declarations */ @@ -2246,6 +2724,9 @@ typedef Elf32_Addr Elf32_Conflict; #define EF_ARM_VFP_FLOAT 0x400 #define EF_ARM_MAVERICK_FLOAT 0x800 +#define EF_ARM_ABI_FLOAT_SOFT 0x200 /* NB conflicts with EF_ARM_SOFT_FLOAT */ +#define EF_ARM_ABI_FLOAT_HARD 0x400 /* NB conflicts with EF_ARM_VFP_FLOAT */ + /* Other constants defined in the ARM ELF spec. version B-01. */ /* NB. These conflict with values defined above. */ @@ -2290,26 +2771,180 @@ typedef Elf32_Addr Elf32_Conflict; #define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) /* ARM attributes section. */ +/* AArch64 relocs. */ + +#define R_AARCH64_NONE 0 /* No relocation. */ + +/* ILP32 AArch64 relocs. */ +#define R_AARCH64_P32_ABS32 1 /* Direct 32 bit. */ +#define R_AARCH64_P32_COPY 180 /* Copy symbol at runtime. */ +#define R_AARCH64_P32_GLOB_DAT 181 /* Create GOT entry. */ +#define R_AARCH64_P32_JUMP_SLOT 182 /* Create PLT entry. */ +#define R_AARCH64_P32_RELATIVE 183 /* Adjust by program base. */ +#define R_AARCH64_P32_TLS_DTPMOD 184 /* Module number, 32 bit. */ +#define R_AARCH64_P32_TLS_DTPREL 185 /* Module-relative offset, 32 bit. */ +#define R_AARCH64_P32_TLS_TPREL 186 /* TP-relative offset, 32 bit. */ +#define R_AARCH64_P32_TLSDESC 187 /* TLS Descriptor. */ +#define R_AARCH64_P32_IRELATIVE 188 /* STT_GNU_IFUNC relocation. */ + +/* LP64 AArch64 relocs. */ +#define R_AARCH64_ABS64 257 /* Direct 64 bit. */ +#define R_AARCH64_ABS32 258 /* Direct 32 bit. */ +#define R_AARCH64_ABS16 259 /* Direct 16-bit. */ +#define R_AARCH64_PREL64 260 /* PC-relative 64-bit. */ +#define R_AARCH64_PREL32 261 /* PC-relative 32-bit. */ +#define R_AARCH64_PREL16 262 /* PC-relative 16-bit. */ +#define R_AARCH64_MOVW_UABS_G0 263 /* Dir. MOVZ imm. from bits 15:0. */ +#define R_AARCH64_MOVW_UABS_G0_NC 264 /* Likewise for MOVK; no check. */ +#define R_AARCH64_MOVW_UABS_G1 265 /* Dir. MOVZ imm. from bits 31:16. */ +#define R_AARCH64_MOVW_UABS_G1_NC 266 /* Likewise for MOVK; no check. */ +#define R_AARCH64_MOVW_UABS_G2 267 /* Dir. MOVZ imm. from bits 47:32. */ +#define R_AARCH64_MOVW_UABS_G2_NC 268 /* Likewise for MOVK; no check. */ +#define R_AARCH64_MOVW_UABS_G3 269 /* Dir. MOV{K,Z} imm. from 63:48. */ +#define R_AARCH64_MOVW_SABS_G0 270 /* Dir. MOV{N,Z} imm. from 15:0. */ +#define R_AARCH64_MOVW_SABS_G1 271 /* Dir. MOV{N,Z} imm. from 31:16. */ +#define R_AARCH64_MOVW_SABS_G2 272 /* Dir. MOV{N,Z} imm. from 47:32. */ +#define R_AARCH64_LD_PREL_LO19 273 /* PC-rel. LD imm. from bits 20:2. */ +#define R_AARCH64_ADR_PREL_LO21 274 /* PC-rel. ADR imm. from bits 20:0. */ +#define R_AARCH64_ADR_PREL_PG_HI21 275 /* Page-rel. ADRP imm. from 32:12. */ +#define R_AARCH64_ADR_PREL_PG_HI21_NC 276 /* Likewise; no overflow check. */ +#define R_AARCH64_ADD_ABS_LO12_NC 277 /* Dir. ADD imm. from bits 11:0. */ +#define R_AARCH64_LDST8_ABS_LO12_NC 278 /* Likewise for LD/ST; no check. */ +#define R_AARCH64_TSTBR14 279 /* PC-rel. TBZ/TBNZ imm. from 15:2. */ +#define R_AARCH64_CONDBR19 280 /* PC-rel. cond. br. imm. from 20:2. */ +#define R_AARCH64_JUMP26 282 /* PC-rel. B imm. from bits 27:2. */ +#define R_AARCH64_CALL26 283 /* Likewise for CALL. */ +#define R_AARCH64_LDST16_ABS_LO12_NC 284 /* Dir. ADD imm. from bits 11:1. */ +#define R_AARCH64_LDST32_ABS_LO12_NC 285 /* Likewise for bits 11:2. */ +#define R_AARCH64_LDST64_ABS_LO12_NC 286 /* Likewise for bits 11:3. */ +#define R_AARCH64_MOVW_PREL_G0 287 /* PC-rel. MOV{N,Z} imm. from 15:0. */ +#define R_AARCH64_MOVW_PREL_G0_NC 288 /* Likewise for MOVK; no check. */ +#define R_AARCH64_MOVW_PREL_G1 289 /* PC-rel. MOV{N,Z} imm. from 31:16. */ +#define R_AARCH64_MOVW_PREL_G1_NC 290 /* Likewise for MOVK; no check. */ +#define R_AARCH64_MOVW_PREL_G2 291 /* PC-rel. MOV{N,Z} imm. from 47:32. */ +#define R_AARCH64_MOVW_PREL_G2_NC 292 /* Likewise for MOVK; no check. */ +#define R_AARCH64_MOVW_PREL_G3 293 /* PC-rel. MOV{N,Z} imm. from 63:48. */ +#define R_AARCH64_LDST128_ABS_LO12_NC 299 /* Dir. ADD imm. from bits 11:4. */ +#define R_AARCH64_MOVW_GOTOFF_G0 300 /* GOT-rel. off. MOV{N,Z} imm. 15:0. */ +#define R_AARCH64_MOVW_GOTOFF_G0_NC 301 /* Likewise for MOVK; no check. */ +#define R_AARCH64_MOVW_GOTOFF_G1 302 /* GOT-rel. o. MOV{N,Z} imm. 31:16. */ +#define R_AARCH64_MOVW_GOTOFF_G1_NC 303 /* Likewise for MOVK; no check. */ +#define R_AARCH64_MOVW_GOTOFF_G2 304 /* GOT-rel. o. MOV{N,Z} imm. 47:32. */ +#define R_AARCH64_MOVW_GOTOFF_G2_NC 305 /* Likewise for MOVK; no check. */ +#define R_AARCH64_MOVW_GOTOFF_G3 306 /* GOT-rel. o. MOV{N,Z} imm. 63:48. */ +#define R_AARCH64_GOTREL64 307 /* GOT-relative 64-bit. */ +#define R_AARCH64_GOTREL32 308 /* GOT-relative 32-bit. */ +#define R_AARCH64_GOT_LD_PREL19 309 /* PC-rel. GOT off. load imm. 20:2. */ +#define R_AARCH64_LD64_GOTOFF_LO15 310 /* GOT-rel. off. LD/ST imm. 14:3. */ +#define R_AARCH64_ADR_GOT_PAGE 311 /* P-page-rel. GOT off. ADRP 32:12. */ +#define R_AARCH64_LD64_GOT_LO12_NC 312 /* Dir. GOT off. LD/ST imm. 11:3. */ +#define R_AARCH64_LD64_GOTPAGE_LO15 313 /* GOT-page-rel. GOT off. LD/ST 14:3 */ +#define R_AARCH64_TLSGD_ADR_PREL21 512 /* PC-relative ADR imm. 20:0. */ +#define R_AARCH64_TLSGD_ADR_PAGE21 513 /* page-rel. ADRP imm. 32:12. */ +#define R_AARCH64_TLSGD_ADD_LO12_NC 514 /* direct ADD imm. from 11:0. */ +#define R_AARCH64_TLSGD_MOVW_G1 515 /* GOT-rel. MOV{N,Z} 31:16. */ +#define R_AARCH64_TLSGD_MOVW_G0_NC 516 /* GOT-rel. MOVK imm. 15:0. */ +#define R_AARCH64_TLSLD_ADR_PREL21 517 /* Like 512; local dynamic model. */ +#define R_AARCH64_TLSLD_ADR_PAGE21 518 /* Like 513; local dynamic model. */ +#define R_AARCH64_TLSLD_ADD_LO12_NC 519 /* Like 514; local dynamic model. */ +#define R_AARCH64_TLSLD_MOVW_G1 520 /* Like 515; local dynamic model. */ +#define R_AARCH64_TLSLD_MOVW_G0_NC 521 /* Like 516; local dynamic model. */ +#define R_AARCH64_TLSLD_LD_PREL19 522 /* TLS PC-rel. load imm. 20:2. */ +#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523 /* TLS DTP-rel. MOV{N,Z} 47:32. */ +#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524 /* TLS DTP-rel. MOV{N,Z} 31:16. */ +#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525 /* Likewise; MOVK; no check. */ +#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526 /* TLS DTP-rel. MOV{N,Z} 15:0. */ +#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527 /* Likewise; MOVK; no check. */ +#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528 /* DTP-rel. ADD imm. from 23:12. */ +#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529 /* DTP-rel. ADD imm. from 11:0. */ +#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530 /* Likewise; no ovfl. check. */ +#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531 /* DTP-rel. LD/ST imm. 11:0. */ +#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532 /* Likewise; no check. */ +#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533 /* DTP-rel. LD/ST imm. 11:1. */ +#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534 /* Likewise; no check. */ +#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535 /* DTP-rel. LD/ST imm. 11:2. */ +#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536 /* Likewise; no check. */ +#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537 /* DTP-rel. LD/ST imm. 11:3. */ +#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538 /* Likewise; no check. */ +#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539 /* GOT-rel. MOV{N,Z} 31:16. */ +#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540 /* GOT-rel. MOVK 15:0. */ +#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541 /* Page-rel. ADRP 32:12. */ +#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542 /* Direct LD off. 11:3. */ +#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543 /* PC-rel. load imm. 20:2. */ +#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544 /* TLS TP-rel. MOV{N,Z} 47:32. */ +#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545 /* TLS TP-rel. MOV{N,Z} 31:16. */ +#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546 /* Likewise; MOVK; no check. */ +#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547 /* TLS TP-rel. MOV{N,Z} 15:0. */ +#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548 /* Likewise; MOVK; no check. */ +#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549 /* TP-rel. ADD imm. 23:12. */ +#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550 /* TP-rel. ADD imm. 11:0. */ +#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551 /* Likewise; no ovfl. check. */ +#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552 /* TP-rel. LD/ST off. 11:0. */ +#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553 /* Likewise; no ovfl. check. */ +#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554 /* TP-rel. LD/ST off. 11:1. */ +#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555 /* Likewise; no check. */ +#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556 /* TP-rel. LD/ST off. 11:2. */ +#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557 /* Likewise; no check. */ +#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558 /* TP-rel. LD/ST off. 11:3. */ +#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559 /* Likewise; no check. */ +#define R_AARCH64_TLSDESC_LD_PREL19 560 /* PC-rel. load immediate 20:2. */ +#define R_AARCH64_TLSDESC_ADR_PREL21 561 /* PC-rel. ADR immediate 20:0. */ +#define R_AARCH64_TLSDESC_ADR_PAGE21 562 /* Page-rel. ADRP imm. 32:12. */ +#define R_AARCH64_TLSDESC_LD64_LO12 563 /* Direct LD off. from 11:3. */ +#define R_AARCH64_TLSDESC_ADD_LO12 564 /* Direct ADD imm. from 11:0. */ +#define R_AARCH64_TLSDESC_OFF_G1 565 /* GOT-rel. MOV{N,Z} imm. 31:16. */ +#define R_AARCH64_TLSDESC_OFF_G0_NC 566 /* GOT-rel. MOVK imm. 15:0; no ck. */ +#define R_AARCH64_TLSDESC_LDR 567 /* Relax LDR. */ +#define R_AARCH64_TLSDESC_ADD 568 /* Relax ADD. */ +#define R_AARCH64_TLSDESC_CALL 569 /* Relax BLR. */ +#define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570 /* TP-rel. LD/ST off. 11:4. */ +#define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571 /* Likewise; no check. */ +#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572 /* DTP-rel. LD/ST imm. 11:4. */ +#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573 /* Likewise; no check. */ +#define R_AARCH64_COPY 1024 /* Copy symbol at runtime. */ +#define R_AARCH64_GLOB_DAT 1025 /* Create GOT entry. */ +#define R_AARCH64_JUMP_SLOT 1026 /* Create PLT entry. */ +#define R_AARCH64_RELATIVE 1027 /* Adjust by program base. */ +#define R_AARCH64_TLS_DTPMOD 1028 /* Module number, 64 bit. */ +#define R_AARCH64_TLS_DTPREL 1029 /* Module-relative offset, 64 bit. */ +#define R_AARCH64_TLS_TPREL 1030 /* TP-relative offset, 64 bit. */ +#define R_AARCH64_TLSDESC 1031 /* TLS Descriptor. */ +#define R_AARCH64_IRELATIVE 1032 /* STT_GNU_IFUNC relocation. */ + +/* MTE memory tag segment type. */ +#define PT_AARCH64_MEMTAG_MTE (PT_LOPROC + 2) + +/* AArch64 specific values for the Dyn d_tag field. */ +#define DT_AARCH64_BTI_PLT (DT_LOPROC + 1) +#define DT_AARCH64_PAC_PLT (DT_LOPROC + 3) +#define DT_AARCH64_VARIANT_PCS (DT_LOPROC + 5) +#define DT_AARCH64_NUM 6 + +/* AArch64 specific values for the st_other field. */ +#define STO_AARCH64_VARIANT_PCS 0x80 + /* ARM relocs. */ #define R_ARM_NONE 0 /* No reloc */ -#define R_ARM_PC24 1 /* PC relative 26 bit branch */ +#define R_ARM_PC24 1 /* Deprecated PC relative 26 + bit branch. */ #define R_ARM_ABS32 2 /* Direct 32 bit */ #define R_ARM_REL32 3 /* PC relative 32 bit */ #define R_ARM_PC13 4 #define R_ARM_ABS16 5 /* Direct 16 bit */ #define R_ARM_ABS12 6 /* Direct 12 bit */ -#define R_ARM_THM_ABS5 7 +#define R_ARM_THM_ABS5 7 /* Direct & 0x7C (LDR, STR). */ #define R_ARM_ABS8 8 /* Direct 8 bit */ #define R_ARM_SBREL32 9 -#define R_ARM_THM_PC22 10 -#define R_ARM_THM_PC8 11 +#define R_ARM_THM_PC22 10 /* PC relative 24 bit (Thumb32 BL). */ +#define R_ARM_THM_PC8 11 /* PC relative & 0x3FC + (Thumb16 LDR, ADD, ADR). */ #define R_ARM_AMP_VCALL9 12 #define R_ARM_SWI24 13 /* Obsolete static relocation. */ #define R_ARM_TLS_DESC 13 /* Dynamic relocation. */ -#define R_ARM_THM_SWI8 14 -#define R_ARM_XPC25 15 -#define R_ARM_THM_XPC22 16 +#define R_ARM_THM_SWI8 14 /* Reserved. */ +#define R_ARM_XPC25 15 /* Reserved. */ +#define R_ARM_THM_XPC22 16 /* Reserved. */ #define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */ #define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */ #define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */ @@ -2320,21 +2955,109 @@ typedef Elf32_Addr Elf32_Conflict; #define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */ #define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */ #define R_ARM_GOT32 26 /* 32 bit GOT entry */ -#define R_ARM_PLT32 27 /* 32 bit PLT address */ -#define R_ARM_ALU_PCREL_7_0 32 -#define R_ARM_ALU_PCREL_15_8 33 -#define R_ARM_ALU_PCREL_23_15 34 -#define R_ARM_LDR_SBREL_11_0 35 -#define R_ARM_ALU_SBREL_19_12 36 -#define R_ARM_ALU_SBREL_27_20 37 +#define R_ARM_PLT32 27 /* Deprecated, 32 bit PLT address. */ +#define R_ARM_CALL 28 /* PC relative 24 bit (BL, BLX). */ +#define R_ARM_JUMP24 29 /* PC relative 24 bit + (B, BL). */ +#define R_ARM_THM_JUMP24 30 /* PC relative 24 bit (Thumb32 B.W). */ +#define R_ARM_BASE_ABS 31 /* Adjust by program base. */ +#define R_ARM_ALU_PCREL_7_0 32 /* Obsolete. */ +#define R_ARM_ALU_PCREL_15_8 33 /* Obsolete. */ +#define R_ARM_ALU_PCREL_23_15 34 /* Obsolete. */ +#define R_ARM_LDR_SBREL_11_0 35 /* Deprecated, prog. base relative. */ +#define R_ARM_ALU_SBREL_19_12 36 /* Deprecated, prog. base relative. */ +#define R_ARM_ALU_SBREL_27_20 37 /* Deprecated, prog. base relative. */ +#define R_ARM_TARGET1 38 +#define R_ARM_SBREL31 39 /* Program base relative. */ +#define R_ARM_V4BX 40 +#define R_ARM_TARGET2 41 +#define R_ARM_PREL31 42 /* 32 bit PC relative. */ +#define R_ARM_MOVW_ABS_NC 43 /* Direct 16-bit (MOVW). */ +#define R_ARM_MOVT_ABS 44 /* Direct high 16-bit (MOVT). */ +#define R_ARM_MOVW_PREL_NC 45 /* PC relative 16-bit (MOVW). */ +#define R_ARM_MOVT_PREL 46 /* PC relative (MOVT). */ +#define R_ARM_THM_MOVW_ABS_NC 47 /* Direct 16 bit (Thumb32 MOVW). */ +#define R_ARM_THM_MOVT_ABS 48 /* Direct high 16 bit + (Thumb32 MOVT). */ +#define R_ARM_THM_MOVW_PREL_NC 49 /* PC relative 16 bit + (Thumb32 MOVW). */ +#define R_ARM_THM_MOVT_PREL 50 /* PC relative high 16 bit + (Thumb32 MOVT). */ +#define R_ARM_THM_JUMP19 51 /* PC relative 20 bit + (Thumb32 B.W). */ +#define R_ARM_THM_JUMP6 52 /* PC relative X & 0x7E + (Thumb16 CBZ, CBNZ). */ +#define R_ARM_THM_ALU_PREL_11_0 53 /* PC relative 12 bit + (Thumb32 ADR.W). */ +#define R_ARM_THM_PC12 54 /* PC relative 12 bit + (Thumb32 LDR{D,SB,H,SH}). */ +#define R_ARM_ABS32_NOI 55 /* Direct 32-bit. */ +#define R_ARM_REL32_NOI 56 /* PC relative 32-bit. */ +#define R_ARM_ALU_PC_G0_NC 57 /* PC relative (ADD, SUB). */ +#define R_ARM_ALU_PC_G0 58 /* PC relative (ADD, SUB). */ +#define R_ARM_ALU_PC_G1_NC 59 /* PC relative (ADD, SUB). */ +#define R_ARM_ALU_PC_G1 60 /* PC relative (ADD, SUB). */ +#define R_ARM_ALU_PC_G2 61 /* PC relative (ADD, SUB). */ +#define R_ARM_LDR_PC_G1 62 /* PC relative (LDR,STR,LDRB,STRB). */ +#define R_ARM_LDR_PC_G2 63 /* PC relative (LDR,STR,LDRB,STRB). */ +#define R_ARM_LDRS_PC_G0 64 /* PC relative (STR{D,H}, + LDR{D,SB,H,SH}). */ +#define R_ARM_LDRS_PC_G1 65 /* PC relative (STR{D,H}, + LDR{D,SB,H,SH}). */ +#define R_ARM_LDRS_PC_G2 66 /* PC relative (STR{D,H}, + LDR{D,SB,H,SH}). */ +#define R_ARM_LDC_PC_G0 67 /* PC relative (LDC, STC). */ +#define R_ARM_LDC_PC_G1 68 /* PC relative (LDC, STC). */ +#define R_ARM_LDC_PC_G2 69 /* PC relative (LDC, STC). */ +#define R_ARM_ALU_SB_G0_NC 70 /* Program base relative (ADD,SUB). */ +#define R_ARM_ALU_SB_G0 71 /* Program base relative (ADD,SUB). */ +#define R_ARM_ALU_SB_G1_NC 72 /* Program base relative (ADD,SUB). */ +#define R_ARM_ALU_SB_G1 73 /* Program base relative (ADD,SUB). */ +#define R_ARM_ALU_SB_G2 74 /* Program base relative (ADD,SUB). */ +#define R_ARM_LDR_SB_G0 75 /* Program base relative (LDR, + STR, LDRB, STRB). */ +#define R_ARM_LDR_SB_G1 76 /* Program base relative + (LDR, STR, LDRB, STRB). */ +#define R_ARM_LDR_SB_G2 77 /* Program base relative + (LDR, STR, LDRB, STRB). */ +#define R_ARM_LDRS_SB_G0 78 /* Program base relative + (LDR, STR, LDRB, STRB). */ +#define R_ARM_LDRS_SB_G1 79 /* Program base relative + (LDR, STR, LDRB, STRB). */ +#define R_ARM_LDRS_SB_G2 80 /* Program base relative + (LDR, STR, LDRB, STRB). */ +#define R_ARM_LDC_SB_G0 81 /* Program base relative (LDC,STC). */ +#define R_ARM_LDC_SB_G1 82 /* Program base relative (LDC,STC). */ +#define R_ARM_LDC_SB_G2 83 /* Program base relative (LDC,STC). */ +#define R_ARM_MOVW_BREL_NC 84 /* Program base relative 16 + bit (MOVW). */ +#define R_ARM_MOVT_BREL 85 /* Program base relative high + 16 bit (MOVT). */ +#define R_ARM_MOVW_BREL 86 /* Program base relative 16 + bit (MOVW). */ +#define R_ARM_THM_MOVW_BREL_NC 87 /* Program base relative 16 + bit (Thumb32 MOVW). */ +#define R_ARM_THM_MOVT_BREL 88 /* Program base relative high + 16 bit (Thumb32 MOVT). */ +#define R_ARM_THM_MOVW_BREL 89 /* Program base relative 16 + bit (Thumb32 MOVW). */ #define R_ARM_TLS_GOTDESC 90 #define R_ARM_TLS_CALL 91 -#define R_ARM_TLS_DESCSEQ 92 +#define R_ARM_TLS_DESCSEQ 92 /* TLS relaxation. */ #define R_ARM_THM_TLS_CALL 93 +#define R_ARM_PLT32_ABS 94 +#define R_ARM_GOT_ABS 95 /* GOT entry. */ +#define R_ARM_GOT_PREL 96 /* PC relative GOT entry. */ +#define R_ARM_GOT_BREL12 97 /* GOT entry relative to GOT + origin (LDR). */ +#define R_ARM_GOTOFF12 98 /* 12 bit, GOT entry relative + to GOT origin (LDR, STR). */ +#define R_ARM_GOTRELAX 99 #define R_ARM_GNU_VTENTRY 100 #define R_ARM_GNU_VTINHERIT 101 -#define R_ARM_THM_PC11 102 /* thumb unconditional branch */ -#define R_ARM_THM_PC9 103 /* thumb conditional branch */ +#define R_ARM_THM_PC11 102 /* PC relative & 0xFFE (Thumb16 B). */ +#define R_ARM_THM_PC9 103 /* PC relative & 0x1FE + (Thumb16 B/B). */ #define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic thread local data */ #define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic @@ -2345,7 +3068,18 @@ typedef Elf32_Addr Elf32_Conflict; static TLS block offset */ #define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static TLS block */ -#define R_ARM_THM_TLS_DESCSEQ 129 +#define R_ARM_TLS_LDO12 109 /* 12 bit relative to TLS + block (LDR, STR). */ +#define R_ARM_TLS_LE12 110 /* 12 bit relative to static + TLS block (LDR, STR). */ +#define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative + to GOT origin (LDR). */ +#define R_ARM_ME_TOO 128 /* Obsolete. */ +#define R_ARM_THM_TLS_DESCSEQ 129 +#define R_ARM_THM_TLS_DESCSEQ16 129 +#define R_ARM_THM_TLS_DESCSEQ32 130 +#define R_ARM_THM_GOT_BREL12 131 /* GOT entry relative to GOT + origin, 12 bit (Thumb32 LDR). */ #define R_ARM_IRELATIVE 160 #define R_ARM_RXPC25 249 #define R_ARM_RSBREL32 250 @@ -2357,6 +3091,81 @@ typedef Elf32_Addr Elf32_Conflict; /* Keep this the last entry. */ #define R_ARM_NUM 256 +/* C-SKY */ +#define R_CKCORE_NONE 0 /* no reloc */ +#define R_CKCORE_ADDR32 1 /* direct 32 bit (S + A) */ +#define R_CKCORE_PCRELIMM8BY4 2 /* disp ((S + A - P) >> 2) & 0xff */ +#define R_CKCORE_PCRELIMM11BY2 3 /* disp ((S + A - P) >> 1) & 0x7ff */ +#define R_CKCORE_PCREL32 5 /* 32-bit rel (S + A - P) */ +#define R_CKCORE_PCRELJSR_IMM11BY2 6 /* disp ((S + A - P) >>1) & 0x7ff */ +#define R_CKCORE_RELATIVE 9 /* 32 bit adjust program base(B + A)*/ +#define R_CKCORE_COPY 10 /* 32 bit adjust by program base */ +#define R_CKCORE_GLOB_DAT 11 /* off between got and sym (S) */ +#define R_CKCORE_JUMP_SLOT 12 /* PLT entry (S) */ +#define R_CKCORE_GOTOFF 13 /* offset to GOT (S + A - GOT) */ +#define R_CKCORE_GOTPC 14 /* PC offset to GOT (GOT + A - P) */ +#define R_CKCORE_GOT32 15 /* 32 bit GOT entry (G) */ +#define R_CKCORE_PLT32 16 /* 32 bit PLT entry (G) */ +#define R_CKCORE_ADDRGOT 17 /* GOT entry in GLOB_DAT (GOT + G) */ +#define R_CKCORE_ADDRPLT 18 /* PLT entry in GLOB_DAT (GOT + G) */ +#define R_CKCORE_PCREL_IMM26BY2 19 /* ((S + A - P) >> 1) & 0x3ffffff */ +#define R_CKCORE_PCREL_IMM16BY2 20 /* disp ((S + A - P) >> 1) & 0xffff */ +#define R_CKCORE_PCREL_IMM16BY4 21 /* disp ((S + A - P) >> 2) & 0xffff */ +#define R_CKCORE_PCREL_IMM10BY2 22 /* disp ((S + A - P) >> 1) & 0x3ff */ +#define R_CKCORE_PCREL_IMM10BY4 23 /* disp ((S + A - P) >> 2) & 0x3ff */ +#define R_CKCORE_ADDR_HI16 24 /* high & low 16 bit ADDR */ + /* ((S + A) >> 16) & 0xffff */ +#define R_CKCORE_ADDR_LO16 25 /* (S + A) & 0xffff */ +#define R_CKCORE_GOTPC_HI16 26 /* high & low 16 bit GOTPC */ + /* ((GOT + A - P) >> 16) & 0xffff */ +#define R_CKCORE_GOTPC_LO16 27 /* (GOT + A - P) & 0xffff */ +#define R_CKCORE_GOTOFF_HI16 28 /* high & low 16 bit GOTOFF */ + /* ((S + A - GOT) >> 16) & 0xffff */ +#define R_CKCORE_GOTOFF_LO16 29 /* (S + A - GOT) & 0xffff */ +#define R_CKCORE_GOT12 30 /* 12 bit disp GOT entry (G) */ +#define R_CKCORE_GOT_HI16 31 /* high & low 16 bit GOT */ + /* (G >> 16) & 0xffff */ +#define R_CKCORE_GOT_LO16 32 /* (G & 0xffff) */ +#define R_CKCORE_PLT12 33 /* 12 bit disp PLT entry (G) */ +#define R_CKCORE_PLT_HI16 34 /* high & low 16 bit PLT */ + /* (G >> 16) & 0xffff */ +#define R_CKCORE_PLT_LO16 35 /* G & 0xffff */ +#define R_CKCORE_ADDRGOT_HI16 36 /* high & low 16 bit ADDRGOT */ + /* (GOT + G * 4) & 0xffff */ +#define R_CKCORE_ADDRGOT_LO16 37 /* (GOT + G * 4) & 0xffff */ +#define R_CKCORE_ADDRPLT_HI16 38 /* high & low 16 bit ADDRPLT */ + /* ((GOT + G * 4) >> 16) & 0xFFFF */ +#define R_CKCORE_ADDRPLT_LO16 39 /* (GOT+G*4) & 0xffff */ +#define R_CKCORE_PCREL_JSR_IMM26BY2 40 /* disp ((S+A-P) >>1) & x3ffffff */ +#define R_CKCORE_TOFFSET_LO16 41 /* (S+A-BTEXT) & 0xffff */ +#define R_CKCORE_DOFFSET_LO16 42 /* (S+A-BTEXT) & 0xffff */ +#define R_CKCORE_PCREL_IMM18BY2 43 /* disp ((S+A-P) >>1) & 0x3ffff */ +#define R_CKCORE_DOFFSET_IMM18 44 /* disp (S+A-BDATA) & 0x3ffff */ +#define R_CKCORE_DOFFSET_IMM18BY2 45 /* disp ((S+A-BDATA)>>1) & 0x3ffff */ +#define R_CKCORE_DOFFSET_IMM18BY4 46 /* disp ((S+A-BDATA)>>2) & 0x3ffff */ +#define R_CKCORE_GOT_IMM18BY4 48 /* disp (G >> 2) */ +#define R_CKCORE_PLT_IMM18BY4 49 /* disp (G >> 2) */ +#define R_CKCORE_PCREL_IMM7BY4 50 /* disp ((S+A-P) >>2) & 0x7f */ +#define R_CKCORE_TLS_LE32 51 /* 32 bit offset to TLS block */ +#define R_CKCORE_TLS_IE32 52 +#define R_CKCORE_TLS_GD32 53 +#define R_CKCORE_TLS_LDM32 54 +#define R_CKCORE_TLS_LDO32 55 +#define R_CKCORE_TLS_DTPMOD32 56 +#define R_CKCORE_TLS_DTPOFF32 57 +#define R_CKCORE_TLS_TPOFF32 58 + +/* C-SKY elf header definition. */ +#define EF_CSKY_ABIMASK 0XF0000000 +#define EF_CSKY_OTHER 0X0FFF0000 +#define EF_CSKY_PROCESSOR 0X0000FFFF + +#define EF_CSKY_ABIV1 0X10000000 +#define EF_CSKY_ABIV2 0X20000000 + +/* C-SKY attributes section. */ +#define SHT_CSKY_ATTRIBUTES (SHT_LOPROC + 1) + /* IA-64 specific declarations. */ /* Processor specific flags for the Ehdr e_flags field. */ @@ -2701,8 +3510,18 @@ typedef Elf32_Addr Elf32_Conflict; #define R_X86_64_TLSDESC 36 /* TLS descriptor. */ #define R_X86_64_IRELATIVE 37 /* Adjust indirectly by program base */ #define R_X86_64_RELATIVE64 38 /* 64-bit adjust by program base */ + /* 39 Reserved was R_X86_64_PC32_BND */ + /* 40 Reserved was R_X86_64_PLT32_BND */ +#define R_X86_64_GOTPCRELX 41 /* Load from 32 bit signed pc relative + offset to GOT entry without REX + prefix, relaxable. */ +#define R_X86_64_REX_GOTPCRELX 42 /* Load from 32 bit signed pc relative + offset to GOT entry with REX prefix, + relaxable. */ +#define R_X86_64_NUM 43 -#define R_X86_64_NUM 39 +/* x86-64 sh_type values. */ +#define SHT_X86_64_UNWIND 0x70000001 /* Unwind information. */ /* AM33 relocations. */ @@ -2730,8 +3549,23 @@ typedef Elf32_Addr Elf32_Conflict; #define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */ #define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */ #define R_MN10300_RELATIVE 23 /* Adjust by program base. */ - -#define R_MN10300_NUM 24 +#define R_MN10300_TLS_GD 24 /* 32-bit offset for global dynamic. */ +#define R_MN10300_TLS_LD 25 /* 32-bit offset for local dynamic. */ +#define R_MN10300_TLS_LDO 26 /* Module-relative offset. */ +#define R_MN10300_TLS_GOTIE 27 /* GOT offset for static TLS block + offset. */ +#define R_MN10300_TLS_IE 28 /* GOT address for static TLS block + offset. */ +#define R_MN10300_TLS_LE 29 /* Offset relative to static TLS + block. */ +#define R_MN10300_TLS_DTPMOD 30 /* ID of module containing symbol. */ +#define R_MN10300_TLS_DTPOFF 31 /* Offset in module TLS block. */ +#define R_MN10300_TLS_TPOFF 32 /* Offset in static TLS block. */ +#define R_MN10300_SYM_DIFF 33 /* Adjustment for next reloc as needed + by linker relaxation. */ +#define R_MN10300_ALIGN 34 /* Alignment requirement for linker + relaxation. */ +#define R_MN10300_NUM 35 /* M32R relocs. */ @@ -2789,6 +3623,89 @@ typedef Elf32_Addr Elf32_Conflict; #define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */ #define R_M32R_NUM 256 /* Keep this the last entry. */ +/* MicroBlaze relocations */ +#define R_MICROBLAZE_NONE 0 /* No reloc. */ +#define R_MICROBLAZE_32 1 /* Direct 32 bit. */ +#define R_MICROBLAZE_32_PCREL 2 /* PC relative 32 bit. */ +#define R_MICROBLAZE_64_PCREL 3 /* PC relative 64 bit. */ +#define R_MICROBLAZE_32_PCREL_LO 4 /* Low 16 bits of PCREL32. */ +#define R_MICROBLAZE_64 5 /* Direct 64 bit. */ +#define R_MICROBLAZE_32_LO 6 /* Low 16 bit. */ +#define R_MICROBLAZE_SRO32 7 /* Read-only small data area. */ +#define R_MICROBLAZE_SRW32 8 /* Read-write small data area. */ +#define R_MICROBLAZE_64_NONE 9 /* No reloc. */ +#define R_MICROBLAZE_32_SYM_OP_SYM 10 /* Symbol Op Symbol relocation. */ +#define R_MICROBLAZE_GNU_VTINHERIT 11 /* GNU C++ vtable hierarchy. */ +#define R_MICROBLAZE_GNU_VTENTRY 12 /* GNU C++ vtable member usage. */ +#define R_MICROBLAZE_GOTPC_64 13 /* PC-relative GOT offset. */ +#define R_MICROBLAZE_GOT_64 14 /* GOT entry offset. */ +#define R_MICROBLAZE_PLT_64 15 /* PLT offset (PC-relative). */ +#define R_MICROBLAZE_REL 16 /* Adjust by program base. */ +#define R_MICROBLAZE_JUMP_SLOT 17 /* Create PLT entry. */ +#define R_MICROBLAZE_GLOB_DAT 18 /* Create GOT entry. */ +#define R_MICROBLAZE_GOTOFF_64 19 /* 64 bit offset to GOT. */ +#define R_MICROBLAZE_GOTOFF_32 20 /* 32 bit offset to GOT. */ +#define R_MICROBLAZE_COPY 21 /* Runtime copy. */ +#define R_MICROBLAZE_TLS 22 /* TLS Reloc. */ +#define R_MICROBLAZE_TLSGD 23 /* TLS General Dynamic. */ +#define R_MICROBLAZE_TLSLD 24 /* TLS Local Dynamic. */ +#define R_MICROBLAZE_TLSDTPMOD32 25 /* TLS Module ID. */ +#define R_MICROBLAZE_TLSDTPREL32 26 /* TLS Offset Within TLS Block. */ +#define R_MICROBLAZE_TLSDTPREL64 27 /* TLS Offset Within TLS Block. */ +#define R_MICROBLAZE_TLSGOTTPREL32 28 /* TLS Offset From Thread Pointer. */ +#define R_MICROBLAZE_TLSTPREL32 29 /* TLS Offset From Thread Pointer. */ + +/* Legal values for d_tag (dynamic entry type). */ +#define DT_NIOS2_GP 0x70000002 /* Address of _gp. */ + +/* Nios II relocations. */ +#define R_NIOS2_NONE 0 /* No reloc. */ +#define R_NIOS2_S16 1 /* Direct signed 16 bit. */ +#define R_NIOS2_U16 2 /* Direct unsigned 16 bit. */ +#define R_NIOS2_PCREL16 3 /* PC relative 16 bit. */ +#define R_NIOS2_CALL26 4 /* Direct call. */ +#define R_NIOS2_IMM5 5 /* 5 bit constant expression. */ +#define R_NIOS2_CACHE_OPX 6 /* 5 bit expression, shift 22. */ +#define R_NIOS2_IMM6 7 /* 6 bit constant expression. */ +#define R_NIOS2_IMM8 8 /* 8 bit constant expression. */ +#define R_NIOS2_HI16 9 /* High 16 bit. */ +#define R_NIOS2_LO16 10 /* Low 16 bit. */ +#define R_NIOS2_HIADJ16 11 /* High 16 bit, adjusted. */ +#define R_NIOS2_BFD_RELOC_32 12 /* 32 bit symbol value + addend. */ +#define R_NIOS2_BFD_RELOC_16 13 /* 16 bit symbol value + addend. */ +#define R_NIOS2_BFD_RELOC_8 14 /* 8 bit symbol value + addend. */ +#define R_NIOS2_GPREL 15 /* 16 bit GP pointer offset. */ +#define R_NIOS2_GNU_VTINHERIT 16 /* GNU C++ vtable hierarchy. */ +#define R_NIOS2_GNU_VTENTRY 17 /* GNU C++ vtable member usage. */ +#define R_NIOS2_UJMP 18 /* Unconditional branch. */ +#define R_NIOS2_CJMP 19 /* Conditional branch. */ +#define R_NIOS2_CALLR 20 /* Indirect call through register. */ +#define R_NIOS2_ALIGN 21 /* Alignment requirement for + linker relaxation. */ +#define R_NIOS2_GOT16 22 /* 16 bit GOT entry. */ +#define R_NIOS2_CALL16 23 /* 16 bit GOT entry for function. */ +#define R_NIOS2_GOTOFF_LO 24 /* %lo of offset to GOT pointer. */ +#define R_NIOS2_GOTOFF_HA 25 /* %hiadj of offset to GOT pointer. */ +#define R_NIOS2_PCREL_LO 26 /* %lo of PC relative offset. */ +#define R_NIOS2_PCREL_HA 27 /* %hiadj of PC relative offset. */ +#define R_NIOS2_TLS_GD16 28 /* 16 bit GOT offset for TLS GD. */ +#define R_NIOS2_TLS_LDM16 29 /* 16 bit GOT offset for TLS LDM. */ +#define R_NIOS2_TLS_LDO16 30 /* 16 bit module relative offset. */ +#define R_NIOS2_TLS_IE16 31 /* 16 bit GOT offset for TLS IE. */ +#define R_NIOS2_TLS_LE16 32 /* 16 bit LE TP-relative offset. */ +#define R_NIOS2_TLS_DTPMOD 33 /* Module number. */ +#define R_NIOS2_TLS_DTPREL 34 /* Module-relative offset. */ +#define R_NIOS2_TLS_TPREL 35 /* TP-relative offset. */ +#define R_NIOS2_COPY 36 /* Copy symbol at runtime. */ +#define R_NIOS2_GLOB_DAT 37 /* Create GOT entry. */ +#define R_NIOS2_JUMP_SLOT 38 /* Create PLT entry. */ +#define R_NIOS2_RELATIVE 39 /* Adjust by program base. */ +#define R_NIOS2_GOTOFF 40 /* 16 bit offset to GOT pointer. */ +#define R_NIOS2_CALL26_NOAT 41 /* Direct call in .noat section. */ +#define R_NIOS2_GOT_LO 42 /* %lo() of GOT entry. */ +#define R_NIOS2_GOT_HA 43 /* %hiadj() of GOT entry. */ +#define R_NIOS2_CALL_LO 44 /* %lo() of function GOT entry. */ +#define R_NIOS2_CALL_HA 45 /* %hiadj() of function GOT entry. */ /* TILEPro relocations. */ #define R_TILEPRO_NONE 0 /* No reloc */ @@ -2955,12 +3872,18 @@ typedef Elf32_Addr Elf32_Conflict; #define R_TILEGX_IMM16_X1_HW2_LAST_PCREL 63 /* X1 pipe PC-rel last hword 2 */ #define R_TILEGX_IMM16_X0_HW0_GOT 64 /* X0 pipe hword 0 GOT offset */ #define R_TILEGX_IMM16_X1_HW0_GOT 65 /* X1 pipe hword 0 GOT offset */ -/* Relocs 66-71 are currently not defined. */ +#define R_TILEGX_IMM16_X0_HW0_PLT_PCREL 66 /* X0 pipe PC-rel PLT hword 0 */ +#define R_TILEGX_IMM16_X1_HW0_PLT_PCREL 67 /* X1 pipe PC-rel PLT hword 0 */ +#define R_TILEGX_IMM16_X0_HW1_PLT_PCREL 68 /* X0 pipe PC-rel PLT hword 1 */ +#define R_TILEGX_IMM16_X1_HW1_PLT_PCREL 69 /* X1 pipe PC-rel PLT hword 1 */ +#define R_TILEGX_IMM16_X0_HW2_PLT_PCREL 70 /* X0 pipe PC-rel PLT hword 2 */ +#define R_TILEGX_IMM16_X1_HW2_PLT_PCREL 71 /* X1 pipe PC-rel PLT hword 2 */ #define R_TILEGX_IMM16_X0_HW0_LAST_GOT 72 /* X0 pipe last hword 0 GOT offset */ #define R_TILEGX_IMM16_X1_HW0_LAST_GOT 73 /* X1 pipe last hword 0 GOT offset */ #define R_TILEGX_IMM16_X0_HW1_LAST_GOT 74 /* X0 pipe last hword 1 GOT offset */ #define R_TILEGX_IMM16_X1_HW1_LAST_GOT 75 /* X1 pipe last hword 1 GOT offset */ -/* Relocs 76-77 are currently not defined. */ +#define R_TILEGX_IMM16_X0_HW3_PLT_PCREL 76 /* X0 pipe PC-rel PLT hword 3 */ +#define R_TILEGX_IMM16_X1_HW3_PLT_PCREL 77 /* X1 pipe PC-rel PLT hword 3 */ #define R_TILEGX_IMM16_X0_HW0_TLS_GD 78 /* X0 pipe hword 0 TLS GD offset */ #define R_TILEGX_IMM16_X1_HW0_TLS_GD 79 /* X1 pipe hword 0 TLS GD offset */ #define R_TILEGX_IMM16_X0_HW0_TLS_LE 80 /* X0 pipe hword 0 TLS LE offset */ @@ -2976,7 +3899,12 @@ typedef Elf32_Addr Elf32_Conflict; /* Relocs 90-91 are currently not defined. */ #define R_TILEGX_IMM16_X0_HW0_TLS_IE 92 /* X0 pipe hword 0 TLS IE offset */ #define R_TILEGX_IMM16_X1_HW0_TLS_IE 93 /* X1 pipe hword 0 TLS IE offset */ -/* Relocs 94-99 are currently not defined. */ +#define R_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL 94 /* X0 pipe PC-rel PLT last hword 0 */ +#define R_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL 95 /* X1 pipe PC-rel PLT last hword 0 */ +#define R_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL 96 /* X0 pipe PC-rel PLT last hword 1 */ +#define R_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL 97 /* X1 pipe PC-rel PLT last hword 1 */ +#define R_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL 98 /* X0 pipe PC-rel PLT last hword 2 */ +#define R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL 99 /* X1 pipe PC-rel PLT last hword 2 */ #define R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE 100 /* X0 pipe last hword 0 IE off */ #define R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE 101 /* X1 pipe last hword 0 IE off */ #define R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE 102 /* X0 pipe last hword 1 IE off */ @@ -3004,4 +3932,396 @@ typedef Elf32_Addr Elf32_Conflict; #define R_TILEGX_NUM 130 +/* RISC-V ELF Flags */ +#define EF_RISCV_RVC 0x0001 +#define EF_RISCV_FLOAT_ABI 0x0006 +#define EF_RISCV_FLOAT_ABI_SOFT 0x0000 +#define EF_RISCV_FLOAT_ABI_SINGLE 0x0002 +#define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004 +#define EF_RISCV_FLOAT_ABI_QUAD 0x0006 +#define EF_RISCV_RVE 0x0008 +#define EF_RISCV_TSO 0x0010 + +/* RISC-V relocations. */ +#define R_RISCV_NONE 0 +#define R_RISCV_32 1 +#define R_RISCV_64 2 +#define R_RISCV_RELATIVE 3 +#define R_RISCV_COPY 4 +#define R_RISCV_JUMP_SLOT 5 +#define R_RISCV_TLS_DTPMOD32 6 +#define R_RISCV_TLS_DTPMOD64 7 +#define R_RISCV_TLS_DTPREL32 8 +#define R_RISCV_TLS_DTPREL64 9 +#define R_RISCV_TLS_TPREL32 10 +#define R_RISCV_TLS_TPREL64 11 +#define R_RISCV_BRANCH 16 +#define R_RISCV_JAL 17 +#define R_RISCV_CALL 18 +#define R_RISCV_CALL_PLT 19 +#define R_RISCV_GOT_HI20 20 +#define R_RISCV_TLS_GOT_HI20 21 +#define R_RISCV_TLS_GD_HI20 22 +#define R_RISCV_PCREL_HI20 23 +#define R_RISCV_PCREL_LO12_I 24 +#define R_RISCV_PCREL_LO12_S 25 +#define R_RISCV_HI20 26 +#define R_RISCV_LO12_I 27 +#define R_RISCV_LO12_S 28 +#define R_RISCV_TPREL_HI20 29 +#define R_RISCV_TPREL_LO12_I 30 +#define R_RISCV_TPREL_LO12_S 31 +#define R_RISCV_TPREL_ADD 32 +#define R_RISCV_ADD8 33 +#define R_RISCV_ADD16 34 +#define R_RISCV_ADD32 35 +#define R_RISCV_ADD64 36 +#define R_RISCV_SUB8 37 +#define R_RISCV_SUB16 38 +#define R_RISCV_SUB32 39 +#define R_RISCV_SUB64 40 +#define R_RISCV_GNU_VTINHERIT 41 +#define R_RISCV_GNU_VTENTRY 42 +#define R_RISCV_ALIGN 43 +#define R_RISCV_RVC_BRANCH 44 +#define R_RISCV_RVC_JUMP 45 +#define R_RISCV_RVC_LUI 46 +#define R_RISCV_GPREL_I 47 +#define R_RISCV_GPREL_S 48 +#define R_RISCV_TPREL_I 49 +#define R_RISCV_TPREL_S 50 +#define R_RISCV_RELAX 51 +#define R_RISCV_SUB6 52 +#define R_RISCV_SET6 53 +#define R_RISCV_SET8 54 +#define R_RISCV_SET16 55 +#define R_RISCV_SET32 56 +#define R_RISCV_32_PCREL 57 +#define R_RISCV_IRELATIVE 58 + +#define R_RISCV_NUM 59 + +/* RISC-V specific values for the st_other field. */ +#define STO_RISCV_VARIANT_CC 0x80 /* Function uses variant calling + convention */ + +/* RISC-V specific values for the sh_type field. */ +#define SHT_RISCV_ATTRIBUTES (SHT_LOPROC + 3) + +/* RISC-V specific values for the p_type field. */ +#define PT_RISCV_ATTRIBUTES (PT_LOPROC + 3) + +/* RISC-V specific values for the d_tag field. */ +#define DT_RISCV_VARIANT_CC (DT_LOPROC + 1) + +/* BPF specific declarations. */ + +#define R_BPF_NONE 0 /* No reloc */ +#define R_BPF_64_64 1 +#define R_BPF_64_32 10 + +/* Imagination Meta specific relocations. */ + +#define R_METAG_HIADDR16 0 +#define R_METAG_LOADDR16 1 +#define R_METAG_ADDR32 2 /* 32bit absolute address */ +#define R_METAG_NONE 3 /* No reloc */ +#define R_METAG_RELBRANCH 4 +#define R_METAG_GETSETOFF 5 + +/* Backward compatibility */ +#define R_METAG_REG32OP1 6 +#define R_METAG_REG32OP2 7 +#define R_METAG_REG32OP3 8 +#define R_METAG_REG16OP1 9 +#define R_METAG_REG16OP2 10 +#define R_METAG_REG16OP3 11 +#define R_METAG_REG32OP4 12 + +#define R_METAG_HIOG 13 +#define R_METAG_LOOG 14 + +#define R_METAG_REL8 15 +#define R_METAG_REL16 16 + +/* GNU */ +#define R_METAG_GNU_VTINHERIT 30 +#define R_METAG_GNU_VTENTRY 31 + +/* PIC relocations */ +#define R_METAG_HI16_GOTOFF 32 +#define R_METAG_LO16_GOTOFF 33 +#define R_METAG_GETSET_GOTOFF 34 +#define R_METAG_GETSET_GOT 35 +#define R_METAG_HI16_GOTPC 36 +#define R_METAG_LO16_GOTPC 37 +#define R_METAG_HI16_PLT 38 +#define R_METAG_LO16_PLT 39 +#define R_METAG_RELBRANCH_PLT 40 +#define R_METAG_GOTOFF 41 +#define R_METAG_PLT 42 +#define R_METAG_COPY 43 +#define R_METAG_JMP_SLOT 44 +#define R_METAG_RELATIVE 45 +#define R_METAG_GLOB_DAT 46 + +/* TLS relocations */ +#define R_METAG_TLS_GD 47 +#define R_METAG_TLS_LDM 48 +#define R_METAG_TLS_LDO_HI16 49 +#define R_METAG_TLS_LDO_LO16 50 +#define R_METAG_TLS_LDO 51 +#define R_METAG_TLS_IE 52 +#define R_METAG_TLS_IENONPIC 53 +#define R_METAG_TLS_IENONPIC_HI16 54 +#define R_METAG_TLS_IENONPIC_LO16 55 +#define R_METAG_TLS_TPOFF 56 +#define R_METAG_TLS_DTPMOD 57 +#define R_METAG_TLS_DTPOFF 58 +#define R_METAG_TLS_LE 59 +#define R_METAG_TLS_LE_HI16 60 +#define R_METAG_TLS_LE_LO16 61 + +/* NDS32 relocations. */ +#define R_NDS32_NONE 0 +#define R_NDS32_32_RELA 20 +#define R_NDS32_COPY 39 +#define R_NDS32_GLOB_DAT 40 +#define R_NDS32_JMP_SLOT 41 +#define R_NDS32_RELATIVE 42 +#define R_NDS32_TLS_TPOFF 102 +#define R_NDS32_TLS_DESC 119 + +/* LoongArch ELF Flags */ +#define EF_LARCH_ABI_MODIFIER_MASK 0x07 +#define EF_LARCH_ABI_SOFT_FLOAT 0x01 +#define EF_LARCH_ABI_SINGLE_FLOAT 0x02 +#define EF_LARCH_ABI_DOUBLE_FLOAT 0x03 +#define EF_LARCH_OBJABI_V1 0x40 + +/* LoongArch specific dynamic relocations */ +#define R_LARCH_NONE 0 +#define R_LARCH_32 1 +#define R_LARCH_64 2 +#define R_LARCH_RELATIVE 3 +#define R_LARCH_COPY 4 +#define R_LARCH_JUMP_SLOT 5 +#define R_LARCH_TLS_DTPMOD32 6 +#define R_LARCH_TLS_DTPMOD64 7 +#define R_LARCH_TLS_DTPREL32 8 +#define R_LARCH_TLS_DTPREL64 9 +#define R_LARCH_TLS_TPREL32 10 +#define R_LARCH_TLS_TPREL64 11 +#define R_LARCH_IRELATIVE 12 + +/* Reserved for future relocs that the dynamic linker must understand. */ + +/* used by the static linker for relocating .text. */ +#define R_LARCH_MARK_LA 20 +#define R_LARCH_MARK_PCREL 21 +#define R_LARCH_SOP_PUSH_PCREL 22 +#define R_LARCH_SOP_PUSH_ABSOLUTE 23 +#define R_LARCH_SOP_PUSH_DUP 24 +#define R_LARCH_SOP_PUSH_GPREL 25 +#define R_LARCH_SOP_PUSH_TLS_TPREL 26 +#define R_LARCH_SOP_PUSH_TLS_GOT 27 +#define R_LARCH_SOP_PUSH_TLS_GD 28 +#define R_LARCH_SOP_PUSH_PLT_PCREL 29 +#define R_LARCH_SOP_ASSERT 30 +#define R_LARCH_SOP_NOT 31 +#define R_LARCH_SOP_SUB 32 +#define R_LARCH_SOP_SL 33 +#define R_LARCH_SOP_SR 34 +#define R_LARCH_SOP_ADD 35 +#define R_LARCH_SOP_AND 36 +#define R_LARCH_SOP_IF_ELSE 37 +#define R_LARCH_SOP_POP_32_S_10_5 38 +#define R_LARCH_SOP_POP_32_U_10_12 39 +#define R_LARCH_SOP_POP_32_S_10_12 40 +#define R_LARCH_SOP_POP_32_S_10_16 41 +#define R_LARCH_SOP_POP_32_S_10_16_S2 42 +#define R_LARCH_SOP_POP_32_S_5_20 43 +#define R_LARCH_SOP_POP_32_S_0_5_10_16_S2 44 +#define R_LARCH_SOP_POP_32_S_0_10_10_16_S2 45 +#define R_LARCH_SOP_POP_32_U 46 + +/* used by the static linker for relocating non .text. */ +#define R_LARCH_ADD8 47 +#define R_LARCH_ADD16 48 +#define R_LARCH_ADD24 49 +#define R_LARCH_ADD32 50 +#define R_LARCH_ADD64 51 +#define R_LARCH_SUB8 52 +#define R_LARCH_SUB16 53 +#define R_LARCH_SUB24 54 +#define R_LARCH_SUB32 55 +#define R_LARCH_SUB64 56 +#define R_LARCH_GNU_VTINHERIT 57 +#define R_LARCH_GNU_VTENTRY 58 + +/* reserved 59-63 */ + +#define R_LARCH_B16 64 +#define R_LARCH_B21 65 +#define R_LARCH_B26 66 +#define R_LARCH_ABS_HI20 67 +#define R_LARCH_ABS_LO12 68 +#define R_LARCH_ABS64_LO20 69 +#define R_LARCH_ABS64_HI12 70 +#define R_LARCH_PCALA_HI20 71 +#define R_LARCH_PCALA_LO12 72 +#define R_LARCH_PCALA64_LO20 73 +#define R_LARCH_PCALA64_HI12 74 +#define R_LARCH_GOT_PC_HI20 75 +#define R_LARCH_GOT_PC_LO12 76 +#define R_LARCH_GOT64_PC_LO20 77 +#define R_LARCH_GOT64_PC_HI12 78 +#define R_LARCH_GOT_HI20 79 +#define R_LARCH_GOT_LO12 80 +#define R_LARCH_GOT64_LO20 81 +#define R_LARCH_GOT64_HI12 82 +#define R_LARCH_TLS_LE_HI20 83 +#define R_LARCH_TLS_LE_LO12 84 +#define R_LARCH_TLS_LE64_LO20 85 +#define R_LARCH_TLS_LE64_HI12 86 +#define R_LARCH_TLS_IE_PC_HI20 87 +#define R_LARCH_TLS_IE_PC_LO12 88 +#define R_LARCH_TLS_IE64_PC_LO20 89 +#define R_LARCH_TLS_IE64_PC_HI12 90 +#define R_LARCH_TLS_IE_HI20 91 +#define R_LARCH_TLS_IE_LO12 92 +#define R_LARCH_TLS_IE64_LO20 93 +#define R_LARCH_TLS_IE64_HI12 94 +#define R_LARCH_TLS_LD_PC_HI20 95 +#define R_LARCH_TLS_LD_HI20 96 +#define R_LARCH_TLS_GD_PC_HI20 97 +#define R_LARCH_TLS_GD_HI20 98 +#define R_LARCH_32_PCREL 99 +#define R_LARCH_RELAX 100 + +/* ARC specific declarations. */ + +/* Processor specific flags for the Ehdr e_flags field. */ +#define EF_ARC_MACH_MSK 0x000000ff +#define EF_ARC_OSABI_MSK 0x00000f00 +#define EF_ARC_ALL_MSK (EF_ARC_MACH_MSK | EF_ARC_OSABI_MSK) + +/* Processor specific values for the Shdr sh_type field. */ +#define SHT_ARC_ATTRIBUTES (SHT_LOPROC + 1) /* ARC attributes section. */ + +/* ARCompact/ARCv2 specific relocs. */ +#define R_ARC_NONE 0x0 +#define R_ARC_8 0x1 +#define R_ARC_16 0x2 +#define R_ARC_24 0x3 +#define R_ARC_32 0x4 + +#define R_ARC_B22_PCREL 0x6 +#define R_ARC_H30 0x7 +#define R_ARC_N8 0x8 +#define R_ARC_N16 0x9 +#define R_ARC_N24 0xA +#define R_ARC_N32 0xB +#define R_ARC_SDA 0xC +#define R_ARC_SECTOFF 0xD +#define R_ARC_S21H_PCREL 0xE +#define R_ARC_S21W_PCREL 0xF +#define R_ARC_S25H_PCREL 0x10 +#define R_ARC_S25W_PCREL 0x11 +#define R_ARC_SDA32 0x12 +#define R_ARC_SDA_LDST 0x13 +#define R_ARC_SDA_LDST1 0x14 +#define R_ARC_SDA_LDST2 0x15 +#define R_ARC_SDA16_LD 0x16 +#define R_ARC_SDA16_LD1 0x17 +#define R_ARC_SDA16_LD2 0x18 +#define R_ARC_S13_PCREL 0x19 +#define R_ARC_W 0x1A +#define R_ARC_32_ME 0x1B +#define R_ARC_N32_ME 0x1C +#define R_ARC_SECTOFF_ME 0x1D +#define R_ARC_SDA32_ME 0x1E +#define R_ARC_W_ME 0x1F +#define R_ARC_H30_ME 0x20 +#define R_ARC_SECTOFF_U8 0x21 +#define R_ARC_SECTOFF_S9 0x22 +#define R_AC_SECTOFF_U8 0x23 +#define R_AC_SECTOFF_U8_1 0x24 +#define R_AC_SECTOFF_U8_2 0x25 +#define R_AC_SECTOFF_S9 0x26 +#define R_AC_SECTOFF_S9_1 0x27 +#define R_AC_SECTOFF_S9_2 0x28 +#define R_ARC_SECTOFF_ME_1 0x29 +#define R_ARC_SECTOFF_ME_2 0x2A +#define R_ARC_SECTOFF_1 0x2B +#define R_ARC_SECTOFF_2 0x2C +#define R_ARC_SDA_12 0x2D +#define R_ARC_SDA16_ST2 0x30 +#define R_ARC_32_PCREL 0x31 +#define R_ARC_PC32 0x32 +#define R_ARC_GOTPC32 0x33 +#define R_ARC_PLT32 0x34 +#define R_ARC_COPY 0x35 +#define R_ARC_GLOB_DAT 0x36 +#define R_ARC_JMP_SLOT 0x37 +#define R_ARC_RELATIVE 0x38 +#define R_ARC_GOTOFF 0x39 +#define R_ARC_GOTPC 0x3A +#define R_ARC_GOT32 0x3B +#define R_ARC_S21W_PCREL_PLT 0x3C +#define R_ARC_S25H_PCREL_PLT 0x3D + +#define R_ARC_JLI_SECTOFF 0x3F + +#define R_ARC_TLS_DTPMOD 0x42 +#define R_ARC_TLS_DTPOFF 0x43 +#define R_ARC_TLS_TPOFF 0x44 +#define R_ARC_TLS_GD_GOT 0x45 +#define R_ARC_TLS_GD_LD 0x46 +#define R_ARC_TLS_GD_CALL 0x47 +#define R_ARC_TLS_IE_GOT 0x48 +#define R_ARC_TLS_DTPOFF_S9 0x49 +#define R_ARC_TLS_LE_S9 0x4A +#define R_ARC_TLS_LE_32 0x4B +#define R_ARC_S25W_PCREL_PLT 0x4C +#define R_ARC_S21H_PCREL_PLT 0x4D +#define R_ARC_NPS_CMEM16 0x4E + +/* OpenRISC 1000 specific relocs. */ +#define R_OR1K_NONE 0 +#define R_OR1K_32 1 +#define R_OR1K_16 2 +#define R_OR1K_8 3 +#define R_OR1K_LO_16_IN_INSN 4 +#define R_OR1K_HI_16_IN_INSN 5 +#define R_OR1K_INSN_REL_26 6 +#define R_OR1K_GNU_VTENTRY 7 +#define R_OR1K_GNU_VTINHERIT 8 +#define R_OR1K_32_PCREL 9 +#define R_OR1K_16_PCREL 10 +#define R_OR1K_8_PCREL 11 +#define R_OR1K_GOTPC_HI16 12 +#define R_OR1K_GOTPC_LO16 13 +#define R_OR1K_GOT16 14 +#define R_OR1K_PLT26 15 +#define R_OR1K_GOTOFF_HI16 16 +#define R_OR1K_GOTOFF_LO16 17 +#define R_OR1K_COPY 18 +#define R_OR1K_GLOB_DAT 19 +#define R_OR1K_JMP_SLOT 20 +#define R_OR1K_RELATIVE 21 +#define R_OR1K_TLS_GD_HI16 22 +#define R_OR1K_TLS_GD_LO16 23 +#define R_OR1K_TLS_LDM_HI16 24 +#define R_OR1K_TLS_LDM_LO16 25 +#define R_OR1K_TLS_LDO_HI16 26 +#define R_OR1K_TLS_LDO_LO16 27 +#define R_OR1K_TLS_IE_HI16 28 +#define R_OR1K_TLS_IE_LO16 29 +#define R_OR1K_TLS_LE_HI16 30 +#define R_OR1K_TLS_LE_LO16 31 +#define R_OR1K_TLS_TPOFF 32 +#define R_OR1K_TLS_DTPOFF 33 +#define R_OR1K_TLS_DTPMOD 34 + #endif /* elf.h */ From 582f6fb8cdb20afe8897293616a1ab0cb5b3d501 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 8 Mar 2023 21:31:13 +0100 Subject: [PATCH 34/44] kernel: Deactivate options shown with CONFIG_KERNEL_DEBUG_VM=y This deactivates some kernel configuratoion options I see when CONFIG_KERNEL_DEBUG_VM=y is set in the OpenWrt configuration on x86/64. Signed-off-by: Hauke Mehrtens --- target/linux/generic/config-5.15 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index fbdfd5c68eb..ac1c3dc35ed 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -1373,7 +1373,10 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_USER is not set # CONFIG_DEBUG_VIRTUAL is not set # CONFIG_DEBUG_VM is not set +# 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 From e850045c76d54b60dcf346f676d67ffe3ed4431a Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 8 Mar 2023 21:31:14 +0100 Subject: [PATCH 35/44] kernel: Deactivate options shown with CONFIG_KERNEL_DEBUG_VIRTUAL=y This deactivates some kernel configuration options I see when CONFIG_KERNEL_DEBUG_VIRTUAL=y is set in the OpenWrt configuration on x86/64. Signed-off-by: Hauke Mehrtens --- target/linux/generic/config-5.15 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index ac1c3dc35ed..96a95acf9e1 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -6459,6 +6459,7 @@ CONFIG_TCP_CONG_CUBIC=y # CONFIG_TEST_BLACKHOLE_DEV is not set # CONFIG_TEST_BPF is not set # CONFIG_TEST_CLOCKSOURCE_WATCHDOG is not set +# CONFIG_TEST_DEBUG_VIRTUAL is not set # CONFIG_TEST_DIV64 is not set # CONFIG_TEST_FIRMWARE is not set # CONFIG_TEST_FREE_PAGES is not set From e291a38d7fa46258f02a7aafeb7797590de5b035 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 8 Mar 2023 21:31:15 +0100 Subject: [PATCH 36/44] kernel: Deactivate options shown with CONFIG_KERNEL_HIST_TRIGGERS=y This deactivates some kernel configuration options I see when CONFIG_KERNEL_HIST_TRIGGERS=y is set in the OpenWrt configuration on x86/64. Signed-off-by: Hauke Mehrtens --- target/linux/generic/config-5.15 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index 96a95acf9e1..71df42c9b81 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -2399,6 +2399,7 @@ CONFIG_HIGH_RES_TIMERS=y # CONFIG_HISI_DMA is not set # CONFIG_HISI_FEMAC is not set # CONFIG_HISI_HIKEY_USB is not set +# CONFIG_HIST_TRIGGERS_DEBUG is not set # CONFIG_HIX5HD2_GMAC is not set # CONFIG_HMC425 is not set # CONFIG_HMC6352 is not set @@ -6385,6 +6386,7 @@ CONFIG_SYMBOLIC_ERRNAME=y # 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 From 2d5b761838951a5a4a491579114fe39b0daf966e Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 8 Mar 2023 21:31:16 +0100 Subject: [PATCH 37/44] kernel: Deactivate options shown with CONFIG_KERNEL_DYNAMIC_FTRACE=y This deactivates some kernel configuration options I see when CONFIG_KERNEL_DYNAMIC_FTRACE=y is set in the OpenWrt configuration on x86/64. Signed-off-by: Hauke Mehrtens --- target/linux/generic/config-5.15 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index 71df42c9b81..09d9ce9356d 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -3192,6 +3192,7 @@ CONFIG_LINEAR_RANGES=y # CONFIG_LIS3L02DQ is not set # CONFIG_LITEX_LITEETH is not set # CONFIG_LITEX_SOC_CONTROLLER is not set +# CONFIG_LIVEPATCH is not set # CONFIG_LKDTM is not set CONFIG_LLC=y # CONFIG_LLC2 is not set From 85661be9df381bacd1f9d09d4045efa04e6ad3c4 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 8 Mar 2023 21:31:17 +0100 Subject: [PATCH 38/44] kernel: Set some options to default shown with CONFIG_KERNEL_UBSAN=y This sets some kernel configuration options to their default values. I saw these as warnings when I set CONFIG_KERNEL_UBSAN=y is set in the OpenWrt configuration on x86/64. Signed-off-by: Hauke Mehrtens --- target/linux/generic/config-5.15 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index 09d9ce9356d..d6c44e801e1 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -6765,7 +6765,12 @@ CONFIG_UBIFS_FS_ZLIB=y CONFIG_UBIFS_FS_ZSTD=y # CONFIG_UBSAN is not set 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 From 2213bf5e83ffeb597fe67c7192f797311f0c44b8 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 8 Mar 2023 21:31:18 +0100 Subject: [PATCH 39/44] kernel: Deactivate options shown with CONFIG_KERNEL_KASAN=y This deactivates some kernel configuration options I see when CONFIG_KERNEL_KASAN=y is set in the OpenWrt configuration on x86/64. Set CONFIG_STACK_HASH_ORDER to its default value. Signed-off-by: Hauke Mehrtens --- target/linux/generic/config-5.15 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index d6c44e801e1..83aebc7017b 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -2988,6 +2988,7 @@ CONFIG_KALLSYMS_BASE_RELATIVE=y # CONFIG_KALLSYMS_UNCOMPRESSED is not set # CONFIG_KARMA_PARTITION is not set # CONFIG_KASAN is not set +# CONFIG_KASAN_MODULE_TEST is not set CONFIG_KASAN_STACK=y # CONFIG_KCMP is not set # CONFIG_KCOV is not set @@ -6325,6 +6326,7 @@ 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 From 0f5ba147916601bcf3a60e27daa8a237ca579b94 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 8 Mar 2023 21:31:19 +0100 Subject: [PATCH 40/44] kernel: Deactivate options shown with CONFIG_KERNEL_KCOV=y This sets the CONFIG_KCOV_IRQ_AREA_SIZE kernel configuration option to its default value. This is shown when I set CONFIG_KERNEL_KCOV=y in the OpenWrt configuration on x86/64. Signed-off-by: Hauke Mehrtens --- target/linux/generic/config-5.15 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index 83aebc7017b..eab04238783 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -2992,6 +2992,7 @@ CONFIG_KALLSYMS_BASE_RELATIVE=y CONFIG_KASAN_STACK=y # CONFIG_KCMP is not set # CONFIG_KCOV is not set +CONFIG_KCOV_IRQ_AREA_SIZE=0x40000 # CONFIG_KCSAN is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_CAT is not set From b844716158dc8060d53785cbf4ecb022ebb255a2 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 8 Mar 2023 21:31:20 +0100 Subject: [PATCH 41/44] kernel: Add CONFIG_KERNEL_HARDLOCKUP_DETECTOR Make it possible to change the kernel configuration option CONFIG_HARDLOCKUP_DETECTOR from OpenWrt. Signed-off-by: Hauke Mehrtens --- config/Config-kernel.in | 12 ++++++++++++ target/linux/generic/config-5.15 | 1 + 2 files changed, 13 insertions(+) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index ad23b214796..c7b1864235b 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -541,6 +541,18 @@ config KERNEL_SOFTLOCKUP_DETECTOR chance to run. The current stack trace is displayed upon detection and the system will stay locked up. +config KERNEL_HARDLOCKUP_DETECTOR + bool "Compile the kernel with detect Hard Lockups" + depends on KERNEL_DEBUG_KERNEL + help + Say Y here to enable the kernel to act as a watchdog to detect + hard lockups. + + Hardlockups are bugs that cause the CPU to loop in kernel mode + for more than 10 seconds, without letting other interrupts have a + chance to run. The current stack trace is displayed upon detection + and the system will stay locked up. + config KERNEL_DETECT_HUNG_TASK bool "Compile the kernel with detect Hung Tasks" depends on KERNEL_DEBUG_KERNEL diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index eab04238783..3374c239e2e 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -711,6 +711,7 @@ CONFIG_BLOCK=y # CONFIG_BONDING is not set # CONFIG_BOOKE_WDT is not set CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT=3 +# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set # CONFIG_BOOTTIME_TRACING is not set From fa168f521a4b1b0655fd44f38837ea3878aa3ecc Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 18 Mar 2023 04:31:12 +0100 Subject: [PATCH 42/44] mpc85xx: fix missing system import The mac-address accessor functions were not included in the sourced script. Fix this by importing the correct script path. Signed-off-by: David Bauer --- target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh index d84ab5f186b..0d9058420b7 100644 --- a/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh @@ -1,4 +1,5 @@ . /lib/functions.sh +. /lib/functions/system.sh preinit_set_mac_address() { case $(board_name) in From aa4a9058fbf4d2ca7ef3af9ebb5bbec896625e93 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 18 Mar 2023 04:31:40 +0100 Subject: [PATCH 43/44] mpc85xx: remove Watchguard T10 MAC override As the mac-address readout never worked, the mac-address fillout by the bootloader is sufficient. Remove the readout for the Watchguard T10 then. Signed-off-by: David Bauer --- .../linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh index 0d9058420b7..462a9e9dd8e 100644 --- a/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh @@ -7,11 +7,6 @@ preinit_set_mac_address() { ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr) ip link set dev eth1 address $(mtd_get_mac_ascii cfg1 eth1addr) ;; - watchguard,firebox-t10) - ip link set dev eth0 address "$(mtd_get_mac_text "device_id" 0x1830)" - ip link set dev eth1 address "$(mtd_get_mac_text "device_id" 0x1844)" - ip link set dev eth2 address "$(mtd_get_mac_text "device_id" 0x1858)" - ;; esac } From 00b40ef00d42b9b384e72aea604bc53e39e24ac3 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 19 Mar 2023 21:33:32 +0100 Subject: [PATCH 44/44] mpc85xx: fix incorrect kernel target The wrapper-image for the WL-WDR4900 was used as a build-target for the kernel. This workd fine as long as only a single wrapper is used with the OpenWrt build-system. If additional wrappers are used, the build becomes racy in the wrapper-stage. The wrapper images actually do not represent a target. They are built based on the kernel configuration. Only copy the resulting images to avoid race-conditions as explained. Signed-off-by: David Bauer --- target/linux/mpc85xx/p1010/target.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mpc85xx/p1010/target.mk b/target/linux/mpc85xx/p1010/target.mk index 019536ff1ab..86628e32dac 100644 --- a/target/linux/mpc85xx/p1010/target.mk +++ b/target/linux/mpc85xx/p1010/target.mk @@ -1,5 +1,5 @@ BOARDNAME:=P1010 -KERNELNAME:=simpleImage.tl-wdr4900-v1 +KERNEL_IMAGES:=simpleImage.tl-wdr4900-v1 define Target/Description Build firmware images for P1010 based boards.