setup.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /*
  2. * Setup pointers to hardware-dependent routines.
  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. * Copyright (C) 1996, 1997, 1998, 2001, 07, 08 by Ralf Baechle
  9. * Copyright (C) 2001 MIPS Technologies, Inc.
  10. * Copyright (C) 2007 by Thomas Bogendoerfer
  11. */
  12. #include <linux/eisa.h>
  13. #include <linux/init.h>
  14. #include <linux/ioport.h>
  15. #include <linux/console.h>
  16. #include <linux/screen_info.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/serial_8250.h>
  19. #include <asm/jazz.h>
  20. #include <asm/jazzdma.h>
  21. #include <asm/reboot.h>
  22. #include <asm/pgtable.h>
  23. #include <asm/tlbmisc.h>
  24. extern asmlinkage void jazz_handle_int(void);
  25. extern void jazz_machine_restart(char *command);
  26. static struct resource jazz_io_resources[] = {
  27. {
  28. .start = 0x00,
  29. .end = 0x1f,
  30. .name = "dma1",
  31. .flags = IORESOURCE_BUSY
  32. }, {
  33. .start = 0x40,
  34. .end = 0x5f,
  35. .name = "timer",
  36. .flags = IORESOURCE_BUSY
  37. }, {
  38. .start = 0x80,
  39. .end = 0x8f,
  40. .name = "dma page reg",
  41. .flags = IORESOURCE_BUSY
  42. }, {
  43. .start = 0xc0,
  44. .end = 0xdf,
  45. .name = "dma2",
  46. .flags = IORESOURCE_BUSY
  47. }
  48. };
  49. void __init plat_mem_setup(void)
  50. {
  51. int i;
  52. /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
  53. add_wired_entry(0x02000017, 0x03c00017, 0xe0000000, PM_64K);
  54. /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
  55. add_wired_entry(0x02400017, 0x02440017, 0xe2000000, PM_16M);
  56. /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
  57. add_wired_entry(0x01800017, 0x01000017, 0xe4000000, PM_4M);
  58. set_io_port_base(JAZZ_PORT_BASE);
  59. #ifdef CONFIG_EISA
  60. EISA_bus = 1;
  61. #endif
  62. /* request I/O space for devices used on all i[345]86 PCs */
  63. for (i = 0; i < ARRAY_SIZE(jazz_io_resources); i++)
  64. request_resource(&ioport_resource, jazz_io_resources + i);
  65. /* The RTC is outside the port address space */
  66. _machine_restart = jazz_machine_restart;
  67. #ifdef CONFIG_VT
  68. screen_info = (struct screen_info) {
  69. .orig_video_cols = 160,
  70. .orig_video_lines = 64,
  71. .orig_video_points = 16,
  72. };
  73. #endif
  74. add_preferred_console("ttyS", 0, "9600");
  75. }
  76. #ifdef CONFIG_OLIVETTI_M700
  77. #define UART_CLK 1843200
  78. #else
  79. /* Some Jazz machines seem to have an 8MHz crystal clock but I don't know
  80. exactly which ones ... XXX */
  81. #define UART_CLK (8000000 / 16) /* ( 3072000 / 16) */
  82. #endif
  83. #define MEMPORT(_base, _irq) \
  84. { \
  85. .mapbase = (_base), \
  86. .membase = (void *)(_base), \
  87. .irq = (_irq), \
  88. .uartclk = UART_CLK, \
  89. .iotype = UPIO_MEM, \
  90. .flags = UPF_BOOT_AUTOCONF, \
  91. }
  92. static struct plat_serial8250_port jazz_serial_data[] = {
  93. MEMPORT(JAZZ_SERIAL1_BASE, JAZZ_SERIAL1_IRQ),
  94. MEMPORT(JAZZ_SERIAL2_BASE, JAZZ_SERIAL2_IRQ),
  95. { },
  96. };
  97. static struct platform_device jazz_serial8250_device = {
  98. .name = "serial8250",
  99. .id = PLAT8250_DEV_PLATFORM,
  100. .dev = {
  101. .platform_data = jazz_serial_data,
  102. },
  103. };
  104. static struct resource jazz_esp_rsrc[] = {
  105. {
  106. .start = JAZZ_SCSI_BASE,
  107. .end = JAZZ_SCSI_BASE + 31,
  108. .flags = IORESOURCE_MEM
  109. },
  110. {
  111. .start = JAZZ_SCSI_DMA,
  112. .end = JAZZ_SCSI_DMA,
  113. .flags = IORESOURCE_MEM
  114. },
  115. {
  116. .start = JAZZ_SCSI_IRQ,
  117. .end = JAZZ_SCSI_IRQ,
  118. .flags = IORESOURCE_IRQ
  119. }
  120. };
  121. static struct platform_device jazz_esp_pdev = {
  122. .name = "jazz_esp",
  123. .num_resources = ARRAY_SIZE(jazz_esp_rsrc),
  124. .resource = jazz_esp_rsrc
  125. };
  126. static struct resource jazz_sonic_rsrc[] = {
  127. {
  128. .start = JAZZ_ETHERNET_BASE,
  129. .end = JAZZ_ETHERNET_BASE + 0xff,
  130. .flags = IORESOURCE_MEM
  131. },
  132. {
  133. .start = JAZZ_ETHERNET_IRQ,
  134. .end = JAZZ_ETHERNET_IRQ,
  135. .flags = IORESOURCE_IRQ
  136. }
  137. };
  138. static struct platform_device jazz_sonic_pdev = {
  139. .name = "jazzsonic",
  140. .num_resources = ARRAY_SIZE(jazz_sonic_rsrc),
  141. .resource = jazz_sonic_rsrc
  142. };
  143. static struct resource jazz_cmos_rsrc[] = {
  144. {
  145. .start = 0x70,
  146. .end = 0x71,
  147. .flags = IORESOURCE_IO
  148. },
  149. {
  150. .start = 8,
  151. .end = 8,
  152. .flags = IORESOURCE_IRQ
  153. }
  154. };
  155. static struct platform_device jazz_cmos_pdev = {
  156. .name = "rtc_cmos",
  157. .num_resources = ARRAY_SIZE(jazz_cmos_rsrc),
  158. .resource = jazz_cmos_rsrc
  159. };
  160. static struct platform_device pcspeaker_pdev = {
  161. .name = "pcspkr",
  162. .id = -1,
  163. };
  164. static int __init jazz_setup_devinit(void)
  165. {
  166. platform_device_register(&jazz_serial8250_device);
  167. platform_device_register(&jazz_esp_pdev);
  168. platform_device_register(&jazz_sonic_pdev);
  169. platform_device_register(&jazz_cmos_pdev);
  170. platform_device_register(&pcspeaker_pdev);
  171. return 0;
  172. }
  173. device_initcall(jazz_setup_devinit);