type
status
date
slug
summary
tags
category
icon
password
The code is based on: https://gitlab.com/riseproject/riscv-optee/optee_os/-/tree/dev-optee-mpxy
Commit ID:
75df9ba41a404aec897399ead0ff0aebcbff48ca
mpxy_opteed_channel_init()
- Check if MPXY extension is supported by OpenSBI.
- Extract MPXY channel ID from DT:
compatible = “riscv,sbi-mpxy-opteed";
riscv,sbi-mpxy-channel-id
← Defines MPXY channel ID.- Save MPXY channel ID to
mpxy_opteed_ctx.channel_id
. opensbi-domain-instance
← Defines the OpenSBI domain used by OP-TEE (not used by OP-TEE).
sbi_mpxy_setup_shmem()
- Allocates 4KB MPXY shared memory (4KB aligned).
- Call
sbi_mpxy_set_shmem
SBI call to set up the allocated MPXY shared memory for the current core. This will invoke OpenSBI’ssbi_mpxy_set_shmem()
to save the shared memory address and size into current harttdomain
’smpxy_state
.
thread_return_to_udomain_by_mpxy()
- Save the args (
arg0
,arg1
,arg2
,arg3
,arg4
) to TX buffer (struct optee_msg_payload
). - Issue SBI call: Send Message with Response (FID #4) with message ID:
OPTEED_MSG_COMPLETE
(0x2
).
sbi_mpxy_send_message_withresp()
- Send Message with Response (FID #4)
- Copy the message from TX buffer to the shared memory.
- Issue the SBI call. Switch to OpenSBI and jump to:
sbi_ecall_mpxy_handler()
- If
ret.error
is success: - Copy the response message from the shared memory to the RX buffer.