[flashrom] [PATCH 2/3] Add support for SPARC (maybe).

Stefan Tauner stefan.tauner at alumni.tuwien.ac.at
Mon Jan 19 21:39:35 CET 2015


Does (cross-)compile but is not run-tested.

Signed-off-by: Stefan Tauner <stefan.tauner at alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner at alumni.tuwien.ac.at>
---
 Makefile   | 2 +-
 hwaccess.h | 8 ++++++++
 platform.h | 5 ++++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index b738e73..54ebfe4 100644
--- a/Makefile
+++ b/Makefile
@@ -320,7 +320,7 @@ endif
 # below uses CC itself.
 override ARCH := $(strip $(shell LC_ALL=C $(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
 
-# PCI port I/O support is unimplemented on PPC/MIPS and unavailable on ARM.
+# PCI port I/O support is unimplemented on PPC/MIPS/SPARC and unavailable on ARM.
 # Right now this means the drivers below only work on x86.
 ifneq ($(ARCH), x86)
 ifeq ($(CONFIG_NIC3COM), yes)
diff --git a/hwaccess.h b/hwaccess.h
index a4fd502..5378361 100644
--- a/hwaccess.h
+++ b/hwaccess.h
@@ -89,6 +89,10 @@
 #define __FLASHROM_LITTLE_ENDIAN__ 1
 #endif
 
+#elif IS_SPARC
+/* SPARC is big endian in general (but allows to access data in little endian too). */
+#define __FLASHROM_BIG_ENDIAN__ 1
+
 #endif /* IS_? */
 
 #if !defined (__FLASHROM_BIG_ENDIAN__) && !defined (__FLASHROM_LITTLE_ENDIAN__)
@@ -357,6 +361,10 @@ int libpayload_wrmsr(int addr, msr_t msr);
 
 /* PCI port I/O is not yet implemented on MIPS. */
 
+#elif IS_SPARC
+
+/* PCI port I/O is not yet implemented on SPARC. */
+
 #elif IS_ARM
 
 /* Non memory mapped I/O is not supported on ARM. */
diff --git a/platform.h b/platform.h
index f57fd12..9cde054 100644
--- a/platform.h
+++ b/platform.h
@@ -45,9 +45,12 @@
       defined(__aarch64__)
 	#define __FLASHROM_ARCH__ "arm"
 	#define IS_ARM 1
+#elif defined (__sparc__) || defined (__sparc)
+	#define __FLASHROM_ARCH__ "sparc"
+	#define IS_SPARC 1
 #endif
 
-#if !(IS_X86 || IS_MIPS || IS_PPC || IS_ARM)
+#if !(IS_X86 || IS_MIPS || IS_PPC || IS_ARM || IS_SPARC)
 #error Unknown architecture
 #endif
 
-- 
Kind regards, Stefan Tauner





More information about the flashrom mailing list