@@ -345,6 +345,7 @@ struct usbhs_priv *usbhs_pdev_to_priv(struct platform_device *pdev);
*/
#define USBHSF_RUNTIME_PWCTRL (1 << 0)
#define USBHSF_HAS_CNEN (1 << 1) /* Single-ended receiver */
+#define USBHSF_CFIFO_BYTE_ADDR (1 << 2) /* Byte addressable */
#define usbhsc_flags_init(p) ((p)->flags = 0)
#define usbhsc_flags_set(p, b) ((p)->flags |= (b))
@@ -543,8 +543,13 @@ static int usbhsf_pio_try_push(struct usbhs_pkt *pkt, int *is_done)
}
/* the rest operation */
- for (i = 0; i < len; i++)
- iowrite8(buf[i], addr + (0x03 - (i & 0x03)));
+ if (usbhsc_flags_has(priv, USBHSF_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
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: Chris Brandt <chris.brandt@renesas.com> --- drivers/usb/renesas_usbhs/common.h | 1 + drivers/usb/renesas_usbhs/fifo.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-)