1 // SPDX-License-Identifier: GPL-2.0-only
2 #include "../hardware.h"
3 #include "devices-common.h"
5 #define imx_pata_imx_data_entry_single(soc, _size) \
7 .iobase = soc ## _ATA_BASE_ADDR, \
9 .irq = soc ## _INT_ATA, \
12 #ifdef CONFIG_SOC_IMX27
13 const struct imx_pata_imx_data imx27_pata_imx_data __initconst
=
14 imx_pata_imx_data_entry_single(MX27
, SZ_4K
);
15 #endif /* ifdef CONFIG_SOC_IMX27 */
17 #ifdef CONFIG_SOC_IMX31
18 const struct imx_pata_imx_data imx31_pata_imx_data __initconst
=
19 imx_pata_imx_data_entry_single(MX31
, SZ_16K
);
20 #endif /* ifdef CONFIG_SOC_IMX31 */
22 #ifdef CONFIG_SOC_IMX35
23 const struct imx_pata_imx_data imx35_pata_imx_data __initconst
=
24 imx_pata_imx_data_entry_single(MX35
, SZ_16K
);
25 #endif /* ifdef CONFIG_SOC_IMX35 */
27 struct platform_device
*__init
imx_add_pata_imx(
28 const struct imx_pata_imx_data
*data
)
30 struct resource res
[] = {
32 .start
= data
->iobase
,
33 .end
= data
->iobase
+ data
->iosize
- 1,
34 .flags
= IORESOURCE_MEM
,
39 .flags
= IORESOURCE_IRQ
,
42 return imx_add_platform_device("pata_imx", -1,
43 res
, ARRAY_SIZE(res
), NULL
, 0);