usb.c 937 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * (C) Copyright 2007
  3. * Markus Klotzbuecher, DENX Software Engineering <mk@denx.de>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT)
  9. #include <mpc5xxx.h>
  10. int usb_cpu_init(void)
  11. {
  12. /* Set the USB Clock */
  13. *(vu_long *)MPC5XXX_CDM_48_FDC = CONFIG_USB_CLOCK;
  14. #ifdef CONFIG_PSC3_USB /* USB is using the alternate configuration */
  15. /* remove all PSC3 USB bits first before ORing in ours */
  16. *(vu_long *)MPC5XXX_GPS_PORT_CONFIG &= ~0x00804f00;
  17. #else
  18. /* remove all USB bits first before ORing in ours */
  19. *(vu_long *)MPC5XXX_GPS_PORT_CONFIG &= ~0x00807000;
  20. #endif
  21. /* Activate USB port */
  22. *(vu_long *)MPC5XXX_GPS_PORT_CONFIG |= CONFIG_USB_CONFIG;
  23. return 0;
  24. }
  25. int usb_cpu_stop(void)
  26. {
  27. return 0;
  28. }
  29. int usb_cpu_init_fail(void)
  30. {
  31. return 0;
  32. }
  33. #endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */