27a411de39bb7f81a1208ec2c140e194bfdb3f48
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.9 / 026-MIPS-BCM63XX-enable-SPI-controller-for-BCM6362.patch
1 From 5da349ee614f61a2e6edb403098f40c6d40f2553 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Thu, 5 Jul 2012 21:19:20 +0200
4 Subject: [PATCH 5/7] MIPS: BCM63XX: enable SPI controller for BCM6362
5
6 The SPI controller shares the same register layout as the 6358 one.
7
8 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
9 ---
10 arch/mips/bcm63xx/clk.c | 2 ++
11 arch/mips/bcm63xx/dev-spi.c | 4 ++--
12 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h | 3 ++-
13 3 files changed, 6 insertions(+), 3 deletions(-)
14
15 --- a/arch/mips/bcm63xx/clk.c
16 +++ b/arch/mips/bcm63xx/clk.c
17 @@ -202,6 +202,8 @@ static void spi_set(struct clk *clk, int
18 mask = CKCTL_6348_SPI_EN;
19 else if (BCMCPU_IS_6358())
20 mask = CKCTL_6358_SPI_EN;
21 + else if (BCMCPU_IS_6362())
22 + mask = CKCTL_6362_SPI_EN;
23 else
24 /* BCMCPU_IS_6368 */
25 mask = CKCTL_6368_SPI_EN;
26 --- a/arch/mips/bcm63xx/dev-spi.c
27 +++ b/arch/mips/bcm63xx/dev-spi.c
28 @@ -37,7 +37,7 @@ static __init void bcm63xx_spi_regs_init
29 {
30 if (BCMCPU_IS_6338() || BCMCPU_IS_6348())
31 bcm63xx_regs_spi = bcm6348_regs_spi;
32 - if (BCMCPU_IS_6358() || BCMCPU_IS_6368())
33 + if (BCMCPU_IS_6358() || BCMCPU_IS_6362() || BCMCPU_IS_6368())
34 bcm63xx_regs_spi = bcm6358_regs_spi;
35 }
36 #else
37 @@ -87,7 +87,7 @@ int __init bcm63xx_spi_register(void)
38 spi_pdata.msg_ctl_width = SPI_6348_MSG_CTL_WIDTH;
39 }
40
41 - if (BCMCPU_IS_6358() || BCMCPU_IS_6368()) {
42 + if (BCMCPU_IS_6358() || BCMCPU_IS_6362() || BCMCPU_IS_6368()) {
43 spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1;
44 spi_pdata.fifo_size = SPI_6358_MSG_DATA_SIZE;
45 spi_pdata.msg_type_shift = SPI_6358_MSG_TYPE_SHIFT;
46 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
47 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
48 @@ -74,7 +74,8 @@ static inline unsigned long bcm63xx_spir
49 #if defined(CONFIG_BCM63XX_CPU_6338) || defined(CONFIG_BCM63XX_CPU_6348)
50 __GEN_SPI_RSET(6348)
51 #endif
52 -#if defined(CONFIG_BCM63XX_CPU_6358) || defined(CONFIG_BCM63XX_CPU_6368)
53 +#if defined(CONFIG_BCM63XX_CPU_6358) || defined(CONFIG_BCM63XX_CPU_6362) || \
54 + defined(CONFIG_BCM63XX_CPU_6368)
55 __GEN_SPI_RSET(6358)
56 #endif
57 #endif