linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: mach-shmobile: sh7377 generic board support via DT
@ 2012-07-06  8:10 Magnus Damm
  2012-07-06 19:17 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Magnus Damm @ 2012-07-06  8:10 UTC (permalink / raw)
  To: linux-sh

From: Magnus Damm <damm@opensource.se>

Add generic DT board support for the sh7377 SoC.

SCIF serial ports and timers are kept as regular
platform devices. Other on-chip and on-board devices
should be configured via the device tree.

At this point there is no interrupt controller support
in place but such code will be added over time when
proper IRQ domain support has been added to INTC.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/arm/boot/dts/sh7377.dtsi         |   21 ++++++++++++++
 arch/arm/mach-shmobile/setup-sh7377.c |   47 +++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+)

--- /dev/null
+++ work/arch/arm/boot/dts/sh7377.dtsi	2012-07-06 17:00:55.000000000 +0900
@@ -0,0 +1,21 @@
+/*
+ * Device Tree Source for the sh7377 SoC
+ *
+ * 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.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "renesas,sh7377";
+
+	cpus {
+		cpu@0 {
+			compatible = "arm,cortex-a8";
+		};
+	};
+};
--- 0001/arch/arm/mach-shmobile/setup-sh7377.c
+++ work/arch/arm/mach-shmobile/setup-sh7377.c	2012-07-06 17:00:29.000000000 +0900
@@ -22,6 +22,7 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/platform_device.h>
+#include <linux/of_platform.h>
 #include <linux/uio_driver.h>
 #include <linux/delay.h>
 #include <linux/input.h>
@@ -500,3 +501,49 @@ void __init sh7377_add_early_devices(voi
 	/* override timer setup with soc-specific code */
 	shmobile_timer.init = sh7377_earlytimer_init;
 }
+
+#ifdef CONFIG_USE_OF
+
+void __init sh7377_add_early_devices_dt(void)
+{
+	shmobile_setup_delay(600, 1, 3); /* Cortex-A8 @ 600MHz */
+
+	early_platform_add_devices(sh7377_early_devices,
+				   ARRAY_SIZE(sh7377_early_devices));
+
+	/* setup early console here as well */
+	shmobile_setup_console();
+}
+
+static const struct of_dev_auxdata sh7377_auxdata_lookup[] __initconst = {
+	{ }
+};
+
+void __init sh7377_add_standard_devices_dt(void)
+{
+	/* clocks are setup late during boot in the case of DT */
+	sh7377_clock_init();
+
+	platform_add_devices(sh7377_early_devices,
+			    ARRAY_SIZE(sh7377_early_devices));
+
+	of_platform_populate(NULL, of_default_bus_match_table,
+			     sh7377_auxdata_lookup, NULL);
+}
+
+static const char *sh7377_boards_compat_dt[] __initdata = {
+	"renesas,sh7377",
+	NULL,
+};
+
+DT_MACHINE_START(SH7377_DT, "Generic SH7377 (Flattened Device Tree)")
+	.map_io		= sh7377_map_io,
+	.init_early	= sh7377_add_early_devices_dt,
+	.init_irq	= sh7377_init_irq,
+	.handle_irq	= shmobile_handle_irq_intc,
+	.init_machine	= sh7377_add_standard_devices_dt,
+	.timer		= &shmobile_timer,
+	.dt_compat	= sh7377_boards_compat_dt,
+MACHINE_END
+
+#endif /* CONFIG_USE_OF */

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

* Re: [PATCH] ARM: mach-shmobile: sh7377 generic board support via DT
  2012-07-06  8:10 [PATCH] ARM: mach-shmobile: sh7377 generic board support via DT Magnus Damm
@ 2012-07-06 19:17 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2012-07-06 19:17 UTC (permalink / raw)
  To: linux-sh

On Friday, July 06, 2012, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Add generic DT board support for the sh7377 SoC.
> 
> SCIF serial ports and timers are kept as regular
> platform devices. Other on-chip and on-board devices
> should be configured via the device tree.
> 
> At this point there is no interrupt controller support
> in place but such code will be added over time when
> proper IRQ domain support has been added to INTC.
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>

Applied to the sh7377 branch of the renesas.git tree.

Thanks,
Rafael


> ---
> 
>  arch/arm/boot/dts/sh7377.dtsi         |   21 ++++++++++++++
>  arch/arm/mach-shmobile/setup-sh7377.c |   47 +++++++++++++++++++++++++++++++++
>  2 files changed, 68 insertions(+)
> 
> --- /dev/null
> +++ work/arch/arm/boot/dts/sh7377.dtsi	2012-07-06 17:00:55.000000000 +0900
> @@ -0,0 +1,21 @@
> +/*
> + * Device Tree Source for the sh7377 SoC
> + *
> + * 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.
> + */
> +
> +/include/ "skeleton.dtsi"
> +
> +/ {
> +	compatible = "renesas,sh7377";
> +
> +	cpus {
> +		cpu@0 {
> +			compatible = "arm,cortex-a8";
> +		};
> +	};
> +};
> --- 0001/arch/arm/mach-shmobile/setup-sh7377.c
> +++ work/arch/arm/mach-shmobile/setup-sh7377.c	2012-07-06 17:00:29.000000000 +0900
> @@ -22,6 +22,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/irq.h>
>  #include <linux/platform_device.h>
> +#include <linux/of_platform.h>
>  #include <linux/uio_driver.h>
>  #include <linux/delay.h>
>  #include <linux/input.h>
> @@ -500,3 +501,49 @@ void __init sh7377_add_early_devices(voi
>  	/* override timer setup with soc-specific code */
>  	shmobile_timer.init = sh7377_earlytimer_init;
>  }
> +
> +#ifdef CONFIG_USE_OF
> +
> +void __init sh7377_add_early_devices_dt(void)
> +{
> +	shmobile_setup_delay(600, 1, 3); /* Cortex-A8 @ 600MHz */
> +
> +	early_platform_add_devices(sh7377_early_devices,
> +				   ARRAY_SIZE(sh7377_early_devices));
> +
> +	/* setup early console here as well */
> +	shmobile_setup_console();
> +}
> +
> +static const struct of_dev_auxdata sh7377_auxdata_lookup[] __initconst = {
> +	{ }
> +};
> +
> +void __init sh7377_add_standard_devices_dt(void)
> +{
> +	/* clocks are setup late during boot in the case of DT */
> +	sh7377_clock_init();
> +
> +	platform_add_devices(sh7377_early_devices,
> +			    ARRAY_SIZE(sh7377_early_devices));
> +
> +	of_platform_populate(NULL, of_default_bus_match_table,
> +			     sh7377_auxdata_lookup, NULL);
> +}
> +
> +static const char *sh7377_boards_compat_dt[] __initdata = {
> +	"renesas,sh7377",
> +	NULL,
> +};
> +
> +DT_MACHINE_START(SH7377_DT, "Generic SH7377 (Flattened Device Tree)")
> +	.map_io		= sh7377_map_io,
> +	.init_early	= sh7377_add_early_devices_dt,
> +	.init_irq	= sh7377_init_irq,
> +	.handle_irq	= shmobile_handle_irq_intc,
> +	.init_machine	= sh7377_add_standard_devices_dt,
> +	.timer		= &shmobile_timer,
> +	.dt_compat	= sh7377_boards_compat_dt,
> +MACHINE_END
> +
> +#endif /* CONFIG_USE_OF */
> 
> 


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

end of thread, other threads:[~2012-07-06 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-06  8:10 [PATCH] ARM: mach-shmobile: sh7377 generic board support via DT Magnus Damm
2012-07-06 19:17 ` Rafael J. Wysocki

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