]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: xhci: xhci_mem_init: Use cpu_to_le64() and not xhci_writeq()
authorStefan Roese <sr@denx.de>
Tue, 21 Jul 2020 08:46:03 +0000 (10:46 +0200)
committerMarek Vasut <marex@denx.de>
Wed, 5 Aug 2020 07:30:46 +0000 (09:30 +0200)
xhci_writeq() makes the CPU->LE swapping only when addressing registers
in the xHCI controller address range and not in the local memory (RAM).
We need to use cpu_to_le64() here to ensure that the conversion is done
correctly.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>
drivers/usb/host/xhci-mem.c

index 2c92c53808cde3d6b83f2c4677eb0805a13e059a..bf60a9c256224c807da64090bd1c7ebfcc489322 100644 (file)
@@ -567,7 +567,7 @@ int xhci_mem_init(struct xhci_ctrl *ctrl, struct xhci_hccr *hccr,
                trb_64 = 0;
                trb_64 = (uintptr_t)seg->trbs;
                struct xhci_erst_entry *entry = &ctrl->erst.entries[val];
-               xhci_writeq(&entry->seg_addr, trb_64);
+               entry->seg_addr = cpu_to_le64(trb_64);
                entry->seg_size = cpu_to_le32(TRBS_PER_SEGMENT);
                entry->rsvd = 0;
                seg = seg->next;