From patchwork Mon Oct 11 17:22:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Rodriguez X-Patchwork-Id: 245861 Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9BHOUuG011080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 11 Oct 2010 17:24:56 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o9BHN1U0005073 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 11 Oct 2010 12:23:02 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id o9BHN1Dn028104; Mon, 11 Oct 2010 12:23:01 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 0526D80627; Mon, 11 Oct 2010 12:23:01 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 9A06080626 for ; Mon, 11 Oct 2010 12:22:59 -0500 (CDT) Received: from white.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id o9BHMxQv013617 for ; Mon, 11 Oct 2010 12:22:59 -0500 (CDT) Received: from psmtp.com (na3sys009amx215.postini.com [74.125.149.55]) by white.ext.ti.com (8.13.7/8.13.7) with SMTP id o9BHMw0v014798 for ; Mon, 11 Oct 2010 12:22:58 -0500 Received: from source ([209.85.213.45]) by na3sys009amx215.postini.com ([74.125.148.10]) with SMTP; Mon, 11 Oct 2010 10:22:58 PDT Received: by ywh1 with SMTP id 1so822873ywh.4 for ; Mon, 11 Oct 2010 10:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3/qoa2g3HrDk4v8+ujlYIuaSeLbWBGTh2F/9AmF1CPU=; b=wIGycKkuhpiI6+lqNXgelVPBQfJOnKV7hk67F3jNR4K27+QxsPSewYd9u7XcfajFTT roJZD4XU7sqHcsfugxV8Ijv3VaL01PM2U3jWJa8fm7M7IOOB9h33OvjPxBKiKzbnxmSy LUsV9Rvz//6KueLbPFq5e9laWHnDmAAZV5j4Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=fSjwb5opJ6u8VqaM+m43txockz+pKLHnkYN7XnpCvK9lOA/xNtFpx6dzZcqVX1YNsd FPeu+U9pC9mxU2PIte0tkC6dlmpOB5V5lAcsYlbLaWPp5qkEcK4DkllbBUKTpD0SH9ki 8b5RwHM68bK9C7y2LrhJOFNKLDObYn6h2D4PI= MIME-Version: 1.0 Received: by 10.42.210.13 with SMTP id gi13mr2295840icb.464.1286817777714; Mon, 11 Oct 2010 10:22:57 -0700 (PDT) Received: by 10.42.177.70 with HTTP; Mon, 11 Oct 2010 10:22:57 -0700 (PDT) In-Reply-To: References: <1286586765-1347-1-git-send-email-vm.rod25@gmail.com> <4CB0625D.4040507@mvista.com> Date: Mon, 11 Oct 2010 12:22:57 -0500 Message-ID: Subject: Re: [PATCH v1 5/6] davinci: MMC/SD support for Omapl138-Hawkboard From: Victor Rodriguez To: Sergei Shtylyov X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.0750) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: davinci-linux-open-source@linux.davincidsp.com X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 11 Oct 2010 17:24:56 +0000 (UTC) X-MIME-Autoconverted: from quoted-printable to 8bit by demeter1.kernel.org id o9BHOUuG011080 diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index f033a0a..7787f5a 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -548,6 +548,8 @@ static const struct mux_config da850_pins[] = { MUX_CFG(DA850, GPIO2_15, 5, 0, 15, 8, false) MUX_CFG(DA850, GPIO4_0, 10, 28, 15, 8, false) MUX_CFG(DA850, GPIO4_1, 10, 24, 15, 8, false) + MUX_CFG(DA850, GPIO3_12, 7, 12, 15, 8, false) + MUX_CFG(DA850, GPIO3_13, 7, 8, 15, 8, false) MUX_CFG(DA850, RTC_ALARM, 0, 28, 15, 2, false) #endif }; diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h index de11aac..e043f11 100644 --- a/arch/arm/mach-davinci/include/mach/mux.h +++ b/arch/arm/mach-davinci/include/mach/mux.h @@ -913,6 +913,8 @@ enum davinci_da850_index { DA850_GPIO2_15, DA850_GPIO4_0, DA850_GPIO4_1, + DA850_GPIO3_12, + DA850_GPIO3_13, DA850_RTC_ALARM, }; -- 1.6.0.5 And Subject: [PATCH v2] davinci: MMC/SD support for Omapl138-Hawkboar This patch adds MMC/SD support for the Hawkboard-L138 system It is under the machine name "omapl138_hawkboard". This system is based on the da850 davinci CPU architecture. Signed-off-by: Victor Rodriguez --- arch/arm/mach-davinci/board-omapl138-hawk.c | 50 +++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c index 182f097..8a9f9c0 100644 --- a/arch/arm/mach-davinci/board-omapl138-hawk.c +++ b/arch/arm/mach-davinci/board-omapl138-hawk.c @@ -23,6 +23,8 @@ #include #define DA850_EVM_PHY_ID "0:07" +#define DA850_HAWK_MMCSD_CD_PIN GPIO_TO_PIN(3, 12) +#define DA850_HAWK_MMCSD_WP_PIN GPIO_TO_PIN(3, 13) static short omapl138_hawk_mii_pins[] __initdata = { DA850_MII_TXEN, DA850_MII_TXCLK, DA850_MII_COL, DA850_MII_TXD_3, @@ -149,6 +151,32 @@ static struct snd_platform_data omapl138_hawk_snd_data = { .rxnumevt = 1, }; +static const short hawk_mmcsd0_pins[] = { + DA850_MMCSD0_DAT_0, DA850_MMCSD0_DAT_1, DA850_MMCSD0_DAT_2, + DA850_MMCSD0_DAT_3, DA850_MMCSD0_CLK, DA850_MMCSD0_CMD, + DA850_GPIO3_12, DA850_GPIO3_13, + -1 +}; + +static int da850_hawk_mmc_get_ro(int index) +{ + return gpio_get_value(DA850_HAWK_MMCSD_WP_PIN); +} + +static int da850_hawk_mmc_get_cd(int index) +{ + return !gpio_get_value(DA850_HAWK_MMCSD_CD_PIN); +} + +static struct davinci_mmc_config da850_mmc_config = { + .get_ro = da850_hawk_mmc_get_ro, + .get_cd = da850_hawk_mmc_get_cd, + .wires = 4, + .max_freq = 50000000, + .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, + .version = MMC_CTLR_VERSION_2, +}; + static struct davinci_uart_config omapl138_hawk_uart_config __initdata = { .enabled_uarts = 0x7, }; @@ -179,6 +207,28 @@ static __init void omapl138_hawk_init(void) pr_warning("%s: mcasp mux setup failed: %d\n", __func__, ret); da8xx_register_mcasp(0, &omapl138_hawk_snd_data); + ret = davinci_cfg_reg_list(hawk_mmcsd0_pins); + if (ret) + pr_warning("%s: MMC/SD0 mux setup failed: %d\n", + __func__, ret); + + ret = gpio_request(DA850_HAWK_MMCSD_CD_PIN, "MMC CD\n"); + if (ret) + pr_warning("%s: can not open GPIO %d\n", + __func__, DA850_HAWK_MMCSD_CD_PIN); + gpio_direction_input(DA850_HAWK_MMCSD_CD_PIN); + + ret = gpio_request(DA850_HAWK_MMCSD_WP_PIN, "MMC WP\n"); + if (ret) + pr_warning("%s: can not open GPIO %d\n", + __func__, DA850_HAWK_MMCSD_WP_PIN); + gpio_direction_input(DA850_HAWK_MMCSD_WP_PIN); + + ret = da8xx_register_mmcsd0(&da850_mmc_config); + if (ret) + pr_warning("%s: MMC/SD0 registration failed: %d\n", + __func__, ret); + ret = da8xx_register_watchdog(); if (ret) pr_warning("omapl138_hawk_init: "