flashrom/flashrom-0009-Simplify-processor.h.patch
Peter Lemenkov f918b18a61 Enable support for USB programmers (FT2232, FT4232, etc), see rhbz #839179
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2012-07-11 13:19:08 +04:00

63 lines
1.6 KiB
Diff

From fd1fe86bcffcf1ac3571d2c98e4d5e91321a40cf Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Thu, 28 Jul 2011 12:56:17 +0400
Subject: [PATCH 9/9] Simplify processor.h
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
processor_enable.c | 26 +++++++++-----------------
1 file 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.10.4