aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-12 16:43:14 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-12 16:43:14 -0700
commit0979bc623e7b34e4dd39e92adeae7344d6563a59 (patch)
tree897a832856516dcd6eb839a900406e95e5680be3
parent3686af12e2a752e4e8bf3288e45fc600acecfae7 (diff)
downloadpatches-0979bc623e7b34e4dd39e92adeae7344d6563a59.tar.gz
fixes for fintek driver
-rw-r--r--serial-8250_pci-add-support-for-fintek-4-8-and-12-port-cards.patch60
1 files changed, 40 insertions, 20 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 c9a0e924a3a0a6..057f12b76821e1 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 | 114 +++++++++++++++++++++++++++++++++++--
- 1 file changed, 108 insertions(+), 6 deletions(-)
+ drivers/tty/serial/8250/8250_pci.c | 134 +++++++++++++++++++++++++++++++++++--
+ 1 file changed, 128 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,60 @@ pci_brcm_trumanage_setup(struct serial_p
+@@ -1344,6 +1344,80 @@ pci_brcm_trumanage_setup(struct serial_p
return ret;
}
@@ -48,21 +48,27 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+ 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) {
-+ case 0: iobase = 0xe000; break;
-+ case 1: iobase = 0xe008; break;
-+ case 2: iobase = 0xe010; break;
-+ case 3: iobase = 0xe018; break;
-+ case 4: iobase = 0xe020; break;
-+ case 5: iobase = 0xe028; break;
-+ case 6: iobase = 0xe030; break;
-+ case 7: iobase = 0xe038; break;
-+ case 8: iobase = 0xe040; break;
-+ case 9: iobase = 0xe048; break;
-+ case 10: iobase = 0xe050; break;
-+ case 11: iobase = 0xe058; break;
++ case 0: iobase = 0xe000; config_base = 0x40; break;
++ case 1: iobase = 0xe008; config_base = 0x48; break;
++ case 2: iobase = 0xe010; config_base = 0x50; break;
++ case 3: iobase = 0xe018; config_base = 0x58; break;
++ case 4: iobase = 0xe020; config_base = 0x60; break;
++ case 5: iobase = 0xe028; config_base = 0x68; break;
++ case 6: iobase = 0xe030; config_base = 0x70; break;
++ case 7: iobase = 0xe038; config_base = 0x78; break;
++ case 8: iobase = 0xe040; config_base = 0x80; break;
++ case 9: iobase = 0xe048; config_base = 0x88; break;
++ case 10: iobase = 0xe050; config_base = 0x90; break;
++ case 11: iobase = 0xe058; config_base = 0x98; break;
+ default:
+ /* Unknown number of ports, get out of here */
+ return -EINVAL;
@@ -81,6 +87,20 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+ ciobase = (int)(base + (0x8 * idx));
+ }
+
++ /* Enable uart I/O port */
++ writeb(0x01, p + config_base + 0x00);
++
++ /* Select 128-byte FIFO and 8x FIFO threshold */
++ writeb(0x33, p + config_base + 0x01);
++
++ /* LSB UART */
++ writeb((u8)(iobase & 0xff), p + config_base + 0x04);
++
++ /* MSB UART */
++ writeb((u8)(iobase & 0xff00) >> 8, p + config_base + 0x05);
++
++ iounmap(p);
++
+ dev_dbg(&priv->dev->dev, "%s: iobase=%lx ciobase=%lx\n", __func__, iobase, ciobase);
+
+ port->port.iotype = UPIO_PORT;
@@ -98,7 +118,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 +2309,27 @@ static struct pci_serial_quirk pci_seria
+@@ -2255,6 +2329,27 @@ static struct pci_serial_quirk pci_seria
.subdevice = PCI_ANY_ID,
.setup = pci_brcm_trumanage_setup,
},
@@ -126,7 +146,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/*
* Default "match everything" terminator entry
-@@ -2452,6 +2527,9 @@ enum pci_board_num_t {
+@@ -2452,6 +2547,9 @@ enum pci_board_num_t {
pbn_omegapci,
pbn_NETMOS9900_2s_115200,
pbn_brcm_trumanage,
@@ -136,7 +156,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
};
/*
-@@ -3202,6 +3280,24 @@ static struct pciserial_board pci_boards
+@@ -3202,6 +3300,24 @@ static struct pciserial_board pci_boards
.reg_shift = 2,
.base_baud = 115200,
},
@@ -161,7 +181,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
};
static const struct pci_device_id blacklist[] = {
-@@ -3362,14 +3458,15 @@ pciserial_init_ports(struct pci_dev *dev
+@@ -3362,14 +3478,15 @@ pciserial_init_ports(struct pci_dev *dev
if (quirk->setup(priv, board, &uart, i))
break;
@@ -182,7 +202,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
break;
}
}
-@@ -4918,6 +5015,11 @@ static struct pci_device_id serial_pci_t
+@@ -4918,6 +5035,11 @@ static struct pci_device_id serial_pci_t
0,
0, pbn_exar_XR17V358 },