From 642172bbb73faa5302bf83bbcd01e190f00bbd62 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Fri, 13 Oct 2017 03:34:25 -0500 Subject: MLK-16587-1 imx8qm/qxp: Sync SCFW API to latest Sync SCFW API to commit a6fd9a48626ef8c93a798c5fb984898b2017bf16. It adds a API to get boot device. Signed-off-by: Ye Li Reviewed-by: Peng Fan (cherry picked from commit 34ee0796ef753abe94b88cfd483ed2caa2716575) --- arch/arm/imx-common/sci/svc/misc/rpc.h | 1 + arch/arm/imx-common/sci/svc/misc/rpc_clnt.c | 16 ++++ arch/arm/imx-common/sci/svc/timer/rpc.h | 1 + arch/arm/imx-common/sci/svc/timer/rpc_clnt.c | 17 ++++ arch/arm/include/asm/imx-common/sci/sci.h | 1 - arch/arm/include/asm/imx-common/sci/svc/misc/api.h | 8 ++ arch/arm/include/asm/imx-common/sci/svc/otp/api.h | 104 --------------------- .../arm/include/asm/imx-common/sci/svc/timer/api.h | 15 +++ arch/arm/include/asm/imx-common/sci/types.h | 2 + 9 files changed, 60 insertions(+), 105 deletions(-) delete mode 100755 arch/arm/include/asm/imx-common/sci/svc/otp/api.h diff --git a/arch/arm/imx-common/sci/svc/misc/rpc.h b/arch/arm/imx-common/sci/svc/misc/rpc.h index 2840cb1a84..cf312c9947 100644 --- a/arch/arm/imx-common/sci/svc/misc/rpc.h +++ b/arch/arm/imx-common/sci/svc/misc/rpc.h @@ -42,6 +42,7 @@ typedef enum misc_func_e MISC_FUNC_OTP_FUSE_READ = 11, /*!< Index for misc_otp_fuse_read() RPC call */ MISC_FUNC_SET_TEMP = 12, /*!< Index for misc_set_temp() RPC call */ MISC_FUNC_GET_TEMP = 13, /*!< Index for misc_get_temp() RPC call */ + MISC_FUNC_GET_BOOT_DEV = 16, /*!< Index for misc_get_boot_dev() RPC call */ } misc_func_t; /* Functions */ diff --git a/arch/arm/imx-common/sci/svc/misc/rpc_clnt.c b/arch/arm/imx-common/sci/svc/misc/rpc_clnt.c index 25f8b09c67..91b572f2b0 100644 --- a/arch/arm/imx-common/sci/svc/misc/rpc_clnt.c +++ b/arch/arm/imx-common/sci/svc/misc/rpc_clnt.c @@ -313,5 +313,21 @@ sc_err_t sc_misc_get_temp(sc_ipc_t ipc, sc_rsrc_t resource, return (sc_err_t) result; } +void sc_misc_get_boot_dev(sc_ipc_t ipc, sc_rsrc_t *dev) +{ + sc_rpc_msg_t msg; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = SC_RPC_SVC_MISC; + RPC_FUNC(&msg) = MISC_FUNC_GET_BOOT_DEV; + RPC_SIZE(&msg) = 1; + + sc_call_rpc(ipc, &msg, false); + + if (dev != NULL) + *dev = RPC_U16(&msg, 0); + return; +} + /**@}*/ diff --git a/arch/arm/imx-common/sci/svc/timer/rpc.h b/arch/arm/imx-common/sci/svc/timer/rpc.h index 7ba00b6f27..b87056bcc7 100644 --- a/arch/arm/imx-common/sci/svc/timer/rpc.h +++ b/arch/arm/imx-common/sci/svc/timer/rpc.h @@ -37,6 +37,7 @@ typedef enum timer_func_e TIMER_FUNC_GET_RTC_TIME = 7, /*!< Index for timer_get_rtc_time() RPC call */ TIMER_FUNC_GET_RTC_SEC1970 = 9, /*!< Index for timer_get_rtc_sec1970() RPC call */ TIMER_FUNC_SET_RTC_ALARM = 8, /*!< Index for timer_set_rtc_alarm() RPC call */ + TIMER_FUNC_SET_RTC_CALB = 11, /*!< Index for timer_set_rtc_calb() RPC call */ } timer_func_t; /* Functions */ diff --git a/arch/arm/imx-common/sci/svc/timer/rpc_clnt.c b/arch/arm/imx-common/sci/svc/timer/rpc_clnt.c index 6e11d3782d..7fc6bcd042 100644 --- a/arch/arm/imx-common/sci/svc/timer/rpc_clnt.c +++ b/arch/arm/imx-common/sci/svc/timer/rpc_clnt.c @@ -230,5 +230,22 @@ sc_err_t sc_timer_set_rtc_alarm(sc_ipc_t ipc, uint16_t year, uint8_t mon, return (sc_err_t) result; } +sc_err_t sc_timer_set_rtc_calb(sc_ipc_t ipc, int8_t count) +{ + sc_rpc_msg_t msg; + uint8_t result; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = SC_RPC_SVC_TIMER; + RPC_FUNC(&msg) = TIMER_FUNC_SET_RTC_CALB; + RPC_I8(&msg, 0) = count; + RPC_SIZE(&msg) = 2; + + sc_call_rpc(ipc, &msg, false); + + result = RPC_R8(&msg); + return (sc_err_t) result; +} + /**@}*/ diff --git a/arch/arm/include/asm/imx-common/sci/sci.h b/arch/arm/include/asm/imx-common/sci/sci.h index 756bc63710..ae2907410a 100644 --- a/arch/arm/include/asm/imx-common/sci/sci.h +++ b/arch/arm/include/asm/imx-common/sci/sci.h @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/arm/include/asm/imx-common/sci/svc/misc/api.h b/arch/arm/include/asm/imx-common/sci/svc/misc/api.h index cc42af56e6..0de86b55de 100644 --- a/arch/arm/include/asm/imx-common/sci/svc/misc/api.h +++ b/arch/arm/include/asm/imx-common/sci/svc/misc/api.h @@ -369,6 +369,14 @@ sc_err_t sc_misc_set_temp(sc_ipc_t ipc, sc_rsrc_t resource, sc_err_t sc_misc_get_temp(sc_ipc_t ipc, sc_rsrc_t resource, sc_misc_temp_t temp, int16_t *celsius, int8_t *tenths); +/*! + * This function returns the boot device. + * + * @param[in] ipc IPC handle + * @param[out] dev pointer to return boot device + */ +void sc_misc_get_boot_dev(sc_ipc_t ipc, sc_rsrc_t *dev); + /* @} */ #endif /* _SC_MISC_API_H */ diff --git a/arch/arm/include/asm/imx-common/sci/svc/otp/api.h b/arch/arm/include/asm/imx-common/sci/svc/otp/api.h deleted file mode 100755 index 367a24f734..0000000000 --- a/arch/arm/include/asm/imx-common/sci/svc/otp/api.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2016 Freescale Semiconductor, Inc. - * Copyright 2017 NXP - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -/*! - * Header file containing the public API for the System Controller (SC) - * One Time Programmable (OTP) function. - * - * @addtogroup OTP_SVC (SVC) One Time Programmable Service - * - * Module for the One Time Programmable (OTP) service. - * - * @{ - */ - -#ifndef _SC_OTP_API_H -#define _SC_OTP_API_H - -/* Includes */ - -#include - -/* Defines */ - -/* Types */ - -/*! - * This type is used to declare OTP values in word lengths. - */ -typedef uint32_t sc_otp_word_t; - -/*! - * This type is used to declare OTP offset values (of OTP word lengths). - */ -typedef uint8_t sc_otp_offset_t; - -/* Functions */ - -/*! - * This function reads the OTP value. - * - * @param[in] ipc IPC handle - * @param[in] offset offset into OTP region - * @param[out] data data to read from the OTP - * - * @return Returns an error code (SC_ERR_NONE = success). - * - * Return errors: - * - SC_ERR_UNAVAILABLE if caller's partition has no OTP resources, - * - SC_ERR_PARM if arguments out of range or invalid, - * - SC_ERR_NOACCESS No read allowed - */ -sc_err_t sc_otp_read(sc_ipc_t ipc, sc_otp_word_t *data, - sc_otp_offset_t offset); - -/*! - * This function writes the OTP value. - * - * @param[in] ipc IPC handle - * @param[in] offset offset into OTP region - * @param[in] data data to write to the OTP - * @param[in] bitmask mask bits to program - * - * @return Returns an error code (SC_ERR_NONE = success). - * - * Return errors: - * - SC_ERR_UNAVAILABLE if caller's partition has no OTP resources, - * - SC_ERR_PARM if arguments out of range or invalid, - * - SC_ERR_NOACCESS No write allowed - */ -sc_err_t sc_otp_write(sc_ipc_t ipc, sc_otp_word_t data, - sc_otp_offset_t offset, sc_otp_word_t bitmask); - -/*! - * This function allows the owner of a partition to set and lock access - * permissions. These permissions are carried forward if the OTP is - * reassigned - * - * @param[in] ipc IPC handle - * @param[in] offset OTP word to access - * @param[in] readen allows read access - * @param[in] writeen allows write access - * @param[in] lock no further changes to permissions during - * power cycle is allowed - * - * @return Returns an error code (SC_ERR_NONE = success). - * - * Return errors: - * - SC_ERR_UNAVAILABLE if caller's partition has no OTP resources, - * - SC_ERR_LOCKED if partition is already locked - * - * Assigns some part of the OTP resource owned by the caller's partition - * to another partition. - */ -sc_err_t sc_otp_set_permissions(sc_ipc_t ipc, sc_otp_offset_t offset, - bool readen, bool writeen, bool lock); - -#endif /* _SC_OTP_API_H */ - -/**@}*/ - diff --git a/arch/arm/include/asm/imx-common/sci/svc/timer/api.h b/arch/arm/include/asm/imx-common/sci/svc/timer/api.h index 5059451ba0..7e9454e191 100644 --- a/arch/arm/include/asm/imx-common/sci/svc/timer/api.h +++ b/arch/arm/include/asm/imx-common/sci/svc/timer/api.h @@ -220,6 +220,21 @@ sc_err_t sc_timer_get_rtc_sec1970(sc_ipc_t ipc, uint32_t *sec); sc_err_t sc_timer_set_rtc_alarm(sc_ipc_t ipc, uint16_t year, uint8_t mon, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec); +/*! + * This function sets the RTC calibration value. Only the owner of the SC_R_SYSTEM + * resource can set the calibration. + * + * @param[in] ipc IPC handle + * @param[in] count calbration count (-16 to 15) + * + * The calibration value is a 5-bit value including the sign bit, which is + * implemented in 2's complement. It is added or subtracted from the RTC on + * a perdiodic basis, once per 32768 cycles of the RTC clock. + * + * @return Returns an error code (SC_ERR_NONE = success). + */ +sc_err_t sc_timer_set_rtc_calb(sc_ipc_t ipc, int8_t count); + /* @} */ #endif /* _SC_TIMER_API_H */ diff --git a/arch/arm/include/asm/imx-common/sci/types.h b/arch/arm/include/asm/imx-common/sci/types.h index c7ad6e5581..928023bdb6 100644 --- a/arch/arm/include/asm/imx-common/sci/types.h +++ b/arch/arm/include/asm/imx-common/sci/types.h @@ -697,6 +697,8 @@ typedef enum sc_rsrc_e SC_R_BOARD_R5 = 529, SC_R_BOARD_R6 = 530, SC_R_BOARD_R7 = 531, + SC_R_MJPEG_DEC_MP = 532, + SC_R_MJPEG_ENC_MP = 533, SC_R_LAST } sc_rsrc_t; -- cgit v1.2.3