29 #define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name))
47 #define EPOD_ID_SVAMMDSP 0
48 #define EPOD_ID_SVAPIPE 1
49 #define EPOD_ID_SIAMMDSP 2
50 #define EPOD_ID_SIAPIPE 3
52 #define EPOD_ID_B2R2_MCDE 5
53 #define EPOD_ID_ESRAM12 6
54 #define EPOD_ID_ESRAM34 7
66 #define EPOD_STATE_NO_CHANGE 0x00
67 #define EPOD_STATE_OFF 0x01
68 #define EPOD_STATE_RAMRET 0x02
69 #define EPOD_STATE_ON_CLK_OFF 0x03
70 #define EPOD_STATE_ON 0x04
75 #define PRCMU_CLKSRC_CLK38M 0x00
76 #define PRCMU_CLKSRC_ACLK 0x01
77 #define PRCMU_CLKSRC_SYSCLK 0x02
78 #define PRCMU_CLKSRC_LCDCLK 0x03
79 #define PRCMU_CLKSRC_SDMMCCLK 0x04
80 #define PRCMU_CLKSRC_TVCLK 0x05
81 #define PRCMU_CLKSRC_TIMCLK 0x06
82 #define PRCMU_CLKSRC_CLK009 0x07
84 #define PRCMU_CLKSRC_SIAMMDSPCLK 0x40
85 #define PRCMU_CLKSRC_I2CCLK 0x41
86 #define PRCMU_CLKSRC_MSP02CLK 0x42
87 #define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43
88 #define PRCMU_CLKSRC_HSIRXCLK 0x44
89 #define PRCMU_CLKSRC_HSITXCLK 0x45
90 #define PRCMU_CLKSRC_ARMCLKFIX 0x46
91 #define PRCMU_CLKSRC_HDMICLK 0x47
200 #define ESRAM0_DEEP_SLEEP_STATE_OFF 1
201 #define ESRAM0_DEEP_SLEEP_STATE_RET 2
219 #if defined(CONFIG_UX500_SOC_DB8500)
223 static inline void __init prcmu_early_init(
void)
228 static inline int prcmu_set_power_state(
u8 state,
bool keep_ulp_clk,
235 static inline u8 prcmu_get_power_state_result(
void)
240 static inline int prcmu_gic_decouple(
void)
245 static inline int prcmu_gic_recouple(
void)
250 static inline bool prcmu_gic_pending_irq(
void)
255 static inline bool prcmu_is_cpu_in_wfi(
int cpu)
260 static inline int prcmu_copy_gic_settings(
void)
265 static inline bool prcmu_pending_irq(
void)
270 static inline int prcmu_set_epod(
u16 epod_id,
u8 epod_state)
275 static inline void prcmu_enable_wakeups(
u32 wakeups)
280 static inline void prcmu_disable_wakeups(
void)
282 prcmu_enable_wakeups(0);
285 static inline void prcmu_config_abb_event_readout(
u32 abb_events)
290 static inline void prcmu_get_abb_event_buffer(
void __iomem **
buf)
310 static inline int prcmu_set_ddr_opp(
u8 opp)
314 static inline int prcmu_get_ddr_opp(
void)
319 static inline int prcmu_set_arm_opp(
u8 opp)
324 static inline int prcmu_get_arm_opp(
void)
329 static inline int prcmu_set_ape_opp(
u8 opp)
334 static inline int prcmu_get_ape_opp(
void)
339 static inline void prcmu_system_reset(
u16 reset_code)
344 static inline u16 prcmu_get_reset_code(
void)
351 static inline void prcmu_modem_reset(
void)
356 static inline bool prcmu_is_ac_wake_requested(
void)
361 static inline int prcmu_set_display_clocks(
void)
366 static inline int prcmu_disable_dsipll(
void)
371 static inline int prcmu_enable_dsipll(
void)
376 static inline int prcmu_config_esram0_deep_sleep(
u8 state)
381 static inline int prcmu_config_hotdog(
u8 threshold)
386 static inline int prcmu_config_hotmon(
u8 low,
u8 high)
391 static inline int prcmu_start_temp_sense(
u16 cycles32k)
396 static inline int prcmu_stop_temp_sense(
void)
401 static inline u32 prcmu_read(
unsigned int reg)
406 static inline void prcmu_write(
unsigned int reg,
u32 value)
416 static inline int prcmu_enable_a9wdog(
u8 id)
421 static inline int prcmu_disable_a9wdog(
u8 id)
426 static inline int prcmu_kick_a9wdog(
u8 id)
431 static inline int prcmu_load_a9wdog(
u8 id,
u32 timeout)
436 static inline int prcmu_config_a9wdog(
u8 num,
bool sleep_auto_off)
442 static inline void __init prcmu_early_init(
void) {}
444 static inline int prcmu_set_power_state(
u8 state,
bool keep_ulp_clk,
450 static inline int prcmu_set_epod(
u16 epod_id,
u8 epod_state)
455 static inline void prcmu_enable_wakeups(
u32 wakeups) {}
457 static inline void prcmu_disable_wakeups(
void) {}
500 static inline int prcmu_set_ape_opp(
u8 opp)
505 static inline int prcmu_get_ape_opp(
void)
510 static inline int prcmu_set_arm_opp(
u8 opp)
515 static inline int prcmu_get_arm_opp(
void)
520 static inline int prcmu_set_ddr_opp(
u8 opp)
525 static inline int prcmu_get_ddr_opp(
void)
530 static inline void prcmu_system_reset(
u16 reset_code) {}
532 static inline u16 prcmu_get_reset_code(
void)
544 static inline void prcmu_modem_reset(
void) {}
546 static inline bool prcmu_is_ac_wake_requested(
void)
551 static inline int prcmu_set_display_clocks(
void)
556 static inline int prcmu_disable_dsipll(
void)
561 static inline int prcmu_enable_dsipll(
void)
566 static inline int prcmu_config_esram0_deep_sleep(
u8 state)
571 static inline void prcmu_config_abb_event_readout(
u32 abb_events) {}
573 static inline void prcmu_get_abb_event_buffer(
void __iomem **
buf)
578 static inline int prcmu_config_hotdog(
u8 threshold)
583 static inline int prcmu_config_hotmon(
u8 low,
u8 high)
588 static inline int prcmu_start_temp_sense(
u16 cycles32k)
593 static inline int prcmu_stop_temp_sense(
void)
598 static inline u32 prcmu_read(
unsigned int reg)
603 static inline void prcmu_write(
unsigned int reg,
u32 value) {}
609 static inline void prcmu_set(
unsigned int reg,
u32 bits)
611 prcmu_write_masked(reg, bits, bits);
614 static inline void prcmu_clear(
unsigned int reg,
u32 bits)
616 prcmu_write_masked(reg, bits, 0);
619 #if defined(CONFIG_UX500_SOC_DB8500)
624 static inline void prcmu_enable_spi2(
void)
633 static inline void prcmu_disable_spi2(
void)
643 static inline void prcmu_enable_stm_mod_uart(
void)
645 if (cpu_is_u8500()) {
656 static inline void prcmu_disable_stm_mod_uart(
void)
658 if (cpu_is_u8500()) {
668 static inline void prcmu_enable_stm_ape(
void)
670 if (cpu_is_u8500()) {
679 static inline void prcmu_disable_stm_ape(
void)
681 if (cpu_is_u8500()) {
689 static inline void prcmu_enable_spi2(
void) {}
690 static inline void prcmu_disable_spi2(
void) {}
691 static inline void prcmu_enable_stm_mod_uart(
void) {}
692 static inline void prcmu_disable_stm_mod_uart(
void) {}
693 static inline void prcmu_enable_stm_ape(
void) {}
694 static inline void prcmu_disable_stm_ape(
void) {}
699 #define PRCMU_QOS_APE_OPP 1
700 #define PRCMU_QOS_DDR_OPP 2
701 #define PRCMU_QOS_ARM_OPP 3
702 #define PRCMU_QOS_DEFAULT_VALUE -1
704 #ifdef CONFIG_DBX500_PRCMU_QOS_POWER
706 unsigned long prcmu_qos_get_cpufreq_opp_delay(
void);
707 void prcmu_qos_set_cpufreq_opp_delay(
unsigned long);
708 void prcmu_qos_force_opp(
int,
s32);
709 int prcmu_qos_requirement(
int pm_qos_class);
710 int prcmu_qos_add_requirement(
int pm_qos_class,
char *
name,
s32 value);
711 int prcmu_qos_update_requirement(
int pm_qos_class,
char *
name,
s32 new_value);
712 void prcmu_qos_remove_requirement(
int pm_qos_class,
char *
name);
713 int prcmu_qos_add_notifier(
int prcmu_qos_class,
715 int prcmu_qos_remove_notifier(
int prcmu_qos_class,
720 static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(
void)
725 static inline void prcmu_qos_set_cpufreq_opp_delay(
unsigned long n) {}
727 static inline void prcmu_qos_force_opp(
int prcmu_qos_class,
s32 i) {}
729 static inline int prcmu_qos_requirement(
int prcmu_qos_class)
734 static inline int prcmu_qos_add_requirement(
int prcmu_qos_class,
740 static inline int prcmu_qos_update_requirement(
int prcmu_qos_class,
746 static inline void prcmu_qos_remove_requirement(
int prcmu_qos_class,
char *
name)
750 static inline int prcmu_qos_add_notifier(
int prcmu_qos_class,
755 static inline int prcmu_qos_remove_notifier(
int prcmu_qos_class,