Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint32_t rcar_trigger_scmi(uint64_t chan_id)
- {
- uint32_t ret;
- struct scmi_shared_mem *shmem;
- uint32_t payload_size;
- scmi_msg_header_t hdr;
- if (chan_id >= RCAR_SCMI_CHAN_COUNT)
- return SMC_ARCH_CALL_INVAL_PARAM;
- shmem = (struct scmi_shared_mem *)(RCAR_SCMI_SHMEM_BASE + chan_id * PAGE_SIZE);
- payload_size = MAX((uint32_t)sizeof(shmem->msg_header),
- mmio_read_32((uintptr_t)&shmem->length));
- payload_size -= sizeof(shmem->msg_header);
- hdr.v = mmio_read_32((uintptr_t)&shmem->msg_header);
- ret = scmi_handle_cmd( hdr.u.protocol, hdr.u.id,
- (uint8_t*)mmio_read_64((uintptr_t)&shmem->msg_payload),
- payload_size);
- INFO("BL31-SCMI: channel: %#llx, protocol: %#x, command: %#x\n",
- chan_id, hdr.u.protocol, hdr.u.id);
- mmio_write_32((uintptr_t)&shmem->channel_status, BIT(0)); /* mark free */
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment