setup.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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, 2004, 05 by Ralf Baechle ([email protected])
  9. * Copyright (C) 2001, 2002, 2003 by Liam Davies ([email protected])
  10. *
  11. */
  12. #include <linux/init.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/io.h>
  15. #include <linux/ioport.h>
  16. #include <linux/memblock.h>
  17. #include <linux/pm.h>
  18. #include <asm/bootinfo.h>
  19. #include <asm/reboot.h>
  20. #include <asm/setup.h>
  21. #include <asm/gt64120.h>
  22. #include <cobalt.h>
  23. extern void cobalt_machine_restart(char *command);
  24. extern void cobalt_machine_halt(void);
  25. const char *get_system_type(void)
  26. {
  27. switch (cobalt_board_id) {
  28. case COBALT_BRD_ID_QUBE1:
  29. return "Cobalt Qube";
  30. case COBALT_BRD_ID_RAQ1:
  31. return "Cobalt RaQ";
  32. case COBALT_BRD_ID_QUBE2:
  33. return "Cobalt Qube2";
  34. case COBALT_BRD_ID_RAQ2:
  35. return "Cobalt RaQ2";
  36. }
  37. return "MIPS Cobalt";
  38. }
  39. /*
  40. * Cobalt doesn't have PS/2 keyboard/mouse interfaces,
  41. * keyboard controller is never used.
  42. * Also PCI-ISA bridge DMA controller is never used.
  43. */
  44. static struct resource cobalt_reserved_resources[] = {
  45. { /* dma1 */
  46. .start = 0x00,
  47. .end = 0x1f,
  48. .name = "reserved",
  49. .flags = IORESOURCE_BUSY | IORESOURCE_IO,
  50. },
  51. { /* keyboard */
  52. .start = 0x60,
  53. .end = 0x6f,
  54. .name = "reserved",
  55. .flags = IORESOURCE_BUSY | IORESOURCE_IO,
  56. },
  57. { /* dma page reg */
  58. .start = 0x80,
  59. .end = 0x8f,
  60. .name = "reserved",
  61. .flags = IORESOURCE_BUSY | IORESOURCE_IO,
  62. },
  63. { /* dma2 */
  64. .start = 0xc0,
  65. .end = 0xdf,
  66. .name = "reserved",
  67. .flags = IORESOURCE_BUSY | IORESOURCE_IO,
  68. },
  69. };
  70. void __init plat_mem_setup(void)
  71. {
  72. int i;
  73. _machine_restart = cobalt_machine_restart;
  74. _machine_halt = cobalt_machine_halt;
  75. pm_power_off = cobalt_machine_halt;
  76. set_io_port_base(CKSEG1ADDR(GT_DEF_PCI0_IO_BASE));
  77. /* I/O port resource */
  78. ioport_resource.end = 0x01ffffff;
  79. /* These resources have been reserved by VIA SuperI/O chip. */
  80. for (i = 0; i < ARRAY_SIZE(cobalt_reserved_resources); i++)
  81. request_resource(&ioport_resource, cobalt_reserved_resources + i);
  82. }
  83. /*
  84. * Prom init. We read our one and only communication with the firmware.
  85. * Grab the amount of installed memory.
  86. * Better boot loaders (CoLo) pass a command line too :-)
  87. */
  88. void __init prom_init(void)
  89. {
  90. unsigned long memsz;
  91. int argc, i;
  92. char **argv;
  93. memsz = fw_arg0 & 0x7fff0000;
  94. argc = fw_arg0 & 0x0000ffff;
  95. argv = (char **)fw_arg1;
  96. for (i = 1; i < argc; i++) {
  97. strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
  98. if (i < (argc - 1))
  99. strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
  100. }
  101. memblock_add(0, memsz);
  102. setup_8250_early_printk_port(CKSEG1ADDR(0x1c800000), 0, 0);
  103. }