From patchwork Sat Sep 19 10:56:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 53952 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 8485D22A0D for ; Sat, 19 Sep 2015 11:01:54 +0000 (UTC) Received: by lanb10 with SMTP id b10sf27366663lan.3 for ; Sat, 19 Sep 2015 04:01:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=BRscKBBbIVFh39TUBEqqlAEy8S6MTrj+hQtaKx/j614=; b=AS5kPcd4sMtxJn59Yup8GXKMMzO2VM7vYSNV4/Q9LzP28gFN2+23km01W8VQlw0usr 470VSPoJb/LIqnkTK8kAIiQfpMFNiI2t2DkHsgk/jdSpiE927Ckafr4spewqkYX+yT/D FcImxw5/unDxY9xGX4rqill70UP1tg1Oyu7WlSPGmY57I6fRqHaH9BC2Bi/yikgF8/W1 11r4quF5i48HmGXH0I14nAehdfXy+uvYtC5k1c9R1SjRbsU7Du4IigcdTpyKIV3pxFqU 7oPg7uAByLthI8x36WYxvmxF1iyaCDgtAtowItAu95wHsFhd1uonpcadlz19TSCFStPB ru2g== X-Gm-Message-State: ALoCoQlJH3L8pFF6GMMbCXGth4jtNCrVIq6nGfODAD+SRtSCcW++9v+jlvXjWLJtkH9++e7iyuKq X-Received: by 10.112.170.67 with SMTP id ak3mr1663730lbc.6.1442660513503; Sat, 19 Sep 2015 04:01:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.134 with SMTP id s6ls136725las.58.gmail; Sat, 19 Sep 2015 04:01:53 -0700 (PDT) X-Received: by 10.25.156.130 with SMTP id f124mr399004lfe.46.1442660513391; Sat, 19 Sep 2015 04:01:53 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id kf2si9237124lbc.174.2015.09.19.04.01.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Sep 2015 04:01:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lanb10 with SMTP id b10so43445361lan.3 for ; Sat, 19 Sep 2015 04:01:53 -0700 (PDT) X-Received: by 10.152.161.232 with SMTP id xv8mr4880950lab.32.1442660513218; Sat, 19 Sep 2015 04:01:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp773448lbq; Sat, 19 Sep 2015 04:01:52 -0700 (PDT) X-Received: by 10.180.37.113 with SMTP id x17mr2613500wij.33.1442660512544; Sat, 19 Sep 2015 04:01:52 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id gz7si3621374wib.35.2015.09.19.04.01.52; Sat, 19 Sep 2015 04:01:52 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 103A0A74D7; Sat, 19 Sep 2015 13:01:04 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ihfxh2u__PkB; Sat, 19 Sep 2015 13:01:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C4961A7466; Sat, 19 Sep 2015 13:00:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D2E6DA748E for ; Sat, 19 Sep 2015 13:00:18 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q6mkzXFQRvoy for ; Sat, 19 Sep 2015 13:00:18 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by theia.denx.de (Postfix) with ESMTPS id 56E5EA7497 for ; Sat, 19 Sep 2015 12:59:57 +0200 (CEST) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8JAxtMS019080; Sat, 19 Sep 2015 05:59:55 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8JAxtVi004941; Sat, 19 Sep 2015 05:59:55 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Sat, 19 Sep 2015 05:59:55 -0500 Received: from a0131933.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8JAx7Q4003723; Sat, 19 Sep 2015 05:59:53 -0500 From: Lokesh Vutla To: , Date: Sat, 19 Sep 2015 16:26:53 +0530 Message-ID: <1442660216-5919-17-git-send-email-lokeshvutla@ti.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1442660216-5919-1-git-send-email-lokeshvutla@ti.com> References: <1442660216-5919-1-git-send-email-lokeshvutla@ti.com> MIME-Version: 1.0 Cc: nsekhar@ti.com, t-kristo@ti.com, Roger Quadros Subject: [U-Boot] [PATCH 16/19] ARM: k2g: add SD card and eMMC support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Roger Quadros Add MMC support for k2g Signed-off-by: Roger Quadros Signed-off-by: Lokesh Vutla Tested-by: Mugunthan V N --- arch/arm/mach-keystone/include/mach/mmc_host_def.h | 22 ++++++++++++++++++++++ board/ti/ks2_evm/board_k2g.c | 16 ++++++++++++++++ drivers/mmc/omap_hsmmc.c | 7 +++++-- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-keystone/include/mach/mmc_host_def.h diff --git a/arch/arm/mach-keystone/include/mach/mmc_host_def.h b/arch/arm/mach-keystone/include/mach/mmc_host_def.h new file mode 100644 index 0000000..a5050ac --- /dev/null +++ b/arch/arm/mach-keystone/include/mach/mmc_host_def.h @@ -0,0 +1,22 @@ +/* + * K2G: MMC + * + * (C) Copyright 2015 + * Texas Instruments Incorporated, + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef K2G_MMC_HOST_DEF_H +#define K2G_MMC_HOST_DEF_H + +#include + +/* + * OMAP HSMMC register definitions + */ + +#define OMAP_HSMMC1_BASE 0x23000100 +#define OMAP_HSMMC2_BASE 0x23100100 + +#endif /* K2G_MMC_HOST_DEF_H */ diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c index b2bc793..3e1dd4c 100644 --- a/board/ti/ks2_evm/board_k2g.c +++ b/board/ti/ks2_evm/board_k2g.c @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include "mux-k2g.h" #define SYS_CLK 24000000 @@ -58,6 +60,20 @@ s16 divn_val[16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; +#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC) +int board_mmc_init(bd_t *bis) +{ + if (psc_enable_module(KS2_LPSC_MMC)) { + printf("%s module enabled failed\n", __func__); + return -1; + } + + omap_mmc_init(0, 0, 0, -1, -1); + omap_mmc_init(1, 0, 0, -1, -1); + return 0; +} +#endif + #ifdef CONFIG_BOARD_EARLY_INIT_F int board_early_init_f(void) { diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index d7b388f..5b74a5a 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -31,10 +31,12 @@ #include #include #include -#include #include #include +#if !defined(CONFIG_SOC_KEYSTONE) +#include #include +#endif /* simplify defines to OMAP_HSMMC_USE_GPIO */ #if (defined(CONFIG_OMAP_GPIO) && !defined(CONFIG_SPL_BUILD)) || \ @@ -662,7 +664,8 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio, priv_data->base_addr = (struct hsmmc *)OMAP_HSMMC2_BASE; #if (defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX) || \ defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX) || \ - defined(CONFIG_AM43XX)) && defined(CONFIG_HSMMC2_8BIT) + defined(CONFIG_AM43XX) || defined(CONFIG_SOC_KEYSTONE)) && \ + defined(CONFIG_HSMMC2_8BIT) /* Enable 8-bit interface for eMMC on OMAP4/5 or DRA7XX */ host_caps_val |= MMC_MODE_8BIT; #endif