ohci-da8xx.c 640 B

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