From cbf957158806bcd5c733c45baa324559904c609c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 5 Jan 2020 08:05:45 +0200 Subject: [PATCH] drivers/pc80/rtc: Separate {get|set}_option() prototypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Long-term plan is to support loading runtime configuration from SPI flash as an alternative, so move these prototypes outside pc80/. Change-Id: Iad7b03dc985550da903d56b3deb5bd736013f8f1 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/38192 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/cpu/intel/hyperthreading/intel_sibling.c | 2 +- src/drivers/pc80/rtc/mc146818rtc.c | 5 ++- src/ec/kontron/it8516e/ec.c | 2 +- src/ec/lenovo/h8/h8.c | 2 +- src/ec/lenovo/pmh7/pmh7.c | 2 +- src/include/option.h | 39 ++++++++++++++----- src/include/pc80/mc146818rtc.h | 3 -- src/mainboard/asus/am1i-a/BiosCallOuts.c | 2 +- src/mainboard/getac/p470/early_init.c | 2 +- src/mainboard/ibase/mb899/superio_hwm.c | 2 +- src/mainboard/kontron/986lcd-m/early_init.c | 2 +- src/mainboard/kontron/986lcd-m/mainboard.c | 2 +- src/mainboard/kontron/ktqm77/mainboard.c | 2 +- src/mainboard/lenovo/x60/smihandler.c | 2 +- src/mainboard/roda/rk886ex/early_init.c | 2 +- src/northbridge/intel/gm45/igd.c | 2 +- src/northbridge/intel/i945/early_init.c | 2 +- src/northbridge/intel/i945/gma.c | 2 +- src/northbridge/intel/nehalem/raminit.c | 2 +- src/northbridge/intel/pineview/early_init.c | 2 +- .../intel/sandybridge/early_init.c | 2 +- src/northbridge/intel/x4x/early_init.c | 2 +- src/soc/intel/broadwell/lpc.c | 2 +- src/soc/intel/broadwell/smihandler.c | 2 +- src/soc/intel/common/block/pmc/pmclib.c | 2 +- src/southbridge/intel/bd82x6x/lpc.c | 2 +- src/southbridge/intel/bd82x6x/sata.c | 2 +- src/southbridge/intel/common/smihandler.c | 2 +- src/southbridge/intel/i82801dx/lpc.c | 1 + src/southbridge/intel/i82801gx/lpc.c | 1 + src/southbridge/intel/i82801ix/lpc.c | 1 + src/southbridge/intel/i82801ix/sata.c | 2 +- src/southbridge/intel/i82801jx/lpc.c | 1 + src/southbridge/intel/i82801jx/sata.c | 2 +- src/southbridge/intel/ibexpeak/lpc.c | 1 + src/southbridge/intel/ibexpeak/sata.c | 2 +- src/southbridge/intel/lynxpoint/lpc.c | 2 +- src/southbridge/intel/lynxpoint/smihandler.c | 2 +- src/superio/ite/it8720f/superio.c | 2 +- src/superio/nuvoton/nct5572d/superio.c | 2 +- src/superio/winbond/w83627ehg/superio.c | 2 +- src/superio/winbond/w83627hf/superio.c | 2 +- src/superio/winbond/w83667hg-a/superio.c | 2 +- 43 files changed, 72 insertions(+), 50 deletions(-) diff --git a/src/cpu/intel/hyperthreading/intel_sibling.c b/src/cpu/intel/hyperthreading/intel_sibling.c index f5bcc87a10..f602ccded7 100644 --- a/src/cpu/intel/hyperthreading/intel_sibling.c +++ b/src/cpu/intel/hyperthreading/intel_sibling.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #if CONFIG(PARALLEL_CPU_INIT) diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c index 715e440955..ee61a6c22d 100644 --- a/src/drivers/pc80/rtc/mc146818rtc.c +++ b/src/drivers/pc80/rtc/mc146818rtc.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -251,7 +252,7 @@ static enum cb_err locate_cmos_layout(struct region_device *rdev) return CB_SUCCESS; } -enum cb_err get_option(void *dest, const char *name) +enum cb_err cmos_get_option(void *dest, const char *name) { struct cmos_option_table *ct; struct region_device rdev; @@ -344,7 +345,7 @@ static enum cb_err set_cmos_value(unsigned long bit, unsigned long length, return CB_SUCCESS; } -enum cb_err set_option(const char *name, void *value) +enum cb_err cmos_set_option(const char *name, void *value) { struct cmos_option_table *ct; struct region_device rdev; diff --git a/src/ec/kontron/it8516e/ec.c b/src/ec/kontron/it8516e/ec.c index c0042fc729..ca695b3378 100644 --- a/src/ec/kontron/it8516e/ec.c +++ b/src/ec/kontron/it8516e/ec.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include "ec.h" #include "chip.h" diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c index 93a771c47d..73657bcdb0 100644 --- a/src/ec/lenovo/h8/h8.c +++ b/src/ec/lenovo/h8/h8.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/ec/lenovo/pmh7/pmh7.c b/src/ec/lenovo/pmh7/pmh7.c index 9dd668fd75..42e5238c42 100644 --- a/src/ec/lenovo/pmh7/pmh7.c +++ b/src/ec/lenovo/pmh7/pmh7.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/include/option.h b/src/include/option.h index 3a20dcf196..198ca00d02 100644 --- a/src/include/option.h +++ b/src/include/option.h @@ -1,19 +1,38 @@ +/* + * This file is part of the coreboot project. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #ifndef _OPTION_H_ #define _OPTION_H_ -/* - * FIXME: get_option() needs to be abstracted better so that other non-volatile - * storage can be used. This will benefit machines without CMOS as well as those - * without a battery-backed CMOS (e.g. some laptops). - */ -#if CONFIG(USE_OPTION_TABLE) -#include -#else #include -static inline enum cb_err get_option(void *dest, const char *name) + +enum cb_err cmos_set_option(const char *name, void *val); +enum cb_err cmos_get_option(void *dest, const char *name); + +static inline enum cb_err set_option(const char *name, void *val) { + if (CONFIG(USE_OPTION_TABLE)) + return cmos_set_option(name, val); + + return CB_CMOS_OTABLE_DISABLED; +} + +static inline enum cb_err get_option(void *dest, const char *name) +{ + if (CONFIG(USE_OPTION_TABLE)) + return cmos_get_option(dest, name); + return CB_CMOS_OTABLE_DISABLED; } -#endif #endif /* _OPTION_H_ */ diff --git a/src/include/pc80/mc146818rtc.h b/src/include/pc80/mc146818rtc.h index 91413d11d5..9cd00b525c 100644 --- a/src/include/pc80/mc146818rtc.h +++ b/src/include/pc80/mc146818rtc.h @@ -181,9 +181,6 @@ int cmos_lb_cks_valid(void); int cmos_checksum_valid(int range_start, int range_end, int cks_loc); void cmos_set_checksum(int range_start, int range_end, int cks_loc); -enum cb_err set_option(const char *name, void *val); -enum cb_err get_option(void *dest, const char *name); - #if CONFIG(CMOS_POST) #if CONFIG(USE_OPTION_TABLE) # include "option_table.h" diff --git a/src/mainboard/asus/am1i-a/BiosCallOuts.c b/src/mainboard/asus/am1i-a/BiosCallOuts.c index ce547419d2..a61a72230c 100644 --- a/src/mainboard/asus/am1i-a/BiosCallOuts.c +++ b/src/mainboard/asus/am1i-a/BiosCallOuts.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include const BIOS_CALLOUT_STRUCT BiosCallouts[] = diff --git a/src/mainboard/getac/p470/early_init.c b/src/mainboard/getac/p470/early_init.c index 0581f80252..f4f974a849 100644 --- a/src/mainboard/getac/p470/early_init.c +++ b/src/mainboard/getac/p470/early_init.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/mainboard/ibase/mb899/superio_hwm.c b/src/mainboard/ibase/mb899/superio_hwm.c index 175c9a0d5a..f57a06dd66 100644 --- a/src/mainboard/ibase/mb899/superio_hwm.c +++ b/src/mainboard/ibase/mb899/superio_hwm.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/mainboard/kontron/986lcd-m/early_init.c b/src/mainboard/kontron/986lcd-m/early_init.c index 995a346298..827f792946 100644 --- a/src/mainboard/kontron/986lcd-m/early_init.c +++ b/src/mainboard/kontron/986lcd-m/early_init.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/mainboard/kontron/986lcd-m/mainboard.c b/src/mainboard/kontron/986lcd-m/mainboard.c index cc2e32bf29..30368e8f91 100644 --- a/src/mainboard/kontron/986lcd-m/mainboard.c +++ b/src/mainboard/kontron/986lcd-m/mainboard.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/mainboard/kontron/ktqm77/mainboard.c b/src/mainboard/kontron/ktqm77/mainboard.c index 50a7b6be08..2af5eb239f 100644 --- a/src/mainboard/kontron/ktqm77/mainboard.c +++ b/src/mainboard/kontron/ktqm77/mainboard.c @@ -22,7 +22,7 @@ #if CONFIG(VGA_ROM_RUN) #include #endif -#include +#include #include #include diff --git a/src/mainboard/lenovo/x60/smihandler.c b/src/mainboard/lenovo/x60/smihandler.c index 7aacc451c0..d5c92e5ae0 100644 --- a/src/mainboard/lenovo/x60/smihandler.c +++ b/src/mainboard/lenovo/x60/smihandler.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include "dock.h" diff --git a/src/mainboard/roda/rk886ex/early_init.c b/src/mainboard/roda/rk886ex/early_init.c index efecb0da60..b0d08f4dd2 100644 --- a/src/mainboard/roda/rk886ex/early_init.c +++ b/src/mainboard/roda/rk886ex/early_init.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/northbridge/intel/gm45/igd.c b/src/northbridge/intel/gm45/igd.c index b1ce1bef90..cfd067e044 100644 --- a/src/northbridge/intel/gm45/igd.c +++ b/src/northbridge/intel/gm45/igd.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "gm45.h" diff --git a/src/northbridge/intel/i945/early_init.c b/src/northbridge/intel/i945/early_init.c index 6e650eb050..1deca3eeba 100644 --- a/src/northbridge/intel/i945/early_init.c +++ b/src/northbridge/intel/i945/early_init.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include "i945.h" diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c index d08b77d3e2..98e30e7d07 100644 --- a/src/northbridge/intel/i945/gma.c +++ b/src/northbridge/intel/i945/gma.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/northbridge/intel/nehalem/raminit.c b/src/northbridge/intel/nehalem/raminit.c index 215e9b82cb..7735522da9 100644 --- a/src/northbridge/intel/nehalem/raminit.c +++ b/src/northbridge/intel/nehalem/raminit.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/northbridge/intel/pineview/early_init.c b/src/northbridge/intel/pineview/early_init.c index b5c5ee0f63..c3cd380dc5 100644 --- a/src/northbridge/intel/pineview/early_init.c +++ b/src/northbridge/intel/pineview/early_init.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #define LPC PCI_DEV(0, 0x1f, 0) diff --git a/src/northbridge/intel/sandybridge/early_init.c b/src/northbridge/intel/sandybridge/early_init.c index 95fc52d262..74ae4f5e08 100644 --- a/src/northbridge/intel/sandybridge/early_init.c +++ b/src/northbridge/intel/sandybridge/early_init.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/northbridge/intel/x4x/early_init.c b/src/northbridge/intel/x4x/early_init.c index c9d44fc8d5..3520b88deb 100644 --- a/src/northbridge/intel/x4x/early_init.c +++ b/src/northbridge/intel/x4x/early_init.c @@ -22,7 +22,7 @@ #else #include /* DEFAULT_PMBASE */ #endif -#include +#include #include "x4x.h" #include #include diff --git a/src/soc/intel/broadwell/lpc.c b/src/soc/intel/broadwell/lpc.c index 007b56b515..e86b5bd46a 100644 --- a/src/soc/intel/broadwell/lpc.c +++ b/src/soc/intel/broadwell/lpc.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/soc/intel/broadwell/smihandler.c b/src/soc/intel/broadwell/smihandler.c index c2843a7cc0..5b04f799a3 100644 --- a/src/soc/intel/broadwell/smihandler.c +++ b/src/soc/intel/broadwell/smihandler.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c index 82b391b958..d022666dd7 100644 --- a/src/soc/intel/common/block/pmc/pmclib.c +++ b/src/soc/intel/common/block/pmc/pmclib.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/southbridge/intel/bd82x6x/lpc.c b/src/southbridge/intel/bd82x6x/lpc.c index ef66ca512a..01576a683a 100644 --- a/src/southbridge/intel/bd82x6x/lpc.c +++ b/src/southbridge/intel/bd82x6x/lpc.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/southbridge/intel/bd82x6x/sata.c b/src/southbridge/intel/bd82x6x/sata.c index 3ec065f287..f5243f6507 100644 --- a/src/southbridge/intel/bd82x6x/sata.c +++ b/src/southbridge/intel/bd82x6x/sata.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/southbridge/intel/common/smihandler.c b/src/southbridge/intel/common/smihandler.c index 7f376fd354..9fba12f9ef 100644 --- a/src/southbridge/intel/common/smihandler.c +++ b/src/southbridge/intel/common/smihandler.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/southbridge/intel/i82801dx/lpc.c b/src/southbridge/intel/i82801dx/lpc.c index a46f5a3707..0e2aead4e4 100644 --- a/src/southbridge/intel/i82801dx/lpc.c +++ b/src/southbridge/intel/i82801dx/lpc.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/src/southbridge/intel/i82801gx/lpc.c b/src/southbridge/intel/i82801gx/lpc.c index 0330af0060..779d3195e9 100644 --- a/src/southbridge/intel/i82801gx/lpc.c +++ b/src/southbridge/intel/i82801gx/lpc.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/src/southbridge/intel/i82801ix/lpc.c b/src/southbridge/intel/i82801ix/lpc.c index d5417307e7..bac48c256d 100644 --- a/src/southbridge/intel/i82801ix/lpc.c +++ b/src/southbridge/intel/i82801ix/lpc.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/src/southbridge/intel/i82801ix/sata.c b/src/southbridge/intel/i82801ix/sata.c index fcf4045baf..546acdfc00 100644 --- a/src/southbridge/intel/i82801ix/sata.c +++ b/src/southbridge/intel/i82801ix/sata.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include "chip.h" diff --git a/src/southbridge/intel/i82801jx/lpc.c b/src/southbridge/intel/i82801jx/lpc.c index a594452e04..91b1bde93a 100644 --- a/src/southbridge/intel/i82801jx/lpc.c +++ b/src/southbridge/intel/i82801jx/lpc.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/src/southbridge/intel/i82801jx/sata.c b/src/southbridge/intel/i82801jx/sata.c index e6e08a31a4..ce8ae470a1 100644 --- a/src/southbridge/intel/i82801jx/sata.c +++ b/src/southbridge/intel/i82801jx/sata.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include "chip.h" diff --git a/src/southbridge/intel/ibexpeak/lpc.c b/src/southbridge/intel/ibexpeak/lpc.c index 324438ec6b..851f4f51ea 100644 --- a/src/southbridge/intel/ibexpeak/lpc.c +++ b/src/southbridge/intel/ibexpeak/lpc.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/src/southbridge/intel/ibexpeak/sata.c b/src/southbridge/intel/ibexpeak/sata.c index 2d9412ad64..04e056492b 100644 --- a/src/southbridge/intel/ibexpeak/sata.c +++ b/src/southbridge/intel/ibexpeak/sata.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c index 62d8aa6385..4b39829e0d 100644 --- a/src/southbridge/intel/lynxpoint/lpc.c +++ b/src/southbridge/intel/lynxpoint/lpc.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/southbridge/intel/lynxpoint/smihandler.c b/src/southbridge/intel/lynxpoint/smihandler.c index 61f86fb067..72c344757d 100644 --- a/src/southbridge/intel/lynxpoint/smihandler.c +++ b/src/southbridge/intel/lynxpoint/smihandler.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/superio/ite/it8720f/superio.c b/src/superio/ite/it8720f/superio.c index 48bbfb2019..b5198e7d51 100644 --- a/src/superio/ite/it8720f/superio.c +++ b/src/superio/ite/it8720f/superio.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/superio/nuvoton/nct5572d/superio.c b/src/superio/nuvoton/nct5572d/superio.c index 76c983a0c7..163d6b92d7 100644 --- a/src/superio/nuvoton/nct5572d/superio.c +++ b/src/superio/nuvoton/nct5572d/superio.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/superio/winbond/w83627ehg/superio.c b/src/superio/winbond/w83627ehg/superio.c index da501739f6..35fca01df5 100644 --- a/src/superio/winbond/w83627ehg/superio.c +++ b/src/superio/winbond/w83627ehg/superio.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "w83627ehg.h" diff --git a/src/superio/winbond/w83627hf/superio.c b/src/superio/winbond/w83627hf/superio.c index a4d734fa47..4d76052f7b 100644 --- a/src/superio/winbond/w83627hf/superio.c +++ b/src/superio/winbond/w83627hf/superio.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "w83627hf.h" diff --git a/src/superio/winbond/w83667hg-a/superio.c b/src/superio/winbond/w83667hg-a/superio.c index 69ab91bf98..d0f4eef90d 100644 --- a/src/superio/winbond/w83667hg-a/superio.c +++ b/src/superio/winbond/w83667hg-a/superio.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include