usb.c 855 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #ifdef CONFIG_4xx_DCACHE
  10. #include <asm/mmu.h>
  11. DECLARE_GLOBAL_DATA_PTR;
  12. #endif
  13. int usb_cpu_init(void)
  14. {
  15. #ifdef CONFIG_4xx_DCACHE
  16. /* disable cache */
  17. change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, TLB_WORD2_I_ENABLE);
  18. #endif
  19. return 0;
  20. }
  21. int usb_cpu_stop(void)
  22. {
  23. #ifdef CONFIG_4xx_DCACHE
  24. /* enable cache */
  25. change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, 0);
  26. #endif
  27. return 0;
  28. }
  29. int usb_cpu_init_fail(void)
  30. {
  31. #ifdef CONFIG_4xx_DCACHE
  32. /* enable cache */
  33. change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, 0);
  34. #endif
  35. return 0;
  36. }
  37. #endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */