Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37045 )
Change subject: drivers/pc80/pc/i8254.c: Drop CAR_GLOBAL_MIGRATION support ......................................................................
drivers/pc80/pc/i8254.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: Ibe9b353ce050b4718e07bccb958dbe3d2312e741 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/drivers/pc80/pc/i8254.c 1 file changed, 7 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/37045/1
diff --git a/src/drivers/pc80/pc/i8254.c b/src/drivers/pc80/pc/i8254.c index 5090f0c..9d23d46 100644 --- a/src/drivers/pc80/pc/i8254.c +++ b/src/drivers/pc80/pc/i8254.c @@ -11,7 +11,6 @@ * GNU General Public License for more details. */
-#include <arch/early_variables.h> #include <arch/io.h> #include <commonlib/helpers.h> #include <cpu/x86/tsc.h> @@ -107,23 +106,19 @@ }
#if CONFIG(UNKNOWN_TSC_RATE) -static u32 g_timer_tsc CAR_GLOBAL; +static u32 g_timer_tsc;
unsigned long tsc_freq_mhz(void) { - u32 tsc; + if (g_timer_tsc > 0) + return g_timer_tsc;
- tsc = car_get_var(g_timer_tsc); - if (tsc > 0) - return tsc; - - tsc = calibrate_tsc_with_pit(); + g_timer_tsc = calibrate_tsc_with_pit();
/* Set some semi-ridiculous rate if approximation fails. */ - if (tsc == 0) - tsc = 5000; + if (g_timer_tsc == 0) + g_timer_tsc = 5000;
- car_set_var(g_timer_tsc, tsc); - return tsc; + return g_timer_tsc; } #endif
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37045 )
Change subject: drivers/pc80/pc/i8254.c: Drop CAR_GLOBAL_MIGRATION support ......................................................................
Patch Set 7: Code-Review+2
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37045 )
Change subject: drivers/pc80/pc/i8254.c: Drop CAR_GLOBAL_MIGRATION support ......................................................................
Patch Set 7: Code-Review+1
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/37045 )
Change subject: drivers/pc80/pc/i8254.c: Drop CAR_GLOBAL_MIGRATION support ......................................................................
drivers/pc80/pc/i8254.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: Ibe9b353ce050b4718e07bccb958dbe3d2312e741 Signed-off-by: Arthur Heymans arthur@aheymans.xyz Reviewed-on: https://review.coreboot.org/c/coreboot/+/37045 Reviewed-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-by: HAOUAS Elyes ehaouas@noos.fr Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/drivers/pc80/pc/i8254.c 1 file changed, 7 insertions(+), 12 deletions(-)
Approvals: build bot (Jenkins): Verified Kyösti Mälkki: Looks good to me, approved HAOUAS Elyes: Looks good to me, but someone else must approve
diff --git a/src/drivers/pc80/pc/i8254.c b/src/drivers/pc80/pc/i8254.c index 5090f0c..9d23d46 100644 --- a/src/drivers/pc80/pc/i8254.c +++ b/src/drivers/pc80/pc/i8254.c @@ -11,7 +11,6 @@ * GNU General Public License for more details. */
-#include <arch/early_variables.h> #include <arch/io.h> #include <commonlib/helpers.h> #include <cpu/x86/tsc.h> @@ -107,23 +106,19 @@ }
#if CONFIG(UNKNOWN_TSC_RATE) -static u32 g_timer_tsc CAR_GLOBAL; +static u32 g_timer_tsc;
unsigned long tsc_freq_mhz(void) { - u32 tsc; + if (g_timer_tsc > 0) + return g_timer_tsc;
- tsc = car_get_var(g_timer_tsc); - if (tsc > 0) - return tsc; - - tsc = calibrate_tsc_with_pit(); + g_timer_tsc = calibrate_tsc_with_pit();
/* Set some semi-ridiculous rate if approximation fails. */ - if (tsc == 0) - tsc = 5000; + if (g_timer_tsc == 0) + g_timer_tsc = 5000;
- car_set_var(g_timer_tsc, tsc); - return tsc; + return g_timer_tsc; } #endif