diff options
author | Colin Tuckley <colin.tuckley@arm.com> | 2009-03-10 10:23:54 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-03-10 10:23:54 +0000 |
commit | 109ed4c153b47dc3f67dba394a823774b61fb7fa (patch) | |
tree | c7469d8cd8f80e4f21b662dc28bfe33b24a726c4 /arch/arm/mach-realview | |
parent | 805b71e6e9155f2f6b10ce9fa085d1f8f6683f9e (diff) |
RealView: Fix SD/MMC card detection on RealView PB1176
The RealView PB1176 has to use GPIO for detecting the SD/MMC card
change.
Signed-off-by: Colin Tuckley <colin.tuckley@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/mach-realview')
-rw-r--r-- | arch/arm/mach-realview/core.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pb1176.c | 6 |
2 files changed, 22 insertions, 6 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 4dc66a502ab0..3668c32931bf 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c @@ -176,19 +176,29 @@ static int __init realview_i2c_init(void) } arch_initcall(realview_i2c_init); -#define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET) - +/* + * All boards except RealView/PB1176 use MCI for the MMC/SD card detect. + * PB1176 has to use GPIO. + */ static unsigned int realview_mmc_status(struct device *dev) { struct amba_device *adev = container_of(dev, struct amba_device, dev); u32 mask; + void __iomem *mmc_detect; - if (adev->res.start == REALVIEW_MMCI0_BASE) + if (machine_is_realview_pb1176()) { + mmc_detect = __io_address(REALVIEW_GPIO2_BASE + 0x04); mask = 1; - else - mask = 2; + } else { + mmc_detect =__io_address(REALVIEW_SYS_BASE) + + REALVIEW_SYS_MCI_OFFSET; + if (adev->res.start == REALVIEW_MMCI0_BASE) + mask = 1; + else + mask = 2; + } - return readl(REALVIEW_SYSMCI) & mask; + return readl(mmc_detect) & mask; } struct mmc_platform_data realview_mmc0_plat_data = { diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index 29bde0b670b5..751d4689405f 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c @@ -91,6 +91,12 @@ static struct map_desc realview_pb1176_io_desc[] __initdata = { .pfn = __phys_to_pfn(REALVIEW_PB1176_L220_BASE), .length = SZ_8K, .type = MT_DEVICE, + }, { + /* needed for SD/MMC detection */ + .virtual = IO_ADDRESS(REALVIEW_GPIO2_BASE), + .pfn = __phys_to_pfn(REALVIEW_GPIO2_BASE), + .length = SZ_4K, + .type = MT_DEVICE, }, #ifdef CONFIG_DEBUG_LL { |