Skip to contentSkip to conversation

Armadillo DT Reference Implementation

PATCH New Bastian Hecht 4 participants 9 messages Dec 18, 2012 – Apr 11, 2013

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover Armadillo DT Reference Implementation

This is the design approch of Simon Horman's kzm9g implementation transferred to the Armadillo board.

It is based on the branch next of
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git
and was tested on the branch devel/of of
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git

For the ethernet controller to work the series assumes the patch
net: sh_eth: Add support of device tree probe
http://patchwork.ozlabs.org/patch/191713/ to be applied.

Bastian Hecht (2):
ARM: r8a7740: Add interim sh-eth device name to clocks list
ARM: shmobile: armadillo800eva: Reference DT implementation

 arch/arm/boot/dts/Makefile                         |    1 +
 .../boot/dts/r8a7740-armadillo800eva-reference.dts |   33 ++++
 arch/arm/mach-shmobile/Kconfig                     |   10 ++
 arch/arm/mach-shmobile/Makefile                    |    1 +
 .../board-armadillo800eva-reference.c              |  172 ++++++++++++++++++++
 arch/arm/mach-shmobile/clock-r8a7740.c             |    1 +
 arch/arm/mach-shmobile/include/mach/common.h       |    2 +
 7 files changed, 220 insertions(+)
 create mode 100644 arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts
 create mode 100644 arch/arm/mach-shmobile/board-armadillo800eva-reference.c
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 ARM: r8a7740: Add interim sh-eth device name to clocks list

When we use the ethernet device via DT setup, we need to add it to a lookup list until this is properly handled later in a DT-only fashion.

---
 arch/arm/mach-shmobile/clock-r8a7740.c |    1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/clock-r8a7740.c +1 -0
index 19ce885..8765a76 100644
@@ -614,6 +614,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh_mobile_sdhi.1",	&mstp_clks[MSTP313]),
 	CLKDEV_DEV_ID("sh_mmcif",		&mstp_clks[MSTP312]),
 	CLKDEV_DEV_ID("sh-eth",			&mstp_clks[MSTP309]),
+	CLKDEV_DEV_ID("e9a00000.sh-eth",	&mstp_clks[MSTP309]),
 
 	CLKDEV_DEV_ID("sh_mobile_sdhi.2",	&mstp_clks[MSTP415]),
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/2 ARM: r8a7740: Add interim sh-eth device name to clocks list

Hi Bastian

Thanks for the patch.

Quoted 14 lines · Bastian Hecht

When we use the ethernet device via DT setup, we need to add it to a lookup list until this is properly handled later in a DT-only fashion.

---
 arch/arm/mach-shmobile/clock-r8a7740.c |    1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/clock-r8a7740.c +0 -0
index 19ce885..8765a76 100644

arch/arm/mach-shmobile/clock-r8a7740.c static struct clk_lookup lookups[] = { · line 617

Quoted 4 lines
arch/arm/mach-shmobile/clock-r8a7740.c +1 -0
@@ -614,6 +614,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh_mobile_sdhi.1",	&mstp_clks[MSTP313]),
 	CLKDEV_DEV_ID("sh_mmcif",		&mstp_clks[MSTP312]),
 	CLKDEV_DEV_ID("sh-eth",			&mstp_clks[MSTP309]),
+	CLKDEV_DEV_ID("e9a00000.sh-eth",	&mstp_clks[MSTP309]),

In a recent thread

http://thread.gmane.org/gmane.linux.ports.sh.devel/18062/focus=18057

I've been suggested to use OF_DEV_AUXDATA(), isn't this also a case for it?

Thanks
Guennadi

Quoted 11 lines
arch/arm/mach-shmobile/clock-r8a7740.c +0 -0
 	CLKDEV_DEV_ID("sh_mobile_sdhi.2",	&mstp_clks[MSTP415]),
 
Signature · 6 lines
1.7.9.5

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

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

maintainer
#3 lore raw

PATCH 1/2 ARM: r8a7740: Add interim sh-eth device name to clocks list

Quoted 27 lines · Guennadi Liakhovetski

Hi Bastian

Thanks for the patch.

Quoted 14 lines · Bastian Hecht

When we use the ethernet device via DT setup, we need to add it to a lookup list until this is properly handled later in a DT-only fashion.

---
 arch/arm/mach-shmobile/clock-r8a7740.c |    1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/clock-r8a7740.c +0 -0
index 19ce885..8765a76 100644

arch/arm/mach-shmobile/clock-r8a7740.c static struct clk_lookup lookups[] = { · line 617

Quoted 4 lines
arch/arm/mach-shmobile/clock-r8a7740.c +1 -0
@@ -614,6 +614,7 @@ static struct clk_lookup lookups[] = {
      CLKDEV_DEV_ID("sh_mobile_sdhi.1",       &mstp_clks[MSTP313]),
      CLKDEV_DEV_ID("sh_mmcif",               &mstp_clks[MSTP312]),
      CLKDEV_DEV_ID("sh-eth",                 &mstp_clks[MSTP309]),
+     CLKDEV_DEV_ID("e9a00000.sh-eth",        &mstp_clks[MSTP309]),

In a recent thread

Quoted 4 lines

http://thread.gmane.org/gmane.linux.ports.sh.devel/18062/focus=18057

I've been suggested to use OF_DEV_AUXDATA(), isn't this also a case for it?

AUXDATA seems to be a great way to add a platform data pointer as a workaround while implementing DT support, but when it comes to translate the name based on base address the code becomes very verbose.

I am all for going with the simplest half-way solution that uses the least amount of lines of code, but I doubt it can get any simpler than a single line of CLKDEV_DEV_ID().

Thanks,

/ magnus

#4 lore raw

PATCH 1/2 ARM: r8a7740: Add interim sh-eth device name to clocks list

In reply to Bastian Hecht
Quoted 3 lines · Bastian Hecht

When we use the ethernet device via DT setup, we need to add it to a lookup list until this is properly handled later in a DT-only fashion.

Thanks, looks good.
I will apply this.

#5 lore raw

PATCH 1/2 ARM: r8a7740: Add interim sh-eth device name to clocks list

Quoted 7 lines · Simon Horman
Quoted 3 lines · Bastian Hecht

When we use the ethernet device via DT setup, we need to add it to a lookup list until this is properly handled later in a DT-only fashion.

Thanks, looks good.
I will apply this.

Apparently I forgot to actually do that.
I have done so now, it is queued up for v3.11 in the soc-r8a7740 branch.

#6 lore raw

PATCH 2/2 ARM: shmobile: armadillo800eva: Reference DT implementation

In reply to Bastian Hecht

Provide alternate board code for the Armadillo 800 EVA to demonstrate how DT may be used given the current state of driver device tree support. This is intended to act as a reference for mach-shmobile developers.

This is based on Simon Horman's reference implementation for the board kzm9g.

Currently only the ethernet controller is brought up.

---
 arch/arm/boot/dts/Makefile                         |    1 +
 .../boot/dts/r8a7740-armadillo800eva-reference.dts |   33 ++++
 arch/arm/mach-shmobile/Kconfig                     |   10 ++
 arch/arm/mach-shmobile/Makefile                    |    1 +
 .../board-armadillo800eva-reference.c              |  172 ++++++++++++++++++++
 arch/arm/mach-shmobile/include/mach/common.h       |    2 +
 6 files changed, 219 insertions(+)
 create mode 100644 arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts
 create mode 100644 arch/arm/mach-shmobile/board-armadillo800eva-reference.c
arch/arm/boot/dts/Makefile +1 -0
index 0632239..8338bcc 100644
@@ -75,6 +75,7 @@ dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
 dtb-$(CONFIG_ARCH_U8500) += snowball.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7740-armadillo800eva.dtb \
+	r8a7740-armadillo800eva-reference.dtb \
 	sh73a0-kzm9g.dtb \
 	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SPEAR13XX) += spear1310-evb.dtb \
arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts new file +33 -0
new file mode 100644
index 0000000..5b5afd3
@@ -0,0 +1,33 @@
+/*
+ * Reference Device Tree Source for the armadillo 800 eva board
+ *
+ * Copyright (C) 2012 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "r8a7740.dtsi"
+
+/ {
+	model = "armadillo 800 eva";
+	compatible = "renesas,armadillo800eva-reference", "renesas,r8a7740";
+
+	memory {
+		device_type = "memory";
+		reg = <0x40000000 0x20000000>;
+	};
+
+	sh-eth at e9a00000 {
+		compatible = "renesas,sh-eth";
+		interrupt-parent = <&intca>;
+		reg = <0xe9a00000 0x800>, <0xe9a01800 0x800>;
+		interrupts = <0x500>;
+		phy-mode = "mii";
+		sh-eth,edmac-endian = "little";
+		sh-eth,register-type = "gigabit";
+		sh-eth,phy-id = <0>;
+	};
+};
arch/arm/mach-shmobile/Kconfig +10 -0
index 9255546..6766752 100644
@@ -96,6 +96,16 @@ config MACH_ARMADILLO800EVA
 	select SND_SOC_WM8978 if SND_SIMPLE_CARD
 	select USE_OF
 
+config MACH_ARMADILLO800EVA_REFERENCE
+	bool "Armadillo-800 EVA board - Reference Device Tree Implementation"
+	depends on MACH_ARMADILLO800EVA
+	---help---
+	  Use reference implementation of Aramdillo800 EVA board support
+	  which makes a greater use of device tree at the expense
+	  of not supporting a number of devices.
+
+	  This is intended to aid developers
+
 config MACH_MARZEN
 	bool "MARZEN board"
 	depends on ARCH_R8A7779
arch/arm/mach-shmobile/Makefile +1 -0
index 0b71479..87fdc64 100644
@@ -46,6 +46,7 @@ obj-$(CONFIG_MACH_KOTA2)	+= board-kota2.o
 obj-$(CONFIG_MACH_BONITO)	+= board-bonito.o
 obj-$(CONFIG_MACH_MARZEN)	+= board-marzen.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
+obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE)     += board-armadillo800eva-reference.o
 obj-$(CONFIG_MACH_KZM9D)	+= board-kzm9d.o
 obj-$(CONFIG_MACH_KZM9G)	+= board-kzm9g.o
 
arch/arm/mach-shmobile/board-armadillo800eva-reference.c new file +172 -0

172 lines not on this page · raw message

arch/arm/mach-shmobile/include/mach/common.h +2 -0
index dfeca79..9249459 100644
@@ -44,7 +44,9 @@ extern struct clk sh73a0_extalr_clk;
 extern void r8a7740_init_irq(void);
 extern void r8a7740_map_io(void);
 extern void r8a7740_add_early_devices(void);
+extern void r8a7740_add_early_devices_dt(void);
 extern void r8a7740_add_standard_devices(void);
+extern void r8a7740_add_standard_devices_dt(void);
 extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);
 
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH 2/2 ARM: shmobile: armadillo800eva: Reference DT implementation

Quoted 9 lines · Bastian Hecht

Provide alternate board code for the Armadillo 800 EVA to demonstrate how DT may be used given the current state of driver device tree support. This is intended to act as a reference for mach-shmobile developers.

This is based on Simon Horman's reference implementation for the board kzm9g.

Currently only the ethernet controller is brought up.

Thanks, looks good. I will apply this.

Could you let me know what the status of
the DT bindings for sh-eth is?

#8 lore raw

PATCH 2/2 ARM: shmobile: armadillo800eva: Reference DT implementation

Hi Simon,

2013/1/9 Simon Horman <[email protected]>:

Quoted 6 lines · Bastian Hecht
Quoted 5 lines

Provide alternate board code for the Armadillo 800 EVA to demonstrate how DT may be used given the current state of driver device tree support. This is intended to act as a reference for mach-shmobile developers.

Quoted 6 lines
Quoted 4 lines

This is based on Simon Horman's reference implementation for the board kzm9g.

Currently only the ethernet controller is brought up.

Thanks, looks good. I will apply this.

Thanks!

Quoted 2 lines

Could you let me know what the status of
the DT bindings for sh-eth is?

I used the bindings that comply to the patch "[v2,1/2] net: sh_eth:
Add support of device tree probe" from 10/16/2012 from Iwamatsu-san. I hasn't found its way into v3.8-rc2 yet and I don't know anything more accurate about the merge process.

Cheers,

Bastian