diff options
author | Michal Simek <monstr@monstr.eu> | 2010-09-28 08:17:03 +0200 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2010-10-21 07:51:53 +0200 |
commit | 67f4aaa21cf8cf09726cd26b506f3407ad7f11f9 (patch) | |
tree | 3a7162f933bcc2a54bf9a423e1830ee2a604b559 /arch/microblaze/kernel/prom.c | |
parent | microblaze: Do not compile early console support for uartlite if is disabled (diff) | |
download | linux-67f4aaa21cf8cf09726cd26b506f3407ad7f11f9.tar.xz linux-67f4aaa21cf8cf09726cd26b506f3407ad7f11f9.zip |
microblaze: Support early console on uart16550
Early console support reuse setting from U-BOOT that's why
it is not necessary to setup baudrates, etc.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel/prom.c')
-rw-r--r-- | arch/microblaze/kernel/prom.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c index 427b13b4740f..608e5cf2e10a 100644 --- a/arch/microblaze/kernel/prom.c +++ b/arch/microblaze/kernel/prom.c @@ -89,6 +89,40 @@ int __init early_uartlite_console(void) { return of_scan_flat_dt(early_init_dt_scan_serial, NULL); } + +/* MS this is Microblaze specifig function */ +static int __init early_init_dt_scan_serial_full(unsigned long node, + const char *uname, int depth, void *data) +{ + unsigned long l; + char *p; + unsigned int addr; + + pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname); + +/* find all serial nodes */ + if (strncmp(uname, "serial", 6) != 0) + return 0; + + early_init_dt_check_for_initrd(node); + +/* find compatible node with uartlite */ + p = of_get_flat_dt_prop(node, "compatible", &l); + + if ((strncmp(p, "xlnx,xps-uart16550", 18) != 0) && + (strncmp(p, "xlnx,axi-uart16550", 18) != 0)) + return 0; + + addr = *(u32 *)of_get_flat_dt_prop(node, "reg", &l); + addr += *(u32 *)of_get_flat_dt_prop(node, "reg-offset", &l); + return addr; /* return address */ +} + +/* this function is looking for early uartlite console - Microblaze specific */ +int __init early_uart16550_console(void) +{ + return of_scan_flat_dt(early_init_dt_scan_serial_full, NULL); +} #endif void __init early_init_devtree(void *params) |