platform-pata_imx.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * This program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License version 2 as published by the
  4. * Free Software Foundation.
  5. */
  6. #include "../hardware.h"
  7. #include "devices-common.h"
  8. #define imx_pata_imx_data_entry_single(soc, _size) \
  9. { \
  10. .iobase = soc ## _ATA_BASE_ADDR, \
  11. .iosize = _size, \
  12. .irq = soc ## _INT_ATA, \
  13. }
  14. #ifdef CONFIG_SOC_IMX27
  15. const struct imx_pata_imx_data imx27_pata_imx_data __initconst =
  16. imx_pata_imx_data_entry_single(MX27, SZ_4K);
  17. #endif /* ifdef CONFIG_SOC_IMX27 */
  18. #ifdef CONFIG_SOC_IMX31
  19. const struct imx_pata_imx_data imx31_pata_imx_data __initconst =
  20. imx_pata_imx_data_entry_single(MX31, SZ_16K);
  21. #endif /* ifdef CONFIG_SOC_IMX31 */
  22. #ifdef CONFIG_SOC_IMX35
  23. const struct imx_pata_imx_data imx35_pata_imx_data __initconst =
  24. imx_pata_imx_data_entry_single(MX35, SZ_16K);
  25. #endif /* ifdef CONFIG_SOC_IMX35 */
  26. struct platform_device *__init imx_add_pata_imx(
  27. const struct imx_pata_imx_data *data)
  28. {
  29. struct resource res[] = {
  30. {
  31. .start = data->iobase,
  32. .end = data->iobase + data->iosize - 1,
  33. .flags = IORESOURCE_MEM,
  34. },
  35. {
  36. .start = data->irq,
  37. .end = data->irq,
  38. .flags = IORESOURCE_IRQ,
  39. },
  40. };
  41. return imx_add_platform_device("pata_imx", -1,
  42. res, ARRAY_SIZE(res), NULL, 0);
  43. }