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@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/983
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
This commit is contained in:
Patrick Georgi
2012-05-01 12:10:45 +02:00
committed by Stefan Reinauer
parent f8f00629e3
commit 44a89b34f8
3 changed files with 10 additions and 3 deletions

View File

@ -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;