ohci-da8xx.c 637 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2012 Sughosh Ganu <urwithsughosh@gmail.com>
  4. */
  5. #include <common.h>
  6. #include <asm/arch/da8xx-usb.h>
  7. int usb_cpu_init(void)
  8. {
  9. /* enable psc for usb2.0 */
  10. lpsc_on(DAVINCI_LPSC_USB20);
  11. /* enable psc for usb1.0 */
  12. lpsc_on(DAVINCI_LPSC_USB11);
  13. /* start the on-chip usb phy and its pll */
  14. if (usb_phy_on())
  15. return 0;
  16. return 1;
  17. }
  18. int usb_cpu_stop(void)
  19. {
  20. usb_phy_off();
  21. /* turn off the usb clock and assert the module reset */
  22. lpsc_disable(DAVINCI_LPSC_USB11);
  23. lpsc_disable(DAVINCI_LPSC_USB20);
  24. return 0;
  25. }
  26. int usb_cpu_init_fail(void)
  27. {
  28. return usb_cpu_stop();
  29. }