* [PATCH V9 1/2] serial: exar: Revert "serial: exar: Add support for Sealevel 7xxxC serial cards"
@ 2023-09-29 17:39 Matthew Howell
2023-09-29 17:40 ` [PATCH V9 2/2] serial: exar: Add RS-485 support for Sealevel XR17V35X based cards Matthew Howell
2023-09-30 6:56 ` [PATCH V9 1/2] serial: exar: Revert "serial: exar: Add support for Sealevel 7xxxC serial cards" gregkh
0 siblings, 2 replies; 4+ messages in thread
From: Matthew Howell @ 2023-09-29 17:39 UTC (permalink / raw)
To: gregkh@linuxfoundation.org
Cc: Darren Beeson, andriy.shevchenko@intel.com,
ilpo.jarvinen@linux.intel.com, eff.baldwin@sealevel.com,
linux-serial@vger.kernel.org, Ryan Wenglarz, Matthew Howell,
James Olson
From: Matthew Howell <matthew.howell@sealevel.com>
Hardware ID of Sealevel 7xxxC cards changed prior to release.
This has rendered 14ee78d5932a redundant.
This reverts commit 14ee78d5932afeb710c8305196a676a715bfdea8.
Fixes: 14ee78d5932a ("Add support for Sealevel 7xxxC serial cards")
Signed-off-by: Matthew Howell <matthew.howell@sealevel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
index 077c3ba3539e..3886f78ecbbf 100644
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -47,12 +47,6 @@
#define PCI_SUBDEVICE_ID_USR_2980 0x0128
#define PCI_SUBDEVICE_ID_USR_2981 0x0129
-#define PCI_DEVICE_ID_SEALEVEL_710xC 0x1001
-#define PCI_DEVICE_ID_SEALEVEL_720xC 0x1002
-#define PCI_DEVICE_ID_SEALEVEL_740xC 0x1004
-#define PCI_DEVICE_ID_SEALEVEL_780xC 0x1008
-#define PCI_DEVICE_ID_SEALEVEL_716xC 0x1010
-
#define UART_EXAR_INT0 0x80
#define UART_EXAR_8XMODE 0x88 /* 8X sampling rate select */
#define UART_EXAR_SLEEP 0x8b /* Sleep mode */
@@ -652,8 +646,6 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
nr_ports = BIT(((pcidev->device & 0x38) >> 3) - 1);
else if (board->num_ports)
nr_ports = board->num_ports;
- else if (pcidev->vendor == PCI_VENDOR_ID_SEALEVEL)
- nr_ports = pcidev->device & 0xff;
else
nr_ports = pcidev->device & 0x0f;
@@ -893,12 +885,6 @@ static const struct pci_device_id exar_pci_tbl[] = {
EXAR_DEVICE(COMMTECH, 4224PCI335, pbn_fastcom335_4),
EXAR_DEVICE(COMMTECH, 2324PCI335, pbn_fastcom335_4),
EXAR_DEVICE(COMMTECH, 2328PCI335, pbn_fastcom335_8),
-
- EXAR_DEVICE(SEALEVEL, 710xC, pbn_exar_XR17V35x),
- EXAR_DEVICE(SEALEVEL, 720xC, pbn_exar_XR17V35x),
- EXAR_DEVICE(SEALEVEL, 740xC, pbn_exar_XR17V35x),
- EXAR_DEVICE(SEALEVEL, 780xC, pbn_exar_XR17V35x),
- EXAR_DEVICE(SEALEVEL, 716xC, pbn_exar_XR17V35x),
{ 0, }
};
MODULE_DEVICE_TABLE(pci, exar_pci_tbl);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH V9 2/2] serial: exar: Add RS-485 support for Sealevel XR17V35X based cards
2023-09-29 17:39 [PATCH V9 1/2] serial: exar: Revert "serial: exar: Add support for Sealevel 7xxxC serial cards" Matthew Howell
@ 2023-09-29 17:40 ` Matthew Howell
2023-10-01 8:56 ` Andy Shevchenko
2023-09-30 6:56 ` [PATCH V9 1/2] serial: exar: Revert "serial: exar: Add support for Sealevel 7xxxC serial cards" gregkh
1 sibling, 1 reply; 4+ messages in thread
From: Matthew Howell @ 2023-09-29 17:40 UTC (permalink / raw)
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, Darren Beeson,
andriy.shevchenko@intel.com, ilpo.jarvinen@linux.intel.com,
eff.baldwin@sealevel.com, James Olson, Ryan Wenglarz
From: Matthew Howell <matthew.howell@sealevel.com>
Sealevel XR17V35X based cards utilize DTR to control RS-485 Enable, but
the current implementation of 8250_exar uses RTS for the auto-RS485-Enable
mode of the XR17V35X UARTs. This patch implements DTR Auto-RS485 on
Sealevel cards.
Signed-off-by: Matthew Howell <matthew.howell@sealevel.com>
---
V8->V9
Changed implementation to use pci_xr17v35x_setup() instead of creating
separate startup functions.
diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
index 3886f78ecbbf..f4a467d5b6aa 100644
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -78,6 +78,9 @@
#define UART_EXAR_RS485_DLY(x) ((x) << 4)
+#define UART_EXAR_DLD 0x02 /* Divisor Fractional */
+#define UART_EXAR_DLD_485_POLARITY 0x80 /* RS-485 Enable Signal Polarity */
+
/*
* IOT2040 MPIO wiring semantics:
*
@@ -439,6 +442,44 @@ static int generic_rs485_config(struct uart_port *port, struct ktermios *termios
return 0;
}
+static int sealevel_rs485_config(struct uart_port *port, struct ktermios *termios,
+ struct serial_rs485 *rs485)
+{
+ u8 __iomem *p = port->membase;
+ u8 old_lcr;
+ u8 efr;
+ u8 dld;
+ int ret;
+
+ ret = generic_rs485_config(port, termios, rs485);
+ if (ret)
+ return ret;
+
+ if (rs485->flags & SER_RS485_ENABLED) {
+ old_lcr = readb(p + UART_LCR);
+
+ /* Set EFR[4]=1 to enable enhanced feature registers */
+ efr = readb(p + UART_XR_EFR);
+ efr |= UART_EFR_ECB;
+ writeb(efr, p + UART_XR_EFR);
+
+ /* Set MCR to use DTR as Auto-RS485 Enable signal */
+ writeb(UART_MCR_OUT1, p + UART_MCR);
+
+ /* Set LCR[7]=1 to enable access to DLD register */
+ writeb(old_lcr | UART_LCR_DLAB, p + UART_LCR);
+
+ /* Set DLD[7]=1 for inverted RS485 Enable logic */
+ dld = readb(p + UART_EXAR_DLD);
+ dld |= UART_EXAR_DLD_485_POLARITY;
+ writeb(dld, p + UART_EXAR_DLD);
+
+ writeb(old_lcr, p + UART_LCR);
+ }
+
+ return 0;
+}
+
static const struct serial_rs485 generic_rs485_supported = {
.flags = SER_RS485_ENABLED,
};
@@ -560,6 +601,9 @@ pci_xr17v35x_setup(struct exar8250 *priv, struct pci_dev *pcidev,
port->port.rs485_config = platform->rs485_config;
port->port.rs485_supported = *(platform->rs485_supported);
+ if (pcidev->subsystem_vendor == PCI_VENDOR_ID_SEALEVEL)
+ port->port.rs485_config = sealevel_rs485_config;
+
/*
* Setup the UART clock for the devices on expansion slot to
* half the clock speed of the main chip (which is 125MHz)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH V9 1/2] serial: exar: Revert "serial: exar: Add support for Sealevel 7xxxC serial cards"
2023-09-29 17:39 [PATCH V9 1/2] serial: exar: Revert "serial: exar: Add support for Sealevel 7xxxC serial cards" Matthew Howell
2023-09-29 17:40 ` [PATCH V9 2/2] serial: exar: Add RS-485 support for Sealevel XR17V35X based cards Matthew Howell
@ 2023-09-30 6:56 ` gregkh
1 sibling, 0 replies; 4+ messages in thread
From: gregkh @ 2023-09-30 6:56 UTC (permalink / raw)
To: Matthew Howell
Cc: Darren Beeson, andriy.shevchenko@intel.com,
ilpo.jarvinen@linux.intel.com, eff.baldwin@sealevel.com,
linux-serial@vger.kernel.org, Ryan Wenglarz, James Olson
On Fri, Sep 29, 2023 at 05:39:49PM +0000, Matthew Howell wrote:
> From: Matthew Howell <matthew.howell@sealevel.com>
>
> Hardware ID of Sealevel 7xxxC cards changed prior to release.
> This has rendered 14ee78d5932a redundant.
>
> This reverts commit 14ee78d5932afeb710c8305196a676a715bfdea8.
>
> Fixes: 14ee78d5932a ("Add support for Sealevel 7xxxC serial cards")
> Signed-off-by: Matthew Howell <matthew.howell@sealevel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
> index 077c3ba3539e..3886f78ecbbf 100644
> --- a/drivers/tty/serial/8250/8250_exar.c
> +++ b/drivers/tty/serial/8250/8250_exar.c
> @@ -47,12 +47,6 @@
> #define PCI_SUBDEVICE_ID_USR_2980 0x0128
> #define PCI_SUBDEVICE_ID_USR_2981 0x0129
>
> -#define PCI_DEVICE_ID_SEALEVEL_710xC 0x1001
> -#define PCI_DEVICE_ID_SEALEVEL_720xC 0x1002
> -#define PCI_DEVICE_ID_SEALEVEL_740xC 0x1004
> -#define PCI_DEVICE_ID_SEALEVEL_780xC 0x1008
> -#define PCI_DEVICE_ID_SEALEVEL_716xC 0x1010
> -
> #define UART_EXAR_INT0 0x80
> #define UART_EXAR_8XMODE 0x88 /* 8X sampling rate select */
> #define UART_EXAR_SLEEP 0x8b /* Sleep mode */
> @@ -652,8 +646,6 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
> nr_ports = BIT(((pcidev->device & 0x38) >> 3) - 1);
> else if (board->num_ports)
> nr_ports = board->num_ports;
> - else if (pcidev->vendor == PCI_VENDOR_ID_SEALEVEL)
> - nr_ports = pcidev->device & 0xff;
> else
> nr_ports = pcidev->device & 0x0f;
>
> @@ -893,12 +885,6 @@ static const struct pci_device_id exar_pci_tbl[] = {
> EXAR_DEVICE(COMMTECH, 4224PCI335, pbn_fastcom335_4),
> EXAR_DEVICE(COMMTECH, 2324PCI335, pbn_fastcom335_4),
> EXAR_DEVICE(COMMTECH, 2328PCI335, pbn_fastcom335_8),
> -
> - EXAR_DEVICE(SEALEVEL, 710xC, pbn_exar_XR17V35x),
> - EXAR_DEVICE(SEALEVEL, 720xC, pbn_exar_XR17V35x),
> - EXAR_DEVICE(SEALEVEL, 740xC, pbn_exar_XR17V35x),
> - EXAR_DEVICE(SEALEVEL, 780xC, pbn_exar_XR17V35x),
> - EXAR_DEVICE(SEALEVEL, 716xC, pbn_exar_XR17V35x),
> { 0, }
> };
> MODULE_DEVICE_TABLE(pci, exar_pci_tbl);
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/process/submitting-patches.rst for what
needs to be done here to properly describe this.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V9 2/2] serial: exar: Add RS-485 support for Sealevel XR17V35X based cards
2023-09-29 17:40 ` [PATCH V9 2/2] serial: exar: Add RS-485 support for Sealevel XR17V35X based cards Matthew Howell
@ 2023-10-01 8:56 ` Andy Shevchenko
0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2023-10-01 8:56 UTC (permalink / raw)
To: Matthew Howell
Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org,
Darren Beeson, ilpo.jarvinen@linux.intel.com,
eff.baldwin@sealevel.com, James Olson, Ryan Wenglarz
On Fri, Sep 29, 2023 at 05:40:55PM +0000, Matthew Howell wrote:
> From: Matthew Howell <matthew.howell@sealevel.com>
>
> Sealevel XR17V35X based cards utilize DTR to control RS-485 Enable, but
> the current implementation of 8250_exar uses RTS for the auto-RS485-Enable
> mode of the XR17V35X UARTs. This patch implements DTR Auto-RS485 on
> Sealevel cards.
Looks good, thank you!
Reviewed-by: Andy Shevchenko <andriy.shevchenkoa@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-01 8:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-29 17:39 [PATCH V9 1/2] serial: exar: Revert "serial: exar: Add support for Sealevel 7xxxC serial cards" Matthew Howell
2023-09-29 17:40 ` [PATCH V9 2/2] serial: exar: Add RS-485 support for Sealevel XR17V35X based cards Matthew Howell
2023-10-01 8:56 ` Andy Shevchenko
2023-09-30 6:56 ` [PATCH V9 1/2] serial: exar: Revert "serial: exar: Add support for Sealevel 7xxxC serial cards" gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).