From patchwork Mon Apr 1 22:06:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2373041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id AC86F3FDDA for ; Mon, 1 Apr 2013 22:10:24 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UMmtm-0001Oa-Da; Mon, 01 Apr 2013 22:08:18 +0000 Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UMmti-0001Mh-2z for linux-arm-kernel@lists.infradead.org; Mon, 01 Apr 2013 22:08:15 +0000 Received: by mail-la0-f46.google.com with SMTP id fq12so2541483lab.33 for ; Mon, 01 Apr 2013 15:08:11 -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=ehexARefRG68St/KL6+r0Rd0ATIPCNgWE1kbP5LaqjA=; b=KtgzJ97JsMM5nesWfq3yIRdvpxhv2oJSO5RdxIMUILzIfsyZ6Grr/U3RvyPeR2Gpb2 5p7G8kPXqWiSk9P+FVUjT+6L/unhbfsgQGJogBaD35y5wL2HH9MQUwu6VWSMrvFk4O3p SepiXQHDW2HfGcmCI+DQOXbyAxwr83nPezl0yqYCwj24/KLNql8Zl9Qgtnd7/OCMYFM2 7K07ZrXfk/5Qwq6n/r/D3F0qCtr9ljsPXKfLmaKto6rV3R9PNNVXspW9h2H6sekyI+f4 GngKZG24dyik803Oa/jikR3+wss5eH80UpYeqbb1OXXb/h7fldhaofOT4OJI52Yf39os xTNA== X-Received: by 10.152.29.232 with SMTP id n8mr2015681lah.55.1364854091202; Mon, 01 Apr 2013 15:08:11 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-100-65.pppoe.mtu-net.ru. [91.79.100.65]) by mx.google.com with ESMTPS id sl5sm6079621lbb.10.2013.04.01.15.08.09 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Apr 2013 15:08:10 -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 2/2] ARM: shmobile: R8A7778: add Ether support From: Sergei Shtylyov Organization: Cogent Embedded Date: Tue, 2 Apr 2013 02:06:51 +0400 MIME-Version: 1.0 Message-Id: <201304020206.52313.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQn308wHYu03tpIGMwBfCvNFFLgDMVvsITbiDNcYfycDIfmmIKXPMJk/ZssJZq5pqKKhGfY0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130401_180814_315101_349C6F07 X-CRM114-Status: GOOD ( 15.20 ) 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 --- This patch is atop of the 'next' branch of Simon Horman's renesas.git. arch/arm/mach-shmobile/clock-r8a7778.c | 3 +++ arch/arm/mach-shmobile/include/mach/r8a7778.h | 1 + arch/arm/mach-shmobile/setup-r8a7778.c | 21 +++++++++++++++++++++ 3 files changed, 25 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 @@ -20,6 +20,7 @@ extern void r8a7778_add_standard_devices(void); extern void r8a7778_add_standard_devices_dt(void); +extern void r8a7778_add_ether_device(void *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 @@ -78,6 +79,19 @@ 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)), +}; + +static struct platform_device ether_device = { + .name = "sh-eth", + .id = -1, + .resource = ether_resources, + .num_resources = ARRAY_SIZE(ether_resources), +}; + #define PLATFORM_INFO(n, i) \ { \ .parent = &platform_bus, \ @@ -118,6 +132,13 @@ void __init r8a7778_add_standard_devices platform_device_register_full(&platform_devinfo[i]); } +void __init r8a7778_add_ether_device(void *pdata) +{ + ether_device.dev.platform_data = pdata; + + platform_device_register(ðer_device); +} + #define INT2SMSKCR0 0x82288 /* 0xfe782288 */ #define INT2SMSKCR1 0x8228c /* 0xfe78228c */