From patchwork Sat Feb 16 22:43:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2152541 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1E2D73FD4F for ; Sat, 16 Feb 2013 21:43:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754644Ab3BPVnM (ORCPT ); Sat, 16 Feb 2013 16:43:12 -0500 Received: from mail-la0-f42.google.com ([209.85.215.42]:57070 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754578Ab3BPVnM (ORCPT ); Sat, 16 Feb 2013 16:43:12 -0500 Received: by mail-la0-f42.google.com with SMTP id fe20so4484351lab.1 for ; Sat, 16 Feb 2013 13:43:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:to:subject:from:organization:date:mime-version :content-type:content-transfer-encoding:message-id :x-gm-message-state; bh=y9c+QhVYZ6DxSVQzW4/MXt+E1+eSjit6LeUS8RaZgDY=; b=eB3izO6pRCyXgwGxau4p1eWJraGsL8uNwpH6/LJeP/xTyydg/7CvoTvUEnZ17r1t/z CiTUFGTOcoPCe74ic95OzEJHtMIfcnAh+3XkCQdWRXKjQOm9t3dwzIiA3J2Bl2L7lnXv vnmkN3IyrRY4HnmvXxpC/c/8MgWzb0vlHC2eG8zZ6o4o7cW7aGF6UXg0dTkXiGS3LJ/j evD/rRPNxBPPBKp6VSZ9HCjY46RPNv5Gv8FV9lnm385jKguUVUz7SWci2VcDBnz3Dxl0 yW+MibyN7NR5V3EtRwv7b8t19E8THQYoBWT7eem/RaJ/faFIKBqJ8fl3pYom6+HZ4ugU qTmQ== X-Received: by 10.152.105.244 with SMTP id gp20mr5433583lab.34.1361050990007; Sat, 16 Feb 2013 13:43:10 -0800 (PST) Received: from wasted.dev.rtsoft.ru (ppp91-79-87-79.pppoe.mtu-net.ru. [91.79.87.79]) by mx.google.com with ESMTPS id go4sm19145931lbb.16.2013.02.16.13.43.08 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 16 Feb 2013 13:43:09 -0800 (PST) To: horms@verge.net.au, magnus.damm@gmail.com, linux@arm.linux.org.uk, linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org, vladimir.barinov@cogentembedded.com Subject: [PATCH 2/4] ARM: mach-shmobile: r8a7779: add SATA support From: Sergei Shtylyov Organization: Cogent Embedded Date: Sun, 17 Feb 2013 01:43:35 +0300 MIME-Version: 1.0 Message-Id: <201302170143.36052.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQnQVm13upcc+zhRsE58/2OT2Io5TlbZWkjhsu3GLi44rSCf5zezk3IpWOTBZ9seUlbuevsD Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Vladimir Barinov Add SATA clock and platform device resources on r8a7779 SoC. Add entry to r8a7779_auxdata_lookup[], so that devm_clk_get() in the driver still works when we're using the device tree. Signed-off-by: Vladimir Barinov Signed-off-by: Sergei Shtylyov --- arch/arm/mach-shmobile/clock-r8a7779.c | 3 +++ arch/arm/mach-shmobile/setup-r8a7779.c | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: renesas/arch/arm/mach-shmobile/clock-r8a7779.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/clock-r8a7779.c +++ renesas/arch/arm/mach-shmobile/clock-r8a7779.c @@ -87,6 +87,7 @@ static struct clk div4_clks[DIV4_NR] = { }; enum { MSTP323, MSTP322, MSTP321, MSTP320, + MSTP115, MSTP101, MSTP100, MSTP030, MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, @@ -99,6 +100,7 @@ static struct clk mstp_clks[MSTP_NR] = { [MSTP322] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 22, 0), /* SDHI1 */ [MSTP321] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 21, 0), /* SDHI2 */ [MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 20, 0), /* SDHI3 */ + [MSTP115] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 15, 0), /* SATA */ [MSTP101] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 1, 0), /* USB2 */ [MSTP100] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 0, 0), /* USB0/1 */ [MSTP030] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 30, 0), /* I2C0 */ @@ -156,6 +158,7 @@ static struct clk_lookup lookups[] = { CLKDEV_CON_ID("peripheral_clk", &div4_clks[DIV4_P]), /* MSTP32 clocks */ + CLKDEV_DEV_ID("sata_rcar", &mstp_clks[MSTP115]), /* SATA */ CLKDEV_DEV_ID("ehci-platform.1", &mstp_clks[MSTP101]), /* USB EHCI port2 */ CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */ CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ Index: renesas/arch/arm/mach-shmobile/setup-r8a7779.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/setup-r8a7779.c +++ renesas/arch/arm/mach-shmobile/setup-r8a7779.c @@ -322,6 +322,26 @@ static struct platform_device i2c3_devic .num_resources = ARRAY_SIZE(rcar_i2c3_res), }; +static struct resource sata_resources[] = { + [0] = { + .name = "rcar-sata", + .start = 0xfc600000, + .end = 0xfc601fff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = gic_spi(100), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device sata_device = { + .name = "sata_rcar", + .id = -1, + .resource = sata_resources, + .num_resources = ARRAY_SIZE(sata_resources), +}; + static struct platform_device *r8a7779_early_devices_dt[] __initdata = { &scif0_device, &scif1_device, @@ -338,6 +358,7 @@ static struct platform_device *r8a7779_e &i2c1_device, &i2c2_device, &i2c3_device, + &sata_device, }; void __init r8a7779_add_standard_devices(void) @@ -404,6 +425,7 @@ void __init r8a7779_add_early_devices_dt } static const struct of_dev_auxdata r8a7779_auxdata_lookup[] __initconst = { + OF_DEV_AUXDATA("renesas,rcar-sata", 0xfc600000, "sata_rcar", NULL), {}, };