aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--board_enable.c6
-rw-r--r--chipset_enable.c5
-rw-r--r--hwaccess_x86_io.c1
-rw-r--r--internal.c15
4 files changed, 16 insertions, 11 deletions
diff --git a/board_enable.c b/board_enable.c
index c23e257d..94cfc9d0 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -25,11 +25,13 @@
#include <stdlib.h>
#include "flash.h"
#include "programmer.h"
-#include "hwaccess_x86_io.h"
-#include "hwaccess_x86_msr.h"
#include "platform/pci.h"
#if defined(__i386__) || defined(__x86_64__)
+
+#include "hwaccess_x86_io.h"
+#include "hwaccess_x86_msr.h"
+
/*
* Helper functions for many Winbond Super I/Os of the W836xx range.
*/
diff --git a/chipset_enable.c b/chipset_enable.c
index d72300e6..fe7ec153 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -33,8 +33,6 @@
#include <errno.h>
#include "flash.h"
#include "programmer.h"
-#include "hwaccess_x86_io.h"
-#include "hwaccess_x86_msr.h"
#include "hwaccess_physmap.h"
#include "platform/pci.h"
@@ -42,6 +40,9 @@
#if defined(__i386__) || defined(__x86_64__)
+#include "hwaccess_x86_io.h"
+#include "hwaccess_x86_msr.h"
+
static int enable_flash_ali_m1533(struct pci_dev *dev, const char *name)
{
uint8_t tmp;
diff --git a/hwaccess_x86_io.c b/hwaccess_x86_io.c
index 3152bfe5..fc6ee54f 100644
--- a/hwaccess_x86_io.c
+++ b/hwaccess_x86_io.c
@@ -79,7 +79,6 @@ int rget_io_perms(void)
#else
/* DJGPP and libpayload environments have full PCI port I/O permissions by default. */
-/* PCI port I/O support is unimplemented on PPC/MIPS and unavailable on ARM. */
int rget_io_perms(void)
{
return 0;
diff --git a/internal.c b/internal.c
index bb606ca5..b8e0564e 100644
--- a/internal.c
+++ b/internal.c
@@ -19,10 +19,13 @@
#include <stdlib.h>
#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"