From patchwork Thu Apr 4 18:53: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: 2394551 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 899BD3FD8C for ; Thu, 4 Apr 2013 18:56:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UNpLB-00077w-Nu for patchwork-linux-arm@patchwork.kernel.org; Thu, 04 Apr 2013 18:56:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UNpJV-00070O-J4; Thu, 04 Apr 2013 18:55:09 +0000 Received: from mail-la0-x230.google.com ([2a00:1450:4010:c03::230]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UNpJR-0006zi-3T for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2013 18:55:06 +0000 Received: by mail-la0-f48.google.com with SMTP id fq13so2808726lab.35 for ; Thu, 04 Apr 2013 11:55:02 -0700 (PDT) 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=VWBKk2jmYm8euDwSjeEl+LlTPc3K4ut9OT3USvGhaUk=; b=Ui8XGOexivT4qAT16uJhUkP3JY50hoq5f8388y4WklPZVwCA17E7kqydasaInw0nb+ ONu+GWKJiuWL4OHIbEZ6cAsFG1qSzWfF5HPMcC4HNGL3fLj+ZZ2Ktbw14hlCTQ5JRVyY frVq/3n9ab73k4ExxUjJEWv/OEJnJj2wPwvbwsl3KtTp5OhBAgyv1tPslXjAbeSGT+iO kq9MD5zvHnmnTqIUNdIo5h6BaJz6+zAG6h+XdU+u4A5ws/QyN6pnXAIQ0Ilhhg6qJYRY l0bbIag7/LiknTKl23wh3bQa0QBI/4XVo74G3lvS+K9+0Eia/NRkAuTidjrNDPV3H5PK PlKA== X-Received: by 10.152.115.139 with SMTP id jo11mr2039217lab.57.1365101702413; Thu, 04 Apr 2013 11:55:02 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-100-82.pppoe.mtu-net.ru. [91.79.100.82]) by mx.google.com with ESMTPS id z10sm1142025lbz.1.2013.04.04.11.55.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 04 Apr 2013 11:55:01 -0700 (PDT) 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 Subject: [PATCH v2 1/2] ARM: shmobile: R8A7779: add Ether support From: Sergei Shtylyov Organization: Cogent Embedded Date: Thu, 4 Apr 2013 22:53:50 +0400 MIME-Version: 1.0 Message-Id: <201304042253.50662.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQmKFKHiG0USnpzn+FGm67JE4yHB9p3VXWActKNMzjj23LOXeumdzLO7gWGNqbwiK1iLd5Z8 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130404_145505_322903_B2EE4F45 X-CRM114-Status: GOOD ( 18.08 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add Ether clock and platform device for R8A7779 SoC; add a function to register this device with board-specific platform data. Signed-off-by: Sergei Shtylyov Acked-by: Kuninori Morimoto --- This patch is atop of the 'renesas-next-20130404v2' tag of Simon Horman's 'renesas.git'. Changes since original posting: - use 'struct sh_eth_plat_data *' as an argument to r8a7779_add_ether_device(); - use platform_device_register_resndata() in r8a7779_add_ether_device(). arch/arm/mach-shmobile/clock-r8a7779.c | 4 +++- arch/arm/mach-shmobile/include/mach/r8a7779.h | 2 ++ arch/arm/mach-shmobile/setup-r8a7779.c | 23 ++++++++++++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) 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 @@ -112,7 +112,7 @@ static struct clk *main_clks[] = { }; enum { MSTP323, MSTP322, MSTP321, MSTP320, - MSTP115, + MSTP115, MSTP114, MSTP103, MSTP101, MSTP100, MSTP030, MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, @@ -126,6 +126,7 @@ static struct clk mstp_clks[MSTP_NR] = { [MSTP321] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 21, 0), /* SDHI2 */ [MSTP320] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 20, 0), /* SDHI3 */ [MSTP115] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 15, 0), /* SATA */ + [MSTP114] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 14, 0), /* Ether */ [MSTP103] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 3, 0), /* DU */ [MSTP101] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 1, 0), /* USB2 */ [MSTP100] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 0, 0), /* USB0/1 */ @@ -162,6 +163,7 @@ static struct clk_lookup lookups[] = { /* 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-eth", &mstp_clks[MSTP114]), /* Ether */ 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/include/mach/r8a7779.h =================================================================== --- renesas.orig/arch/arm/mach-shmobile/include/mach/r8a7779.h +++ renesas/arch/arm/mach-shmobile/include/mach/r8a7779.h @@ -3,6 +3,7 @@ #include #include +#include struct platform_device; @@ -31,6 +32,7 @@ extern void r8a7779_earlytimer_init(void extern void r8a7779_add_early_devices(void); extern void r8a7779_add_standard_devices(void); extern void r8a7779_add_standard_devices_dt(void); +extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata); extern void r8a7779_clock_init(void); extern void r8a7779_pinmux_init(void); extern void r8a7779_pm_init(void); 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 @@ -1,8 +1,9 @@ /* * r8a7779 processor support * - * Copyright (C) 2011 Renesas Solutions Corp. + * Copyright (C) 2011, 2013 Renesas Solutions Corp. * Copyright (C) 2011 Magnus Damm + * Copyright (C) 2013 Cogent Embedded, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -393,6 +394,18 @@ static struct platform_device sata_devic }, }; +/* Ether */ +static struct resource ether_resources[] = { + { + .start = 0xfde00000, + .end = 0xfde003ff, + .flags = IORESOURCE_MEM, + }, { + .start = gic_iid(0xb4), + .flags = IORESOURCE_IRQ, + }, +}; + static struct platform_device *r8a7779_devices_dt[] __initdata = { &scif0_device, &scif1_device, @@ -428,6 +441,14 @@ void __init r8a7779_add_standard_devices ARRAY_SIZE(r8a7779_late_devices)); } +void __init r8a7779_add_ether_device(struct sh_eth_plat_data *pdata) +{ + platform_device_register_resndata(&platform_bus, "sh_eth", -1, + ether_resources, + ARRAY_SIZE(ether_resources), + pdata, sizeof(*pdata)); +} + /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ void __init __weak r8a7779_register_twd(void) { }