linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3]
@ 2013-05-14  2:39 Simon Horman
  2013-05-14  2:39 ` [PATCH v2 1/3] ARM: shmobile: r8a7790: add Ether support Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Simon Horman @ 2013-05-14  2:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

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

It is based on the renesas-next-20130513 tag of my renesas tree.

Dependencies noted in individual patches.

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          | 25 +++++++++++++++++++++++++
 arch/arm/mach-shmobile/clock-r8a7790.c        |  4 ++++
 arch/arm/mach-shmobile/include/mach/r8a7790.h |  3 +++
 arch/arm/mach-shmobile/setup-r8a7790.c        | 15 +++++++++++++++
 5 files changed, 48 insertions(+), 1 deletion(-)

-- 
1.8.2.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/3] ARM: shmobile: r8a7790: add Ether support
  2013-05-14  2:39 [PATCH v2 0/3] Simon Horman
@ 2013-05-14  2:39 ` Simon Horman
  2013-05-14  2:39 ` [PATCH v2 2/3] ARM: shmobile: lager: enable Ether Simon Horman
  2013-05-14  2:39 ` [PATCH v2 3/3] ARM: shmobile: lager: enable nfsroot in DTS Simon Horman
  2 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2013-05-14  2:39 UTC (permalink / raw)
  To: linux-arm-kernel

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 <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---

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

v2
* Do not add MSTP812, EtherAVB. It is not used.
* As suggested by Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
  - 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        | 15 +++++++++++++++
 3 files changed, 22 insertions(+)

diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index b393592..b21ff6b 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -50,6 +50,7 @@
 #define SMSTPCR2 0xe6150138
 #define SMSTPCR3 0xe615013c
 #define SMSTPCR7 0xe615014c
+#define SMSTPCR8 0xe6150990
 
 #define MODEMR		0xE6160060
 #define SDCKCR		0xE6150074
@@ -180,6 +181,7 @@ static struct clk div6_clks[DIV6_NR] = {
 
 /* MSTP */
 enum {
+	MSTP813,
 	MSTP721, MSTP720,
 	MSTP304,
 	MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202,
@@ -187,6 +189,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 */
 	[MSTP304] = SH_CLK_MSTP32(&cp_clk, SMSTPCR3, 4, 0), /* TPU0 */
@@ -249,6 +252,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP202]),
 	CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP721]),
 	CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
+	CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP813]),
 };
 
 #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31)		\
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
index 2e919e6..89e4f70 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
@@ -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_timer_init(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index eeef5f6..c56deab 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -30,6 +30,21 @@
 #include <mach/r8a7790.h>
 #include <asm/mach/arch.h>
 
+
+/* Ether */
+static __initdata struct resource ether_resources[] = {
+	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, "sh-eth", -1,
+					  ether_resources,
+					  ARRAY_SIZE(ether_resources),
+					  pdata, sizeof(*pdata));
+}
+
 static const struct resource pfc_resources[] = {
 	DEFINE_RES_MEM(0xe6060000, 0x250),
 };
-- 
1.8.2.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] ARM: shmobile: lager: enable Ether
  2013-05-14  2:39 [PATCH v2 0/3] Simon Horman
  2013-05-14  2:39 ` [PATCH v2 1/3] ARM: shmobile: r8a7790: add Ether support Simon Horman
@ 2013-05-14  2:39 ` Simon Horman
  2013-05-14  9:21   ` Laurent Pinchart
  2013-05-14  2:39 ` [PATCH v2 3/3] ARM: shmobile: lager: enable nfsroot in DTS Simon Horman
  2 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2013-05-14  2:39 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---

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".

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 | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index 6a1ba38..c06f0da 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <linux/gpio.h>
 #include <linux/interrupt.h>
 #include <linux/irqchip.h>
 #include <linux/kernel.h>
@@ -52,6 +53,17 @@ static struct gpio_led_platform_data lager_leds_pdata = {
 	.num_leds	= ARRAY_SIZE(lager_leds),
 };
 
+/* Ether */
+static struct sh_eth_plat_data ether_platdata = {
+	.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",
@@ -59,6 +71,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)
@@ -73,6 +96,8 @@ static void __init lager_add_standard_devices(void)
 	platform_device_register_data(&platform_bus, "leds-gpio", -1,
 				      &lager_leds_pdata,
 				      sizeof(lager_leds_pdata));
+
+	r8a7790_add_ether_device(&ether_platdata);
 }
 
 static const char *lager_boards_compat_dt[] __initdata = {
-- 
1.8.2.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/3] ARM: shmobile: lager: enable nfsroot in DTS
  2013-05-14  2:39 [PATCH v2 0/3] Simon Horman
  2013-05-14  2:39 ` [PATCH v2 1/3] ARM: shmobile: r8a7790: add Ether support Simon Horman
  2013-05-14  2:39 ` [PATCH v2 2/3] ARM: shmobile: lager: enable Ether Simon Horman
@ 2013-05-14  2:39 ` Simon Horman
  2 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2013-05-14  2:39 UTC (permalink / raw)
  To: linux-arm-kernel

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 <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---

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(-)

diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index 09a84fc..b2f61f0 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -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 {
-- 
1.8.2.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] ARM: shmobile: lager: enable Ether
  2013-05-14  2:39 ` [PATCH v2 2/3] ARM: shmobile: lager: enable Ether Simon Horman
@ 2013-05-14  9:21   ` Laurent Pinchart
  2013-05-14 13:02     ` Sergei Shtylyov
  0 siblings, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2013-05-14  9:21 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Tuesday 14 May 2013 11:39:30 Simon Horman wrote:
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Is there any ongoing work on DT bindings for sh-eth ?

> ---
> 
> 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".
> 
> 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 | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/arch/arm/mach-shmobile/board-lager.c
> b/arch/arm/mach-shmobile/board-lager.c index 6a1ba38..c06f0da 100644
> --- a/arch/arm/mach-shmobile/board-lager.c
> +++ b/arch/arm/mach-shmobile/board-lager.c
> @@ -18,6 +18,7 @@
>   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
> USA */
> 
> +#include <linux/gpio.h>
>  #include <linux/interrupt.h>
>  #include <linux/irqchip.h>
>  #include <linux/kernel.h>
> @@ -52,6 +53,17 @@ static struct gpio_led_platform_data lager_leds_pdata = {
> .num_leds	= ARRAY_SIZE(lager_leds),
>  };
> 
> +/* Ether */
> +static struct sh_eth_plat_data ether_platdata = {
> +	.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",
> @@ -59,6 +71,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)
> @@ -73,6 +96,8 @@ static void __init lager_add_standard_devices(void)
>  	platform_device_register_data(&platform_bus, "leds-gpio", -1,
>  				      &lager_leds_pdata,
>  				      sizeof(lager_leds_pdata));
> +
> +	r8a7790_add_ether_device(&ether_platdata);
>  }
> 
>  static const char *lager_boards_compat_dt[] __initdata = {

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] ARM: shmobile: lager: enable Ether
  2013-05-14  9:21   ` Laurent Pinchart
@ 2013-05-14 13:02     ` Sergei Shtylyov
  2013-05-17 22:23       ` Sergei Shtylyov
  0 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2013-05-14 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 14-05-2013 13:21, Laurent Pinchart wrote:

>> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Is there any ongoing work on DT bindings for sh-eth ?

    At least there was -- by Nobuhiro Iwamatsu. I don't think converting 
platform data to DT properties makes sense since sh_eth have some 
procedural platform data. I also don't think working on DT makes sense 
until the driver is cleaned up of all its #ifdef'ery (that work is 
partly being done by Nobuhiro and I'm planning to start the big #ifdef 
cleanup this week).

WBR, Sergei

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] ARM: shmobile: lager: enable Ether
  2013-05-14 13:02     ` Sergei Shtylyov
@ 2013-05-17 22:23       ` Sergei Shtylyov
  0 siblings, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2013-05-17 22:23 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 05/14/2013 05:02 PM, Sergei Shtylyov wrote:

>
>>> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
>
>> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
>> Is there any ongoing work on DT bindings for sh-eth ?
>
>    At least there was -- by Nobuhiro Iwamatsu. I don't think 
> converting platform data to DT properties makes sense since sh_eth 
> have some procedural platform data. I also don't think working on DT 
> makes sense until the driver is cleaned up of all its #ifdef'ery (that 
> work is partly being done by Nobuhiro and I'm planning to start the 
> big #ifdef cleanup this week).

     Alas, not this week apparently as my management has shifted 
priorities thrice this week. So maybe late next week now...

WBR, Sergei

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-05-17 22:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14  2:39 [PATCH v2 0/3] Simon Horman
2013-05-14  2:39 ` [PATCH v2 1/3] ARM: shmobile: r8a7790: add Ether support Simon Horman
2013-05-14  2:39 ` [PATCH v2 2/3] ARM: shmobile: lager: enable Ether Simon Horman
2013-05-14  9:21   ` Laurent Pinchart
2013-05-14 13:02     ` Sergei Shtylyov
2013-05-17 22:23       ` Sergei Shtylyov
2013-05-14  2:39 ` [PATCH v2 3/3] ARM: shmobile: lager: enable nfsroot in DTS Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).