ohci-ep93xx.c 839 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2013
  4. * Sergey Kostanbaev < sergey.kostanbaev <at> fairwaves.ru >
  5. */
  6. #include <config.h>
  7. #include <common.h>
  8. #if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT)
  9. #include <asm/io.h>
  10. #include <asm/arch/ep93xx.h>
  11. int usb_cpu_init(void)
  12. {
  13. struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
  14. unsigned long pwr = readl(&syscon->pwrcnt);
  15. writel(pwr | SYSCON_PWRCNT_USH_EN, &syscon->pwrcnt);
  16. return 0;
  17. }
  18. int usb_cpu_stop(void)
  19. {
  20. struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
  21. unsigned long pwr = readl(&syscon->pwrcnt);
  22. writel(pwr & ~SYSCON_PWRCNT_USH_EN, &syscon->pwrcnt);
  23. return 0;
  24. }
  25. int usb_cpu_init_fail(void)
  26. {
  27. return usb_cpu_stop();
  28. }
  29. #endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */