xhci-rzv2m.c 856 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * xHCI host controller driver for RZ/V2M
  4. *
  5. * Copyright (C) 2022 Renesas Electronics Corporation
  6. */
  7. #include <linux/usb/rzv2m_usb3drd.h>
  8. #include "xhci.h"
  9. #include "xhci-plat.h"
  10. #include "xhci-rzv2m.h"
  11. #define RZV2M_USB3_INTEN 0x1044 /* Interrupt Enable */
  12. #define RZV2M_USB3_INT_XHC_ENA BIT(0)
  13. #define RZV2M_USB3_INT_HSE_ENA BIT(2)
  14. #define RZV2M_USB3_INT_ENA_VAL (RZV2M_USB3_INT_XHC_ENA \
  15. | RZV2M_USB3_INT_HSE_ENA)
  16. int xhci_rzv2m_init_quirk(struct usb_hcd *hcd)
  17. {
  18. struct device *dev = hcd->self.controller;
  19. rzv2m_usb3drd_reset(dev->parent, true);
  20. return 0;
  21. }
  22. void xhci_rzv2m_start(struct usb_hcd *hcd)
  23. {
  24. u32 int_en;
  25. if (hcd->regs) {
  26. /* Interrupt Enable */
  27. int_en = readl(hcd->regs + RZV2M_USB3_INTEN);
  28. int_en |= RZV2M_USB3_INT_ENA_VAL;
  29. writel(int_en, hcd->regs + RZV2M_USB3_INTEN);
  30. }
  31. }