blob: 4b1af936fae91067c79457ad7bd6efcd5eaa5fed [file] [log] [blame]
Magnus Dammc793c1b2010-02-05 11:14:49 +00001#ifndef __ARCH_MACH_COMMON_H
2#define __ARCH_MACH_COMMON_H
3
Magnus Damm08ad42f2012-03-06 17:36:14 +09004extern void shmobile_earlytimer_init(void);
Stephen Warren6bb27d72012-11-08 12:40:59 -07005extern void shmobile_timer_init(void);
Magnus Damm0f2c9f22012-03-28 19:22:30 +09006extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz,
Marc Zyngiera62580e2011-09-08 13:15:22 +01007 unsigned int mult, unsigned int div);
Marc Zyngier4200b162012-01-10 19:44:19 +00008struct twd_local_timer;
Magnus Damm4ae04ac2010-02-08 11:02:54 +00009extern void shmobile_setup_console(void);
Magnus Damm1c51ed42010-12-14 16:56:55 +090010extern void shmobile_secondary_vector(void);
Magnus Damm83ca5c82010-05-20 14:45:03 +000011struct clk;
Magnus Damm6b6a4c02012-02-29 21:41:30 +090012extern int shmobile_clk_init(void);
Magnus Damm863b1712010-12-28 08:27:01 +000013extern void shmobile_handle_irq_intc(struct pt_regs *);
Magnus Dammc3dada12011-04-29 02:23:28 +090014extern struct platform_suspend_ops shmobile_suspend_ops;
Magnus Dammb73b5c42011-11-11 14:01:30 +090015struct cpuidle_driver;
Rafael J. Wysocki5b411472012-08-15 20:58:19 +020016struct cpuidle_device;
17extern int shmobile_enter_wfi(struct cpuidle_device *dev,
18 struct cpuidle_driver *drv, int index);
19extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv);
Magnus Damme47bb512010-05-12 14:21:24 +000020
Magnus Damm2b7eda62010-02-05 11:14:58 +000021extern void sh7372_init_irq(void);
Magnus Damm5d7220ec2012-02-29 21:37:19 +090022extern void sh7372_map_io(void);
Stephen Warren6bb27d72012-11-08 12:40:59 -070023extern void sh7372_earlytimer_init(void);
Magnus Damm2b7eda62010-02-05 11:14:58 +000024extern void sh7372_add_early_devices(void);
25extern void sh7372_add_standard_devices(void);
Guennadi Liakhovetski8a21cda2012-12-31 11:23:50 +000026extern void sh7372_add_early_devices_dt(void);
27extern void sh7372_add_standard_devices_dt(void);
Magnus Damm495b3ce2010-05-12 14:21:34 +000028extern void sh7372_clock_init(void);
Kuninori Morimotob789b3f2010-02-17 09:39:10 +000029extern void sh7372_pinmux_init(void);
Magnus Damm97991652011-04-29 02:28:08 +090030extern void sh7372_pm_init(void);
Magnus Dammf7dadb32011-12-23 01:23:07 +010031extern void sh7372_resume_core_standby_sysc(void);
32extern int sh7372_do_idle_sysc(unsigned long sleep_mode);
Magnus Damm83ca5c82010-05-20 14:45:03 +000033extern struct clk sh7372_extal1_clk;
34extern struct clk sh7372_extal2_clk;
Magnus Damm2b7eda62010-02-05 11:14:58 +000035
Magnus Damm5f53a562010-12-21 08:37:32 +000036extern void sh73a0_init_irq(void);
Magnus Damm50e15c32012-02-29 21:37:27 +090037extern void sh73a0_map_io(void);
Stephen Warren6bb27d72012-11-08 12:40:59 -070038extern void sh73a0_earlytimer_init(void);
Magnus Damm6d9598e2010-11-17 10:59:31 +000039extern void sh73a0_add_early_devices(void);
40extern void sh73a0_add_standard_devices(void);
41extern void sh73a0_clock_init(void);
Takashi YOSHII1cdf3702010-11-19 16:47:16 +090042extern void sh73a0_pinmux_init(void);
Bastian Hecht13baf882012-12-05 12:13:06 +000043extern void sh73a0_pm_init(void);
Bastian Hecht33419a62013-01-09 19:41:51 +000044extern void sh73a0_secondary_vector(void);
Magnus Dammf6d84f42010-12-03 07:22:31 +000045extern struct clk sh73a0_extal1_clk;
46extern struct clk sh73a0_extal2_clk;
Kuninori Morimotod4775352011-12-05 22:29:15 -080047extern struct clk sh73a0_extcki_clk;
48extern struct clk sh73a0_extalr_clk;
Magnus Damm6d9598e2010-11-17 10:59:31 +000049
Kuninori Morimoto6c01ba42011-11-10 18:45:52 -080050extern void r8a7740_init_irq(void);
Magnus Dammd3ab7222012-02-29 21:37:35 +090051extern void r8a7740_map_io(void);
Kuninori Morimoto6c01ba42011-11-10 18:45:52 -080052extern void r8a7740_add_early_devices(void);
53extern void r8a7740_add_standard_devices(void);
54extern void r8a7740_clock_init(u8 md_ck);
55extern void r8a7740_pinmux_init(void);
Bastian Hecht895d3b52012-12-05 12:13:07 +000056extern void r8a7740_pm_init(void);
Kuninori Morimoto6c01ba42011-11-10 18:45:52 -080057
Magnus Dammf411fad2011-12-14 01:36:12 +090058extern void r8a7779_init_irq(void);
Magnus Damm3e353b872012-02-29 21:37:43 +090059extern void r8a7779_map_io(void);
Stephen Warren6bb27d72012-11-08 12:40:59 -070060extern void r8a7779_earlytimer_init(void);
Magnus Dammf411fad2011-12-14 01:36:12 +090061extern void r8a7779_add_early_devices(void);
62extern void r8a7779_add_standard_devices(void);
63extern void r8a7779_clock_init(void);
Magnus Damm19c43fc2011-12-14 01:36:22 +090064extern void r8a7779_pinmux_init(void);
Magnus Damma662c082012-01-10 15:50:01 +090065extern void r8a7779_pm_init(void);
Kuninori Morimotod49679e2012-06-12 02:36:21 -070066extern void r8a7740_meram_workaround(void);
Magnus Dammf411fad2011-12-14 01:36:12 +090067
Magnus Dammb759bd12012-05-10 14:57:22 +090068extern void r8a7779_register_twd(void);
Magnus Dammf40aaf62012-01-10 17:44:39 +090069
Shawn Guo21cc1b72012-04-26 21:58:41 +080070#ifdef CONFIG_SUSPEND
71int shmobile_suspend_init(void);
72#else
73static inline int shmobile_suspend_init(void) { return 0; }
74#endif
75
76#ifdef CONFIG_CPU_IDLE
77int shmobile_cpuidle_init(void);
78#else
79static inline int shmobile_cpuidle_init(void) { return 0; }
80#endif
81
Marc Zyngiera62580e2011-09-08 13:15:22 +010082extern void shmobile_cpu_die(unsigned int cpu);
83extern int shmobile_cpu_disable(unsigned int cpu);
84
85#ifdef CONFIG_HOTPLUG_CPU
86extern int shmobile_cpu_is_dead(unsigned int cpu);
87#else
88static inline int shmobile_cpu_is_dead(unsigned int cpu) { return 1; }
89#endif
90
91extern void shmobile_smp_init_cpus(unsigned int ncores);
92
Arnd Bergmannb3796d92012-09-23 22:36:35 +000093static inline void __init shmobile_init_late(void)
Rafael J. Wysocki35f2b0b2012-08-15 20:57:27 +020094{
95 shmobile_suspend_init();
96 shmobile_cpuidle_init();
97}
98
Magnus Dammc793c1b2010-02-05 11:14:49 +000099#endif /* __ARCH_MACH_COMMON_H */