* [PATCH 5/5] arm: mach-mmp: brownstone.c support multiple sd slots
@ 2011-02-14 6:53 Philip Rakity
2011-02-14 14:10 ` Arnd Bergmann
0 siblings, 1 reply; 2+ messages in thread
From: Philip Rakity @ 2011-02-14 6:53 UTC (permalink / raw)
To: linux-arm-kernel@lists.infradead.org
Cc: linux-mmc@vger.kernel.org, Mark Brown, Chris Ball, Arnd Bergmann
Support multiple sd/eMMC interfaces. enable mmc1, 2, and 3.
mmc2 is used eMMC and slot is marked PERMANENT and 8 bit device.
mmc1 is used for Wifi and slot is marked PERMANENT
Note: eMMC (mmc2) is set to initialize first to workaround a problem
where booting in logical order requires mmc create work queue
to be multi-threaded otherwise boot process hangs. BUG report
send to linux-mmc and linux-kernel mailing list.
Signed-off-by: Philip Rakity <prakity@marvell.com>
---
arch/arm/mach-mmp/brownstone.c | 42 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c
index 7bb78fd..0e92fd7 100644
--- a/arch/arm/mach-mmp/brownstone.c
+++ b/arch/arm/mach-mmp/brownstone.c
@@ -19,6 +19,7 @@
#include <linux/regulator/max8649.h>
#include <linux/regulator/fixed.h>
#include <linux/mfd/max8925.h>
+#include <linux/delay.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -180,6 +181,45 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = {
.max_speed = 25000000,
};
+static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc1 = {
+ .flags = PXA_FLAG_CARD_PERMANENT,
+};
+
+static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = {
+ .flags = PXA_FLAG_CARD_PERMANENT |
+ PXA_FLAG_SD_8_BIT_CAPABLE_SLOT,
+};
+
+static void __init mmc_sdio_wifi(void)
+{
+ int poweron;
+ int reset;
+
+ poweron = mfp_to_gpio(GPIO57_GPIO);
+ reset = mfp_to_gpio(GPIO58_GPIO);
+
+ if(gpio_request(reset, "sd8xxx reset")) {
+ printk(KERN_INFO "gpio %d request failed\n", reset);
+ return;
+ }
+
+ if(gpio_request(poweron, "sd8xxx PDn")) {
+ gpio_free(reset);
+ printk(KERN_INFO "gpio %d request failed\n", poweron);
+ return;
+ }
+
+ gpio_direction_output(poweron, 1);
+ mdelay (20);
+ gpio_direction_output(reset, 0);
+ mdelay (20);
+ gpio_direction_output(reset, 1);
+ gpio_free(reset);
+ gpio_free(poweron);
+
+ mmp2_add_sdhost(1, &mmp2_sdh_platdata_mmc1); /* Wifi */
+}
+
static void __init brownstone_init(void)
{
mfp_config(ARRAY_AND_SIZE(brownstone_pin_config));
@@ -188,7 +228,9 @@ static void __init brownstone_init(void)
mmp2_add_uart(1);
mmp2_add_uart(3);
mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info));
+ mmp2_add_sdhost(2, &mmp2_sdh_platdata_mmc2); /* eMMC */
mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
+ mmc_sdio_wifi();
/* enable 5v regulator */
platform_device_register(&brownstone_v_5vp_device);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 5/5] arm: mach-mmp: brownstone.c support multiple sd slots
2011-02-14 6:53 [PATCH 5/5] arm: mach-mmp: brownstone.c support multiple sd slots Philip Rakity
@ 2011-02-14 14:10 ` Arnd Bergmann
0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2011-02-14 14:10 UTC (permalink / raw)
To: Philip Rakity
Cc: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org,
Mark Brown, Chris Ball
On Monday 14 February 2011, Philip Rakity wrote:
> +
> + gpio_direction_output(poweron, 1);
> + mdelay (20);
> + gpio_direction_output(reset, 0);
> + mdelay (20);
> + gpio_direction_output(reset, 1);
> + gpio_free(reset);
> + gpio_free(poweron);
mdelay is not nice, especially in boot code, because a lot of people
are interested in reducing boot times, and 40 miliseconds is definitely
in the range that people notice.
At the very least, change it from mdelay() to msleep(), to allow other
processes to continue.
Ideally, you can run the function in the background using schedule_work(),
but there may be better ways to do that for the entire platform code.
Arnd
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-14 14:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-14 6:53 [PATCH 5/5] arm: mach-mmp: brownstone.c support multiple sd slots Philip Rakity
2011-02-14 14:10 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox