1
2
3
4
5
6
7
8
9#include <asm/sizes.h>
10
11#include "../hardware.h"
12#include "devices-common.h"
13
14#define imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size) \
15 { \
16 .id = _id, \
17 .iobase = soc ## _WDOG ## _hwid ## _BASE_ADDR, \
18 .iosize = _size, \
19 }
20#define imx_imx2_wdt_data_entry(soc, _id, _hwid, _size) \
21 [_id] = imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size)
22
23#ifdef CONFIG_SOC_IMX21
24const struct imx_imx2_wdt_data imx21_imx2_wdt_data __initconst =
25 imx_imx2_wdt_data_entry_single(MX21, 0, , SZ_4K);
26#endif
27
28#ifdef CONFIG_SOC_IMX27
29const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst =
30 imx_imx2_wdt_data_entry_single(MX27, 0, , SZ_4K);
31#endif
32
33#ifdef CONFIG_SOC_IMX31
34const struct imx_imx2_wdt_data imx31_imx2_wdt_data __initconst =
35 imx_imx2_wdt_data_entry_single(MX31, 0, , SZ_16K);
36#endif
37
38#ifdef CONFIG_SOC_IMX35
39const struct imx_imx2_wdt_data imx35_imx2_wdt_data __initconst =
40 imx_imx2_wdt_data_entry_single(MX35, 0, , SZ_16K);
41#endif
42
43struct platform_device *__init imx_add_imx2_wdt(
44 const struct imx_imx2_wdt_data *data)
45{
46 struct resource res[] = {
47 {
48 .start = data->iobase,
49 .end = data->iobase + data->iosize - 1,
50 .flags = IORESOURCE_MEM,
51 },
52 };
53 return imx_add_platform_device("imx2-wdt", data->id,
54 res, ARRAY_SIZE(res), NULL, 0);
55}
56