summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-08-18 06:58:42 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2019-08-26 21:11:31 +0000
commit101ef0b528461a3fb662db150b16607430a2bd94 (patch)
treeaa1ab0d8cba232e03d3f468728e8edc03e8e9c8c
parentcd7a70f4879ff6e0f3e334ddf1031ccf0c0d31cf (diff)
downloadcoreboot-101ef0b528461a3fb662db150b16607430a2bd94.tar.gz
coreboot-101ef0b528461a3fb662db150b16607430a2bd94.tar.bz2
coreboot-101ef0b528461a3fb662db150b16607430a2bd94.zip
lib/bootblock: Add simplified entry with basetime
This allows for minor optimization as num_timestamps becomes a constant zero for a function with local scope. The loop with calls to timestamp_add() gets removed from bootblock. Change-Id: Id230075c0e76fe377b6ea8c8ddf8318e07d29b91 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/34972 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r--src/cpu/intel/car/bootblock.c2
-rw-r--r--src/cpu/qemu-x86/bootblock.c2
-rw-r--r--src/include/bootblock_common.h11
-rw-r--r--src/lib/bootblock.c15
-rw-r--r--src/soc/amd/stoneyridge/bootblock/bootblock.c2
-rw-r--r--src/soc/intel/apollolake/bootblock/bootblock.c2
-rw-r--r--src/soc/intel/braswell/bootblock/bootblock.c2
-rw-r--r--src/soc/intel/cannonlake/bootblock/bootblock.c2
-rw-r--r--src/soc/intel/denverton_ns/bootblock/bootblock.c2
-rw-r--r--src/soc/intel/icelake/bootblock/bootblock.c2
-rw-r--r--src/soc/intel/quark/bootblock/bootblock.c2
-rw-r--r--src/soc/intel/skylake/bootblock/bootblock.c2
12 files changed, 25 insertions, 21 deletions
diff --git a/src/cpu/intel/car/bootblock.c b/src/cpu/intel/car/bootblock.c
index d751d8627242..664c2b5074fd 100644
--- a/src/cpu/intel/car/bootblock.c
+++ b/src/cpu/intel/car/bootblock.c
@@ -21,7 +21,7 @@ asmlinkage void bootblock_c_entry_bist(uint64_t base_timestamp, uint32_t bist)
{
saved_bist = bist;
/* Call lib/bootblock.c main */
- bootblock_main_with_timestamp(base_timestamp, NULL, 0);
+ bootblock_main_with_basetime(base_timestamp);
}
void __weak bootblock_early_northbridge_init(void) { }
diff --git a/src/cpu/qemu-x86/bootblock.c b/src/cpu/qemu-x86/bootblock.c
index 8dcf57699019..6459beb5d7c0 100644
--- a/src/cpu/qemu-x86/bootblock.c
+++ b/src/cpu/qemu-x86/bootblock.c
@@ -29,5 +29,5 @@ asmlinkage void bootblock_c_entry_bist(uint64_t base_timestamp, uint32_t bist)
}
/* Call lib/bootblock.c main */
- bootblock_main_with_timestamp(base_timestamp, NULL, 0);
+ bootblock_main_with_basetime(base_timestamp);
}
diff --git a/src/include/bootblock_common.h b/src/include/bootblock_common.h
index 08b2b7ad6dde..1081f2745311 100644
--- a/src/include/bootblock_common.h
+++ b/src/include/bootblock_common.h
@@ -38,16 +38,7 @@ void bootblock_soc_init(void);
asmlinkage void bootblock_c_entry(uint64_t base_timestamp);
asmlinkage void bootblock_c_entry_bist(uint64_t base_timestamp, uint32_t bist);
-/*
- * This is a the same as the bootblock main(), with the difference that it does
- * not collect a timestamp. Instead it accepts the initial timestamp and
- * possibly additional timestamp entries as arguments. This can be used in cases
- * where earlier stamps are available. Note that this function is designed to be
- * entered from C code. This function assumes that the timer has already been
- * initialized, so it does not call init_timer().
- */
-asmlinkage void bootblock_main_with_timestamp(uint64_t base_timestamp,
- struct timestamp_entry *timestamps, size_t num_timestamps);
+void bootblock_main_with_basetime(uint64_t base_timestamp);
/* This is the argument structure passed from decompressor to bootblock. */
struct bootblock_arg {
diff --git a/src/lib/bootblock.c b/src/lib/bootblock.c
index 3925e90afeef..19841c6931f1 100644
--- a/src/lib/bootblock.c
+++ b/src/lib/bootblock.c
@@ -30,7 +30,15 @@ __weak void bootblock_soc_early_init(void) { /* do nothing */ }
__weak void bootblock_soc_init(void) { /* do nothing */ }
__weak void bootblock_mainboard_init(void) { /* do nothing */ }
-asmlinkage void bootblock_main_with_timestamp(uint64_t base_timestamp,
+/*
+ * This is a the same as the bootblock main(), with the difference that it does
+ * not collect a timestamp. Instead it accepts the initial timestamp and
+ * possibly additional timestamp entries as arguments. This can be used in cases
+ * where earlier stamps are available. Note that this function is designed to be
+ * entered from C code. This function assumes that the timer has already been
+ * initialized, so it does not call init_timer().
+ */
+static void bootblock_main_with_timestamp(uint64_t base_timestamp,
struct timestamp_entry *timestamps, size_t num_timestamps)
{
/* Initialize timestamps if we have TIMESTAMP region in memlayout.ld. */
@@ -60,6 +68,11 @@ asmlinkage void bootblock_main_with_timestamp(uint64_t base_timestamp,
run_romstage();
}
+void bootblock_main_with_basetime(uint64_t base_timestamp)
+{
+ bootblock_main_with_timestamp(base_timestamp, NULL, 0);
+}
+
void main(void)
{
uint64_t base_timestamp = 0;
diff --git a/src/soc/amd/stoneyridge/bootblock/bootblock.c b/src/soc/amd/stoneyridge/bootblock/bootblock.c
index 9239030d6c73..a079ec2561dd 100644
--- a/src/soc/amd/stoneyridge/bootblock/bootblock.c
+++ b/src/soc/amd/stoneyridge/bootblock/bootblock.c
@@ -88,7 +88,7 @@ asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
}
/* TSC cannot be relied upon. Override the TSC value passed in. */
- bootblock_main_with_timestamp(timestamp_get(), NULL, 0);
+ bootblock_main_with_basetime(timestamp_get());
}
void bootblock_soc_early_init(void)
diff --git a/src/soc/intel/apollolake/bootblock/bootblock.c b/src/soc/intel/apollolake/bootblock/bootblock.c
index f86c18ed432c..a07c4620af53 100644
--- a/src/soc/intel/apollolake/bootblock/bootblock.c
+++ b/src/soc/intel/apollolake/bootblock/bootblock.c
@@ -69,7 +69,7 @@ asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
enable_rtc_upper_bank();
/* Call lib/bootblock.c main */
- bootblock_main_with_timestamp(base_timestamp, NULL, 0);
+ bootblock_main_with_basetime(base_timestamp);
}
static void enable_pmcbar(void)
diff --git a/src/soc/intel/braswell/bootblock/bootblock.c b/src/soc/intel/braswell/bootblock/bootblock.c
index 2d1a3e8687d9..d8d953c8a72e 100644
--- a/src/soc/intel/braswell/bootblock/bootblock.c
+++ b/src/soc/intel/braswell/bootblock/bootblock.c
@@ -31,7 +31,7 @@
asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
{
/* Call lib/bootblock.c main */
- bootblock_main_with_timestamp(base_timestamp, NULL, 0);
+ bootblock_main_with_basetime(base_timestamp);
}
static void program_base_addresses(void)
diff --git a/src/soc/intel/cannonlake/bootblock/bootblock.c b/src/soc/intel/cannonlake/bootblock/bootblock.c
index 30c2266096db..653ba30563ae 100644
--- a/src/soc/intel/cannonlake/bootblock/bootblock.c
+++ b/src/soc/intel/cannonlake/bootblock/bootblock.c
@@ -44,7 +44,7 @@ const FSPT_UPD temp_ram_init_params = {
asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
{
/* Call lib/bootblock.c main */
- bootblock_main_with_timestamp(base_timestamp, NULL, 0);
+ bootblock_main_with_basetime(base_timestamp);
}
void bootblock_soc_early_init(void)
diff --git a/src/soc/intel/denverton_ns/bootblock/bootblock.c b/src/soc/intel/denverton_ns/bootblock/bootblock.c
index e9800c8ae5ce..f75de1f2d0e6 100644
--- a/src/soc/intel/denverton_ns/bootblock/bootblock.c
+++ b/src/soc/intel/denverton_ns/bootblock/bootblock.c
@@ -51,7 +51,7 @@ const FSPT_UPD temp_ram_init_params = {
asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
{
/* Call lib/bootblock.c main */
- bootblock_main_with_timestamp(base_timestamp, NULL, 0);
+ bootblock_main_with_basetime(base_timestamp);
};
void bootblock_soc_early_init(void)
diff --git a/src/soc/intel/icelake/bootblock/bootblock.c b/src/soc/intel/icelake/bootblock/bootblock.c
index b76dc4ba37f3..db43e50ec802 100644
--- a/src/soc/intel/icelake/bootblock/bootblock.c
+++ b/src/soc/intel/icelake/bootblock/bootblock.c
@@ -23,7 +23,7 @@
asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
{
/* Call lib/bootblock.c main */
- bootblock_main_with_timestamp(base_timestamp, NULL, 0);
+ bootblock_main_with_basetime(base_timestamp);
}
void bootblock_soc_early_init(void)
diff --git a/src/soc/intel/quark/bootblock/bootblock.c b/src/soc/intel/quark/bootblock/bootblock.c
index ff5b9b2a52eb..2b2fc29f59fa 100644
--- a/src/soc/intel/quark/bootblock/bootblock.c
+++ b/src/soc/intel/quark/bootblock/bootblock.c
@@ -82,7 +82,7 @@ asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
if (CONFIG(ENABLE_DEBUG_LED_BOOTBLOCK_ENTRY))
light_sd_led();
- bootblock_main_with_timestamp(base_timestamp, NULL, 0);
+ bootblock_main_with_basetime(base_timestamp);
}
void bootblock_soc_early_init(void)
diff --git a/src/soc/intel/skylake/bootblock/bootblock.c b/src/soc/intel/skylake/bootblock/bootblock.c
index 4358fba40f38..e9ca2d8af21f 100644
--- a/src/soc/intel/skylake/bootblock/bootblock.c
+++ b/src/soc/intel/skylake/bootblock/bootblock.c
@@ -22,7 +22,7 @@
asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
{
/* Call lib/bootblock.c main */
- bootblock_main_with_timestamp(base_timestamp, NULL, 0);
+ bootblock_main_with_basetime(base_timestamp);
}
void bootblock_soc_early_init(void)