diff options
| -rw-r--r-- | serial-8250_pci-add-support-for-fintek-4-8-and-12-port-cards.patch | 46 |
1 files changed, 20 insertions, 26 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 057f12b76821e1..d9294181e51dd3 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,8 +16,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- - drivers/tty/serial/8250/8250_pci.c | 134 +++++++++++++++++++++++++++++++++++-- - 1 file changed, 128 insertions(+), 6 deletions(-) + drivers/tty/serial/8250/8250_pci.c | 128 +++++++++++++++++++++++++++++++++++-- + 1 file changed, 122 insertions(+), 6 deletions(-) --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -37,7 +37,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> /* * init function returns: -@@ -1344,6 +1344,80 @@ pci_brcm_trumanage_setup(struct serial_p +@@ -1344,6 +1344,74 @@ pci_brcm_trumanage_setup(struct serial_p return ret; } @@ -45,15 +45,11 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + const struct pciserial_board *board, + struct uart_8250_port *port, int idx) +{ ++ struct pci_dev *pdev = priv->dev; + unsigned long base; + unsigned long iobase; + unsigned long ciobase = 0; + u8 config_base; -+ u8 __iomem *p; -+ -+ p = pci_ioremap_bar(priv->dev, 0); -+ if (p == NULL) -+ return -ENOMEM; + + /* FIXME: read these from the PCI config space */ + switch (idx) { @@ -74,13 +70,13 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + return -EINVAL; + } + -+ dev_dbg(&priv->dev->dev, "bar 0 = %lx\n", (unsigned long)pci_resource_start(priv->dev, 0)); -+ dev_dbg(&priv->dev->dev, "bar 1 = %lx\n", (unsigned long)pci_resource_start(priv->dev, 1)); -+ dev_dbg(&priv->dev->dev, "bar 2 = %lx\n", (unsigned long)pci_resource_start(priv->dev, 2)); -+ dev_dbg(&priv->dev->dev, "bar 3 = %lx\n", (unsigned long)pci_resource_start(priv->dev, 3)); -+ dev_dbg(&priv->dev->dev, "bar 4 = %lx\n", (unsigned long)pci_resource_start(priv->dev, 4)); -+ dev_dbg(&priv->dev->dev, "bar 5 = %lx\n", (unsigned long)pci_resource_start(priv->dev, 5)); -+ dev_dbg(&priv->dev->dev, "bar 6 = %lx\n", (unsigned long)pci_resource_start(priv->dev, 6)); ++ 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)); ++ dev_dbg(&pdev->dev, "bar 6 = %lx\n", (unsigned long)pci_resource_start(pdev, 6)); + + if (idx < 4) { + base = pci_resource_start(priv->dev, 3); @@ -88,18 +84,16 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + } + + /* Enable uart I/O port */ -+ writeb(0x01, p + config_base + 0x00); ++ pci_write_config_byte(pdev, config_base + 0x00, 0x01); + + /* Select 128-byte FIFO and 8x FIFO threshold */ -+ writeb(0x33, p + config_base + 0x01); ++ pci_write_config_byte(pdev, config_base + 0x01, 0x33); + + /* LSB UART */ -+ writeb((u8)(iobase & 0xff), p + config_base + 0x04); ++ pci_write_config_byte(pdev, config_base + 0x04, (u8)(iobase & 0xff)); + + /* MSB UART */ -+ writeb((u8)(iobase & 0xff00) >> 8, p + config_base + 0x05); -+ -+ iounmap(p); ++ pci_write_config_byte(pdev, config_base + 0x05, (u8)((iobase & 0xff00) >> 8)); + + dev_dbg(&priv->dev->dev, "%s: iobase=%lx ciobase=%lx\n", __func__, iobase, ciobase); + @@ -118,7 +112,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) -@@ -2255,6 +2329,27 @@ static struct pci_serial_quirk pci_seria +@@ -2255,6 +2323,27 @@ static struct pci_serial_quirk pci_seria .subdevice = PCI_ANY_ID, .setup = pci_brcm_trumanage_setup, }, @@ -146,7 +140,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> /* * Default "match everything" terminator entry -@@ -2452,6 +2547,9 @@ enum pci_board_num_t { +@@ -2452,6 +2541,9 @@ enum pci_board_num_t { pbn_omegapci, pbn_NETMOS9900_2s_115200, pbn_brcm_trumanage, @@ -156,7 +150,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> }; /* -@@ -3202,6 +3300,24 @@ static struct pciserial_board pci_boards +@@ -3202,6 +3294,24 @@ static struct pciserial_board pci_boards .reg_shift = 2, .base_baud = 115200, }, @@ -181,7 +175,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> }; static const struct pci_device_id blacklist[] = { -@@ -3362,14 +3478,15 @@ pciserial_init_ports(struct pci_dev *dev +@@ -3362,14 +3472,15 @@ pciserial_init_ports(struct pci_dev *dev if (quirk->setup(priv, board, &uart, i)) break; @@ -202,7 +196,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> break; } } -@@ -4918,6 +5035,11 @@ static struct pci_device_id serial_pci_t +@@ -4918,6 +5029,11 @@ static struct pci_device_id serial_pci_t 0, 0, pbn_exar_XR17V358 }, |
