bast-ide.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // SPDX-License-Identifier: GPL-2.0
  2. //
  3. // Copyright 2007 Simtec Electronics
  4. // http://www.simtec.co.uk/products/EB2410ITX/
  5. // http://armlinux.simtec.co.uk/
  6. // Ben Dooks <[email protected]>
  7. #include <linux/kernel.h>
  8. #include <linux/types.h>
  9. #include <linux/init.h>
  10. #include <linux/interrupt.h>
  11. #include <linux/platform_device.h>
  12. #include <linux/ata_platform.h>
  13. #include <asm/mach-types.h>
  14. #include <asm/mach/arch.h>
  15. #include <asm/mach/map.h>
  16. #include <asm/mach/irq.h>
  17. #include "map.h"
  18. #include "irqs.h"
  19. #include "bast.h"
  20. /* IDE ports */
  21. static struct pata_platform_info bast_ide_platdata = {
  22. .ioport_shift = 5,
  23. };
  24. static struct resource bast_ide0_resource[] = {
  25. [0] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDEPRI, 8 * 0x20),
  26. [1] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDEPRIAUX + (6 * 0x20), 0x20),
  27. [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE0),
  28. };
  29. static struct platform_device bast_device_ide0 = {
  30. .name = "pata_platform",
  31. .id = 0,
  32. .num_resources = ARRAY_SIZE(bast_ide0_resource),
  33. .resource = bast_ide0_resource,
  34. .dev = {
  35. .platform_data = &bast_ide_platdata,
  36. .coherent_dma_mask = ~0,
  37. }
  38. };
  39. static struct resource bast_ide1_resource[] = {
  40. [0] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDESEC, 8 * 0x20),
  41. [1] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDESECAUX + (6 * 0x20), 0x20),
  42. [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE1),
  43. };
  44. static struct platform_device bast_device_ide1 = {
  45. .name = "pata_platform",
  46. .id = 1,
  47. .num_resources = ARRAY_SIZE(bast_ide1_resource),
  48. .resource = bast_ide1_resource,
  49. .dev = {
  50. .platform_data = &bast_ide_platdata,
  51. .coherent_dma_mask = ~0,
  52. }
  53. };
  54. static struct platform_device *bast_ide_devices[] __initdata = {
  55. &bast_device_ide0,
  56. &bast_device_ide1,
  57. };
  58. static __init int bast_ide_init(void)
  59. {
  60. if (machine_is_bast() || machine_is_vr1000())
  61. return platform_add_devices(bast_ide_devices,
  62. ARRAY_SIZE(bast_ide_devices));
  63. return 0;
  64. }
  65. fs_initcall(bast_ide_init);