3036: fix iomap base addr error
[firefly-linux-kernel-4.4.55.git] / include / linux / rockchip / common.h
1 #ifndef __MACH_ROCKCHIP_COMMON_H
2 #define __MACH_ROCKCHIP_COMMON_H
3
4 #include <linux/notifier.h>
5
6 #define RK_DEVICE(VIRT,PHYS,SIZE) \
7         { \
8                 .virtual        = (unsigned long)(VIRT), \
9                 .pfn            = __phys_to_pfn(PHYS), \
10                 .length         = SIZE, \
11                 .type           = MT_DEVICE, \
12         }
13
14 extern bool rockchip_jtag_enabled;
15 extern unsigned long rockchip_boot_fn;
16 extern struct smp_operations rockchip_smp_ops;
17
18 extern int (*ddr_change_freq)(uint32_t nMHz);
19 extern long (*ddr_round_rate)(uint32_t nMHz);
20 extern void (*ddr_set_auto_self_refresh)(bool en);
21
22 extern int rockchip_cpu_kill(unsigned int cpu);
23 extern void rockchip_cpu_die(unsigned int cpu);
24 extern int rockchip_cpu_disable(unsigned int cpu);
25
26 #define BOOT_MODE_NORMAL                0
27 #define BOOT_MODE_FACTORY2              1
28 #define BOOT_MODE_RECOVERY              2
29 #define BOOT_MODE_CHARGE                3
30 #define BOOT_MODE_POWER_TEST            4
31 #define BOOT_MODE_OFFMODE_CHARGING      5
32 #define BOOT_MODE_REBOOT                6
33 #define BOOT_MODE_PANIC                 7
34 #define BOOT_MODE_WATCHDOG              8
35 #define BOOT_MODE_TSADC                 9
36
37 extern int rockchip_boot_mode(void);
38 extern void __init rockchip_boot_mode_init(u32 flag, u32 mode);
39 extern void rockchip_restart_get_boot_mode(const char *cmd, u32 *flag, u32 *mode);
40 extern void __init rockchip_suspend_init(void);
41 extern void __init rockchip_ion_reserve(void);
42
43 enum rockchip_pm_policy {
44         ROCKCHIP_PM_POLICY_PERFORMANCE = 0,
45         ROCKCHIP_PM_POLICY_NORMAL,
46         ROCKCHIP_PM_POLICY_POWERSAVE,
47         ROCKCHIP_PM_NR_POLICYS,
48 };
49
50 extern enum rockchip_pm_policy rockchip_pm_get_policy(void);
51 extern int rockchip_pm_set_policy(enum rockchip_pm_policy policy);
52 extern int rockchip_pm_policy_register_notifier(struct notifier_block *nb);
53 extern int rockchip_pm_policy_unregister_notifier(struct notifier_block *nb);
54
55 extern int rockchip_register_system_status_notifier(struct notifier_block *nb);
56 extern int rockchip_unregister_system_status_notifier(struct notifier_block *nb);
57 extern int rockchip_set_system_status(unsigned long status);
58 extern int rockchip_clear_system_status(unsigned long status);
59 extern unsigned long rockchip_get_system_status(void);
60
61 #if IS_ENABLED(CONFIG_SENSORS_ROCKCHIP_TSADC)
62 extern int rockchip_tsadc_get_temp(int chn);
63 #else
64 static inline int rockchip_tsadc_get_temp(int chn) { return 0; }
65 #endif
66
67 #endif