aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/prom.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/kernel/prom.c')
-rw-r--r--arch/microblaze/kernel/prom.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index bacbd3d41ec7..a105301e2b7f 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -72,11 +72,12 @@ static int __init early_init_dt_scan_serial(unsigned long node,
72/* find compatible node with uartlite */ 72/* find compatible node with uartlite */
73 p = of_get_flat_dt_prop(node, "compatible", &l); 73 p = of_get_flat_dt_prop(node, "compatible", &l);
74 if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) && 74 if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) &&
75 (strncmp(p, "xlnx,opb-uartlite", 17) != 0)) 75 (strncmp(p, "xlnx,opb-uartlite", 17) != 0) &&
76 (strncmp(p, "xlnx,axi-uartlite", 17) != 0))
76 return 0; 77 return 0;
77 78
78 addr = of_get_flat_dt_prop(node, "reg", &l); 79 addr = of_get_flat_dt_prop(node, "reg", &l);
79 return *addr; /* return address */ 80 return be32_to_cpup(addr); /* return address */
80} 81}
81 82
82/* this function is looking for early uartlite console - Microblaze specific */ 83/* this function is looking for early uartlite console - Microblaze specific */
@@ -84,6 +85,40 @@ int __init early_uartlite_console(void)
84{ 85{
85 return of_scan_flat_dt(early_init_dt_scan_serial, NULL); 86 return of_scan_flat_dt(early_init_dt_scan_serial, NULL);
86} 87}
88
89/* MS this is Microblaze specifig function */
90static int __init early_init_dt_scan_serial_full(unsigned long node,
91 const char *uname, int depth, void *data)
92{
93 unsigned long l;
94 char *p;
95 unsigned int addr;
96
97 pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
98
99/* find all serial nodes */
100 if (strncmp(uname, "serial", 6) != 0)
101 return 0;
102
103 early_init_dt_check_for_initrd(node);
104
105/* find compatible node with uartlite */
106 p = of_get_flat_dt_prop(node, "compatible", &l);
107
108 if ((strncmp(p, "xlnx,xps-uart16550", 18) != 0) &&
109 (strncmp(p, "xlnx,axi-uart16550", 18) != 0))
110 return 0;
111
112 addr = *(u32 *)of_get_flat_dt_prop(node, "reg", &l);
113 addr += *(u32 *)of_get_flat_dt_prop(node, "reg-offset", &l);
114 return be32_to_cpu(addr); /* return address */
115}
116
117/* this function is looking for early uartlite console - Microblaze specific */
118int __init early_uart16550_console(void)
119{
120 return of_scan_flat_dt(early_init_dt_scan_serial_full, NULL);
121}
87#endif 122#endif
88 123
89void __init early_init_devtree(void *params) 124void __init early_init_devtree(void *params)