Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7560669 authored by Chris Brandt's avatar Chris Brandt Committed by Greg Kroah-Hartman
Browse files

usb: renesas_usbhs: support byte addressable CFIFO



Some SoC have a CFIFO register that is byte addressable. This means
when the CFIFO access is set to 32-bit, you can write 8-bit values to
addresses CFIFO+0, CFIFO+1, CFIFO+2, CFIFO+3.

Signed-off-by: default avatarChris Brandt <chris.brandt@renesas.com>
Reviewed-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: default avatarSimon Horman <horms+renesas@verge.net.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2195e3af
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -543,8 +543,13 @@ static int usbhsf_pio_try_push(struct usbhs_pkt *pkt, int *is_done)
	}

	/* the rest operation */
	if (usbhs_get_dparam(priv, cfifo_byte_addr)) {
		for (i = 0; i < len; i++)
			iowrite8(buf[i], addr + (i & 0x03));
	} else {
		for (i = 0; i < len; i++)
			iowrite8(buf[i], addr + (0x03 - (i & 0x03)));
	}

	/*
	 * variable update
+1 −0
Original line number Diff line number Diff line
@@ -191,6 +191,7 @@ struct renesas_usbhs_driver_param {
	u32 has_usb_dmac:1; /* for USB-DMAC */
	u32 runtime_pwctrl:1;
	u32 has_cnen:1;
	u32 cfifo_byte_addr:1; /* CFIFO is byte addressable */
#define USBHS_USB_DMAC_XFER_SIZE	32	/* hardcode the xfer size */
};