From patchwork Thu Sep 21 15:22:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 113275 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2159600qgf; Thu, 21 Sep 2017 08:27:33 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCahByUd1BdJXvYhZZSQqJbKuEqzrufUatXWkAsQuMotqs7eC8mCE7f34JpkhToqYPurQOI X-Received: by 10.80.146.115 with SMTP id j48mr1541790eda.132.1506007652951; Thu, 21 Sep 2017 08:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506007652; cv=none; d=google.com; s=arc-20160816; b=L3ZFXo5Ozx9I4jV90AzB8ViwqRZm8OuKGVijLzaQn1NJjnF9c1sQAwt30juK3ZTi7M buLDjuACvvh3frqlWlI3B39zWJPa6dGs2sMHXA0nXuugh7qpvGEC00c+tUPDVAgoFIOq rsSIwhEf6mGbhuSkzI6v4gJ44HGiExy5EaAzwjT4qEeOoihprLWNdVrDDGCt1xzdDPvj Wyfq92PdAzuO5d/TjJfv6LK0X2HK06+np9aM1ZXpw/A6fMe6fwke9kQU2fMdtN4U/hG+ g8DJrpS/5TE5rOdPqEXnFXQDfA+AaHLzdQahvLw40ego/wiAGSLbX59R+STYaSggaIBX wlKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=moOut4gYcdeRrZI7IatWnqBx7UpIPxmlXUsnCZT1+Z4=; b=PvFXEyyg+gzxk4S2hni2PqNL+EWQfxoojKuvw7ybydYLMh5BGVr3eRIxVfARCeC85z 9s5fYpNYmFaH3uT1hYiLGlxEfljQoD8jYbdCWNStqK2lrfgP8Vu8bm5szS7i9TlSkUiF jU5VKwy8fVqW+LN5SYFYkYP+8vtoUStCduzJKooGgcAM/GMFf+2bwCFIT0NDUjn2EEMt EXYAApY9o54IvQ3xnECK/Crp9WpBwd8iNU6gI1o7iTSLL0e0ggCMSJC5VO8XpQkQ3ezV g+jBhEAjV+KMo0U+QJpZBRWejNpjuxtkOGhwpOkqyI5rj3iHeoRa/SieP8Gdy+YBkJ6o B5kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=qb9hZQH7; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id y59si1677152eda.212.2017.09.21.08.27.32; Thu, 21 Sep 2017 08:27:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=qb9hZQH7; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: by lists.denx.de (Postfix, from userid 105) id 79F8AC21EAB; Thu, 21 Sep 2017 15:25:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 131DCC22056; Thu, 21 Sep 2017 15:23:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 43915C22040; Thu, 21 Sep 2017 15:22:52 +0000 (UTC) Received: from lelnx194.ext.ti.com (lelnx194.ext.ti.com [198.47.27.80]) by lists.denx.de (Postfix) with ESMTPS id A6D74C21FED for ; Thu, 21 Sep 2017 15:22:48 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id v8LFMk9n013915; Thu, 21 Sep 2017 10:22:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1506007366; bh=5v5c15tPRrU81oWyaSXPjtcgCPbqr+t3OGMnNmK3mNw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qb9hZQH7fx0Q/zi9lditwriB1ZU1rHwAU8l49UKXgOsKQ7qy1xmZ6AobAQjH7ZeaS EKmo9Z5P2SSWMqitOmHsWTnegKwYRNQsbWB7afYrtpYNArkyNDEW+EdcmPm50lEYZh 5TN3Jq4W3mWK4BTy404QHHhWclr4Y4prv5Vd2SA4= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8LFMkCw009379; Thu, 21 Sep 2017 10:22:46 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Thu, 21 Sep 2017 10:22:46 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Thu, 21 Sep 2017 10:22:45 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8LFMjuG014761; Thu, 21 Sep 2017 10:22:45 -0500 From: Jean-Jacques Hiblot To: , , , , Date: Thu, 21 Sep 2017 17:22:08 +0200 Message-ID: <1506007346-10037-6-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506007346-10037-1-git-send-email-jjhiblot@ti.com> References: <1506007346-10037-1-git-send-email-jjhiblot@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 05/23] mmc: omap_hsmmc: Enable DDR mode support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Kishon Vijay Abraham I In order to enable DDR mode, Dual Data Rate mode bit has to be set in MMCHS_CON register. Set it here. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Jean-Jacques Hiblot --- arch/arm/include/asm/omap_mmc.h | 1 + drivers/mmc/omap_hsmmc.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/arch/arm/include/asm/omap_mmc.h b/arch/arm/include/asm/omap_mmc.h index 3f94f2e..341a2e2 100644 --- a/arch/arm/include/asm/omap_mmc.h +++ b/arch/arm/include/asm/omap_mmc.h @@ -89,6 +89,7 @@ struct omap_hsmmc_plat { #define WPP_ACTIVEHIGH (0x0 << 8) #define RESERVED_MASK (0x3 << 9) #define CTPL_MMC_SD (0x0 << 11) +#define DDR (0x1 << 19) #define DMA_MASTER (0x1 << 20) #define BLEN_512BYTESLEN (0x200 << 0) #define NBLK_STPCNT (0x0 << 16) diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 4a65a46..d5cd826 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -271,6 +271,11 @@ static void omap_hsmmc_set_timing(struct mmc *mmc) val &= ~AC12_UHSMC_MASK; priv->mode = mmc->selected_mode; + if (mmc_is_mode_ddr(priv->mode)) + writel(readl(&mmc_base->con) | DDR, &mmc_base->con); + else + writel(readl(&mmc_base->con) & ~DDR, &mmc_base->con); + switch (priv->mode) { case MMC_HS_200: case UHS_SDR104: