From patchwork Thu May 23 03:19:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 2604571 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 81D19DF215 for ; Thu, 23 May 2013 03:19:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756855Ab3EWDTW (ORCPT ); Wed, 22 May 2013 23:19:22 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:63640 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756346Ab3EWDTV (ORCPT ); Wed, 22 May 2013 23:19:21 -0400 Received: by mail-pa0-f43.google.com with SMTP id hz10so2482476pad.2 for ; Wed, 22 May 2013 20:19:21 -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=efRQn7950kNrD5LQnrQUgILNZfExQ0emHG2j6xLkwJo=; b=ggPYcakoJ5tFpRbnyEri71gesA6/lxj8gjhBM+DO13qJY5xKKkKOOm6T/dHWzfvr9v Zb4bsAPht5NZx0ymJrrtxFCViNOEjQYMHXvkEIhIzW2swAwVMXVS7nhX3VzlNyQ5k+sL +7LmjsTGGasa/SzRhB68AnAlQACp2xuE5qt4zpSjOuVs/mffo6zDjIXgpdIAujXYoDUp rYUyHIwodDODTsXEHmNCmQGdoxz8nZArLzofANWCKMy+MQRGA3HhfbhnPHsm4NYmslPV UDkHIakhH1ZGxIIfkYI0ikTemEpvTi+2BFwHgackHAQdmMfFGnXRCqOI2kswQNRIf4cU 4FmQ== X-Received: by 10.66.221.70 with SMTP id qc6mr11207504pac.10.1369279161282; Wed, 22 May 2013 20:19:21 -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 tb7sm9775691pbc.14.2013.05.22.20.19.19 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 22 May 2013 20:19:20 -0700 (PDT) Date: Wed, 22 May 2013 20:19:20 -0700 (PDT) Message-ID: <8738te4c3u.wl%kuninori.morimoto.gx@renesas.com> To: Simon Cc: Magnus , Linux-SH , Kuninori Morimoto In-Reply-To: <87d2si4cdn.wl%kuninori.morimoto.gx@renesas.com> References: <87li7fwgk8.wl%kuninori.morimoto.gx@renesas.com> <87d2si4cdn.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 07/17 v2] ARM: shmobile: r8a7778: add HSPI 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 Signed-off-by: Yusuke Goda Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change arch/arm/mach-shmobile/clock-r8a7778.c | 6 ++++++ arch/arm/mach-shmobile/include/mach/r8a7778.h | 1 + arch/arm/mach-shmobile/setup-r8a7778.c | 23 +++++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c index 1386c59..c2c1895 100644 --- a/arch/arm/mach-shmobile/clock-r8a7778.c +++ b/arch/arm/mach-shmobile/clock-r8a7778.c @@ -108,6 +108,7 @@ enum { MSTP030, MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, MSTP016, MSTP015, + MSTP007, MSTP_NR }; static struct clk mstp_clks[MSTP_NR] = { @@ -127,10 +128,12 @@ static struct clk mstp_clks[MSTP_NR] = { [MSTP021] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 21, 0), /* SCIF5 */ [MSTP016] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 16, 0), /* TMU0 */ [MSTP015] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 15, 0), /* TMU1 */ + [MSTP007] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 7, 0), /* HSPI */ }; static struct clk_lookup lookups[] = { /* main */ + CLKDEV_CON_ID("shyway_clk", &s_clk), CLKDEV_CON_ID("peripheral_clk", &p_clk), /* MSTP32 clocks */ @@ -150,6 +153,9 @@ static struct clk_lookup lookups[] = { CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */ CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */ CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */ + CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */ + CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */ + CLKDEV_DEV_ID("sh-hspi.2", &mstp_clks[MSTP007]), /* HSPI2 */ }; void __init r8a7778_clock_init(void) diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h index a428bc6..ca8bc14 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7778.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h @@ -25,6 +25,7 @@ extern void r8a7778_add_standard_devices(void); 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_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 87b74a5..8f011cb 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c @@ -198,6 +198,29 @@ void __init r8a7778_add_i2c_device(int id) i2c_resources + (2 * id), 2); } +/* HSPI */ +static struct resource hspi_resources[] = { + /* HSPI0 */ + DEFINE_RES_MEM(0xfffc7000, 0x18), + DEFINE_RES_IRQ(gic_iid(0x5f)), + /* HSPI1 */ + DEFINE_RES_MEM(0xfffc8000, 0x18), + DEFINE_RES_IRQ(gic_iid(0x74)), + /* HSPI2 */ + DEFINE_RES_MEM(0xfffc6000, 0x18), + DEFINE_RES_IRQ(gic_iid(0x75)), +}; + +void __init r8a7778_add_hspi_device(int id) +{ + BUG_ON(id < 0 || id > 2); + + platform_device_register_simple( + "sh-hspi", id, + hspi_resources + (2 * id), 2); +} + + void __init r8a7778_add_standard_devices(void) { int i;