riscpc.c 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. /*
  2. * linux/arch/arm/mach-rpc/riscpc.c
  3. *
  4. * Copyright (C) 1998-2001 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * Architecture specific fixups.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/tty.h>
  14. #include <linux/delay.h>
  15. #include <linux/pm.h>
  16. #include <linux/init.h>
  17. #include <linux/sched.h>
  18. #include <linux/device.h>
  19. #include <linux/serial_8250.h>
  20. #include <asm/elf.h>
  21. #include <asm/io.h>
  22. #include <asm/mach-types.h>
  23. #include <asm/hardware.h>
  24. #include <asm/page.h>
  25. #include <asm/domain.h>
  26. #include <asm/setup.h>
  27. #include <asm/mach/map.h>
  28. #include <asm/mach/arch.h>
  29. #include <asm/mach/time.h>
  30. extern void rpc_init_irq(void);
  31. extern unsigned int vram_size;
  32. #if 0
  33. unsigned int memc_ctrl_reg;
  34. unsigned int number_mfm_drives;
  35. static int __init parse_tag_acorn(const struct tag *tag)
  36. {
  37. memc_ctrl_reg = tag->u.acorn.memc_control_reg;
  38. number_mfm_drives = tag->u.acorn.adfsdrives;
  39. switch (tag->u.acorn.vram_pages) {
  40. case 512:
  41. vram_size += PAGE_SIZE * 256;
  42. case 256:
  43. vram_size += PAGE_SIZE * 256;
  44. default:
  45. break;
  46. }
  47. #if 0
  48. if (vram_size) {
  49. desc->video_start = 0x02000000;
  50. desc->video_end = 0x02000000 + vram_size;
  51. }
  52. #endif
  53. return 0;
  54. }
  55. __tagtable(ATAG_ACORN, parse_tag_acorn);
  56. #endif
  57. static struct map_desc rpc_io_desc[] __initdata = {
  58. { SCREEN_BASE, SCREEN_START, 2*1048576, MT_DEVICE }, /* VRAM */
  59. { (u32)IO_BASE, IO_START, IO_SIZE , MT_DEVICE }, /* IO space */
  60. { EASI_BASE, EASI_START, EASI_SIZE, MT_DEVICE } /* EASI space */
  61. };
  62. static void __init rpc_map_io(void)
  63. {
  64. iotable_init(rpc_io_desc, ARRAY_SIZE(rpc_io_desc));
  65. /*
  66. * Turn off floppy.
  67. */
  68. outb(0xc, 0x3f2);
  69. /*
  70. * RiscPC can't handle half-word loads and stores
  71. */
  72. elf_hwcap &= ~HWCAP_HALF;
  73. }
  74. static struct resource acornfb_resources[] = {
  75. { /* VIDC */
  76. .start = 0x03400000,
  77. .end = 0x035fffff,
  78. .flags = IORESOURCE_MEM,
  79. }, {
  80. .start = IRQ_VSYNCPULSE,
  81. .end = IRQ_VSYNCPULSE,
  82. .flags = IORESOURCE_IRQ,
  83. },
  84. };
  85. static struct platform_device acornfb_device = {
  86. .name = "acornfb",
  87. .id = -1,
  88. .dev = {
  89. .coherent_dma_mask = 0xffffffff,
  90. },
  91. .num_resources = ARRAY_SIZE(acornfb_resources),
  92. .resource = acornfb_resources,
  93. };
  94. static struct resource iomd_resources[] = {
  95. {
  96. .start = 0x03200000,
  97. .end = 0x0320ffff,
  98. .flags = IORESOURCE_MEM,
  99. },
  100. };
  101. static struct platform_device iomd_device = {
  102. .name = "iomd",
  103. .id = -1,
  104. .num_resources = ARRAY_SIZE(iomd_resources),
  105. .resource = iomd_resources,
  106. };
  107. static struct platform_device kbd_device = {
  108. .name = "kart",
  109. .id = -1,
  110. .dev = {
  111. .parent = &iomd_device.dev,
  112. },
  113. };
  114. static struct plat_serial8250_port serial_platform_data[] = {
  115. {
  116. .mapbase = 0x03010fe0,
  117. .irq = 10,
  118. .uartclk = 1843200,
  119. .regshift = 2,
  120. .iotype = UPIO_MEM,
  121. .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
  122. },
  123. { },
  124. };
  125. static struct platform_device serial_device = {
  126. .name = "serial8250",
  127. .id = 0,
  128. .dev = {
  129. .platform_data = serial_platform_data,
  130. },
  131. };
  132. static struct platform_device *devs[] __initdata = {
  133. &iomd_device,
  134. &kbd_device,
  135. &serial_device,
  136. &acornfb_device,
  137. };
  138. static int __init rpc_init(void)
  139. {
  140. return platform_add_devices(devs, ARRAY_SIZE(devs));
  141. }
  142. arch_initcall(rpc_init);
  143. extern struct sys_timer ioc_timer;
  144. MACHINE_START(RISCPC, "Acorn-RiscPC")
  145. MAINTAINER("Russell King")
  146. BOOT_MEM(0x10000000, 0x03000000, 0xe0000000)
  147. BOOT_PARAMS(0x10000100)
  148. DISABLE_PARPORT(0)
  149. DISABLE_PARPORT(1)
  150. MAPIO(rpc_map_io)
  151. INITIRQ(rpc_init_irq)
  152. .timer = &ioc_timer,
  153. MACHINE_END