diff --git a/config/x86_64/default b/config/x86_64/default index 720f54e..123c19e 100644 --- a/config/x86_64/default +++ b/config/x86_64/default @@ -3896,6 +3896,7 @@ CONFIG_SERIAL_8250_MANY_PORTS=y CONFIG_SERIAL_8250_SHARE_IRQ=y # CONFIG_SERIAL_8250_DETECT_IRQ is not set CONFIG_SERIAL_8250_RSA=y +CONFIG_SERIAL_8250_DWLIB=y # CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_DW=y CONFIG_SERIAL_8250_RT288X=y diff --git a/patches.suse/bonding-fix-active-backup-failover-for-current-ARP-s.patch b/patches.suse/bonding-fix-active-backup-failover-for-current-ARP-s.patch index 26cc015..013e9c0 100644 --- a/patches.suse/bonding-fix-active-backup-failover-for-current-ARP-s.patch +++ b/patches.suse/bonding-fix-active-backup-failover-for-current-ARP-s.patch @@ -3,8 +3,7 @@ From: Jiri Wiesner Date: Fri, 21 Aug 2020 10:42:13 +0200 Subject: bonding: fix active-backup failover for current ARP slave Git-commit: 0410d07190961ac526f05085765a8d04d926545b -Patch-mainline: Queued in subsystem maintainer repository -Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git +Patch-mainline: v5.9-rc2 References: bsc#1174771 When the ARP monitor is used for link detection, ARP replies are diff --git a/patches.suse/powerpc-Fix-P10-PVR-revision-in-proc-cpuinfo-for-SMT.patch b/patches.suse/powerpc-Fix-P10-PVR-revision-in-proc-cpuinfo-for-SMT.patch index 67a77b3..812f3f9 100644 --- a/patches.suse/powerpc-Fix-P10-PVR-revision-in-proc-cpuinfo-for-SMT.patch +++ b/patches.suse/powerpc-Fix-P10-PVR-revision-in-proc-cpuinfo-for-SMT.patch @@ -4,8 +4,7 @@ Date: Mon, 3 Aug 2020 13:56:00 +1000 Subject: [PATCH] powerpc: Fix P10 PVR revision in /proc/cpuinfo for SMT4 cores References: jsc#SLE-13521 -Patch-mainline: queued -Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux +Patch-mainline: v5.9-rc2 Git-commit: 030a2c689fb46e1690f7ded8b194bab7678efb28 On POWER10 bit 12 in the PVR indicates if the core is SMT4 or SMT8. diff --git a/patches.suse/powerpc-pseries-Do-not-initiate-shutdown-when-system.patch b/patches.suse/powerpc-pseries-Do-not-initiate-shutdown-when-system.patch index da4deca..eed7ba4 100644 --- a/patches.suse/powerpc-pseries-Do-not-initiate-shutdown-when-system.patch +++ b/patches.suse/powerpc-pseries-Do-not-initiate-shutdown-when-system.patch @@ -5,8 +5,7 @@ Subject: [PATCH] powerpc/pseries: Do not initiate shutdown when system is running on UPS References: bsc#1175440 ltc#187574 -Patch-mainline: queued -Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux +Patch-mainline: v5.9-rc2 Git-commit: 90a9b102eddf6a3f987d15f4454e26a2532c1c98 As per PAPR we have to look for both EPOW sensor value and event diff --git a/patches.suse/serial-8250_dw-split-Synopsys-DesignWare-8250-common.patch b/patches.suse/serial-8250_dw-split-Synopsys-DesignWare-8250-common.patch new file mode 100644 index 0000000..462f4a5 --- /dev/null +++ b/patches.suse/serial-8250_dw-split-Synopsys-DesignWare-8250-common.patch @@ -0,0 +1,213 @@ +From 136e0ab99b22378e3ff7d54f799a3a329316e869 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Tue, 6 Aug 2019 12:43:16 +0300 +Subject: [PATCH] serial: 8250_dw: split Synopsys DesignWare 8250 common functions +Git-commit: 136e0ab99b22378e3ff7d54f799a3a329316e869 +Patch-mainline: v5.4-rc1 +References: jsc#SLE-13436 + +We would like to use same functions in the couple of drivers for +Synopsys DesignWare 8250 UART. Split them from 8250_dw into new brand +library module which users will select explicitly. + +Signed-off-by: Andy Shevchenko +Reviewed-by: Heikki Krogerus +Link: https://lore.kernel.org/r/20190806094322.64987-3-andriy.shevchenko@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/tty/serial/8250/8250_dwlib.c | 126 +++++++++++++++++++++++++++++++++++ + drivers/tty/serial/8250/8250_dwlib.h | 19 ++++++ + drivers/tty/serial/8250/Kconfig | 3 + + drivers/tty/serial/8250/Makefile | 1 + + 4 files changed, 149 insertions(+) + create mode 100644 drivers/tty/serial/8250/8250_dwlib.c + create mode 100644 drivers/tty/serial/8250/8250_dwlib.h + +diff --git a/drivers/tty/serial/8250/8250_dwlib.c b/drivers/tty/serial/8250/8250_dwlib.c +new file mode 100644 +index 000000000000..6d6a78eead3e +--- /dev/null ++++ b/drivers/tty/serial/8250/8250_dwlib.c +@@ -0,0 +1,126 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* Synopsys DesignWare 8250 library. */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "8250_dwlib.h" ++ ++/* Offsets for the DesignWare specific registers */ ++#define DW_UART_DLF 0xc0 /* Divisor Latch Fraction Register */ ++#define DW_UART_CPR 0xf4 /* Component Parameter Register */ ++#define DW_UART_UCV 0xf8 /* UART Component Version */ ++ ++/* Component Parameter Register bits */ ++#define DW_UART_CPR_ABP_DATA_WIDTH (3 << 0) ++#define DW_UART_CPR_AFCE_MODE (1 << 4) ++#define DW_UART_CPR_THRE_MODE (1 << 5) ++#define DW_UART_CPR_SIR_MODE (1 << 6) ++#define DW_UART_CPR_SIR_LP_MODE (1 << 7) ++#define DW_UART_CPR_ADDITIONAL_FEATURES (1 << 8) ++#define DW_UART_CPR_FIFO_ACCESS (1 << 9) ++#define DW_UART_CPR_FIFO_STAT (1 << 10) ++#define DW_UART_CPR_SHADOW (1 << 11) ++#define DW_UART_CPR_ENCODED_PARMS (1 << 12) ++#define DW_UART_CPR_DMA_EXTRA (1 << 13) ++#define DW_UART_CPR_FIFO_MODE (0xff << 16) ++ ++/* Helper for FIFO size calculation */ ++#define DW_UART_CPR_FIFO_SIZE(a) (((a >> 16) & 0xff) * 16) ++ ++static inline u32 dw8250_readl_ext(struct uart_port *p, int offset) ++{ ++ if (p->iotype == UPIO_MEM32BE) ++ return ioread32be(p->membase + offset); ++ return readl(p->membase + offset); ++} ++ ++static inline void dw8250_writel_ext(struct uart_port *p, int offset, u32 reg) ++{ ++ if (p->iotype == UPIO_MEM32BE) ++ iowrite32be(reg, p->membase + offset); ++ else ++ writel(reg, p->membase + offset); ++} ++ ++/* ++ * divisor = div(I) + div(F) ++ * "I" means integer, "F" means fractional ++ * quot = div(I) = clk / (16 * baud) ++ * frac = div(F) * 2^dlf_size ++ * ++ * let rem = clk % (16 * baud) ++ * we have: div(F) * (16 * baud) = rem ++ * so frac = 2^dlf_size * rem / (16 * baud) = (rem << dlf_size) / (16 * baud) ++ */ ++static unsigned int dw8250_get_divisor(struct uart_port *p, unsigned int baud, ++ unsigned int *frac) ++{ ++ unsigned int quot, rem, base_baud = baud * 16; ++ struct dw8250_port_data *d = p->private_data; ++ ++ quot = p->uartclk / base_baud; ++ rem = p->uartclk % base_baud; ++ *frac = DIV_ROUND_CLOSEST(rem << d->dlf_size, base_baud); ++ ++ return quot; ++} ++ ++static void dw8250_set_divisor(struct uart_port *p, unsigned int baud, ++ unsigned int quot, unsigned int quot_frac) ++{ ++ dw8250_writel_ext(p, DW_UART_DLF, quot_frac); ++ serial8250_do_set_divisor(p, baud, quot, quot_frac); ++} ++ ++void dw8250_setup_port(struct uart_port *p) ++{ ++ struct uart_8250_port *up = up_to_u8250p(p); ++ u32 reg; ++ ++ /* ++ * If the Component Version Register returns zero, we know that ++ * ADDITIONAL_FEATURES are not enabled. No need to go any further. ++ */ ++ reg = dw8250_readl_ext(p, DW_UART_UCV); ++ if (!reg) ++ return; ++ ++ dev_dbg(p->dev, "Designware UART version %c.%c%c\n", ++ (reg >> 24) & 0xff, (reg >> 16) & 0xff, (reg >> 8) & 0xff); ++ ++ dw8250_writel_ext(p, DW_UART_DLF, ~0U); ++ reg = dw8250_readl_ext(p, DW_UART_DLF); ++ dw8250_writel_ext(p, DW_UART_DLF, 0); ++ ++ if (reg) { ++ struct dw8250_port_data *d = p->private_data; ++ ++ d->dlf_size = fls(reg); ++ p->get_divisor = dw8250_get_divisor; ++ p->set_divisor = dw8250_set_divisor; ++ } ++ ++ reg = dw8250_readl_ext(p, DW_UART_CPR); ++ if (!reg) ++ return; ++ ++ /* Select the type based on FIFO */ ++ if (reg & DW_UART_CPR_FIFO_MODE) { ++ p->type = PORT_16550A; ++ p->flags |= UPF_FIXED_TYPE; ++ p->fifosize = DW_UART_CPR_FIFO_SIZE(reg); ++ up->capabilities = UART_CAP_FIFO; ++ } ++ ++ if (reg & DW_UART_CPR_AFCE_MODE) ++ up->capabilities |= UART_CAP_AFE; ++ ++ if (reg & DW_UART_CPR_SIR_MODE) ++ up->capabilities |= UART_CAP_IRDA; ++} ++EXPORT_SYMBOL_GPL(dw8250_setup_port); +diff --git a/drivers/tty/serial/8250/8250_dwlib.h b/drivers/tty/serial/8250/8250_dwlib.h +new file mode 100644 +index 000000000000..87a4db2a8aba +--- /dev/null ++++ b/drivers/tty/serial/8250/8250_dwlib.h +@@ -0,0 +1,19 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* Synopsys DesignWare 8250 library header file. */ ++ ++#include ++ ++#include "8250.h" ++ ++struct dw8250_port_data { ++ /* Port properties */ ++ int line; ++ ++ /* DMA operations */ ++ struct uart_8250_dma dma; ++ ++ /* Hardware configuration */ ++ u8 dlf_size; ++}; ++ ++void dw8250_setup_port(struct uart_port *p); +diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig +index 509f6a3bb9ff..d628258fb4cf 100644 +--- a/drivers/tty/serial/8250/Kconfig ++++ b/drivers/tty/serial/8250/Kconfig +@@ -314,6 +314,9 @@ config SERIAL_8250_RSA + + If you don't have such card, or if unsure, say N. + ++config SERIAL_8250_DWLIB ++ bool ++ + config SERIAL_8250_ACORN + tristate "Acorn expansion card serial port support" + depends on ARCH_ACORN && SERIAL_8250 +diff --git a/drivers/tty/serial/8250/Makefile b/drivers/tty/serial/8250/Makefile +index 18751bc63a84..9b451d81588b 100644 +--- a/drivers/tty/serial/8250/Makefile ++++ b/drivers/tty/serial/8250/Makefile +@@ -8,6 +8,7 @@ obj-$(CONFIG_SERIAL_8250) += 8250.o 8250_base.o + 8250-$(CONFIG_SERIAL_8250_PNP) += 8250_pnp.o + 8250_base-y := 8250_port.o + 8250_base-$(CONFIG_SERIAL_8250_DMA) += 8250_dma.o ++8250_base-$(CONFIG_SERIAL_8250_DWLIB) += 8250_dwlib.o + 8250_base-$(CONFIG_SERIAL_8250_FINTEK) += 8250_fintek.o + obj-$(CONFIG_SERIAL_8250_GSC) += 8250_gsc.o + obj-$(CONFIG_SERIAL_8250_PCI) += 8250_pci.o +-- +2.16.4 + diff --git a/patches.suse/serial-8250_lpss-Add-setup-for-Elkhart-Lake-ports.patch b/patches.suse/serial-8250_lpss-Add-setup-for-Elkhart-Lake-ports.patch new file mode 100644 index 0000000..ca5b3fa --- /dev/null +++ b/patches.suse/serial-8250_lpss-Add-setup-for-Elkhart-Lake-ports.patch @@ -0,0 +1,51 @@ +From 1b91d97c66ef32a80dc3098df2f5fe3392342625 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Thu, 5 Mar 2020 15:08:22 +0200 +Subject: [PATCH] serial: 8250_lpss: Add ->setup() for Elkhart Lake ports +Git-commit: 1b91d97c66ef32a80dc3098df2f5fe3392342625 +Patch-mainline: v5.7-rc1 +References: jsc#SLE-13436 + +The ->setup() callback is mandatory for the devices. +Provide it for Elkhart Lake UART ports. + +Note, for time being it's empty, but in the future it might require +an additional configuration such as DMA. + +Reported-by: Raymond Tan +Signed-off-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20200305130822.36850-1-andriy.shevchenko@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/tty/serial/8250/8250_lpss.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c +index 60eff3240c8a..4dee8a9e0c95 100644 +--- a/drivers/tty/serial/8250/8250_lpss.c ++++ b/drivers/tty/serial/8250/8250_lpss.c +@@ -156,6 +156,11 @@ static int byt_serial_setup(struct lpss8250 *lpss, struct uart_port *port) + return 0; + } + ++static int ehl_serial_setup(struct lpss8250 *lpss, struct uart_port *port) ++{ ++ return 0; ++} ++ + #ifdef CONFIG_SERIAL_8250_DMA + static const struct dw_dma_platform_data qrk_serial_dma_pdata = { + .nr_channels = 2, +@@ -356,6 +361,7 @@ static const struct lpss8250_board byt_board = { + static const struct lpss8250_board ehl_board = { + .freq = 200000000, + .base_baud = 12500000, ++ .setup = ehl_serial_setup, + }; + + static const struct lpss8250_board qrk_board = { +-- +2.16.4 + diff --git a/patches.suse/serial-8250_lpss-Enable-HS-UART-on-Elkhart-Lake.patch b/patches.suse/serial-8250_lpss-Enable-HS-UART-on-Elkhart-Lake.patch new file mode 100644 index 0000000..2686623 --- /dev/null +++ b/patches.suse/serial-8250_lpss-Enable-HS-UART-on-Elkhart-Lake.patch @@ -0,0 +1,70 @@ +From 4f912b898dc2bc76ed593ac78077085cc81a3523 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Tue, 6 Aug 2019 12:43:22 +0300 +Subject: [PATCH] serial: 8250_lpss: Enable HS UART on Elkhart Lake +Git-commit: 4f912b898dc2bc76ed593ac78077085cc81a3523 +Patch-mainline: v5.4-rc1 +References: jsc#SLE-13436 + +Intel Elkhart Lake may use High Speed UART from OSE IP block. +This is different to what we have in main LPSS, though compatible +with older version of it, which is handled by this driver. + +Enable OSE HS UART on Intel Elkhart Lake by adding PCI IDs. + +Signed-off-by: Andy Shevchenko +Reviewed-by: Heikki Krogerus +Link: https://lore.kernel.org/r/20190806094322.64987-9-andriy.shevchenko@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/tty/serial/8250/8250_lpss.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c +index cfe0ab443250..5f72ef3ea574 100644 +--- a/drivers/tty/serial/8250/8250_lpss.c ++++ b/drivers/tty/serial/8250/8250_lpss.c +@@ -24,6 +24,13 @@ + #define PCI_DEVICE_ID_INTEL_BSW_UART1 0x228a + #define PCI_DEVICE_ID_INTEL_BSW_UART2 0x228c + ++#define PCI_DEVICE_ID_INTEL_EHL_UART0 0x4b96 ++#define PCI_DEVICE_ID_INTEL_EHL_UART1 0x4b97 ++#define PCI_DEVICE_ID_INTEL_EHL_UART2 0x4b98 ++#define PCI_DEVICE_ID_INTEL_EHL_UART3 0x4b99 ++#define PCI_DEVICE_ID_INTEL_EHL_UART4 0x4b9a ++#define PCI_DEVICE_ID_INTEL_EHL_UART5 0x4b9b ++ + #define PCI_DEVICE_ID_INTEL_BDW_UART1 0x9ce3 + #define PCI_DEVICE_ID_INTEL_BDW_UART2 0x9ce4 + +@@ -349,6 +356,11 @@ static const struct lpss8250_board byt_board = { + .setup = byt_serial_setup, + }; + ++static const struct lpss8250_board ehl_board = { ++ .freq = 200000000, ++ .base_baud = 12500000, ++}; ++ + static const struct lpss8250_board qrk_board = { + .freq = 44236800, + .base_baud = 2764800, +@@ -358,6 +370,12 @@ static const struct lpss8250_board qrk_board = { + + static const struct pci_device_id pci_ids[] = { + { PCI_DEVICE_DATA(INTEL, QRK_UARTx, &qrk_board) }, ++ { PCI_DEVICE_DATA(INTEL, EHL_UART0, &ehl_board) }, ++ { PCI_DEVICE_DATA(INTEL, EHL_UART1, &ehl_board) }, ++ { PCI_DEVICE_DATA(INTEL, EHL_UART2, &ehl_board) }, ++ { PCI_DEVICE_DATA(INTEL, EHL_UART3, &ehl_board) }, ++ { PCI_DEVICE_DATA(INTEL, EHL_UART4, &ehl_board) }, ++ { PCI_DEVICE_DATA(INTEL, EHL_UART5, &ehl_board) }, + { PCI_DEVICE_DATA(INTEL, BYT_UART1, &byt_board) }, + { PCI_DEVICE_DATA(INTEL, BYT_UART2, &byt_board) }, + { PCI_DEVICE_DATA(INTEL, BSW_UART1, &byt_board) }, +-- +2.16.4 + diff --git a/patches.suse/serial-8250_lpss-Get-rid-of-custom-LPSS_DEVICE-macro.patch b/patches.suse/serial-8250_lpss-Get-rid-of-custom-LPSS_DEVICE-macro.patch new file mode 100644 index 0000000..8ab2b53 --- /dev/null +++ b/patches.suse/serial-8250_lpss-Get-rid-of-custom-LPSS_DEVICE-macro.patch @@ -0,0 +1,56 @@ +From d53aa935b7d17ba198ebe96f31c7879a66428e08 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Tue, 6 Aug 2019 12:43:21 +0300 +Subject: [PATCH] serial: 8250_lpss: Get rid of custom LPSS_DEVICE() macro +Git-commit: d53aa935b7d17ba198ebe96f31c7879a66428e08 +Patch-mainline: v5.4-rc1 +References: jsc#SLE-13436 + +Since PCI core provides a generic PCI_DEVICE_DATA() macro, +replace LPSS_DEVICE() with former one. + +No functional change intended. + +Signed-off-by: Andy Shevchenko +Reviewed-by: Heikki Krogerus +Link: https://lore.kernel.org/r/20190806094322.64987-8-andriy.shevchenko@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/tty/serial/8250/8250_lpss.c | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c +index 2bb30e688433..cfe0ab443250 100644 +--- a/drivers/tty/serial/8250/8250_lpss.c ++++ b/drivers/tty/serial/8250/8250_lpss.c +@@ -356,17 +356,15 @@ static const struct lpss8250_board qrk_board = { + .exit = qrk_serial_exit, + }; + +-#define LPSS_DEVICE(id, board) { PCI_VDEVICE(INTEL, id), (kernel_ulong_t)&board } +- + static const struct pci_device_id pci_ids[] = { +- LPSS_DEVICE(PCI_DEVICE_ID_INTEL_QRK_UARTx, qrk_board), +- LPSS_DEVICE(PCI_DEVICE_ID_INTEL_BYT_UART1, byt_board), +- LPSS_DEVICE(PCI_DEVICE_ID_INTEL_BYT_UART2, byt_board), +- LPSS_DEVICE(PCI_DEVICE_ID_INTEL_BSW_UART1, byt_board), +- LPSS_DEVICE(PCI_DEVICE_ID_INTEL_BSW_UART2, byt_board), +- LPSS_DEVICE(PCI_DEVICE_ID_INTEL_BDW_UART1, byt_board), +- LPSS_DEVICE(PCI_DEVICE_ID_INTEL_BDW_UART2, byt_board), +- { }, ++ { PCI_DEVICE_DATA(INTEL, QRK_UARTx, &qrk_board) }, ++ { PCI_DEVICE_DATA(INTEL, BYT_UART1, &byt_board) }, ++ { PCI_DEVICE_DATA(INTEL, BYT_UART2, &byt_board) }, ++ { PCI_DEVICE_DATA(INTEL, BSW_UART1, &byt_board) }, ++ { PCI_DEVICE_DATA(INTEL, BSW_UART2, &byt_board) }, ++ { PCI_DEVICE_DATA(INTEL, BDW_UART1, &byt_board) }, ++ { PCI_DEVICE_DATA(INTEL, BDW_UART2, &byt_board) }, ++ { } + }; + MODULE_DEVICE_TABLE(pci, pci_ids); + +-- +2.16.4 + diff --git a/patches.suse/serial-8250_lpss-Switch-over-to-MSI-interrupts.patch b/patches.suse/serial-8250_lpss-Switch-over-to-MSI-interrupts.patch new file mode 100644 index 0000000..10c841e --- /dev/null +++ b/patches.suse/serial-8250_lpss-Switch-over-to-MSI-interrupts.patch @@ -0,0 +1,87 @@ +From 254cc7743e847780655025c1d81a9c15854bf236 Mon Sep 17 00:00:00 2001 +From: Felipe Balbi +Date: Tue, 1 Oct 2019 14:58:25 +0300 +Subject: [PATCH] serial: 8250_lpss: Switch over to MSI interrupts +Git-commit: 254cc7743e847780655025c1d81a9c15854bf236 +Patch-mainline: v5.5-rc1 +References: jsc#SLE-13436 + +Some devices support MSI interrupts. Let's at least try to use them in +platforms that provide MSI capability. + +While at that, remove the now duplicated code from qrp_serial_setup(). + +Signed-off-by: Felipe Balbi +Link: https://lore.kernel.org/r/20191001115825.795700-1-felipe.balbi@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/tty/serial/8250/8250_lpss.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c +index 5f72ef3ea574..60eff3240c8a 100644 +--- a/drivers/tty/serial/8250/8250_lpss.c ++++ b/drivers/tty/serial/8250/8250_lpss.c +@@ -221,17 +221,6 @@ static void qrk_serial_exit_dma(struct lpss8250 *lpss) {} + + static int qrk_serial_setup(struct lpss8250 *lpss, struct uart_port *port) + { +- struct pci_dev *pdev = to_pci_dev(port->dev); +- int ret; +- +- pci_set_master(pdev); +- +- ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); +- if (ret < 0) +- return ret; +- +- port->irq = pci_irq_vector(pdev, 0); +- + qrk_serial_setup_dma(lpss, port); + return 0; + } +@@ -293,16 +282,22 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id) + if (ret) + return ret; + ++ pci_set_master(pdev); ++ + lpss = devm_kzalloc(&pdev->dev, sizeof(*lpss), GFP_KERNEL); + if (!lpss) + return -ENOMEM; + ++ ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); ++ if (ret < 0) ++ return ret; ++ + lpss->board = (struct lpss8250_board *)id->driver_data; + + memset(&uart, 0, sizeof(struct uart_8250_port)); + + uart.port.dev = &pdev->dev; +- uart.port.irq = pdev->irq; ++ uart.port.irq = pci_irq_vector(pdev, 0); + uart.port.private_data = &lpss->data; + uart.port.type = PORT_16550A; + uart.port.iotype = UPIO_MEM; +@@ -337,6 +332,7 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id) + err_exit: + if (lpss->board->exit) + lpss->board->exit(lpss); ++ pci_free_irq_vectors(pdev); + return ret; + } + +@@ -348,6 +344,7 @@ static void lpss8250_remove(struct pci_dev *pdev) + + if (lpss->board->exit) + lpss->board->exit(lpss); ++ pci_free_irq_vectors(pdev); + } + + static const struct lpss8250_board byt_board = { +-- +2.16.4 + diff --git a/patches.suse/serial-8250_lpss-add-fractional-divisor-support.patch b/patches.suse/serial-8250_lpss-add-fractional-divisor-support.patch new file mode 100644 index 0000000..03cc96a --- /dev/null +++ b/patches.suse/serial-8250_lpss-add-fractional-divisor-support.patch @@ -0,0 +1,62 @@ +From b4d0aac23e355933e963492bd71f98a36819137a Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Tue, 6 Aug 2019 12:43:19 +0300 +Subject: [PATCH] serial: 8250_lpss: add fractional divisor support +Git-commit: b4d0aac23e355933e963492bd71f98a36819137a +Patch-mainline: v5.4-rc1 +References: jsc#SLE-13436 + +For Synopsys DesignWare 8250 uart which version >= 4.00a, there's a +valid divisor latch fraction register. + +Now the preparation is done, it's easy to add the feature support. +This patch firstly tries to get the fractional divisor width during +probe, then setups specific get_divisor() and set_divisor() hook. + +Among other changes the FIFO size is now retrieved from the hardware. + +Signed-off-by: Andy Shevchenko +Reviewed-by: Heikki Krogerus +Link: https://lore.kernel.org/r/20190806094322.64987-6-andriy.shevchenko@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/tty/serial/8250/8250_lpss.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c +index 3bf23770c188..0c6aa990db3d 100644 +--- a/drivers/tty/serial/8250/8250_lpss.c ++++ b/drivers/tty/serial/8250/8250_lpss.c +@@ -113,7 +113,6 @@ static unsigned int byt_get_mctrl(struct uart_port *port) + static int byt_serial_setup(struct lpss8250 *lpss, struct uart_port *port) + { + struct dw_dma_slave *param = &lpss->dma_param; +- struct uart_8250_port *up = up_to_u8250p(port); + struct pci_dev *pdev = to_pci_dev(port->dev); + unsigned int dma_devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0); + struct pci_dev *dma_dev = pci_get_slot(pdev->bus, dma_devfn); +@@ -139,10 +138,6 @@ static int byt_serial_setup(struct lpss8250 *lpss, struct uart_port *port) + param->m_master = 0; + param->p_master = 1; + +- /* TODO: Detect FIFO size automaticaly for DesignWare 8250 */ +- port->fifosize = 64; +- up->tx_loadsz = 64; +- + lpss->dma_maxburst = 16; + + port->set_termios = byt_set_termios; +@@ -316,6 +311,8 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id) + if (ret) + return ret; + ++ dw8250_setup_port(&uart.port); ++ + ret = lpss8250_dma_setup(lpss, &uart); + if (ret) + goto err_exit; +-- +2.16.4 + diff --git a/patches.suse/serial-8250_lpss-switch-to-use-8250_dwlib-library.patch b/patches.suse/serial-8250_lpss-switch-to-use-8250_dwlib-library.patch new file mode 100644 index 0000000..fcb41d3 --- /dev/null +++ b/patches.suse/serial-8250_lpss-switch-to-use-8250_dwlib-library.patch @@ -0,0 +1,124 @@ +From bf414f5520ef856f6026bcd39942704d7004f7f0 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Tue, 6 Aug 2019 12:43:18 +0300 +Subject: [PATCH] serial: 8250_lpss: switch to use 8250_dwlib library +Git-commit: bf414f5520ef856f6026bcd39942704d7004f7f0 +Patch-mainline: v5.4-rc1 +References: jsc#SLE-13436 + +Since we have a common library module for Synopsys DesignWare UART, +let us use it. + +Signed-off-by: Andy Shevchenko +Reviewed-by: Heikki Krogerus +Link: https://lore.kernel.org/r/20190806094322.64987-5-andriy.shevchenko@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/tty/serial/8250/8250_lpss.c | 22 +++++++++++++--------- + drivers/tty/serial/8250/Kconfig | 1 + + 2 files changed, 14 insertions(+), 9 deletions(-) + +diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c +index d07e431110d9..3bf23770c188 100644 +--- a/drivers/tty/serial/8250/8250_lpss.c ++++ b/drivers/tty/serial/8250/8250_lpss.c +@@ -14,7 +14,7 @@ + #include + #include + +-#include "8250.h" ++#include "8250_dwlib.h" + + #define PCI_DEVICE_ID_INTEL_QRK_UARTx 0x0936 + +@@ -48,21 +48,25 @@ struct lpss8250_board { + }; + + struct lpss8250 { +- int line; ++ struct dw8250_port_data data; + struct lpss8250_board *board; + + /* DMA parameters */ +- struct uart_8250_dma dma; + struct dw_dma_chip dma_chip; + struct dw_dma_slave dma_param; + u8 dma_maxburst; + }; + ++static inline struct lpss8250 *to_lpss8250(struct dw8250_port_data *data) ++{ ++ return container_of(data, struct lpss8250, data); ++} ++ + static void byt_set_termios(struct uart_port *p, struct ktermios *termios, + struct ktermios *old) + { + unsigned int baud = tty_termios_baud_rate(termios); +- struct lpss8250 *lpss = p->private_data; ++ struct lpss8250 *lpss = to_lpss8250(p->private_data); + unsigned long fref = lpss->board->freq, fuart = baud * 16; + unsigned long w = BIT(15) - 1; + unsigned long m, n; +@@ -163,7 +167,7 @@ static const struct dw_dma_platform_data qrk_serial_dma_pdata = { + + static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) + { +- struct uart_8250_dma *dma = &lpss->dma; ++ struct uart_8250_dma *dma = &lpss->data.dma; + struct dw_dma_chip *chip = &lpss->dma_chip; + struct dw_dma_slave *param = &lpss->dma_param; + struct pci_dev *pdev = to_pci_dev(port->dev); +@@ -247,7 +251,7 @@ static bool lpss8250_dma_filter(struct dma_chan *chan, void *param) + + static int lpss8250_dma_setup(struct lpss8250 *lpss, struct uart_8250_port *port) + { +- struct uart_8250_dma *dma = &lpss->dma; ++ struct uart_8250_dma *dma = &lpss->data.dma; + struct dw_dma_slave *rx_param, *tx_param; + struct device *dev = port->port.dev; + +@@ -296,7 +300,7 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id) + + uart.port.dev = &pdev->dev; + uart.port.irq = pdev->irq; +- uart.port.private_data = lpss; ++ uart.port.private_data = &lpss->data; + uart.port.type = PORT_16550A; + uart.port.iotype = UPIO_MEM; + uart.port.regshift = 2; +@@ -320,7 +324,7 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id) + if (ret < 0) + goto err_exit; + +- lpss->line = ret; ++ lpss->data.line = ret; + + pci_set_drvdata(pdev, lpss); + return 0; +@@ -335,7 +339,7 @@ static void lpss8250_remove(struct pci_dev *pdev) + { + struct lpss8250 *lpss = pci_get_drvdata(pdev); + +- serial8250_unregister_port(lpss->line); ++ serial8250_unregister_port(lpss->data.line); + + if (lpss->board->exit) + lpss->board->exit(lpss); +diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig +index 90abf97b378d..ff5d142bbd70 100644 +--- a/drivers/tty/serial/8250/Kconfig ++++ b/drivers/tty/serial/8250/Kconfig +@@ -444,6 +444,7 @@ config SERIAL_8250_LPSS + default SERIAL_8250 + depends on SERIAL_8250 && PCI + depends on X86 || COMPILE_TEST ++ select SERIAL_8250_DWLIB + select DW_DMAC_CORE if SERIAL_8250_DMA + select DW_DMAC_PCI if (SERIAL_8250_DMA && X86_INTEL_LPSS) + select RATIONAL +-- +2.16.4 + diff --git a/series.conf b/series.conf index 07824b5..2346642 100644 --- a/series.conf +++ b/series.conf @@ -816,6 +816,11 @@ patches.suse/USB-usbcore-Fix-slab-out-of-bounds-bug-during-device.patch patches.suse/serial-stm32-Use-__maybe_unused-instead-of-if-CONFIG.patch patches.suse/tty-serial-fsl_lpuart-Use-appropriate-lpuart32_-I-O-.patch + patches.suse/serial-8250_dw-split-Synopsys-DesignWare-8250-common.patch + patches.suse/serial-8250_lpss-switch-to-use-8250_dwlib-library.patch + patches.suse/serial-8250_lpss-add-fractional-divisor-support.patch + patches.suse/serial-8250_lpss-Get-rid-of-custom-LPSS_DEVICE-macro.patch + patches.suse/serial-8250_lpss-Enable-HS-UART-on-Elkhart-Lake.patch patches.suse/tty-serial-atmel-reschedule-TX-after-RX-was-started.patch patches.suse/serial-tegra-add-internal-loopback-functionality.patch patches.suse/serial-tegra-protect-IER-against-LCR.DLAB.patch @@ -7786,6 +7791,7 @@ patches.suse/pci-iproc-use-inbound-resources-for-setup.patch patches.suse/pci-rcar-use-inbound-resources-for-setup.patch patches.suse/tools-PCI-Fix-fd-leakage.patch + patches.suse/serial-8250_lpss-Switch-over-to-MSI-interrupts.patch patches.suse/tty-serial-msm_serial-Fix-flow-control.patch patches.suse/serial-8250_dw-Avoid-double-error-messaging-when-IRQ.patch patches.suse/serial-8250-mtk-Use-platform_get_irq_optional-for-op.patch @@ -11377,6 +11383,7 @@ patches.suse/mmc-sdhci-introduce-sdhci_set_power_and_bus_voltage.patch patches.suse/mmc-sdhci-iproc-add-custom-set_power-callback-for-bcm2711.patch patches.suse/serial-8250_tegra-Create-Tegra-specific-8250-driver.patch + patches.suse/serial-8250_lpss-Add-setup-for-Elkhart-Lake-ports.patch patches.suse/vt-vt_ioctl-remove-unnecessary-console-allocation-ch.patch patches.suse/serial-sprd-Fix-a-dereference-warning.patch patches.suse/vt-vt_ioctl-fix-VT_DISALLOCATE-freeing-in-use-virtua.patch @@ -14391,11 +14398,8 @@ patches.suse/ASoC-intel-Fix-memleak-in-sst_media_open.patch patches.suse/ALSA-hda-realtek-Add-quirk-for-Samsung-Galaxy-Book-I.patch patches.suse/ALSA-hda-avoid-reset-of-sdo_limit.patch - - # netdev/net patches.suse/bonding-fix-active-backup-failover-for-current-ARP-s.patch - - # powerpc/linux fixes + patches.suse/powerpc-Fix-P10-PVR-revision-in-proc-cpuinfo-for-SMT.patch patches.suse/powerpc-pseries-Do-not-initiate-shutdown-when-system.patch # mkp/scsi queue @@ -14407,9 +14411,6 @@ patches.suse/scsi-smartpqi-add-raid-bypass-counter.patch patches.suse/scsi-smartpqi-bump-version-to-1-2-16-010.patch - # powerpc/linux fixes - patches.suse/powerpc-Fix-P10-PVR-revision-in-proc-cpuinfo-for-SMT.patch - ######################################################## # end of sorted patches ########################################################