diff options
Diffstat (limited to 'arch/arm/mach-kirkwood/common.c')
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 56 |
1 files changed, 53 insertions, 3 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index b3404b7775b3..9f012551794d 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c @@ -24,6 +24,7 @@ #include <mach/kirkwood.h> #include <plat/cache-feroceon-l2.h> #include <plat/ehci-orion.h> +#include <plat/mvsdio.h> #include <plat/mv_xor.h> #include <plat/orion_nand.h> #include <plat/time.h> @@ -254,7 +255,7 @@ static struct resource kirkwood_rtc_resource = { .flags = IORESOURCE_MEM, }; -void __init kirkwood_rtc_init(void) +static void __init kirkwood_rtc_init(void) { platform_device_register_simple("rtc-mv", -1, &kirkwood_rtc_resource, 1); } @@ -296,6 +297,50 @@ void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data) /***************************************************************************** + * SD/SDIO/MMC + ****************************************************************************/ +static struct resource mvsdio_resources[] = { + [0] = { + .start = SDIO_PHYS_BASE, + .end = SDIO_PHYS_BASE + SZ_1K - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_KIRKWOOD_SDIO, + .end = IRQ_KIRKWOOD_SDIO, + .flags = IORESOURCE_IRQ, + }, +}; + +static u64 mvsdio_dmamask = 0xffffffffUL; + +static struct platform_device kirkwood_sdio = { + .name = "mvsdio", + .id = -1, + .dev = { + .dma_mask = &mvsdio_dmamask, + .coherent_dma_mask = 0xffffffff, + }, + .num_resources = ARRAY_SIZE(mvsdio_resources), + .resource = mvsdio_resources, +}; + +void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data) +{ + u32 dev, rev; + + kirkwood_pcie_id(&dev, &rev); + if (rev == 0) /* catch all Kirkwood Z0's */ + mvsdio_data->clock = 100000000; + else + mvsdio_data->clock = 200000000; + mvsdio_data->dram = &kirkwood_mbus_dram_info; + kirkwood_sdio.dev.platform_data = mvsdio_data; + platform_device_register(&kirkwood_sdio); +} + + +/***************************************************************************** * SPI ****************************************************************************/ static struct orion_spi_info kirkwood_spi_plat_data = { @@ -502,7 +547,7 @@ static struct platform_device kirkwood_xor01_channel = { }, }; -void __init kirkwood_xor0_init(void) +static void __init kirkwood_xor0_init(void) { platform_device_register(&kirkwood_xor0_shared); @@ -600,7 +645,7 @@ static struct platform_device kirkwood_xor11_channel = { }, }; -void __init kirkwood_xor1_init(void) +static void __init kirkwood_xor1_init(void) { platform_device_register(&kirkwood_xor1_shared); @@ -708,4 +753,9 @@ void __init kirkwood_init(void) #ifdef CONFIG_CACHE_FEROCEON_L2 kirkwood_l2_init(); #endif + + /* internal devices that every board has */ + kirkwood_rtc_init(); + kirkwood_xor0_init(); + kirkwood_xor1_init(); } |