]>
git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - drivers/usb/dwc3/io.h
1 // SPDX-License-Identifier: GPL-2.0
3 * io.h - DesignWare USB3 DRD IO Header
5 * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com
7 * Authors: Felipe Balbi <balbi@ti.com>,
8 * Sebastian Andrzej Siewior <bigeasy@linutronix.de>
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 of
12 * the License as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
20 #ifndef __DRIVERS_USB_DWC3_IO_H
21 #define __DRIVERS_USB_DWC3_IO_H
28 static inline u32
dwc3_readl(void __iomem
*base
, u32 offset
)
33 * We requested the mem region starting from the Globals address
34 * space, see dwc3_probe in core.c.
35 * However, the offsets are given starting from xHCI address space.
37 value
= readl(base
+ offset
- DWC3_GLOBALS_REGS_START
);
40 * When tracing we want to make it easy to find the correct address on
41 * documentation, so we revert it back to the proper addresses, the
42 * same way they are described on SNPS documentation
44 trace_dwc3_readl(base
- DWC3_GLOBALS_REGS_START
, offset
, value
);
49 static inline void dwc3_writel(void __iomem
*base
, u32 offset
, u32 value
)
52 * We requested the mem region starting from the Globals address
53 * space, see dwc3_probe in core.c.
54 * However, the offsets are given starting from xHCI address space.
56 writel(value
, base
+ offset
- DWC3_GLOBALS_REGS_START
);
59 * When tracing we want to make it easy to find the correct address on
60 * documentation, so we revert it back to the proper addresses, the
61 * same way they are described on SNPS documentation
63 trace_dwc3_writel(base
- DWC3_GLOBALS_REGS_START
, offset
, value
);
66 #endif /* __DRIVERS_USB_DWC3_IO_H */