riscpc.c 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. unsigned int vram_size;
  32. unsigned int memc_ctrl_reg;
  33. unsigned int number_mfm_drives;
  34. static int __init parse_tag_acorn(const struct tag *tag)
  35. {
  36. memc_ctrl_reg = tag->u.acorn.memc_control_reg;
  37. number_mfm_drives = tag->u.acorn.adfsdrives;
  38. switch (tag->u.acorn.vram_pages) {
  39. case 512:
  40. vram_size += PAGE_SIZE * 256;
  41. case 256:
  42. vram_size += PAGE_SIZE * 256;
  43. default:
  44. break;
  45. }
  46. #if 0
  47. if (vram_size) {
  48. desc->video_start = 0x02000000;
  49. desc->video_end = 0x02000000 + vram_size;
  50. }
  51. #endif
  52. return 0;
  53. }
  54. __tagtable(ATAG_ACORN, parse_tag_acorn);
  55. static struct map_desc rpc_io_desc[] __initdata = {
  56. { SCREEN_BASE, SCREEN_START, 2*1048576, MT_DEVICE }, /* VRAM */
  57. { (u32)IO_BASE, IO_START, IO_SIZE , MT_DEVICE }, /* IO space */
  58. { EASI_BASE, EASI_START, EASI_SIZE, MT_DEVICE } /* EASI space */
  59. };
  60. static void __init rpc_map_io(void)
  61. {
  62. iotable_init(rpc_io_desc, ARRAY_SIZE(rpc_io_desc));
  63. /*
  64. * Turn off floppy.
  65. */
  66. outb(0xc, 0x3f2);
  67. /*
  68. * RiscPC can't handle half-word loads and stores
  69. */
  70. elf_hwcap &= ~HWCAP_HALF;
  71. }
  72. static struct resource acornfb_resources[] = {
  73. { /* VIDC */
  74. .start = 0x03400000,
  75. .end = 0x035fffff,
  76. .flags = IORESOURCE_MEM,
  77. }, {
  78. .start = IRQ_VSYNCPULSE,
  79. .end = IRQ_VSYNCPULSE,
  80. .flags = IORESOURCE_IRQ,
  81. },
  82. };
  83. static struct platform_device acornfb_device = {
  84. .name = "acornfb",
  85. .id = -1,
  86. .dev = {
  87. .coherent_dma_mask = 0xffffffff,
  88. },
  89. .num_resources = ARRAY_SIZE(acornfb_resources),
  90. .resource = acornfb_resources,
  91. };
  92. static struct resource iomd_resources[] = {
  93. {
  94. .start = 0x03200000,
  95. .end = 0x0320ffff,
  96. .flags = IORESOURCE_MEM,
  97. },
  98. };
  99. static struct platform_device iomd_device = {
  100. .name = "iomd",
  101. .id = -1,
  102. .num_resources = ARRAY_SIZE(iomd_resources),
  103. .resource = iomd_resources,
  104. };
  105. static struct platform_device kbd_device = {
  106. .name = "kart",
  107. .id = -1,
  108. .dev = {
  109. .parent = &iomd_device.dev,
  110. },
  111. };
  112. static struct plat_serial8250_port serial_platform_data[] = {
  113. {
  114. .mapbase = 0x03010fe0,
  115. .irq = 10,
  116. .uartclk = 1843200,
  117. .regshift = 2,
  118. .iotype = UPIO_MEM,
  119. .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
  120. },
  121. { },
  122. };
  123. static struct platform_device serial_device = {
  124. .name = "serial8250",
  125. .id = 0,
  126. .dev = {
  127. .platform_data = serial_platform_data,
  128. },
  129. };
  130. static struct platform_device *devs[] __initdata = {
  131. &iomd_device,
  132. &kbd_device,
  133. &serial_device,
  134. &acornfb_device,
  135. };
  136. static int __init rpc_init(void)
  137. {
  138. return platform_add_devices(devs, ARRAY_SIZE(devs));
  139. }
  140. arch_initcall(rpc_init);
  141. extern struct sys_timer ioc_timer;
  142. MACHINE_START(RISCPC, "Acorn-RiscPC")
  143. /* Maintainer: Russell King */
  144. .phys_ram = 0x10000000,
  145. .phys_io = 0x03000000,
  146. .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
  147. .boot_params = 0x10000100,
  148. .reserve_lp0 = 1,
  149. .reserve_lp1 = 1,
  150. .map_io = rpc_map_io,
  151. .init_irq = rpc_init_irq,
  152. .timer = &ioc_timer,
  153. MACHINE_END