From patchwork Wed Apr 27 20:49:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 737651 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3RKqfB7018594 for ; Wed, 27 Apr 2011 20:53:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760007Ab1D0UxP (ORCPT ); Wed, 27 Apr 2011 16:53:15 -0400 Received: from na3sys009aog101.obsmtp.com ([74.125.149.67]:34496 "EHLO na3sys009aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756121Ab1D0UxN convert rfc822-to-8bit (ORCPT ); Wed, 27 Apr 2011 16:53:13 -0400 Received: from sc-owa02.marvell.com ([65.219.4.130]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKTbiCMAJt7i2LScUQ4Am6RNnL6dT0brFT@postini.com; Wed, 27 Apr 2011 13:53:12 PDT Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by sc-owa02.marvell.com ([10.93.76.22]) with mapi; Wed, 27 Apr 2011 13:49:46 -0700 From: Philip Rakity To: Russell King - ARM Linux CC: "linux-arm-kernel@lists.infradead.org" , "linux-mmc@vger.kernel.org" , Chris Ball , Zhangfei Gao Date: Wed, 27 Apr 2011 13:49:45 -0700 Subject: Re: [PATCH] plat-pxa: Enable ability to adjust SD/MMC clocks Thread-Topic: [PATCH] plat-pxa: Enable ability to adjust SD/MMC clocks Thread-Index: AcwFHKSBpYhVD/OLQ868rWD/IVZKOA== Message-ID: <1F336A22-BAC3-41E3-8D4E-5DF27874D1EA@marvell.com> References: <59C2B513-EC04-4CA2-818B-9901CAF3E554@marvell.com> <20110427093328.GU17290@n2100.arm.linux.org.uk> <161C3F6C-0986-4364-B458-DBA4D08456FD@marvell.com> In-Reply-To: <161C3F6C-0986-4364-B458-DBA4D08456FD@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Apr 2011 20:53:16 +0000 (UTC) The patches were submitted a while ago. Enclosed. From dc965baa7f96b347178c9e5e7f2426a03475f1e5 Mon Sep 17 00:00:00 2001 From: Philip Rakity Date: Mon, 7 Feb 2011 11:49:53 -0800 Subject: [PATCH 12/12] arm: mach-mmp: brownstone.c support multiple sd slots 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. Wifi (mmc1) requires we enable power on the device by toggling the gpio lines for power and reset. Signed-off-by: Philip Rakity --- 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..36d5b82 100644 --- a/arch/arm/mach-mmp/brownstone.c +++ b/arch/arm/mach-mmp/brownstone.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -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); + msleep (1); + gpio_direction_output(reset, 0); + msleep (1); + 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 From 6081a571dede58782688bf908ecc16b410536a63 Mon Sep 17 00:00:00 2001 From: Philip Rakity Date: Mon, 20 Dec 2010 14:42:22 -0800 Subject: [PATCH] mach-mmp: Support for SD/MMC clock adjustment in brownstone Set timing for brownstone for SD/MMC cards to enable detection timing adjustments are needed when speed > 25MHz remove limitation on maximum speed of 25MHz Signed-off-by: Philip Rakity --- arch/arm/mach-mmp/brownstone.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c index 36d5b82..55e891a 100644 --- a/arch/arm/mach-mmp/brownstone.c +++ b/arch/arm/mach-mmp/brownstone.c @@ -178,14 +178,22 @@ static struct i2c_board_info brownstone_twsi1_info[] = { }; static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { - .max_speed = 25000000, + .adjust_clocks = 1, + .clk_select = 1, + .clk_delay = 31, }; static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc1 = { + .adjust_clocks = 1, + .clk_select = 1, + .clk_delay = 15, .flags = PXA_FLAG_CARD_PERMANENT, }; static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { + .adjust_clocks = 1, + .clk_select = 1, + .clk_delay = 31, .flags = PXA_FLAG_CARD_PERMANENT | PXA_FLAG_SD_8_BIT_CAPABLE_SLOT, };