From c3da3fe1d36c58f0d3acbf237f5848dd08dcf016 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Thu, 11 May 2017 16:40:40 +0200 Subject: drivers/pc80/rtc: Rename mc146818rtc_early.c -> _romcc.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And don't link it. It's for ROMCC. To make code happy that uses the ROMCC interface read_option(), read_option_lowlevel() is ported to mc146818rtc.c along with a message to use get_option() instead. Change-Id: I54ea08de034766c8140b320075d36d5e811582fa Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/19663 Tested-by: build bot (Jenkins) Tested-by: Raptor Engineering Automated Test Stand Reviewed-by: Aaron Durbin Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paul Menzel --- src/drivers/pc80/rtc/mc146818rtc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/drivers/pc80/rtc/mc146818rtc.c') diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c index a102917d8d..33860b8de3 100644 --- a/src/drivers/pc80/rtc/mc146818rtc.c +++ b/src/drivers/pc80/rtc/mc146818rtc.c @@ -304,6 +304,17 @@ static enum cb_err set_cmos_value(unsigned long bit, unsigned long length, return CB_SUCCESS; } +unsigned int read_option_lowlevel(unsigned int start, unsigned int size, + unsigned int def) +{ + printk(BIOS_NOTICE, "NOTICE: read_option() used to access CMOS " + "from non-ROMCC code, please use get_option() instead.\n"); + if (IS_ENABLED(CONFIG_USE_OPTION_TABLE)) { + const unsigned char byte = cmos_read(start / 8); + return (byte >> (start & 7U)) & ((1U << size) - 1U); + } + return def; +} enum cb_err set_option(const char *name, void *value) { -- cgit v1.2.3