OleksiiMoisieiev

Untitled

Aug 2nd, 2021
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. uint32_t rcar_trigger_scmi(uint64_t chan_id)
  2. {
  3. uint32_t ret;
  4. struct scmi_shared_mem *shmem;
  5. uint32_t payload_size;
  6. scmi_msg_header_t hdr;
  7.  
  8. if (chan_id >= RCAR_SCMI_CHAN_COUNT)
  9. return SMC_ARCH_CALL_INVAL_PARAM;
  10. shmem = (struct scmi_shared_mem *)(RCAR_SCMI_SHMEM_BASE + chan_id * PAGE_SIZE);
  11. payload_size = MAX((uint32_t)sizeof(shmem->msg_header),
  12. mmio_read_32((uintptr_t)&shmem->length));
  13. payload_size -= sizeof(shmem->msg_header);
  14. hdr.v = mmio_read_32((uintptr_t)&shmem->msg_header);
  15. ret = scmi_handle_cmd( hdr.u.protocol, hdr.u.id,
  16. (uint8_t*)mmio_read_64((uintptr_t)&shmem->msg_payload),
  17. payload_size);
  18. INFO("BL31-SCMI: channel: %#llx, protocol: %#x, command: %#x\n",
  19. chan_id, hdr.u.protocol, hdr.u.id);
  20. mmio_write_32((uintptr_t)&shmem->channel_status, BIT(0)); /* mark free */
  21. return ret;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment