From patchwork Tue May 28 04:23:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 2622831 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5FAF2DFB78 for ; Tue, 28 May 2013 04:23:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751750Ab3E1EXE (ORCPT ); Tue, 28 May 2013 00:23:04 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:48118 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750893Ab3E1EXE (ORCPT ); Tue, 28 May 2013 00:23:04 -0400 Received: by mail-pa0-f48.google.com with SMTP id kp6so7428721pab.21 for ; Mon, 27 May 2013 21:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:to:cc:in-reply-to:references:from:subject :mime-version:content-type; bh=o3nUtxt/yeZvIyW/A4h3xb2pGULn8qNYZ7nuB5XplaA=; b=tiSsgdm/MXvVtnrX5GZzWq1Cg1Cgs7urwAiVjDi4cBBWxuuaA+nCZ2/P+L6KQvBLjR pe+krD9viDurgFzN2R1HcfctPHT/l0qBMnnXTcQsrAYOSClnDkUN9jHnwLX8cOUVfN/1 lU5VLmlTN7a84nvlmLxDkznA6hXKvzXCWCU1ZnVdd0ORLyqwN1/cczrorpd1i7buijbL RcY9yo85A+kz/JOlBueCpBU7F+t6GNYrQFTbGOkUaHuJc3HFE6qVB3kPEJKiLiMSiElf kQBlNMAhGbMaT+iBP1HBoI+N5iDRrrc1TPLESCEZQQFszO0OLmBRe8v2fwZ4NfvtC5jn fuTQ== X-Received: by 10.66.158.9 with SMTP id wq9mr6070845pab.189.1369714982709; Mon, 27 May 2013 21:23:02 -0700 (PDT) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id k8sm26608912pag.18.2013.05.27.21.23.00 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 27 May 2013 21:23:01 -0700 (PDT) Date: Mon, 27 May 2013 21:23:01 -0700 (PDT) Message-ID: <87zjvf91i5.wl%kuninori.morimoto.gx@renesas.com> To: Simon Cc: Magnus , Linux-SH , Kuninori Morimoto , (RSO) goda In-Reply-To: <874ndnag6h.wl%kuninori.morimoto.gx@renesas.com> References: <87li7fwgk8.wl%kuninori.morimoto.gx@renesas.com> <874ndnag6h.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/3 v3] ARM: shmobile: r8a7778: add MMCIF support MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Add a platform device for the r8a7778 MMCIF. Signed-off-by: Yusuke Goda Signed-off-by: Kuninori Morimoto --- v2 -> v3 - __initdata was added arch/arm/mach-shmobile/clock-r8a7778.c | 3 +++ arch/arm/mach-shmobile/include/mach/r8a7778.h | 2 ++ arch/arm/mach-shmobile/setup-r8a7778.c | 13 +++++++++++++ 3 files changed, 18 insertions(+) diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c index c2c1895..18d44f5 100644 --- a/arch/arm/mach-shmobile/clock-r8a7778.c +++ b/arch/arm/mach-shmobile/clock-r8a7778.c @@ -103,6 +103,7 @@ static struct clk *main_clks[] = { }; enum { + MSTP331, MSTP323, MSTP322, MSTP321, MSTP114, MSTP030, @@ -112,6 +113,7 @@ enum { MSTP_NR }; static struct clk mstp_clks[MSTP_NR] = { + [MSTP331] = SH_CLK_MSTP32(&s4_clk, MSTPCR3, 31, 0), /* MMC */ [MSTP323] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 23, 0), /* SDHI0 */ [MSTP322] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 22, 0), /* SDHI1 */ [MSTP321] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 21, 0), /* SDHI2 */ @@ -137,6 +139,7 @@ static struct clk_lookup lookups[] = { CLKDEV_CON_ID("peripheral_clk", &p_clk), /* MSTP32 clocks */ + CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP331]), /* MMC */ CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP323]), /* SDHI0 */ CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */ CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */ diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h index ca8bc14..fcf3c90 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7778.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h @@ -18,6 +18,7 @@ #ifndef __ASM_R8A7778_H__ #define __ASM_R8A7778_H__ +#include #include #include @@ -26,6 +27,7 @@ extern void r8a7778_add_standard_devices_dt(void); extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata); extern void r8a7778_add_i2c_device(int id); extern void r8a7778_add_hspi_device(int id); +extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info); extern void r8a7778_init_delay(void); extern void r8a7778_init_irq(void); diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index fdc483d..17bc1d2 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c @@ -220,6 +220,19 @@ void __init r8a7778_add_hspi_device(int id) hspi_resources + (2 * id), 2); } +/* MMC */ +static struct resource mmc_resources[] __initdata = { + DEFINE_RES_MEM(0xffe4e000, 0x100), + DEFINE_RES_IRQ(gic_iid(0x5d)), +}; + +void __init r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info) +{ + platform_device_register_resndata( + &platform_bus, "sh_mmcif", -1, + mmc_resources, ARRAY_SIZE(mmc_resources), + info, sizeof(*info)); +} void __init r8a7778_add_standard_devices(void) {