diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/platform/efi/efi.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 6d88dcac466c..511fb15e2036 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * Skip non-WB memory and ignore empty memory ranges. | 26 | * Skip non-WB memory and ignore empty memory ranges. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/kernel.h> | 31 | #include <linux/kernel.h> |
30 | #include <linux/init.h> | 32 | #include <linux/init.h> |
31 | #include <linux/efi.h> | 33 | #include <linux/efi.h> |
@@ -47,7 +49,6 @@ | |||
47 | #include <asm/x86_init.h> | 49 | #include <asm/x86_init.h> |
48 | 50 | ||
49 | #define EFI_DEBUG 1 | 51 | #define EFI_DEBUG 1 |
50 | #define PFX "EFI: " | ||
51 | 52 | ||
52 | int efi_enabled; | 53 | int efi_enabled; |
53 | EXPORT_SYMBOL(efi_enabled); | 54 | EXPORT_SYMBOL(efi_enabled); |
@@ -254,7 +255,7 @@ int efi_set_rtc_mmss(unsigned long nowtime) | |||
254 | 255 | ||
255 | status = efi.get_time(&eft, &cap); | 256 | status = efi.get_time(&eft, &cap); |
256 | if (status != EFI_SUCCESS) { | 257 | if (status != EFI_SUCCESS) { |
257 | printk(KERN_ERR "Oops: efitime: can't read time!\n"); | 258 | pr_err("Oops: efitime: can't read time!\n"); |
258 | return -1; | 259 | return -1; |
259 | } | 260 | } |
260 | 261 | ||
@@ -268,7 +269,7 @@ int efi_set_rtc_mmss(unsigned long nowtime) | |||
268 | 269 | ||
269 | status = efi.set_time(&eft); | 270 | status = efi.set_time(&eft); |
270 | if (status != EFI_SUCCESS) { | 271 | if (status != EFI_SUCCESS) { |
271 | printk(KERN_ERR "Oops: efitime: can't write time!\n"); | 272 | pr_err("Oops: efitime: can't write time!\n"); |
272 | return -1; | 273 | return -1; |
273 | } | 274 | } |
274 | return 0; | 275 | return 0; |
@@ -282,7 +283,7 @@ unsigned long efi_get_time(void) | |||
282 | 283 | ||
283 | status = efi.get_time(&eft, &cap); | 284 | status = efi.get_time(&eft, &cap); |
284 | if (status != EFI_SUCCESS) | 285 | if (status != EFI_SUCCESS) |
285 | printk(KERN_ERR "Oops: efitime: can't read time!\n"); | 286 | pr_err("Oops: efitime: can't read time!\n"); |
286 | 287 | ||
287 | return mktime(eft.year, eft.month, eft.day, eft.hour, | 288 | return mktime(eft.year, eft.month, eft.day, eft.hour, |
288 | eft.minute, eft.second); | 289 | eft.minute, eft.second); |
@@ -367,7 +368,7 @@ static void __init print_efi_memmap(void) | |||
367 | p < memmap.map_end; | 368 | p < memmap.map_end; |
368 | p += memmap.desc_size, i++) { | 369 | p += memmap.desc_size, i++) { |
369 | md = p; | 370 | md = p; |
370 | printk(KERN_INFO PFX "mem%02u: type=%u, attr=0x%llx, " | 371 | pr_info("mem%02u: type=%u, attr=0x%llx, " |
371 | "range=[0x%016llx-0x%016llx) (%lluMB)\n", | 372 | "range=[0x%016llx-0x%016llx) (%lluMB)\n", |
372 | i, md->type, md->attribute, md->phys_addr, | 373 | i, md->type, md->attribute, md->phys_addr, |
373 | md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), | 374 | md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), |
@@ -400,7 +401,7 @@ void __init efi_reserve_boot_services(void) | |||
400 | memblock_is_region_reserved(start, size)) { | 401 | memblock_is_region_reserved(start, size)) { |
401 | /* Could not reserve, skip it */ | 402 | /* Could not reserve, skip it */ |
402 | md->num_pages = 0; | 403 | md->num_pages = 0; |
403 | memblock_dbg(PFX "Could not reserve boot range " | 404 | memblock_dbg("Could not reserve boot range " |
404 | "[0x%010llx-0x%010llx]\n", | 405 | "[0x%010llx-0x%010llx]\n", |
405 | start, start+size-1); | 406 | start, start+size-1); |
406 | } else | 407 | } else |
@@ -434,7 +435,7 @@ static void __init efi_systab_init(void *phys) | |||
434 | efi.systab = early_ioremap((unsigned long)efi_phys.systab, | 435 | efi.systab = early_ioremap((unsigned long)efi_phys.systab, |
435 | sizeof(efi_system_table_t)); | 436 | sizeof(efi_system_table_t)); |
436 | if (efi.systab == NULL) | 437 | if (efi.systab == NULL) |
437 | printk(KERN_ERR "Couldn't map the EFI system table!\n"); | 438 | pr_err("Couldn't map the system table!\n"); |
438 | memcpy(&efi_systab, efi.systab, sizeof(efi_system_table_t)); | 439 | memcpy(&efi_systab, efi.systab, sizeof(efi_system_table_t)); |
439 | early_iounmap(efi.systab, sizeof(efi_system_table_t)); | 440 | early_iounmap(efi.systab, sizeof(efi_system_table_t)); |
440 | efi.systab = &efi_systab; | 441 | efi.systab = &efi_systab; |
@@ -443,9 +444,9 @@ static void __init efi_systab_init(void *phys) | |||
443 | * Verify the EFI Table | 444 | * Verify the EFI Table |
444 | */ | 445 | */ |
445 | if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) | 446 | if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) |
446 | printk(KERN_ERR "EFI system table signature incorrect!\n"); | 447 | pr_err("System table signature incorrect!\n"); |
447 | if ((efi.systab->hdr.revision >> 16) == 0) | 448 | if ((efi.systab->hdr.revision >> 16) == 0) |
448 | printk(KERN_ERR "Warning: EFI system table version " | 449 | pr_err("Warning: System table version " |
449 | "%d.%02d, expected 1.00 or greater!\n", | 450 | "%d.%02d, expected 1.00 or greater!\n", |
450 | efi.systab->hdr.revision >> 16, | 451 | efi.systab->hdr.revision >> 16, |
451 | efi.systab->hdr.revision & 0xffff); | 452 | efi.systab->hdr.revision & 0xffff); |
@@ -463,42 +464,42 @@ static void __init efi_config_init(u64 tables, int nr_tables) | |||
463 | efi.systab->tables, | 464 | efi.systab->tables, |
464 | efi.systab->nr_tables * sizeof(efi_config_table_t)); | 465 | efi.systab->nr_tables * sizeof(efi_config_table_t)); |
465 | if (config_tables == NULL) | 466 | if (config_tables == NULL) |
466 | printk(KERN_ERR "Could not map EFI Configuration Table!\n"); | 467 | pr_err("Could not map Configuration table!\n"); |
467 | 468 | ||
468 | printk(KERN_INFO); | 469 | pr_info(""); |
469 | for (i = 0; i < efi.systab->nr_tables; i++) { | 470 | for (i = 0; i < efi.systab->nr_tables; i++) { |
470 | if (!efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID)) { | 471 | if (!efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID)) { |
471 | efi.mps = config_tables[i].table; | 472 | efi.mps = config_tables[i].table; |
472 | printk(" MPS=0x%lx ", config_tables[i].table); | 473 | pr_cont(" MPS=0x%lx ", config_tables[i].table); |
473 | } else if (!efi_guidcmp(config_tables[i].guid, | 474 | } else if (!efi_guidcmp(config_tables[i].guid, |
474 | ACPI_20_TABLE_GUID)) { | 475 | ACPI_20_TABLE_GUID)) { |
475 | efi.acpi20 = config_tables[i].table; | 476 | efi.acpi20 = config_tables[i].table; |
476 | printk(" ACPI 2.0=0x%lx ", config_tables[i].table); | 477 | pr_cont(" ACPI 2.0=0x%lx ", config_tables[i].table); |
477 | } else if (!efi_guidcmp(config_tables[i].guid, | 478 | } else if (!efi_guidcmp(config_tables[i].guid, |
478 | ACPI_TABLE_GUID)) { | 479 | ACPI_TABLE_GUID)) { |
479 | efi.acpi = config_tables[i].table; | 480 | efi.acpi = config_tables[i].table; |
480 | printk(" ACPI=0x%lx ", config_tables[i].table); | 481 | pr_cont(" ACPI=0x%lx ", config_tables[i].table); |
481 | } else if (!efi_guidcmp(config_tables[i].guid, | 482 | } else if (!efi_guidcmp(config_tables[i].guid, |
482 | SMBIOS_TABLE_GUID)) { | 483 | SMBIOS_TABLE_GUID)) { |
483 | efi.smbios = config_tables[i].table; | 484 | efi.smbios = config_tables[i].table; |
484 | printk(" SMBIOS=0x%lx ", config_tables[i].table); | 485 | pr_cont(" SMBIOS=0x%lx ", config_tables[i].table); |
485 | #ifdef CONFIG_X86_UV | 486 | #ifdef CONFIG_X86_UV |
486 | } else if (!efi_guidcmp(config_tables[i].guid, | 487 | } else if (!efi_guidcmp(config_tables[i].guid, |
487 | UV_SYSTEM_TABLE_GUID)) { | 488 | UV_SYSTEM_TABLE_GUID)) { |
488 | efi.uv_systab = config_tables[i].table; | 489 | efi.uv_systab = config_tables[i].table; |
489 | printk(" UVsystab=0x%lx ", config_tables[i].table); | 490 | pr_cont(" UVsystab=0x%lx ", config_tables[i].table); |
490 | #endif | 491 | #endif |
491 | } else if (!efi_guidcmp(config_tables[i].guid, | 492 | } else if (!efi_guidcmp(config_tables[i].guid, |
492 | HCDP_TABLE_GUID)) { | 493 | HCDP_TABLE_GUID)) { |
493 | efi.hcdp = config_tables[i].table; | 494 | efi.hcdp = config_tables[i].table; |
494 | printk(" HCDP=0x%lx ", config_tables[i].table); | 495 | pr_cont(" HCDP=0x%lx ", config_tables[i].table); |
495 | } else if (!efi_guidcmp(config_tables[i].guid, | 496 | } else if (!efi_guidcmp(config_tables[i].guid, |
496 | UGA_IO_PROTOCOL_GUID)) { | 497 | UGA_IO_PROTOCOL_GUID)) { |
497 | efi.uga = config_tables[i].table; | 498 | efi.uga = config_tables[i].table; |
498 | printk(" UGA=0x%lx ", config_tables[i].table); | 499 | pr_cont(" UGA=0x%lx ", config_tables[i].table); |
499 | } | 500 | } |
500 | } | 501 | } |
501 | printk("\n"); | 502 | pr_cont("\n"); |
502 | early_iounmap(config_tables, | 503 | early_iounmap(config_tables, |
503 | efi.systab->nr_tables * sizeof(efi_config_table_t)); | 504 | efi.systab->nr_tables * sizeof(efi_config_table_t)); |
504 | } | 505 | } |
@@ -531,8 +532,7 @@ static void __init efi_runtime_init(void) | |||
531 | */ | 532 | */ |
532 | efi.get_time = phys_efi_get_time; | 533 | efi.get_time = phys_efi_get_time; |
533 | } else | 534 | } else |
534 | printk(KERN_ERR "Could not map the EFI runtime service " | 535 | pr_err("Could not map the runtime service table!\n"); |
535 | "table!\n"); | ||
536 | early_iounmap(runtime, sizeof(efi_runtime_services_t)); | 536 | early_iounmap(runtime, sizeof(efi_runtime_services_t)); |
537 | } | 537 | } |
538 | 538 | ||
@@ -542,7 +542,7 @@ static void __init efi_memmap_init(void) | |||
542 | memmap.map = early_ioremap((unsigned long)memmap.phys_map, | 542 | memmap.map = early_ioremap((unsigned long)memmap.phys_map, |
543 | memmap.nr_map * memmap.desc_size); | 543 | memmap.nr_map * memmap.desc_size); |
544 | if (memmap.map == NULL) | 544 | if (memmap.map == NULL) |
545 | printk(KERN_ERR "Could not map the EFI memory map!\n"); | 545 | pr_err("Could not map the memory map!\n"); |
546 | memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size); | 546 | memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size); |
547 | 547 | ||
548 | if (add_efi_memmap) | 548 | if (add_efi_memmap) |
@@ -575,12 +575,12 @@ void __init efi_init(void) | |||
575 | vendor[i] = *c16++; | 575 | vendor[i] = *c16++; |
576 | vendor[i] = '\0'; | 576 | vendor[i] = '\0'; |
577 | } else | 577 | } else |
578 | printk(KERN_ERR PFX "Could not map the firmware vendor!\n"); | 578 | pr_err("Could not map the firmware vendor!\n"); |
579 | early_iounmap(tmp, 2); | 579 | early_iounmap(tmp, 2); |
580 | 580 | ||
581 | printk(KERN_INFO "EFI v%u.%.02u by %s\n", | 581 | pr_info("EFI v%u.%.02u by %s\n", |
582 | efi.systab->hdr.revision >> 16, | 582 | efi.systab->hdr.revision >> 16, |
583 | efi.systab->hdr.revision & 0xffff, vendor); | 583 | efi.systab->hdr.revision & 0xffff, vendor); |
584 | 584 | ||
585 | efi_config_init(efi.systab->tables, efi.systab->nr_tables); | 585 | efi_config_init(efi.systab->tables, efi.systab->nr_tables); |
586 | 586 | ||
@@ -696,7 +696,7 @@ void __init efi_enter_virtual_mode(void) | |||
696 | md->virt_addr = (u64) (unsigned long) va; | 696 | md->virt_addr = (u64) (unsigned long) va; |
697 | 697 | ||
698 | if (!va) { | 698 | if (!va) { |
699 | printk(KERN_ERR PFX "ioremap of 0x%llX failed!\n", | 699 | pr_err("ioremap of 0x%llX failed!\n", |
700 | (unsigned long long)md->phys_addr); | 700 | (unsigned long long)md->phys_addr); |
701 | continue; | 701 | continue; |
702 | } | 702 | } |
@@ -730,8 +730,8 @@ void __init efi_enter_virtual_mode(void) | |||
730 | (efi_memory_desc_t *)__pa(new_memmap)); | 730 | (efi_memory_desc_t *)__pa(new_memmap)); |
731 | 731 | ||
732 | if (status != EFI_SUCCESS) { | 732 | if (status != EFI_SUCCESS) { |
733 | printk(KERN_ALERT "Unable to switch EFI into virtual mode " | 733 | pr_alert("Unable to switch EFI into virtual mode " |
734 | "(status=%lx)!\n", status); | 734 | "(status=%lx)!\n", status); |
735 | panic("EFI call to SetVirtualAddressMap() failed!"); | 735 | panic("EFI call to SetVirtualAddressMap() failed!"); |
736 | } | 736 | } |
737 | 737 | ||