68abf3998f
- Add support for Winbond W25Q40.V chips - Add support for Macronix MX23L1654, MX23L6454 and MX23L12854 mask ROMs - Add support for Intel Wildcat Point PCH - Add support for Intel Silvermont: Bay Trail, Rangeley and Avoton - Add support for S25FL128P, S25FL129P chips - Add support for a bunch of 29GL parallel flash chips - Add support for Atmel AT49LH004 and AT49LH00B4 - Add new programmer for SPI EEPROMs attached to Intel 82580 NICs - Add support for AMD Bolton chipset - Add Board Enable for ASUS Vintage 2 PH1 (P5LD2-MQ) - Add support for Macronix MX29F022(N)B and MX29F022(N)T - Add support for Macronix MX25U12835F - Add support for Sanyo LE25FW106 - Add IT8212F PCI ATA controller as programmer - Add support for Atmel (now Adesto) AT25DL081 and AT25DL161 - Add VIA VT6421A LPC programmer driver - Add support for ESMT F25L32PA - Add support for Sanyo LE25FW406A - Add support for new AMD SPI controller (SPI 100) - Add support for Sanyo LE25FU406B - Add support for SST25LF020A - Add support for Spansion S25FL132K and S25FL164K - Add support for SST25WF08 - Add support for Macronix MX23L3254 mask ROM - Add support for TUMPA Lite - Add support for Intel 82574L - Add board enable for ASUS A7V8X-MX - Add board enable for ASUS P5LD2-VM DH - Add board enable for abit BF6 - Add support for SST25VF512A, ST25VF020, SST25VF020B chips - Add pinout for Wiggler LPT - Add pinout for Atmel STK200/300 - Add pinout for Altera ByteBlasterMV - Add support for ST M50LPW080 chip - Add an internal DMI decoder - Add board enable for Bcom WinNET P680 - Add support for AT45CS1282 chip - Add support for AT45DB321C - Add support for Atmel AT45DB* chips - Add support for Fujitsu MBM29LV160BE/TE - Add ability to select between chips on GIGABYTE DualBIOS boards - Temporarily disable ftdi support Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
128 lines
3.5 KiB
Diff
128 lines
3.5 KiB
Diff
From: Peter Lemenkov <lemenkov@gmail.com>
|
|
Date: Sun, 26 Sep 2010 21:05:50 +0400
|
|
Subject: [PATCH] Use HAVE_*_H macro for detecting includes
|
|
|
|
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
|
diff --git a/hwaccess.h b/hwaccess.h
|
|
index 1fa7815..fda9530 100644
|
|
--- a/hwaccess.h
|
|
+++ b/hwaccess.h
|
|
@@ -24,11 +24,9 @@
|
|
#ifndef __HWACCESS_H__
|
|
#define __HWACCESS_H__ 1
|
|
|
|
-#if defined (__i386__) || defined (__x86_64__)
|
|
-#if defined(__GLIBC__)
|
|
+#if defined (HAVE_SYS_IO_H)
|
|
#include <sys/io.h>
|
|
-#endif
|
|
-#endif
|
|
+#endif /* defined (HAVE_SYS_IO_H) */
|
|
|
|
#if NEED_PCI == 1
|
|
/*
|
|
@@ -45,7 +43,53 @@
|
|
#endif
|
|
|
|
#undef index
|
|
+
|
|
+#if defined (HAVE_STRINGS_H)
|
|
+#include <strings.h>
|
|
+#endif /* defined (HAVE_STRINGS_H) */
|
|
+
|
|
+#if defined (HAVE_STDINT_H)
|
|
+#include <stdint.h>
|
|
+#endif /* defined (HAVE_STDINT_H) */
|
|
+
|
|
+#if defined (HAVE_SYS_TYPES_H)
|
|
+#include <sys/types.h>
|
|
+#endif /* defined (HAVE_SYS_TYPES_H) */
|
|
+
|
|
+#if defined (HAVE_MACHINE_SYSARCH_H)
|
|
+#include <machine/sysarch.h>
|
|
+#endif /* defined (HAVE_MACHINE_SYSARCH_H) */
|
|
+
|
|
+#if defined (HAVE_MACHINE_CPUFUNC_H)
|
|
+#if defined(__FreeBSD__) || defined(__DragonFly__)
|
|
+ /* Note that Debian/kFreeBSD (FreeBSD kernel with glibc) has conflicting
|
|
+ * out[bwl] definitions in machine/cpufunc.h and sys/io.h at least in some
|
|
+ * versions. Use machine/cpufunc.h only for plain FreeBSD/DragonFlyBSD.
|
|
+ */
|
|
+#include <machine/cpufunc.h>
|
|
#endif
|
|
+#endif /* defined (HAVE_MACHINE_CPUFUNC_H) */
|
|
+
|
|
+/* for iopl and outb under Solaris */
|
|
+#if defined HAVE_ASM_SUNDDI_H
|
|
+#include <asm/sunddi.h>
|
|
+#endif /* defined HAVE_ASM_SUNDDI_H */
|
|
+#if defined HAVE_SYS_SYSI86_H
|
|
+#include <sys/sysi86.h>
|
|
+#endif /* defined HAVE_SYS_SYSI86_H */
|
|
+#if defined HAVE_SYS_PSW_H
|
|
+#include <sys/psw.h>
|
|
+#endif /* defined HAVE_SYS_PSW_H */
|
|
+
|
|
+#ifdef __DJGPP__
|
|
+#include <pc.h>
|
|
+#endif /* __DJGPP__ */
|
|
+
|
|
+#if defined HAVE_DIRECTIO_DARWINIO_H
|
|
+#include <DirectIO/darwinio.h>
|
|
+#endif /* defined HAVE_DIRECTIO_DARWINIO_H */
|
|
+
|
|
+#endif /* defined (HAVE_LIBPCI) */
|
|
|
|
#define ___constant_swab8(x) ((uint8_t) ( \
|
|
(((uint8_t)(x) & (uint8_t)0xffU))))
|
|
@@ -118,15 +162,15 @@ cpu_to_be(64)
|
|
#define le_to_cpu64 cpu_to_le64
|
|
|
|
#if NEED_PCI == 1
|
|
+
|
|
+/* PCI port I/O is not yet implemented on PowerPC. */
|
|
+/* PCI port I/O is not yet implemented on MIPS. */
|
|
#if defined (__i386__) || defined (__x86_64__)
|
|
|
|
#define __FLASHROM_HAVE_OUTB__ 1
|
|
|
|
-/* for iopl and outb under Solaris */
|
|
-#if defined (__sun) && (defined(__i386) || defined(__amd64))
|
|
-#include <sys/sysi86.h>
|
|
-#include <sys/psw.h>
|
|
-#include <asm/sunddi.h>
|
|
+#if (defined(__MACH__) && defined(__APPLE__))
|
|
+#define __DARWIN__
|
|
#endif
|
|
|
|
/* Clarification about OUTB/OUTW/OUTL argument order:
|
|
@@ -162,8 +206,6 @@ cpu_to_be(64)
|
|
|
|
#ifdef __DJGPP__
|
|
|
|
-#include <pc.h>
|
|
-
|
|
#define OUTB(x,y) outportb(y, x)
|
|
#define OUTW(x,y) outportw(y, x)
|
|
#define OUTL(x,y) outportl(y, x)
|
|
@@ -246,7 +288,7 @@ static inline uint32_t inl(uint16_t port)
|
|
typedef struct { uint32_t hi, lo; } msr_t;
|
|
msr_t rdmsr(int addr);
|
|
int wrmsr(int addr, msr_t msr);
|
|
-#endif
|
|
+#endif /* !defined(__DARWIN__) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__DragonFly__) && !defined(__LIBPAYLOAD__) */
|
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
|
/* FreeBSD already has conflicting definitions for wrmsr/rdmsr. */
|
|
#undef rdmsr
|
|
@@ -256,7 +298,8 @@ int wrmsr(int addr, msr_t msr);
|
|
typedef struct { uint32_t hi, lo; } msr_t;
|
|
msr_t freebsd_rdmsr(int addr);
|
|
int freebsd_wrmsr(int addr, msr_t msr);
|
|
-#endif
|
|
+#endif /* defined(__FreeBSD__) || defined(__DragonFly__) */
|
|
+
|
|
#if defined(__LIBPAYLOAD__)
|
|
#include <arch/io.h>
|
|
#include <arch/msr.h>
|