platform-imx2-wdt.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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) \
  13. { \
  14. .iobase = soc ## _WDOG_BASE_ADDR, \
  15. }
  16. #ifdef CONFIG_SOC_IMX21
  17. const struct imx_imx2_wdt_data imx21_imx2_wdt_data __initconst =
  18. imx_imx2_wdt_data_entry_single(MX21);
  19. #endif /* ifdef CONFIG_SOC_IMX21 */
  20. #ifdef CONFIG_SOC_IMX27
  21. const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst =
  22. imx_imx2_wdt_data_entry_single(MX27);
  23. #endif /* ifdef CONFIG_SOC_IMX27 */
  24. struct platform_device *__init imx_add_imx2_wdt(
  25. const struct imx_imx2_wdt_data *data)
  26. {
  27. struct resource res[] = {
  28. {
  29. .start = data->iobase,
  30. .end = data->iobase + SZ_4K - 1,
  31. .flags = IORESOURCE_MEM,
  32. },
  33. };
  34. return imx_add_platform_device("imx2-wdt", 0,
  35. res, ARRAY_SIZE(res), NULL, 0);
  36. }