Lines Matching full:shmem

37 static void shmem_tx_prepare(struct scmi_shared_mem __iomem *shmem,  in shmem_tx_prepare()  argument
58 spin_until_cond((ioread32(&shmem->channel_status) & in shmem_tx_prepare()
61 if (!(ioread32(&shmem->channel_status) & in shmem_tx_prepare()
70 iowrite32(0x0, &shmem->channel_status); in shmem_tx_prepare()
72 &shmem->flags); in shmem_tx_prepare()
73 iowrite32(sizeof(shmem->msg_header) + xfer->tx.len, &shmem->length); in shmem_tx_prepare()
74 iowrite32(pack_scmi_header(&xfer->hdr), &shmem->msg_header); in shmem_tx_prepare()
76 memcpy_toio(shmem->msg_payload, xfer->tx.buf, xfer->tx.len); in shmem_tx_prepare()
79 static u32 shmem_read_header(struct scmi_shared_mem __iomem *shmem) in shmem_read_header() argument
81 return ioread32(&shmem->msg_header); in shmem_read_header()
84 static void shmem_fetch_response(struct scmi_shared_mem __iomem *shmem, in shmem_fetch_response() argument
87 size_t len = ioread32(&shmem->length); in shmem_fetch_response()
89 xfer->hdr.status = ioread32(shmem->msg_payload); in shmem_fetch_response()
90 /* Skip the length of header and status in shmem area i.e 8 bytes */ in shmem_fetch_response()
94 memcpy_fromio(xfer->rx.buf, shmem->msg_payload + 4, xfer->rx.len); in shmem_fetch_response()
97 static void shmem_fetch_notification(struct scmi_shared_mem __iomem *shmem, in shmem_fetch_notification() argument
100 size_t len = ioread32(&shmem->length); in shmem_fetch_notification()
102 /* Skip only the length of header in shmem area i.e 4 bytes */ in shmem_fetch_notification()
106 memcpy_fromio(xfer->rx.buf, shmem->msg_payload, xfer->rx.len); in shmem_fetch_notification()
109 static void shmem_clear_channel(struct scmi_shared_mem __iomem *shmem) in shmem_clear_channel() argument
111 iowrite32(SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE, &shmem->channel_status); in shmem_clear_channel()
114 static bool shmem_poll_done(struct scmi_shared_mem __iomem *shmem, in shmem_poll_done() argument
119 xfer_id = MSG_XTRACT_TOKEN(ioread32(&shmem->msg_header)); in shmem_poll_done()
124 return ioread32(&shmem->channel_status) & in shmem_poll_done()
129 static bool shmem_channel_free(struct scmi_shared_mem __iomem *shmem) in shmem_channel_free() argument
131 return (ioread32(&shmem->channel_status) & in shmem_channel_free()
135 static bool shmem_channel_intr_enabled(struct scmi_shared_mem __iomem *shmem) in shmem_channel_intr_enabled() argument
137 return ioread32(&shmem->flags) & SCMI_SHMEM_FLAG_INTR_ENABLED; in shmem_channel_intr_enabled()
144 struct device_node *shmem __free(device_node); in shmem_setup_iomap()
152 shmem = of_parse_phandle(cdev->of_node, "shmem", idx); in shmem_setup_iomap()
153 if (!shmem) in shmem_setup_iomap()
156 if (!of_device_is_compatible(shmem, "arm,scmi-shmem")) in shmem_setup_iomap()
163 ret = of_address_to_resource(shmem, 0, res); in shmem_setup_iomap()