projects
/
coreboot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix CMOS handling for non-USE_OPTION_TABLE configuration
[coreboot.git]
/
src
/
include
/
pc80
/
mc146818rtc.h
diff --git
a/src/include/pc80/mc146818rtc.h
b/src/include/pc80/mc146818rtc.h
index 0abb2a6b4b5f91437f9c3d5a6ca7631402dcc687..3e5a61a7067aacf7f7619011b2362ec87b27fcaf 100644
(file)
--- a/
src/include/pc80/mc146818rtc.h
+++ b/
src/include/pc80/mc146818rtc.h
@@
-81,14
+81,6
@@
#define PC_CKS_RANGE_END 45
#define PC_CKS_LOC 46
#define PC_CKS_RANGE_END 45
#define PC_CKS_LOC 46
-/* coreboot cmos checksum is usually only built over bytes 49..125
- * LB_CKS_RANGE_START, LB_CKS_RANGE_END and LB_CKS_LOC are defined
- * in option_table.h
- */
-#if CONFIG_HAVE_OPTION_TABLE
-#include <option_table.h>
-#endif
-
#ifndef UTIL_BUILD_OPTION_TABLE
#include <arch/io.h>
static inline unsigned char cmos_read(unsigned char addr)
#ifndef UTIL_BUILD_OPTION_TABLE
#include <arch/io.h>
static inline unsigned char cmos_read(unsigned char addr)
@@
-117,16
+109,18
@@
static inline void cmos_write(unsigned char val, unsigned char addr)
#if !defined(__ROMCC__)
void rtc_init(int invalid);
#if CONFIG_USE_OPTION_TABLE
#if !defined(__ROMCC__)
void rtc_init(int invalid);
#if CONFIG_USE_OPTION_TABLE
+int set_option(const char *name, void *val);
int get_option(void *dest, const char *name);
int get_option(void *dest, const char *name);
-unsigned read_option(unsigned start, unsigned size, unsigned def);
+unsigned read_option
_lowlevel
(unsigned start, unsigned size, unsigned def);
#else
#else
+static inline int set_option(const char *name __attribute__((unused)), void *val __attribute__((unused))) { return -2; };
static inline int get_option(void *dest __attribute__((unused)),
const char *name __attribute__((unused))) { return -2; }
static inline int get_option(void *dest __attribute__((unused)),
const char *name __attribute__((unused))) { return -2; }
-static inline unsigned read_option(unsigned start, unsigned size, unsigned def)
- { return def; }
+#define read_option_lowlevel(start, size, def) def
#endif
#else
#include <pc80/mc146818rtc_early.c>
#endif
#endif
#else
#include <pc80/mc146818rtc_early.c>
#endif
+#define read_option(name, default) read_option_lowlevel(CMOS_VSTART_ ##name, CMOS_VLEN_ ##name, (default))
#endif /* PC80_MC146818RTC_H */
#endif /* PC80_MC146818RTC_H */