SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
Earlycon should be set up as early as possible.  ACPI boot tables are
mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
is called from setup_arch() and that's where we parse SPCR.
So it has to be opted-in per-arch.
When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
deferred until the DT/ACPI decision is done.  Initialize DT earlycon
if ACPI is disabled.
Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        select ACPI_GENERIC_GSI if ACPI
        select ACPI_REDUCED_HARDWARE_ONLY if ACPI
        select ACPI_MCFG if ACPI
+       select ACPI_SPCR_TABLE if ACPI
        select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
 
 #include <linux/memblock.h>
 #include <linux/of_fdt.h>
 #include <linux/smp.h>
+#include <linux/serial_core.h>
 
 #include <asm/cputype.h>
 #include <asm/cpu_ops.h>
        if (param_acpi_off ||
            (!param_acpi_on && !param_acpi_force &&
             of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
-               return;
+               goto done;
 
        /*
         * ACPI is disabled at this point. Enable it in order to parse
                if (!param_acpi_force)
                        disable_acpi();
        }
+
+done:
+       if (acpi_disabled) {
+               if (earlycon_init_is_deferred)
+                       early_init_dt_scan_chosen_stdout();
+       } else {
+               parse_spcr(earlycon_init_is_deferred);
+       }
 }
 
 #ifdef CONFIG_ACPI_APEI