summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/u-boot/u-boot-2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2012-05-18 19:39:18 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2012-05-21 13:15:17 -0300
commite55f64563a09cc9b9179c10d41e48495880fdb1a (patch)
treeb77cc8ed1d11d7f3bcd611c5c0d0350b4929aca9 /recipes-bsp/u-boot/u-boot-2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch
parentc6d3499849227666d149bcb607ead699b853b842 (diff)
downloadmeta-fsl-arm-e55f64563a09cc9b9179c10d41e48495880fdb1a.tar.gz
u-boot: add patches required for i.MX and i.MXS families
This adds the set of patches, that will be included in next u-boot release, on top of 2012.04.01 version. Those fix known issues with supported machines. The patches are managed on branch 'patches-2012.04.01' of https://github.com/Freescale/u-boot-imx repository. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-bsp/u-boot/u-boot-2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch')
-rw-r--r--recipes-bsp/u-boot/u-boot-2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch b/recipes-bsp/u-boot/u-boot-2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch
new file mode 100644
index 0000000..03a4fe9
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch
@@ -0,0 +1,57 @@
1From f61ed79b5e9e95a15a7fa1e2180dfe7d64cd2d17 Mon Sep 17 00:00:00 2001
2From: Fabio Estevam <fabio.estevam@freescale.com>
3Date: Mon, 23 Apr 2012 08:30:50 +0000
4Subject: [PATCH 41/56] spi: mxs: Allow other chip selects to work
5
6MXS SSP controller may have up to three chip selects per port: SS0, SS1 and SS2.
7
8Currently only SS0 is supported in the mxs_spi driver.
9
10Allow all the three chip select to work by selecting the desired one
11in bits 20 and 21 of the HW_SSP_CTRL0 register.
12
13Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
14Acked-by: Marek Vasut <marex@denx.de>
15---
16 drivers/spi/mxs_spi.c | 10 ++++++++++
17 1 file changed, 10 insertions(+)
18
19diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
20index e7237e7..7859536 100644
21--- a/drivers/spi/mxs_spi.c
22+++ b/drivers/spi/mxs_spi.c
23@@ -34,6 +34,8 @@
24
25 #define MXS_SPI_MAX_TIMEOUT 1000000
26 #define MXS_SPI_PORT_OFFSET 0x2000
27+#define MXS_SSP_CHIPSELECT_MASK 0x00300000
28+#define MXS_SSP_CHIPSELECT_SHIFT 20
29
30 struct mxs_spi_slave {
31 struct spi_slave slave;
32@@ -65,6 +67,8 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
33 {
34 struct mxs_spi_slave *mxs_slave;
35 uint32_t addr;
36+ struct mx28_ssp_regs *ssp_regs;
37+ int reg;
38
39 if (!spi_cs_is_valid(bus, cs)) {
40 printf("mxs_spi: invalid bus %d / chip select %d\n", bus, cs);
41@@ -82,7 +86,13 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
42 mxs_slave->max_khz = max_hz / 1000;
43 mxs_slave->mode = mode;
44 mxs_slave->regs = (struct mx28_ssp_regs *)addr;
45+ ssp_regs = mxs_slave->regs;
46
47+ reg = readl(&ssp_regs->hw_ssp_ctrl0);
48+ reg &= ~(MXS_SSP_CHIPSELECT_MASK);
49+ reg |= cs << MXS_SSP_CHIPSELECT_SHIFT;
50+
51+ writel(reg, &ssp_regs->hw_ssp_ctrl0);
52 return &mxs_slave->slave;
53 }
54
55--
561.7.10
57