diff options
Diffstat (limited to 'drivers/accel/amdxdna/amdxdna_mailbox.c')
| -rw-r--r-- | drivers/accel/amdxdna/amdxdna_mailbox.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/accel/amdxdna/amdxdna_mailbox.c b/drivers/accel/amdxdna/amdxdna_mailbox.c index 1afc8079e3d1..814b16bb1953 100644 --- a/drivers/accel/amdxdna/amdxdna_mailbox.c +++ b/drivers/accel/amdxdna/amdxdna_mailbox.c @@ -98,27 +98,27 @@ struct mailbox_msg { static void mailbox_reg_write(struct mailbox_channel *mb_chann, u32 mbox_reg, u32 data) { struct xdna_mailbox_res *mb_res = &mb_chann->mb->res; - u64 ringbuf_addr = mb_res->mbox_base + mbox_reg; + void __iomem *ringbuf_addr = mb_res->mbox_base + mbox_reg; - writel(data, (void *)ringbuf_addr); + writel(data, ringbuf_addr); } static u32 mailbox_reg_read(struct mailbox_channel *mb_chann, u32 mbox_reg) { struct xdna_mailbox_res *mb_res = &mb_chann->mb->res; - u64 ringbuf_addr = mb_res->mbox_base + mbox_reg; + void __iomem *ringbuf_addr = mb_res->mbox_base + mbox_reg; - return readl((void *)ringbuf_addr); + return readl(ringbuf_addr); } static int mailbox_reg_read_non_zero(struct mailbox_channel *mb_chann, u32 mbox_reg, u32 *val) { struct xdna_mailbox_res *mb_res = &mb_chann->mb->res; - u64 ringbuf_addr = mb_res->mbox_base + mbox_reg; + void __iomem *ringbuf_addr = mb_res->mbox_base + mbox_reg; int ret, value; /* Poll till value is not zero */ - ret = readx_poll_timeout(readl, (void *)ringbuf_addr, value, + ret = readx_poll_timeout(readl, ringbuf_addr, value, value, 1 /* us */, 100); if (ret < 0) return ret; @@ -200,10 +200,10 @@ static void mailbox_release_msg(struct mailbox_channel *mb_chann, static int mailbox_send_msg(struct mailbox_channel *mb_chann, struct mailbox_msg *mb_msg) { + void __iomem *write_addr; u32 ringbuf_size; u32 head, tail; u32 start_addr; - u64 write_addr; u32 tmp_tail; head = mailbox_get_headptr(mb_chann, CHAN_RES_X2I); @@ -221,14 +221,14 @@ mailbox_send_msg(struct mailbox_channel *mb_chann, struct mailbox_msg *mb_msg) if (tail >= head && tmp_tail > ringbuf_size - sizeof(u32)) { write_addr = mb_chann->mb->res.ringbuf_base + start_addr + tail; - writel(TOMBSTONE, (void *)write_addr); + writel(TOMBSTONE, write_addr); /* tombstone is set. Write from the start of the ringbuf */ tail = 0; } write_addr = mb_chann->mb->res.ringbuf_base + start_addr + tail; - memcpy_toio((void *)write_addr, &mb_msg->pkg, mb_msg->pkg_size); + memcpy_toio(write_addr, &mb_msg->pkg, mb_msg->pkg_size); mailbox_set_tailptr(mb_chann, tail + mb_msg->pkg_size); trace_mbox_set_tail(MAILBOX_NAME, mb_chann->msix_irq, @@ -275,11 +275,11 @@ mailbox_get_resp(struct mailbox_channel *mb_chann, struct xdna_msg_header *heade static int mailbox_get_msg(struct mailbox_channel *mb_chann) { struct xdna_msg_header header; + void __iomem *read_addr; u32 msg_size, rest; u32 ringbuf_size; u32 head, tail; u32 start_addr; - u64 read_addr; int ret; if (mailbox_reg_read_non_zero(mb_chann, mb_chann->res[CHAN_RES_I2X].mb_tail_ptr_reg, &tail)) @@ -302,7 +302,7 @@ static int mailbox_get_msg(struct mailbox_channel *mb_chann) /* Peek size of the message or TOMBSTONE */ read_addr = mb_chann->mb->res.ringbuf_base + start_addr + head; - header.total_size = readl((void *)read_addr); + header.total_size = readl(read_addr); /* size is TOMBSTONE, set next read from 0 */ if (header.total_size == TOMBSTONE) { if (head < tail) { @@ -328,7 +328,7 @@ static int mailbox_get_msg(struct mailbox_channel *mb_chann) rest = sizeof(header) - sizeof(u32); read_addr += sizeof(u32); - memcpy_fromio((u32 *)&header + 1, (void *)read_addr, rest); + memcpy_fromio((u32 *)&header + 1, read_addr, rest); read_addr += rest; ret = mailbox_get_resp(mb_chann, &header, (u32 *)read_addr); |
