diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2012-05-18 19:39:18 -0300 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2012-05-21 13:15:17 -0300 |
commit | e55f64563a09cc9b9179c10d41e48495880fdb1a (patch) | |
tree | b77cc8ed1d11d7f3bcd611c5c0d0350b4929aca9 /recipes-bsp/u-boot/u-boot-2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch | |
parent | c6d3499849227666d149bcb607ead699b853b842 (diff) | |
download | meta-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.patch | 57 |
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 @@ | |||
1 | From f61ed79b5e9e95a15a7fa1e2180dfe7d64cd2d17 Mon Sep 17 00:00:00 2001 | ||
2 | From: Fabio Estevam <fabio.estevam@freescale.com> | ||
3 | Date: Mon, 23 Apr 2012 08:30:50 +0000 | ||
4 | Subject: [PATCH 41/56] spi: mxs: Allow other chip selects to work | ||
5 | |||
6 | MXS SSP controller may have up to three chip selects per port: SS0, SS1 and SS2. | ||
7 | |||
8 | Currently only SS0 is supported in the mxs_spi driver. | ||
9 | |||
10 | Allow all the three chip select to work by selecting the desired one | ||
11 | in bits 20 and 21 of the HW_SSP_CTRL0 register. | ||
12 | |||
13 | Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> | ||
14 | Acked-by: Marek Vasut <marex@denx.de> | ||
15 | --- | ||
16 | drivers/spi/mxs_spi.c | 10 ++++++++++ | ||
17 | 1 file changed, 10 insertions(+) | ||
18 | |||
19 | diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c | ||
20 | index 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 | -- | ||
56 | 1.7.10 | ||
57 | |||