diff options
author | Peng Fan <peng.fan@nxp.com> | 2019-08-26 08:12:16 +0000 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2019-10-08 16:35:59 +0200 |
commit | 8cacd788b40d1cbb80aafe2ee561ac7d74291446 (patch) | |
tree | baf963d7a6627d56d5baedfeb6a100b4778acddd /drivers/misc | |
parent | 94e4d028b29fb4c012b4ae1942b4d58d7937b63a (diff) | |
download | u-boot-8cacd788b40d1cbb80aafe2ee561ac7d74291446.zip u-boot-8cacd788b40d1cbb80aafe2ee561ac7d74291446.tar.gz u-boot-8cacd788b40d1cbb80aafe2ee561ac7d74291446.tar.bz2 |
imx: scu_api: add sc_pm_is_partition_started
Add sc_pm_is_partition_started to check whether a partition
has been started. This will be used to detect M4 partition booted up or
not, then we could choose which dtb to use. If M4 is up, we need
use dtb, such as imx8qm-mek-rpmsg.dtb.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/imx8/scu_api.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/misc/imx8/scu_api.c b/drivers/misc/imx8/scu_api.c index 1856f3a..000a31f 100644 --- a/drivers/misc/imx8/scu_api.c +++ b/drivers/misc/imx8/scu_api.c @@ -119,6 +119,33 @@ int sc_pm_set_resource_power_mode(sc_ipc_t ipc, sc_rsrc_t resource, return ret; } +sc_bool_t sc_pm_is_partition_started(sc_ipc_t ipc, sc_rm_pt_t pt) +{ + struct udevice *dev = gd->arch.scu_dev; + int size = sizeof(struct sc_rpc_msg_s); + struct sc_rpc_msg_s msg; + int ret; + u8 result; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = (u8)(SC_RPC_SVC_PM); + RPC_FUNC(&msg) = (u8)(PM_FUNC_IS_PARTITION_STARTED); + RPC_U8(&msg, 0U) = (u8)(pt); + RPC_SIZE(&msg) = 2U; + + ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size); + + result = RPC_R8(&msg); + if (result != 0 && result != 1) { + printf("%s: partition:%d res:%d\n", + __func__, pt, RPC_R8(&msg)); + if (ret) + printf("%s: partition:%d res:%d\n", __func__, pt, + RPC_R8(&msg)); + } + return !!result; +} + /* PAD */ int sc_pad_set(sc_ipc_t ipc, sc_pad_t pad, u32 val) { |