summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-08-19 16:14:15 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2019-11-22 06:24:28 +0000
commit9bb16cd9c5b0fdf198f2b78c193d1a02f4f51338 (patch)
treedd284ae6978cd2551bccd16b9e872be154789797 /src
parent3382e53c64e7aef81cba23bb66bb1c615613faba (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/pc80/rtc/mc146818rtc.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c
index 6edffe0cd0..d3efdec16d 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 @@ enum cb_err get_option(void *dest, const char *name)
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 @@ enum cb_err get_option(void *dest, const char *name)
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 @@ enum cb_err get_option(void *dest, const char *name)
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 @@ enum cb_err set_option(const char *name, void *value)
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 @@ enum cb_err set_option(const char *name, void *value)
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;
}