micro9.c 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * linux/arch/arm/mach-ep93xx/micro9.c
  3. *
  4. * Copyright (C) 2006 Contec Steuerungstechnik & Automation GmbH
  5. * Manfred Gruber <manfred.gruber@contec.at>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/init.h>
  12. #include <linux/interrupt.h>
  13. #include <linux/ioport.h>
  14. #include <linux/kernel.h>
  15. #include <linux/mm.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/sched.h>
  18. #include <linux/mtd/physmap.h>
  19. #include <asm/io.h>
  20. #include <asm/hardware.h>
  21. #include <asm/mach/arch.h>
  22. #include <asm/mach-types.h>
  23. static struct ep93xx_eth_data micro9_eth_data = {
  24. .phy_id = 0x1f,
  25. };
  26. static struct resource micro9_eth_resource[] = {
  27. {
  28. .start = EP93XX_ETHERNET_PHYS_BASE,
  29. .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff,
  30. .flags = IORESOURCE_MEM,
  31. }, {
  32. .start = IRQ_EP93XX_ETHERNET,
  33. .end = IRQ_EP93XX_ETHERNET,
  34. .flags = IORESOURCE_IRQ,
  35. }
  36. };
  37. static struct platform_device micro9_eth_device = {
  38. .name = "ep93xx-eth",
  39. .id = -1,
  40. .dev = {
  41. .platform_data = &micro9_eth_data,
  42. },
  43. .num_resources = ARRAY_SIZE(micro9_eth_resource),
  44. .resource = micro9_eth_resource,
  45. };
  46. static void __init micro9_eth_init(void)
  47. {
  48. memcpy(micro9_eth_data.dev_addr,
  49. (void *)(EP93XX_ETHERNET_BASE + 0x50), 6);
  50. platform_device_register(&micro9_eth_device);
  51. }
  52. static void __init micro9_init(void)
  53. {
  54. micro9_eth_init();
  55. }
  56. /*
  57. * Micro9-H
  58. */
  59. #ifdef CONFIG_MACH_MICRO9H
  60. static struct physmap_flash_data micro9h_flash_data = {
  61. .width = 4,
  62. };
  63. static struct resource micro9h_flash_resource = {
  64. .start = 0x10000000,
  65. .end = 0x13ffffff,
  66. .flags = IORESOURCE_MEM,
  67. };
  68. static struct platform_device micro9h_flash = {
  69. .name = "physmap-flash",
  70. .id = 0,
  71. .dev = {
  72. .platform_data = &micro9h_flash_data,
  73. },
  74. .num_resources = 1,
  75. .resource = &micro9h_flash_resource,
  76. };
  77. static void __init micro9h_init(void)
  78. {
  79. platform_device_register(&micro9h_flash);
  80. }
  81. static void __init micro9h_init_machine(void)
  82. {
  83. ep93xx_init_devices();
  84. micro9_init();
  85. micro9h_init();
  86. }
  87. MACHINE_START(MICRO9, "Contec Hypercontrol Micro9-H")
  88. /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
  89. .phys_io = EP93XX_APB_PHYS_BASE,
  90. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  91. .boot_params = 0x00000100,
  92. .map_io = ep93xx_map_io,
  93. .init_irq = ep93xx_init_irq,
  94. .timer = &ep93xx_timer,
  95. .init_machine = micro9h_init_machine,
  96. MACHINE_END
  97. #endif
  98. /*
  99. * Micro9-M
  100. */
  101. #ifdef CONFIG_MACH_MICRO9M
  102. static void __init micro9m_init_machine(void)
  103. {
  104. ep93xx_init_devices();
  105. micro9_init();
  106. }
  107. MACHINE_START(MICRO9M, "Contec Hypercontrol Micro9-M")
  108. /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
  109. .phys_io = EP93XX_APB_PHYS_BASE,
  110. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  111. .boot_params = 0x00000100,
  112. .map_io = ep93xx_map_io,
  113. .init_irq = ep93xx_init_irq,
  114. .timer = &ep93xx_timer,
  115. .init_machine = micro9m_init_machine,
  116. MACHINE_END
  117. #endif
  118. /*
  119. * Micro9-L
  120. */
  121. #ifdef CONFIG_MACH_MICRO9L
  122. static void __init micro9l_init_machine(void)
  123. {
  124. ep93xx_init_devices();
  125. micro9_init();
  126. }
  127. MACHINE_START(MICRO9L, "Contec Hypercontrol Micro9-L")
  128. /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
  129. .phys_io = EP93XX_APB_PHYS_BASE,
  130. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  131. .boot_params = 0x00000100,
  132. .map_io = ep93xx_map_io,
  133. .init_irq = ep93xx_init_irq,
  134. .timer = &ep93xx_timer,
  135. .init_machine = micro9l_init_machine,
  136. MACHINE_END
  137. #endif