diff options
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) | |||
| 89 | { | 89 | { |
| 90 | return of_scan_flat_dt(early_init_dt_scan_serial, NULL); | 90 | return of_scan_flat_dt(early_init_dt_scan_serial, NULL); |
| 91 | } | 91 | } |
| 92 | |||
| 93 | /* MS this is Microblaze specifig function */ | ||
| 94 | static int __init early_init_dt_scan_serial_full(unsigned long node, | ||
| 95 | const char *uname, int depth, void *data) | ||
| 96 | { | ||
| 97 | unsigned long l; | ||
| 98 | char *p; | ||
| 99 | unsigned int addr; | ||
| 100 | |||
| 101 | pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname); | ||
| 102 | |||
| 103 | /* find all serial nodes */ | ||
| 104 | if (strncmp(uname, "serial", 6) != 0) | ||
| 105 | return 0; | ||
| 106 | |||
| 107 | early_init_dt_check_for_initrd(node); | ||
| 108 | |||
| 109 | /* find compatible node with uartlite */ | ||
| 110 | p = of_get_flat_dt_prop(node, "compatible", &l); | ||
| 111 | |||
| 112 | if ((strncmp(p, "xlnx,xps-uart16550", 18) != 0) && | ||
| 113 | (strncmp(p, "xlnx,axi-uart16550", 18) != 0)) | ||
| 114 | return 0; | ||
| 115 | |||
| 116 | addr = *(u32 *)of_get_flat_dt_prop(node, "reg", &l); | ||
| 117 | addr += *(u32 *)of_get_flat_dt_prop(node, "reg-offset", &l); | ||
| 118 | return addr; /* return address */ | ||
| 119 | } | ||
| 120 | |||
| 121 | /* this function is looking for early uartlite console - Microblaze specific */ | ||
| 122 | int __init early_uart16550_console(void) | ||
| 123 | { | ||
| 124 | return of_scan_flat_dt(early_init_dt_scan_serial_full, NULL); | ||
| 125 | } | ||
| 92 | #endif | 126 | #endif |
| 93 | 127 | ||
| 94 | void __init early_init_devtree(void *params) | 128 | void __init early_init_devtree(void *params) |
