diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-17 10:44:32 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-17 10:44:32 -0700 |
| commit | aac89a6eb6af76a768286abe02c1b4977ae06977 (patch) | |
| tree | 1dd21618d639bf5d34ed2a44b6e98650e0f1ab77 | |
| parent | f6e6720a59d48941664b57b5365cda8a8d4a3dc0 (diff) | |
| download | patches-aac89a6eb6af76a768286abe02c1b4977ae06977.tar.gz | |
clean up fintek patch
| -rw-r--r-- | serial-8250_pci-add-support-for-fintek-4-8-and-12-port-cards.patch | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/serial-8250_pci-add-support-for-fintek-4-8-and-12-port-cards.patch b/serial-8250_pci-add-support-for-fintek-4-8-and-12-port-cards.patch index e8115c7e1f53f9..700f5bd04d1914 100644 --- a/serial-8250_pci-add-support-for-fintek-4-8-and-12-port-cards.patch +++ b/serial-8250_pci-add-support-for-fintek-4-8-and-12-port-cards.patch @@ -16,21 +16,12 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- - drivers/tty/serial/8250/8250_pci.c | 125 ++++++++++++++++++++++++++++++++++++- - 1 file changed, 124 insertions(+), 1 deletion(-) + drivers/tty/serial/8250/8250_pci.c | 112 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 112 insertions(+) --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c -@@ -9,7 +9,7 @@ - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License. - */ --#undef DEBUG -+#define DEBUG - #include <linux/module.h> - #include <linux/init.h> - #include <linux/pci.h> -@@ -1343,6 +1343,82 @@ pci_brcm_trumanage_setup(struct serial_p +@@ -1343,6 +1343,71 @@ pci_brcm_trumanage_setup(struct serial_p return ret; } @@ -43,9 +34,12 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + unsigned long iobase; + unsigned long ciobase = 0; + u8 config_base; -+ u8 data; + -+ /* FIXME: read these from the PCI config space */ ++ /* ++ * We are supposed to be able to read these from the PCI config space, ++ * but the values there don't seem to match what we need to use, so ++ * just use these hard-coded values for now, as they are correct. ++ */ + switch (idx) { + case 0: iobase = 0xe000; config_base = 0x40; break; + case 1: iobase = 0xe008; config_base = 0x48; break; @@ -64,13 +58,6 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + return -EINVAL; + } + -+ dev_dbg(&pdev->dev, "bar 0 = %lx\n", (unsigned long)pci_resource_start(pdev, 0)); -+ dev_dbg(&pdev->dev, "bar 1 = %lx\n", (unsigned long)pci_resource_start(pdev, 1)); -+ dev_dbg(&pdev->dev, "bar 2 = %lx\n", (unsigned long)pci_resource_start(pdev, 2)); -+ dev_dbg(&pdev->dev, "bar 3 = %lx\n", (unsigned long)pci_resource_start(pdev, 3)); -+ dev_dbg(&pdev->dev, "bar 4 = %lx\n", (unsigned long)pci_resource_start(pdev, 4)); -+ dev_dbg(&pdev->dev, "bar 5 = %lx\n", (unsigned long)pci_resource_start(pdev, 5)); -+ + if (idx < 4) { + base = pci_resource_start(priv->dev, 3); + ciobase = (int)(base + (0x8 * idx)); @@ -79,7 +66,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + dev_dbg(&pdev->dev, "%s: idx=%d iobase=0x%lx ciobase=0x%lx config_base=0x%2x\n", + __func__, idx, iobase, ciobase, config_base); + -+ /* Enable uart I/O port */ ++ /* Enable UART I/O port */ + pci_write_config_byte(pdev, config_base + 0x00, 0x01); + + /* Select 128-byte FIFO and 8x FIFO threshold */ @@ -91,16 +78,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + /* MSB UART */ + pci_write_config_byte(pdev, config_base + 0x05, (u8)((iobase & 0xff00) >> 8)); + -+ /* irq number */ ++ /* irq number, this usually fails, but the spec says to do it anyway. */ + pci_write_config_byte(pdev, config_base + 0x06, pdev->irq); + -+ /* verify irq was set */ -+ pci_read_config_byte(pdev, config_base + 0x06, &data); -+ dev_dbg(&pdev->dev, "%s: irq = 0x%2x data=0x%02x\n", __func__, pdev->irq, data); -+ if (data != pdev->irq) { -+ dev_err(&pdev->dev, "Can not set irq!\n"); -+ } -+ + port->port.iotype = UPIO_PORT; + port->port.iobase = iobase; + port->port.mapbase = 0; @@ -113,7 +93,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> static int skip_tx_en_setup(struct serial_private *priv, const struct pciserial_board *board, struct uart_8250_port *port, int idx) -@@ -2252,6 +2328,27 @@ static struct pci_serial_quirk pci_seria +@@ -2252,6 +2317,27 @@ static struct pci_serial_quirk pci_seria .subdevice = PCI_ANY_ID, .setup = pci_brcm_trumanage_setup, }, @@ -141,7 +121,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> /* * Default "match everything" terminator entry -@@ -2449,6 +2546,9 @@ enum pci_board_num_t { +@@ -2449,6 +2535,9 @@ enum pci_board_num_t { pbn_omegapci, pbn_NETMOS9900_2s_115200, pbn_brcm_trumanage, @@ -151,7 +131,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> }; /* -@@ -3199,6 +3299,24 @@ static struct pciserial_board pci_boards +@@ -3199,6 +3288,24 @@ static struct pciserial_board pci_boards .reg_shift = 2, .base_baud = 115200, }, @@ -176,7 +156,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> }; static const struct pci_device_id blacklist[] = { -@@ -4916,6 +5034,11 @@ static struct pci_device_id serial_pci_t +@@ -4916,6 +5023,11 @@ static struct pci_device_id serial_pci_t 0, 0, pbn_exar_XR17V358 }, |
