diff options
Diffstat (limited to 'recipes-bsp/u-boot/u-boot-v2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch')
-rw-r--r-- | recipes-bsp/u-boot/u-boot-v2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/recipes-bsp/u-boot/u-boot-v2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch b/recipes-bsp/u-boot/u-boot-v2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch deleted file mode 100644 index 03a4fe9..0000000 --- a/recipes-bsp/u-boot/u-boot-v2012.04.01/0041-spi-mxs-Allow-other-chip-selects-to-work.patch +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
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 | |||