usb.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * (C) Copyright 2006
  3. * Markus Klotzbuecher, DENX Software Engineering <mk@denx.de>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <common.h>
  24. #if defined(CONFIG_USB_OHCI_NEW) && defined(CFG_USB_OHCI_CPU_INIT)
  25. # if defined(CONFIG_CPU_MONAHANS) || defined(CONFIG_PXA27X)
  26. #include <asm/arch/pxa-regs.h>
  27. int usb_cpu_init()
  28. {
  29. #if defined(CONFIG_CPU_MONAHANS)
  30. /* Enable USB host clock. */
  31. CKENA |= (CKENA_2_USBHOST | CKENA_20_UDC);
  32. udelay(100);
  33. #endif
  34. #if defined(CONFIG_PXA27X)
  35. /* Enable USB host clock. */
  36. CKEN |= CKEN10_USBHOST;
  37. #endif
  38. #if defined(CONFIG_CPU_MONAHANS)
  39. /* Configure Port 2 for Host (USB Client Registers) */
  40. UP2OCR = 0x3000c;
  41. #endif
  42. UHCHR |= UHCHR_FHR;
  43. wait_ms(11);
  44. UHCHR &= ~UHCHR_FHR;
  45. UHCHR |= UHCHR_FSBIR;
  46. while (UHCHR & UHCHR_FSBIR)
  47. udelay(1);
  48. #if defined(CONFIG_CPU_MONAHANS)
  49. UHCHR &= ~UHCHR_SSEP0;
  50. #endif
  51. #if defined(CONFIG_PXA27X)
  52. UHCHR &= ~UHCHR_SSEP2;
  53. #endif
  54. UHCHR &= ~UHCHR_SSEP1;
  55. UHCHR &= ~UHCHR_SSE;
  56. return 0;
  57. }
  58. int usb_cpu_stop()
  59. {
  60. return 0;
  61. }
  62. int usb_cpu_init_fail()
  63. {
  64. return 0;
  65. }
  66. # endif /* defined(CONFIG_CPU_MONAHANS) || defined(CONFIG_PXA27X) */
  67. #endif /* defined(CONFIG_USB_OHCI) && defined(CFG_USB_OHCI_CPU_INIT) */