xref: /openbmc/linux/drivers/usb/host/xhci-rzv2m.c (revision 11976fe2)
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 
8 #include <linux/usb/rzv2m_usb3drd.h>
9 #include "xhci-plat.h"
10 #include "xhci-rzv2m.h"
11 
12 #define RZV2M_USB3_INTEN	0x1044	/* Interrupt Enable */
13 
14 #define RZV2M_USB3_INT_XHC_ENA	BIT(0)
15 #define RZV2M_USB3_INT_HSE_ENA	BIT(2)
16 #define RZV2M_USB3_INT_ENA_VAL	(RZV2M_USB3_INT_XHC_ENA \
17 				 | RZV2M_USB3_INT_HSE_ENA)
18 
19 int xhci_rzv2m_init_quirk(struct usb_hcd *hcd)
20 {
21 	struct device *dev = hcd->self.controller;
22 
23 	rzv2m_usb3drd_reset(dev->parent, true);
24 
25 	return 0;
26 }
27 
28 void xhci_rzv2m_start(struct usb_hcd *hcd)
29 {
30 	u32 int_en;
31 
32 	if (hcd->regs) {
33 		/* Interrupt Enable */
34 		int_en = readl(hcd->regs + RZV2M_USB3_INTEN);
35 		int_en |= RZV2M_USB3_INT_ENA_VAL;
36 		writel(int_en, hcd->regs + RZV2M_USB3_INTEN);
37 	}
38 }
39