* [PATCH 0/2] ARM: shmobile: lager: enable Ether
@ 2013-05-10 8:05 Simon Horman
2013-05-10 8:05 ` [PATCH 1/2] ARM: shmobile: r8a7790: add Ether support Simon Horman
2013-05-10 8:05 ` [PATCH 2/2] ARM: shmobile: lager: enable Ether Simon Horman
0 siblings, 2 replies; 12+ messages in thread
From: Simon Horman @ 2013-05-10 8:05 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
this short series enables the on-board ethernet
of the r8a7790 SoC for on lager baord.
It is based on the renesas-next-20130509 tag of my renesas tree.
It has a run-time dependency on
"sh_eth: add support for r8a7790 SoC"
Simon Horman (2):
ARM: shmobile: r8a7790: add Ether support
ARM: shmobile: lager: enable Ether
arch/arm/boot/dts/r8a7790-lager.dts | 2 +-
arch/arm/mach-shmobile/board-lager.c | 26 ++++++++++++++++++++++++++
arch/arm/mach-shmobile/clock-r8a7790.c | 6 +++++-
arch/arm/mach-shmobile/include/mach/r8a7790.h | 3 +++
arch/arm/mach-shmobile/setup-r8a7790.c | 15 +++++++++++++++
5 files changed, 50 insertions(+), 2 deletions(-)
--
1.8.2.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] ARM: shmobile: r8a7790: add Ether support
2013-05-10 8:05 [PATCH 0/2] ARM: shmobile: lager: enable Ether Simon Horman
@ 2013-05-10 8:05 ` Simon Horman
2013-05-10 10:26 ` Sergei Shtylyov
2013-05-10 8:05 ` [PATCH 2/2] ARM: shmobile: lager: enable Ether Simon Horman
1 sibling, 1 reply; 12+ messages in thread
From: Simon Horman @ 2013-05-10 8:05 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".
---
arch/arm/mach-shmobile/clock-r8a7790.c | 6 +++++-
arch/arm/mach-shmobile/include/mach/r8a7790.h | 3 +++
arch/arm/mach-shmobile/setup-r8a7790.c | 15 +++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index bedd20c..2c3123e 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -49,6 +49,7 @@
#define SMSTPCR2 0xe6150138
#define SMSTPCR7 0xe615014c
+#define SMSTPCR8 0xe6150990
#define MODEMR 0xE6160060
#define SDCKCR 0xE6150074
@@ -178,9 +179,11 @@ static struct clk div6_clks[DIV6_NR] = {
};
/* MSTP */
-enum { MSTP721, MSTP720,
+enum { MSTP813, MSTP812, MSTP721, MSTP720,
MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP_NR };
static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
+ [MSTP812] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 12, 0), /* EtherAVB */
[MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */
[MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
[MSTP216] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 16, 0), /* SCIFB2 */
@@ -242,6 +245,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..95b8f7e 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
@@ -1,9 +1,12 @@
#ifndef __ASM_R8A7790_H__
#define __ASM_R8A7790_H__
+#include <linux/sh_eth.h>
+
void r8a7790_add_standard_devices(void);
void r8a7790_clock_init(void);
void r8a7790_pinmux_init(void);
void r8a7790_timer_init(void);
+void r8a7790_add_ether_device(struct sh_eth_plat_data *pdata);
#endif /* __ASM_R8A7790_H__ */
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index eeef5f6..8ed0d7b 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 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] 12+ messages in thread
* [PATCH 2/2] ARM: shmobile: lager: enable Ether
2013-05-10 8:05 [PATCH 0/2] ARM: shmobile: lager: enable Ether Simon Horman
2013-05-10 8:05 ` [PATCH 1/2] ARM: shmobile: r8a7790: add Ether support Simon Horman
@ 2013-05-10 8:05 ` Simon Horman
2013-05-10 10:35 ` Sergei Shtylyov
2013-05-13 22:31 ` Laurent Pinchart
1 sibling, 2 replies; 12+ messages in thread
From: Simon Horman @ 2013-05-10 8:05 UTC (permalink / raw)
To: linux-arm-kernel
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".
---
arch/arm/boot/dts/r8a7790-lager.dts | 2 +-
arch/arm/mach-shmobile/board-lager.c | 26 ++++++++++++++++++++++++++
2 files changed, 27 insertions(+), 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 {
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index 6a1ba38..0b8112d 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,15 @@ 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,
+};
+
static const struct pinctrl_map lager_pinctrl_map[] = {
/* SCIF0 (CN19: DEBUG SERIAL0) */
PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
@@ -59,6 +69,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 +94,11 @@ static void __init lager_add_standard_devices(void)
platform_device_register_data(&platform_bus, "leds-gpio", -1,
&lager_leds_pdata,
sizeof(lager_leds_pdata));
+
+ /* Ether RESET */
+ gpio_request_one(RCAR_GP_PIN(5, 31), GPIOF_OUT_INIT_HIGH, NULL);
+
+ r8a7790_add_ether_device(ðer_platdata);
}
static const char *lager_boards_compat_dt[] __initdata = {
--
1.8.2.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 1/2] ARM: shmobile: r8a7790: add Ether support
2013-05-10 8:05 ` [PATCH 1/2] ARM: shmobile: r8a7790: add Ether support Simon Horman
@ 2013-05-10 10:26 ` Sergei Shtylyov
2013-05-13 0:43 ` Simon Horman
0 siblings, 1 reply; 12+ messages in thread
From: Sergei Shtylyov @ 2013-05-10 10:26 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 10-05-2013 12:05, Simon Horman wrote:
> 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".
> ---
> arch/arm/mach-shmobile/clock-r8a7790.c | 6 +++++-
> arch/arm/mach-shmobile/include/mach/r8a7790.h | 3 +++
> arch/arm/mach-shmobile/setup-r8a7790.c | 15 +++++++++++++++
> 3 files changed, 23 insertions(+), 1 deletion(-)
> diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
> index bedd20c..2c3123e 100644
> --- a/arch/arm/mach-shmobile/clock-r8a7790.c
> +++ b/arch/arm/mach-shmobile/clock-r8a7790.c
[...]
> @@ -178,9 +179,11 @@ static struct clk div6_clks[DIV6_NR] = {
> };
>
> /* MSTP */
> -enum { MSTP721, MSTP720,
> +enum { MSTP813, MSTP812,
I think these two should be on a line of their own...
> MSTP721, MSTP720,
> MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP_NR };
> static struct clk mstp_clks[MSTP_NR] = {
> + [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
> + [MSTP812] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 12, 0), /* EtherAVB */
> [MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */
> [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
> [MSTP216] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 16, 0), /* SCIFB2 */
[...]
> diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
> index 2e919e6..95b8f7e 100644
> --- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
> +++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
> @@ -1,9 +1,12 @@
> #ifndef __ASM_R8A7790_H__
> #define __ASM_R8A7790_H__
>
> +#include <linux/sh_eth.h>
> +
> void r8a7790_add_standard_devices(void);
> void r8a7790_clock_init(void);
> void r8a7790_pinmux_init(void);
> void r8a7790_timer_init(void);
> +void r8a7790_add_ether_device(struct sh_eth_plat_data *pdata);
Perhaps better place is right after r8a7790_add_standard_devices()...
> #endif /* __ASM_R8A7790_H__ */
> diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
> index eeef5f6..8ed0d7b 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 struct resource ether_resources[] = {
You missed the '__initdata' annotation.
> + DEFINE_RES_MEM(0xee700000, 0x400),
> + DEFINE_RES_IRQ(gic_spi(162)), /* IRQ0 */
> +};
WBR, Sergei
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/2] ARM: shmobile: lager: enable Ether
2013-05-10 8:05 ` [PATCH 2/2] ARM: shmobile: lager: enable Ether Simon Horman
@ 2013-05-10 10:35 ` Sergei Shtylyov
2013-05-13 0:40 ` Simon Horman
2013-05-13 22:31 ` Laurent Pinchart
1 sibling, 1 reply; 12+ messages in thread
From: Sergei Shtylyov @ 2013-05-10 10:35 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 10-05-2013 12:05, Simon Horman wrote:
> 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".
> ---
> arch/arm/boot/dts/r8a7790-lager.dts | 2 +-
> arch/arm/mach-shmobile/board-lager.c | 26 ++++++++++++++++++++++++++
> 2 files changed, 27 insertions(+), 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 {
Perhaps you shouldn't mix .dts changes with source changes?
> diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
> index 6a1ba38..0b8112d 100644
> --- a/arch/arm/mach-shmobile/board-lager.c
> +++ b/arch/arm/mach-shmobile/board-lager.c
[...]
> @@ -59,6 +69,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"),
I thought MDIO bus was a part of RMII. At least Wikipedia told me
so. :-)
WBR, Sergei
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/2] ARM: shmobile: lager: enable Ether
2013-05-10 10:35 ` Sergei Shtylyov
@ 2013-05-13 0:40 ` Simon Horman
2013-05-13 13:04 ` Sergei Shtylyov
0 siblings, 1 reply; 12+ messages in thread
From: Simon Horman @ 2013-05-13 0:40 UTC (permalink / raw)
To: linux-arm-kernel
[ CC Laurent ]
On Fri, May 10, 2013 at 02:35:01PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 10-05-2013 12:05, Simon Horman wrote:
>
> >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".
> >---
> > arch/arm/boot/dts/r8a7790-lager.dts | 2 +-
> > arch/arm/mach-shmobile/board-lager.c | 26 ++++++++++++++++++++++++++
> > 2 files changed, 27 insertions(+), 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 {
>
> Perhaps you shouldn't mix .dts changes with source changes?
Sure, I can break that out into a separate patch.
>
> >diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
> >index 6a1ba38..0b8112d 100644
> >--- a/arch/arm/mach-shmobile/board-lager.c
> >+++ b/arch/arm/mach-shmobile/board-lager.c
> [...]
> >@@ -59,6 +69,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"),
>
> I thought MDIO bus was a part of RMII. At least Wikipedia told
> me so. :-)
Is the implication that you think that the eth_mdio and eth_rmii
groups should be combined?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] ARM: shmobile: r8a7790: add Ether support
2013-05-10 10:26 ` Sergei Shtylyov
@ 2013-05-13 0:43 ` Simon Horman
2013-05-13 13:07 ` Sergei Shtylyov
0 siblings, 1 reply; 12+ messages in thread
From: Simon Horman @ 2013-05-13 0:43 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, May 10, 2013 at 02:26:50PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 10-05-2013 12:05, Simon Horman wrote:
>
> >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".
> >---
> > arch/arm/mach-shmobile/clock-r8a7790.c | 6 +++++-
> > arch/arm/mach-shmobile/include/mach/r8a7790.h | 3 +++
> > arch/arm/mach-shmobile/setup-r8a7790.c | 15 +++++++++++++++
> > 3 files changed, 23 insertions(+), 1 deletion(-)
>
> >diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
> >index bedd20c..2c3123e 100644
> >--- a/arch/arm/mach-shmobile/clock-r8a7790.c
> >+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
> [...]
> >@@ -178,9 +179,11 @@ static struct clk div6_clks[DIV6_NR] = {
> > };
> >
> > /* MSTP */
> >-enum { MSTP721, MSTP720,
> >+enum { MSTP813, MSTP812,
>
> I think these two should be on a line of their own...
>
> >MSTP721, MSTP720,
> > MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP_NR };
> > static struct clk mstp_clks[MSTP_NR] = {
> >+ [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
> >+ [MSTP812] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 12, 0), /* EtherAVB */
> > [MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */
> > [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
> > [MSTP216] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 16, 0), /* SCIFB2 */
> [...]
> >diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
> >index 2e919e6..95b8f7e 100644
> >--- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
> >+++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
> >@@ -1,9 +1,12 @@
> > #ifndef __ASM_R8A7790_H__
> > #define __ASM_R8A7790_H__
> >
> >+#include <linux/sh_eth.h>
> >+
> > void r8a7790_add_standard_devices(void);
> > void r8a7790_clock_init(void);
> > void r8a7790_pinmux_init(void);
> > void r8a7790_timer_init(void);
> >+void r8a7790_add_ether_device(struct sh_eth_plat_data *pdata);
>
> Perhaps better place is right after r8a7790_add_standard_devices()...
Is the implication that the struct sh_eth_plat_data can be defined
in setup-r8a7790.c? Or do you for see adding a struct sh_eth_plat_data
parameter to r8a7790_add_standard_devices() ?
> > #endif /* __ASM_R8A7790_H__ */
> >diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
> >index eeef5f6..8ed0d7b 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 struct resource ether_resources[] = {
>
> You missed the '__initdata' annotation.
Thanks, I will fix that.
>
> >+ DEFINE_RES_MEM(0xee700000, 0x400),
> >+ DEFINE_RES_IRQ(gic_spi(162)), /* IRQ0 */
> >+};
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/2] ARM: shmobile: lager: enable Ether
2013-05-13 0:40 ` Simon Horman
@ 2013-05-13 13:04 ` Sergei Shtylyov
2013-05-13 22:30 ` Laurent Pinchart
0 siblings, 1 reply; 12+ messages in thread
From: Sergei Shtylyov @ 2013-05-13 13:04 UTC (permalink / raw)
To: linux-arm-kernel
On 13.05.2013 4:40, Simon Horman wrote:
> [ CC Laurent ]
>>> 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".
[...]
>>> diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
>>> index 6a1ba38..0b8112d 100644
>>> --- a/arch/arm/mach-shmobile/board-lager.c
>>> +++ b/arch/arm/mach-shmobile/board-lager.c
>> [...]
>>> @@ -59,6 +69,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"),
>> I thought MDIO bus was a part of RMII. At least Wikipedia told
>> me so. :-)
> Is the implication that you think that the eth_mdio and eth_rmii
> groups should be combined?
Well, yes.
WBR, Sergei
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] ARM: shmobile: r8a7790: add Ether support
2013-05-13 0:43 ` Simon Horman
@ 2013-05-13 13:07 ` Sergei Shtylyov
2013-05-14 0:29 ` Simon Horman
0 siblings, 1 reply; 12+ messages in thread
From: Sergei Shtylyov @ 2013-05-13 13:07 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 13-05-2013 4:43, Simon Horman wrote:
>>> 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>
[...]
>>> diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
>>> index 2e919e6..95b8f7e 100644
>>> --- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
>>> +++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
>>> @@ -1,9 +1,12 @@
>>> #ifndef __ASM_R8A7790_H__
>>> #define __ASM_R8A7790_H__
>>>
>>> +#include <linux/sh_eth.h>
>>> +
>>> void r8a7790_add_standard_devices(void);
>>> void r8a7790_clock_init(void);
>>> void r8a7790_pinmux_init(void);
>>> void r8a7790_timer_init(void);
>>> +void r8a7790_add_ether_device(struct sh_eth_plat_data *pdata);
>> Perhaps better place is right after r8a7790_add_standard_devices()...
> Is the implication that the struct sh_eth_plat_data can be defined
> in setup-r8a7790.c?
No, why?
> Or do you for see adding a struct sh_eth_plat_data
> parameter to r8a7790_add_standard_devices() ?
Not at all.
WBR, Sergei
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/2] ARM: shmobile: lager: enable Ether
2013-05-13 13:04 ` Sergei Shtylyov
@ 2013-05-13 22:30 ` Laurent Pinchart
0 siblings, 0 replies; 12+ messages in thread
From: Laurent Pinchart @ 2013-05-13 22:30 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 13 May 2013 17:04:41 Sergei Shtylyov wrote:
> On 13.05.2013 4:40, Simon Horman wrote:
> > [ CC Laurent ]
> >
> >>> 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".
> [...]
>
> >>> diff --git a/arch/arm/mach-shmobile/board-lager.c
> >>> b/arch/arm/mach-shmobile/board-lager.c index 6a1ba38..0b8112d 100644
> >>> --- a/arch/arm/mach-shmobile/board-lager.c
> >>> +++ b/arch/arm/mach-shmobile/board-lager.c
> >>
> >> [...]
> >>
> >>> @@ -59,6 +69,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"),
> >>>
> >> I thought MDIO bus was a part of RMII. At least Wikipedia told
> >>
> >> me so. :-)
> >
> > Is the implication that you think that the eth_mdio and eth_rmii
> > groups should be combined?
MDIO is used by RMII, MII and (R)GMII. Merging eth_mdio and eth_rmii would
require duplicating the pins in all those ethernet-related functions.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/2] ARM: shmobile: lager: enable Ether
2013-05-10 8:05 ` [PATCH 2/2] ARM: shmobile: lager: enable Ether Simon Horman
2013-05-10 10:35 ` Sergei Shtylyov
@ 2013-05-13 22:31 ` Laurent Pinchart
1 sibling, 0 replies; 12+ messages in thread
From: Laurent Pinchart @ 2013-05-13 22:31 UTC (permalink / raw)
To: linux-arm-kernel
Hi Simon,
On Friday 10 May 2013 17:05:19 Simon Horman wrote:
> 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". ---
> arch/arm/boot/dts/r8a7790-lager.dts | 2 +-
> arch/arm/mach-shmobile/board-lager.c | 26 ++++++++++++++++++++++++++
> 2 files changed, 27 insertions(+), 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 {
> diff --git a/arch/arm/mach-shmobile/board-lager.c
> b/arch/arm/mach-shmobile/board-lager.c index 6a1ba38..0b8112d 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,15 @@ 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,
> +};
> +
> static const struct pinctrl_map lager_pinctrl_map[] = {
> /* SCIF0 (CN19: DEBUG SERIAL0) */
> PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
> @@ -59,6 +69,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 +94,11 @@ static void __init lager_add_standard_devices(void)
> platform_device_register_data(&platform_bus, "leds-gpio", -1,
> &lager_leds_pdata,
> sizeof(lager_leds_pdata));
> +
> + /* Ether RESET */
> + gpio_request_one(RCAR_GP_PIN(5, 31), GPIOF_OUT_INIT_HIGH, NULL);
Please don't touch GPIOs directly from board files. The reset GPIO number
should be passed to the related device through platform data (and/or DT), and
GPIO handling should be moved to the driver.
> + r8a7790_add_ether_device(ðer_platdata);
> }
>
> static const char *lager_boards_compat_dt[] __initdata = {
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] ARM: shmobile: r8a7790: add Ether support
2013-05-13 13:07 ` Sergei Shtylyov
@ 2013-05-14 0:29 ` Simon Horman
0 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2013-05-14 0:29 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, May 13, 2013 at 05:07:49PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 13-05-2013 4:43, Simon Horman wrote:
>
> >>>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>
>
> [...]
>
> >>>diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
> >>>index 2e919e6..95b8f7e 100644
> >>>--- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
> >>>+++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
> >>>@@ -1,9 +1,12 @@
> >>> #ifndef __ASM_R8A7790_H__
> >>> #define __ASM_R8A7790_H__
> >>>
> >>>+#include <linux/sh_eth.h>
> >>>+
> >>> void r8a7790_add_standard_devices(void);
> >>> void r8a7790_clock_init(void);
> >>> void r8a7790_pinmux_init(void);
> >>> void r8a7790_timer_init(void);
> >>>+void r8a7790_add_ether_device(struct sh_eth_plat_data *pdata);
>
> >> Perhaps better place is right after r8a7790_add_standard_devices()...
>
> >Is the implication that the struct sh_eth_plat_data can be defined
> >in setup-r8a7790.c?
>
> No, why?
>
> >Or do you for see adding a struct sh_eth_plat_data
> >parameter to r8a7790_add_standard_devices() ?
>
> Not at all.
Sorry, I miss-read your previous email.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2013-05-14 0:29 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-10 8:05 [PATCH 0/2] ARM: shmobile: lager: enable Ether Simon Horman
2013-05-10 8:05 ` [PATCH 1/2] ARM: shmobile: r8a7790: add Ether support Simon Horman
2013-05-10 10:26 ` Sergei Shtylyov
2013-05-13 0:43 ` Simon Horman
2013-05-13 13:07 ` Sergei Shtylyov
2013-05-14 0:29 ` Simon Horman
2013-05-10 8:05 ` [PATCH 2/2] ARM: shmobile: lager: enable Ether Simon Horman
2013-05-10 10:35 ` Sergei Shtylyov
2013-05-13 0:40 ` Simon Horman
2013-05-13 13:04 ` Sergei Shtylyov
2013-05-13 22:30 ` Laurent Pinchart
2013-05-13 22:31 ` Laurent Pinchart
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).