/* Fill invoke cmd params */ switch (cmd) { case TA_CMD_BNXT_COPY_COREDUMP:
param[0].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT;
param[0].u.memref.shm = pvt_data.fw_shm_pool;
param[0].u.memref.size = MAX_SHM_MEM_SZ;
param[0].u.memref.shm_offs = 0;
param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT; break; case TA_CMD_BNXT_FASTBOOT: default: /* Nothing to do */ break;
}
}
/** * tee_bnxt_fw_load() - Load the bnxt firmware * Uses an OP-TEE call to start a secure * boot process. * Returns 0 on success, negative errno otherwise.
*/ int tee_bnxt_fw_load(void)
{ int ret = 0; struct tee_ioctl_invoke_arg arg; struct tee_param param[MAX_TEE_PARAM_ARRY_MEMB];
if (!pvt_data.ctx) return -ENODEV;
prepare_args(TA_CMD_BNXT_FASTBOOT, &arg, param);
ret = tee_client_invoke_func(pvt_data.ctx, &arg, param); if (ret < 0 || arg.ret != 0) {
dev_err(pvt_data.dev, "TA_CMD_BNXT_FASTBOOT invoke failed TEE err: %x, ret:%x\n",
arg.ret, ret); return -EINVAL;
}
return 0;
}
EXPORT_SYMBOL(tee_bnxt_fw_load);
/** * tee_bnxt_copy_coredump() - Copy coredump from the allocated memory * Uses an OP-TEE call to copy coredump * @buf: destination buffer where core dump is copied into * @offset: offset from the base address of core dump area * @size: size of the dump * * Returns 0 on success, negative errno otherwise.
*/ int tee_bnxt_copy_coredump(void *buf, u32 offset, u32 size)
{ struct tee_ioctl_invoke_arg arg; struct tee_param param[MAX_TEE_PARAM_ARRY_MEMB]; void *core_data;
u32 rbytes = size;
u32 nbytes = 0; int ret = 0;
/* Open context with TEE driver */
pvt_data.ctx = tee_client_open_context(NULL, optee_ctx_match, NULL,
NULL); if (IS_ERR(pvt_data.ctx)) return -ENODEV;
/* Open session with Bnxt load Trusted App */
export_uuid(sess_arg.uuid, &bnxt_device->id.uuid);
sess_arg.clnt_login = TEE_IOCTL_LOGIN_PUBLIC;
sess_arg.num_params = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.