setup.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 by Ralf Baechle
  9. * Copyright (C) 2001 MIPS Technologies, Inc.
  10. */
  11. #include <linux/eisa.h>
  12. #include <linux/hdreg.h>
  13. #include <linux/init.h>
  14. #include <linux/ioport.h>
  15. #include <linux/sched.h>
  16. #include <linux/interrupt.h>
  17. #include <linux/mm.h>
  18. #include <linux/console.h>
  19. #include <linux/fb.h>
  20. #include <linux/ide.h>
  21. #include <linux/pm.h>
  22. #include <linux/screen_info.h>
  23. #include <asm/bootinfo.h>
  24. #include <asm/irq.h>
  25. #include <asm/jazz.h>
  26. #include <asm/jazzdma.h>
  27. #include <asm/reboot.h>
  28. #include <asm/io.h>
  29. #include <asm/pgtable.h>
  30. #include <asm/time.h>
  31. #include <asm/traps.h>
  32. extern asmlinkage void jazz_handle_int(void);
  33. extern void jazz_machine_restart(char *command);
  34. extern void jazz_machine_halt(void);
  35. extern void jazz_machine_power_off(void);
  36. void __init plat_timer_setup(struct irqaction *irq)
  37. {
  38. /* set the clock to 100 Hz */
  39. r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
  40. setup_irq(JAZZ_TIMER_IRQ, irq);
  41. }
  42. static struct resource jazz_io_resources[] = {
  43. {
  44. .start = 0x00,
  45. .end = 0x1f,
  46. .name = "dma1",
  47. .flags = IORESOURCE_BUSY
  48. }, {
  49. .start = 0x40,
  50. .end = 0x5f,
  51. .name = "timer",
  52. .end = IORESOURCE_BUSY
  53. }, {
  54. .start = 0x80,
  55. .end = 0x8f,
  56. .name = "dma page reg",
  57. .flags = IORESOURCE_BUSY
  58. }, {
  59. .start = 0xc0,
  60. .end = 0xdf,
  61. .name = "dma2",
  62. .flags = IORESOURCE_BUSY
  63. }
  64. };
  65. void __init plat_mem_setup(void)
  66. {
  67. int i;
  68. /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
  69. add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K);
  70. /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
  71. add_wired_entry (0x02400017, 0x02440017, 0xe2000000, PM_16M);
  72. /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
  73. add_wired_entry (0x01800017, 0x01000017, 0xe4000000, PM_4M);
  74. set_io_port_base(JAZZ_PORT_BASE);
  75. #ifdef CONFIG_EISA
  76. if (mips_machtype == MACH_MIPS_MAGNUM_4000)
  77. EISA_bus = 1;
  78. #endif
  79. isa_slot_offset = 0xe3000000;
  80. /* request I/O space for devices used on all i[345]86 PCs */
  81. for (i = 0; i < ARRAY_SIZE(jazz_io_resources); i++)
  82. request_resource(&ioport_resource, jazz_io_resources + i);
  83. /* The RTC is outside the port address space */
  84. _machine_restart = jazz_machine_restart;
  85. _machine_halt = jazz_machine_halt;
  86. pm_power_off = jazz_machine_power_off;
  87. screen_info = (struct screen_info) {
  88. 0, 0, /* orig-x, orig-y */
  89. 0, /* unused */
  90. 0, /* orig_video_page */
  91. 0, /* orig_video_mode */
  92. 160, /* orig_video_cols */
  93. 0, 0, 0, /* unused, ega_bx, unused */
  94. 64, /* orig_video_lines */
  95. 0, /* orig_video_isVGA */
  96. 16 /* orig_video_points */
  97. };
  98. vdma_init();
  99. }