[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 2/2] ns16550: add Exar PCIe UART cards support

  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 20 Aug 2021 08:40:02 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rmqe9DklQavUFmXKaYnR4ceDv5aqg9bft7To23E1xTU=; b=UyjtMHdMZbyGK0hH+Li8ayx5hC+LLYf1m89hgEquFDFD5gdRlm1eBbr9od3h1ddUg4v4tZpjIb+y5WAvmurjQoFb9zFBRe8krz0Pp/Qi7CnN4ciCgsggypYSnJMbZbuRFefl8//+2C8hRgnGeUQcgH26u47qF9ONVjFEgTn9gt9hQfTzYnQRjJyQML15VUpZ7Hc1k2EaX8gBKnj2U5kOv00pSKj1tWVmPt3uMVykNQTK/InLX52+/qYMpj4UdLmxX8fwrpAkzjJsM2ecSmhvvCIQTHz0UD1Z51KzUkGSgci9w5Uj1JTchiwdZEZa0qTw/gY9vy+LYWPSHVOsDy304A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ikosnk9bsa9iMdCmy8/IgK3adfmpt6yvKyS7erNXK5rHqfM0AjLmgToivkY3zYYybPWEvVfYqiBRy6Rnt6GIXc5G5xkt9ut1VrDo4H7IVtVO0mF3rEFxJMlMUzu4sVhfV8io7uZc6fkihGICFAKG5nRsDl/Yf9i6pdfK9Z7wNULpD3OfJOks6IyD1KtpPk/kDJff+rsjWxCiaB2MRc+cwnaEsg4PuIxBv2c3vpBAZnWTCllywLyMxkWxnglaC0/iUGzzgaf+HFoArfDYfs5uWvBg+wibZSd7HhadsWgADY7lzHmx1T2+W3tSZBc30vcPfRvFcd5H1qFGAzGtwFLbgg==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 20 Aug 2021 06:40:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.08.2021 21:06, Marek Marczykowski-Górecki wrote:
> Besides standard UART setup, this device needs enabling
> (vendor-specific) "Enhanced Control Bits" - otherwise disabling hardware
> control flow (MCR[2]) is ignored. Add appropriate quirk to the
> ns16550_setup_preirq(), similar to the handle_dw_usr_busy_quirk(). The
> new function act on Exar 2-, 4-, and 8- port cards only. I have tested
> the functionality on 2-port card but based on the Linux driver, the same
> applies to other models too.
> Additionally, Exar card supports fractional divisor (DLD[3:0] register,
> at 0x02). This part is not supported here yet, and seems to not
> be required for working 115200bps at the very least.
> The specification for the 2-port card is available at:
> https://www.maxlinear.com/product/interface/uarts/pcie-uarts/xr17v352
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with one line dropped (see bottom of mail).

> I've opted to move the #ifdef into ns16550_setup_preirq() itself and
> move the whole enable_exar_enhanced_bits() into appropriate #ifdef too
> (need to move it anyway, to use uart_param). But if you prefer the older
> structure (#ifdef inside ns16550_setup_preirq()), I can do that too.

That's okay for now, I think. When we gain more quirks we may want to
re-arrange this some. The only thing I don't like (but which is
unavoidable afaict) is ...

> @@ -104,6 +107,8 @@ struct ns16550_config_param {
>      unsigned int uart_offset;
>      unsigned int first_offset;
>  };
> +
> +static void enable_exar_enhanced_bits(const struct ns16550 *uart);
>  #endif

... this added forward declaration.

> --- a/xen/include/xen/8250-uart.h
> +++ b/xen/include/xen/8250-uart.h
> @@ -35,6 +35,8 @@
>  #define UART_USR          0x1f    /* Status register (DW) */
>  #define UART_DLL          0x00    /* divisor latch (ls) (DLAB=1) */
>  #define UART_DLM          0x01    /* divisor latch (ms) (DLAB=1) */
> +#define UART_XR_EFR       0x09    /* Enhanced function register (Exar) */
> +#define UART_XR_DVID      0x8d    /* Device identification */

The latter line can now be dropped again, as the symbol has no use
anymore. I'll try to remember to take care of this while committing.




Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.