* [PATCH v2 0/2] ARM: shmobile: lager: Add DT reference
@ 2013-07-01 2:18 Simon Horman
2013-07-01 2:18 ` [PATCH v2 1/2] ARM: shmobile: r8a7790: Initialise clocks and SCIF in r8a7790_add_dt_devices() Simon Horman
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Simon Horman @ 2013-07-01 2:18 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
this short series adds DT reference to Lager.
The intention of this is to allow the board to be
brought up as much as possible using DT. And for
this to act as a basis for further DT coverage
of devices present on the Lager and its r8a7790 SoC.
This series differs from v2 in that it has been
rebased on top of reneas-next-20130701 and now makes use
of r8a7790_init_delay().
Simon Horman (2):
ARM: shmobile: r8a7790: Initialise clocks and SCIF in
r8a7790_add_dt_devices()
ARM: shmobile: lager: Add DT reference
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/r8a7790-lager-reference.dts | 31 +++++++++++++++++++++
arch/arm/mach-shmobile/Kconfig | 11 ++++++++
arch/arm/mach-shmobile/Makefile | 1 +
arch/arm/mach-shmobile/board-lager-reference.c | 37 ++++++++++++++++++++++++++
arch/arm/mach-shmobile/include/mach/r8a7790.h | 1 +
arch/arm/mach-shmobile/setup-r8a7790.c | 11 +++++++-
7 files changed, 92 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/boot/dts/r8a7790-lager-reference.dts
create mode 100644 arch/arm/mach-shmobile/board-lager-reference.c
--
1.8.2.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] ARM: shmobile: r8a7790: Initialise clocks and SCIF in r8a7790_add_dt_devices()
2013-07-01 2:18 [PATCH v2 0/2] ARM: shmobile: lager: Add DT reference Simon Horman
@ 2013-07-01 2:18 ` Simon Horman
2013-07-03 4:02 ` Magnus Damm
2013-07-01 2:18 ` [PATCH v2 2/2] ARM: shmobile: lager: Add DT reference Simon Horman
2013-07-02 7:41 ` [PATCH v2 0/2] " Magnus Damm
2 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2013-07-01 2:18 UTC (permalink / raw)
To: linux-arm-kernel
This is sufficient to allow boot of the Lager board with
a console without boards-lager.c compiled into the kernel.
This is an example of a minimal but still useful initialisation
of the board using DT as much as possible.
Also provide r8a7790_add_dt_device() in
r8a7790.h to allow it be used from a boards-lager-reference.c
file which will be added by a subsequent patch.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
v2
* Rebase
---
arch/arm/mach-shmobile/include/mach/r8a7790.h | 1 +
arch/arm/mach-shmobile/setup-r8a7790.c | 11 ++++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
index 7851cc1..7a25138 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
@@ -2,6 +2,7 @@
#define __ASM_R8A7790_H__
void r8a7790_add_standard_devices(void);
+void r8a7790_add_standard_devices_dt(void);
void r8a7790_clock_init(void);
void r8a7790_pinmux_init(void);
void r8a7790_init_delay(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index d89cd83..770109b 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -180,7 +180,7 @@ static struct resource cmt00_resources[] = {
&cmt##idx##_platform_data, \
sizeof(struct sh_timer_config))
-void __init r8a7790_add_standard_devices(void)
+void __init r8a7790_add_dt_devices(void)
{
r8a7790_register_scif(SCIFA0);
r8a7790_register_scif(SCIFA1);
@@ -192,6 +192,11 @@ void __init r8a7790_add_standard_devices(void)
r8a7790_register_scif(SCIF1);
r8a7790_register_scif(HSCIF0);
r8a7790_register_scif(HSCIF1);
+}
+
+void __init r8a7790_add_standard_devices(void)
+{
+ r8a7790_add_dt_devices();
r8a7790_register_irqc(0);
r8a7790_register_thermal();
r8a7790_register_cmt(00);
@@ -219,6 +224,10 @@ void __init r8a7790_init_delay(void)
#ifdef CONFIG_USE_OF
void __init r8a7790_add_standard_devices_dt(void)
{
+ /* clocks are setup late during boot in the case of DT */
+ r8a7790_clock_init();
+
+ r8a7790_add_dt_devices();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
--
1.8.2.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] ARM: shmobile: lager: Add DT reference
2013-07-01 2:18 [PATCH v2 0/2] ARM: shmobile: lager: Add DT reference Simon Horman
2013-07-01 2:18 ` [PATCH v2 1/2] ARM: shmobile: r8a7790: Initialise clocks and SCIF in r8a7790_add_dt_devices() Simon Horman
@ 2013-07-01 2:18 ` Simon Horman
2013-07-02 7:41 ` [PATCH v2 0/2] " Magnus Damm
2 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2013-07-01 2:18 UTC (permalink / raw)
To: linux-arm-kernel
This is sufficient to allow boot of the Lager board with
a console without boards-lager.c compiled into the kernel.
This is an example of a minimal but still useful initialisation
of the board using DT as much as possible.
As such it is the same as the boot of Lager that can be achieved
without a board file. The intention of adding this file
is to facilitate further work to allow board specific devices to be
initialised via DT.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
v2
* Use recently added r8a7790_init_delay()
---
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/r8a7790-lager-reference.dts | 31 +++++++++++++++++++++
arch/arm/mach-shmobile/Kconfig | 11 ++++++++
arch/arm/mach-shmobile/Makefile | 1 +
arch/arm/mach-shmobile/board-lager-reference.c | 37 ++++++++++++++++++++++++++
5 files changed, 81 insertions(+)
create mode 100644 arch/arm/boot/dts/r8a7790-lager-reference.dts
create mode 100644 arch/arm/mach-shmobile/board-lager-reference.c
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index cb31259..f2dc697 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -165,6 +165,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
r8a7740-armadillo800eva-reference.dtb \
r8a7779-marzen-reference.dtb \
r8a7790-lager.dtb \
+ r8a7790-lager-reference.dtb \
sh73a0-kzm9g.dtb \
sh73a0-kzm9g-reference.dtb \
r8a73a4-ape6evm.dtb \
diff --git a/arch/arm/boot/dts/r8a7790-lager-reference.dts b/arch/arm/boot/dts/r8a7790-lager-reference.dts
new file mode 100644
index 0000000..fa5b81b
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7790-lager-reference.dts
@@ -0,0 +1,31 @@
+/*
+ * Device Tree Source for the Lager board
+ *
+ * Copyright (C) 2013 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/ "r8a7790.dtsi"
+
+/ {
+ model = "Lager";
+ compatible = "renesas,lager-reference", "renesas,r8a7790";
+
+ chosen {
+ bootargs = "console=ttySC6,115200 ignore_loglevel";
+ };
+
+ memory at 40000000 {
+ device_type = "memory";
+ reg = <0 0x40000000 0 0x80000000>;
+ };
+
+ lbsc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ };
+};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 64dc24d..30c571b 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -150,6 +150,17 @@ config MACH_LAGER
depends on ARCH_R8A7790
select USE_OF
+config MACH_LAGER_REFERENCE
+ bool "Lager board - Reference Device Tree Implementation"
+ depends on ARCH_R8A7790
+ select USE_OF
+ ---help---
+ Use reference implementation of Lager board support
+ which makes use of device tree at the expense
+ of not supporting a number of devices.
+
+ This is intended to aid developers
+
config MACH_KZM9D
bool "KZM9D board"
depends on ARCH_EMEV2
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 6165a51..d813133 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_MACH_BOCKW) += board-bockw.o
obj-$(CONFIG_MACH_MARZEN) += board-marzen.o
obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o
obj-$(CONFIG_MACH_LAGER) += board-lager.o
+obj-$(CONFIG_MACH_LAGER_REFERENCE) += board-lager-reference.o
obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o
obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
new file mode 100644
index 0000000..daec357
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -0,0 +1,37 @@
+/*
+ * Lager board support - Reference DT implementation
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ * Copyright (C) 2013 Simon Horman
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <linux/init.h>
+#include <linux/irqchip.h>
+#include <mach/r8a7790.h>
+#include <asm/mach/arch.h>
+
+static const char *lager_boards_compat_dt[] __initdata = {
+ "renesas,lager-reference",
+ NULL,
+};
+
+DT_MACHINE_START(LAGER_DT, "lager")
+ .init_early = r8a7790_init_delay,
+ .init_irq = irqchip_init,
+ .init_machine = r8a7790_add_standard_devices_dt,
+ .init_time = r8a7790_timer_init,
+ .dt_compat = lager_boards_compat_dt,
+MACHINE_END
--
1.8.2.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 0/2] ARM: shmobile: lager: Add DT reference
2013-07-01 2:18 [PATCH v2 0/2] ARM: shmobile: lager: Add DT reference Simon Horman
2013-07-01 2:18 ` [PATCH v2 1/2] ARM: shmobile: r8a7790: Initialise clocks and SCIF in r8a7790_add_dt_devices() Simon Horman
2013-07-01 2:18 ` [PATCH v2 2/2] ARM: shmobile: lager: Add DT reference Simon Horman
@ 2013-07-02 7:41 ` Magnus Damm
2013-07-03 2:26 ` Simon Horman
2 siblings, 1 reply; 6+ messages in thread
From: Magnus Damm @ 2013-07-02 7:41 UTC (permalink / raw)
To: linux-arm-kernel
Hi Simon,
On Mon, Jul 1, 2013 at 11:18 AM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> Hi,
>
> this short series adds DT reference to Lager.
Thanks for your work on this.
> The intention of this is to allow the board to be
> brought up as much as possible using DT. And for
> this to act as a basis for further DT coverage
> of devices present on the Lager and its r8a7790 SoC.
>
>
> This series differs from v2 in that it has been
> rebased on top of reneas-next-20130701 and now makes use
> of r8a7790_init_delay().
>
>
> Simon Horman (2):
> ARM: shmobile: r8a7790: Initialise clocks and SCIF in
> r8a7790_add_dt_devices()
At this point I'm inclined to say "no" to new DT reference using
platform devices for SCIF. I believe we instead should really work on
adding DT support to the SCIF driver and use DT for SCIF on more
recent boards. Also, we probably don't want to enable clocks like
that, instead we should tie in common clocks. That will take a little
bit longer time though, so I wonder what is a good solution until
then..
> ARM: shmobile: lager: Add DT reference
I think you want to update Makefile.boot to include the
lager-reference board. Also, I believe that without SCIF and clocks
the init_machine() and init_irq() callbacks can be left unset to make
use of the default behaviour.
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 0/2] ARM: shmobile: lager: Add DT reference
2013-07-02 7:41 ` [PATCH v2 0/2] " Magnus Damm
@ 2013-07-03 2:26 ` Simon Horman
0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2013-07-03 2:26 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jul 02, 2013 at 04:41:01PM +0900, Magnus Damm wrote:
> Hi Simon,
>
> On Mon, Jul 1, 2013 at 11:18 AM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > Hi,
> >
> > this short series adds DT reference to Lager.
>
> Thanks for your work on this.
>
> > The intention of this is to allow the board to be
> > brought up as much as possible using DT. And for
> > this to act as a basis for further DT coverage
> > of devices present on the Lager and its r8a7790 SoC.
> >
> >
> > This series differs from v2 in that it has been
> > rebased on top of reneas-next-20130701 and now makes use
> > of r8a7790_init_delay().
> >
> >
> > Simon Horman (2):
> > ARM: shmobile: r8a7790: Initialise clocks and SCIF in
> > r8a7790_add_dt_devices()
>
> At this point I'm inclined to say "no" to new DT reference using
> platform devices for SCIF. I believe we instead should really work on
> adding DT support to the SCIF driver and use DT for SCIF on more
> recent boards. Also, we probably don't want to enable clocks like
> that, instead we should tie in common clocks. That will take a little
> bit longer time though, so I wonder what is a good solution until
> then..
I guess we should just delay lager-reference until its dependencies are ready.
> > ARM: shmobile: lager: Add DT reference
>
> I think you want to update Makefile.boot to include the
> lager-reference board. Also, I believe that without SCIF and clocks
> the init_machine() and init_irq() callbacks can be left unset to make
> use of the default behaviour.
>
> Cheers,
>
> / magnus
> --
> 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
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] ARM: shmobile: r8a7790: Initialise clocks and SCIF in r8a7790_add_dt_devices()
2013-07-01 2:18 ` [PATCH v2 1/2] ARM: shmobile: r8a7790: Initialise clocks and SCIF in r8a7790_add_dt_devices() Simon Horman
@ 2013-07-03 4:02 ` Magnus Damm
0 siblings, 0 replies; 6+ messages in thread
From: Magnus Damm @ 2013-07-03 4:02 UTC (permalink / raw)
To: linux-arm-kernel
Hi Simon,
On Mon, Jul 1, 2013 at 11:18 AM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> This is sufficient to allow boot of the Lager board with
> a console without boards-lager.c compiled into the kernel.
> This is an example of a minimal but still useful initialisation
> of the board using DT as much as possible.
>
> Also provide r8a7790_add_dt_device() in
> r8a7790.h to allow it be used from a boards-lager-reference.c
> file which will be added by a subsequent patch.
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
>
> ---
>
> v2
>
> * Rebase
> ---
> arch/arm/mach-shmobile/include/mach/r8a7790.h | 1 +
> arch/arm/mach-shmobile/setup-r8a7790.c | 11 ++++++++++-
> 2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
> index 7851cc1..7a25138 100644
> --- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
> +++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
> @@ -2,6 +2,7 @@
> #define __ASM_R8A7790_H__
>
> void r8a7790_add_standard_devices(void);
> +void r8a7790_add_standard_devices_dt(void);
> void r8a7790_clock_init(void);
> void r8a7790_pinmux_init(void);
> void r8a7790_init_delay(void);
> diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
> index d89cd83..770109b 100644
> --- a/arch/arm/mach-shmobile/setup-r8a7790.c
> +++ b/arch/arm/mach-shmobile/setup-r8a7790.c
> @@ -180,7 +180,7 @@ static struct resource cmt00_resources[] = {
> &cmt##idx##_platform_data, \
> sizeof(struct sh_timer_config))
>
> -void __init r8a7790_add_standard_devices(void)
> +void __init r8a7790_add_dt_devices(void)
> {
> r8a7790_register_scif(SCIFA0);
> r8a7790_register_scif(SCIFA1);
> @@ -192,6 +192,11 @@ void __init r8a7790_add_standard_devices(void)
> r8a7790_register_scif(SCIF1);
> r8a7790_register_scif(HSCIF0);
> r8a7790_register_scif(HSCIF1);
> +}
> +
> +void __init r8a7790_add_standard_devices(void)
> +{
> + r8a7790_add_dt_devices();
> r8a7790_register_irqc(0);
> r8a7790_register_thermal();
> r8a7790_register_cmt(00);
> @@ -219,6 +224,10 @@ void __init r8a7790_init_delay(void)
> #ifdef CONFIG_USE_OF
> void __init r8a7790_add_standard_devices_dt(void)
> {
> + /* clocks are setup late during boot in the case of DT */
> + r8a7790_clock_init();
> +
> + r8a7790_add_dt_devices();
> of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> }
>
> --
> 1.8.2.1
In this patch you modify r8a7790_add_standard_devices_dt() to include
clocks. I prefer not to make this kind of modification to the generic
r8a7790 DT code since it clashes with upcoming common clock framework
changes. I would like to keep the generic per-SoC DT_MACHINE bits so
they don't enable legacy clocks.
Also, as you probably noticed, this patch conflicts with the idea to
keep ->init_machine() set to NULL for modern platforms.
Despite what I said yesterday, I think it would be very useful to have
Lager DT reference board code around even though SCIF can't do DT yet.
How about keeping the DT_MACHINE stuff for r8a7790 in setup-r8a7790.c
as-is, but in your board-lager-reference.c you have a temporary
version of ->init_machine() that enables clocks, adds SCIF (and CMT?)
as platform devices, but does the rest via DT? Then when SCIF is ready
we can drop the C code for the DT reference board support.
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-07-03 4:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-01 2:18 [PATCH v2 0/2] ARM: shmobile: lager: Add DT reference Simon Horman
2013-07-01 2:18 ` [PATCH v2 1/2] ARM: shmobile: r8a7790: Initialise clocks and SCIF in r8a7790_add_dt_devices() Simon Horman
2013-07-03 4:02 ` Magnus Damm
2013-07-01 2:18 ` [PATCH v2 2/2] ARM: shmobile: lager: Add DT reference Simon Horman
2013-07-02 7:41 ` [PATCH v2 0/2] " Magnus Damm
2013-07-03 2:26 ` 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).