aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2013-04-04 14:53:50 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-04-04 21:47:03 -0400
commitdace48d04dee46a3409d5e13cd98031522e46377 (patch)
treeff91a137d45287b08147c45c3d18f4ffcaa44a0c /arch/arm/mach-shmobile
parentf0ff5a0a82b0c1be8e14584aa66a7890e08361d9 (diff)
ARM: shmobile: R8A7779: add Ether support
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 <sergei.shtylyov@cogentembedded.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7779.c4
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h2
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c23
3 files changed, 27 insertions, 2 deletions
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index 5436b512da7a..31d5cd4d9787 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -112,7 +112,7 @@ static struct clk *main_clks[] = {
112}; 112};
113 113
114enum { MSTP323, MSTP322, MSTP321, MSTP320, 114enum { MSTP323, MSTP322, MSTP321, MSTP320,
115 MSTP115, 115 MSTP115, MSTP114,
116 MSTP103, MSTP101, MSTP100, 116 MSTP103, MSTP101, MSTP100,
117 MSTP030, 117 MSTP030,
118 MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, 118 MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
@@ -126,6 +126,7 @@ static struct clk mstp_clks[MSTP_NR] = {
126 [MSTP321] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 21, 0), /* SDHI2 */ 126 [MSTP321] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 21, 0), /* SDHI2 */
127 [MSTP320] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 20, 0), /* SDHI3 */ 127 [MSTP320] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 20, 0), /* SDHI3 */
128 [MSTP115] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 15, 0), /* SATA */ 128 [MSTP115] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 15, 0), /* SATA */
129 [MSTP114] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 14, 0), /* Ether */
129 [MSTP103] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 3, 0), /* DU */ 130 [MSTP103] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 3, 0), /* DU */
130 [MSTP101] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 1, 0), /* USB2 */ 131 [MSTP101] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 1, 0), /* USB2 */
131 [MSTP100] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 0, 0), /* USB0/1 */ 132 [MSTP100] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 0, 0), /* USB0/1 */
@@ -162,6 +163,7 @@ static struct clk_lookup lookups[] = {
162 /* MSTP32 clocks */ 163 /* MSTP32 clocks */
163 CLKDEV_DEV_ID("sata_rcar", &mstp_clks[MSTP115]), /* SATA */ 164 CLKDEV_DEV_ID("sata_rcar", &mstp_clks[MSTP115]), /* SATA */
164 CLKDEV_DEV_ID("fc600000.sata", &mstp_clks[MSTP115]), /* SATA w/DT */ 165 CLKDEV_DEV_ID("fc600000.sata", &mstp_clks[MSTP115]), /* SATA w/DT */
166 CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP114]), /* Ether */
165 CLKDEV_DEV_ID("ehci-platform.1", &mstp_clks[MSTP101]), /* USB EHCI port2 */ 167 CLKDEV_DEV_ID("ehci-platform.1", &mstp_clks[MSTP101]), /* USB EHCI port2 */
166 CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */ 168 CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */
167 CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ 169 CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index af38750f38f7..b58a1f026e9c 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/sh_clk.h> 4#include <linux/sh_clk.h>
5#include <linux/pm_domain.h> 5#include <linux/pm_domain.h>
6#include <linux/sh_eth.h>
6 7
7/* Pin Function Controller: 8/* Pin Function Controller:
8 * GPIO_FN_xx - GPIO used to select pin function 9 * GPIO_FN_xx - GPIO used to select pin function
@@ -352,6 +353,7 @@ extern void r8a7779_earlytimer_init(void);
352extern void r8a7779_add_early_devices(void); 353extern void r8a7779_add_early_devices(void);
353extern void r8a7779_add_standard_devices(void); 354extern void r8a7779_add_standard_devices(void);
354extern void r8a7779_add_standard_devices_dt(void); 355extern void r8a7779_add_standard_devices_dt(void);
356extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata);
355extern void r8a7779_clock_init(void); 357extern void r8a7779_clock_init(void);
356extern void r8a7779_pinmux_init(void); 358extern void r8a7779_pinmux_init(void);
357extern void r8a7779_pm_init(void); 359extern void r8a7779_pm_init(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 042df35e71a0..689ce67920d8 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -1,8 +1,9 @@
1/* 1/*
2 * r8a7779 processor support 2 * r8a7779 processor support
3 * 3 *
4 * Copyright (C) 2011 Renesas Solutions Corp. 4 * Copyright (C) 2011, 2013 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm 5 * Copyright (C) 2011 Magnus Damm
6 * Copyright (C) 2013 Cogent Embedded, Inc.
6 * 7 *
7 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -347,6 +348,18 @@ static struct platform_device sata_device = {
347 }, 348 },
348}; 349};
349 350
351/* Ether */
352static struct resource ether_resources[] = {
353 {
354 .start = 0xfde00000,
355 .end = 0xfde003ff,
356 .flags = IORESOURCE_MEM,
357 }, {
358 .start = gic_iid(0xb4),
359 .flags = IORESOURCE_IRQ,
360 },
361};
362
350static struct platform_device *r8a7779_devices_dt[] __initdata = { 363static struct platform_device *r8a7779_devices_dt[] __initdata = {
351 &scif0_device, 364 &scif0_device,
352 &scif1_device, 365 &scif1_device,
@@ -382,6 +395,14 @@ void __init r8a7779_add_standard_devices(void)
382 ARRAY_SIZE(r8a7779_late_devices)); 395 ARRAY_SIZE(r8a7779_late_devices));
383} 396}
384 397
398void __init r8a7779_add_ether_device(struct sh_eth_plat_data *pdata)
399{
400 platform_device_register_resndata(&platform_bus, "sh_eth", -1,
401 ether_resources,
402 ARRAY_SIZE(ether_resources),
403 pdata, sizeof(*pdata));
404}
405
385/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ 406/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
386void __init __weak r8a7779_register_twd(void) { } 407void __init __weak r8a7779_register_twd(void) { }
387 408