From patchwork Wed Dec 3 08:57:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 417296 X-Patchwork-Delegate: iwamatsu@nigauri.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 484F01400DD for ; Wed, 3 Dec 2014 19:58:09 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C12C04B874; Wed, 3 Dec 2014 09:58:07 +0100 (CET) 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 MVhFkNjhft8L; Wed, 3 Dec 2014 09:58:07 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F15014B861; Wed, 3 Dec 2014 09:58:06 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 869A24B861 for ; Wed, 3 Dec 2014 09:58:04 +0100 (CET) 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 3TjzeSIePFSS for ; Wed, 3 Dec 2014 09:58:04 +0100 (CET) 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 mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by theia.denx.de (Postfix) with ESMTPS id 17DDE4B855 for ; Wed, 3 Dec 2014 09:58:00 +0100 (CET) Received: by mail-pd0-f171.google.com with SMTP id y13so15088846pdi.30 for ; Wed, 03 Dec 2014 00:57:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=k/DZIAcKsLQ20Yju9aenupbtuLgZeK5RCV4TR965G1M=; b=Ld4/AjxfUUXb0vXY3MFgTDo4TG4yoLkGmauWlIq+TXYH2dBtt5HfT2qoqebvFU/IVe F+z6er9SYesZnnFOzFDGW4ArcsSIodGEYQsCrmfEtLVwUMHrXuf73yO+bxrk8vxTBnYe j1xHc0Jercr658JkbCiO4L2mHkQ8kz/qP+XTO64zCpVrlOCCgJL30JQMrXKRJ+RFUC2Z XSa9F4op/l2S1BDz8fLoUBCca8Y0RCckYU9RtCSz9uss2l2DNAvt4rFVKGmyI6vh7zD6 DBE8DNU7R/gFCquiX3VPr3HkDmFtplplKQNEa1BVe4GZlOoG2JY+Bru8HjRirlwii7P/ KdbQ== X-Gm-Message-State: ALoCoQmy16YL4ijr0t10bzv/45EbW6t/8wAyPPnJ+Y6GqRRdqCrShPfw1lxyZWlZr11TITHoK7g1 X-Received: by 10.70.93.2 with SMTP id cq2mr6253548pdb.99.1417597078331; Wed, 03 Dec 2014 00:57:58 -0800 (PST) Received: from xps-iwamatsu.renesas.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id w5sm22513169pds.25.2014.12.03.00.57.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Dec 2014 00:57:56 -0800 (PST) From: Nobuhiro Iwamatsu To: u-boot@lists.denx.de, Nobuhiro Iwamatsu Date: Wed, 3 Dec 2014 17:57:48 +0900 Message-Id: <1417597068-5478-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> X-Mailer: git-send-email 2.1.3 Cc: Nobuhiro Iwamatsu Subject: [U-Boot] [PATCH] mmc: sh_mmcif: Add support rmobile X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Renesas R-Mobile/R-Car ARM SoC of MMC has the same IP that are supported by sh_mmcif. This adds support R-Mobile/R-Car ARM SoC with the setting of the clock support. Signed-off-by: Nobuhiro Iwamatsu --- drivers/mmc/sh_mmcif.c | 2 +- drivers/mmc/sh_mmcif.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/sh_mmcif.c b/drivers/mmc/sh_mmcif.c index 3a2022c..76ba93b 100644 --- a/drivers/mmc/sh_mmcif.c +++ b/drivers/mmc/sh_mmcif.c @@ -596,7 +596,7 @@ int mmcif_mmc_init(void) host->clk = CONFIG_SH_MMCIF_CLK; sh_mmcif_cfg.f_min = MMC_CLK_DIV_MIN(host->clk); - sh_mmcif_cfg.f_max = MMC_CLK_DIV_MAX; + sh_mmcif_cfg.f_max = MMC_CLK_DIV_MAX(host->clk); mmc = mmc_create(&sh_mmcif_cfg, host); if (mmc == NULL) { diff --git a/drivers/mmc/sh_mmcif.h b/drivers/mmc/sh_mmcif.h index 70034e2..4b6752f 100644 --- a/drivers/mmc/sh_mmcif.h +++ b/drivers/mmc/sh_mmcif.h @@ -199,8 +199,13 @@ struct sh_mmcif_regs { #define SOFT_RST_OFF (0 << 31) #define CLKDEV_EMMC_DATA 52000000 /* 52MHz */ +#ifdef CONFIG_RMOBILE +#define MMC_CLK_DIV_MIN(clk) (clk / (1 << 9)) +#define MMC_CLK_DIV_MAX(clk) (clk / (1 << 1)) +#else #define MMC_CLK_DIV_MIN(clk) (clk / (1 << 8)) -#define MMC_CLK_DIV_MAX CLKDEV_EMMC_DATA +#define MMC_CLK_DIV_MAX(clk) CLKDEV_EMMC_DATA +#endif #define MMC_BUS_WIDTH_1 0 #define MMC_BUS_WIDTH_4 2