platform.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 int __init amiga_init_devices(void)
  50. {
  51. if (!MACH_IS_AMIGA)
  52. return -ENODEV;
  53. /* video hardware */
  54. if (AMIGAHW_PRESENT(AMI_VIDEO))
  55. platform_device_register_simple("amiga-video", -1, NULL, 0);
  56. /* sound hardware */
  57. if (AMIGAHW_PRESENT(AMI_AUDIO))
  58. platform_device_register_simple("amiga-audio", -1, NULL, 0);
  59. /* storage interfaces */
  60. if (AMIGAHW_PRESENT(AMI_FLOPPY))
  61. platform_device_register_simple("amiga-floppy", -1, NULL, 0);
  62. return 0;
  63. }
  64. device_initcall(amiga_init_devices);