linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bastian Hecht <hechtb@googlemail.com>
To: linux-sh@vger.kernel.org, linux-mtd@lists.infradead.org
Cc: Magnus Damm <magnus.damm@gmail.com>,
	Laurent Pichart <laurent.pinchart@ideasonboard.com>
Subject: [PATCH v2 1/7] mtd: sh_flctl: Expand FLCMNCR register bit field
Date: Sat, 11 Feb 2012 11:44:59 +0000	[thread overview]
Message-ID: <1328960705-18699-2-git-send-email-hechtb@gmail.com> (raw)
In-Reply-To: <1328960705-18699-1-git-send-email-hechtb@gmail.com>

Add support for a new hardware generation. The meaning of some bits
of the FLCMNCR register changed, so some new defines are added
parallel to the existing ones to keep backward compatibility.

The defines allow to choose an appropriate clocking scheme.

Signed-off-by: Bastian Hecht <hechtb@gmail.com>
---
changelog: code stays the same, just the description is slightly corrected.

 include/linux/mtd/sh_flctl.h |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h
index 9cf4c4c..e66c393 100644
--- a/include/linux/mtd/sh_flctl.h
+++ b/include/linux/mtd/sh_flctl.h
@@ -67,6 +67,30 @@
 #define	CE0_ENABLE	(0x1 << 3)	/* Chip Enable 0 */
 #define	TYPESEL_SET	(0x1 << 0)
 
+/*
+ * Clock settings using the PULSEx registers from FLCMNCR
+ *
+ * Some hardware uses bits called PULSEx instead of FCKSEL_E and QTSEL_E
+ * to control the clock divider used between the High-Speed Peripheral Clock
+ * and the FLCTL internal clock. If so, use CLK_8_BIT_xxx for connecting 8 bit
+ * and CLK_16_BIT_xxx for connecting 16 bit bus bandwith NAND chips. For the 16
+ * bit version the divider is seperate for the pulse width of high and low
+ * signals.
+ */
+#define PULSE3	(0x1 << 27)
+#define PULSE2	(0x1 << 17)
+#define PULSE1	(0x1 << 15)
+#define PULSE0	(0x1 << 9)
+#define CLK_8_BIT_0_5HP			PULSE1
+#define CLK_8_BIT_1HP			0x0
+#define CLK_8_BIT_1_5HP			(PULSE1 | PULSE2)
+#define CLK_8_BIT_2HP			PULSE0
+#define CLK_8_BIT_3HP			(PULSE0 | PULSE1 | PULSE2)
+#define CLK_8_BIT_4HP			(PULSE0 | PULSE2)
+#define CLK_16_BIT_6HP_LOW_2HP_HIGH	PULSE0
+#define CLK_16_BIT_9HP_LOW_3HP_HIGH	(PULSE0 | PULSE1 | PULSE2)
+#define CLK_16_BIT_12HP_LOW_4HP_HIGH	(PULSE0 | PULSE2)
+
 /* FLCMDCR control bits */
 #define ADRCNT2_E	(0x1 << 31)	/* 5byte address enable */
 #define ADRMD_E		(0x1 << 26)	/* Sector address access */
-- 
1.7.5.4


  reply	other threads:[~2012-02-11 11:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-11 11:44 [PATCH v2 0/7] SH Mobile sh_flctl driver brush up Bastian Hecht
2012-02-11 11:44 ` Bastian Hecht [this message]
2012-02-18  2:22   ` [PATCH v2 1/7] mtd: sh_flctl: Expand FLCMNCR register bit field Laurent Pinchart
2012-02-19 10:34     ` Bastian Hecht
2012-02-11 11:45 ` [PATCH v2 2/7] mtd: sh_flctl: Reorder empty_fifo() calls Bastian Hecht
2012-02-18  2:21   ` Laurent Pinchart
2012-02-11 11:45 ` [PATCH v2 3/7] mtd: sh_flctl: Expand the READID command to 8 bytes Bastian Hecht
2012-02-18  2:20   ` Laurent Pinchart
2012-02-19 10:46     ` Bastian Hecht
2012-02-11 11:45 ` [PATCH v2 4/7] mtd: sh_flctl: Implement NAND_CMD_RNDOUT command Bastian Hecht
2012-02-11 11:45 ` [PATCH v2 5/7] mtd: sh_flctl: Use cached register value for FLCMNCR Bastian Hecht
2012-02-18  2:18   ` Laurent Pinchart
2012-02-19 10:48     ` Bastian Hecht
2012-02-11 11:45 ` [PATCH v2 6/7] mtd: sh_flctl: Add FLHOLDCR register Bastian Hecht
2012-02-18  0:25   ` Laurent Pinchart
2012-02-19 11:04     ` Bastian Hecht
2012-02-11 11:45 ` [PATCH v2 7/7] ARM: mach-shmobile: mackerel: Add the flash controller flctl Bastian Hecht
2012-02-13 13:41 ` [PATCH v2 0/7] SH Mobile sh_flctl driver brush up Artem Bityutskiy
2012-02-14  3:38   ` Simon Horman
2012-02-14 10:58     ` Bastian Hecht
2012-03-09 12:11       ` Artem Bityutskiy
2012-03-09 12:14         ` Laurent Pinchart
2012-03-09 12:37           ` Artem Bityutskiy
2012-03-09 12:42             ` Laurent Pinchart
2012-03-09 13:22             ` Magnus Damm

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=1328960705-18699-2-git-send-email-hechtb@gmail.com \
    --to=hechtb@googlemail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.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).