All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ns16550: add Asix AX99100 serial card
@ 2024-02-18  1:34 Marek Marczykowski-Górecki
  2024-02-19  8:57 ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-02-18  1:34 UTC (permalink / raw)
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Andrew Cooper, George Dunlap,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu

It's 4-port serial card, each port is presented as a separate function.
According to the specification, it features 256-byte TX FIFO buffer.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
It's a card plugged into a box that can function as yet another gitlab runner.
---
 xen/drivers/char/ns16550.c | 12 ++++++++++++
 xen/include/xen/pci_ids.h  |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 97bf0985344a..00c0da3f373c 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -92,6 +92,7 @@ struct ns16550_config {
         param_exar_xr17v354,
         param_exar_xr17v358,
         param_intel_lpss,
+        param_asix_ax99100,
     } param;
 };
 
@@ -842,6 +843,12 @@ static const struct ns16550_config_param __initconst uart_param[] = {
         .mmio = 1,
         .max_ports = 1,
     },
+    [param_asix_ax99100] = {
+        .reg_width = 1,
+        .lsr_mask = UART_LSR_THRE,
+        .max_ports = 1,
+        .fifo_size = 256,
+    },
 };
 
 static const struct ns16550_config __initconst uart_config[] =
@@ -1170,6 +1177,11 @@ static const struct ns16550_config __initconst uart_config[] =
         .dev_id = 0x7adc,
         .param = param_intel_lpss
     },
+    {
+        .vendor_id = PCI_VENDOR_ID_ASIX,
+        .dev_id = 9100,
+        .param = param_asix_ax99100
+    },
 };
 
 static int __init
diff --git a/xen/include/xen/pci_ids.h b/xen/include/xen/pci_ids.h
index e798477a7e23..2a19f4ab7872 100644
--- a/xen/include/xen/pci_ids.h
+++ b/xen/include/xen/pci_ids.h
@@ -11,3 +11,5 @@
 #define PCI_VENDOR_ID_BROADCOM           0x14e4
 
 #define PCI_VENDOR_ID_INTEL              0x8086
+
+#define PCI_VENDOR_ID_ASIX               0x125b
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ns16550: add Asix AX99100 serial card
  2024-02-18  1:34 [PATCH] ns16550: add Asix AX99100 serial card Marek Marczykowski-Górecki
@ 2024-02-19  8:57 ` Jan Beulich
  2024-02-19 11:13   ` Marek Marczykowski-Górecki
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2024-02-19  8:57 UTC (permalink / raw)
  To: Marek Marczykowski-Górecki
  Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini,
	Wei Liu, xen-devel

On 18.02.2024 02:34, Marek Marczykowski-Górecki wrote:
> @@ -1170,6 +1177,11 @@ static const struct ns16550_config __initconst uart_config[] =
>          .dev_id = 0x7adc,
>          .param = param_intel_lpss
>      },
> +    {
> +        .vendor_id = PCI_VENDOR_ID_ASIX,
> +        .dev_id = 9100,

As per Linux this is 0x9100.

> +        .param = param_asix_ax99100
> +    },
>  };
>  
>  static int __init
> diff --git a/xen/include/xen/pci_ids.h b/xen/include/xen/pci_ids.h
> index e798477a7e23..2a19f4ab7872 100644
> --- a/xen/include/xen/pci_ids.h
> +++ b/xen/include/xen/pci_ids.h
> @@ -11,3 +11,5 @@
>  #define PCI_VENDOR_ID_BROADCOM           0x14e4
>  
>  #define PCI_VENDOR_ID_INTEL              0x8086
> +
> +#define PCI_VENDOR_ID_ASIX               0x125b

Please insert such that numeric sorting is retained.

Jan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ns16550: add Asix AX99100 serial card
  2024-02-19  8:57 ` Jan Beulich
@ 2024-02-19 11:13   ` Marek Marczykowski-Górecki
  2024-02-19 23:11     ` Marek Marczykowski-Górecki
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-02-19 11:13 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini,
	Wei Liu, xen-devel

[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]

On Mon, Feb 19, 2024 at 09:57:49AM +0100, Jan Beulich wrote:
> On 18.02.2024 02:34, Marek Marczykowski-Górecki wrote:
> > @@ -1170,6 +1177,11 @@ static const struct ns16550_config __initconst uart_config[] =
> >          .dev_id = 0x7adc,
> >          .param = param_intel_lpss
> >      },
> > +    {
> > +        .vendor_id = PCI_VENDOR_ID_ASIX,
> > +        .dev_id = 9100,
> 
> As per Linux this is 0x9100.

Right... but then, maybe the patch isn't needed at all, as it does work
for me. Maybe what's needed instead is some other patch already in
staging. Initial attempt that did not work was with 4.17.something.
I guess setting the fifo size isn't that important.

> > +        .param = param_asix_ax99100
> > +    },
> >  };
> >  
> >  static int __init
> > diff --git a/xen/include/xen/pci_ids.h b/xen/include/xen/pci_ids.h
> > index e798477a7e23..2a19f4ab7872 100644
> > --- a/xen/include/xen/pci_ids.h
> > +++ b/xen/include/xen/pci_ids.h
> > @@ -11,3 +11,5 @@
> >  #define PCI_VENDOR_ID_BROADCOM           0x14e4
> >  
> >  #define PCI_VENDOR_ID_INTEL              0x8086
> > +
> > +#define PCI_VENDOR_ID_ASIX               0x125b
> 
> Please insert such that numeric sorting is retained.
> 
> Jan

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ns16550: add Asix AX99100 serial card
  2024-02-19 11:13   ` Marek Marczykowski-Górecki
@ 2024-02-19 23:11     ` Marek Marczykowski-Górecki
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-02-19 23:11 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini,
	Wei Liu, xen-devel

[-- Attachment #1: Type: text/plain, Size: 950 bytes --]

On Mon, Feb 19, 2024 at 12:13:18PM +0100, Marek Marczykowski-Górecki wrote:
> On Mon, Feb 19, 2024 at 09:57:49AM +0100, Jan Beulich wrote:
> > On 18.02.2024 02:34, Marek Marczykowski-Górecki wrote:
> > > @@ -1170,6 +1177,11 @@ static const struct ns16550_config __initconst uart_config[] =
> > >          .dev_id = 0x7adc,
> > >          .param = param_intel_lpss
> > >      },
> > > +    {
> > > +        .vendor_id = PCI_VENDOR_ID_ASIX,
> > > +        .dev_id = 9100,
> > 
> > As per Linux this is 0x9100.
> 
> Right... but then, maybe the patch isn't needed at all, as it does work
> for me. Maybe what's needed instead is some other patch already in
> staging. Initial attempt that did not work was with 4.17.something.
> I guess setting the fifo size isn't that important.

Indeed, the patch is not needed after all, plain "master" from today
works.

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-19 23:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-18  1:34 [PATCH] ns16550: add Asix AX99100 serial card Marek Marczykowski-Górecki
2024-02-19  8:57 ` Jan Beulich
2024-02-19 11:13   ` Marek Marczykowski-Górecki
2024-02-19 23:11     ` Marek Marczykowski-Górecki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.