| From 5513c831f7f4e16340e1ea0dee037ef1fbf5a833 Mon Sep 17 00:00:00 2001 |
| From: Simon Horman <horms+renesas@verge.net.au> |
| Date: Tue, 6 Aug 2013 16:50:10 +0900 |
| Subject: ARM: shmobile: lager: enable Ether |
| |
| Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| (cherry picked from commit 4901e136aa5c35873701156c4c0af5b3c2c8faee) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| arch/arm/mach-shmobile/board-lager.c | 29 +++++++++++++++++++++++++++++ |
| 1 file changed, 29 insertions(+) |
| |
| diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c |
| index aa8be240..4872939c 100644 |
| --- a/arch/arm/mach-shmobile/board-lager.c |
| +++ b/arch/arm/mach-shmobile/board-lager.c |
| @@ -31,6 +31,7 @@ |
| #include <linux/platform_device.h> |
| #include <linux/regulator/fixed.h> |
| #include <linux/regulator/machine.h> |
| +#include <linux/sh_eth.h> |
| #include <mach/common.h> |
| #include <mach/irqs.h> |
| #include <mach/r8a7790.h> |
| @@ -91,6 +92,20 @@ static struct resource mmcif1_resources[] __initdata = { |
| DEFINE_RES_IRQ(gic_spi(170)), |
| }; |
| |
| +/* Ether */ |
| +static struct sh_eth_plat_data ether_pdata __initdata = { |
| + .phy = 0x1, |
| + .edmac_endian = EDMAC_LITTLE_ENDIAN, |
| + .register_type = SH_ETH_REG_FAST_RCAR, |
| + .phy_interface = PHY_INTERFACE_MODE_RMII, |
| + .ether_link_active_low = 1, |
| +}; |
| + |
| +static struct resource ether_resources[] __initdata = { |
| + DEFINE_RES_MEM(0xee700000, 0x400), |
| + DEFINE_RES_IRQ(gic_spi(162)), |
| +}; |
| + |
| static const struct pinctrl_map lager_pinctrl_map[] = { |
| /* SCIF0 (CN19: DEBUG SERIAL0) */ |
| PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790", |
| @@ -103,6 +118,15 @@ static const struct pinctrl_map lager_pinctrl_map[] = { |
| "mmc1_data8", "mmc1"), |
| PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.1", "pfc-r8a7790", |
| "mmc1_ctrl", "mmc1"), |
| + /* Ether */ |
| + PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790", |
| + "eth_link", "eth"), |
| + PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790", |
| + "eth_mdio", "eth"), |
| + PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790", |
| + "eth_rmii", "eth"), |
| + PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790", |
| + "intc_irq0", "intc"), |
| }; |
| |
| static void __init lager_add_standard_devices(void) |
| @@ -125,6 +149,11 @@ static void __init lager_add_standard_devices(void) |
| platform_device_register_resndata(&platform_bus, "sh_mmcif", 1, |
| mmcif1_resources, ARRAY_SIZE(mmcif1_resources), |
| &mmcif1_pdata, sizeof(mmcif1_pdata)); |
| + |
| + platform_device_register_resndata(&platform_bus, "r8a7790-ether", -1, |
| + ether_resources, |
| + ARRAY_SIZE(ether_resources), |
| + ðer_pdata, sizeof(ether_pdata)); |
| } |
| |
| static const char *lager_boards_compat_dt[] __initdata = { |
| -- |
| 1.8.4.3.gca3854a |
| |