From: Zhihao Xu Date: Tue, 17 Feb 2026 12:11:45 +0000 (+0800) Subject: starfive: manually refresh patches for v6.18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3e7aa18a4e364f6c3510a285c9eceb71bf4833ea;p=thirdparty%2Fopenwrt.git starfive: manually refresh patches for v6.18 Manually refresh patches: - 0004-spi-spl022-Get-and-deassert-reset-in-probe.patch - 0007-driver-mailbox-Add-mailbox-driver.patch - 0009-uart-8250-Add-dw-auto-flow-ctrl-support.patch - 0013-drivers-nvme-Add-precheck-and-delay-for-CQE-pending-.patch - 0014-riscv-Optimize-memcpy-with-aligned-version.patch Signed-off-by: Zhihao Xu --- diff --git a/target/linux/starfive/patches-6.18/0004-spi-spl022-Get-and-deassert-reset-in-probe.patch b/target/linux/starfive/patches-6.18/0004-spi-spl022-Get-and-deassert-reset-in-probe.patch index 68b181065e3..cefc3226533 100644 --- a/target/linux/starfive/patches-6.18/0004-spi-spl022-Get-and-deassert-reset-in-probe.patch +++ b/target/linux/starfive/patches-6.18/0004-spi-spl022-Get-and-deassert-reset-in-probe.patch @@ -13,15 +13,15 @@ Signed-off-by: Hal Feng --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c -@@ -33,6 +33,7 @@ - #include +@@ -34,6 +34,7 @@ #include #include + #include +#include /* * This macro is used to define some register default values. -@@ -363,6 +364,7 @@ struct pl022 { +@@ -364,6 +365,7 @@ struct pl022 { resource_size_t phybase; void __iomem *virtbase; struct clk *clk; @@ -29,7 +29,7 @@ Signed-off-by: Hal Feng struct spi_controller *host; struct pl022_ssp_controller *host_info; struct spi_transfer *cur_transfer; -@@ -1930,6 +1932,19 @@ static int pl022_probe(struct amba_devic +@@ -1927,6 +1929,19 @@ static int pl022_probe(struct amba_devic goto err_no_clk; } @@ -49,7 +49,7 @@ Signed-off-by: Hal Feng /* Disable SSP */ writew((readw(SSP_CR1(pl022->virtbase)) & (~SSP_CR1_MASK_SSE)), SSP_CR1(pl022->virtbase)); -@@ -1985,6 +2000,8 @@ static int pl022_probe(struct amba_devic +@@ -1982,6 +1997,8 @@ static int pl022_probe(struct amba_devic if (platform_info->enable_dma) pl022_dma_remove(pl022); err_no_irq: diff --git a/target/linux/starfive/patches-6.18/0007-driver-mailbox-Add-mailbox-driver.patch b/target/linux/starfive/patches-6.18/0007-driver-mailbox-Add-mailbox-driver.patch index e8a81d12bc2..e4800c0cb49 100644 --- a/target/linux/starfive/patches-6.18/0007-driver-mailbox-Add-mailbox-driver.patch +++ b/target/linux/starfive/patches-6.18/0007-driver-mailbox-Add-mailbox-driver.patch @@ -18,9 +18,9 @@ Signed-off-by: Hal Feng --- a/drivers/mailbox/Kconfig +++ b/drivers/mailbox/Kconfig -@@ -295,4 +295,17 @@ config QCOM_IPCC - acts as an interrupt controller for receiving interrupts from clients. - Say Y here if you want to build this driver. +@@ -390,4 +390,17 @@ config RISCV_SBI_MPXY_MBOX + or HS-mode hypervisor). Say Y here if you want to have this support. + If unsure say N. +config STARFIVE_MBOX + tristate "Platform Starfive Mailbox" @@ -38,10 +38,10 @@ Signed-off-by: Hal Feng endif --- a/drivers/mailbox/Makefile +++ b/drivers/mailbox/Makefile -@@ -64,3 +64,7 @@ obj-$(CONFIG_SPRD_MBOX) += sprd-mailbox - obj-$(CONFIG_QCOM_CPUCP_MBOX) += qcom-cpucp-mbox.o +@@ -82,3 +82,7 @@ obj-$(CONFIG_CIX_MBOX) += cix-mailbox.o + obj-$(CONFIG_BCM74110_MAILBOX) += bcm74110-mailbox.o - obj-$(CONFIG_QCOM_IPCC) += qcom-ipcc.o + obj-$(CONFIG_RISCV_SBI_MPXY_MBOX) += riscv-sbi-mpxy-mbox.o + +obj-$(CONFIG_STARFIVE_MBOX) += starfive_mailbox.o +ccflags-$(CONFIG_STARFIVE_MBOX) := -Wno-error=missing-prototypes diff --git a/target/linux/starfive/patches-6.18/0009-uart-8250-Add-dw-auto-flow-ctrl-support.patch b/target/linux/starfive/patches-6.18/0009-uart-8250-Add-dw-auto-flow-ctrl-support.patch index 92515582c61..9383402793f 100644 --- a/target/linux/starfive/patches-6.18/0009-uart-8250-Add-dw-auto-flow-ctrl-support.patch +++ b/target/linux/starfive/patches-6.18/0009-uart-8250-Add-dw-auto-flow-ctrl-support.patch @@ -17,18 +17,18 @@ Signed-off-by: Minda Chen --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c -@@ -810,6 +810,8 @@ int serial8250_register_8250_port(const - uart->dl_read = up->dl_read; - if (up->dl_write) - uart->dl_write = up->dl_write; -+ if (up->probe) -+ uart->probe = up->probe; +@@ -804,6 +804,8 @@ int serial8250_register_8250_port(const + uart->dl_read = up->dl_read; + if (up->dl_write) + uart->dl_write = up->dl_write; ++ if (up->probe) ++ uart->probe = up->probe; - if (uart->port.type != PORT_8250_CIR) { - if (uart_console_registered(&uart->port)) + /* Check the type (again)! It might have changed by the port.type assignment above. */ + if (uart->port.type != PORT_8250_CIR) { --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c -@@ -594,6 +594,9 @@ static int dw8250_probe(struct platform_ +@@ -775,6 +775,9 @@ static int dw8250_probe(struct platform_ data->msr_mask_off |= UART_MSR_TERI; } @@ -40,7 +40,7 @@ Signed-off-by: Minda Chen if (data->clk == NULL) --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c -@@ -319,6 +319,14 @@ static const struct serial8250_config ua +@@ -311,6 +311,14 @@ static const struct serial8250_config ua .rxtrig_bytes = {1, 8, 16, 30}, .flags = UART_CAP_FIFO | UART_CAP_AFE, }, @@ -55,7 +55,7 @@ Signed-off-by: Minda Chen }; /* Uart divisor latch read */ -@@ -1124,6 +1132,11 @@ static void autoconfig_16550a(struct uar +@@ -1057,6 +1065,11 @@ static void autoconfig_16550a(struct uar up->port.type = PORT_U6_16550A; up->capabilities |= UART_CAP_AFE; } @@ -67,14 +67,14 @@ Signed-off-by: Minda Chen } /* -@@ -2774,7 +2787,6 @@ serial8250_do_set_termios(struct uart_po - if (termios->c_cflag & CRTSCTS) - up->mcr |= UART_MCR_AFE; +@@ -2565,7 +2578,6 @@ static unsigned int serial8250_get_baud_ + min = port->uartclk / 16 / UART_DIV_MAX; + max = (port->uartclk + tolerance) / 16; } - /* - * Update the per-port timeout. - */ + * Ask the core to calculate the divisor for us. + * Allow 1% tolerance at the upper limit so uart clks marginally --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h @@ -141,6 +141,7 @@ struct uart_8250_port { diff --git a/target/linux/starfive/patches-6.18/0013-drivers-nvme-Add-precheck-and-delay-for-CQE-pending-.patch b/target/linux/starfive/patches-6.18/0013-drivers-nvme-Add-precheck-and-delay-for-CQE-pending-.patch index ef84c85305f..18bf27e0155 100644 --- a/target/linux/starfive/patches-6.18/0013-drivers-nvme-Add-precheck-and-delay-for-CQE-pending-.patch +++ b/target/linux/starfive/patches-6.18/0013-drivers-nvme-Add-precheck-and-delay-for-CQE-pending-.patch @@ -14,17 +14,17 @@ Signed-off-by: Kevin.xie --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c -@@ -28,6 +28,7 @@ +@@ -27,6 +27,7 @@ + #include #include #include - #include +#include #include "trace.h" #include "nvme.h" -@@ -1156,6 +1157,15 @@ static inline int nvme_poll_cq(struct nv +@@ -1368,6 +1369,15 @@ static inline bool nvme_poll_cq(struct n { - int found = 0; + bool found = false; + /* + * In some cases, such as udev trigger, cqe status may update @@ -36,5 +36,5 @@ Signed-off-by: Kevin.xie + udelay(1); + while (nvme_cqe_pending(nvmeq)) { - found++; + found = true; /* diff --git a/target/linux/starfive/patches-6.18/0014-riscv-Optimize-memcpy-with-aligned-version.patch b/target/linux/starfive/patches-6.18/0014-riscv-Optimize-memcpy-with-aligned-version.patch index 6b690ae9424..0ccbf04de30 100644 --- a/target/linux/starfive/patches-6.18/0014-riscv-Optimize-memcpy-with-aligned-version.patch +++ b/target/linux/starfive/patches-6.18/0014-riscv-Optimize-memcpy-with-aligned-version.patch @@ -27,15 +27,15 @@ Signed-off-by: Hal Feng lib-y += memset.o lib-y += memmove.o ifeq ($(CONFIG_KASAN_GENERIC)$(CONFIG_KASAN_SW_TAGS),) -@@ -16,6 +15,8 @@ lib-$(CONFIG_MMU) += uaccess.o +@@ -15,6 +14,8 @@ endif + lib-$(CONFIG_MMU) += uaccess.o lib-$(CONFIG_64BIT) += tishift.o lib-$(CONFIG_RISCV_ISA_ZICBOZ) += clear_page.o - lib-$(CONFIG_RISCV_ISA_ZBC) += crc32.o +lib-y += string.o +lib-y += memcpy_aligned.o - obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o lib-$(CONFIG_RISCV_ISA_V) += xor.o + lib-$(CONFIG_RISCV_ISA_V) += riscv_v_helpers.o --- a/arch/riscv/lib/memcpy.S +++ /dev/null @@ -1,110 +0,0 @@