diff options
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 45 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/db88f6281-bp-setup.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/include/mach/kirkwood.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/rd88f6281-setup.c | 13 | ||||
-rw-r--r-- | arch/arm/plat-orion/include/plat/mvsdio.h | 21 |
6 files changed, 98 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index b3404b7775b3..e5076aae1c6b 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <mach/kirkwood.h> | 24 | #include <mach/kirkwood.h> |
25 | #include <plat/cache-feroceon-l2.h> | 25 | #include <plat/cache-feroceon-l2.h> |
26 | #include <plat/ehci-orion.h> | 26 | #include <plat/ehci-orion.h> |
27 | #include <plat/mvsdio.h> | ||
27 | #include <plat/mv_xor.h> | 28 | #include <plat/mv_xor.h> |
28 | #include <plat/orion_nand.h> | 29 | #include <plat/orion_nand.h> |
29 | #include <plat/time.h> | 30 | #include <plat/time.h> |
@@ -296,6 +297,50 @@ void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data) | |||
296 | 297 | ||
297 | 298 | ||
298 | /***************************************************************************** | 299 | /***************************************************************************** |
300 | * SD/SDIO/MMC | ||
301 | ****************************************************************************/ | ||
302 | static struct resource mvsdio_resources[] = { | ||
303 | [0] = { | ||
304 | .start = SDIO_PHYS_BASE, | ||
305 | .end = SDIO_PHYS_BASE + SZ_1K - 1, | ||
306 | .flags = IORESOURCE_MEM, | ||
307 | }, | ||
308 | [1] = { | ||
309 | .start = IRQ_KIRKWOOD_SDIO, | ||
310 | .end = IRQ_KIRKWOOD_SDIO, | ||
311 | .flags = IORESOURCE_IRQ, | ||
312 | }, | ||
313 | }; | ||
314 | |||
315 | static u64 mvsdio_dmamask = 0xffffffffUL; | ||
316 | |||
317 | static struct platform_device kirkwood_sdio = { | ||
318 | .name = "mvsdio", | ||
319 | .id = -1, | ||
320 | .dev = { | ||
321 | .dma_mask = &mvsdio_dmamask, | ||
322 | .coherent_dma_mask = 0xffffffff, | ||
323 | }, | ||
324 | .num_resources = ARRAY_SIZE(mvsdio_resources), | ||
325 | .resource = mvsdio_resources, | ||
326 | }; | ||
327 | |||
328 | void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data) | ||
329 | { | ||
330 | u32 dev, rev; | ||
331 | |||
332 | kirkwood_pcie_id(&dev, &rev); | ||
333 | if (rev == 0) /* catch all Kirkwood Z0's */ | ||
334 | mvsdio_data->clock = 100000000; | ||
335 | else | ||
336 | mvsdio_data->clock = 200000000; | ||
337 | mvsdio_data->dram = &kirkwood_mbus_dram_info; | ||
338 | kirkwood_sdio.dev.platform_data = mvsdio_data; | ||
339 | platform_device_register(&kirkwood_sdio); | ||
340 | } | ||
341 | |||
342 | |||
343 | /***************************************************************************** | ||
299 | * SPI | 344 | * SPI |
300 | ****************************************************************************/ | 345 | ****************************************************************************/ |
301 | static struct orion_spi_info kirkwood_spi_plat_data = { | 346 | static struct orion_spi_info kirkwood_spi_plat_data = { |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index fe367c18e722..58279400cf7c 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -14,6 +14,7 @@ | |||
14 | struct dsa_platform_data; | 14 | struct dsa_platform_data; |
15 | struct mv643xx_eth_platform_data; | 15 | struct mv643xx_eth_platform_data; |
16 | struct mv_sata_platform_data; | 16 | struct mv_sata_platform_data; |
17 | struct mvsdio_platform_data; | ||
17 | 18 | ||
18 | /* | 19 | /* |
19 | * Basic Kirkwood init functions used early by machine-setup. | 20 | * Basic Kirkwood init functions used early by machine-setup. |
@@ -35,6 +36,7 @@ void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq); | |||
35 | void kirkwood_pcie_init(void); | 36 | void kirkwood_pcie_init(void); |
36 | void kirkwood_rtc_init(void); | 37 | void kirkwood_rtc_init(void); |
37 | void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); | 38 | void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); |
39 | void kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data); | ||
38 | void kirkwood_spi_init(void); | 40 | void kirkwood_spi_init(void); |
39 | void kirkwood_uart0_init(void); | 41 | void kirkwood_uart0_init(void); |
40 | void kirkwood_uart1_init(void); | 42 | void kirkwood_uart1_init(void); |
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c index a14c2948c62a..5c3b40d6e093 100644 --- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c +++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c | |||
@@ -22,7 +22,9 @@ | |||
22 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/pci.h> | 23 | #include <asm/mach/pci.h> |
24 | #include <mach/kirkwood.h> | 24 | #include <mach/kirkwood.h> |
25 | #include <plat/mvsdio.h> | ||
25 | #include "common.h" | 26 | #include "common.h" |
27 | #include "mpp.h" | ||
26 | 28 | ||
27 | static struct mv643xx_eth_platform_data db88f6281_ge00_data = { | 29 | static struct mv643xx_eth_platform_data db88f6281_ge00_data = { |
28 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | 30 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), |
@@ -32,18 +34,31 @@ static struct mv_sata_platform_data db88f6281_sata_data = { | |||
32 | .n_ports = 2, | 34 | .n_ports = 2, |
33 | }; | 35 | }; |
34 | 36 | ||
37 | static struct mvsdio_platform_data db88f6281_mvsdio_data = { | ||
38 | .gpio_write_protect = 37, | ||
39 | .gpio_card_detect = 38, | ||
40 | }; | ||
41 | |||
42 | static unsigned int db88f6281_mpp_config[] __initdata = { | ||
43 | MPP37_GPIO, | ||
44 | MPP38_GPIO, | ||
45 | 0 | ||
46 | }; | ||
47 | |||
35 | static void __init db88f6281_init(void) | 48 | static void __init db88f6281_init(void) |
36 | { | 49 | { |
37 | /* | 50 | /* |
38 | * Basic setup. Needs to be called early. | 51 | * Basic setup. Needs to be called early. |
39 | */ | 52 | */ |
40 | kirkwood_init(); | 53 | kirkwood_init(); |
54 | kirkwood_mpp_conf(db88f6281_mpp_config); | ||
41 | 55 | ||
42 | kirkwood_ehci_init(); | 56 | kirkwood_ehci_init(); |
43 | kirkwood_ge00_init(&db88f6281_ge00_data); | 57 | kirkwood_ge00_init(&db88f6281_ge00_data); |
44 | kirkwood_rtc_init(); | 58 | kirkwood_rtc_init(); |
45 | kirkwood_sata_init(&db88f6281_sata_data); | 59 | kirkwood_sata_init(&db88f6281_sata_data); |
46 | kirkwood_uart0_init(); | 60 | kirkwood_uart0_init(); |
61 | kirkwood_sdio_init(&db88f6281_mvsdio_data); | ||
47 | } | 62 | } |
48 | 63 | ||
49 | static int __init db88f6281_pci_init(void) | 64 | static int __init db88f6281_pci_init(void) |
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index ada480c0e197..d3db30fe763b 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h | |||
@@ -116,5 +116,7 @@ | |||
116 | 116 | ||
117 | #define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000) | 117 | #define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000) |
118 | 118 | ||
119 | #define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x90000) | ||
120 | |||
119 | 121 | ||
120 | #endif | 122 | #endif |
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c index a1ef8a91848e..a8b88a5570bd 100644 --- a/arch/arm/mach-kirkwood/rd88f6281-setup.c +++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c | |||
@@ -24,8 +24,10 @@ | |||
24 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
25 | #include <asm/mach/pci.h> | 25 | #include <asm/mach/pci.h> |
26 | #include <mach/kirkwood.h> | 26 | #include <mach/kirkwood.h> |
27 | #include <plat/mvsdio.h> | ||
27 | #include <plat/orion_nand.h> | 28 | #include <plat/orion_nand.h> |
28 | #include "common.h" | 29 | #include "common.h" |
30 | #include "mpp.h" | ||
29 | 31 | ||
30 | static struct mtd_partition rd88f6281_nand_parts[] = { | 32 | static struct mtd_partition rd88f6281_nand_parts[] = { |
31 | { | 33 | { |
@@ -91,6 +93,15 @@ static struct mv_sata_platform_data rd88f6281_sata_data = { | |||
91 | .n_ports = 2, | 93 | .n_ports = 2, |
92 | }; | 94 | }; |
93 | 95 | ||
96 | static struct mvsdio_platform_data rd88f6281_mvsdio_data = { | ||
97 | .gpio_card_detect = 28, | ||
98 | }; | ||
99 | |||
100 | static unsigned int rd88f6281_mpp_config[] __initdata = { | ||
101 | MPP28_GPIO, | ||
102 | 0 | ||
103 | }; | ||
104 | |||
94 | static void __init rd88f6281_init(void) | 105 | static void __init rd88f6281_init(void) |
95 | { | 106 | { |
96 | u32 dev, rev; | 107 | u32 dev, rev; |
@@ -99,6 +110,7 @@ static void __init rd88f6281_init(void) | |||
99 | * Basic setup. Needs to be called early. | 110 | * Basic setup. Needs to be called early. |
100 | */ | 111 | */ |
101 | kirkwood_init(); | 112 | kirkwood_init(); |
113 | kirkwood_mpp_conf(rd88f6281_mpp_config); | ||
102 | 114 | ||
103 | kirkwood_ehci_init(); | 115 | kirkwood_ehci_init(); |
104 | 116 | ||
@@ -114,6 +126,7 @@ static void __init rd88f6281_init(void) | |||
114 | 126 | ||
115 | kirkwood_rtc_init(); | 127 | kirkwood_rtc_init(); |
116 | kirkwood_sata_init(&rd88f6281_sata_data); | 128 | kirkwood_sata_init(&rd88f6281_sata_data); |
129 | kirkwood_sdio_init(&rd88f6281_mvsdio_data); | ||
117 | kirkwood_uart0_init(); | 130 | kirkwood_uart0_init(); |
118 | kirkwood_xor0_init(); | 131 | kirkwood_xor0_init(); |
119 | kirkwood_xor1_init(); | 132 | kirkwood_xor1_init(); |
diff --git a/arch/arm/plat-orion/include/plat/mvsdio.h b/arch/arm/plat-orion/include/plat/mvsdio.h new file mode 100644 index 000000000000..14ca88676002 --- /dev/null +++ b/arch/arm/plat-orion/include/plat/mvsdio.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-orion/include/plat/mvsdio.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __MACH_MVSDIO_H | ||
10 | #define __MACH_MVSDIO_H | ||
11 | |||
12 | #include <linux/mbus.h> | ||
13 | |||
14 | struct mvsdio_platform_data { | ||
15 | struct mbus_dram_target_info *dram; | ||
16 | unsigned int clock; | ||
17 | int gpio_card_detect; | ||
18 | int gpio_write_protect; | ||
19 | }; | ||
20 | |||
21 | #endif | ||