From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Stephen Hurd <shurd@broadcom.com>,
Michael Chan <mchan@broadcom.com>,
Ben Hutchings <ben@decadent.org.uk>,
Rui Xiang <rui.xiang@huawei.com>
Subject: [PATCH 3.4 76/88] 8250/16?50: Add support for Broadcom TruManage redirected serial port
Date: Mon, 9 Jun 2014 17:25:26 -0700 [thread overview]
Message-ID: <20140610002426.983926719@linuxfoundation.org> (raw)
In-Reply-To: <20140610002424.500996570@linuxfoundation.org>
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Hurd <shurd@broadcom.com>
commit ebebd49a8eab5e9aa1b1f8f1614ccc3c2120f886 upstream.
Add support for the UART device present in Broadcom TruManage capable
NetXtreme chips (ie: 5761m 5762, and 5725).
This implementation has a hidden transmit FIFO, so running in single-byte
interrupt mode results in too many interrupts. The UART_CAP_HFIFO
capability was added to track this. It continues to reload the THR as long
as the THRE and TSRE bits are set in the LSR up to a specified limit (1024
is used here).
Signed-off-by: Stephen Hurd <shurd@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
[xr: Backported to 3.4:
- Adjust filenames
- Adjust context
- PORT_BRCM_TRUMANAGE is 22 not 24]
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/8250/8250.c | 15 ++++++++++++--
drivers/tty/serial/8250/8250.h | 1
drivers/tty/serial/8250/8250_pci.c | 38 +++++++++++++++++++++++++++++++++++++
include/linux/serial_core.h | 3 +-
4 files changed, 54 insertions(+), 3 deletions(-)
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -282,6 +282,12 @@ static const struct serial8250_config ua
.fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
.flags = UART_CAP_FIFO | UART_CAP_AFE | UART_CAP_EFR,
},
+ [PORT_BRCM_TRUMANAGE] = {
+ .name = "TruManage",
+ .fifo_size = 1,
+ .tx_loadsz = 1024,
+ .flags = UART_CAP_HFIFO,
+ },
};
#if defined(CONFIG_MIPS_ALCHEMY)
@@ -1470,6 +1476,11 @@ void serial8250_tx_chars(struct uart_825
port->icount.tx++;
if (uart_circ_empty(xmit))
break;
+ if (up->capabilities & UART_CAP_HFIFO) {
+ if ((serial_port_in(port, UART_LSR) & BOTH_EMPTY) !=
+ BOTH_EMPTY)
+ break;
+ }
} while (--count > 0);
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
@@ -2641,7 +2652,7 @@ serial8250_verify_port(struct uart_port
if (ser->irq >= nr_irqs || ser->irq < 0 ||
ser->baud_base < 9600 || ser->type < PORT_UNKNOWN ||
ser->type >= ARRAY_SIZE(uart_config) || ser->type == PORT_CIRRUS ||
- ser->type == PORT_STARTECH)
+ ser->type == PORT_STARTECH || uart_config[ser->type].name == NULL)
return -EINVAL;
return 0;
}
@@ -2651,7 +2662,7 @@ serial8250_type(struct uart_port *port)
{
int type = port->type;
- if (type >= ARRAY_SIZE(uart_config))
+ if (type >= ARRAY_SIZE(uart_config) || uart_config[type].name == NULL)
type = 0;
return uart_config[type].name;
}
--- a/drivers/tty/serial/8250/8250.h
+++ b/drivers/tty/serial/8250/8250.h
@@ -69,6 +69,7 @@ struct serial8250_config {
#define UART_CAP_AFE (1 << 11) /* MCR-based hw flow control */
#define UART_CAP_UUE (1 << 12) /* UART needs IER bit 6 set (Xscale) */
#define UART_CAP_RTOIE (1 << 13) /* UART needs IER bit 4 set (Xscale, Tegra) */
+#define UART_CAP_HFIFO (1 << 14) /* UART has a "hidden" FIFO */
#define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */
#define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1077,6 +1077,18 @@ pci_omegapci_setup(struct serial_private
return setup_port(priv, port, 2, idx * 8, 0);
}
+static int
+pci_brcm_trumanage_setup(struct serial_private *priv,
+ const struct pciserial_board *board,
+ struct uart_8250_port *port, int idx)
+{
+ int ret = pci_default_setup(priv, board, port, idx);
+
+ port->port.type = PORT_BRCM_TRUMANAGE;
+ port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
+ return ret;
+}
+
static int skip_tx_en_setup(struct serial_private *priv,
const struct pciserial_board *board,
struct uart_port *port, int idx)
@@ -1151,6 +1163,7 @@ pci_xr17c154_setup(struct serial_private
#define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6
#define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
+#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
/* Unknown vendors/cards - this should not be in linux/pci_ids.h */
#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
@@ -1684,6 +1697,17 @@ static struct pci_serial_quirk pci_seria
.setup = pci_omegapci_setup,
},
/*
+ * Broadcom TruManage (NetXtreme)
+ */
+ {
+ .vendor = PCI_VENDOR_ID_BROADCOM,
+ .device = PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .setup = pci_brcm_trumanage_setup,
+ },
+
+ /*
* Default "match everything" terminator entry
*/
{
@@ -1872,6 +1896,7 @@ enum pci_board_num_t {
pbn_ce4100_1_115200,
pbn_omegapci,
pbn_NETMOS9900_2s_115200,
+ pbn_brcm_trumanage,
};
/*
@@ -2578,6 +2603,12 @@ static struct pciserial_board pci_boards
.num_ports = 2,
.base_baud = 115200,
},
+ [pbn_brcm_trumanage] = {
+ .flags = FL_BASE0,
+ .num_ports = 1,
+ .reg_shift = 2,
+ .base_baud = 115200,
+ },
};
static const struct pci_device_id softmodem_blacklist[] = {
@@ -4140,6 +4171,13 @@ static struct pci_device_id serial_pci_t
pbn_omegapci },
/*
+ * Broadcom TruManage
+ */
+ { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_brcm_trumanage },
+
+ /*
* These entries match devices with class COMMUNICATION_SERIAL,
* COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
*/
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -47,7 +47,8 @@
#define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */
#define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */
#define PORT_XR17D15X 21 /* Exar XR17D15x UART */
-#define PORT_MAX_8250 21 /* max port ID */
+#define PORT_BRCM_TRUMANAGE 25
+#define PORT_MAX_8250 25 /* max port ID */
/*
* ARM specific type numbers. These are not currently guaranteed
next prev parent reply other threads:[~2014-06-10 0:25 UTC|newest]
Thread overview: 102+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-10 0:24 [PATCH 3.4 00/88] 3.4.93-stable review Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 01/88] sched: Use CPUPRI_NR_PRIORITIES instead of MAX_RT_PRIO in cpupri check Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 02/88] perf: Prevent false warning in perf_swevent_add Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 03/88] perf: Limit perf_event_attr::sample_period to 63 bits Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 04/88] perf: Fix race in removing an event Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 05/88] mm/memory-failure.c: fix memory leak by race between poison and unpoison Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 06/88] ARM: 8051/1: put_user: fix possible data corruption in put_user Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 07/88] sched: Fix hotplug vs. set_cpus_allowed_ptr() Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 08/88] md: always set MD_RECOVERY_INTR when aborting a reshape or other "resync" Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 10/88] Staging: speakup: Move pasting into a work item Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 11/88] ALSA: hda/realtek - Correction of fixup codes for PB V7900 laptop Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 12/88] ALSA: hda/realtek - Fix COEF widget NID for ALC260 replacer fixup Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 13/88] USB: ftdi_sio: add NovaTech OrionLXm product ID Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 14/88] USB: serial: option: add support for Novatel E371 PCIe card Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 15/88] USB: io_ti: fix firmware download on big-endian machines (part 2) Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 16/88] USB: Avoid runtime suspend loops for HCDs that cant handle suspend/resume Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 17/88] mm: rmap: fix use-after-free in __put_anon_vma Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 18/88] Bluetooth: Fix missing length checks for L2CAP signalling PDUs Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 19/88] Bluetooth: Fix invalid length check in l2cap_information_rsp() Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 20/88] Bluetooth: Support AR3011 in Acer Iconia Tab W500 Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 21/88] Bluetooth: add support for atheros 0930:0219 Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 22/88] Bluetooth: add support for atheros 0489:e057 Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 23/88] Bluetooth: Add support for Foxconn/Hon Hai AR5BBU22 0489:E03C Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 24/88] Bluetooth: Add support for Sony Vaio T-Series Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 25/88] Bluetooth: Add USB_VENDOR_AND_INTERFACE_INFO() for Broadcom/Foxconn Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 26/88] Bluetooth: Add support for BCM20702A0 [04ca, 2003] Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 27/88] Bluetooth: Add support for BCM20702A0 [0b05, 17b5] Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 28/88] Bluetooth: Add support for IMC Networks [13d3:3393] Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 29/88] Bluetooth: Add support for GC-WB300D PCIe [04ca:3006] to ath3k Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 30/88] Bluetooth: Add support for Foxconn / Hon Hai [0489:e04e] Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 31/88] Bluetooth: Add support for Foxconn / Hon Hai [0489:e056] Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 32/88] Bluetooth device 04ca:3008 should use ath3k Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 33/88] Bluetooth: Add support for atheros 04ca:3004 device to ath3k Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 34/88] Bluetooth: Device 0cf3:3008 should map AR 3012 Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 35/88] Bluetooth: Add support for Foxconn/Hon Hai [0489:e04d] Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 36/88] Bluetooth: Add support for Mediatek Bluetooth device [0e8d:763f] Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 37/88] Bluetooth: ath3k: Add support for Fujitsu Lifebook UH5x2 [04c5:1330] Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 38/88] Bluetooth: ath3k: Add support for ID 0x13d3/0x3402 Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 39/88] Bluetooth: Add support for Atheros [0cf3:3121] Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 40/88] Bluetooth: Add support for Atheros [0cf3:e003] Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 41/88] Bluetooth: Add a new PID/VID 0cf3/e005 for AR3012 Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 42/88] Bluetooth: Add support for BCM20702A0 [0b05, 17cb] Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 43/88] virtio_blk: Drop unused request tracking list Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 44/88] virtio-blk: Fix hot-unplug race in remove method Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 45/88] virtio-blk: Call del_gendisk() before disable guest kick Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 46/88] virtio-blk: Reset device after blk_cleanup_queue() Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 47/88] mm: add kmap_to_page() Greg Kroah-Hartman
2014-06-10 1:15 ` Hugh Dickins
2014-06-10 1:21 ` Ben Hutchings
2014-06-10 8:04 ` Yijing Wang
2014-06-10 20:50 ` Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 48/88] mm: highmem: export kmap_to_page for modules Greg Kroah-Hartman
2014-06-10 0:24 ` [PATCH 3.4 49/88] virtio: 9p: correctly pass physical address to userspace for high pages Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 50/88] virtio-blk: Dont free ida when disk is in use Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 51/88] virtio_console: fix uapi header Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 52/88] virtio: console: rename cvq_lock to c_ivq_lock Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 53/88] virtio: console: add locking around c_ovq operations Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 54/88] nfsd: pass net to nfsd_init_socks() Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 55/88] nfsd: pass net to nfsd_startup() and nfsd_shutdown() Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 56/88] nfsd: pass net to nfsd_create_serv() Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 57/88] nfsd: pass net to nfsd_svc() Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 58/88] nfsd: pass net to nfsd_set_nrthreads() Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 59/88] nfsd: pass net to __write_ports() and down Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 60/88] nfsd: pass proper net to nfsd_destroy() from NFSd kthreads Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 61/88] nfsd: containerize NFSd filesystem Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 62/88] nfsd: check passed sockets net matches NFSd superblocks one Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 63/88] isci: Fix a race condition in the SSP task management path Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 64/88] mpt2sas: Fix for device scan following host reset could get stuck in a infinite loop Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 65/88] mpt2sas: Fix for issue Missing delay not getting set during system bootup Greg Kroah-Hartman
2014-06-10 1:04 ` Ben Hutchings
2014-06-10 0:25 ` [PATCH 3.4 66/88] hpsa: gen8plus Smart Array IDs Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 67/88] iscsi-target: Always send a response before terminating iSCSI connection Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 68/88] target/pscsi: fix return value check Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 69/88] target: Fix MAINTENANCE_IN service action CDB checks to use lower 5 bits Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 70/88] target: use correct sense code for LUN communication failure Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 71/88] target/file: Fix 32-bit highmem breakage for SGL -> iovec mapping Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 72/88] serial: pch_uart: fix tty-kref leak in dma-rx path Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 73/88] serial: pch_uart: fix tty-kref leak in rx-error path Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 74/88] tty: Correct tty buffer flush Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 75/88] Fix 4 port and add support for 8 port Unknown PCI serial port cards Greg Kroah-Hartman
2014-06-10 0:25 ` Greg Kroah-Hartman [this message]
2014-06-10 1:05 ` [PATCH 3.4 76/88] 8250/16?50: Add support for Broadcom TruManage redirected serial port Ben Hutchings
2014-06-10 0:25 ` [PATCH 3.4 77/88] tty/serial: Add support for Altera " Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 78/88] xen/p2m: Move code around to allow for better re-usage Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 79/88] xen/p2m: Allow alloc_p2m_middle to call reserve_brk depending on argument Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 80/88] xen/p2m: Collapse early_alloc_p2m_middle redundant checks Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 81/88] xen/p2m: An early bootup variant of set_phys_to_machine Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 82/88] xen/setup: Populate freed MFNs from non-RAM E820 entries and gaps to E820 RAM Greg Kroah-Hartman
2014-06-10 9:07 ` David Vrabel
2014-06-10 9:30 ` Daniel Kiper
2014-06-10 13:18 ` David Vrabel
2014-06-10 18:45 ` Greg Kroah-Hartman
2014-06-10 19:39 ` Daniel Kiper
2014-06-10 20:44 ` Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 83/88] xen/setup: Combine the two hypercall functions - since they are quite similar Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 84/88] xen/setup: update VA mapping when releasing memory during setup Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 85/88] xen/balloon: Subtract from xen_released_pages the count that is populated Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 86/88] xen: populate correct number of pages when across mem boundary (v2) Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 87/88] xen/p2m: Reserve 8MB of _brk space for P2M leafs when populating back Greg Kroah-Hartman
2014-06-10 0:25 ` [PATCH 3.4 88/88] xen/p2m: Reuse existing P2M leafs if they are filled with 1:1 PFNs or INVALID Greg Kroah-Hartman
2014-06-10 15:13 ` [PATCH 3.4 00/88] 3.4.93-stable review Guenter Roeck
2014-06-10 18:45 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140610002426.983926719@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=ben@decadent.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mchan@broadcom.com \
--cc=rui.xiang@huawei.com \
--cc=shurd@broadcom.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox