summaryrefslogtreecommitdiff
path: root/drivers/misc/imx8
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-07-17 08:04:28 -0400
committerTom Rini <trini@konsulko.com>2020-07-17 08:04:28 -0400
commit42e7659db0ac7089d3a2f80ee1c3b8eb64d84706 (patch)
treec2b2dda157f71ce80ca4fb00332519f161896a5c /drivers/misc/imx8
parentfee68b98fe3890631a9bdf8f8db328179011ee3f (diff)
parentab8b4e818cbc3846672c13b12f1d75daccfac519 (diff)
Merge tag 'u-boot-imx-20200716' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
i.MX for 2020.10 ---------------- - i.MX DDR driver fix/update for i.MX8M - i.MX pinctrl driver fix. - Use arm_smccc_smc to remove imx sip function - i.MX8M clk update - support booting aarch32 kernel on aarch64 hardware - fused part support for i.MX8MP - imx6: pcm058 to DM Travis: https://travis-ci.org/github/sbabic/u-boot-imx/builds/708734785
Diffstat (limited to 'drivers/misc/imx8')
-rw-r--r--drivers/misc/imx8/fuse.c19
-rw-r--r--drivers/misc/imx8/scu_api.c25
2 files changed, 37 insertions, 7 deletions
diff --git a/drivers/misc/imx8/fuse.c b/drivers/misc/imx8/fuse.c
index 4d7f2f524d..be18122937 100644
--- a/drivers/misc/imx8/fuse.c
+++ b/drivers/misc/imx8/fuse.c
@@ -9,6 +9,7 @@
#include <fuse.h>
#include <asm/arch/sci/sci.h>
#include <asm/arch/sys_proto.h>
+#include <linux/arm-smccc.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -36,22 +37,24 @@ int fuse_read(u32 bank, u32 word, u32 *val)
int fuse_sense(u32 bank, u32 word, u32 *val)
{
- unsigned long ret = 0, value = 0;
+ struct arm_smccc_res res;
if (bank != 0) {
printf("Invalid bank argument, ONLY bank 0 is supported\n");
return -EINVAL;
}
- ret = call_imx_sip_ret2(FSL_SIP_OTP_READ, (unsigned long)word, &value,
- 0, 0);
- *val = (u32)value;
+ arm_smccc_smc(FSL_SIP_OTP_READ, (unsigned long)word, 0, 0,
+ 0, 0, 0, 0, &res);
+ *val = (u32)res.a1;
- return ret;
+ return res.a0;
}
int fuse_prog(u32 bank, u32 word, u32 val)
{
+ struct arm_smccc_res res;
+
if (bank != 0) {
printf("Invalid bank argument, ONLY bank 0 is supported\n");
return -EINVAL;
@@ -78,8 +81,10 @@ int fuse_prog(u32 bank, u32 word, u32 val)
}
}
- return call_imx_sip(FSL_SIP_OTP_WRITE, (unsigned long)word,
- (unsigned long)val, 0, 0);
+ arm_smccc_smc(FSL_SIP_OTP_WRITE, (unsigned long)word,
+ (unsigned long)val, 0, 0, 0, 0, 0, &res);
+
+ return res.a0;
}
int fuse_override(u32 bank, u32 word, u32 val)
diff --git a/drivers/misc/imx8/scu_api.c b/drivers/misc/imx8/scu_api.c
index 3e38edbf5d..20b74fbb18 100644
--- a/drivers/misc/imx8/scu_api.c
+++ b/drivers/misc/imx8/scu_api.c
@@ -374,6 +374,31 @@ void sc_misc_boot_status(sc_ipc_t ipc, sc_misc_boot_status_t status)
__func__, status, RPC_R8(&msg));
}
+int sc_misc_get_boot_container(sc_ipc_t ipc, u8 *idx)
+{
+ struct udevice *dev = gd->arch.scu_dev;
+ int size = sizeof(struct sc_rpc_msg_s);
+ struct sc_rpc_msg_s msg;
+ int ret;
+
+ if (!dev)
+ hang();
+
+ RPC_VER(&msg) = SC_RPC_VERSION;
+ RPC_SIZE(&msg) = 1U;
+ RPC_SVC(&msg) = (u8)SC_RPC_SVC_MISC;
+ RPC_FUNC(&msg) = (u8)MISC_FUNC_GET_BOOT_CONTAINER;
+
+ ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+ if (ret < 0)
+ return ret;
+
+ if (idx)
+ *idx = (u8)RPC_U8(&msg, 0U);
+
+ return 0;
+}
+
void sc_misc_build_info(sc_ipc_t ipc, u32 *build, u32 *commit)
{
struct udevice *dev = gd->arch.scu_dev;