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 PM_BOOT_GPIO_MASK(irq) (1 << ((irq) - CXD56_IRQ_EXDEVICE_0 + 16))
67#define PMCMD_RAM_OFF 0
68#define PMCMD_RAM_RET 1
73#define PM_CPUFREQLOCK_FLAG_HV (0x0001)
74#define PM_CPUFREQLOCK_FLAG_LV (0x4000)
75#define PM_CPUFREQLOCK_FLAG_HOLD (0x8000)
79#define PM_CPUFREQLOCK_TAG(prefix1, prefix2, num) \
80 (((prefix1) << 24) + ((prefix2) << 16) + (num))
84# define PM_CPUFREQLOCK_INIT(_tag, _flag) \
93#define PM_CPUWAKELOCK_TAG(prefix1, prefix2, num) \
94 (((prefix1) << 24) + ((prefix2) << 16) + (num))
98#define PM_CPUWAKELOCK_INIT(_tag) \
120 struct sq_entry_s sq_entry;
130 struct sq_entry_s sq_entry;
139 PMIC_NOTIFY_ALARM = 0,
148typedef void (*pmic_notify_t)(
void *arg);
155#define EXTERN extern "C"
170int up_pmramctrl(
int cmd, uintptr_t addr,
size_t size);
172#ifdef CONFIG_CXD56_PM_DEBUG_INFO
181void up_pmstatdump(
void);
183# define up_pmstatdump()
269int up_pm_count_acquire_wakelock(
void);
284uint32_t up_pm_get_bootcause(
void);
299uint32_t up_pm_get_bootmask(
void);
315uint32_t up_pm_set_bootmask(uint32_t mask);
331uint32_t up_pm_clr_bootmask(uint32_t mask);
344int up_pm_sleep(
enum pm_sleepmode_e mode);
354int up_pm_reboot(
void);
371#ifdef CONFIG_CXD56_PMIC_INT
372int up_pmic_set_notify(
int kind, pmic_notify_t cb);
374# define up_pmic_set_notify(kind, cb)