diff options
author | Tom Rini <trini@konsulko.com> | 2021-02-18 08:06:26 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-02-18 08:06:26 -0500 |
commit | 56f1bcc4b7fbca8789cef90c30f201f5b3fff757 (patch) | |
tree | d587eafbc09d7ec51a9b12dca023ddce60507876 /include/usb/xhci.h | |
parent | 496f49464d90b564da5f1a2f4eecb5553e01edf9 (diff) | |
parent | 0059ef0be903a1f0a9afe5259fb2e0874f78a8ac (diff) |
Merge tag 'rpi-next-2021.04' of https://gitlab.denx.de/u-boot/custodians/u-boot-raspberrypi
- add iProc RNG2000 driver for RPi4
- add support for CM4 and RPi400
Diffstat (limited to 'include/usb/xhci.h')
-rw-r--r-- | include/usb/xhci.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/usb/xhci.h b/include/usb/xhci.h index e1d382369a3..8d95e213b01 100644 --- a/include/usb/xhci.h +++ b/include/usb/xhci.h @@ -16,6 +16,7 @@ #ifndef HOST_XHCI_H_ #define HOST_XHCI_H_ +#include <phys2bus.h> #include <reset.h> #include <asm/types.h> #include <asm/cache.h> @@ -1221,6 +1222,12 @@ struct xhci_ctrl { #define XHCI_MTK_HOST BIT(0) }; +#if CONFIG_IS_ENABLED(DM_USB) +#define xhci_to_dev(_ctrl) _ctrl->dev +#else +#define xhci_to_dev(_ctrl) NULL +#endif + unsigned long trb_addr(struct xhci_segment *seg, union xhci_trb *trb); struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_container_ctx *ctx); @@ -1250,7 +1257,8 @@ int xhci_check_maxpacket(struct usb_device *udev); 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); +struct xhci_ring *xhci_ring_alloc(struct xhci_ctrl *ctrl, unsigned int num_segs, + bool link_trbs); int xhci_alloc_virt_device(struct xhci_ctrl *ctrl, unsigned int slot_id); int xhci_mem_init(struct xhci_ctrl *ctrl, struct xhci_hccr *hccr, struct xhci_hcor *hcor); @@ -1278,4 +1286,14 @@ extern struct dm_usb_ops xhci_usb_ops; struct xhci_ctrl *xhci_get_ctrl(struct usb_device *udev); +static inline dma_addr_t xhci_virt_to_bus(struct xhci_ctrl *ctrl, void *addr) +{ + return dev_phys_to_bus(xhci_to_dev(ctrl), virt_to_phys(addr)); +} + +static inline void *xhci_bus_to_virt(struct xhci_ctrl *ctrl, dma_addr_t addr) +{ + return phys_to_virt(dev_bus_to_phys(xhci_to_dev(ctrl), addr)); +} + #endif /* HOST_XHCI_H_ */ |