X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fusb%2Fhost%2Fxhci.h;h=1f489332b78f033aeb2f492b6f280eb17e08a496;hb=7c1deec0afc209fea14bc38e3a3e1d28b773ee55;hp=ceb1573d86b043c8d3c507a8eed55ca484bb14de;hpb=85b8c5c4bf80025de4632ae6c9a8a606e51508a4;p=u-boot diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index ceb1573d86..1f489332b7 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -17,12 +17,11 @@ #ifndef HOST_XHCI_H_ #define HOST_XHCI_H_ +#include #include #include #include - -#define upper_32_bits(n) (u32)((n) >> 32) -#define lower_32_bits(n) (u32)(n) +#include #define MAX_EP_CTX_NUM 31 #define XHCI_ALIGNMENT 64 @@ -1110,20 +1109,28 @@ static inline void xhci_writel(uint32_t volatile *regs, const unsigned int val) */ static inline u64 xhci_readq(__le64 volatile *regs) { +#if BITS_PER_LONG == 64 + return readq(regs); +#else __u32 *ptr = (__u32 *)regs; u64 val_lo = readl(ptr); u64 val_hi = readl(ptr + 1); return val_lo + (val_hi << 32); +#endif } static inline void xhci_writeq(__le64 volatile *regs, const u64 val) { +#if BITS_PER_LONG == 64 + writeq(val, regs); +#else __u32 *ptr = (__u32 *)regs; u32 val_lo = lower_32_bits(val); /* FIXME */ - u32 val_hi = 0; + u32 val_hi = upper_32_bits(val); writel(val_lo, ptr); writel(val_hi, ptr + 1); +#endif } int xhci_hcd_init(int index, struct xhci_hccr **ret_hccr, @@ -1244,12 +1251,14 @@ int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe, int xhci_ctrl_tx(struct usb_device *udev, unsigned long pipe, struct devrequest *req, int length, void *buffer); int xhci_check_maxpacket(struct usb_device *udev); -void xhci_flush_cache(uint32_t addr, u32 type_len); -void xhci_inval_cache(uint32_t addr, u32 type_len); +void xhci_flush_cache(uintptr_t addr, u32 type_len); +void xhci_inval_cache(uintptr_t addr, u32 type_len); void xhci_cleanup(struct xhci_ctrl *ctrl); struct xhci_ring *xhci_ring_alloc(unsigned int num_segs, bool link_trbs); int xhci_alloc_virt_device(struct usb_device *udev); int xhci_mem_init(struct xhci_ctrl *ctrl, struct xhci_hccr *hccr, struct xhci_hcor *hcor); +struct xhci_ctrl *xhci_get_ctrl(struct usb_device *udev); + #endif /* HOST_XHCI_H_ */