24#ifndef __ARCH_ARM_INCLUDE_CXD56XX_PM_H
25#define __ARCH_ARM_INCLUDE_CXD56XX_PM_H
31#include <nuttx/config.h>
32#include <nuttx/queue.h>
40#define PM_BOOT_POR_NORMAL (0x00000000ul)
41#define PM_BOOT_POR_DEADBATT (0x00000001ul)
42#define PM_BOOT_WDT_REBOOT (0x00000002ul)
43#define PM_BOOT_WDT_RESET (0x00000004ul)
44#define PM_BOOT_DEEP_WKUPL (0x00000008ul)
45#define PM_BOOT_DEEP_WKUPS (0x00000010ul)
46#define PM_BOOT_DEEP_RTC (0x00000020ul)
47#define PM_BOOT_DEEP_USB_ATTACH (0x00000040ul)
48#define PM_BOOT_DEEP_OTHERS (0x00000080ul)
49#define PM_BOOT_COLD_SCU_INT (0x00000100ul)
50#define PM_BOOT_COLD_RTC (0x00001e00ul)
51#define PM_BOOT_COLD_RTC_ALM0 (0x00000200ul)
52#define PM_BOOT_COLD_RTC_ALM1 (0x00000400ul)
53#define PM_BOOT_COLD_RTC_ALM2 (0x00000800ul)
54#define PM_BOOT_COLD_RTC_ALMERR (0x00001000ul)
55#define PM_BOOT_COLD_GPIO (0x0fff0000ul)
56#define PM_BOOT_COLD_SEN_INT (0x10000000ul)
57#define PM_BOOT_COLD_PMIC_INT (0x20000000ul)
58#define PM_BOOT_COLD_USB_DETACH (0x40000000ul)
59#define PM_BOOT_COLD_USB_ATTACH (0x80000000ul)
63#define PMCMD_RAM_OFF 0
64#define PMCMD_RAM_RET 1
69#define PM_CPUFREQLOCK_FLAG_HV (0x0001)
70#define PM_CPUFREQLOCK_FLAG_LV (0x4000)
71#define PM_CPUFREQLOCK_FLAG_HOLD (0x8000)
75#define PM_CPUFREQLOCK_TAG(prefix1, prefix2, num) \
76 (((prefix1) << 24) + ((prefix2) << 16) + (num))
80# define PM_CPUFREQLOCK_INIT(_tag, _flag) \
89#define PM_CPUWAKELOCK_TAG(prefix1, prefix2, num) \
90 (((prefix1) << 24) + ((prefix2) << 16) + (num))
94#define PM_CPUWAKELOCK_INIT(_tag) \
116 struct sq_entry_s sq_entry;
126 struct sq_entry_s sq_entry;
135 PMIC_NOTIFY_ALARM = 0,
144typedef void (*pmic_notify_t)(
void *arg);
151#define EXTERN extern "C"
166int up_pmramctrl(
int cmd, uintptr_t addr,
size_t size);
168#ifdef CONFIG_CXD56_PM_DEBUG_INFO
177void up_pmstatdump(
void);
179# define up_pmstatdump()
265int up_pm_count_acquire_wakelock(
void);
280uint32_t up_pm_get_bootcause(
void);
295uint32_t up_pm_get_bootmask(
void);
311uint32_t up_pm_set_bootmask(uint32_t mask);
327uint32_t up_pm_clr_bootmask(uint32_t mask);
340int up_pm_sleep(
enum pm_sleepmode_e mode);
350int up_pm_reboot(
void);
367#ifdef CONFIG_CXD56_PMIC_INT
368int up_pmic_set_notify(
int kind, pmic_notify_t cb);
370# define up_pmic_set_notify(kind, cb)