Skip to content

Commit ec1dc56

Browse files
Merge patch "Enable SPCR table for console output on RISC-V"
Sia Jee Heng <[email protected]> says: The ACPI SPCR code has been used to enable console output for ARM64 and X86. The same code can be reused for RISC-V. Furthermore, SPCR table is mandated for headless system as outlined in the RISC-V BRS Specification, chapter 6. * b4-shazam-merge: RISC-V: ACPI: Enable SPCR table for console output on RISC-V Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
2 parents b5db73f + 3873894 commit ec1dc56

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

arch/riscv/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ config RISCV
1414
def_bool y
1515
select ACPI_GENERIC_GSI if ACPI
1616
select ACPI_REDUCED_HARDWARE_ONLY if ACPI
17+
select ACPI_SPCR_TABLE if ACPI
1718
select ARCH_DMA_DEFAULT_COHERENT
1819
select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
1920
select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM_VMEMMAP

arch/riscv/kernel/acpi.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
#include <linux/efi.h>
1818
#include <linux/io.h>
1919
#include <linux/memblock.h>
20+
#include <linux/of_fdt.h>
2021
#include <linux/pci.h>
22+
#include <linux/serial_core.h>
2123

2224
int acpi_noirq = 1; /* skip ACPI IRQ initialization */
2325
int acpi_disabled = 1;
@@ -131,7 +133,7 @@ void __init acpi_boot_table_init(void)
131133
if (param_acpi_off ||
132134
(!param_acpi_on && !param_acpi_force &&
133135
efi.acpi20 == EFI_INVALID_TABLE_ADDR))
134-
return;
136+
goto done;
135137

136138
/*
137139
* ACPI is disabled at this point. Enable it in order to parse
@@ -151,6 +153,14 @@ void __init acpi_boot_table_init(void)
151153
if (!param_acpi_force)
152154
disable_acpi();
153155
}
156+
157+
done:
158+
if (acpi_disabled) {
159+
if (earlycon_acpi_spcr_enable)
160+
early_init_dt_scan_chosen_stdout();
161+
} else {
162+
acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
163+
}
154164
}
155165

156166
static int acpi_parse_madt_rintc(union acpi_subtable_headers *header, const unsigned long end)

0 commit comments

Comments
 (0)