platform.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Copyright (C) 2007-2009 Geert Uytterhoeven
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file COPYING in the main directory of this archive
  6. * for more details.
  7. */
  8. #include <linux/init.h>
  9. #include <linux/platform_device.h>
  10. #include <linux/zorro.h>
  11. #include <asm/amigahw.h>
  12. #ifdef CONFIG_ZORRO
  13. static const struct resource zorro_resources[] __initconst = {
  14. /* Zorro II regions (on Zorro II/III) */
  15. {
  16. .name = "Zorro II exp",
  17. .start = 0x00e80000,
  18. .end = 0x00efffff,
  19. .flags = IORESOURCE_MEM,
  20. }, {
  21. .name = "Zorro II mem",
  22. .start = 0x00200000,
  23. .end = 0x009fffff,
  24. .flags = IORESOURCE_MEM,
  25. },
  26. /* Zorro III regions (on Zorro III only) */
  27. {
  28. .name = "Zorro III exp",
  29. .start = 0xff000000,
  30. .end = 0xffffffff,
  31. .flags = IORESOURCE_MEM,
  32. }, {
  33. .name = "Zorro III cfg",
  34. .start = 0x40000000,
  35. .end = 0x7fffffff,
  36. .flags = IORESOURCE_MEM,
  37. }
  38. };
  39. static int __init amiga_init_bus(void)
  40. {
  41. if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
  42. return -ENODEV;
  43. platform_device_register_simple("amiga-zorro", -1, zorro_resources,
  44. AMIGAHW_PRESENT(ZORRO3) ? 4 : 2);
  45. return 0;
  46. }
  47. subsys_initcall(amiga_init_bus);
  48. #endif /* CONFIG_ZORRO */
  49. static const struct resource a3000_scsi_resource __initconst = {
  50. .start = 0xdd0000,
  51. .end = 0xdd00ff,
  52. .flags = IORESOURCE_MEM,
  53. };
  54. static const struct resource a4000t_scsi_resource __initconst = {
  55. .start = 0xdd0000,
  56. .end = 0xdd0fff,
  57. .flags = IORESOURCE_MEM,
  58. };
  59. static int __init amiga_init_devices(void)
  60. {
  61. if (!MACH_IS_AMIGA)
  62. return -ENODEV;
  63. /* video hardware */
  64. if (AMIGAHW_PRESENT(AMI_VIDEO))
  65. platform_device_register_simple("amiga-video", -1, NULL, 0);
  66. /* sound hardware */
  67. if (AMIGAHW_PRESENT(AMI_AUDIO))
  68. platform_device_register_simple("amiga-audio", -1, NULL, 0);
  69. /* storage interfaces */
  70. if (AMIGAHW_PRESENT(AMI_FLOPPY))
  71. platform_device_register_simple("amiga-floppy", -1, NULL, 0);
  72. if (AMIGAHW_PRESENT(A3000_SCSI))
  73. platform_device_register_simple("amiga-a3000-scsi", -1,
  74. &a3000_scsi_resource, 1);
  75. if (AMIGAHW_PRESENT(A4000_SCSI))
  76. platform_device_register_simple("amiga-a4000t-scsi", -1,
  77. &a4000t_scsi_resource, 1);
  78. return 0;
  79. }
  80. device_initcall(amiga_init_devices);