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.c44
1 files changed, 37 insertions, 7 deletions
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 427b13b4740f..a105301e2b7f 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -42,11 +42,6 @@
42#include <asm/sections.h> 42#include <asm/sections.h>
43#include <asm/pci-bridge.h> 43#include <asm/pci-bridge.h>
44 44
45void __init early_init_dt_scan_chosen_arch(unsigned long node)
46{
47 /* No Microblaze specific code here */
48}
49
50void __init early_init_dt_add_memory_arch(u64 base, u64 size) 45void __init early_init_dt_add_memory_arch(u64 base, u64 size)
51{ 46{
52 memblock_add(base, size); 47 memblock_add(base, size);
@@ -77,11 +72,12 @@ static int __init early_init_dt_scan_serial(unsigned long node,
77/* find compatible node with uartlite */ 72/* find compatible node with uartlite */
78 p = of_get_flat_dt_prop(node, "compatible", &l); 73 p = of_get_flat_dt_prop(node, "compatible", &l);
79 if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) && 74 if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) &&
80 (strncmp(p, "xlnx,opb-uartlite", 17) != 0)) 75 (strncmp(p, "xlnx,opb-uartlite", 17) != 0) &&
76 (strncmp(p, "xlnx,axi-uartlite", 17) != 0))
81 return 0; 77 return 0;
82 78
83 addr = of_get_flat_dt_prop(node, "reg", &l); 79 addr = of_get_flat_dt_prop(node, "reg", &l);
84 return *addr; /* return address */ 80 return be32_to_cpup(addr); /* return address */
85} 81}
86 82
87/* this function is looking for early uartlite console - Microblaze specific */ 83/* this function is looking for early uartlite console - Microblaze specific */
@@ -89,6 +85,40 @@ int __init early_uartlite_console(void)
89{ 85{
90 return of_scan_flat_dt(early_init_dt_scan_serial, NULL); 86 return of_scan_flat_dt(early_init_dt_scan_serial, NULL);
91} 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}
92#endif 122#endif
93 123
94void __init early_init_devtree(void *params) 124void __init early_init_devtree(void *params)