diff options
author | Shunyong Yang <shunyong.yang@hxt-semitech.com> | 2018-12-18 01:02:45 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-01-14 05:42:18 -0500 |
commit | 98a455d91e7116ca417bc37da6aa2dd633206a6f (patch) | |
tree | a31baed8fda81f9b56652054a301e7dee2d5daf6 /drivers/acpi/tables.c | |
parent | 1c7fc5cbc33980acd13d668f1c8f0313d6ae9fd8 (diff) |
ACPI / tables: table override from built-in initrd
In some scenario, we need to build initrd with kernel in a single image.
This can simplify system deployment process by downloading the whole system
once, such as in IC verification.
This patch adds support to override ACPI tables from built-in initrd.
Signed-off-by: Shunyong Yang <shunyong.yang@hxt-semitech.com>
[ rjw: Minor cleanups ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/tables.c')
-rw-r--r-- | drivers/acpi/tables.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 48eabb6c2d4f..8fccbe49612a 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -473,14 +473,22 @@ static DECLARE_BITMAP(acpi_initrd_installed, NR_ACPI_INITRD_TABLES); | |||
473 | 473 | ||
474 | void __init acpi_table_upgrade(void) | 474 | void __init acpi_table_upgrade(void) |
475 | { | 475 | { |
476 | void *data = (void *)initrd_start; | 476 | void *data; |
477 | size_t size = initrd_end - initrd_start; | 477 | size_t size; |
478 | int sig, no, table_nr = 0, total_offset = 0; | 478 | int sig, no, table_nr = 0, total_offset = 0; |
479 | long offset = 0; | 479 | long offset = 0; |
480 | struct acpi_table_header *table; | 480 | struct acpi_table_header *table; |
481 | char cpio_path[32] = "kernel/firmware/acpi/"; | 481 | char cpio_path[32] = "kernel/firmware/acpi/"; |
482 | struct cpio_data file; | 482 | struct cpio_data file; |
483 | 483 | ||
484 | if (IS_ENABLED(CONFIG_ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD)) { | ||
485 | data = __initramfs_start; | ||
486 | size = __initramfs_size; | ||
487 | } else { | ||
488 | data = (void *)initrd_start; | ||
489 | size = initrd_end - initrd_start; | ||
490 | } | ||
491 | |||
484 | if (data == NULL || size == 0) | 492 | if (data == NULL || size == 0) |
485 | return; | 493 | return; |
486 | 494 | ||