Skip to contentSkip to conversation

ARM: shmobile: lager: enable Ether

PATCH Superseded Simon Horman 5 participants 12 messages Jul 1, 2013 – Jul 17, 2013

Subsystems (5)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v4 cover ARM: shmobile: lager: enable Ether

Hi,

this short series enables the on-board ethernet
of the r8a7790 SoC for on lager board.

It has a run-time dependency on
"sh_eth: add support for r8a7790 SoC"

It has been built on top of renesas-next-20130701.

Simon Horman (3):
ARM: shmobile: r8a7790: add Ether support
ARM: shmobile: lager: enable Ether
ARM: shmobile: lager: enable nfsroot in DTS

 arch/arm/boot/dts/r8a7790-lager.dts           |  2 +-
 arch/arm/mach-shmobile/board-lager.c          | 24 ++++++++++++++++++++++++
 arch/arm/mach-shmobile/clock-r8a7790.c        |  4 ++++
 arch/arm/mach-shmobile/include/mach/r8a7790.h |  3 +++
 arch/arm/mach-shmobile/setup-r8a7790.c        | 14 ++++++++++++++
 5 files changed, 46 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH v4 1/3 ARM: shmobile: r8a7790: add Ether support

Add Ether clock and platform device for R8A7779 SoC; add a function to register this device with board-specific platform data.

Based on a similar change for the r8a7779 by Sergei Shtylyov.

Cc Sergei Shtylyov <[email protected]>

---

This patch has a run-time dependency on "sh_eth: add support for r8a7790 SoC".

v3
* Use newly added "r8a7790-ether" instead of "sh-eth"

v2
* Do not add MSTP812, EtherAVB. It is not used.
* As suggested by Sergei Shtylyov <[email protected]>
- Move Ethernet element of MSTP enum to a separate line
- Move declaration of r8a7790_add_ether_device() to immediately after that of r8a7790_add_standard_devices()
- Add __initdata annotation to ether_resource.

---
 arch/arm/mach-shmobile/clock-r8a7790.c        |  4 ++++
 arch/arm/mach-shmobile/include/mach/r8a7790.h |  3 +++
 arch/arm/mach-shmobile/setup-r8a7790.c        | 14 ++++++++++++++
 3 files changed, 21 insertions(+)
arch/arm/mach-shmobile/clock-r8a7790.c +4 -0
index 62d8162..2f52c0f 100644
@@ -52,6 +52,7 @@
 #define SMSTPCR3 0xe615013c
 #define SMSTPCR5 0xe6150144
 #define SMSTPCR7 0xe615014c
+#define SMSTPCR8 0xe6150990
 
 #define MODEMR		0xE6160060
 #define SDCKCR		0xE6150074
@@ -182,6 +183,7 @@ static struct clk div6_clks[DIV6_NR] = {
 
 /* MSTP */
 enum {
+	MSTP813,
 	MSTP721, MSTP720,
 	MSTP717, MSTP716,
 	MSTP522,
@@ -192,6 +194,7 @@ enum {
 };
 
 static struct clk mstp_clks[MSTP_NR] = {
+	[MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
 	[MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */
 	[MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
 	[MSTP717] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */
@@ -260,6 +263,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
 	CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP717]),
 	CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP716]),
+	CLKDEV_DEV_ID("r8a7790-ether", &mstp_clks[MSTP813]),
 	CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
 	CLKDEV_DEV_ID("ee200000.mmcif", &mstp_clks[MSTP315]),
 	CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]),
arch/arm/mach-shmobile/include/mach/r8a7790.h +3 -0
index 7851cc1..b827b49 100644
@@ -1,7 +1,10 @@
 #ifndef __ASM_R8A7790_H__
 #define __ASM_R8A7790_H__
 
+#include <linux/sh_eth.h>
+
 void r8a7790_add_standard_devices(void);
+void r8a7790_add_ether_device(struct sh_eth_plat_data *pdata);
 void r8a7790_clock_init(void);
 void r8a7790_pinmux_init(void);
 void r8a7790_init_delay(void);
arch/arm/mach-shmobile/setup-r8a7790.c +14 -0
index d89cd83..fad4251 100644
@@ -31,6 +31,20 @@
 #include <mach/r8a7790.h>
 #include <asm/mach/arch.h>
 
+/* Ether */
+static struct resource ether_resources[] __initdata = {
+	DEFINE_RES_MEM(0xee700000, 0x400),
+	DEFINE_RES_IRQ(gic_spi(162)), /* IRQ0 */
+};
+
+void __init r8a7790_add_ether_device(struct sh_eth_plat_data *pdata)
+{
+	platform_device_register_resndata(&platform_bus, "r8a7790-ether", -1,
+					  ether_resources,
+					  ARRAY_SIZE(ether_resources),
+					  pdata, sizeof(*pdata));
+}
+
 static struct resource pfc_resources[] __initdata = {
 	DEFINE_RES_MEM(0xe6060000, 0x250),
 };
Signature · 1 line
1.8.2.1
#2 lore raw

PATCH v4 1/3 ARM: shmobile: r8a7790: add Ether support

Quoted 90 lines · Simon Horman

Add Ether clock and platform device for R8A7779 SoC; add a function to register this device with board-specific platform data.

Based on a similar change for the r8a7779 by Sergei Shtylyov.

Cc Sergei Shtylyov <[email protected]>

---

This patch has a run-time dependency on "sh_eth: add support for r8a7790 SoC".

v3
* Use newly added "r8a7790-ether" instead of "sh-eth"

v2
* Do not add MSTP812, EtherAVB. It is not used.
* As suggested by Sergei Shtylyov <[email protected]>
- Move Ethernet element of MSTP enum to a separate line
- Move declaration of r8a7790_add_ether_device() to immediately after that of r8a7790_add_standard_devices()
- Add __initdata annotation to ether_resource.

---
 arch/arm/mach-shmobile/clock-r8a7790.c        |  4 ++++
 arch/arm/mach-shmobile/include/mach/r8a7790.h |  3 +++
 arch/arm/mach-shmobile/setup-r8a7790.c        | 14 ++++++++++++++
 3 files changed, 21 insertions(+)
arch/arm/mach-shmobile/clock-r8a7790.c +4 -0
index 62d8162..2f52c0f 100644
@@ -52,6 +52,7 @@
 #define SMSTPCR3 0xe615013c
 #define SMSTPCR5 0xe6150144
 #define SMSTPCR7 0xe615014c
+#define SMSTPCR8 0xe6150990
 
 #define MODEMR		0xE6160060
 #define SDCKCR		0xE6150074
@@ -182,6 +183,7 @@ static struct clk div6_clks[DIV6_NR] = {
 
 /* MSTP */
 enum {
+	MSTP813,
 	MSTP721, MSTP720,
 	MSTP717, MSTP716,
 	MSTP522,
@@ -192,6 +194,7 @@ enum {
 };
 
 static struct clk mstp_clks[MSTP_NR] = {
+	[MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
 	[MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */
 	[MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
 	[MSTP717] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */
@@ -260,6 +263,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
 	CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP717]),
 	CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP716]),
+	CLKDEV_DEV_ID("r8a7790-ether", &mstp_clks[MSTP813]),
 	CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
 	CLKDEV_DEV_ID("ee200000.mmcif", &mstp_clks[MSTP315]),
 	CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]),
arch/arm/mach-shmobile/include/mach/r8a7790.h +3 -0
index 7851cc1..b827b49 100644
@@ -1,7 +1,10 @@
 #ifndef __ASM_R8A7790_H__
 #define __ASM_R8A7790_H__
 
+#include <linux/sh_eth.h>
+
 void r8a7790_add_standard_devices(void);
+void r8a7790_add_ether_device(struct sh_eth_plat_data *pdata);
 void r8a7790_clock_init(void);
 void r8a7790_pinmux_init(void);
 void r8a7790_init_delay(void);
arch/arm/mach-shmobile/setup-r8a7790.c +3 -0
index d89cd83..fad4251 100644
@@ -31,6 +31,20 @@
 #include <mach/r8a7790.h>
 #include <asm/mach/arch.h>
 
+/* Ether */
+static struct resource ether_resources[] __initdata = {
+	DEFINE_RES_MEM(0xee700000, 0x400),

arch/arm/mach-shmobile/setup-r8a7790.c line 46

Quoted 10 lines
arch/arm/mach-shmobile/setup-r8a7790.c +10 -0
+	DEFINE_RES_IRQ(gic_spi(162)), /* IRQ0 */
+};
+
+void __init r8a7790_add_ether_device(struct sh_eth_plat_data *pdata)
+{
+	platform_device_register_resndata(&platform_bus, "r8a7790-ether", -1,
+					  ether_resources,
+					  ARRAY_SIZE(ether_resources),
+					  pdata, sizeof(*pdata));
+}

Why are we hardcoding the address and interrupt of a device rather than describing it in the devicetree? This is the most trivial case to describe.

Thanks,
Mark.

Quoted 13 lines
arch/arm/mach-shmobile/setup-r8a7790.c +1 -0
+
 static struct resource pfc_resources[] __initdata = {
 	DEFINE_RES_MEM(0xe6060000, 0x250),
 };
Signature · 7 lines
1.8.2.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#3 lore raw

PATCH v4 1/3 ARM: shmobile: r8a7790: add Ether support

On Wed, Jul 17, 2013 at 10:11:03AM +0100, Mark Rutland wrote:

[snip]

Quoted 3 lines

Why are we hardcoding the address and interrupt of a device rather than describing it in the devicetree? This is the most trivial case to describe.

The approach that shmobile is taking is to either initialise a device entirely using C (non-DT) or entirely using DT. And moreover to either initialise a board using C or DT (though in the latter case some devices still end up being initialised in C to provide a minimally working system).

At this time for more recent boards we typically provide both a C and DT versions to initialise a board. The C version typically is able to initialise a fuller set of hardware while the DT version catches up.

In this case the device is being initialised in C. And this code is intended ti be used when a board and thus its SoC is initialised using C.

Once the SH ethernet driver and all its pre-requisite drivers and infrastructure can be initialised using DT then that will be used when initialising the board using DT.

#4 lore raw

PATCH v4 2/3 ARM: shmobile: lager: enable Ether

In reply to Simon Horman
Cc Laurent Pinchart <[email protected]>
Cc Sergei Shtylyov <[email protected]>

---

This patch has a build-time dependency on "sh_eth: add support for gpio reset". This patch has a run-time dependency on "sh_eth: add support for r8a7790 SoC".

v4
* Annotate ether_platdata as __initdata

v3
* Rebase

v2
* As suggested by Laurent Pinchart
- Do not manipilate sh_eth reset GPIO directly, rather, do so through newly proposed support for this in the sh_eth driver.
* A suggested by Sergei Shtylyov
- Move DTS portion into a separate patch

---
 arch/arm/mach-shmobile/board-lager.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm/mach-shmobile/board-lager.c +24 -0
index 0b4a1f9..7d5db20 100644
@@ -71,6 +71,17 @@ static __initdata struct gpio_keys_platform_data lager_keys_pdata = {
 	.nbuttons	= ARRAY_SIZE(gpio_buttons),
 };
 
+/* Ether */
+static struct sh_eth_plat_data ether_platdata __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,
+	.needs_gpio_reset	= 1,
+	.reset_gpio		= RCAR_GP_PIN(5, 31),
+};
+
 static const struct pinctrl_map lager_pinctrl_map[] = {
 	/* SCIF0 (CN19: DEBUG SERIAL0) */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
@@ -78,6 +89,17 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
 	/* SCIF1 (CN20: DEBUG SERIAL1) */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790",
 				  "scif1_data", "scif1"),
+	/* Ether */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_link", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_magic", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_mdio", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_rmii", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "intc_irq0", "intc"),
 };
 
 static void __init lager_add_standard_devices(void)
@@ -89,6 +111,8 @@ static void __init lager_add_standard_devices(void)
 	r8a7790_pinmux_init();
 
 	r8a7790_add_standard_devices();
+	r8a7790_add_ether_device(&ether_platdata);
+
 	platform_device_register_data(&platform_bus, "leds-gpio", -1,
 				      &lager_leds_pdata,
 				      sizeof(lager_leds_pdata));
Signature · 1 line
1.8.2.1
#5 lore raw

PATCH v4 2/3 ARM: shmobile: lager: enable Ether

Hi Simon,

Quoted 50 lines · On Monday 01 July 2013 16:20:33 Simon Horman wrote:
Cc Laurent Pinchart <[email protected]>
Cc Sergei Shtylyov <[email protected]>

---

This patch has a build-time dependency on "sh_eth: add support for gpio reset". This patch has a run-time dependency on "sh_eth: add support for r8a7790 SoC".

v4
* Annotate ether_platdata as __initdata

v3
* Rebase

v2
* As suggested by Laurent Pinchart
- Do not manipilate sh_eth reset GPIO directly, rather, do so through newly proposed support for this in the sh_eth driver.
* A suggested by Sergei Shtylyov
- Move DTS portion into a separate patch

---
 arch/arm/mach-shmobile/board-lager.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
(quoted diff) +0 -0

b/arch/arm/mach-shmobile/board-lager.c index 0b4a1f9..7d5db20 100644

arch/arm/mach-shmobile/board-lager.c +11 -0
@@ -71,6 +71,17 @@ static __initdata struct gpio_keys_platform_data
 lager_keys_pdata = { .nbuttons	= ARRAY_SIZE(gpio_buttons),
 };
 
+/* Ether */
+static struct sh_eth_plat_data ether_platdata __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,
+	.needs_gpio_reset	= 1,
+	.reset_gpio		= RCAR_GP_PIN(5, 31),
+};
+
 static const struct pinctrl_map lager_pinctrl_map[] = {
 	/* SCIF0 (CN19: DEBUG SERIAL0) */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",

arch/arm/mach-shmobile/board-lager.c static const struct pinctrl_map lager_pinctrl_map[] = { · line 96

Quoted 8 lines
arch/arm/mach-shmobile/board-lager.c +5 -0
@@ -78,6 +89,17 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
 	/* SCIF1 (CN20: DEBUG SERIAL1) */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790",
 				  "scif1_data", "scif1"),
+	/* Ether */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_link", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_magic", "eth"),

That pin isn't used on Lager, you can drop it.

By the way, the latest R8A7790 datasheet errata renamed the eth_magic pin to eth_wol. What would you think about renaming it to eth_wol in drivers/pinctrl/sh-pfc/pfc-r8a7790.c ?

Quoted 18 lines
arch/arm/mach-shmobile/board-lager.c +8 -0
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_mdio", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_rmii", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "intc_irq0", "intc"),
 };
 
 static void __init lager_add_standard_devices(void)
@@ -89,6 +111,8 @@ static void __init lager_add_standard_devices(void)
 	r8a7790_pinmux_init();
 
 	r8a7790_add_standard_devices();
+	r8a7790_add_ether_device(&ether_platdata);
+
 	platform_device_register_data(&platform_bus, "leds-gpio", -1,
 				      &lager_leds_pdata,
 				      sizeof(lager_leds_pdata));
Signature · 3 lines
Regards,

Laurent Pinchart
#6 lore raw

PATCH v4 2/3 ARM: shmobile: lager: enable Ether

Quoted 55 lines · Laurent Pinchart

Hi Simon,

Quoted 52 lines · On Monday 01 July 2013 16:20:33 Simon Horman wrote:
Cc Laurent Pinchart <[email protected]>
Cc Sergei Shtylyov <[email protected]>

---

This patch has a build-time dependency on "sh_eth: add support for gpio reset". This patch has a run-time dependency on "sh_eth: add support for r8a7790 SoC".

v4
* Annotate ether_platdata as __initdata

v3
* Rebase

v2
* As suggested by Laurent Pinchart
- Do not manipilate sh_eth reset GPIO directly, rather, do so through newly proposed support for this in the sh_eth driver.
* A suggested by Sergei Shtylyov
- Move DTS portion into a separate patch

---
 arch/arm/mach-shmobile/board-lager.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
(quoted diff) +0 -0

b/arch/arm/mach-shmobile/board-lager.c index 0b4a1f9..7d5db20 100644

arch/arm/mach-shmobile/board-lager.c +11 -0
@@ -71,6 +71,17 @@ static __initdata struct gpio_keys_platform_data
 lager_keys_pdata = { .nbuttons	= ARRAY_SIZE(gpio_buttons),
 };
 
+/* Ether */
+static struct sh_eth_plat_data ether_platdata __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,
+	.needs_gpio_reset	= 1,
+	.reset_gpio		= RCAR_GP_PIN(5, 31),
+};
+
 static const struct pinctrl_map lager_pinctrl_map[] = {
 	/* SCIF0 (CN19: DEBUG SERIAL0) */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
@@ -78,6 +89,17 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
 	/* SCIF1 (CN20: DEBUG SERIAL1) */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790",
Quoted 8 lines

arch/arm/mach-shmobile/board-lager.c static const struct pinctrl_map lager_pinctrl_map[] = { · line 96

Quoted 6 lines
arch/arm/mach-shmobile/board-lager.c +5 -0
 				  "scif1_data", "scif1"),
+	/* Ether */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_link", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_magic", "eth"),

That pin isn't used on Lager, you can drop it.

Thanks, I will drop that.

Quoted 3 lines

By the way, the latest R8A7790 datasheet errata renamed the eth_magic pin to eth_wol. What would you think about renaming it to eth_wol in drivers/pinctrl/sh-pfc/pfc-r8a7790.c ?

I do not have a strong opinion but changing it sounds entirely reasonable to me.

Quoted 18 lines
Quoted 18 lines
arch/arm/mach-shmobile/board-lager.c +8 -0
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_mdio", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_rmii", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "intc_irq0", "intc"),
 };
 
 static void __init lager_add_standard_devices(void)
@@ -89,6 +111,8 @@ static void __init lager_add_standard_devices(void)
 	r8a7790_pinmux_init();
 
 	r8a7790_add_standard_devices();
+	r8a7790_add_ether_device(&ether_platdata);
+
 	platform_device_register_data(&platform_bus, "leds-gpio", -1,
 				      &lager_leds_pdata,
 				      sizeof(lager_leds_pdata));
#7 lore raw

PATCH v4 2/3 ARM: shmobile: lager: enable Ether

Hi Simon,

Quoted 67 lines · On Tuesday 02 July 2013 10:22:28 Simon Horman wrote:
Quoted 50 lines · Laurent Pinchart
Quoted 49 lines · On Monday 01 July 2013 16:20:33 Simon Horman wrote:
Cc Laurent Pinchart <[email protected]>
Cc Sergei Shtylyov <[email protected]>

---

This patch has a build-time dependency on "sh_eth: add support for gpio reset". This patch has a run-time dependency on "sh_eth: add support for r8a7790 SoC".

v4
* Annotate ether_platdata as __initdata

v3
* Rebase

v2
* As suggested by Laurent Pinchart
- Do not manipilate sh_eth reset GPIO directly, rather, do so through newly proposed support for this in the sh_eth driver.
* A suggested by Sergei Shtylyov
- Move DTS portion into a separate patch

---

 arch/arm/mach-shmobile/board-lager.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
(quoted diff) +0 -0

b/arch/arm/mach-shmobile/board-lager.c index 0b4a1f9..7d5db20 100644

arch/arm/mach-shmobile/board-lager.c +11 -0
@@ -71,6 +71,17 @@ static __initdata struct gpio_keys_platform_data
 lager_keys_pdata = { .nbuttons	= ARRAY_SIZE(gpio_buttons),
 };
 
+/* Ether */
+static struct sh_eth_plat_data ether_platdata __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,
+	.needs_gpio_reset	= 1,
+	.reset_gpio		= RCAR_GP_PIN(5, 31),
+};
+
 
Quoted 15 lines

arch/arm/mach-shmobile/board-lager.c static const struct pinctrl_map lager_pinctrl_map[] = · line 97

Quoted 13 lines
arch/arm/mach-shmobile/board-lager.c +0 -0
 static const struct pinctrl_map lager_pinctrl_map[] = {
 	/* SCIF0 (CN19: DEBUG SERIAL0) */
arch/arm/mach-shmobile/board-lager.c +5 -0
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
@@ -78,6 +89,17 @@ static const struct pinctrl_map lager_pinctrl_map[] =
 {
 	/* SCIF1 (CN20: DEBUG SERIAL1) */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790",
 				  "scif1_data", "scif1"),
+	/* Ether */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_link", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_magic", "eth"),

That pin isn't used on Lager, you can drop it.

Quoted 8 lines

Thanks, I will drop that.

Quoted 3 lines

By the way, the latest R8A7790 datasheet errata renamed the eth_magic pin to eth_wol. What would you think about renaming it to eth_wol in drivers/pinctrl/sh-pfc/pfc-r8a7790.c ?

I do not have a strong opinion but changing it sounds entirely reasonable to me.

The errata renamed the pin, but the latest datasheet, supposed to include the errata, still uses eth_magic. Let's not bother then (even though wol would be much more descriptive than magic).

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
arch/arm/mach-shmobile/board-lager.c +6 -0
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_mdio", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "eth_rmii", "eth"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7790",
+				  "intc_irq0", "intc"),
 };
 

static void __init lager_add_standard_devices(void)

arch/arm/mach-shmobile/board-lager.c +2 -0
@@ -89,6 +111,8 @@ static void __init lager_add_standard_devices(void)
 	r8a7790_pinmux_init();
 	r8a7790_add_standard_devices();
+	r8a7790_add_ether_device(&ether_platdata);
+
 	platform_device_register_data(&platform_bus, "leds-gpio", -1,
 				      &lager_leds_pdata,
 				      sizeof(lager_leds_pdata));
Signature · 3 lines
Regards,

Laurent Pinchart
#8 lore raw

PATCH v4 3/3 ARM: shmobile: lager: enable nfsroot in DTS

In reply to Simon Horman

Now that Ether support has been added to the lager board it is possible to use nfsroot. This configuration is in line with that of other shmobile boards.

Cc Sergei Shtylyov <[email protected]>

---

This patch has a run-time dependency on "ARM: shmobile: lager: enable Ether"

v2
* Split out as a new patch from "ARM: shmobile: lager: enable Ether"

---
 arch/arm/boot/dts/r8a7790-lager.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/r8a7790-lager.dts +1 -1
index 09a84fc..b2f61f0 100644
@@ -16,7 +16,7 @@
 	compatible = "renesas,lager", "renesas,r8a7790";
 
 	chosen {
-		bootargs = "console=ttySC6,115200 ignore_loglevel";
+		bootargs = "console=ttySC6,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096 rw";
 	};
 
 	memory at 40000000 {
Signature · 1 line
1.8.2.1
#9 lore raw

v4 cover ARM: shmobile: lager: enable Ether

In reply to Simon Horman

Hi Simon,

Quoted 9 lines · On Monday 01 July 2013 16:20:31 Simon Horman wrote:

Hi,

this short series enables the on-board ethernet
of the r8a7790 SoC for on lager board.

It has a run-time dependency on
"sh_eth: add support for r8a7790 SoC"

It has been built on top of renesas-next-20130701.

Do you plan to respin this series on top of your latest devel branch ? I've quickly rebased it and now get receive FIFO overflows when booting over NFS, followed by the kernel disabling the sh-eth IRQ.

Quoted 11 lines

Simon Horman (3):
ARM: shmobile: r8a7790: add Ether support
ARM: shmobile: lager: enable Ether
ARM: shmobile: lager: enable nfsroot in DTS

 arch/arm/boot/dts/r8a7790-lager.dts           |  2 +-
 arch/arm/mach-shmobile/board-lager.c          | 24 ++++++++++++++++++++++++
arch/arm/mach-shmobile/clock-r8a7790.c        |  4 ++++
 arch/arm/mach-shmobile/include/mach/r8a7790.h |  3 +++
 arch/arm/mach-shmobile/setup-r8a7790.c        | 14 ++++++++++++++
 5 files changed, 46 insertions(+), 1 deletion(-)
Signature · 3 lines
Regards,

Laurent Pinchart
#10 lore raw

v4 cover ARM: shmobile: lager: enable Ether

Hello.

Quoted 11 lines · Laurent Pinchart
Quoted 7 lines

this short series enables the on-board ethernet
of the r8a7790 SoC for on lager board.

It has a run-time dependency on
"sh_eth: add support for r8a7790 SoC"

It has been built on top of renesas-next-20130701.

Do you plan to respin this series on top of your latest devel branch ? I've quickly rebased it and now get receive FIFO overflows when booting over NFS, followed by the kernel disabling the sh-eth IRQ.

That disabling of IRQ should have been fixed in 3.10.

WBR, Sergei

#11 lore raw

v4 cover ARM: shmobile: lager: enable Ether

In reply to Laurent Pinchart
Quoted 8 lines · Laurent Pinchart

Hi Simon,

Quoted 5 lines · On Monday 01 July 2013 16:20:31 Simon Horman wrote:

Hi,

this short series enables the on-board ethernet
of the r8a7790 SoC for on lager board.

Quoted 8 lines
Quoted 4 lines

It has a run-time dependency on
"sh_eth: add support for r8a7790 SoC"

It has been built on top of renesas-next-20130701.

Do you plan to respin this series on top of your latest devel branch ? I've quickly rebased it and now get receive FIFO overflows when booting over NFS, followed by the kernel disabling the sh-eth IRQ.

I am planning to respin it and the driver changes once net-next re-opens. Which I am expecting to be next week.

Quoted 22 lines
Quoted 11 lines

Simon Horman (3):
ARM: shmobile: r8a7790: add Ether support
ARM: shmobile: lager: enable Ether
ARM: shmobile: lager: enable nfsroot in DTS

 arch/arm/boot/dts/r8a7790-lager.dts           |  2 +-
 arch/arm/mach-shmobile/board-lager.c          | 24 ++++++++++++++++++++++++
arch/arm/mach-shmobile/clock-r8a7790.c        |  4 ++++
 arch/arm/mach-shmobile/include/mach/r8a7790.h |  3 +++
 arch/arm/mach-shmobile/setup-r8a7790.c        | 14 ++++++++++++++
 5 files changed, 46 insertions(+), 1 deletion(-)
Signature · 8 lines
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html