arm/acpi: Add a new ACPI initialized function for UART

This adds a new function to initialize UART for ACPI on ARM.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
This commit is contained in:
Shannon Zhao authored and Jan Beulich committed 2016-03-03 09:09:40 +01:00
1 parent 9ee7fbd4eb
commit 9bd0d13ace
3 files changed
+37 -4

No files matched your search

+1 -1
View File
@@ -768,7 +768,7 @@ void __init start_xen(unsigned long boot_phys_offset,
gic_preinit();
dt_uart_init();
arm_uart_init();
console_init_preirq();
console_init_ring();
+35 -2
View File
@@ -1,7 +1,7 @@
/*
* xen/drivers/char/arm-uart.c
*
* Generic uart retrieved via the device tree
* Generic uart retrieved via the device tree or ACPI
*
* Julien Grall <julien.grall@linaro.org>
* Copyright (c) 2013 Linaro Limited.
@@ -23,6 +23,7 @@
#include <xen/device_tree.h>
#include <xen/serial.h>
#include <xen/errno.h>
#include <xen/acpi.h>
/*
* Configure UART port with a string:
@@ -35,7 +36,7 @@
static char __initdata opt_dtuart[256] = "";
string_param("dtuart", opt_dtuart);
void __init dt_uart_init(void)
static void __init dt_uart_init(void)
{
struct dt_device_node *dev;
int ret;
@@ -96,6 +97,38 @@ void __init dt_uart_init(void)
printk("Unable to initialize dtuart: %d\n", ret);
}
#ifdef CONFIG_ACPI
static void __init acpi_uart_init(void)
{
struct acpi_table_spcr *spcr = NULL;
int ret;
acpi_get_table(ACPI_SIG_SPCR, 0, (struct acpi_table_header **)&spcr);
if ( spcr == NULL )
{
printk("Unable to get spcr table\n");
}
else
{
ret = acpi_device_init(DEVICE_SERIAL, NULL, spcr->interface_type);
if ( ret )
printk("Unable to initialize acpi uart: %d\n", ret);
}
}
#else
static void __init acpi_uart_init(void) { }
#endif
void __init arm_uart_init(void)
{
if ( acpi_disabled )
dt_uart_init();
else
acpi_uart_init();
}
/*
* Local variables:
* mode: C
+1 -1
View File
@@ -170,7 +170,7 @@ struct ns16550_defaults {
void ns16550_init(int index, struct ns16550_defaults *defaults);
void ehci_dbgp_init(void);
void __init dt_uart_init(void);
void arm_uart_init(void);
struct physdev_dbgp_op;
int dbgp_op(const struct physdev_dbgp_op *);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.