summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/8250/8250_pci.c
AgeCommit message (Collapse)Author
2017-11-28serial: 8250_pci: Add Amazon PCI serial device IDMatt Wilson
This device will be used in future Amazon EC2 instances as the primary serial port (i.e., data sent to this port will be available via the GetConsoleOuput [1] EC2 API). [1] http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetConsoleOutput.html Cc: stable <stable@vger.kernel.org> Signed-off-by: Matt Wilson <msw@amazon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-08tty: serial: Remove redundant license textGreg Kroah-Hartman
Now that the SPDX tag is in all tty files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Jiri Slaby <jslaby@suse.com> Cc: Eric Anholt <eric@anholt.net> Cc: Stefan Wahren <stefan.wahren@i2se.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: Joachim Eastwood <manabian@gmail.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Tobias Klauser <tklauser@distanz.ch> Cc: Russell King <linux@armlinux.org.uk> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Richard Genoud <richard.genoud@gmail.com> Cc: Alexander Shiyan <shc_work@mail.ru> Cc: Baruch Siach <baruch@tkos.co.il> Cc: Pat Gefre <pfg@sgi.com> Cc: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: Sylvain Lemieux <slemieux.tyco@gmail.com> Cc: Carlo Caione <carlo@caione.org> Cc: Kevin Hilman <khilman@baylibre.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Sudeep Holla <sudeep.holla@arm.com> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Andy Gross <andy.gross@linaro.org> Cc: David Brown <david.brown@linaro.org> Cc: "Andreas Färber" <afaerber@suse.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Laxman Dewangan <ldewangan@nvidia.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Barry Song <baohua@kernel.org> Cc: Patrice Chotard <patrice.chotard@st.com> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: Chris Metcalf <cmetcalf@mellanox.com> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Timur Tabi <timur@tabi.org> Cc: Tony Prisk <linux@prisktech.co.nz> Cc: Michal Simek <michal.simek@xilinx.com> Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-08tty: add SPDX identifiers to all remaining files in drivers/tty/Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/tty files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Jiri Slaby <jslaby@suse.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Chris Metcalf <cmetcalf@mellanox.com> Cc: Jiri Kosina <jikos@kernel.org> Cc: David Sterba <dsterba@suse.com> Cc: James Hogan <jhogan@kernel.org> Cc: Rob Herring <robh@kernel.org> Cc: Eric Anholt <eric@anholt.net> Cc: Stefan Wahren <stefan.wahren@i2se.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: Joachim Eastwood <manabian@gmail.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Tobias Klauser <tklauser@distanz.ch> Cc: Russell King <linux@armlinux.org.uk> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Richard Genoud <richard.genoud@gmail.com> Cc: Alexander Shiyan <shc_work@mail.ru> Cc: Baruch Siach <baruch@tkos.co.il> Cc: "Maciej W. Rozycki" <macro@linux-mips.org> Cc: "Uwe Kleine-König" <kernel@pengutronix.de> Cc: Pat Gefre <pfg@sgi.com> Cc: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: Sylvain Lemieux <slemieux.tyco@gmail.com> Cc: Carlo Caione <carlo@caione.org> Cc: Kevin Hilman <khilman@baylibre.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Sudeep Holla <sudeep.holla@arm.com> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Andy Gross <andy.gross@linaro.org> Cc: David Brown <david.brown@linaro.org> Cc: "Andreas Färber" <afaerber@suse.de> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Laxman Dewangan <ldewangan@nvidia.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Barry Song <baohua@kernel.org> Cc: Patrice Chotard <patrice.chotard@st.com> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Timur Tabi <timur@tabi.org> Cc: Tony Prisk <linux@prisktech.co.nz> Cc: Michal Simek <michal.simek@xilinx.com> Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Cc: Jiri Slaby <jslaby@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-04serial: 8250_mid: Enable HSU on Intel Cedar Fork PCHAndy Shevchenko
Intel Cedar Fork PCH has similar HSU as has been used on Intel Denverton. Add PCI ID to get it enumerated. While here, remove DNV part form INTEL_MID_UART_DNV_FISR to show that is used not only on Intel Denverton from now on. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-30serial: 8250_pci: Enable device after we check black listAndy Shevchenko
If the board we are guessing has been listed in black list we don't need to enable it twice. The associated driver, if any, will take care about proper initialization. To achieve this we split out two helper functions, i.e. serial_pci_is_class_communication() and serial_pci_is_blacklisted() which will be called before pcim_enable_device(). We can do this since PCI specification requires class, device and vendor ID registers to be always present in the configuration space. As an example what happens before this patch applied (These are some debug prints, don't search for them in kernel sources): serial 0000:00:04.1: Mapped GSI28 to IRQ28 serial 0000:00:04.2: Mapped GSI29 to IRQ29 serial 0000:00:04.3: Mapped GSI54 to IRQ54 8250_mid 0000:00:04.1: Mapped GSI28 to IRQ28 8250_mid 0000:00:04.2: Mapped GSI29 to IRQ29 8250_mid 0000:00:04.3: Mapped GSI54 to IRQ54 After we will have just last three lines out of above. 8250_mid 0000:00:04.1: Mapped GSI28 to IRQ28 8250_mid 0000:00:04.2: Mapped GSI29 to IRQ29 8250_mid 0000:00:04.3: Mapped GSI54 to IRQ54 While here, correct a value of error code mentioned in the comment of serial_pci_guess_board(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-30serial: core: move UPF_NO_TXEN_TEST to quirks and renameAndy Shevchenko
First 16 bits in the flags field are user-visible except UPF_NO_TXEN_TEST. To keep it clean we introduce internal quirks and move UPF_NO_TXEN_TEST to them. Rename the constant to UPQ_NO_TXEN_TEST to distinguish with port flags. Users are converted accordingly. The quirks field might be extended later to hold the additional ones. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-30tty: serial: pci: constify pci_device_id.Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by <linux/pci.h> work with const pci_device_id. So mark the non-const structs as const. File size before: text data bss dec hex filename 12626 18128 0 30754 7822 tty/serial/8250/8250_pci.o File size After adding 'const': text data bss dec hex filename 23986 6768 0 30754 7822 tty/serial/8250/8250_pci.o Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10serial: pci: Remove unused pci_boards entriesJan Kiszka
Became obsolete with the split-out of 8250_exar. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10serial: exar: Move Commtech adapters to 8250_exar as wellJan Kiszka
Those are Exar-based, too. With the required refactoring of the code to fit into 8250_exar, we automatically fix the same issue pci_xr17v35x_setup had before: 8XMODE, FCTL, TXTRG and RXTRG were always only set for port 0. Now they are initialized for the correct target port by using port.membase. Now we can also cleanly fix the blacklist of 8250_pci so that all Commtech devices are rejected and 8250_exar can handle them. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09serial: 8250_pci: make pciserial_detach_ports() staticWei Yongjun
Fixes the following sparse warning: drivers/tty/serial/8250/8250_pci.c:3916:6: warning: symbol 'pciserial_detach_ports' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-06serial: 8250_pci: Add MKS Tenta SCOM-0800 and SCOM-0801 cardsIan Abbott
The MKS Instruments SCOM-0800 and SCOM-0801 cards (originally by Tenta Technologies) are 3U CompactPCI serial cards with 4 and 8 serial ports, respectively. The first 4 ports are implemented by an OX16PCI954 chip, and the second 4 ports are implemented by an OX16C954 chip on a local bus, bridged by the second PCI function of the OX16PCI954. The ports are jumper-selectable as RS-232 and RS-422/485, and the UARTs use a non-standard oscillator frequency of 20 MHz (base_baud = 1250000). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03serial: 8250_pci: remove exar codeSudip Mukherjee
Remove the Exar specific codes from 8250_pci and blacklist those chips so that the new Exar serial driver binds to the devices. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-16Merge 4.10-rc4 into tty-nextGreg Kroah-Hartman
We want the serial/tty fixes in here as well to build on top of. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-12serial: 8250_fintek: Add resource check for Fintek F81504/508/512Ji-Ze Hong (Peter Hong)
Add resource type check for Fintek F81504/508/512, BAR3/4/5 must be IORESOURCE_IO. Fintek is trying to make F81504/508/512 works on MMIO interface, but it's still in progress. We found some issue when the experiment IC when the BAR3/4/5 is IORESOURCE_MEM. It'll cause wrong operation with IO resource. So we'll add the resource check for this. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_kernel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-118250_pci: Fix potential use-after-free in error pathGabriel Krisman Bertazi
Commit f209fa03fc9d ("serial: 8250_pci: Detach low-level driver during PCI error recovery") introduces a potential use-after-free in case the pciserial_init_ports call in serial8250_io_resume fails, which may happen if a memory allocation fails or if the .init quirk failed for whatever reason). If this happen, further pci_get_drvdata will return a pointer to freed memory. This patch reworks the PCI recovery resume hook to restore the old priv structure in this case, which should be ok, since the ports were already detached. Such error during recovery causes us to give up on the recovery. Fixes: f209fa03fc9d ("serial: 8250_pci: Detach low-level driver during PCI error recovery") Reported-by: Michal Suchanek <msuchanek@suse.com> Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com> Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-29serial: 8250_pci: Detach low-level driver during PCI error recoveryGabriel Krisman Bertazi
During a PCI error recovery, like the ones provoked by EEH in the ppc64 platform, all IO to the device must be blocked while the recovery is completed. Current 8250_pci implementation only suspends the port instead of detaching it, which doesn't prevent incoming accesses like TIOCMGET and TIOCMSET calls from reaching the device. Those end up racing with the EEH recovery, crashing it. Similar races were also observed when opening the device and when shutting it down during recovery. This patch implements a more robust IO blockage for the 8250_pci recovery by unregistering the port at the beginning of the procedure and re-adding it afterwards. Since the port is detached from the uart layer, we can be sure that no request will make through to the device during recovery. This is similar to the solution used by the JSM serial driver. I thank Peter Hurley <peter@hurleysoftware.com> for valuable input on this one over one year ago. Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-108250: FIX Fourth port offset of Pericom PI7C9X7954 boardsAngelo Butti
Hi, below patch to fix Fourth port offset of Percom PI7C9X7954 boards. I had a problem using Fourth port on a pci express serial board based on Pericom PI7C9X7954. Reading datasheet I notice a "special" offset assign to this port when used in I/O mode. Offset 0x0 -> UART 0 Offset 0x8 -> UART 1 Offset 0x10 -> UART 2 Offset 0x38 -> UART 3 <<---- This don't follow a logical sequence This patch add a different init to last port, to have right offset. I check also Pericom 7952 and 7958 but that devices follow logical sequence, so they are ok. Regards, Angelo Signed-off-by: Angelo Butti <buttiangelo@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22serial: 8250_pci: Use symbolic constants for EXAR's MPIO registersJan Kiszka
Less magic that only requires comments. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-05Merge 4.8-rc5 into tty-nextGreg Kroah-Hartman
We want the fixes in here for merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31serial: 8250: added acces i/o products quad and octal serial cardsJimi Damon
Added devices ids for acces i/o products quad and octal serial cards that make use of existing Pericom PI7C9X7954 and PI7C9X7958 configurations . Signed-off-by: Jimi Damon <jdamon@accesio.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31serial: 8250_lpss: move Quark code from PCI driverAndy Shevchenko
Intel Quark has DesignWare UART. Move the code from 8250_pci to 8250_lpss. Reviewed-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31serial: 8250_lpss: split LPSS driver to separate moduleAndy Shevchenko
The SoCs, such as Intel Braswell, have DesignWare UART IP. Split out the support of such chips to a separate module which also will be used for Intel Quark later. The rationale to have the separate driver to be existing: - Do not contaminate 8250_pci.c anymore with LPSS related quirks - All of them are using same DMA engine and they are Designware IP which means that in the future we might share the code between 8250_dw.c and 8250_lpss.c - It reduces the kernel memory footprint on non-X86 machines where 8250_pci.c is in use Besides the split the driver also has been refactored, in particular a) the DMA and port setup are separate functions, b) the two new structures lpss8250 and lpss8250_board are introduced to keep necessary data instead of pciserial_board, c) DMA parameters are passed to the DMA setup via mentioned custom structure. Most of the changes are done due to the future support of UART DMA on Intel Quark. The Intel Quark UART DMA support is based on bits taking from BSP code published by Intel earlier. The driver does not use any specific power management. PCI core takes care of the default behaviour during suspend and resume. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-258250_pci: Adds support for the WCH CH355 4S cardAlexandr Petrenko
Adds support for the WCH CH355 4S card in the 8250 serial driver. Signed-off-by: Alexandr Petrenko <petrenkoas83@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: 8250, remove shadow and unused variablesJiri Slaby
The compiler complains about variables that are set, but never used: * intX variables in exar_handle_irq drivers/tty/serial/8250/8250_port.c:1864:34: warning: variable ‘int3’ set but not used [-Wunused-but-set-variable] * val variable in pci_quatech_wqopr drivers/tty/serial/8250/8250_pci.c:1139:10: warning: variable ‘val’ set but not used [-Wunused-but-set-variable] And about a shadow variable: * tmout in wait_for_xmitr is defined twice with the same type. Both of them are also initialized before use. Remove all of them. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Matt Schulte <matts@commtech-fastcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-20Merge tag 'tty-4.7-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty and serial driver updates from Greg KH: "Here's the large TTY and Serial driver update for 4.7-rc1. A few new serial drivers are added here, and Peter has fixed a bunch of long-standing bugs in the tty layer and serial drivers as normal. Full details in the shortlog. All of these have been in linux-next for a while with no reported issues" * tag 'tty-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (88 commits) MAINTAINERS: 8250: remove website reference serial: core: Fix port mutex assert if lockdep disabled serial: 8250_dw: fix wrong logic in dw8250_check_lcr() tty: vt, finish looping on duplicate tty: vt, return error when con_startup fails QE-UART: add "fsl,t1040-ucc-uart" to of_device_id serial: mctrl_gpio: Drop support for out1-gpios and out2-gpios serial: 8250dw: Add device HID for future AMD UART controller Fix OpenSSH pty regression on close serial: mctrl_gpio: add IRQ locking serial: 8250: Integrate Fintek into 8250_base serial: mps2-uart: add support for early console serial: mps2-uart: add MPS2 UART driver dt-bindings: document the MPS2 UART bindings serial: sirf: Use generic uart-has-rtscts DT property serial: sirf: Introduce helper variable struct device_node *np serial: mxs-auart: Use generic uart-has-rtscts DT property serial: imx: Use generic uart-has-rtscts DT property doc: DT: Add Generic Serial Device Tree Bindings serial: 8250: of: Make tegra_serial_handle_break() static ...
2016-04-30serial: 8250_pci: report DCD and DSR signals as active for Bay TrailWan Ahmad Zainie
Bay Trail UART port does not support DCD and DSR lines. The driver shall report that these signals are permanently active. This patch is for HSUART enumerated via PCI. For ACPI, see commit dfd37668ea6d ("serial: 8250_dw: Fix get_mctrl behaviour"). The commit also describes the possible issue if these signals are enabled on a port without these pins. Signed-off-by: Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad@intel.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28serial: 8250_pci: fix divide error bug if baud rate is 0David Müller
Since commit 21947ba654a6 ("serial: 8250_pci: replace switch-case by formula"), the 8250 driver crashes in the byt_set_termios() function with a divide error. This is caused by the fact that a baud rate of 0 (B0) is not handled properly. Fix it by falling back to B9600 in this case. Signed-off-by: David Müller <d.mueller@elsoft.ch> Fixes: 21947ba654a6 ("serial: 8250_pci: replace switch-case by formula") Cc: stable@vger.kernel.org Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-13dmaengine: dw: rename masters to reflect actual topologyAndy Shevchenko
The source and destination masters are reflecting buses or their layers to where the different devices can be connected. The patch changes the master names to reflect which one is related to which independently on the transfer direction. The outcome of the change is that the memory data width is now always limited by a data width of the master which is dedicated to communicate to memory. The patch will not break anything since all current users have the same data width for all masters. Though it would be nice to revisit avr32 platforms to check what is the actual hardware topology in use there. It seems that it has one bus and two masters on it as stated by Table 8-2, that's why everything works independently on the master in use. The purpose of the sequential patch is to fix the driver for configuration of more than one bus. The change is done in the assumption that src_master and dst_master are reflecting a connection to the memory and peripheral correspondently on avr32 and otherwise on the rest. Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-03-07tty: serial: 8250: add MOXA Smartio MUE boards supportMathieu OTHACEHE
Add support for : - CP-102E: 2 ports RS232 PCIE card - CP-102EL: 2 ports RS232 PCIE card - CP-132EL: 2 ports RS422/485 PCIE card - CP-114EL: 4 ports RS232/422/485 PCIE card - CP-104EL-A: 4 ports RS232 PCIE card - CP-168EL-A: 8 ports RS232 PCIE card - CP-118EL-A: 8 ports RS232/422/485 PCIE card - CP-118E-A: 8 ports RS422/485 PCIE card - CP-138E-A: 8 ports RS422/485 PCIE card - CP-134EL-A: 4 ports RS422/485 PCIE card - CP-116E-A (A): 8 ports RS232/422/485 PCIE card - CP-116E-A (B): 8 ports RS232/422/485 PCIE card This patch is based on information extracted from vendor mxupcie driver available on MOXA website. I was able to test it on a CP-168EL-A on PC. Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-07serial: 8250_pci: all known Braswell ports are 1 channelAndy Shevchenko
There is no need to have channel offset defined since all BayTrail and Braswell ports are 1 channel. Remove unneeded definition. While here, remove comment which has no value. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-07serial: 8250_pci: convert to pcim_*() APIAndy Shevchenko
The managed API provides a better approach to help with acquiring and releasing resources. Besides that error handling becomes simpler. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14Merge 4.5-rc4 into tty-nextGreg Kroah-Hartman
We want the fixes in here, and this resolves a merge error in tty_io.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06tty: serial: 8250: Fix indentation warningsAnton Wuerfel
Checkpatch complains about incorrect indentation of switch/case statements. This patch fixes the corresponding warnings. Additionally some indentation is changed to match the correct format specified in the Linux Kernel Coding Style. Signed-off-by: Anton Würfel <anton.wuerfel@fau.de> Signed-off-by: Phillip Raffeck <phillip.raffeck@fau.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: linux-kernel@i4.cs.fau.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06tty: serial: 8250: Merge duplicate conditionsAnton Wuerfel
This patch refactors a switch case statement by merging an if condition in the default case into an identical condition right after the switch statement. This comes with a slight change in behaviour: If pci_netmos_9900_numports returns 0, an additional warning is printed. Signed-off-by: Anton Würfel <anton.wuerfel@fau.de> Signed-off-by: Phillip Raffeck <phillip.raffeck@fau.de> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: linux-kernel@i4.cs.fau.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06tty: serial: 8250: Add parentheses to macroAnton Wuerfel
This patch fixes a checkpatch warning caused by missing parentheses in the definition of a macro. Furthermore redundant parentheses are removed in an assignment. Signed-off-by: Anton Würfel <anton.wuerfel@fau.de> Signed-off-by: Phillip Raffeck <phillip.raffeck@fau.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: linux-kernel@i4.cs.fau.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06tty: serial: 8250: Remove else after returnAnton Wuerfel
This patch fixes checkpatch warnings about unnecessary else blocks after return statements. Signed-off-by: Anton Würfel <anton.wuerfel@fau.de> Signed-off-by: Phillip Raffeck <phillip.raffeck@fau.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: linux-kernel@i4.cs.fau.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06tty: serial: 8250: Replace spaces with tabsAnton Wuerfel
Indentation is changed to match the correct format of using tabs instead of spaces wherever possible. Signed-off-by: Anton Würfel <anton.wuerfel@fau.de> Signed-off-by: Phillip Raffeck <phillip.raffeck@fau.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Cc: linux-kernel@i4.cs.fau.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06tty: serial: 8250: Fix whitespace errorsAnton Wuerfel
This patch fixes whitespace errors reported by checkpatch to increase readability. Main focus is on missing spaces after commas in function headers and macros (like foo,bar edited to foo, bar). Signed-off-by: Anton Würfel <anton.wuerfel@fau.de> Signed-off-by: Phillip Raffeck <phillip.raffeck@fau.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: linux-kernel@i4.cs.fau.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06tty: Add support for PCIe WCH382 2S multi-IO cardJeremy McNicoll
WCH382 2S board is a PCIe card with 2 DB9 COM ports detected as Serial controller: Device 1c00:3253 (rev 10) (prog-if 05 [16850]) Signed-off-by: Jeremy McNicoll <jmcnicol@redhat.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06serial/8250_pci: simplify Pericom handlingJan Beulich
Considering that pci_pericom_setup(()'s only difference to pci_default_setup() is the setting of the uartclk field, and taking into account that this field already gets taken care of by having the base_baud field filled in the pci_boards[] entries, there's no need for both the function and the quirks table entry. Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06serial: 8250_pci: use to_pci_dev()Geliang Tang
Use to_pci_dev() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-29serial: 8250_pci: Add Intel Broadwell portsMika Westerberg
Some recent (early 2015) macbooks have Intel Broadwell where LPSS UARTs are PCI enumerated instead of ACPI. The LPSS UART block is pretty much same as used on Intel Baytrail so we can reuse the existing Baytrail setup code. Add both Broadwell LPSS UART ports to the list of supported devices. Signed-off-by: Leif Liddy <leif.liddy@gmail.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17serial: 8250_mid: add support for DMA engine handling from UART MMIOHeikki Krogerus
The platforms that have this UART, but that don't have separate PCI device for the DMA Engine, need to create the HSU DMA Engine device separately. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17serial: 8250_pci: Intel MID UART support to its own driverHeikki Krogerus
Intel MID UART quirks require already quite a bit of code in 8250_pci.c. On new Intel platforms where it is used, the integrated DMA engine no longer has its own PCI device, but is instead configured from the UART's MMIO. That means we will have to add even more code for handling just MID UARTs. Instead of adding that to 8250_pci.c, splitting the support of Intel MID UART into its own driver. Handling of the integrated DMA engine becomes much simpler this way. Own driver will also remove the need for things like specific set_termios hooks for every board using this UART, and simplify the handling of it in general. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: 8250_pci: fix mode after S3/S4 resume for F81504/508/512Peter Hung
Fix RS232/485 mode incorrect setting after S3/S4 resume for F81504/508/512 We had add RS232/485 RTS control with fecf27a373f5. But when it resume from S3/S4, the mode register 0x40 + 0x08 * idx + 7 will rewrite to 0x01 (RS232 mode). This patch will modify 2 sections. One is pci_fintek_init(), if it called when first init, it will write mode register with 0x01. If it called from S3/S4 resume, it's will get the relative port data and pass it to pci_fintek_rs485_config() with NULL rs485 parameter. The another modification is in pci_fintek_rs485_config(). It'll re-apply old configuration when the parameter rs485 is NULL. Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-04serial: 8250_pci: Add support for Pericom PI7C9X795[1248]Adam Lee
Pericom PI7C9X795[1248] are Uno/Dual/Quad/Octal UART devices, this patch enables them, also defines PCI_VENDOR_ID_PERICOM here. Signed-off-by: Adam Lee <adam.lee@canonical.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-04serial: 8250: Auto CTS control by HW if AFE enabledQipeng Zha
According to DesignWare 8250 spec, if auto flow control mode is enabled, a change in CTS does not cause an interrupt, so sw-assisted CTS flow control mode will not work properly. There reported an GPS firmware download failure issue, and we verified the root cause is, the default sw-assisted CTS flow control mode can not work properly since no interrupt when got CTS signal. This patch is to enable auto CTS mode by defaut if CRTSCTS is enable for DesignWare 8250 controller. Signed-off-by: Huiquan Zhong <huiquan.zhong@intel.com> Signed-off-by: Qipeng Zha <qipeng.zha@intel.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03serial: 8250_pci: add RS485 for F81504/508/512Peter Hung
Add RS485 control for Fintek F81504/508/512 F81504/508/512 can control their RTS with H/W mode. PCI configuration space for each port is 0x40 + idx * 8 + 7. When it set with 0x01, it's configured with RS232 mode. RTS is controlled by MCR. When it set with 0x11, it's configured with RS485 mode. RTS is controlled by H/W, RTS low with idle & RX, high with TX. When it set with 0x31, it's configured with RS485 mode. RTS is controlled by H/W, RTS high with idle & RX, low with TX. We will force 0x01 on pci_fintek_setup(). Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12serial: 8250_pci: Correct uartclk for xr17v35x expansion chipsSoeren Grunewald
The internal clock of the master chip, which is usually 125MHz, is only half (62.5MHz) for the slave chips. So we have to adjust the uartclk for all the slave ports. Therefor we add a new function to determine if a slave chip is present and update pci_xr17v35x_setup accordingly. Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12serial: 8250_pci: Add support for 12 port Exar boardsSoeren Grunewald
The Exar XR17V358 can also be combined with a XR17V354 chip to act as a single 12 port chip. This works the same way as the combining two XR17V358 chips. But the reported device id then is 0x4358. Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>