From patchwork Mon Apr 1 22:04:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2373011 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 523383FDDA for ; Mon, 1 Apr 2013 22:06:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758228Ab3DAWGP (ORCPT ); Mon, 1 Apr 2013 18:06:15 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:40246 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758036Ab3DAWGP (ORCPT ); Mon, 1 Apr 2013 18:06:15 -0400 Received: by mail-lb0-f175.google.com with SMTP id o10so2380853lbi.34 for ; Mon, 01 Apr 2013 15:06:13 -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=oVqBihVFxnx2bh+SO59jrAYEw3XjrBwi+iqLHhAAjmY=; b=FdzlsK8zxNveaNC7t/GTLH9o/EkJUaKuBl8vU4QekjUfgPH/NUu8ebBZIYvt1F+iqf HZMHhu4awl6vdRoZrIaBv7kRjSUgFYhHV2urrrDdath11dNmgCSYKSKwMMMHsRIip/fD pFnLRstCag2Q6f39DrJ0qMvvfW3/zmmY4jgBjjoDFz8djNhDSzZwnHteaI2xK+xPzt84 vXwB9Ssi55EX7pI6cQ9QtPEUlCj29pC6QWmpLCQmD7Aq9UdjrRDzp51BqPfXF4yGMR9m 8a1vvIqCga1LiksBHZ+3mKCL6BV/jFnuh+YhkzudevRBwQO1SdG6Pr/asL38RfSYV0kq 07jg== X-Received: by 10.112.155.100 with SMTP id vv4mr891947lbb.81.1364853973364; Mon, 01 Apr 2013 15:06:13 -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 v7sm6069709lbg.13.2013.04.01.15.06.11 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Apr 2013 15:06:12 -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 1/2] ARM: shmobile: R8A7779: add Ether support From: Sergei Shtylyov Organization: Cogent Embedded Date: Tue, 2 Apr 2013 02:04:54 +0400 MIME-Version: 1.0 Message-Id: <201304020204.54546.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQlqWUpCxFn6ZxytHWy51qYUimKzflmg9958WhfcF5WS4ci7uTwa5fjYFCUj9ac6pDlAlV1D Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.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 --- This patch is atop of the 'next' branch of Simon Horman's renesas.git. arch/arm/mach-shmobile/clock-r8a7779.c | 4 ++- arch/arm/mach-shmobile/include/mach/r8a7779.h | 1 arch/arm/mach-shmobile/setup-r8a7779.c | 29 +++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) -- 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 @@ -93,7 +93,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, @@ -107,6 +107,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 */ @@ -143,6 +144,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 @@ -31,6 +31,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(void *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 @@ -369,6 +370,25 @@ static struct platform_device i2c3_devic .num_resources = ARRAY_SIZE(rcar_i2c3_res), }; +/* Ether */ +static struct resource ether_resources[] = { + { + .start = 0xfde00000, + .end = 0xfde003ff, + .flags = IORESOURCE_MEM, + }, { + .start = gic_iid(0xb4), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device ether_device = { + .name = "sh-eth", + .id = -1, + .resource = ether_resources, + .num_resources = ARRAY_SIZE(ether_resources), +}; + static struct resource sata_resources[] = { [0] = { .name = "rcar-sata", @@ -428,6 +448,13 @@ void __init r8a7779_add_standard_devices ARRAY_SIZE(r8a7779_late_devices)); } +void __init r8a7779_add_ether_device(void *pdata) +{ + ether_device.dev.platform_data = pdata; + + platform_device_register(ðer_device); +} + /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ void __init __weak r8a7779_register_twd(void) { }