diff options
author | Ye Li <ye.li@nxp.com> | 2021-08-07 16:00:41 +0800 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2021-08-09 14:46:50 +0200 |
commit | 0c00d03aca356c295daafe82873ecfc9d7769dd9 (patch) | |
tree | 4e5af04a945358f712b1de8b626edc6efc50b0a4 /drivers/misc/imx8ulp/s400_api.c | |
parent | 3854a066f2ccc4a40da3da1a2973cfb35166e576 (diff) |
driver: misc: Add MU and S400 API to communicate with Sentinel
Add MU driver and S400 API. Need enable MISC driver to work
Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'drivers/misc/imx8ulp/s400_api.c')
-rw-r--r-- | drivers/misc/imx8ulp/s400_api.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/misc/imx8ulp/s400_api.c b/drivers/misc/imx8ulp/s400_api.c new file mode 100644 index 0000000000..82fd3117a4 --- /dev/null +++ b/drivers/misc/imx8ulp/s400_api.c @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2020 NXP + * + */ + +#include <common.h> +#include <hang.h> +#include <malloc.h> +#include <asm/io.h> +#include <dm.h> +#include <asm/arch/s400_api.h> +#include <misc.h> + +DECLARE_GLOBAL_DATA_PTR; + +int ahab_release_rdc(u8 core_id) +{ + struct udevice *dev = gd->arch.s400_dev; + int size = sizeof(struct imx8ulp_s400_msg); + struct imx8ulp_s400_msg msg; + int ret; + + if (!dev) { + printf("s400 dev is not initialized\n"); + return -ENODEV; + } + + msg.version = AHAB_VERSION; + msg.tag = AHAB_CMD_TAG; + msg.size = 2; + msg.command = AHAB_RELEASE_RDC_REQ_CID; + msg.data[0] = core_id; + + ret = misc_call(dev, false, &msg, size, &msg, size); + if (ret) + printf("Error: %s: ret %d, core id %u, response 0x%x\n", + __func__, ret, core_id, msg.data[0]); + + return ret; +} |