diff options
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 483455c5bb02..ce02c056ac3f 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/bitops.h> | 30 | #include <linux/bitops.h> |
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <linux/kexec.h> | 32 | #include <linux/kexec.h> |
33 | #include <linux/debugfs.h> | ||
33 | 34 | ||
34 | #include <asm/prom.h> | 35 | #include <asm/prom.h> |
35 | #include <asm/rtas.h> | 36 | #include <asm/rtas.h> |
@@ -1124,24 +1125,6 @@ static int __init early_init_dt_scan_chosen(unsigned long node, | |||
1124 | tce_alloc_end = *lprop; | 1125 | tce_alloc_end = *lprop; |
1125 | #endif | 1126 | #endif |
1126 | 1127 | ||
1127 | #ifdef CONFIG_PPC_RTAS | ||
1128 | /* To help early debugging via the front panel, we retrieve a minimal | ||
1129 | * set of RTAS infos now if available | ||
1130 | */ | ||
1131 | { | ||
1132 | u64 *basep, *entryp, *sizep; | ||
1133 | |||
1134 | basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); | ||
1135 | entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); | ||
1136 | sizep = of_get_flat_dt_prop(node, "linux,rtas-size", NULL); | ||
1137 | if (basep && entryp && sizep) { | ||
1138 | rtas.base = *basep; | ||
1139 | rtas.entry = *entryp; | ||
1140 | rtas.size = *sizep; | ||
1141 | } | ||
1142 | } | ||
1143 | #endif /* CONFIG_PPC_RTAS */ | ||
1144 | |||
1145 | #ifdef CONFIG_KEXEC | 1128 | #ifdef CONFIG_KEXEC |
1146 | lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL); | 1129 | lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL); |
1147 | if (lprop) | 1130 | if (lprop) |
@@ -1326,6 +1309,11 @@ void __init early_init_devtree(void *params) | |||
1326 | /* Setup flat device-tree pointer */ | 1309 | /* Setup flat device-tree pointer */ |
1327 | initial_boot_params = params; | 1310 | initial_boot_params = params; |
1328 | 1311 | ||
1312 | #ifdef CONFIG_PPC_RTAS | ||
1313 | /* Some machines might need RTAS info for debugging, grab it now. */ | ||
1314 | of_scan_flat_dt(early_init_dt_scan_rtas, NULL); | ||
1315 | #endif | ||
1316 | |||
1329 | /* Retrieve various informations from the /chosen node of the | 1317 | /* Retrieve various informations from the /chosen node of the |
1330 | * device-tree, including the platform type, initrd location and | 1318 | * device-tree, including the platform type, initrd location and |
1331 | * size, TCE reserve, and more ... | 1319 | * size, TCE reserve, and more ... |
@@ -2148,3 +2136,27 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) | |||
2148 | } | 2136 | } |
2149 | return NULL; | 2137 | return NULL; |
2150 | } | 2138 | } |
2139 | |||
2140 | #ifdef DEBUG | ||
2141 | static struct debugfs_blob_wrapper flat_dt_blob; | ||
2142 | |||
2143 | static int __init export_flat_device_tree(void) | ||
2144 | { | ||
2145 | struct dentry *d; | ||
2146 | |||
2147 | d = debugfs_create_dir("powerpc", NULL); | ||
2148 | if (!d) | ||
2149 | return 1; | ||
2150 | |||
2151 | flat_dt_blob.data = initial_boot_params; | ||
2152 | flat_dt_blob.size = initial_boot_params->totalsize; | ||
2153 | |||
2154 | d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR, | ||
2155 | d, &flat_dt_blob); | ||
2156 | if (!d) | ||
2157 | return 1; | ||
2158 | |||
2159 | return 0; | ||
2160 | } | ||
2161 | __initcall(export_flat_device_tree); | ||
2162 | #endif | ||