dwc3-uboot.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* include/dwc3-uboot.h
  3. *
  4. * Copyright (c) 2015 Texas Instruments Incorporated - http://www.ti.com
  5. *
  6. * Designware SuperSpeed USB uboot init
  7. */
  8. #ifndef __DWC3_UBOOT_H_
  9. #define __DWC3_UBOOT_H_
  10. #include <linux/usb/otg.h>
  11. #include <linux/usb/phy.h>
  12. struct dwc3_device {
  13. unsigned long base;
  14. enum usb_dr_mode dr_mode;
  15. enum usb_phy_interface hsphy_mode;
  16. u32 maximum_speed;
  17. unsigned tx_fifo_resize:1;
  18. unsigned has_lpm_erratum;
  19. u8 lpm_nyet_threshold;
  20. unsigned is_utmi_l1_suspend;
  21. u8 hird_threshold;
  22. unsigned disable_scramble_quirk;
  23. unsigned u2exit_lfps_quirk;
  24. unsigned u2ss_inp3_quirk;
  25. unsigned req_p1p2p3_quirk;
  26. unsigned del_p1p2p3_quirk;
  27. unsigned del_phy_power_chg_quirk;
  28. unsigned lfps_filter_quirk;
  29. unsigned rx_detect_poll_quirk;
  30. unsigned dis_u3_susphy_quirk;
  31. unsigned dis_u2_susphy_quirk;
  32. unsigned tx_de_emphasis_quirk;
  33. unsigned tx_de_emphasis;
  34. int index;
  35. };
  36. int dwc3_uboot_init(struct dwc3_device *dev);
  37. void dwc3_uboot_exit(int index);
  38. void dwc3_uboot_handle_interrupt(int index);
  39. struct phy;
  40. #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)
  41. int dwc3_setup_phy(struct udevice *dev, struct phy **array, int *num_phys);
  42. int dwc3_shutdown_phy(struct udevice *dev, struct phy *usb_phys, int num_phys);
  43. #else
  44. static inline int dwc3_setup_phy(struct udevice *dev, struct phy **array,
  45. int *num_phys)
  46. {
  47. return -ENOTSUPP;
  48. }
  49. static inline int dwc3_shutdown_phy(struct udevice *dev, struct phy *usb_phys,
  50. int num_phys)
  51. {
  52. return -ENOTSUPP;
  53. }
  54. #endif
  55. #endif /* __DWC3_UBOOT_H_ */