Commit | Line | Data |
---|---|---|
cf3567aa SH |
1 | /* |
2 | * Copyright (C) 2010 Pengutronix | |
3 | * Sascha Hauer <s.hauer@pengutronix.de> | |
4 | * | |
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. | |
8 | */ | |
b7f080cf | 9 | #include <linux/dma-mapping.h> |
cf3567aa | 10 | #include <asm/sizes.h> |
edca314f | 11 | #include <mach/mx23.h> |
cf3567aa SH |
12 | #include <mach/mx28.h> |
13 | #include <mach/devices-common.h> | |
14 | ||
edca314f | 15 | #define mxs_auart_data_entry_single(soc, _id, hwid) \ |
cf3567aa SH |
16 | { \ |
17 | .id = _id, \ | |
edca314f SG |
18 | .iobase = soc ## _AUART ## hwid ## _BASE_ADDR, \ |
19 | .irq = soc ## _INT_AUART ## hwid, \ | |
cf3567aa SH |
20 | } |
21 | ||
edca314f SG |
22 | #define mxs_auart_data_entry(soc, _id, hwid) \ |
23 | [_id] = mxs_auart_data_entry_single(soc, _id, hwid) | |
24 | ||
25 | #ifdef CONFIG_SOC_IMX23 | |
26 | const struct mxs_auart_data mx23_auart_data[] __initconst = { | |
27 | #define mx23_auart_data_entry(_id, hwid) \ | |
28 | mxs_auart_data_entry(MX23, _id, hwid) | |
29 | mx23_auart_data_entry(0, 1), | |
30 | mx23_auart_data_entry(1, 2), | |
31 | }; | |
32 | #endif | |
cf3567aa SH |
33 | |
34 | #ifdef CONFIG_SOC_IMX28 | |
35 | const struct mxs_auart_data mx28_auart_data[] __initconst = { | |
36 | #define mx28_auart_data_entry(_id) \ | |
edca314f | 37 | mxs_auart_data_entry(MX28, _id, _id) |
cf3567aa SH |
38 | mx28_auart_data_entry(0), |
39 | mx28_auart_data_entry(1), | |
40 | mx28_auart_data_entry(2), | |
41 | mx28_auart_data_entry(3), | |
42 | mx28_auart_data_entry(4), | |
43 | }; | |
44 | #endif | |
45 | ||
46 | struct platform_device *__init mxs_add_auart( | |
47 | const struct mxs_auart_data *data) | |
48 | { | |
49 | struct resource res[] = { | |
50 | { | |
51 | .start = data->iobase, | |
52 | .end = data->iobase + SZ_8K - 1, | |
53 | .flags = IORESOURCE_MEM, | |
54 | }, { | |
55 | .start = data->irq, | |
56 | .end = data->irq, | |
57 | .flags = IORESOURCE_IRQ, | |
58 | }, | |
59 | }; | |
60 | ||
61 | return mxs_add_platform_device_dmamask("mxs-auart", data->id, | |
62 | res, ARRAY_SIZE(res), NULL, 0, | |
63 | DMA_BIT_MASK(32)); | |
64 | } | |
65 |