Kyösti Mälkki has submitted this change. ( https://review.coreboot.org/c/coreboot/+/37074 )
Change subject: drivers/pc80/rtc: Remove CMOS spinlock ......................................................................
drivers/pc80/rtc: Remove CMOS spinlock
This was only used with amdfam10h-15h, and only in romstage while commentary elsewhere says concurrent CMOS and CBFS access caused issues.
We would want a cleaner approach on this, if re-implemented.
Change-Id: I8512196cb55ff2b4542b1421a1bbae540450115a Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/37074 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Arthur Heymans arthur@aheymans.xyz Reviewed-by: Aaron Durbin adurbin@chromium.org --- M src/drivers/pc80/rtc/mc146818rtc.c 1 file changed, 0 insertions(+), 21 deletions(-)
Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved Arthur Heymans: Looks good to me, approved
diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c index 6edffe0..d3efdec 100644 --- a/src/drivers/pc80/rtc/mc146818rtc.c +++ b/src/drivers/pc80/rtc/mc146818rtc.c @@ -37,17 +37,6 @@ /* Don't warn for checking >= LB_CKS_RANGE_START even though it may be 0. */ #pragma GCC diagnostic ignored "-Wtype-limits"
-#include <smp/spinlock.h> - -#if (defined(__PRE_RAM__) && \ -CONFIG(HAVE_ROMSTAGE_NVRAM_CBFS_SPINLOCK)) - #define LOCK_NVRAM_CBFS_SPINLOCK() spin_lock(romstage_nvram_cbfs_lock()) - #define UNLOCK_NVRAM_CBFS_SPINLOCK() spin_unlock(romstage_nvram_cbfs_lock()) -#else - #define LOCK_NVRAM_CBFS_SPINLOCK() { } - #define UNLOCK_NVRAM_CBFS_SPINLOCK() { } -#endif - static void cmos_reset_date(void) { /* Now setup a default date equals to the build date */ @@ -274,13 +263,10 @@ if (!CONFIG(USE_OPTION_TABLE)) return CB_CMOS_OTABLE_DISABLED;
- LOCK_NVRAM_CBFS_SPINLOCK(); - /* Figure out how long name is */ namelen = strnlen(name, CMOS_MAX_NAME_LENGTH);
if (locate_cmos_layout(&rdev) != CB_SUCCESS) { - UNLOCK_NVRAM_CBFS_SPINLOCK(); return CB_CMOS_LAYOUT_NOT_FOUND; } ct = rdev_mmap_full(&rdev); @@ -288,7 +274,6 @@ printk(BIOS_ERR, "RTC: cmos_layout.bin could not be mapped. " "Options are disabled\n");
- UNLOCK_NVRAM_CBFS_SPINLOCK(); return CB_CMOS_LAYOUT_NOT_FOUND; }
@@ -304,22 +289,18 @@ if (!found) { printk(BIOS_DEBUG, "No CMOS option '%s'.\n", name); rdev_munmap(&rdev, ct); - UNLOCK_NVRAM_CBFS_SPINLOCK(); return CB_CMOS_OPTION_NOT_FOUND; }
if (!cmos_checksum_valid(LB_CKS_RANGE_START, LB_CKS_RANGE_END, LB_CKS_LOC)) { rdev_munmap(&rdev, ct); - UNLOCK_NVRAM_CBFS_SPINLOCK(); return CB_CMOS_CHECKSUM_INVALID; } if (get_cmos_value(ce->bit, ce->length, dest) != CB_SUCCESS) { rdev_munmap(&rdev, ct); - UNLOCK_NVRAM_CBFS_SPINLOCK(); return CB_CMOS_ACCESS_ERROR; } rdev_munmap(&rdev, ct); - UNLOCK_NVRAM_CBFS_SPINLOCK(); return CB_SUCCESS; }
@@ -392,7 +373,6 @@ namelen = strnlen(name, CMOS_MAX_NAME_LENGTH);
if (locate_cmos_layout(&rdev) != CB_SUCCESS) { - UNLOCK_NVRAM_CBFS_SPINLOCK(); return CB_CMOS_LAYOUT_NOT_FOUND; } ct = rdev_mmap_full(&rdev); @@ -400,7 +380,6 @@ printk(BIOS_ERR, "RTC: cmos_layout.bin could not be mapped. " "Options are disabled\n");
- UNLOCK_NVRAM_CBFS_SPINLOCK(); return CB_CMOS_LAYOUT_NOT_FOUND; }