[coreboot] New patch to review for coreboot: 1bf5cea Fix build with CMOS support on various platforms

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Tue May 1 12:18:57 CEST 2012


Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/983

-gerrit

commit 1bf5cea9b5902d27029725611a947e09db529201
Author: Patrick Georgi <patrick at georgi-clan.de>
Date:   Tue May 1 12:10:45 2012 +0200

    Fix build with CMOS support on various platforms
    
    When bringing in nvramtool as build_opt_tbl replacement,
    various platforms where left in the cold that don't
    provide direct IO support from userland (or at least not
    in a way we support).
    
    Build nvramtool without CMOS support when done as part of
    a coreboot build. We don't need to touch CMOS in this case.
    
    Change-Id: Icc88d1d32f10384867a5d44b065f9aa119bb0d50
    Signed-off-by: Patrick Georgi <patrick at georgi-clan.de>
---
 util/nvramtool/Makefile        |    2 +-
 util/nvramtool/Makefile.inc    |    2 +-
 util/nvramtool/cmos_lowlevel.c |    9 ++++++++-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/util/nvramtool/Makefile b/util/nvramtool/Makefile
index 063bb1a..6723a48 100644
--- a/util/nvramtool/Makefile
+++ b/util/nvramtool/Makefile
@@ -24,7 +24,7 @@ CC      = gcc
 STRIP	= strip
 INSTALL = /usr/bin/install
 PREFIX  = /usr/local
-CFLAGS  = -O2 -g -Wall -W -I.
+CFLAGS  = -O2 -g -Wall -W -I. -DCMOS_HAL=1
 #CFLAGS  = -Os -Wall
 
 CLI_OBJS = cli/nvramtool.o cli/opts.o
diff --git a/util/nvramtool/Makefile.inc b/util/nvramtool/Makefile.inc
index b356720..0acda04 100644
--- a/util/nvramtool/Makefile.inc
+++ b/util/nvramtool/Makefile.inc
@@ -37,7 +37,7 @@ nvramtoolobj :=
 nvramtoolobj += cli/nvramtool.o cli/opts.o
 nvramtoolobj += cmos_lowlevel.o cmos_ops.o common.o compute_ip_checksum.o
 nvramtoolobj += hexdump.o input_file.o layout.o accessors/layout-common.o accessors/layout-text.o accessors/layout-bin.o lbtable.o
-nvramtoolobj += reg_expr.o cbfs.o accessors/cmos-hw-unix.o accessors/cmos-mem.o
+nvramtoolobj += reg_expr.o cbfs.o accessors/cmos-mem.o
 
 $(objutil)/nvramtool $(objutil)/nvramtool/accessors $(objutil)/nvramtool/cli:
 	mkdir -p $@
diff --git a/util/nvramtool/cmos_lowlevel.c b/util/nvramtool/cmos_lowlevel.c
index 58494f9..55b1879 100644
--- a/util/nvramtool/cmos_lowlevel.c
+++ b/util/nvramtool/cmos_lowlevel.c
@@ -39,14 +39,21 @@
 /* Hardware Abstraction Layer: lowlevel byte-wise write access */
 
 extern cmos_access_t cmos_hal, memory_hal;
-static cmos_access_t *current_access = &cmos_hal;
+static cmos_access_t *current_access =
+#ifdef CMOS_HAL
+	&cmos_hal;
+#else
+	&memory_hal;
+#endif
 
 void select_hal(hal_t hal, void *data)
 {
 	switch(hal) {
+#ifdef CMOS_HAL
 		case HAL_CMOS:
 			current_access = &cmos_hal;
 			break;
+#endif
 		case HAL_MEMORY:
 			current_access = &memory_hal;
 			break;




More information about the coreboot mailing list