From patchwork Thu Apr 4 18:55:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2394571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 56B10DF25A for ; Thu, 4 Apr 2013 18:58:25 +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 1UNpMc-0007y0-Sm for patchwork-linux-arm@patchwork.kernel.org; Thu, 04 Apr 2013 18:58:24 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UNpLM-0007X0-Rv; Thu, 04 Apr 2013 18:57:04 +0000 Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UNpLI-0007WS-TQ for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2013 18:57:02 +0000 Received: by mail-la0-f50.google.com with SMTP id ec20so2754929lab.23 for ; Thu, 04 Apr 2013 11:56:58 -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=v6HNp//uSA3Bz6n0uXOUINEpHrrApxty/LQ9cTfnRG8=; b=GxUgAhWgJ8WkPNTLRQGWSfAAYlnW/i1LZpcSSyfhWTOiR2lz04z3/IqvGYtCmXPXeq IyVg2n6vdHCjh4rc1PeH/rXN2YBysuHz+b1VZs5vR7vF/L5AOjIIFv2kvtLQzF4KID5g ji0E0DL/GgZzn/1Pdi/O6xJMU2TyQwTUfcAL8ulIDH8yDJ/d0Por/9sdBGcSqnrw9URb s1R8nDv6vYNwAC008bD2WuIVUkJG5vAYrLyq+FXAS9y4mzQtCk+Zcxcb5A2IWTHW53an 5k86jb8L9qPlq/4d8CAJ0pKoM084IX3DQ3mdutL0OZMnTONT1VQxumyTtSJgD8KbWDo2 dRfg== X-Received: by 10.112.76.39 with SMTP id h7mr2877671lbw.118.1365101818437; Thu, 04 Apr 2013 11:56:58 -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 f7sm402640lbj.13.2013.04.04.11.56.56 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 04 Apr 2013 11:56:57 -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 2/2] ARM: shmobile: R8A7778: add Ether support From: Sergei Shtylyov Organization: Cogent Embedded Date: Thu, 4 Apr 2013 22:55:46 +0400 MIME-Version: 1.0 Message-Id: <201304042255.46986.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQmnQqyJsUFiG3EpfBeTpMThRASAkH/uicS6H7RY3IGrAtAlNRPu9lgvTUKg01zVhj7QZ+WS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130404_145701_127503_C40DF497 X-CRM114-Status: GOOD ( 14.92 ) 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 R8A7778 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 r8a7778_add_ether_device(); - use platform_device_register_resndata() in r8a7778_add_ether_device(). arch/arm/mach-shmobile/clock-r8a7778.c | 3 +++ arch/arm/mach-shmobile/include/mach/r8a7778.h | 3 +++ arch/arm/mach-shmobile/setup-r8a7778.c | 15 +++++++++++++++ 3 files changed, 21 insertions(+) Index: renesas/arch/arm/mach-shmobile/clock-r8a7778.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/clock-r8a7778.c +++ renesas/arch/arm/mach-shmobile/clock-r8a7778.c @@ -58,11 +58,13 @@ static struct clk *main_clks[] = { }; enum { + MSTP114, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, MSTP016, MSTP015, MSTP_NR }; static struct clk mstp_clks[MSTP_NR] = { + [MSTP114] = SH_CLK_MSTP32(&clkp, MSTPCR1, 14, 0), /* Ether */ [MSTP026] = SH_CLK_MSTP32(&clkp, MSTPCR0, 26, 0), /* SCIF0 */ [MSTP025] = SH_CLK_MSTP32(&clkp, MSTPCR0, 25, 0), /* SCIF1 */ [MSTP024] = SH_CLK_MSTP32(&clkp, MSTPCR0, 24, 0), /* SCIF2 */ @@ -75,6 +77,7 @@ static struct clk mstp_clks[MSTP_NR] = { static struct clk_lookup lookups[] = { /* MSTP32 clocks */ + CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP114]), /* Ether */ CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */ CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */ CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */ Index: renesas/arch/arm/mach-shmobile/include/mach/r8a7778.h =================================================================== --- renesas.orig/arch/arm/mach-shmobile/include/mach/r8a7778.h +++ renesas/arch/arm/mach-shmobile/include/mach/r8a7778.h @@ -18,8 +18,11 @@ #ifndef __ASM_R8A7778_H__ #define __ASM_R8A7778_H__ +#include + 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_init_delay(void); extern void r8a7778_init_irq(void); extern void r8a7778_init_irq_dt(void); Index: renesas/arch/arm/mach-shmobile/setup-r8a7778.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/setup-r8a7778.c +++ renesas/arch/arm/mach-shmobile/setup-r8a7778.c @@ -3,6 +3,7 @@ * * Copyright (C) 2013 Renesas Solutions Corp. * Copyright (C) 2013 Kuninori Morimoto + * 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 @@ -79,6 +80,12 @@ static struct sh_timer_config sh_tmu1_pl .clocksource_rating = 200, }; +/* Ether */ +static struct resource ether_resources[] = { + DEFINE_RES_MEM(0xfde00000, 0x400), + DEFINE_RES_IRQ(gic_iid(0x89)), +}; + #define r8a7778_register_tmu(idx) \ platform_device_register_resndata( \ &platform_bus, "sh_tmu", idx, \ @@ -111,6 +118,14 @@ void __init r8a7778_add_standard_devices r8a7778_register_tmu(1); } +void __init r8a7778_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)); +} + static struct renesas_intc_irqpin_config irqpin_platform_data = { .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */ .sense_bitfield_width = 2,