summaryrefslogtreecommitdiff
path: root/plat/imx/common/include/sci/svc/pm/api.h
diff options
context:
space:
mode:
Diffstat (limited to 'plat/imx/common/include/sci/svc/pm/api.h')
-rw-r--r--plat/imx/common/include/sci/svc/pm/api.h81
1 files changed, 55 insertions, 26 deletions
diff --git a/plat/imx/common/include/sci/svc/pm/api.h b/plat/imx/common/include/sci/svc/pm/api.h
index b12c03e3..0460251a 100644
--- a/plat/imx/common/include/sci/svc/pm/api.h
+++ b/plat/imx/common/include/sci/svc/pm/api.h
@@ -14,6 +14,8 @@
*
* Module for the Power Management (PM) service.
*
+ * @includedoc pm/details.dox
+ *
* @{
*/
@@ -31,10 +33,10 @@
* @name Defines for type widths
*/
/*@{*/
-#define SC_PM_POWER_MODE_W 2 /* Width of sc_pm_power_mode_t */
-#define SC_PM_CLOCK_MODE_W 3 /* Width of sc_pm_clock_mode_t */
-#define SC_PM_RESET_TYPE_W 2 /* Width of sc_pm_reset_type_t */
-#define SC_PM_RESET_REASON_W 3 /* Width of sc_pm_reset_reason_t */
+#define SC_PM_POWER_MODE_W 2U /* Width of sc_pm_power_mode_t */
+#define SC_PM_CLOCK_MODE_W 3U /* Width of sc_pm_clock_mode_t */
+#define SC_PM_RESET_TYPE_W 2U /* Width of sc_pm_reset_type_t */
+#define SC_PM_RESET_REASON_W 4U /* Width of sc_pm_reset_reason_t */
/*@}*/
/*!
@@ -112,28 +114,22 @@
/*@}*/
/*!
- * @name Defines for sc_pm_reset_cause_t
- */
-/*@{*/
-#define SC_PM_RESET_CAUSE_TEMP 0U /* Reset due to temp panic alarm */
-#define SC_PM_RESET_CAUSE_FAULT 1U /* Reset due to fault exception */
-#define SC_PM_RESET_CAUSE_IRQ 2U /* Reset due to SCU reset IRQ */
-#define SC_PM_RESET_CAUSE_WDOG 3U /* Reset due to SW WDOG */
-#define SC_PM_RESET_CAUSE_API 4U /* Reset due to pm_reset() or monitor */
-/*@}*/
-
-/*!
* @name Defines for sc_pm_reset_reason_t
*/
/*@{*/
#define SC_PM_RESET_REASON_POR 0U /* Power on reset */
-#define SC_PM_RESET_REASON_WARM 1U /* Warm reset */
+#define SC_PM_RESET_REASON_JTAG 1U /* JTAG reset */
#define SC_PM_RESET_REASON_SW 2U /* Software reset */
-#define SC_PM_RESET_REASON_WDOG 3U /* Watchdog reset */
-#define SC_PM_RESET_REASON_LOCKUP 4U /* Lockup reset */
-#define SC_PM_RESET_REASON_TAMPER 5U /* Tamper reset */
-#define SC_PM_RESET_REASON_TEMP 6U /* Temp reset */
-#define SC_PM_RESET_REASON_LOW_VOLT 7U /* Low voltage reset */
+#define SC_PM_RESET_REASON_WDOG 3U /* Partition watchdog reset */
+#define SC_PM_RESET_REASON_LOCKUP 4U /* SCU lockup reset */
+#define SC_PM_RESET_REASON_SNVS 5U /* SNVS reset */
+#define SC_PM_RESET_REASON_TEMP 6U /* Temp panic reset */
+#define SC_PM_RESET_REASON_MSI 7U /* MSI reset */
+#define SC_PM_RESET_REASON_UECC 8U /* ECC reset */
+#define SC_PM_RESET_REASON_SCFW_WDOG 9U /* SCFW watchdog reset */
+#define SC_PM_RESET_REASON_ROM_WDOG 10U /* SCU ROM watchdog reset */
+#define SC_PM_RESET_REASON_SECO 11U /* SECO reset */
+#define SC_PM_RESET_REASON_SCFW_FAULT 12U /* SCFW fault reset */
/*@}*/
/*!
@@ -192,11 +188,6 @@ typedef uint32_t sc_pm_clock_rate_t;
typedef uint8_t sc_pm_reset_type_t;
/*!
- * This type is used to declare a desired reset type.
- */
-typedef uint8_t sc_pm_reset_cause;
-
-/*!
* This type is used to declare a reason for a reset.
*/
typedef uint8_t sc_pm_reset_reason_t;
@@ -286,6 +277,9 @@ sc_err_t sc_pm_get_sys_power_mode(sc_ipc_t ipc, sc_rm_pt_t pt,
* - SC_ERR_NOACCESS if caller's partition is not the resource owner
* or parent of the owner
*
+ * Resources must be at SC_PM_PW_MODE_LP mode or higher to access them,
+ * otherwise the master will get a bus error or hang.
+ *
* This function will record the individual resource power mode
* and change it if the requested mode is lower than or equal to the
* partition power mode set with sc_pm_set_partition_power_mode().
@@ -308,6 +302,34 @@ sc_err_t sc_pm_set_resource_power_mode(sc_ipc_t ipc, sc_rsrc_t resource,
sc_pm_power_mode_t mode);
/*!
+* This function sets the power mode for all the resources owned
+* by a child partition.
+*
+* @param[in] ipc IPC handle
+* @param[in] pt handle of child partition
+* @param[in] mode power mode to apply
+* @param[in] exclude resource to exclude
+*
+* @return Returns an error code (SC_ERR_NONE = success).
+*
+* Return errors:
+* - SC_ERR_PARM if invalid partition or mode,
+* - SC_ERR_NOACCESS if caller's partition is not the parent
+* of \a pt
+*
+* This functions loops through all the resources owned by \a pt
+* and sets the power mode to \a mode. It will skip setting
+* \a exclude (SC_R_LAST to skip none).
+*
+* This function can only be called by the parent. It is used to
+* implement some aspects of virtualization.
+*/
+sc_err_t sc_pm_set_resource_power_mode_all(sc_ipc_t ipc,
+ sc_rm_pt_t pt,
+ sc_pm_power_mode_t mode,
+ sc_rsrc_t exclude);
+
+/*!
* This function gets the power mode of a resource.
*
* @param[in] ipc IPC handle
@@ -579,6 +601,13 @@ sc_err_t sc_pm_reset(sc_ipc_t ipc, sc_pm_reset_type_t type);
* @param[in] ipc IPC handle
* @param[out] reason pointer to return reset reason
*
+ * This function returns the reason a partition was reset. If the reason
+ * is POR, then the system reset reason will be returned.
+ *
+ * Note depending on the connection of the WDOG_OUT signal and the OTP
+ * programming of the PMIC, some reset reasons my trigger a system POR
+ * and the original reason will be lost.
+ *
* @return Returns an error code (SC_ERR_NONE = success).
*/
sc_err_t sc_pm_reset_reason(sc_ipc_t ipc, sc_pm_reset_reason_t *reason);