diff options
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r-- | arch/arm/kernel/setup.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 8fc2c8fcbdc6..095d6611c84e 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/memblock.h> | 31 | #include <linux/memblock.h> |
32 | #include <linux/bug.h> | 32 | #include <linux/bug.h> |
33 | #include <linux/compiler.h> | 33 | #include <linux/compiler.h> |
34 | #include <linux/sort.h> | ||
34 | 35 | ||
35 | #include <asm/unified.h> | 36 | #include <asm/unified.h> |
36 | #include <asm/cpu.h> | 37 | #include <asm/cpu.h> |
@@ -890,6 +891,12 @@ static struct machine_desc * __init setup_machine_tags(unsigned int nr) | |||
890 | return mdesc; | 891 | return mdesc; |
891 | } | 892 | } |
892 | 893 | ||
894 | static int __init meminfo_cmp(const void *_a, const void *_b) | ||
895 | { | ||
896 | const struct membank *a = _a, *b = _b; | ||
897 | long cmp = bank_pfn_start(a) - bank_pfn_start(b); | ||
898 | return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; | ||
899 | } | ||
893 | 900 | ||
894 | void __init setup_arch(char **cmdline_p) | 901 | void __init setup_arch(char **cmdline_p) |
895 | { | 902 | { |
@@ -908,8 +915,8 @@ void __init setup_arch(char **cmdline_p) | |||
908 | arm_dma_zone_size = mdesc->dma_zone_size; | 915 | arm_dma_zone_size = mdesc->dma_zone_size; |
909 | } | 916 | } |
910 | #endif | 917 | #endif |
911 | if (mdesc->soft_reboot) | 918 | if (mdesc->restart_mode) |
912 | reboot_setup("s"); | 919 | reboot_setup(&mdesc->restart_mode); |
913 | 920 | ||
914 | init_mm.start_code = (unsigned long) _text; | 921 | init_mm.start_code = (unsigned long) _text; |
915 | init_mm.end_code = (unsigned long) _etext; | 922 | init_mm.end_code = (unsigned long) _etext; |
@@ -922,12 +929,16 @@ void __init setup_arch(char **cmdline_p) | |||
922 | 929 | ||
923 | parse_early_param(); | 930 | parse_early_param(); |
924 | 931 | ||
932 | sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL); | ||
925 | sanity_check_meminfo(); | 933 | sanity_check_meminfo(); |
926 | arm_memblock_init(&meminfo, mdesc); | 934 | arm_memblock_init(&meminfo, mdesc); |
927 | 935 | ||
928 | paging_init(mdesc); | 936 | paging_init(mdesc); |
929 | request_standard_resources(mdesc); | 937 | request_standard_resources(mdesc); |
930 | 938 | ||
939 | if (mdesc->restart) | ||
940 | arm_pm_restart = mdesc->restart; | ||
941 | |||
931 | unflatten_device_tree(); | 942 | unflatten_device_tree(); |
932 | 943 | ||
933 | #ifdef CONFIG_SMP | 944 | #ifdef CONFIG_SMP |