1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2010 Pengutronix
4 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
6 #include <linux/dma-mapping.h>
8 #include "../hardware.h"
9 #include "devices-common.h"
11 #define imx_mxc_ehci_data_entry_single(soc, _id, hs) \
14 .iobase = soc ## _USB_ ## hs ## _BASE_ADDR, \
15 .irq = soc ## _INT_USB_ ## hs, \
18 #ifdef CONFIG_SOC_IMX27
19 const struct imx_mxc_ehci_data imx27_mxc_ehci_otg_data __initconst =
20 imx_mxc_ehci_data_entry_single(MX27, 0, OTG);
21 const struct imx_mxc_ehci_data imx27_mxc_ehci_hs_data[] __initconst = {
22 imx_mxc_ehci_data_entry_single(MX27, 1, HS1),
23 imx_mxc_ehci_data_entry_single(MX27, 2, HS2),
25 #endif /* ifdef CONFIG_SOC_IMX27 */
27 #ifdef CONFIG_SOC_IMX31
28 const struct imx_mxc_ehci_data imx31_mxc_ehci_otg_data __initconst =
29 imx_mxc_ehci_data_entry_single(MX31, 0, OTG);
30 const struct imx_mxc_ehci_data imx31_mxc_ehci_hs_data[] __initconst = {
31 imx_mxc_ehci_data_entry_single(MX31, 1, HS1),
32 imx_mxc_ehci_data_entry_single(MX31, 2, HS2),
34 #endif /* ifdef CONFIG_SOC_IMX31 */
36 #ifdef CONFIG_SOC_IMX35
37 const struct imx_mxc_ehci_data imx35_mxc_ehci_otg_data __initconst =
38 imx_mxc_ehci_data_entry_single(MX35, 0, OTG);
39 const struct imx_mxc_ehci_data imx35_mxc_ehci_hs_data __initconst =
40 imx_mxc_ehci_data_entry_single(MX35, 1, HS);
41 #endif /* ifdef CONFIG_SOC_IMX35 */
43 struct platform_device *__init imx_add_mxc_ehci(
44 const struct imx_mxc_ehci_data *data,
45 const struct mxc_usbh_platform_data *pdata)
47 struct resource res[] = {
49 .start = data->iobase,
50 .end = data->iobase + SZ_512 - 1,
51 .flags = IORESOURCE_MEM,
55 .flags = IORESOURCE_IRQ,
58 return imx_add_platform_device_dmamask("mxc-ehci", data->id,
60 pdata, sizeof(*pdata), DMA_BIT_MASK(32));