From patchwork Sat May 11 21:25:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2554581 Return-Path: X-Original-To: patchwork-ltsi-dev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) by patchwork2.kernel.org (Postfix) with ESMTP id B7AF8DF230 for ; Sat, 11 May 2013 21:25:44 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [IPv6:::1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 20A03719; Sat, 11 May 2013 21:25:44 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTP id A5C45718 for ; Sat, 11 May 2013 21:25:42 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 2427C1FCA3 for ; Sat, 11 May 2013 21:25:40 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id ep20so5039717lab.10 for ; Sat, 11 May 2013 14:25:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:to:subject:cc:from:organization:date:mime-version :content-type:content-transfer-encoding:message-id :x-gm-message-state; bh=lRHj1/N1h10Q25VUO9+wV0ZcaxCAgDFlrrApdygy/U8=; b=nkKZ8aRQXxtZAhpfeYxxaeGucMh1jHiZUgl17aVoE+e34Gci/qzCWsSq84x8r9i4d/ OeD+GdNA/GmUTbi81yGlVpjfhVyjv+PfRfLm3ppEf34/6TZhIsAypqhQop6a8TY0Cyi5 sX2vRRTLTu09huiIeSilYBqGDtFj8l1yumoqk65tayRvxP+49pMUp+RdSTPMGwjc6PhS kzt5GVuHfhX8PRXb/kQ6BeGc88aSRpSdZZroC5je11RCm3VIhyM03GzG/Mqxvu52ZeC+ tzMNBl/wnUsoqpKLDmI5IW/2JQzPB5yWabOkq0j8TQ1QSPiNM3Avbz6wqEvObCe9uOxi +Isg== X-Received: by 10.112.169.72 with SMTP id ac8mr9831063lbc.115.1368307539014; Sat, 11 May 2013 14:25:39 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-152-225.pppoe.mtu-net.ru. [91.76.152.225]) by mx.google.com with ESMTPSA id d3sm2893877lbe.13.2013.05.11.14.25.36 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 11 May 2013 14:25:37 -0700 (PDT) To: ltsi-dev@lists.linuxfoundation.org From: Sergei Shtylyov Organization: Cogent Embedded Date: Sun, 12 May 2013 01:25:50 +0400 MIME-Version: 1.0 Message-Id: <201305120125.51117.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQnPoOi/FBNt0J88LD3HK4vBr8cHIPdjwox1VND8BOeYqvbZwsD62vA8t89YJxw9Qk2QWZ7K X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: vladimir.barinov@cogentembedded.com Subject: [LTSI-dev] [PATCH 1/2] ARM: mach-shmobile: r8a7779: add SATA support X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org From: Vladimir Barinov Add SATA clock for r8a7779 SoC (for both device tree and usual cases). Register SATA controller as a "late" platform device on r8a7779 SoC. Signed-off-by: Vladimir Barinov Signed-off-by: Sergei Shtylyov Signed-off-by: Simon Horman (cherry picked from commit a7b9837c7749bf3333151a7d060d239caff1569d) --- This patch (already merged by Linus) is intended for the Marzen patch series. Changes from the upstream version: - added SATA platform device to the "early" device table instead of "late"; - resolved 4 rejects due to missing interim patches. arch/arm/mach-shmobile/clock-r8a7779.c | 6 +++++- arch/arm/mach-shmobile/setup-r8a7779.c | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) Index: linux-3.4.39/arch/arm/mach-shmobile/clock-r8a7779.c =================================================================== --- linux-3.4.39.orig/arch/arm/mach-shmobile/clock-r8a7779.c +++ linux-3.4.39/arch/arm/mach-shmobile/clock-r8a7779.c @@ -86,11 +86,13 @@ static struct clk div4_clks[DIV4_NR] = { 0x0300, CLK_ENABLE_ON_INIT), }; -enum { MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, +enum { MSTP115, + MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, MSTP016, MSTP015, MSTP014, MSTP_NR }; static struct clk mstp_clks[MSTP_NR] = { + [MSTP115] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 15, 0), /* SATA */ [MSTP026] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 26, 0), /* SCIF0 */ [MSTP025] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 25, 0), /* SCIF1 */ [MSTP024] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 24, 0), /* SCIF2 */ @@ -141,6 +143,8 @@ 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("fc600000.sata", &mstp_clks[MSTP115]), /* SATA w/DT */ CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */ CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP016]), /* TMU01 */ CLKDEV_DEV_ID("sh_tmu.2", &mstp_clks[MSTP016]), /* TMU02 */ Index: linux-3.4.39/arch/arm/mach-shmobile/setup-r8a7779.c =================================================================== --- linux-3.4.39.orig/arch/arm/mach-shmobile/setup-r8a7779.c +++ linux-3.4.39/arch/arm/mach-shmobile/setup-r8a7779.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -302,6 +303,30 @@ 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), + .dev = { + .dma_mask = &sata_device.dev.coherent_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, +}; + static struct platform_device *r8a7779_early_devices[] __initdata = { &scif0_device, &scif1_device, @@ -315,6 +340,7 @@ static struct platform_device *r8a7779_e &i2c1_device, &i2c2_device, &i2c3_device, + &sata_device, }; static struct platform_device *r8a7779_late_devices[] __initdata = {