summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@google.com>2012-02-13 00:35:35 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-02-13 00:35:35 +0000
commitb286da7ffc0dd978bb6efe4530c3e904b57c4aca (patch)
tree95734984a923e7da1c7e20d39c5202a6a715e703
parentbfd89a56353286d6ff393110b590448aa9c39669 (diff)
downloadast2050-flashrom-b286da7ffc0dd978bb6efe4530c3e904b57c4aca.zip
ast2050-flashrom-b286da7ffc0dd978bb6efe4530c3e904b57c4aca.tar.gz
Support compilation for the ARM architecture (little-endian only)
Note: The internal programmer will abort during processor check. This is intentional. The other hardware drivers (except those using port I/O) should work. Corresponding to flashrom svn r1492. Signed-off-by: David Hendricks <dhendrix@google.com> Acked-by: David Hendricks <dhendrix@google.com> Tested-by: Timo Juhani Lindfors <timo.lindfors@iki.fi> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
-rw-r--r--Makefile5
-rw-r--r--arch.h2
-rw-r--r--hwaccess.c14
-rw-r--r--hwaccess.h11
-rw-r--r--programmer.h2
5 files changed, 31 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 83aa038..34c1326 100644
--- a/Makefile
+++ b/Makefile
@@ -215,8 +215,9 @@ endif
# below uses CC itself.
override ARCH := $(strip $(shell LC_ALL=C $(CC) $(CPPFLAGS) -E arch.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
-ifeq ($(ARCH), ppc)
-# There's no PCI port I/O support on PPC/PowerPC, yet.
+# PCI port I/O support is unimplemented on PPC/MIPS and unavailable on ARM.
+# Right now this means the drivers below only work on x86.
+ifneq ($(ARCH), x86)
ifeq ($(CONFIG_NIC3COM), yes)
UNSUPPORTED_FEATURES += CONFIG_NIC3COM=yes
else
diff --git a/arch.h b/arch.h
index 980fba6..f3f3b0d 100644
--- a/arch.h
+++ b/arch.h
@@ -27,5 +27,7 @@
#define __FLASHROM_ARCH__ "mips"
#elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__)
#define __FLASHROM_ARCH__ "ppc"
+#elif defined(__arm__)
+#define __FLASHROM_ARCH__ "arm"
#endif
__FLASHROM_ARCH__
diff --git a/hwaccess.c b/hwaccess.c
index 8c89925..51e113e 100644
--- a/hwaccess.c
+++ b/hwaccess.c
@@ -116,6 +116,20 @@ void release_io_perms(void)
{
}
+#elif defined (__arm__)
+
+static inline void sync_primitive(void)
+{
+}
+
+void get_io_perms(void)
+{
+}
+
+void release_io_perms(void)
+{
+}
+
#else
#error Unknown architecture
diff --git a/hwaccess.h b/hwaccess.h
index eea3652..c10b12e 100644
--- a/hwaccess.h
+++ b/hwaccess.h
@@ -68,6 +68,13 @@
#error Little-endian PowerPC #defines are unknown
#endif
+#elif defined (__arm__)
+#if defined (__ARMEL__)
+#define __FLASHROM_LITTLE_ENDIAN__ 1
+#else
+#error Big-endian ARM #defines are unknown
+#endif
+
#endif
#if !defined (__FLASHROM_BIG_ENDIAN__) && !defined (__FLASHROM_LITTLE_ENDIAN__)
@@ -326,6 +333,10 @@ int libpayload_wrmsr(int addr, msr_t msr);
/* PCI port I/O is not yet implemented on MIPS. */
+#elif defined(__arm__)
+
+/* Non memory mapped I/O is not supported on ARM. */
+
#else
#error Unknown architecture, please check if it supports PCI port IO.
diff --git a/programmer.h b/programmer.h
index 6f69db1..240e1af 100644
--- a/programmer.h
+++ b/programmer.h
@@ -527,6 +527,7 @@ int default_spi_write_256(struct flashctx *flash, uint8_t *buf, unsigned int sta
int register_spi_programmer(const struct spi_programmer *programmer);
/* ichspi.c */
+#if CONFIG_INTERNAL == 1
enum ich_chipset {
CHIPSET_ICH_UNKNOWN,
CHIPSET_ICH7 = 7,
@@ -538,7 +539,6 @@ enum ich_chipset {
CHIPSET_7_SERIES_PANTHER_POINT
};
-#if CONFIG_INTERNAL == 1
extern uint32_t ichspi_bbar;
int ich_init_spi(struct pci_dev *dev, uint32_t base, void *rcrb,
enum ich_chipset ich_generation);
OpenPOWER on IntegriCloud