ehci-uniphier.c 766 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (C) 2014 Panasonic Corporation
  3. * Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <usb.h>
  9. #include <asm/arch/ehci-uniphier.h>
  10. #include "ehci.h"
  11. /*
  12. * Create the appropriate control structures to manage
  13. * a new EHCI host controller.
  14. */
  15. int ehci_hcd_init(int index, enum usb_init_type init, struct ehci_hccr **hccr,
  16. struct ehci_hcor **hcor)
  17. {
  18. struct ehci_hccr *cr;
  19. struct ehci_hcor *or;
  20. uniphier_ehci_reset(index, 0);
  21. cr = (struct ehci_hccr *)(uniphier_ehci_platdata[index].base);
  22. or = (void *)cr + HC_LENGTH(ehci_readl(&cr->cr_capbase));
  23. *hccr = cr;
  24. *hcor = or;
  25. return 0;
  26. }
  27. int ehci_hcd_stop(int index)
  28. {
  29. uniphier_ehci_reset(index, 1);
  30. return 0;
  31. }