2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
9 #include <linux/dma-mapping.h>
11 #include "../hardware.h"
12 #include "devices-common.h"
14 #define imx_mxc_ehci_data_entry_single(soc, _id, hs) \
17 .iobase = soc ## _USB_ ## hs ## _BASE_ADDR, \
18 .irq = soc ## _INT_USB_ ## hs, \
21 #ifdef CONFIG_SOC_IMX25
22 const struct imx_mxc_ehci_data imx25_mxc_ehci_otg_data __initconst
=
23 imx_mxc_ehci_data_entry_single(MX25
, 0, OTG
);
24 const struct imx_mxc_ehci_data imx25_mxc_ehci_hs_data __initconst
=
25 imx_mxc_ehci_data_entry_single(MX25
, 1, HS
);
26 #endif /* ifdef CONFIG_SOC_IMX25 */
28 #ifdef CONFIG_SOC_IMX27
29 const struct imx_mxc_ehci_data imx27_mxc_ehci_otg_data __initconst
=
30 imx_mxc_ehci_data_entry_single(MX27
, 0, OTG
);
31 const struct imx_mxc_ehci_data imx27_mxc_ehci_hs_data
[] __initconst
= {
32 imx_mxc_ehci_data_entry_single(MX27
, 1, HS1
),
33 imx_mxc_ehci_data_entry_single(MX27
, 2, HS2
),
35 #endif /* ifdef CONFIG_SOC_IMX27 */
37 #ifdef CONFIG_SOC_IMX31
38 const struct imx_mxc_ehci_data imx31_mxc_ehci_otg_data __initconst
=
39 imx_mxc_ehci_data_entry_single(MX31
, 0, OTG
);
40 const struct imx_mxc_ehci_data imx31_mxc_ehci_hs_data
[] __initconst
= {
41 imx_mxc_ehci_data_entry_single(MX31
, 1, HS1
),
42 imx_mxc_ehci_data_entry_single(MX31
, 2, HS2
),
44 #endif /* ifdef CONFIG_SOC_IMX31 */
46 #ifdef CONFIG_SOC_IMX35
47 const struct imx_mxc_ehci_data imx35_mxc_ehci_otg_data __initconst
=
48 imx_mxc_ehci_data_entry_single(MX35
, 0, OTG
);
49 const struct imx_mxc_ehci_data imx35_mxc_ehci_hs_data __initconst
=
50 imx_mxc_ehci_data_entry_single(MX35
, 1, HS
);
51 #endif /* ifdef CONFIG_SOC_IMX35 */
53 #ifdef CONFIG_SOC_IMX51
54 const struct imx_mxc_ehci_data imx51_mxc_ehci_otg_data __initconst
=
55 imx_mxc_ehci_data_entry_single(MX51
, 0, OTG
);
56 const struct imx_mxc_ehci_data imx51_mxc_ehci_hs_data
[] __initconst
= {
57 imx_mxc_ehci_data_entry_single(MX51
, 1, HS1
),
58 imx_mxc_ehci_data_entry_single(MX51
, 2, HS2
),
60 #endif /* ifdef CONFIG_SOC_IMX51 */
62 struct platform_device
*__init
imx_add_mxc_ehci(
63 const struct imx_mxc_ehci_data
*data
,
64 const struct mxc_usbh_platform_data
*pdata
)
66 struct resource res
[] = {
68 .start
= data
->iobase
,
69 .end
= data
->iobase
+ SZ_512
- 1,
70 .flags
= IORESOURCE_MEM
,
74 .flags
= IORESOURCE_IRQ
,
77 return imx_add_platform_device_dmamask("mxc-ehci", data
->id
,
79 pdata
, sizeof(*pdata
), DMA_BIT_MASK(32));