From: John Crispin <blogic@openwrt.org>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, Ralph Hempel <ralph.hempel@lantiq.com>,
David Woodhouse <dwmw2@infradead.org>,
linux-mtd@lists.infradead.org, John Crispin <blogic@openwrt.org>
Subject: [PATCH 07/10] MIPS: lantiq: add NOR flash CFI address swizzle
Date: Wed, 5 Jan 2011 20:56:16 +0100 [thread overview]
Message-ID: <1294257379-417-8-git-send-email-blogic@openwrt.org> (raw)
In-Reply-To: <1294257379-417-1-git-send-email-blogic@openwrt.org>
This patch adds the hack mentioned in the previous patch.
It is only a hack to make the map driver work until a better solution
is discussed.
Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Ralph Hempel <ralph.hempel@lantiq.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mips@linux-mips.org
Cc: linux-mtd@lists.infradead.org
---
drivers/mtd/chips/Kconfig | 9 +++++++++
drivers/mtd/chips/cfi_cmdset_0002.c | 8 ++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig
index 35c6a23..9ecb5eb 100644
--- a/drivers/mtd/chips/Kconfig
+++ b/drivers/mtd/chips/Kconfig
@@ -39,6 +39,15 @@ config MTD_CFI_ADV_OPTIONS
If unsure, say 'N'.
+config MTD_CFI_CMD_SWIZZLE
+ bool "Swizzle last bit of command address"
+ default y
+ depends on LANTIQ
+ help
+ lantiq SoCs share the external bus unit with the pci interface
+ for MTD to work at the the same time with PCI, we need to add
+ this quirk
+
choice
prompt "Flash cmd/query data swapping"
depends on MTD_CFI_ADV_OPTIONS
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 3b8e32d..e047af1 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -39,7 +39,12 @@
#include <linux/mtd/xip.h>
#define AMD_BOOTLOC_BUG
+
+#ifdef CONFIG_MTD_CFI_CMD_SWIZZLE
+#define FORCE_WORD_WRITE 1
+#else
#define FORCE_WORD_WRITE 0
+#endif
#define MAX_WORD_RETRIES 3
@@ -1140,6 +1145,9 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
int retry_cnt = 0;
adr += chip->start;
+#ifdef CONFIG_MTD_CFI_CMD_SWIZZLE
+ adr ^= 2;
+#endif
mutex_lock(&chip->mutex);
ret = get_chip(map, chip, adr, FL_WRITING);
--
1.7.2.3
next prev parent reply other threads:[~2011-01-05 20:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1294257379-417-1-git-send-email-blogic@openwrt.org>
2011-01-05 19:56 ` [PATCH 06/10] MIPS: lantiq: add NOR flash support John Crispin
2011-01-11 2:59 ` Daniel Schwierzeck
2011-01-11 10:29 ` John Crispin
2011-01-05 19:56 ` John Crispin [this message]
2011-01-06 10:06 ` [PATCH 07/10] MIPS: lantiq: add NOR flash CFI address swizzle John Crispin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1294257379-417-8-git-send-email-blogic@openwrt.org \
--to=blogic@openwrt.org \
--cc=dwmw2@infradead.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-mtd@lists.infradead.org \
--cc=ralf@linux-mips.org \
--cc=ralph.hempel@lantiq.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).