diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2006-06-23 04:20:13 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-06-27 21:59:48 -0400 |
commit | 458148c00b97864a27ecf528a1d45a8e5ebd9bbc (patch) | |
tree | cd32ceb1cddc32e501a1aeebd0f0f88dbdd950a5 | |
parent | ab3ab74d9b6b3920be70f502b40cb3f7f08d23fa (diff) |
[POWERPC] Setup RTAS values earlier, to enable rtas_call() earlier
Althought RTAS is instantiated when we enter the kernel, we can't actually
call into it until we know its entry point address. Currently we grab that
in rtas_initialize(), however that's quite late in the boot sequence.
To enable rtas_call() earlier, we can grab the RTAS entry etc. values while
we're scanning the flattened device tree. There's existing code to retrieve
the values from /chosen, however we don't store them there anymore, so remove
that code.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/kernel/prom.c | 23 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas.c | 22 | ||||
-rw-r--r-- | include/asm-powerpc/rtas.h | 3 |
3 files changed, 30 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index efed4bc2b454..ce02c056ac3f 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -1125,24 +1125,6 @@ static int __init early_init_dt_scan_chosen(unsigned long node, | |||
1125 | tce_alloc_end = *lprop; | 1125 | tce_alloc_end = *lprop; |
1126 | #endif | 1126 | #endif |
1127 | 1127 | ||
1128 | #ifdef CONFIG_PPC_RTAS | ||
1129 | /* To help early debugging via the front panel, we retrieve a minimal | ||
1130 | * set of RTAS infos now if available | ||
1131 | */ | ||
1132 | { | ||
1133 | u64 *basep, *entryp, *sizep; | ||
1134 | |||
1135 | basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); | ||
1136 | entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); | ||
1137 | sizep = of_get_flat_dt_prop(node, "linux,rtas-size", NULL); | ||
1138 | if (basep && entryp && sizep) { | ||
1139 | rtas.base = *basep; | ||
1140 | rtas.entry = *entryp; | ||
1141 | rtas.size = *sizep; | ||
1142 | } | ||
1143 | } | ||
1144 | #endif /* CONFIG_PPC_RTAS */ | ||
1145 | |||
1146 | #ifdef CONFIG_KEXEC | 1128 | #ifdef CONFIG_KEXEC |
1147 | 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); |
1148 | if (lprop) | 1130 | if (lprop) |
@@ -1327,6 +1309,11 @@ void __init early_init_devtree(void *params) | |||
1327 | /* Setup flat device-tree pointer */ | 1309 | /* Setup flat device-tree pointer */ |
1328 | initial_boot_params = params; | 1310 | initial_boot_params = params; |
1329 | 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 | |||
1330 | /* Retrieve various informations from the /chosen node of the | 1317 | /* Retrieve various informations from the /chosen node of the |
1331 | * device-tree, including the platform type, initrd location and | 1318 | * device-tree, including the platform type, initrd location and |
1332 | * size, TCE reserve, and more ... | 1319 | * size, TCE reserve, and more ... |
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index b6aed765966a..061d8afd246e 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -801,3 +801,25 @@ void __init rtas_initialize(void) | |||
801 | rtas_last_error_token = rtas_token("rtas-last-error"); | 801 | rtas_last_error_token = rtas_token("rtas-last-error"); |
802 | #endif | 802 | #endif |
803 | } | 803 | } |
804 | |||
805 | int __init early_init_dt_scan_rtas(unsigned long node, | ||
806 | const char *uname, int depth, void *data) | ||
807 | { | ||
808 | u32 *basep, *entryp, *sizep; | ||
809 | |||
810 | if (depth != 1 || strcmp(uname, "rtas") != 0) | ||
811 | return 0; | ||
812 | |||
813 | basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); | ||
814 | entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); | ||
815 | sizep = of_get_flat_dt_prop(node, "rtas-size", NULL); | ||
816 | |||
817 | if (basep && entryp && sizep) { | ||
818 | rtas.base = *basep; | ||
819 | rtas.entry = *entryp; | ||
820 | rtas.size = *sizep; | ||
821 | } | ||
822 | |||
823 | /* break now */ | ||
824 | return 1; | ||
825 | } | ||
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h index 02e213e3d69f..a33c6acffa61 100644 --- a/include/asm-powerpc/rtas.h +++ b/include/asm-powerpc/rtas.h | |||
@@ -181,6 +181,9 @@ extern int rtas_set_rtc_time(struct rtc_time *rtc_time); | |||
181 | extern unsigned int rtas_busy_delay_time(int status); | 181 | extern unsigned int rtas_busy_delay_time(int status); |
182 | extern unsigned int rtas_busy_delay(int status); | 182 | extern unsigned int rtas_busy_delay(int status); |
183 | 183 | ||
184 | extern int early_init_dt_scan_rtas(unsigned long node, | ||
185 | const char *uname, int depth, void *data); | ||
186 | |||
184 | extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); | 187 | extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); |
185 | 188 | ||
186 | /* Error types logged. */ | 189 | /* Error types logged. */ |