Skip to contentSkip to conversation

term/ns8250-spcr: Add one more 16550 debug type.

PATCH In review Udo Steinberg 3 participants 3 messages Jun 8, 2024 – Jun 12, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 term/ns8250-spcr: Add one more 16550 debug type.

Hi all,

below is a patch for picking up the correct UART address from the ACPI SPCR table on modern AWS bare-metal instances.

CC Benjamin and Glenn for review.

Cheers,
Udo

--

From ddb2b0f0da4f5f6be13a70d5a8d7dff6f90e2208 Mon Sep 17 00:00:00 2001
From: Udo Steinberg <[email protected]>
Date: Fri, 7 Jun 2024 23:44:43 +0200
Subject: [PATCH] term/ns8250-spcr: Add one more 16550 debug type.

Type 0x1 was introduced with the ACPI DBGP table and type 0x12 was introduced with the ACPI DBG2 table. Type 0x12 is used by the ACPI SPCR table on recent AWS bare-metal instances (c6i/c7i). Also give each debug type a proper name.

---
 grub-core/term/ns8250-spcr.c | 3 ++-
 include/grub/acpi.h          | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)
grub-core/term/ns8250-spcr.c +2 -1
index d52b52c26..4efaaf768 100644
@@ -38,7 +38,8 @@ grub_ns8250_spcr_init (void)
     grub_dprintf ("serial", "SPCR table revision %d < 2, continuing anyway\n",
 		  (int) spcr->hdr.revision);
   if (spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550 &&
-      spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550X)
+      spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550_DBGP &&
+      spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550_DBG2)
     return NULL;
   /* For now, we only support byte accesses. */
   if (spcr->base_addr.access_size != GRUB_ACPI_GENADDR_SIZE_BYTE &&
include/grub/acpi.h +3 -2
index f2862da74..1046f22d7 100644
@@ -200,8 +200,9 @@ struct grub_acpi_genaddr {
 struct grub_acpi_spcr {
   struct grub_acpi_table_header hdr;
   grub_uint8_t intf_type;
-#define GRUB_ACPI_SPCR_INTF_TYPE_16550  0x00
-#define GRUB_ACPI_SPCR_INTF_TYPE_16550X 0x01
+#define GRUB_ACPI_SPCR_INTF_TYPE_16550      0x00
+#define GRUB_ACPI_SPCR_INTF_TYPE_16550_DBGP 0x01
+#define GRUB_ACPI_SPCR_INTF_TYPE_16550_DBG2 0x12
   grub_uint8_t reserved_0[3];
   struct grub_acpi_genaddr base_addr;
   grub_uint8_t interrupt_type;
Signature · 7 lines
2.45.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Fri, 7 Jun 2024 23:57:14 +0200 Udo Steinberg <[email protected]> wrote:

Hi all,

below is a patch for picking up the correct UART address from the ACPI SPCR table on modern AWS bare-metal instances.

CC Benjamin and Glenn for review.

Cheers,
Udo

LGTM for the changes itself. I don't think you used git to send the patch, but this is small enough that perhaps Daniel won't have an issue applying it.

Glenn Washburn

Quoted 38 lines

--

From ddb2b0f0da4f5f6be13a70d5a8d7dff6f90e2208 Mon Sep 17 00:00:00 2001
From: Udo Steinberg <[email protected]>
Date: Fri, 7 Jun 2024 23:44:43 +0200
Subject: [PATCH] term/ns8250-spcr: Add one more 16550 debug type.

Type 0x1 was introduced with the ACPI DBGP table and type 0x12 was introduced with the ACPI DBG2 table. Type 0x12 is used by the ACPI SPCR table on recent AWS bare-metal instances (c6i/c7i). Also give each debug type a proper name.

---
 grub-core/term/ns8250-spcr.c | 3 ++-
 include/grub/acpi.h          | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)
grub-core/term/ns8250-spcr.c +2 -1
index d52b52c26..4efaaf768 100644
@@ -38,7 +38,8 @@ grub_ns8250_spcr_init (void)
     grub_dprintf ("serial", "SPCR table revision %d < 2, continuing anyway\n",
 		  (int) spcr->hdr.revision);
   if (spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550 &&
-      spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550X)
+      spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550_DBGP &&
+      spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550_DBG2)
     return NULL;
   /* For now, we only support byte accesses. */
   if (spcr->base_addr.access_size != GRUB_ACPI_GENADDR_SIZE_BYTE &&
include/grub/acpi.h +0 -0
index f2862da74..1046f22d7 100644
@@ -200,8 +200,9 @@ struct grub_acpi_genaddr {
 struct grub_acpi_spcr {

include/grub/acpi.h struct grub_acpi_genaddr { · line 208

Quoted 10 lines
include/grub/acpi.h +3 -2
   struct grub_acpi_table_header hdr;
   grub_uint8_t intf_type;
-#define GRUB_ACPI_SPCR_INTF_TYPE_16550  0x00
-#define GRUB_ACPI_SPCR_INTF_TYPE_16550X 0x01
+#define GRUB_ACPI_SPCR_INTF_TYPE_16550      0x00
+#define GRUB_ACPI_SPCR_INTF_TYPE_16550_DBGP 0x01
+#define GRUB_ACPI_SPCR_INTF_TYPE_16550_DBG2 0x12
   grub_uint8_t reserved_0[3];
   struct grub_acpi_genaddr base_addr;
   grub_uint8_t interrupt_type;

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw
Quoted 8 lines · Glenn Washburn
Quoted 5 lines · On Fri, 7 Jun 2024 23:57:14 +0200 Udo Steinberg <[email protected]> wrote:

Hi all,

below is a patch for picking up the correct UART address from the ACPI SPCR table on modern AWS bare-metal instances.

Quoted 6 lines
Quoted 4 lines
CC Benjamin and Glenn for review.

Cheers,
Udo

LGTM for the changes itself. I don't think you used git to send the

Yeah, it would be perfect if you use git to send patches.

Quoted 4 lines

patch, but this is small enough that perhaps Daniel won't have an issue applying it.

Though this time Reviewed-by: Daniel Kiper <[email protected]>...

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel