Skip to contentSkip to conversation

ns16550: add Asix AX99100 serial card

PATCH In review Marek Marczykowski-Górecki 2 participants 4 messages Feb 18, 2024 – Feb 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ns16550: add Asix AX99100 serial card

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.

---
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(+)
xen/drivers/char/ns16550.c +12 -0
index 97bf0985344a..00c0da3f373c 100644
@@ -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
xen/include/xen/pci_ids.h +2 -0
index e798477a7e23..2a19f4ab7872 100644
@@ -11,3 +11,5 @@
 #define PCI_VENDOR_ID_BROADCOM           0x14e4
 
 #define PCI_VENDOR_ID_INTEL              0x8086
+
+#define PCI_VENDOR_ID_ASIX               0x125b
Signature · 1 line
2.43.0
#1 lore raw

xen/drivers/char/ns16550.c static const struct ns16550_config __initconst uart_config[] = · line 1182

Quoted 7 lines · Marek Marczykowski-Górecki
xen/drivers/char/ns16550.c +3 -0
@@ -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.

Quoted 10 lines
xen/drivers/char/ns16550.c +2 -0
+        .param = param_asix_ax99100
+    },
 };
 
 static int __init
xen/include/xen/pci_ids.h +0 -0
index e798477a7e23..2a19f4ab7872 100644

xen/include/xen/pci_ids.h line 15

Quoted 5 lines
xen/include/xen/pci_ids.h +2 -0
@@ -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

#2 lore raw
Quoted 10 lines · Jan Beulich

xen/drivers/char/ns16550.c static const struct ns16550_config __initconst uart_config[] = · line 1182

Quoted 7 lines · Marek Marczykowski-Górecki
xen/drivers/char/ns16550.c +3 -0
@@ -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.

Quoted 19 lines
Quoted 10 lines
xen/drivers/char/ns16550.c +2 -0
+        .param = param_asix_ax99100
+    },
 };
 
 static int __init
xen/include/xen/pci_ids.h +0 -0
index e798477a7e23..2a19f4ab7872 100644

xen/include/xen/pci_ids.h line 15

Quoted 5 lines
xen/include/xen/pci_ids.h +2 -0
@@ -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

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
#3 lore raw
Quoted 12 lines · Marek Marczykowski-Górecki
Quoted 10 lines · Jan Beulich

xen/drivers/char/ns16550.c static const struct ns16550_config __initconst uart_config[] = · line 1182

Quoted 7 lines · Marek Marczykowski-Górecki
xen/drivers/char/ns16550.c +3 -0
@@ -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.

Quoted 4 lines

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.

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab