flashrom/flashrom-0010-Simplify-processor.h.patch
Peter Lemenkov 2aeb79237b svn ver. 1487
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2012-02-02 15:21:04 +04:00

63 lines
1.6 KiB
Diff

From eb00fe31da8571f16ae87f981a30fed1c89dc15a Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Thu, 28 Jul 2011 12:56:17 +0400
Subject: [PATCH 10/10] Simplify processor.h
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
processor_enable.c | 26 +++++++++-----------------
1 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/processor_enable.c b/processor_enable.c
index 014e019..bf69330 100644
--- a/processor_enable.c
+++ b/processor_enable.c
@@ -24,19 +24,6 @@
#include "flash.h"
#include "programmer.h"
-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__powerpc__)
-
-int processor_flash_enable(void)
-{
- /* On x86, flash access is not processor specific except on
- * AMD Elan SC520, AMD Geode and maybe other SoC-style CPUs.
- * FIXME: Move enable_flash_cs5536 and get_flashbase_sc520 here.
- */
- return 0;
-}
-
-#else
-
#if defined (__MIPSEL__) && defined (__linux)
#include <stdio.h>
#include <string.h>
@@ -83,15 +70,20 @@ static int is_loongson(void)
int processor_flash_enable(void)
{
+ int ret = 1;
/* FIXME: detect loongson on FreeBSD and OpenBSD as well. */
#if defined (__MIPSEL__) && defined (__linux)
if (is_loongson()) {
flashbase = 0x1fc00000;
- return 0;
+ ret = 0;
}
+#elif defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__powerpc__)
+ /* On x86, flash access is not processor specific except on
+ * AMD Elan SC520, AMD Geode and maybe other SoC-style CPUs.
+ * FIXME: Move enable_flash_cs5536 and get_flashbase_sc520 here.
+ */
+ ret = 0;
#endif
/* Not implemented yet. Oh well. */
- return 1;
+ return ret;
}
-
-#endif
--
1.7.7.5