Commit | Line | Data |
---|---|---|
d2912cb1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
50f2de61 | 2 | #include "../hardware.h" |
e0557c0d | 3 | #include "devices-common.h" |
a45adf1c | 4 | |
236c4e8b | 5 | #define imx_pata_imx_data_entry_single(soc, _size) \ |
a45adf1c APR |
6 | { \ |
7 | .iobase = soc ## _ATA_BASE_ADDR, \ | |
236c4e8b FE |
8 | .iosize = _size, \ |
9 | .irq = soc ## _INT_ATA, \ | |
a45adf1c APR |
10 | } |
11 | ||
236c4e8b FE |
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 */ | |
16 | ||
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 */ | |
21 | ||
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 */ | |
26 | ||
a45adf1c APR |
27 | struct platform_device *__init imx_add_pata_imx( |
28 | const struct imx_pata_imx_data *data) | |
29 | { | |
30 | struct resource res[] = { | |
31 | { | |
32 | .start = data->iobase, | |
318007e9 | 33 | .end = data->iobase + data->iosize - 1, |
a45adf1c APR |
34 | .flags = IORESOURCE_MEM, |
35 | }, | |
36 | { | |
37 | .start = data->irq, | |
38 | .end = data->irq, | |
39 | .flags = IORESOURCE_IRQ, | |
40 | }, | |
41 | }; | |
42 | return imx_add_platform_device("pata_imx", -1, | |
43 | res, ARRAY_SIZE(res), NULL, 0); | |
44 | } | |
45 |