Thomas Heijligen has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/61300 )
Change subject: Makeile: reenable internal programmer for mipsel ......................................................................
Makeile: reenable internal programmer for mipsel
Make CONFIG_INTERNAL an alias for CONFIG_INTERNAL_X86 or CONFIG_INTERNAL_MIPS on the respective platforms. This allows for handling different system dependencies like DEPENDS_ON_X86_IO without the need to have an empty implementaion of those.
Change-Id: Ia607ea60c3d7d15fe231fa412595992dadc535ad Signed-off-by: Thomas Heijligen thomas.heijligen@secunet.com --- M Makefile M board_enable.c M chipset_enable.c M internal.c 4 files changed, 45 insertions(+), 31 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/00/61300/1
diff --git a/Makefile b/Makefile index d4de2ff..079a1ad 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,8 @@ CONFIG_SERPROG \
DEPENDS_ON_BITBANG_SPI := \ - CONFIG_INTERNAL \ + CONFIG_INTERNAL_X86 \ + CONFIG_INTERNAL_MIPSEL \ CONFIG_NICINTEL_SPI \ CONFIG_OGP_SPI \ CONFIG_PONY_SPI \ @@ -110,7 +111,8 @@ CONFIG_ATAPROMISE \ CONFIG_DRKAISER \ CONFIG_GFXNVIDIA \ - CONFIG_INTERNAL \ + CONFIG_INTERNAL_X86 \ + CONFIG_INTERNAL_MIPSEL \ CONFIG_IT8212 \ CONFIG_NICINTEL \ CONFIG_NICINTEL_EEPROM \ @@ -120,12 +122,12 @@ CONFIG_SATASII \
DEPENDS_ON_X86_MSR := \ - CONFIG_INTERNAL \ + CONFIG_INTERNAL_X86 \
DEPENDS_ON_X86_PORT_IO := \ CONFIG_ATAHPT \ CONFIG_ATAPROMISE \ - CONFIG_INTERNAL \ + CONFIG_INTERNAL_X86 \ CONFIG_NIC3COM \ CONFIG_NICNATSEMI \ CONFIG_NICREALTEK \ @@ -138,7 +140,8 @@ CONFIG_ATAVIA \ CONFIG_DRKAISER \ CONFIG_GFXNVIDIA \ - CONFIG_INTERNAL \ + CONFIG_INTERNAL_X86 \ + CONFIG_INTERNAL_MIPSEL \ CONFIG_IT8212 \ CONFIG_NIC3COM \ CONFIG_NICINTEL \ @@ -327,8 +330,12 @@ endif
# Disable the internal programmer on unsupported architectures (everything but x86 and mipsel) -ifneq ($(ARCH)-little, $(filter $(ARCH), x86 mips)-$(ENDIAN)) -$(call mark_unsupported,CONFIG_INTERNAL) +ifneq ($(ARCH), x86) +$(call mark_unsupported,CONFIG_INTERNAL_X86) +endif + +ifneq ($(ARCH) $(ENDIAN), mips little) +$(call mark_unsupported,CONFIG_INTERNAL_MIPSEL) endif
ifeq ($(HAS_LIBPCI), no) @@ -432,6 +439,12 @@
# Always enable internal/onboard support for now. CONFIG_INTERNAL ?= yes +ifeq ($(CONFIG_INTERNAL) $(ARCH), yes x86) +CONFIG_INTERNAL_X86 := yes +endif +ifeq ($(CONFIG_INTERNAL) $(ARCH) $(ENDIAN), yes mips little) +CONFIG_INTERNAL_MIPSEL := yes +endif
# Always enable serprog for now. CONFIG_SERPROG ?= yes @@ -597,17 +610,16 @@
FEATURE_FLAGS += -D'CONFIG_DEFAULT_PROGRAMMER_ARGS="$(CONFIG_DEFAULT_PROGRAMMER_ARGS)"'
-ifeq ($(CONFIG_INTERNAL), yes) +ifeq ($(filter $(CONFIG_INTERNAL_X86) $(CONFIG_INTERNAL_MIPSEL), yes), yes) FEATURE_FLAGS += -D'CONFIG_INTERNAL=1' PROGRAMMER_OBJS += processor_enable.o chipset_enable.o board_enable.o cbtable.o internal.o -ifeq ($(ARCH), x86) -PROGRAMMER_OBJS += it87spi.o it85spi.o sb600spi.o amd_imc.o wbsio_spi.o mcp6x_spi.o -PROGRAMMER_OBJS += ichspi.o dmi.o +endif + +ifeq ($(CONFIG_INTERNAL_X86), yes) ifeq ($(CONFIG_INTERNAL_DMI), yes) FEATURE_FLAGS += -D'CONFIG_INTERNAL_DMI=1' endif -else -endif +PROGRAMMER_OBJS += it87spi.o it85spi.o sb600spi.o amd_imc.o wbsio_spi.o mcp6x_spi.o ichspi.o dmi.o endif
ifeq ($(CONFIG_SERPROG), yes) diff --git a/board_enable.c b/board_enable.c index c23e257..14e556c 100644 --- a/board_enable.c +++ b/board_enable.c @@ -25,11 +25,11 @@ #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 d72300e..6ed8141 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -33,14 +33,15 @@ #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"
#define NOT_DONE_YET 1
#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) { diff --git a/internal.c b/internal.c index 7a13e4c..03bc7ca 100644 --- a/internal.c +++ b/internal.c @@ -19,19 +19,12 @@ #include <stdlib.h> #include "flash.h" #include "programmer.h" -#include "hwaccess_x86_io.h" #include "hwaccess_physmap.h" #include "platform/pci.h"
-int is_laptop = 0; -int laptop_ok = 0; - -int force_boardenable = 0; -int force_boardmismatch = 0; - -enum chipbustype internal_buses_supported = BUS_NONE; - #if defined(__i386__) || defined(__x86_64__) +#include "hwaccess_x86_io.h" + void probe_superio(void) { probe_superio_winbond(); @@ -59,6 +52,14 @@
#endif
+int is_laptop = 0; +int laptop_ok = 0; + +int force_boardenable = 0; +int force_boardmismatch = 0; + +enum chipbustype internal_buses_supported = BUS_NONE; + static void internal_chip_writeb(const struct flashctx *flash, uint8_t val, chipaddr addr) { @@ -183,11 +184,6 @@ } 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. @@ -213,6 +209,11 @@ }
#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"