ohci-ep93xx.c 842 B

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