Bill XIE has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39103 )
Change subject: security/vboot: relocate and rename vboot_platform_is_resuming() ......................................................................
security/vboot: relocate and rename vboot_platform_is_resuming()
After measured boot is decoupled from verified boot in CB:35077, vboot_platform_is_resuming() is never vboot-specific, thus it is renamed to platform_is_resuming() and declared in bootmode.h.
Change-Id: I29b5b88af0576c34c10cfbd99659a5cdc0c75842 Signed-off-by: Bill XIE persmule@hardenedlinux.org --- M src/include/bootmode.h M src/lib/cbfs.c M src/security/tpm/tspi/crtm.c M src/security/tpm/tspi/crtm.h M src/security/vboot/vboot_common.h M src/security/vboot/vboot_logic.c M src/soc/amd/common/block/acpi/acpi.c M src/soc/intel/baytrail/pmutil.c M src/soc/intel/braswell/pmutil.c M src/soc/intel/broadwell/pmutil.c M src/soc/intel/common/block/pmc/pmclib.c M src/southbridge/intel/common/pmbase.c M src/vendorcode/eltan/security/verified_boot/vboot_check.c 13 files changed, 37 insertions(+), 42 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/39103/1
diff --git a/src/include/bootmode.h b/src/include/bootmode.h index 3ae8746..9391296 100644 --- a/src/include/bootmode.h +++ b/src/include/bootmode.h @@ -30,4 +30,10 @@ int gfx_get_init_done(void); void gfx_set_init_done(int done);
+/* + * Determine if the platform is resuming from suspend. Returns 0 when + * not resuming, > 0 if resuming, and < 0 on error. + */ +int platform_is_resuming(void); + #endif /* __BOOTMODE_H__ */ diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index a375cba..49b4fb2 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -57,10 +57,7 @@ * Files can be added to the RO_REGION_ONLY config option to use this feature. */ printk(BIOS_DEBUG, "Fall back to RO region for %s\n", name); - if (fmap_locate_area_as_rdev("COREBOOT", &rdev)) - ERROR("RO region not found\n"); - else - ret = cbfs_locate(fh, &rdev, name, type); + ret = cbfs_locate_file_in_region(fh, "COREBOOT", name, type); }
if (!ret) @@ -90,18 +87,14 @@ const char *name, uint32_t *type) { struct region_device rdev; - int ret = 0; + if (fmap_locate_area_as_rdev(region_name, &rdev)) { LOG("%s region not found while looking for %s\n", region_name, name); return -1; }
- ret = cbfs_locate(fh, &rdev, name, type); - if (!ret) - if (tspi_measure_cbfs_hook(fh, name)) - return -1; - return ret; + return cbfs_locate(fh, &rdev, name, type); }
size_t cbfs_load_and_decompress(const struct region_device *rdev, size_t offset, diff --git a/src/security/tpm/tspi/crtm.c b/src/security/tpm/tspi/crtm.c index d404f12..2a2dbec 100644 --- a/src/security/tpm/tspi/crtm.c +++ b/src/security/tpm/tspi/crtm.c @@ -200,14 +200,10 @@ cbfs_file_data(&rdev, fh);
switch (cbfs_type) { + case CBFS_TYPE_MRC: case CBFS_TYPE_MRC_CACHE: pcr_index = TPM_RUNTIME_DATA_PCR; break; - /* - * mrc.bin is code executed on CPU, so it - * should not be considered runtime data - */ - case CBFS_TYPE_MRC: case CBFS_TYPE_STAGE: case CBFS_TYPE_SELF: case CBFS_TYPE_FIT: @@ -232,7 +228,7 @@ if ((!CONFIG(TPM_CRTM_INIT_OUTSIDE_BOOTBLOCK) && ENV_BOOTBLOCK) || (CONFIG(TPM_CRTM_INIT_OUTSIDE_BOOTBLOCK) && ENV_ROMSTAGE)) { timestamp_add_now(TS_START_TPMINIT); - int result = tpm_setup(vboot_platform_is_resuming()); + int result = tpm_setup(platform_is_resuming()); timestamp_add_now(TS_END_TPMINIT);
if (result == TPM_SUCCESS) { diff --git a/src/security/tpm/tspi/crtm.h b/src/security/tpm/tspi/crtm.h index a71443d..aaa01f9 100644 --- a/src/security/tpm/tspi/crtm.h +++ b/src/security/tpm/tspi/crtm.h @@ -46,7 +46,7 @@ */ uint32_t tspi_init_crtm(void);
-#if !ENV_SMM && CONFIG(TPM_MEASURED_BOOT) +#if CONFIG(TPM_MEASURED_BOOT) /* * Measures cbfs data via hook (cbfs) * fh is the cbfs file handle to measure diff --git a/src/security/vboot/vboot_common.h b/src/security/vboot/vboot_common.h index 57f3475..f3884b4 100644 --- a/src/security/vboot/vboot_common.h +++ b/src/security/vboot/vboot_common.h @@ -49,12 +49,6 @@ */ int vboot_retrieve_hash(void *digest, size_t digest_size);
-/* - * Determine if the platform is resuming from suspend. Returns 0 when - * not resuming, > 0 if resuming, and < 0 on error. - */ -int vboot_platform_is_resuming(void); - /* ============================= VERSTAGE ================================== */ /* * Main logic for verified boot. verstage_main() is just the core vboot logic. diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c index 66929ac..6b1de93 100644 --- a/src/security/vboot/vboot_logic.c +++ b/src/security/vboot/vboot_logic.c @@ -114,7 +114,7 @@ if (!CONFIG(VBOOT_STARTS_IN_BOOTBLOCK)) return 0;
- is_resume = vboot_platform_is_resuming(); + is_resume = platform_is_resuming();
if (is_resume > 0) { uint8_t saved_hash[VBOOT_MAX_HASH_SIZE]; @@ -273,7 +273,7 @@ * does verification of memory init and thus must ensure it resumes with * the same slot that it booted from. */ if (CONFIG(RESUME_PATH_SAME_AS_BOOT) && - vboot_platform_is_resuming()) + platform_is_resuming()) ctx->flags |= VB2_CONTEXT_S3_RESUME;
/* Read secdata from TPM. Initialize TPM if secdata not found. We don't diff --git a/src/soc/amd/common/block/acpi/acpi.c b/src/soc/amd/common/block/acpi/acpi.c index e18933b..84970b9 100644 --- a/src/soc/amd/common/block/acpi/acpi.c +++ b/src/soc/amd/common/block/acpi/acpi.c @@ -13,15 +13,18 @@ * GNU General Public License for more details. */
-#include <arch/acpi.h> -#include <cbmem.h> -#include <elog.h> -#include <console/console.h> -#include <soc/southbridge.h> #include <amdblocks/acpimmio.h> #include <amdblocks/acpi.h> +#include <arch/acpi.h> +#include <bootmode.h> +#include <cbmem.h> +#include <console/console.h> +#include <elog.h> #include <halt.h> #include <security/vboot/vboot_common.h> +#include <soc/southbridge.h> + +#include <halt.h>
void poweroff(void) { @@ -137,7 +140,7 @@ return acpi_sleep_from_pm1(acpi_read16(MMIO_ACPI_PM1_CNT_BLK)); }
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { if (!(acpi_read16(MMIO_ACPI_PM1_STS) & WAK_STS)) return 0; diff --git a/src/soc/intel/baytrail/pmutil.c b/src/soc/intel/baytrail/pmutil.c index 51174fc..5fed72a 100644 --- a/src/soc/intel/baytrail/pmutil.c +++ b/src/soc/intel/baytrail/pmutil.c @@ -16,6 +16,7 @@ #include <stdint.h> #include <arch/acpi.h> #include <arch/io.h> +#include <bootmode.h> #include <device/device.h> #include <device/mmio.h> #include <device/pci.h> @@ -28,7 +29,6 @@ #include <soc/pci_devs.h> #include <soc/pmc.h> #include <security/vboot/vbnv.h> -#include <security/vboot/vboot_common.h>
#if defined(__SIMPLE_DEVICE__)
@@ -388,7 +388,7 @@ return rtc_failure(); }
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { if (!(inw(ACPI_BASE_ADDRESS + PM1_STS) & WAK_STS)) return 0; diff --git a/src/soc/intel/braswell/pmutil.c b/src/soc/intel/braswell/pmutil.c index 18cb04d..cb63d67 100644 --- a/src/soc/intel/braswell/pmutil.c +++ b/src/soc/intel/braswell/pmutil.c @@ -17,6 +17,7 @@ #include <arch/acpi.h> #include <arch/io.h> #include <assert.h> +#include <bootmode.h> #include <device/device.h> #include <device/mmio.h> #include <device/pci.h> @@ -28,7 +29,6 @@ #include <soc/pm.h> #include <stdint.h> #include <security/vboot/vbnv.h> -#include <security/vboot/vboot_common.h>
#if defined(__SIMPLE_DEVICE__)
@@ -383,7 +383,7 @@ return rtc_failure(); }
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { if (!(inw(ACPI_BASE_ADDRESS + PM1_STS) & WAK_STS)) return 0; diff --git a/src/soc/intel/broadwell/pmutil.c b/src/soc/intel/broadwell/pmutil.c index 2445dfa..826ee8c 100644 --- a/src/soc/intel/broadwell/pmutil.c +++ b/src/soc/intel/broadwell/pmutil.c @@ -20,6 +20,7 @@
#include <arch/acpi.h> #include <arch/io.h> +#include <bootmode.h> #include <device/pci_ops.h> #include <device/device.h> #include <device/pci.h> @@ -31,7 +32,6 @@ #include <soc/pm.h> #include <soc/gpio.h> #include <security/vboot/vbnv.h> -#include <security/vboot/vboot_common.h>
/* Print status bits with descriptive names */ static void print_status_bits(u32 status, const char *bit_names[]) @@ -451,7 +451,7 @@ return sci_irq; }
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { if (!(inw(ACPI_BASE_ADDRESS + PM1_STS) & WAK_STS)) return 0; diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c index d022666..7f09384 100644 --- a/src/soc/intel/common/block/pmc/pmclib.c +++ b/src/soc/intel/common/block/pmc/pmclib.c @@ -14,6 +14,7 @@ */
#include <arch/io.h> +#include <bootmode.h> #include <device/mmio.h> #include <cbmem.h> #include <console/console.h> @@ -22,11 +23,12 @@ #include <intelblocks/gpio.h> #include <intelblocks/tco.h> #include <option.h> +#include <pc80/mc146818rtc.h> +#include <security/vboot/vboot_common.h> #include <soc/pm.h> #include <stdint.h> #include <string.h> #include <timer.h> -#include <security/vboot/vboot_common.h>
static struct chipset_power_state power_state;
@@ -441,7 +443,7 @@ } #endif // CONFIG_PMC_GLOBAL_RESET_ENABLE_LOCK
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { if (!(inw(ACPI_BASE_ADDRESS + PM1_STS) & WAK_STS)) return 0; diff --git a/src/southbridge/intel/common/pmbase.c b/src/southbridge/intel/common/pmbase.c index ff0410a..a7d0476 100644 --- a/src/southbridge/intel/common/pmbase.c +++ b/src/southbridge/intel/common/pmbase.c @@ -16,11 +16,11 @@ #include <stdint.h> #include <arch/acpi.h> #include <arch/io.h> +#include <bootmode.h> #include <device/pci_ops.h> #include <device/device.h> #include <device/pci.h> #include <assert.h> -#include <security/vboot/vboot_common.h>
#include "pmbase.h" #include "pmutil.h" @@ -95,7 +95,7 @@ return inb(lpc_get_pmbase() + addr); }
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { u16 reg16 = read_pmbase16(PM1_STS);
diff --git a/src/vendorcode/eltan/security/verified_boot/vboot_check.c b/src/vendorcode/eltan/security/verified_boot/vboot_check.c index 9d99e02..e0a247c 100644 --- a/src/vendorcode/eltan/security/verified_boot/vboot_check.c +++ b/src/vendorcode/eltan/security/verified_boot/vboot_check.c @@ -16,6 +16,7 @@
#include <boot_device.h> #include <bootmem.h> +#include <bootmode.h> #include <cbfs.h> #include <vboot_check.h> #include <vboot_common.h> @@ -292,7 +293,7 @@
if (CONFIG(VENDORCODE_ELTAN_MBOOT)) { printk(BIOS_DEBUG, "mb_measure returned 0x%x\n", - mb_measure(vboot_platform_is_resuming())); + mb_measure(platform_is_resuming())); }
printk(BIOS_SPEW, "%s: process early verify list\n", __func__);
Philipp Deppenwiese has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39103 )
Change subject: security/vboot: relocate and rename vboot_platform_is_resuming() ......................................................................
Patch Set 1:
patch reverts changes made previously. See cbfs.c
Hello Patrick Rudolph, Aaron Durbin, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39103
to look at the new patch set (#2).
Change subject: security/vboot: relocate and rename vboot_platform_is_resuming() ......................................................................
security/vboot: relocate and rename vboot_platform_is_resuming()
After measured boot is decoupled from verified boot in CB:35077, vboot_platform_is_resuming() is never vboot-specific, thus it is renamed to platform_is_resuming() and declared in bootmode.h.
Change-Id: I29b5b88af0576c34c10cfbd99659a5cdc0c75842 Signed-off-by: Bill XIE persmule@hardenedlinux.org --- M src/include/bootmode.h M src/security/tpm/tspi/crtm.c M src/security/vboot/vboot_common.h M src/security/vboot/vboot_logic.c M src/soc/amd/common/block/acpi/acpi.c M src/soc/intel/baytrail/pmutil.c M src/soc/intel/braswell/pmutil.c M src/soc/intel/broadwell/pmutil.c M src/soc/intel/common/block/pmc/pmclib.c M src/southbridge/intel/common/pmbase.c M src/vendorcode/eltan/security/verified_boot/vboot_check.c 11 files changed, 32 insertions(+), 26 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/39103/2
Bill XIE has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39103 )
Change subject: security/vboot: relocate and rename vboot_platform_is_resuming() ......................................................................
Patch Set 2:
Patch Set 1:
patch reverts changes made previously. See cbfs.c
Fixed as you pointed out.
Philipp Deppenwiese has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39103 )
Change subject: security/vboot: relocate and rename vboot_platform_is_resuming() ......................................................................
Patch Set 2: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/39103/2/src/soc/amd/common/block/ac... File src/soc/amd/common/block/acpi/acpi.c:
https://review.coreboot.org/c/coreboot/+/39103/2/src/soc/amd/common/block/ac... PS2, Line 26: remove newline
Hello Patrick Rudolph, Aaron Durbin, Philipp Deppenwiese, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39103
to look at the new patch set (#3).
Change subject: security/vboot: relocate and rename vboot_platform_is_resuming() ......................................................................
security/vboot: relocate and rename vboot_platform_is_resuming()
After measured boot is decoupled from verified boot in CB:35077, vboot_platform_is_resuming() is never vboot-specific, thus it is renamed to platform_is_resuming() and declared in bootmode.h.
Change-Id: I29b5b88af0576c34c10cfbd99659a5cdc0c75842 Signed-off-by: Bill XIE persmule@hardenedlinux.org --- M src/include/bootmode.h M src/security/tpm/tspi/crtm.c M src/security/vboot/vboot_common.h M src/security/vboot/vboot_logic.c M src/soc/amd/common/block/acpi/acpi.c M src/soc/intel/baytrail/pmutil.c M src/soc/intel/braswell/pmutil.c M src/soc/intel/broadwell/pmutil.c M src/soc/intel/common/block/pmc/pmclib.c M src/southbridge/intel/common/pmbase.c M src/vendorcode/eltan/security/verified_boot/vboot_check.c 11 files changed, 31 insertions(+), 26 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/39103/3
Bill XIE has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39103 )
Change subject: security/vboot: relocate and rename vboot_platform_is_resuming() ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39103/2/src/soc/amd/common/block/ac... File src/soc/amd/common/block/acpi/acpi.c:
https://review.coreboot.org/c/coreboot/+/39103/2/src/soc/amd/common/block/ac... PS2, Line 26:
remove newline
Done
Hello Philipp Deppenwiese, build bot (Jenkins), Patrick Rudolph, Aaron Durbin,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39103
to look at the new patch set (#4).
Change subject: security/vboot: relocate and rename vboot_platform_is_resuming() ......................................................................
security/vboot: relocate and rename vboot_platform_is_resuming()
After measured boot is decoupled from verified boot in CB:35077, vboot_platform_is_resuming() is never vboot-specific, thus it is renamed to platform_is_resuming() and declared in bootmode.h.
Change-Id: I29b5b88af0576c34c10cfbd99659a5cdc0c75842 Signed-off-by: Bill XIE persmule@hardenedlinux.org --- M src/include/bootmode.h M src/security/vboot/vboot_common.h M src/security/vboot/vboot_logic.c M src/soc/amd/common/block/acpi/acpi.c M src/soc/intel/baytrail/pmutil.c M src/soc/intel/braswell/pmutil.c M src/soc/intel/broadwell/pmutil.c M src/soc/intel/common/block/pmc/pmclib.c M src/southbridge/intel/common/pmbase.c M src/vendorcode/eltan/security/verified_boot/vboot_check.c 10 files changed, 30 insertions(+), 25 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/39103/4
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39103 )
Change subject: security/vboot: relocate and rename vboot_platform_is_resuming() ......................................................................
Patch Set 6: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/39103/6/src/security/vboot/vboot_lo... File src/security/vboot/vboot_logic.c:
https://review.coreboot.org/c/coreboot/+/39103/6/src/security/vboot/vboot_lo... PS6, Line 275: platform_is_resuming()) nit: does this fit on the same line now?
Philipp Deppenwiese has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39103 )
Change subject: security/vboot: relocate and rename vboot_platform_is_resuming() ......................................................................
security/vboot: relocate and rename vboot_platform_is_resuming()
After measured boot is decoupled from verified boot in CB:35077, vboot_platform_is_resuming() is never vboot-specific, thus it is renamed to platform_is_resuming() and declared in bootmode.h.
Change-Id: I29b5b88af0576c34c10cfbd99659a5cdc0c75842 Signed-off-by: Bill XIE persmule@hardenedlinux.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/39103 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org --- M src/include/bootmode.h M src/security/vboot/vboot_common.h M src/security/vboot/vboot_logic.c M src/soc/amd/common/block/acpi/acpi.c M src/soc/intel/baytrail/pmutil.c M src/soc/intel/braswell/pmutil.c M src/soc/intel/broadwell/pmutil.c M src/soc/intel/common/block/pmc/pmclib.c M src/southbridge/intel/common/pmbase.c M src/vendorcode/eltan/security/verified_boot/vboot_check.c 10 files changed, 30 insertions(+), 25 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/include/bootmode.h b/src/include/bootmode.h index 258eba1..89e2c2c 100644 --- a/src/include/bootmode.h +++ b/src/include/bootmode.h @@ -29,4 +29,10 @@ int gfx_get_init_done(void); void gfx_set_init_done(int done);
+/* + * Determine if the platform is resuming from suspend. Returns 0 when + * not resuming, > 0 if resuming, and < 0 on error. + */ +int platform_is_resuming(void); + #endif /* __BOOTMODE_H__ */ diff --git a/src/security/vboot/vboot_common.h b/src/security/vboot/vboot_common.h index e922128..d825b82 100644 --- a/src/security/vboot/vboot_common.h +++ b/src/security/vboot/vboot_common.h @@ -48,12 +48,6 @@ */ int vboot_retrieve_hash(void *digest, size_t digest_size);
-/* - * Determine if the platform is resuming from suspend. Returns 0 when - * not resuming, > 0 if resuming, and < 0 on error. - */ -int vboot_platform_is_resuming(void); - /* ============================= VERSTAGE ================================== */ /* * Main logic for verified boot. verstage_main() is just the core vboot logic. diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c index 80f7aaa..ab5b53d 100644 --- a/src/security/vboot/vboot_logic.c +++ b/src/security/vboot/vboot_logic.c @@ -113,7 +113,7 @@ if (!CONFIG(VBOOT_STARTS_IN_BOOTBLOCK)) return 0;
- is_resume = vboot_platform_is_resuming(); + is_resume = platform_is_resuming();
if (is_resume > 0) { uint8_t saved_hash[VBOOT_MAX_HASH_SIZE]; @@ -272,7 +272,7 @@ * does verification of memory init and thus must ensure it resumes with * the same slot that it booted from. */ if (CONFIG(RESUME_PATH_SAME_AS_BOOT) && - vboot_platform_is_resuming()) + platform_is_resuming()) ctx->flags |= VB2_CONTEXT_S3_RESUME;
/* Read secdata from TPM. Initialize TPM if secdata not found. We don't diff --git a/src/soc/amd/common/block/acpi/acpi.c b/src/soc/amd/common/block/acpi/acpi.c index 6f2f7c5..4d99f7b5 100644 --- a/src/soc/amd/common/block/acpi/acpi.c +++ b/src/soc/amd/common/block/acpi/acpi.c @@ -12,15 +12,17 @@ * GNU General Public License for more details. */
-#include <arch/acpi.h> -#include <cbmem.h> -#include <elog.h> -#include <console/console.h> -#include <soc/southbridge.h> #include <amdblocks/acpimmio.h> #include <amdblocks/acpi.h> +#include <arch/acpi.h> +#include <bootmode.h> +#include <cbmem.h> +#include <console/console.h> +#include <elog.h> #include <halt.h> #include <security/vboot/vboot_common.h> +#include <soc/southbridge.h> +#include <halt.h>
void poweroff(void) { @@ -136,7 +138,7 @@ return acpi_sleep_from_pm1(acpi_read16(MMIO_ACPI_PM1_CNT_BLK)); }
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { if (!(acpi_read16(MMIO_ACPI_PM1_STS) & WAK_STS)) return 0; diff --git a/src/soc/intel/baytrail/pmutil.c b/src/soc/intel/baytrail/pmutil.c index 9e032ce..f0abcee 100644 --- a/src/soc/intel/baytrail/pmutil.c +++ b/src/soc/intel/baytrail/pmutil.c @@ -15,6 +15,7 @@ #include <stdint.h> #include <arch/acpi.h> #include <arch/io.h> +#include <bootmode.h> #include <device/device.h> #include <device/mmio.h> #include <device/pci.h> @@ -27,7 +28,6 @@ #include <soc/pci_devs.h> #include <soc/pmc.h> #include <security/vboot/vbnv.h> -#include <security/vboot/vboot_common.h>
#if defined(__SIMPLE_DEVICE__)
@@ -387,7 +387,7 @@ return rtc_failure(); }
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { if (!(inw(ACPI_BASE_ADDRESS + PM1_STS) & WAK_STS)) return 0; diff --git a/src/soc/intel/braswell/pmutil.c b/src/soc/intel/braswell/pmutil.c index 9c5079f..016c45c 100644 --- a/src/soc/intel/braswell/pmutil.c +++ b/src/soc/intel/braswell/pmutil.c @@ -15,6 +15,7 @@ #include <arch/acpi.h> #include <arch/io.h> #include <assert.h> +#include <bootmode.h> #include <device/device.h> #include <device/mmio.h> #include <device/pci.h> @@ -26,7 +27,6 @@ #include <soc/pm.h> #include <stdint.h> #include <security/vboot/vbnv.h> -#include <security/vboot/vboot_common.h>
#if defined(__SIMPLE_DEVICE__)
@@ -380,7 +380,7 @@ return rtc_failure(); }
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { if (!(inw(ACPI_BASE_ADDRESS + PM1_STS) & WAK_STS)) return 0; diff --git a/src/soc/intel/broadwell/pmutil.c b/src/soc/intel/broadwell/pmutil.c index 172d8cd..b170ff2 100644 --- a/src/soc/intel/broadwell/pmutil.c +++ b/src/soc/intel/broadwell/pmutil.c @@ -19,6 +19,7 @@
#include <arch/acpi.h> #include <arch/io.h> +#include <bootmode.h> #include <device/pci_ops.h> #include <device/device.h> #include <device/pci.h> @@ -30,7 +31,6 @@ #include <soc/pm.h> #include <soc/gpio.h> #include <security/vboot/vbnv.h> -#include <security/vboot/vboot_common.h>
/* Print status bits with descriptive names */ static void print_status_bits(u32 status, const char *bit_names[]) @@ -450,7 +450,7 @@ return sci_irq; }
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { if (!(inw(ACPI_BASE_ADDRESS + PM1_STS) & WAK_STS)) return 0; diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c index d03348a..47a4ed9 100644 --- a/src/soc/intel/common/block/pmc/pmclib.c +++ b/src/soc/intel/common/block/pmc/pmclib.c @@ -13,6 +13,7 @@ */
#include <arch/io.h> +#include <bootmode.h> #include <device/mmio.h> #include <cbmem.h> #include <console/console.h> @@ -21,11 +22,12 @@ #include <intelblocks/gpio.h> #include <intelblocks/tco.h> #include <option.h> +#include <pc80/mc146818rtc.h> +#include <security/vboot/vboot_common.h> #include <soc/pm.h> #include <stdint.h> #include <string.h> #include <timer.h> -#include <security/vboot/vboot_common.h>
static struct chipset_power_state power_state;
@@ -440,7 +442,7 @@ } #endif // CONFIG_PMC_GLOBAL_RESET_ENABLE_LOCK
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { if (!(inw(ACPI_BASE_ADDRESS + PM1_STS) & WAK_STS)) return 0; diff --git a/src/southbridge/intel/common/pmbase.c b/src/southbridge/intel/common/pmbase.c index 5174ed7..2567b28 100644 --- a/src/southbridge/intel/common/pmbase.c +++ b/src/southbridge/intel/common/pmbase.c @@ -15,11 +15,11 @@ #include <stdint.h> #include <arch/acpi.h> #include <arch/io.h> +#include <bootmode.h> #include <device/pci_ops.h> #include <device/device.h> #include <device/pci.h> #include <assert.h> -#include <security/vboot/vboot_common.h>
#include "pmbase.h" #include "pmutil.h" @@ -94,7 +94,7 @@ return inb(lpc_get_pmbase() + addr); }
-int vboot_platform_is_resuming(void) +int platform_is_resuming(void) { u16 reg16 = read_pmbase16(PM1_STS);
diff --git a/src/vendorcode/eltan/security/verified_boot/vboot_check.c b/src/vendorcode/eltan/security/verified_boot/vboot_check.c index fd0d82b..63e4608 100644 --- a/src/vendorcode/eltan/security/verified_boot/vboot_check.c +++ b/src/vendorcode/eltan/security/verified_boot/vboot_check.c @@ -14,6 +14,7 @@
#include <boot_device.h> #include <bootmem.h> +#include <bootmode.h> #include <cbfs.h> #include <vboot_check.h> #include <vboot_common.h> @@ -290,7 +291,7 @@
if (CONFIG(VENDORCODE_ELTAN_MBOOT)) { printk(BIOS_DEBUG, "mb_measure returned 0x%x\n", - mb_measure(vboot_platform_is_resuming())); + mb_measure(platform_is_resuming())); }
printk(BIOS_SPEW, "%s: process early verify list\n", __func__);