diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-10-20 13:45:14 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-10-21 13:10:10 -0400 |
commit | 32c97689c46b272302053778f1a6c2facb0e220c (patch) | |
tree | 46617f9d6feda43ca5bc142511016c06125a52ec /arch/powerpc | |
parent | 7096d0422153ffcc2264eef652fc3a7bca3e6d3c (diff) |
of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch
This patch refactors the early init parsing of the chosen node so that
architectures aren't forced to provide an empty implementation of
early_init_dt_scan_chosen_arch. Instead, if an architecture wants to
do something different, it can either use a wrapper function around
early_init_dt_scan_chosen(), or it can replace it altogether.
This patch was written in preparation to adding device tree support to
both x86 ad MIPS.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: David Daney <ddaney@caviumnetworks.com>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index fed9bf6187d1..e296aae63c60 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -363,10 +363,15 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
363 | return 0; | 363 | return 0; |
364 | } | 364 | } |
365 | 365 | ||
366 | void __init early_init_dt_scan_chosen_arch(unsigned long node) | 366 | int __init early_init_dt_scan_chosen_ppc(unsigned long node, const char *uname, |
367 | int depth, void *data) | ||
367 | { | 368 | { |
368 | unsigned long *lprop; | 369 | unsigned long *lprop; |
369 | 370 | ||
371 | /* Use common scan routine to determine if this is the chosen node */ | ||
372 | if (early_init_dt_scan_chosen(node, uname, depth, data) == 0) | ||
373 | return 0; | ||
374 | |||
370 | #ifdef CONFIG_PPC64 | 375 | #ifdef CONFIG_PPC64 |
371 | /* check if iommu is forced on or off */ | 376 | /* check if iommu is forced on or off */ |
372 | if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL) | 377 | if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL) |
@@ -398,6 +403,9 @@ void __init early_init_dt_scan_chosen_arch(unsigned long node) | |||
398 | if (lprop) | 403 | if (lprop) |
399 | crashk_res.end = crashk_res.start + *lprop - 1; | 404 | crashk_res.end = crashk_res.start + *lprop - 1; |
400 | #endif | 405 | #endif |
406 | |||
407 | /* break now */ | ||
408 | return 1; | ||
401 | } | 409 | } |
402 | 410 | ||
403 | #ifdef CONFIG_PPC_PSERIES | 411 | #ifdef CONFIG_PPC_PSERIES |
@@ -679,7 +687,7 @@ void __init early_init_devtree(void *params) | |||
679 | * device-tree, including the platform type, initrd location and | 687 | * device-tree, including the platform type, initrd location and |
680 | * size, TCE reserve, and more ... | 688 | * size, TCE reserve, and more ... |
681 | */ | 689 | */ |
682 | of_scan_flat_dt(early_init_dt_scan_chosen, NULL); | 690 | of_scan_flat_dt(early_init_dt_scan_chosen_ppc, NULL); |
683 | 691 | ||
684 | /* Scan memory nodes and rebuild MEMBLOCKs */ | 692 | /* Scan memory nodes and rebuild MEMBLOCKs */ |
685 | memblock_init(); | 693 | memblock_init(); |