Hi Bin,

On 02.07.20 10:47, Stefan Roese wrote:
While trying to use the U-Boot xHCI driver on the MIPS Octeon platform,
which is big endian, I noticed that the driver is missing a few endian
conversion calls. This patch adds these missing endian conversion
calls.

Did you find the time to review this patchset with endianess corrections
and support for physical vs virtual addresses? Its in preparation for
the Octeon (MIPS big endian) xHCI support.

I would like to have this common xhci parts integrated in mainline early
in this release (if there are no issues of course), so that these
changes can get a broad testing on multiple platforms.

Thanks,
Stefan

Signed-off-by: Stefan Roese <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Marek Vasut <[email protected]>
---

  drivers/usb/host/xhci-mem.c | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 2d968aafb0..bd959b4093 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -110,7 +110,7 @@ static void xhci_scratchpad_free(struct xhci_ctrl *ctrl)
ctrl->dcbaa->dev_context_ptrs[0] = 0; - free((void *)(uintptr_t)ctrl->scratchpad->sp_array[0]);
+       free((void *)le64_to_cpu(ctrl->scratchpad->sp_array[0]));
        free(ctrl->scratchpad->sp_array);
        free(ctrl->scratchpad);
        ctrl->scratchpad = NULL;
@@ -225,7 +225,8 @@ static void xhci_link_segments(struct xhci_segment *prev,
        prev->next = next;
        if (link_trbs) {
                val_64 = (uintptr_t)next->trbs;
-               prev->trbs[TRBS_PER_SEGMENT-1].link.segment_ptr = val_64;
+               prev->trbs[TRBS_PER_SEGMENT-1].link.segment_ptr =
+                       cpu_to_le64(val_64);
/*
                 * Set the last TRB in the segment to
@@ -486,7 +487,7 @@ int xhci_alloc_virt_device(struct xhci_ctrl *ctrl, unsigned 
int slot_id)
        byte_64 = (uintptr_t)(virt_dev->out_ctx->bytes);
/* Point to output device context in dcbaa. */
-       ctrl->dcbaa->dev_context_ptrs[slot_id] = byte_64;
+       ctrl->dcbaa->dev_context_ptrs[slot_id] = cpu_to_le64(byte_64);
xhci_flush_cache((uintptr_t)&ctrl->dcbaa->dev_context_ptrs[slot_id],
                         sizeof(__le64));
@@ -768,7 +769,7 @@ void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl,
debug("route string %x\n", route);
  #endif
-       slot_ctx->dev_info |= route;
+       slot_ctx->dev_info |= cpu_to_le32(route);
switch (speed) {
        case USB_SPEED_SUPER:



Viele Grüße,
Stefan

--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]

Reply via email to