From cceafa2ad073fe58b10b6f2317cbd36a63d7ccb5 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Wed, 26 May 2010 01:45:41 +0000 Subject: Handle the following architectures in generic flashrom code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - x86/x86_64 (little endian) - PowerPC (big endian) - MIPS (big+little endian) No changes to programmer specific code. This means any drivers with MMIO access will _not_ suddenly start working on big endian systems, but with this patch everything is in place to fix them. Compilation should work on all architectures listed above for all drivers except nic3com and nicrealtek which require PCI Port IO which is x86-only for now. To compile without nic3com and nicrealtek, run make distclean make CONFIG_NIC3COM=no CONFIG_NICREALTEK=no Thanks to Misha Manulis for testing early versions of this patch on PowerPC (big endian) with the satasii programmer. Thanks to Segher Boessenkool for design review and for helping out with compiler tricks and pointing out that we need eieio on PowerPC. Thanks to Vladimir Serbinenko for compile testing on MIPS (little endian) and PowerPC (big endian) and for runtime testing on MIPS (little endian). Thanks to David Daney for compile testing on MIPS (big endian). Thanks to Uwe Hermann for compile and runtime testing on x86_64. DO NOT RUN flashrom ON NON-X86 AFTER APPLYING THIS PATCH! This patch only provides the infrastructure, but does not convert any drivers, so flashrom will compile, but it won't do the right thing on non-x86 platforms. Corresponding to flashrom svn r1013. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Misha Manulis Acked-by: Vladimir 'phcoder/φ-coder' Serbinenko Acked-by: Uwe Hermann Acked-by: Segher Boessenkool --- spi25.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spi25.c') diff --git a/spi25.c b/spi25.c index 5a52f28..b45faf8 100644 --- a/spi25.c +++ b/spi25.c @@ -172,12 +172,14 @@ int probe_spi_rdid4(struct flashchip *flash) /* only some SPI chipsets support 4 bytes commands */ switch (spi_controller) { #if INTERNAL_SUPPORT == 1 +#if defined(__i386__) || defined(__x86_64__) case SPI_CONTROLLER_ICH7: case SPI_CONTROLLER_ICH9: case SPI_CONTROLLER_VIA: case SPI_CONTROLLER_SB600: case SPI_CONTROLLER_WBSIO: #endif +#endif #if FT2232_SPI_SUPPORT == 1 case SPI_CONTROLLER_FT2232: #endif @@ -996,11 +998,13 @@ int spi_aai_write(struct flashchip *flash, uint8_t *buf) switch (spi_controller) { #if INTERNAL_SUPPORT == 1 +#if defined(__i386__) || defined(__x86_64__) case SPI_CONTROLLER_WBSIO: msg_cerr("%s: impossible with Winbond SPI masters," " degrading to byte program\n", __func__); return spi_chip_write_1(flash, buf); #endif +#endif default: break; } -- cgit v1.1