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.
11 #include "../hardware.h"
12 #include "devices-common.h"
14 #define imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size) \
17 .iobase = soc ## _WDOG ## _hwid ## _BASE_ADDR, \
20 #define imx_imx2_wdt_data_entry(soc, _id, _hwid, _size) \
21 [_id] = imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size)
23 #ifdef CONFIG_SOC_IMX21
24 const struct imx_imx2_wdt_data imx21_imx2_wdt_data __initconst
=
25 imx_imx2_wdt_data_entry_single(MX21
, 0, , SZ_4K
);
26 #endif /* ifdef CONFIG_SOC_IMX21 */
28 #ifdef CONFIG_SOC_IMX27
29 const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst
=
30 imx_imx2_wdt_data_entry_single(MX27
, 0, , SZ_4K
);
31 #endif /* ifdef CONFIG_SOC_IMX27 */
33 #ifdef CONFIG_SOC_IMX31
34 const struct imx_imx2_wdt_data imx31_imx2_wdt_data __initconst
=
35 imx_imx2_wdt_data_entry_single(MX31
, 0, , SZ_16K
);
36 #endif /* ifdef CONFIG_SOC_IMX31 */
38 #ifdef CONFIG_SOC_IMX35
39 const struct imx_imx2_wdt_data imx35_imx2_wdt_data __initconst
=
40 imx_imx2_wdt_data_entry_single(MX35
, 0, , SZ_16K
);
41 #endif /* ifdef CONFIG_SOC_IMX35 */
43 struct platform_device
*__init
imx_add_imx2_wdt(
44 const struct imx_imx2_wdt_data
*data
)
46 struct resource res
[] = {
48 .start
= data
->iobase
,
49 .end
= data
->iobase
+ data
->iosize
- 1,
50 .flags
= IORESOURCE_MEM
,
53 return imx_add_platform_device("imx2-wdt", data
->id
,
54 res
, ARRAY_SIZE(res
), NULL
, 0);