Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
platform-imx2-wdt.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 Pengutronix
3  * Uwe Kleine-Koenig <[email protected]>
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  */
9 #include <asm/sizes.h>
10 #include <mach/hardware.h>
11 #include <mach/devices-common.h>
12 
13 #define imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size) \
14  { \
15  .id = _id, \
16  .iobase = soc ## _WDOG ## _hwid ## _BASE_ADDR, \
17  .iosize = _size, \
18  }
19 #define imx_imx2_wdt_data_entry(soc, _id, _hwid, _size) \
20  [_id] = imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size)
21 
22 #ifdef CONFIG_SOC_IMX21
25 #endif /* ifdef CONFIG_SOC_IMX21 */
26 
27 #ifdef CONFIG_SOC_IMX25
28 const struct imx_imx2_wdt_data imx25_imx2_wdt_data __initconst =
30 #endif /* ifdef CONFIG_SOC_IMX25 */
31 
32 #ifdef CONFIG_SOC_IMX27
33 const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst =
35 #endif /* ifdef CONFIG_SOC_IMX27 */
36 
37 #ifdef CONFIG_SOC_IMX31
38 const struct imx_imx2_wdt_data imx31_imx2_wdt_data __initconst =
40 #endif /* ifdef CONFIG_SOC_IMX31 */
41 
42 #ifdef CONFIG_SOC_IMX35
43 const struct imx_imx2_wdt_data imx35_imx2_wdt_data __initconst =
45 #endif /* ifdef CONFIG_SOC_IMX35 */
46 
47 #ifdef CONFIG_SOC_IMX51
48 const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst = {
49 #define imx51_imx2_wdt_data_entry(_id, _hwid) \
50  imx_imx2_wdt_data_entry(MX51, _id, _hwid, SZ_16K)
51  imx51_imx2_wdt_data_entry(0, 1),
52  imx51_imx2_wdt_data_entry(1, 2),
53 };
54 #endif /* ifdef CONFIG_SOC_IMX51 */
55 
56 #ifdef CONFIG_SOC_IMX53
57 const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst = {
58 #define imx53_imx2_wdt_data_entry(_id, _hwid) \
59  imx_imx2_wdt_data_entry(MX53, _id, _hwid, SZ_16K)
60  imx53_imx2_wdt_data_entry(0, 1),
61  imx53_imx2_wdt_data_entry(1, 2),
62 };
63 #endif /* ifdef CONFIG_SOC_IMX53 */
64 
66  const struct imx_imx2_wdt_data *data)
67 {
68  struct resource res[] = {
69  {
70  .start = data->iobase,
71  .end = data->iobase + data->iosize - 1,
72  .flags = IORESOURCE_MEM,
73  },
74  };
75  return imx_add_platform_device("imx2-wdt", data->id,
76  res, ARRAY_SIZE(res), NULL, 0);
77 }