diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-05-11 16:12:47 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-05-11 16:12:47 +0000 |
commit | 344615defbcd7c607d81f36fb5e50a007e414f08 (patch) | |
tree | 1d04bc63fec7325d30211f2e40c65d7aad6c9931 /sys/arch/arm64 | |
parent | 89a04970bbafd86c6989de0dc63c92c05c672d75 (diff) |
On ACPI systems, if there is no SPCR table (or if it doesn't provide us
with a usable serial console) switch to the framebuffer console. This
makes the rpi4 do the right thing since the SPCR table is suppressed when
you select "Graphics" as the display.
ok patrick@
Diffstat (limited to 'sys/arch/arm64')
-rw-r--r-- | sys/arch/arm64/stand/efiboot/efiacpi.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arch/arm64/stand/efiboot/efiacpi.c b/sys/arch/arm64/stand/efiboot/efiacpi.c index b9105a66343..62b89c3f11d 100644 --- a/sys/arch/arm64/stand/efiboot/efiacpi.c +++ b/sys/arch/arm64/stand/efiboot/efiacpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efiacpi.c,v 1.7 2020/04/21 07:54:01 kettenis Exp $ */ +/* $OpenBSD: efiacpi.c,v 1.8 2020/05/11 16:12:46 kettenis Exp $ */ /* * Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org> @@ -588,6 +588,8 @@ efi_acpi_madt(struct acpi_table_header *hdr) fdt_node_set_string_property(node, "status", "okay"); } +static int serial = 0; + void efi_acpi_spcr(struct acpi_table_header *hdr) { @@ -654,6 +656,7 @@ efi_acpi_spcr(struct acpi_table_header *hdr) return; } fdt_node_set_property(node, "reg", reg, sizeof(reg)); + serial = 1; } void * @@ -715,6 +718,10 @@ efi_acpi(void) node = fdt_find_node("/acpi"); fdt_node_set_property(node, "reg", reg, sizeof(reg)); + /* Use framebuffer if SPCR is absent or unusable. */ + if (!serial) + cnset(ttydev("fb0")); + /* Raspberry Pi 4 is "special". */ if (memcmp(xsdt->hdr_oemid, "RPIFDN", 6) == 0 && memcmp(xsdt->hdr_oemtableid, "RPI4", 4) == 0) |