diff options
| -rw-r--r-- | drivers/firmware/iscsi_ibft_find.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/firmware/iscsi_ibft_find.c b/drivers/firmware/iscsi_ibft_find.c index dd85555d3296..82a7a1566290 100644 --- a/drivers/firmware/iscsi_ibft_find.c +++ b/drivers/firmware/iscsi_ibft_find.c | |||
| @@ -57,23 +57,12 @@ static int __init acpi_find_ibft(struct acpi_table_header *header) | |||
| 57 | } | 57 | } |
| 58 | #endif /* CONFIG_ACPI */ | 58 | #endif /* CONFIG_ACPI */ |
| 59 | 59 | ||
| 60 | /* | 60 | static int __init find_ibft_in_mem(void) |
| 61 | * Routine used to find the iSCSI Boot Format Table. The logical | ||
| 62 | * kernel address is set in the ibft_addr global variable. | ||
| 63 | */ | ||
| 64 | unsigned long __init find_ibft_region(unsigned long *sizep) | ||
| 65 | { | 61 | { |
| 66 | unsigned long pos; | 62 | unsigned long pos; |
| 67 | unsigned int len = 0; | 63 | unsigned int len = 0; |
| 68 | void *virt; | 64 | void *virt; |
| 69 | 65 | ||
| 70 | ibft_addr = NULL; | ||
| 71 | |||
| 72 | /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will | ||
| 73 | * only use ACPI for this */ | ||
| 74 | if (efi_enabled) | ||
| 75 | return 0; | ||
| 76 | |||
| 77 | for (pos = IBFT_START; pos < IBFT_END; pos += 16) { | 66 | for (pos = IBFT_START; pos < IBFT_END; pos += 16) { |
| 78 | /* The table can't be inside the VGA BIOS reserved space, | 67 | /* The table can't be inside the VGA BIOS reserved space, |
| 79 | * so skip that area */ | 68 | * so skip that area */ |
| @@ -92,6 +81,17 @@ unsigned long __init find_ibft_region(unsigned long *sizep) | |||
| 92 | } | 81 | } |
| 93 | } | 82 | } |
| 94 | } | 83 | } |
| 84 | return len; | ||
| 85 | } | ||
| 86 | /* | ||
| 87 | * Routine used to find the iSCSI Boot Format Table. The logical | ||
| 88 | * kernel address is set in the ibft_addr global variable. | ||
| 89 | */ | ||
| 90 | unsigned long __init find_ibft_region(unsigned long *sizep) | ||
| 91 | { | ||
| 92 | |||
| 93 | ibft_addr = NULL; | ||
| 94 | |||
| 95 | #ifdef CONFIG_ACPI | 95 | #ifdef CONFIG_ACPI |
| 96 | /* | 96 | /* |
| 97 | * One spec says "IBFT", the other says "iBFT". We have to check | 97 | * One spec says "IBFT", the other says "iBFT". We have to check |
| @@ -102,6 +102,13 @@ unsigned long __init find_ibft_region(unsigned long *sizep) | |||
| 102 | if (!ibft_addr) | 102 | if (!ibft_addr) |
| 103 | acpi_table_parse("iBFT", acpi_find_ibft); | 103 | acpi_table_parse("iBFT", acpi_find_ibft); |
| 104 | #endif /* CONFIG_ACPI */ | 104 | #endif /* CONFIG_ACPI */ |
| 105 | |||
| 106 | /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will | ||
| 107 | * only use ACPI for this */ | ||
| 108 | |||
| 109 | if (!ibft_addr && !efi_enabled) | ||
| 110 | find_ibft_in_mem(); | ||
| 111 | |||
| 105 | if (ibft_addr) { | 112 | if (ibft_addr) { |
| 106 | *sizep = PAGE_ALIGN(ibft_addr->header.length); | 113 | *sizep = PAGE_ALIGN(ibft_addr->header.length); |
| 107 | return (u64)isa_virt_to_bus(ibft_addr); | 114 | return (u64)isa_virt_to_bus(ibft_addr); |
