diff options
| author | Tom Rini <[email protected]> | 2019-07-27 09:35:05 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2019-07-27 09:35:05 -0400 |
| commit | df9a7a195bdf0722399199bf373afc8309ae3ad7 (patch) | |
| tree | 5bf1e2e3388725131640aac7d120647820ca5b48 /drivers/misc | |
| parent | 222701e157176a66628e4f399f52ca3307b018c9 (diff) | |
| parent | 4a6f5b4f56b8bc6f36736fc0a07c5c4f9069e69b (diff) | |
Merge tag 'u-boot-imx-20190719' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
u-boot-imx-20190719
- CCF for i.MX6
- nandbcb command to write SPL into NAND
- Switch to DM (i.MX28)
- Boards: Toradex, engicam, DH
- Fixes for i.MX8
- Fixes for i.MX7ULP
Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/561147504
Diffstat (limited to 'drivers/misc')
| -rw-r--r-- | drivers/misc/imx8/scu_api.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/misc/imx8/scu_api.c b/drivers/misc/imx8/scu_api.c index d9c4d5d7840..031bc0048b6 100644 --- a/drivers/misc/imx8/scu_api.c +++ b/drivers/misc/imx8/scu_api.c @@ -273,6 +273,34 @@ int sc_misc_otp_fuse_read(sc_ipc_t ipc, u32 word, u32 *val) return 0; } +int sc_misc_get_temp(sc_ipc_t ipc, sc_rsrc_t resource, sc_misc_temp_t temp, + s16 *celsius, s8 *tenths) +{ + struct udevice *dev = gd->arch.scu_dev; + int size = sizeof(struct sc_rpc_msg_s); + struct sc_rpc_msg_s msg; + int ret; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = (u8)SC_RPC_SVC_MISC; + RPC_FUNC(&msg) = (u8)MISC_FUNC_GET_TEMP; + RPC_U16(&msg, 0U) = (u16)resource; + RPC_U8(&msg, 2U) = (u8)temp; + RPC_SIZE(&msg) = 2U; + + ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size); + if (ret < 0) + return ret; + + if (celsius) + *celsius = RPC_I16(&msg, 0U); + + if (tenths) + *tenths = RPC_I8(&msg, 2U); + + return 0; +} + /* RM */ sc_bool_t sc_rm_is_memreg_owned(sc_ipc_t ipc, sc_rm_mr_t mr) { |
