From: Eric Nelson <eric.nelson@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V6 - Part 2 - 2/3] mx6q: Add support for ECSPI through mxc_spi driver
Date: Tue, 31 Jan 2012 10:52:04 -0700 [thread overview]
Message-ID: <1328032330-20883-4-git-send-email-eric.nelson@boundarydevices.com> (raw)
In-Reply-To: <1328032330-20883-1-git-send-email-eric.nelson@boundarydevices.com>
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
Acked-by: Stefano Babic <sbabic@denx.de>
---
arch/arm/include/asm/arch-mx6/imx-regs.h | 44 ++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h
index 29841dd..326f865 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -194,6 +194,50 @@ struct src {
u32 gpr10;
};
+/* ECSPI registers */
+struct cspi_regs {
+ u32 rxdata;
+ u32 txdata;
+ u32 ctrl;
+ u32 cfg;
+ u32 intr;
+ u32 dma;
+ u32 stat;
+ u32 period;
+};
+
+/*
+ * CSPI register definitions
+ */
+#define MXC_ECSPI
+#define MXC_CSPICTRL_EN (1 << 0)
+#define MXC_CSPICTRL_MODE (1 << 1)
+#define MXC_CSPICTRL_XCH (1 << 2)
+#define MXC_CSPICTRL_CHIPSELECT(x) (((x) & 0x3) << 12)
+#define MXC_CSPICTRL_BITCOUNT(x) (((x) & 0xfff) << 20)
+#define MXC_CSPICTRL_PREDIV(x) (((x) & 0xF) << 12)
+#define MXC_CSPICTRL_POSTDIV(x) (((x) & 0xF) << 8)
+#define MXC_CSPICTRL_SELCHAN(x) (((x) & 0x3) << 18)
+#define MXC_CSPICTRL_MAXBITS 0xfff
+#define MXC_CSPICTRL_TC (1 << 7)
+#define MXC_CSPICTRL_RXOVF (1 << 6)
+#define MXC_CSPIPERIOD_32KHZ (1 << 15)
+#define MAX_SPI_BYTES 32
+
+/* Bit position inside CTRL register to be associated with SS */
+#define MXC_CSPICTRL_CHAN 18
+
+/* Bit position inside CON register to be associated with SS */
+#define MXC_CSPICON_POL 4
+#define MXC_CSPICON_PHA 0
+#define MXC_CSPICON_SSPOL 12
+#define MXC_SPI_BASE_ADDRESSES \
+ ECSPI1_BASE_ADDR, \
+ ECSPI2_BASE_ADDR, \
+ ECSPI3_BASE_ADDR, \
+ ECSPI4_BASE_ADDR, \
+ ECSPI5_BASE_ADDR
+
struct iim_regs {
u32 ctrl;
u32 ctrl_set;
--
1.7.1
next prev parent reply other threads:[~2012-01-31 17:52 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 17:52 [U-Boot] [PATCH V6 - Part 1 - 1/1] mx6q: define GPIO macros for translating between ordinals and port:index Eric Nelson
2012-01-31 17:52 ` [U-Boot] [PATCH V6 - Part 2 - 0/3] mxc_spi refactoring (for mx6q and mx6qsabrelite) Eric Nelson
2012-01-31 17:52 ` [U-Boot] [PATCH V6 - Part 2 - 1/3] mxc_spi: move machine specifics into CPU headers Eric Nelson
2012-02-01 11:23 ` Jason Hui
2012-02-08 11:23 ` Stefano Babic
2012-01-31 17:52 ` Eric Nelson [this message]
2012-02-01 11:24 ` [U-Boot] [PATCH V6 - Part 2 - 2/3] mx6q: Add support for ECSPI through mxc_spi driver Jason Hui
2012-02-08 11:23 ` Stefano Babic
2012-01-31 17:52 ` [U-Boot] [PATCH V6 - Part 2 - 3/3] mx6q: mx6qsabrelite: Add ECSPI support to the Sabrelite platform Eric Nelson
2012-02-01 11:25 ` Jason Hui
2012-02-08 11:23 ` Stefano Babic
2012-01-31 17:52 ` [U-Boot] [PATCH V6 - Part 3 - 0/2] SPI flash enhancements: allow default bus and chip-selects Eric Nelson
2012-01-31 18:11 ` Mike Frysinger
2012-01-31 19:14 ` Eric Nelson
2012-02-01 11:30 ` Stefano Babic
2012-02-01 11:35 ` Dirk Behme
2012-02-01 17:00 ` Mike Frysinger
2012-02-01 19:31 ` Eric Nelson
2012-02-01 21:04 ` Mike Frysinger
2012-02-02 9:18 ` Stefano Babic
2012-02-02 14:56 ` Eric Nelson
2012-02-02 16:32 ` Mike Frysinger
2012-02-03 9:27 ` Stefano Babic
2012-02-09 6:40 ` Dirk Behme
2012-01-31 17:52 ` [U-Boot] [PATCH V6 - Part 3 - 1/2] sf command: allow default bus and chip selects Eric Nelson
2012-02-01 11:26 ` Jason Hui
2012-01-31 17:52 ` [U-Boot] [PATCH V6 - Part 2 - 2/2] README: Add description of SPI Flash (SF) command configuration Eric Nelson
2012-02-01 11:27 ` Jason Hui
2012-01-31 17:52 ` [U-Boot] [PATCH V6 - Part 4 - 1/1] mx6q: mx6qsabrelite: Provide default serial flash bus and chip-select Eric Nelson
2012-02-01 11:28 ` Jason Hui
2012-02-08 11:23 ` Stefano Babic
2012-01-31 17:52 ` [U-Boot] [PATCH V6 - Part 5 - 1/1] mx6q: mx6qsabrelite: Conditionally define macros for environment in serial flash Eric Nelson
2012-02-01 11:29 ` Jason Hui
2012-02-08 11:23 ` Stefano Babic
2012-02-08 11:23 ` [U-Boot] [PATCH V6 - Part 1 - 1/1] mx6q: define GPIO macros for translating between ordinals and port:index Stefano Babic
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=1328032330-20883-4-git-send-email-eric.nelson@boundarydevices.com \
--to=eric.nelson@boundarydevices.com \
--cc=u-boot@lists.denx.de \
/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