diff options
author | Ye Li <ye.li@nxp.com> | 2019-02-10 18:59:23 -0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2019-02-10 22:00:02 -0800 |
commit | 2f3e58c8e9a995fddcec34e04adbafaae101303a (patch) | |
tree | 257583746622b8b25daf30148d83077c2b43c18a /arch/arm | |
parent | a9fdc0e4efa5c50ae194f7862d87cf53608afd8c (diff) |
MLK-20901 imx8: Sync SCFW API to latest
Sync the SCFW API to latest commit below:
commit 0721a2af721fca45e9d7e9b673b669ffab9aca7f
Author: Glen Wienecke <glen.wienecke@nxp.com>
Date: Sun Feb 10 19:16:56 2019 -0600
SCF-296: Partition reboot should not reset FSPI/OCRAM if in use
- Update ss_rsrc_reset to return BUSY error if FSPI/OCRAM in use
- Update pm_update_ridx to skip power transition if FSPI/OCRAM in use
- For user_mode update requests, reflect mode achieved after pm_update_ridx
- Add PM SVC call to get active mode (user_mode not accurate during transitions)
- Undo some MISRA updates that changed ss_rsrc_reset to void function
Signed-off-by: Glen Wienecke <glen.wienecke@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/mach-imx/sci/svc/irq/api.h | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/mach-imx/sci/svc/misc/api.h | 23 | ||||
-rw-r--r-- | arch/arm/include/asm/mach-imx/sci/svc/pm/api.h | 36 | ||||
-rw-r--r-- | arch/arm/include/asm/mach-imx/sci/svc/rm/api.h | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | arch/arm/include/asm/mach-imx/sci/svc/seco/api.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/sci/svc/irq/rpc.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/sci/svc/misc/rpc.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/sci/svc/misc/rpc_clnt.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-imx/sci/svc/pad/rpc.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/sci/svc/pm/rpc.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/sci/svc/pm/rpc_clnt.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-imx/sci/svc/rm/rpc.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/sci/svc/seco/rpc.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/sci/svc/timer/rpc.h | 2 |
14 files changed, 100 insertions, 25 deletions
diff --git a/arch/arm/include/asm/mach-imx/sci/svc/irq/api.h b/arch/arm/include/asm/mach-imx/sci/svc/irq/api.h index 56f3fbfc9c8..391eff2c18f 100644 --- a/arch/arm/include/asm/mach-imx/sci/svc/irq/api.h +++ b/arch/arm/include/asm/mach-imx/sci/svc/irq/api.h @@ -88,6 +88,8 @@ /*@{*/ #define SC_IRQ_BUTTON (1U << 0U) /*!< Button interrupt */ #define SC_IRQ_PAD (1U << 1U) /*!< Pad wakeup */ +#define SC_IRQ_USR1 (1U << 2U) /*!< User defined 1 */ +#define SC_IRQ_USR2 (1U << 3U) /*!< User defined 2 */ /*@}*/ /*! diff --git a/arch/arm/include/asm/mach-imx/sci/svc/misc/api.h b/arch/arm/include/asm/mach-imx/sci/svc/misc/api.h index 35fdbb59c91..2f9a06dbb67 100644 --- a/arch/arm/include/asm/mach-imx/sci/svc/misc/api.h +++ b/arch/arm/include/asm/mach-imx/sci/svc/misc/api.h @@ -69,11 +69,11 @@ * @name Defines for sc_misc_bt_t */ /*@{*/ -#define SC_MISC_BT_PRIMARY 0U -#define SC_MISC_BT_SECONDARY 1U -#define SC_MISC_BT_RECOVERY 2U -#define SC_MISC_BT_MANUFACTURE 3U -#define SC_MISC_BT_SERIAL 4U +#define SC_MISC_BT_PRIMARY 0U /*!< Primary boot */ +#define SC_MISC_BT_SECONDARY 1U /*!< Secondary boot */ +#define SC_MISC_BT_RECOVERY 2U /*!< Recovery boot */ +#define SC_MISC_BT_MANUFACTURE 3U /*!< Manufacture boot */ +#define SC_MISC_BT_SERIAL 4U /*!< Serial boot */ /*@}*/ /* Types */ @@ -509,6 +509,19 @@ void sc_misc_get_button_status(sc_ipc_t ipc, sc_bool_t *status); */ sc_err_t sc_misc_rompatch_checksum(sc_ipc_t ipc, uint32_t *checksum); +/*! + * This function calls the board IOCTL function. + * + * @param[in] ipc IPC handle + * @param[in,out] parm1 pointer to pass parameter 1 + * @param[in,out] parm2 pointer to pass parameter 2 + * @param[in,out] parm3 pointer to pass parameter 3 + * + * @return Returns and error code (SC_ERR_NONE = success). + */ +sc_err_t sc_misc_board_ioctl(sc_ipc_t ipc, uint32_t *parm1, + uint32_t *parm2, uint32_t *parm3); + /* @} */ #endif /* SC_MISC_API_H */ diff --git a/arch/arm/include/asm/mach-imx/sci/svc/pm/api.h b/arch/arm/include/asm/mach-imx/sci/svc/pm/api.h index a032b931b8b..eb5e6ba3724 100644 --- a/arch/arm/include/asm/mach-imx/sci/svc/pm/api.h +++ b/arch/arm/include/asm/mach-imx/sci/svc/pm/api.h @@ -596,7 +596,7 @@ sc_err_t sc_pm_reset(sc_ipc_t ipc, sc_pm_reset_type_t type); * This function gets a caller's reset reason. * * @param[in] ipc IPC handle - * @param[out] reason pointer to return reset reason + * @param[out] reason pointer to return the reset reason * * This function returns the reason a partition was reset. If the reason * is POR, then the system reset reason will be returned. @@ -610,6 +610,24 @@ sc_err_t sc_pm_reset(sc_ipc_t ipc, sc_pm_reset_type_t type); sc_err_t sc_pm_reset_reason(sc_ipc_t ipc, sc_pm_reset_reason_t *reason); /*! + * This function gets the partition that caused a reset. + * + * @param[in] ipc IPC handle + * @param[out] pt pointer to return the resetting partition + * + * If the reset reason obtained via sc_pm_reset_reason() is POR then the + * result from this function will be 0. Some SECO causes of reset will + * also return 0. + * + * Note depending on the connection of the WDOG_OUT signal and the OTP + * programming of the PMIC, some resets may trigger a system POR + * and the partition info will be lost. + * + * @return Returns an error code (SC_ERR_NONE = success). + */ +sc_err_t sc_pm_get_reset_part(sc_ipc_t ipc, sc_rm_pt_t *pt); + +/*! * This function is used to boot a partition. * * @param[in] ipc IPC handle @@ -645,12 +663,8 @@ sc_err_t sc_pm_boot(sc_ipc_t ipc, sc_rm_pt_t pt, * power, clocks, etc.) is reset. The boot SW of the booting CPU must be * able to handle peripherals that that are not reset. * - * If \a type is SC_PM_RESET_TYPE_WARM, then only the boot CPU is reset. - * SC state (partitions, power, clocks, etc.) are NOT reset. The boot SW - * of the booting CPU must be able to handle peripherals and SC state that - * that are not reset. - * - * If \a type is SC_PM_RESET_TYPE_BOARD, then return with no action. + * If \a type is SC_PM_RESET_TYPE_WARM or SC_PM_RESET_TYPE_BOARD, then + * returns SC_ERR_PARM as these are not supported. * * If this function returns, then the reset did not occur due to an * invalid parameter. @@ -669,12 +683,8 @@ void sc_pm_reboot(sc_ipc_t ipc, sc_pm_reset_type_t type); * power, clocks, etc.) is reset. The boot SW of the booting CPU must be * able to handle peripherals that that are not reset. * - * If \a type is SC_PM_RESET_TYPE_WARM, then only the boot CPU is reset. - * SC state (partitions, power, clocks, etc.) are NOT reset. The boot SW - * of the booting CPU must be able to handle peripherals and SC state that - * that are not reset. - * - * If \a type is SC_PM_RESET_TYPE_BOARD, then return with no action. + * If \a type is SC_PM_RESET_TYPE_WARM or SC_PM_RESET_TYPE_BOARD, then + * returns SC_ERR_PARM as these are not supported. * * @return Returns an error code (SC_ERR_NONE = success). * diff --git a/arch/arm/include/asm/mach-imx/sci/svc/rm/api.h b/arch/arm/include/asm/mach-imx/sci/svc/rm/api.h index bed944f3ed4..ba9bb9d2435 100644 --- a/arch/arm/include/asm/mach-imx/sci/svc/rm/api.h +++ b/arch/arm/include/asm/mach-imx/sci/svc/rm/api.h @@ -470,6 +470,8 @@ sc_bool_t sc_rm_is_resource_owned(sc_ipc_t ipc, sc_rsrc_t resource); * @param[in] resource resource to check * @param[out] pt pointer to return owning partition * + * @return Returns a boolean (SC_TRUE if the resource is a bus master). + * * Return errors: * - SC_PARM if arguments out of range or invalid * diff --git a/arch/arm/include/asm/mach-imx/sci/svc/seco/api.h b/arch/arm/include/asm/mach-imx/sci/svc/seco/api.h index 9866f9cf99b..529028c5a51 100755..100644 --- a/arch/arm/include/asm/mach-imx/sci/svc/seco/api.h +++ b/arch/arm/include/asm/mach-imx/sci/svc/seco/api.h @@ -442,6 +442,8 @@ void sc_seco_build_info(sc_ipc_t ipc, uint32_t *version, * @param[out] monotonic pointer to return monotonic counter * @param[out] uid_l pointer to return UID (lower 32 bits) * @param[out] uid_h pointer to return UID (upper 32 bits) + * + * @return Returns and error code (SC_ERR_NONE = success). */ sc_err_t sc_seco_chip_info(sc_ipc_t ipc, uint16_t *lc, uint16_t *monotonic, uint32_t *uid_l, uint32_t *uid_h); diff --git a/arch/arm/mach-imx/sci/svc/irq/rpc.h b/arch/arm/mach-imx/sci/svc/irq/rpc.h index 04bc22dfdd9..687dc2866d3 100644 --- a/arch/arm/mach-imx/sci/svc/irq/rpc.h +++ b/arch/arm/mach-imx/sci/svc/irq/rpc.h @@ -38,7 +38,7 @@ * @param[in] caller_pt caller partition * @param[in] msg pointer to RPC message */ -void irq_dispatch(sc_rm_pt_t caller_pt, sc_rpc_msg_t *msg); +void irq_dispatch(sc_rm_pt_t caller_pt, sc_rsrc_t mu, sc_rpc_msg_t *msg); #endif /* SC_IRQ_RPC_H */ diff --git a/arch/arm/mach-imx/sci/svc/misc/rpc.h b/arch/arm/mach-imx/sci/svc/misc/rpc.h index 614f06bd71f..9a6d8ce9eb0 100644 --- a/arch/arm/mach-imx/sci/svc/misc/rpc.h +++ b/arch/arm/mach-imx/sci/svc/misc/rpc.h @@ -57,6 +57,7 @@ #define MISC_FUNC_GET_BOOT_TYPE 33U /*!< Index for misc_get_boot_type() RPC call */ #define MISC_FUNC_GET_BUTTON_STATUS 18U /*!< Index for misc_get_button_status() RPC call */ #define MISC_FUNC_ROMPATCH_CHECKSUM 26U /*!< Index for misc_rompatch_checksum() RPC call */ +#define MISC_FUNC_BOARD_IOCTL 34U /*!< Index for misc_board_ioctl() RPC call */ /*@}*/ /* Types */ @@ -69,7 +70,7 @@ * @param[in] caller_pt caller partition * @param[in] msg pointer to RPC message */ -void misc_dispatch(sc_rm_pt_t caller_pt, sc_rpc_msg_t *msg); +void misc_dispatch(sc_rm_pt_t caller_pt, sc_rsrc_t mu, sc_rpc_msg_t *msg); #endif /* SC_MISC_RPC_H */ diff --git a/arch/arm/mach-imx/sci/svc/misc/rpc_clnt.c b/arch/arm/mach-imx/sci/svc/misc/rpc_clnt.c index d6d0744d751..7dd5a0575bd 100644 --- a/arch/arm/mach-imx/sci/svc/misc/rpc_clnt.c +++ b/arch/arm/mach-imx/sci/svc/misc/rpc_clnt.c @@ -697,5 +697,28 @@ sc_err_t sc_misc_rompatch_checksum(sc_ipc_t ipc, uint32_t *checksum) return (sc_err_t) result; } +sc_err_t sc_misc_board_ioctl(sc_ipc_t ipc, uint32_t *parm1, + uint32_t *parm2, uint32_t *parm3) +{ + sc_rpc_msg_t msg; + uint8_t result; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = U8(SC_RPC_SVC_MISC); + RPC_FUNC(&msg) = U8(MISC_FUNC_BOARD_IOCTL); + RPC_U32(&msg, 0U) = *PTR_U32(parm1); + RPC_U32(&msg, 4U) = *PTR_U32(parm2); + RPC_U32(&msg, 8U) = *PTR_U32(parm3); + RPC_SIZE(&msg) = 4U; + + sc_call_rpc(ipc, &msg, SC_FALSE); + + *parm1 = RPC_U32(&msg, 0U); + *parm2 = RPC_U32(&msg, 4U); + *parm3 = RPC_U32(&msg, 8U); + result = RPC_R8(&msg); + return (sc_err_t) result; +} + /**@}*/ diff --git a/arch/arm/mach-imx/sci/svc/pad/rpc.h b/arch/arm/mach-imx/sci/svc/pad/rpc.h index 35983334f1f..4589e1f801f 100644 --- a/arch/arm/mach-imx/sci/svc/pad/rpc.h +++ b/arch/arm/mach-imx/sci/svc/pad/rpc.h @@ -52,7 +52,7 @@ * @param[in] caller_pt caller partition * @param[in] msg pointer to RPC message */ -void pad_dispatch(sc_rm_pt_t caller_pt, sc_rpc_msg_t *msg); +void pad_dispatch(sc_rm_pt_t caller_pt, sc_rsrc_t mu, sc_rpc_msg_t *msg); #endif /* SC_PAD_RPC_H */ diff --git a/arch/arm/mach-imx/sci/svc/pm/rpc.h b/arch/arm/mach-imx/sci/svc/pm/rpc.h index 0d96cd6c009..8f47daefa81 100644 --- a/arch/arm/mach-imx/sci/svc/pm/rpc.h +++ b/arch/arm/mach-imx/sci/svc/pm/rpc.h @@ -42,6 +42,7 @@ #define PM_FUNC_GET_CLOCK_PARENT 15U /*!< Index for pm_get_clock_parent() RPC call */ #define PM_FUNC_RESET 13U /*!< Index for pm_reset() RPC call */ #define PM_FUNC_RESET_REASON 10U /*!< Index for pm_reset_reason() RPC call */ +#define PM_FUNC_GET_RESET_PART 26U /*!< Index for pm_get_reset_part() RPC call */ #define PM_FUNC_BOOT 8U /*!< Index for pm_boot() RPC call */ #define PM_FUNC_REBOOT 9U /*!< Index for pm_reboot() RPC call */ #define PM_FUNC_REBOOT_PARTITION 12U /*!< Index for pm_reboot_partition() RPC call */ @@ -61,7 +62,7 @@ * @param[in] caller_pt caller partition * @param[in] msg pointer to RPC message */ -void pm_dispatch(sc_rm_pt_t caller_pt, sc_rpc_msg_t *msg); +void pm_dispatch(sc_rm_pt_t caller_pt, sc_rsrc_t mu, sc_rpc_msg_t *msg); #endif /* SC_PM_RPC_H */ diff --git a/arch/arm/mach-imx/sci/svc/pm/rpc_clnt.c b/arch/arm/mach-imx/sci/svc/pm/rpc_clnt.c index 3233729fa43..3ba8d44ad92 100644 --- a/arch/arm/mach-imx/sci/svc/pm/rpc_clnt.c +++ b/arch/arm/mach-imx/sci/svc/pm/rpc_clnt.c @@ -397,6 +397,27 @@ sc_err_t sc_pm_reset_reason(sc_ipc_t ipc, sc_pm_reset_reason_t *reason) return (sc_err_t) result; } +sc_err_t sc_pm_get_reset_part(sc_ipc_t ipc, sc_rm_pt_t *pt) +{ + sc_rpc_msg_t msg; + uint8_t result; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = U8(SC_RPC_SVC_PM); + RPC_FUNC(&msg) = U8(PM_FUNC_GET_RESET_PART); + RPC_SIZE(&msg) = 1U; + + sc_call_rpc(ipc, &msg, SC_FALSE); + + result = RPC_R8(&msg); + if (pt != NULL) + { + *pt = RPC_U8(&msg, 0U); + } + + return (sc_err_t) result; +} + sc_err_t sc_pm_boot(sc_ipc_t ipc, sc_rm_pt_t pt, sc_rsrc_t resource_cpu, sc_faddr_t boot_addr, sc_rsrc_t resource_mu, sc_rsrc_t resource_dev) diff --git a/arch/arm/mach-imx/sci/svc/rm/rpc.h b/arch/arm/mach-imx/sci/svc/rm/rpc.h index 879522c96a6..d8b86fd1aa7 100644 --- a/arch/arm/mach-imx/sci/svc/rm/rpc.h +++ b/arch/arm/mach-imx/sci/svc/rm/rpc.h @@ -69,7 +69,7 @@ * @param[in] caller_pt caller partition * @param[in] msg pointer to RPC message */ -void rm_dispatch(sc_rm_pt_t caller_pt, sc_rpc_msg_t *msg); +void rm_dispatch(sc_rm_pt_t caller_pt, sc_rsrc_t mu, sc_rpc_msg_t *msg); #endif /* SC_RM_RPC_H */ diff --git a/arch/arm/mach-imx/sci/svc/seco/rpc.h b/arch/arm/mach-imx/sci/svc/seco/rpc.h index f17ce22583f..cfc742cf936 100644 --- a/arch/arm/mach-imx/sci/svc/seco/rpc.h +++ b/arch/arm/mach-imx/sci/svc/seco/rpc.h @@ -56,7 +56,7 @@ * @param[in] caller_pt caller partition * @param[in] msg pointer to RPC message */ -void seco_dispatch(sc_rm_pt_t caller_pt, sc_rpc_msg_t *msg); +void seco_dispatch(sc_rm_pt_t caller_pt, sc_rsrc_t mu, sc_rpc_msg_t *msg); #endif /* SC_SECO_RPC_H */ diff --git a/arch/arm/mach-imx/sci/svc/timer/rpc.h b/arch/arm/mach-imx/sci/svc/timer/rpc.h index a071f47f527..c97147c5a30 100644 --- a/arch/arm/mach-imx/sci/svc/timer/rpc.h +++ b/arch/arm/mach-imx/sci/svc/timer/rpc.h @@ -54,7 +54,7 @@ * @param[in] caller_pt caller partition * @param[in] msg pointer to RPC message */ -void timer_dispatch(sc_rm_pt_t caller_pt, sc_rpc_msg_t *msg); +void timer_dispatch(sc_rm_pt_t caller_pt, sc_rsrc_t mu, sc_rpc_msg_t *msg); #endif /* SC_TIMER_RPC_H */ |