diff options
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r-- | arch/x86/kernel/setup.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index c3a606c41ce0..b176f2b1f45d 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -113,6 +113,7 @@ | |||
113 | #endif | 113 | #endif |
114 | #include <asm/mce.h> | 114 | #include <asm/mce.h> |
115 | #include <asm/alternative.h> | 115 | #include <asm/alternative.h> |
116 | #include <asm/prom.h> | ||
116 | 117 | ||
117 | /* | 118 | /* |
118 | * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries. | 119 | * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries. |
@@ -453,16 +454,30 @@ static void __init parse_setup_data(void) | |||
453 | return; | 454 | return; |
454 | pa_data = boot_params.hdr.setup_data; | 455 | pa_data = boot_params.hdr.setup_data; |
455 | while (pa_data) { | 456 | while (pa_data) { |
456 | data = early_memremap(pa_data, PAGE_SIZE); | 457 | u32 data_len, map_len; |
458 | |||
459 | map_len = max(PAGE_SIZE - (pa_data & ~PAGE_MASK), | ||
460 | (u64)sizeof(struct setup_data)); | ||
461 | data = early_memremap(pa_data, map_len); | ||
462 | data_len = data->len + sizeof(struct setup_data); | ||
463 | if (data_len > map_len) { | ||
464 | early_iounmap(data, map_len); | ||
465 | data = early_memremap(pa_data, data_len); | ||
466 | map_len = data_len; | ||
467 | } | ||
468 | |||
457 | switch (data->type) { | 469 | switch (data->type) { |
458 | case SETUP_E820_EXT: | 470 | case SETUP_E820_EXT: |
459 | parse_e820_ext(data, pa_data); | 471 | parse_e820_ext(data); |
472 | break; | ||
473 | case SETUP_DTB: | ||
474 | add_dtb(pa_data); | ||
460 | break; | 475 | break; |
461 | default: | 476 | default: |
462 | break; | 477 | break; |
463 | } | 478 | } |
464 | pa_data = data->next; | 479 | pa_data = data->next; |
465 | early_iounmap(data, PAGE_SIZE); | 480 | early_iounmap(data, map_len); |
466 | } | 481 | } |
467 | } | 482 | } |
468 | 483 | ||
@@ -1030,8 +1045,8 @@ void __init setup_arch(char **cmdline_p) | |||
1030 | * Read APIC and some other early information from ACPI tables. | 1045 | * Read APIC and some other early information from ACPI tables. |
1031 | */ | 1046 | */ |
1032 | acpi_boot_init(); | 1047 | acpi_boot_init(); |
1033 | |||
1034 | sfi_init(); | 1048 | sfi_init(); |
1049 | x86_dtb_init(); | ||
1035 | 1050 | ||
1036 | /* | 1051 | /* |
1037 | * get boot-time SMP configuration: | 1052 | * get boot-time SMP configuration: |
@@ -1065,6 +1080,8 @@ void __init setup_arch(char **cmdline_p) | |||
1065 | #endif | 1080 | #endif |
1066 | x86_init.oem.banner(); | 1081 | x86_init.oem.banner(); |
1067 | 1082 | ||
1083 | x86_init.timers.wallclock_init(); | ||
1084 | |||
1068 | mcheck_init(); | 1085 | mcheck_init(); |
1069 | 1086 | ||
1070 | local_irq_save(flags); | 1087 | local_irq_save(flags); |