@@ -7,6 +7,12 @@ extern void shmobile_init_delay(void);
extern void shmobile_boot_vector(void);
extern unsigned long shmobile_boot_fn;
extern unsigned long shmobile_boot_size;
+#ifdef CONFIG_ARCH_RCAR_GEN2
+extern void shmobile_boot_vector_gen2(void);
+extern unsigned long shmobile_boot_fn_gen2;
+extern unsigned long shmobile_boot_size_gen2;
+extern unsigned long shmobile_wdt_clock_status;
+#endif /* CONFIG_ARCH_RCAR_GEN2 */
extern void shmobile_smp_boot(void);
extern void shmobile_smp_sleep(void);
extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
@@ -191,6 +191,7 @@ static void __init shmobile_smp_apmu_setup_boot(void)
{
/* install boot code shared by all CPUs */
shmobile_boot_fn = __pa_symbol(shmobile_smp_boot);
+ shmobile_boot_fn_gen2 = shmobile_boot_fn;
}
void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
@@ -50,6 +50,18 @@ static inline u32 phys_to_sbar(phys_addr_t addr)
#define SYSCIER 0x0c
#define SYSCIMR 0x10
+static void __iomem *shmobile_boot_vector_gen2_start = NULL;
+static unsigned long clock_status;
+
+void shmobile_set_wdt_clock_status(unsigned long value)
+{
+ if (!shmobile_boot_vector_gen2_start)
+ return;
+ memcpy_toio(shmobile_boot_vector_gen2_start + clock_status,
+ &value, sizeof(value));
+}
+EXPORT_SYMBOL(shmobile_set_wdt_clock_status);
+
#if defined(CONFIG_SMP)
static void __init rcar_gen2_sysc_init(u32 syscier)
@@ -120,8 +132,17 @@ void __init rcar_gen2_pm_init(void)
if (!p)
return;
- memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
- iounmap(p);
+ if (resource_size(&res) >= shmobile_boot_size_gen2) {
+ memcpy_toio(p, shmobile_boot_vector_gen2,
+ shmobile_boot_size_gen2);
+ shmobile_boot_vector_gen2_start = p;
+ clock_status = (&shmobile_wdt_clock_status -
+ (unsigned long *)shmobile_boot_vector_gen2) *
+ sizeof(shmobile_wdt_clock_status);
+ } else {
+ memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
+ }
+
/* setup reset vectors */
p = ioremap_nocache(RST, 0x63);