platform-imx2-wdt.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) 2010 Pengutronix
  3. * Uwe Kleine-Koenig <u.kleine-koenig@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. */
  9. #include <asm/sizes.h>
  10. #include <mach/hardware.h>
  11. #include <mach/devices-common.h>
  12. #define imx_imx2_wdt_data_entry_single(soc, _size) \
  13. { \
  14. .iobase = soc ## _WDOG_BASE_ADDR, \
  15. .iosize = _size, \
  16. }
  17. #ifdef CONFIG_SOC_IMX21
  18. const struct imx_imx2_wdt_data imx21_imx2_wdt_data __initconst =
  19. imx_imx2_wdt_data_entry_single(MX21, SZ_4K);
  20. #endif /* ifdef CONFIG_SOC_IMX21 */
  21. #ifdef CONFIG_SOC_IMX25
  22. const struct imx_imx2_wdt_data imx25_imx2_wdt_data __initconst =
  23. imx_imx2_wdt_data_entry_single(MX25, SZ_16K);
  24. #endif /* ifdef CONFIG_SOC_IMX25 */
  25. #ifdef CONFIG_SOC_IMX27
  26. const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst =
  27. imx_imx2_wdt_data_entry_single(MX27, SZ_4K);
  28. #endif /* ifdef CONFIG_SOC_IMX27 */
  29. #ifdef CONFIG_SOC_IMX31
  30. const struct imx_imx2_wdt_data imx31_imx2_wdt_data __initconst =
  31. imx_imx2_wdt_data_entry_single(MX31, SZ_16K);
  32. #endif /* ifdef CONFIG_SOC_IMX31 */
  33. #ifdef CONFIG_SOC_IMX35
  34. const struct imx_imx2_wdt_data imx35_imx2_wdt_data __initconst =
  35. imx_imx2_wdt_data_entry_single(MX35, SZ_16K);
  36. #endif /* ifdef CONFIG_SOC_IMX35 */
  37. struct platform_device *__init imx_add_imx2_wdt(
  38. const struct imx_imx2_wdt_data *data)
  39. {
  40. struct resource res[] = {
  41. {
  42. .start = data->iobase,
  43. .end = data->iobase + data->iosize - 1,
  44. .flags = IORESOURCE_MEM,
  45. },
  46. };
  47. return imx_add_platform_device("imx2-wdt", 0,
  48. res, ARRAY_SIZE(res), NULL, 0);
  49. }