17 #include <linux/kernel.h>
18 #include <linux/string.h>
22 #include <linux/types.h>
23 #include <linux/pci.h>
27 #include <linux/bitops.h>
28 #include <linux/module.h>
29 #include <linux/kexec.h>
36 #include <asm/processor.h>
40 #include <asm/pgtable.h>
41 #include <asm/sections.h>
42 #include <asm/pci-bridge.h>
54 #ifdef CONFIG_EARLY_PRINTK
57 int __init early_init_dt_scan_chosen_serial(
unsigned long node,
63 pr_debug(
"%s: depth: %d, uname: %s\n", __func__, depth, uname);
65 if (depth == 1 && (
strcmp(uname,
"chosen") == 0 ||
66 strcmp(uname,
"chosen@0") == 0)) {
67 p = of_get_flat_dt_prop(node,
"linux,stdout-path", &l);
68 if (p !=
NULL && l > 0)
72 if (stdout &&
strstr(stdout, uname)) {
73 p = of_get_flat_dt_prop(node,
"compatible", &l);
74 pr_debug(
"Compatible string: %s\n", p);
76 if ((
strncmp(p,
"xlnx,xps-uart16550", 18) == 0) ||
77 (
strncmp(p,
"xlnx,axi-uart16550", 18) == 0)) {
80 *(
u32 *)data = UART16550;
82 addr = *(
u32 *)of_get_flat_dt_prop(node,
"reg", &l);
83 addr += *(
u32 *)of_get_flat_dt_prop(node,
88 if ((
strncmp(p,
"xlnx,xps-uartlite", 17) == 0) ||
89 (
strncmp(p,
"xlnx,opb-uartlite", 17) == 0) ||
90 (
strncmp(p,
"xlnx,axi-uartlite", 17) == 0) ||
91 (
strncmp(p,
"xlnx,mdm", 8) == 0)) {
94 *(
u32 *)data = UARTLITE;
96 addrp = of_get_flat_dt_prop(node,
"reg", &l);
106 return of_scan_flat_dt(early_init_dt_scan_chosen_serial, version);
112 pr_debug(
" -> early_init_devtree(%p)\n", params);
121 of_scan_flat_dt(early_init_dt_scan_chosen,
cmd_line);
124 of_scan_flat_dt(early_init_dt_scan_root,
NULL);
125 of_scan_flat_dt(early_init_dt_scan_memory,
NULL);
135 pr_debug(
" <- early_init_devtree()\n");
138 #ifdef CONFIG_BLK_DEV_INITRD
159 #if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
162 static int __init export_flat_device_tree(
void)
170 of_debugfs_root, &flat_dt_blob);