ARM: shmobile: sh73a0: Introduce generic setup callback
authorMagnus Damm <damm+renesas@opensource.se>
Fri, 9 Jan 2015 13:08:49 +0000 (14:08 +0100)
committerSimon Horman <horms+renesas@verge.net.au>
Mon, 23 Feb 2015 23:22:45 +0000 (08:22 +0900)
Add a generic sh73a0 machine setup callback for the upcoming
sh73a0 multiplatform case. Cache needs to be configured, and
legacy clocks must be omitted.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/mach-shmobile/setup-sh73a0.c

index faea74a2151b1ca6849065f27e2d356711fe8ba5..48f2447ab01f6e600b393df1dc446286f3e8884d 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/platform_data/sh_ipmmu.h>
 #include <linux/platform_data/irq-renesas-intc-irqpin.h>
 
+#include <asm/hardware/cache-l2x0.h>
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
@@ -782,8 +783,6 @@ void __init sh73a0_add_early_devices(void)
        shmobile_setup_console();
 }
 
-#ifdef CONFIG_USE_OF
-
 void __init sh73a0_add_standard_devices_dt(void)
 {
        /* clocks are setup late during boot in the case of DT */
@@ -800,6 +799,17 @@ static void sh73a0_restart(enum reboot_mode mode, const char *cmd)
        writel((1 << 31), RESCNT2);
 }
 
+#ifdef CONFIG_USE_OF
+
+static void __init sh73a0_generic_init(void)
+{
+#ifdef CONFIG_CACHE_L2X0
+       /* Shared attribute override enable, 64K*8way */
+       l2x0_init(IOMEM(0xf0100000), 0x00400000, 0xc20f0fff);
+#endif
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
 static const char *sh73a0_boards_compat_dt[] __initdata = {
        "renesas,sh73a0",
        NULL,
@@ -809,7 +819,7 @@ DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
        .smp            = smp_ops(sh73a0_smp_ops),
        .map_io         = sh73a0_map_io,
        .init_early     = shmobile_init_delay,
-       .init_machine   = sh73a0_add_standard_devices_dt,
+       .init_machine   = sh73a0_generic_init,
        .init_late      = shmobile_init_late,
        .restart        = sh73a0_restart,
        .dt_compat      = sh73a0_boards_compat_dt,