bast-ide.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* linux/arch/arm/mach-s3c2410/bast-ide.c
  2. *
  3. * Copyright 2007 Simtec Electronics
  4. * http://www.simtec.co.uk/products/EB2410ITX/
  5. * http://armlinux.simtec.co.uk/
  6. * Ben Dooks <ben@simtec.co.uk>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/types.h>
  14. #include <linux/init.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/ata_platform.h>
  18. #include <asm/mach-types.h>
  19. #include <asm/mach/arch.h>
  20. #include <asm/mach/map.h>
  21. #include <asm/mach/irq.h>
  22. #include <mach/map.h>
  23. #include "bast.h"
  24. /* IDE ports */
  25. static struct pata_platform_info bast_ide_platdata = {
  26. .ioport_shift = 5,
  27. };
  28. static struct resource bast_ide0_resource[] = {
  29. [0] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDEPRI, 8 * 0x20),
  30. [1] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDEPRIAUX + (6 * 0x20), 0x20),
  31. [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE0),
  32. };
  33. static struct platform_device bast_device_ide0 = {
  34. .name = "pata_platform",
  35. .id = 0,
  36. .num_resources = ARRAY_SIZE(bast_ide0_resource),
  37. .resource = bast_ide0_resource,
  38. .dev = {
  39. .platform_data = &bast_ide_platdata,
  40. .coherent_dma_mask = ~0,
  41. }
  42. };
  43. static struct resource bast_ide1_resource[] = {
  44. [0] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDESEC, 8 * 0x20),
  45. [1] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDESECAUX + (6 * 0x20), 0x20),
  46. [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE1),
  47. };
  48. static struct platform_device bast_device_ide1 = {
  49. .name = "pata_platform",
  50. .id = 1,
  51. .num_resources = ARRAY_SIZE(bast_ide1_resource),
  52. .resource = bast_ide1_resource,
  53. .dev = {
  54. .platform_data = &bast_ide_platdata,
  55. .coherent_dma_mask = ~0,
  56. }
  57. };
  58. static struct platform_device *bast_ide_devices[] __initdata = {
  59. &bast_device_ide0,
  60. &bast_device_ide1,
  61. };
  62. static __init int bast_ide_init(void)
  63. {
  64. if (machine_is_bast() || machine_is_vr1000())
  65. return platform_add_devices(bast_ide_devices,
  66. ARRAY_SIZE(bast_ide_devices));
  67. return 0;
  68. }
  69. fs_initcall(bast_ide_init);