bootloader/arm64: Discover UART from DBG2 ACPI table
Fallback to DBG2 if SPCR is not present while discovering UART serial devices. DBG2 is newer than SPCR but does not provide the same information, and it appears that both can exist on the same system. This has only been tested in Hyper-V which exposes DBG2. Change-Id: I6a75114f4287b6db289b544c3b80a66a625fb6c6 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10354 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
53579f5004
commit
05d6e44fc9
@@ -12,6 +12,7 @@
|
||||
#define ACPI_MADT_SIGNATURE "APIC"
|
||||
#define ACPI_MCFG_SIGNATURE "MCFG"
|
||||
#define ACPI_SPCR_SIGNATURE "SPCR"
|
||||
#define ACPI_DBG2_SIGNATURE "DBG2"
|
||||
|
||||
#define ACPI_LOCAL_APIC_ENABLED 0x01
|
||||
|
||||
@@ -264,6 +265,8 @@ typedef struct acpi_mcfg_allocation
|
||||
uint32 reserved;
|
||||
} _PACKED acpi_mcfg_allocation;
|
||||
|
||||
// SPCR table specified by Microsoft at
|
||||
// https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/serial-port-console-redirection-table
|
||||
typedef struct acpi_spcr {
|
||||
acpi_descriptor_header header;
|
||||
uint32 interface_type;
|
||||
@@ -292,6 +295,38 @@ enum {
|
||||
ACPI_SPCR_INTERFACE_TYPE_PL011 = 3,
|
||||
};
|
||||
|
||||
// DBG2 table specified by Microsoft at
|
||||
// https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/acpi-debug-port-table
|
||||
typedef struct acpi_dbg2 {
|
||||
acpi_descriptor_header header;
|
||||
uint32 offset_dbg_device_info;
|
||||
uint32 number_dbg_device_info;
|
||||
} _PACKED acpi_dbg2;
|
||||
|
||||
typedef struct acpi_dbg2_device_info {
|
||||
uint8 revision;
|
||||
uint16 length;
|
||||
uint8 num_addresses;
|
||||
uint16 namespace_str_length;
|
||||
uint16 namespace_str_offset;
|
||||
uint16 oem_data_length;
|
||||
uint16 oem_data_offset;
|
||||
uint16 port_type;
|
||||
uint16 port_subtype;
|
||||
uint16 reserved;
|
||||
uint16 base_addr_offset;
|
||||
uint16 addr_size_offset;
|
||||
} _PACKED acpi_dbg2_device_info;
|
||||
|
||||
enum {
|
||||
ACPI_DBG2_PORT_TYPE_SERIAL = 0x8000,
|
||||
};
|
||||
|
||||
enum {
|
||||
ACPI_DBG2_PORT_SUBTYPE_16550 = 0,
|
||||
ACPI_DBG2_PORT_SUBTYPE_PL011 = 3,
|
||||
};
|
||||
|
||||
|
||||
/* The following definitions are adapted from acpica/include/acrestyp.h */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user