From 36f87376a328ba3fe7c676c4e27214f23a5e146d Mon Sep 17 00:00:00 2001 From: Peter Marheine Date: Wed, 19 Jan 2022 17:11:09 +1100 Subject: hwaccess: fix build on non-x86 targets The changes to hwaccess in commit 49d758698a0dd166679c48b1a2785e50e9b0cc83 cause build failure on non-x86 systems because the hwaccess_x86_* headers are included in some files that are built for all platforms (particularly those in the internal programmer) and those headers in turn include which only exists on x86. This change avoids including those headers on non-x86 platforms so the internal programmer can be built without errors. The comment on the stub implementation of rget_io_perms() is also modified to remove references to non-x86 platforms, since that file is only built on x86 now. BUG=None TEST=meson build succeeds for both x86 and ARM targets Signed-off-by: Peter Marheine Change-Id: I20f122679c30340b2c73afd7419e79644ddc3c4e Reviewed-on: https://review.coreboot.org/c/flashrom/+/61194 Reviewed-by: Nico Huber Reviewed-by: Thomas Heijligen Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- internal.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'internal.c') diff --git a/internal.c b/internal.c index bb606ca56..b8e0564ef 100644 --- a/internal.c +++ b/internal.c @@ -19,10 +19,13 @@ #include #include "flash.h" #include "programmer.h" -#include "hwaccess_x86_io.h" #include "hwaccess_physmap.h" #include "platform/pci.h" +#if defined(__i386__) || defined(__x86_64__) +#include "hwaccess_x86_io.h" +#endif + int is_laptop = 0; int laptop_ok = 0; @@ -241,11 +244,6 @@ static int internal_init(void) } free(arg); - if (rget_io_perms()) { - ret = 1; - goto internal_init_exit; - } - /* Default to Parallel/LPC/FWH flash devices. If a known host controller * is found, the host controller init routine sets the * internal_buses_supported bitfield. @@ -271,6 +269,11 @@ static int internal_init(void) } #if defined(__i386__) || defined(__x86_64__) + if (rget_io_perms()) { + ret = 1; + goto internal_init_exit; + } + if ((cb_parse_table(&cb_vendor, &cb_model) == 0) && (board_vendor != NULL) && (board_model != NULL)) { if (strcasecmp(board_vendor, cb_vendor) || strcasecmp(board_model, cb_model)) { msg_pwarn("Warning: The mainboard IDs set by -p internal:mainboard (%s:%s) do not\n" -- cgit v1.2.3