OP-TEE: SBI MPXY
2024-10-11
| 2025-1-12
本文字數 202閱讀時長 1 分鐘
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’s sbi_mpxy_set_shmem() to save the shared memory address and size into current hart tdomain’s mpxy_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)
          1. Copy the message from TX buffer to the shared memory.
          1. Issue the SBI call. Switch to OpenSBI and jump to: sbi_ecall_mpxy_handler()
          1. If ret.error is success:
            1. Copy the response message from the shared memory to the RX buffer.
     
  • OP-TEE
  • OP-TEE: TAsOP-TEE: Threads
    Loading...
    目錄