aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/setup-sh73a0.c
diff options
context:
space:
mode:
authorSimon Horman <horms+renesas@verge.net.au>2012-11-21 08:00:15 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-01-24 22:43:49 -0500
commit486095331af0ab4582879aa1421757f51a92d4e7 (patch)
tree058c02405d9f8d50bdba65f34f3f1af9dd7b71d9 /arch/arm/mach-shmobile/setup-sh73a0.c
parenta3f22db5102238197d5f6bbcad2f720ec7f09e10 (diff)
ARM: mach-shmobile: sh73a0: Minimal setup using DT
Allow a minimal setup of the sh73a0 SoC using a flattened device tree. In particular, Configure the i2c controllers using a flattened device tree. SCI serial controller and CMT clock source, whose drivers do not yet support configuration using a flattened device tree, are still configured using C code in order to allow booting of a board with this SoC. *** Please note that the clock initialisation scheme used in this patch does not currently work with SMP as there is a yet to be resolved lock-up in workqueue initialisation. CONFIG_SMP must be disabled when using this code. *** Includes update from Thierry Reding to no longer use gic_handle_irq() Cc: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Simon Horman <horms+renesas@verge.net.au> fix
Diffstat (limited to 'arch/arm/mach-shmobile/setup-sh73a0.c')
-rw-r--r--arch/arm/mach-shmobile/setup-sh73a0.c62
1 files changed, 61 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index 8c2d6424f470..f7ecb0bc1bec 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -23,6 +23,7 @@
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/of_platform.h>
26#include <linux/delay.h> 27#include <linux/delay.h>
27#include <linux/input.h> 28#include <linux/input.h>
28#include <linux/io.h> 29#include <linux/io.h>
@@ -754,7 +755,7 @@ static struct platform_device pmu_device = {
754 .resource = pmu_resources, 755 .resource = pmu_resources,
755}; 756};
756 757
757static struct platform_device *sh73a0_early_devices[] __initdata = { 758static struct platform_device *sh73a0_early_devices_dt[] __initdata = {
758 &scif0_device, 759 &scif0_device,
759 &scif1_device, 760 &scif1_device,
760 &scif2_device, 761 &scif2_device,
@@ -765,6 +766,9 @@ static struct platform_device *sh73a0_early_devices[] __initdata = {
765 &scif7_device, 766 &scif7_device,
766 &scif8_device, 767 &scif8_device,
767 &cmt10_device, 768 &cmt10_device,
769};
770
771static struct platform_device *sh73a0_early_devices[] __initdata = {
768 &tmu00_device, 772 &tmu00_device,
769 &tmu01_device, 773 &tmu01_device,
770}; 774};
@@ -787,6 +791,8 @@ void __init sh73a0_add_standard_devices(void)
787 /* Clear software reset bit on SY-DMAC module */ 791 /* Clear software reset bit on SY-DMAC module */
788 __raw_writel(__raw_readl(SRCR2) & ~(1 << 18), SRCR2); 792 __raw_writel(__raw_readl(SRCR2) & ~(1 << 18), SRCR2);
789 793
794 platform_add_devices(sh73a0_early_devices_dt,
795 ARRAY_SIZE(sh73a0_early_devices_dt));
790 platform_add_devices(sh73a0_early_devices, 796 platform_add_devices(sh73a0_early_devices,
791 ARRAY_SIZE(sh73a0_early_devices)); 797 ARRAY_SIZE(sh73a0_early_devices));
792 platform_add_devices(sh73a0_late_devices, 798 platform_add_devices(sh73a0_late_devices,
@@ -805,9 +811,63 @@ void __init sh73a0_earlytimer_init(void)
805 811
806void __init sh73a0_add_early_devices(void) 812void __init sh73a0_add_early_devices(void)
807{ 813{
814 early_platform_add_devices(sh73a0_early_devices_dt,
815 ARRAY_SIZE(sh73a0_early_devices_dt));
808 early_platform_add_devices(sh73a0_early_devices, 816 early_platform_add_devices(sh73a0_early_devices,
809 ARRAY_SIZE(sh73a0_early_devices)); 817 ARRAY_SIZE(sh73a0_early_devices));
810 818
811 /* setup early console here as well */ 819 /* setup early console here as well */
812 shmobile_setup_console(); 820 shmobile_setup_console();
813} 821}
822
823#ifdef CONFIG_USE_OF
824
825/* Please note that the clock initialisation shcheme used in
826 * sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt()
827 * does not work with SMP as there is a yet to be resolved lock-up in
828 * workqueue initialisation.
829 *
830 * CONFIG_SMP should be disabled when using this code.
831 */
832
833void __init sh73a0_add_early_devices_dt(void)
834{
835 shmobile_setup_delay(1196, 44, 46); /* Cortex-A9 @ 1196MHz */
836
837 early_platform_add_devices(sh73a0_early_devices_dt,
838 ARRAY_SIZE(sh73a0_early_devices_dt));
839
840 /* setup early console here as well */
841 shmobile_setup_console();
842}
843
844static const struct of_dev_auxdata sh73a0_auxdata_lookup[] __initconst = {
845 {},
846};
847
848void __init sh73a0_add_standard_devices_dt(void)
849{
850 /* clocks are setup late during boot in the case of DT */
851 sh73a0_clock_init();
852
853 platform_add_devices(sh73a0_early_devices_dt,
854 ARRAY_SIZE(sh73a0_early_devices_dt));
855 of_platform_populate(NULL, of_default_bus_match_table,
856 sh73a0_auxdata_lookup, NULL);
857}
858
859static const char *sh73a0_boards_compat_dt[] __initdata = {
860 "renesas,sh73a0",
861 NULL,
862};
863
864DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
865 .map_io = sh73a0_map_io,
866 .init_early = sh73a0_add_early_devices_dt,
867 .nr_irqs = NR_IRQS_LEGACY,
868 .init_irq = sh73a0_init_irq_dt,
869 .init_machine = sh73a0_add_standard_devices_dt,
870 .init_time = shmobile_timer_init,
871 .dt_compat = sh73a0_boards_compat_dt,
872MACHINE_END
873#endif /* CONFIG_USE_OF */