blob: 2d1686becdd558755da2d87434785d660c6e6b36 [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);
Magnus Dammf6d84f42010-12-03 07:22:31 +000043extern struct clk sh73a0_extal1_clk;
44extern struct clk sh73a0_extal2_clk;
Kuninori Morimotod4775352011-12-05 22:29:15 -080045extern struct clk sh73a0_extcki_clk;
46extern struct clk sh73a0_extalr_clk;
Magnus Damm6d9598e2010-11-17 10:59:31 +000047
Kuninori Morimoto6c01ba42011-11-10 18:45:52 -080048extern void r8a7740_init_irq(void);
Magnus Dammd3ab7222012-02-29 21:37:35 +090049extern void r8a7740_map_io(void);
Kuninori Morimoto6c01ba42011-11-10 18:45:52 -080050extern void r8a7740_add_early_devices(void);
51extern void r8a7740_add_standard_devices(void);
52extern void r8a7740_clock_init(u8 md_ck);
53extern void r8a7740_pinmux_init(void);
54
Magnus Dammf411fad2011-12-14 01:36:12 +090055extern void r8a7779_init_irq(void);
Magnus Damm3e353b872012-02-29 21:37:43 +090056extern void r8a7779_map_io(void);
Stephen Warren6bb27d72012-11-08 12:40:59 -070057extern void r8a7779_earlytimer_init(void);
Magnus Dammf411fad2011-12-14 01:36:12 +090058extern void r8a7779_add_early_devices(void);
59extern void r8a7779_add_standard_devices(void);
60extern void r8a7779_clock_init(void);
Magnus Damm19c43fc2011-12-14 01:36:22 +090061extern void r8a7779_pinmux_init(void);
Magnus Damma662c082012-01-10 15:50:01 +090062extern void r8a7779_pm_init(void);
Kuninori Morimotod49679e2012-06-12 02:36:21 -070063extern void r8a7740_meram_workaround(void);
Magnus Dammf411fad2011-12-14 01:36:12 +090064
Magnus Dammb759bd12012-05-10 14:57:22 +090065extern void r8a7779_register_twd(void);
Magnus Dammf40aaf62012-01-10 17:44:39 +090066
Shawn Guo21cc1b72012-04-26 21:58:41 +080067#ifdef CONFIG_SUSPEND
68int shmobile_suspend_init(void);
69#else
70static inline int shmobile_suspend_init(void) { return 0; }
71#endif
72
73#ifdef CONFIG_CPU_IDLE
74int shmobile_cpuidle_init(void);
75#else
76static inline int shmobile_cpuidle_init(void) { return 0; }
77#endif
78
Marc Zyngiera62580e2011-09-08 13:15:22 +010079extern void shmobile_cpu_die(unsigned int cpu);
80extern int shmobile_cpu_disable(unsigned int cpu);
81
82#ifdef CONFIG_HOTPLUG_CPU
83extern int shmobile_cpu_is_dead(unsigned int cpu);
84#else
85static inline int shmobile_cpu_is_dead(unsigned int cpu) { return 1; }
86#endif
87
88extern void shmobile_smp_init_cpus(unsigned int ncores);
89
Arnd Bergmannb3796d92012-09-23 22:36:35 +000090static inline void __init shmobile_init_late(void)
Rafael J. Wysocki35f2b0b2012-08-15 20:57:27 +020091{
92 shmobile_suspend_init();
93 shmobile_cpuidle_init();
94}
95
Magnus Dammc793c1b2010-02-05 11:14:49 +000096#endif /* __ARCH_MACH_COMMON_H */