Root/target/linux/brcm63xx/patches-3.3/439-MIPS-BCM63XX-wire-up-the-HS-SPI-controller-for-BCM63.patch

1From ed225910f0e062d9c28d5cf216f97b3cf457a8c5 Mon Sep 17 00:00:00 2001
2From: Jonas Gorski <jonas.gorski@gmail.com>
3Date: Mon, 21 Nov 2011 00:55:49 +0100
4Subject: [PATCH 58/81] MIPS: BCM63XX: wire up the HS SPI controller for BCM6362
5
6Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
7---
8 arch/mips/bcm63xx/clk.c | 2 ++
9 arch/mips/bcm63xx/dev-hsspi.c | 7 +++++--
10 .../include/asm/mach-bcm63xx/bcm63xx_dev_hsspi.h | 1 +
11 3 files changed, 8 insertions(+), 2 deletions(-)
12
13--- a/arch/mips/bcm63xx/clk.c
14+++ b/arch/mips/bcm63xx/clk.c
15@@ -218,6 +218,8 @@ static void hsspi_set(struct clk *clk, i
16 
17     if (BCMCPU_IS_6328())
18         mask = CKCTL_6328_HSSPI_EN;
19+ else if (BCMCPU_IS_6362())
20+ mask = CKCTL_6362_HSSPI_EN;
21     else
22         return;
23 
24--- a/arch/mips/bcm63xx/dev-hsspi.c
25+++ b/arch/mips/bcm63xx/dev-hsspi.c
26@@ -43,7 +43,7 @@ static struct platform_device bcm63xx_hs
27 int __init bcm63xx_hsspi_register(void)
28 {
29 
30- if (!BCMCPU_IS_6328())
31+ if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362())
32         return -ENODEV;
33 
34     spi_resources[0].start = bcm63xx_regset_address(RSET_HSSPI);
35@@ -51,7 +51,10 @@ int __init bcm63xx_hsspi_register(void)
36     spi_resources[0].end += RSET_HSSPI_SIZE - 1;
37     spi_resources[1].start = bcm63xx_get_irq_number(IRQ_HSSPI);
38 
39- spi_pdata.speed_hz = HSSPI_PLL_HZ_6328;
40+ if (BCMCPU_IS_6328())
41+ spi_pdata.speed_hz = HSSPI_PLL_HZ_6328;
42+ else
43+ spi_pdata.speed_hz = HSSPI_PLL_HZ;
44 
45     return platform_device_register(&bcm63xx_hsspi_device);
46 }
47--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_hsspi.h
48+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_hsspi.h
49@@ -16,6 +16,7 @@ struct bcm63xx_hsspi_pdata {
50 #define bcm_hsspi_writel(v, o) bcm_rset_writel(RSET_HSSPI, (v), (o))
51 
52 #define HSSPI_PLL_HZ_6328 133333333
53+#define HSSPI_PLL_HZ 400000000
54 
55 #define HSSPI_BUFFER_LEN 512
56 
57

Archive Download this file



interactive