setup.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * arch/sh64/mach-romram/setup.c
  7. *
  8. * SH-5 ROM/RAM Platform Support
  9. *
  10. * This file handles the architecture-dependent parts of initialization
  11. *
  12. * Copyright (C) 2000, 2001 Paolo Alberelli
  13. *
  14. * benedict.gaster@superh.com: 3rd May 2002
  15. * Added support for ramdisk, removing statically linked romfs at the same time. *
  16. *
  17. * lethal@linux-sh.org: 15th May 2003
  18. * Use the generic procfs cpuinfo interface, just return a valid board name.
  19. *
  20. * Sean.McGoogan@superh.com 17th Feb 2004
  21. * copied from arch/sh64/mach-harp/setup.c
  22. */
  23. #include <linux/stddef.h>
  24. #include <linux/init.h>
  25. #include <linux/mm.h>
  26. #include <linux/bootmem.h>
  27. #include <linux/delay.h>
  28. #include <linux/kernel.h>
  29. #include <asm/processor.h>
  30. #include <asm/platform.h>
  31. #include <asm/io.h>
  32. #include <asm/irq.h>
  33. #include <asm/page.h>
  34. #define RES_COUNT(res) ((sizeof((res))/sizeof(struct resource)))
  35. /*
  36. * Platform Dependent Interrupt Priorities.
  37. */
  38. /* Using defaults defined in irq.h */
  39. #define RES NO_PRIORITY /* Disabled */
  40. #define IR0 IRL0_PRIORITY /* IRLs */
  41. #define IR1 IRL1_PRIORITY
  42. #define IR2 IRL2_PRIORITY
  43. #define IR3 IRL3_PRIORITY
  44. #define PCA INTA_PRIORITY /* PCI Ints */
  45. #define PCB INTB_PRIORITY
  46. #define PCC INTC_PRIORITY
  47. #define PCD INTD_PRIORITY
  48. #define SER TOP_PRIORITY
  49. #define ERR TOP_PRIORITY
  50. #define PW0 TOP_PRIORITY
  51. #define PW1 TOP_PRIORITY
  52. #define PW2 TOP_PRIORITY
  53. #define PW3 TOP_PRIORITY
  54. #define DM0 NO_PRIORITY /* DMA Ints */
  55. #define DM1 NO_PRIORITY
  56. #define DM2 NO_PRIORITY
  57. #define DM3 NO_PRIORITY
  58. #define DAE NO_PRIORITY
  59. #define TU0 TIMER_PRIORITY /* TMU Ints */
  60. #define TU1 NO_PRIORITY
  61. #define TU2 NO_PRIORITY
  62. #define TI2 NO_PRIORITY
  63. #define ATI NO_PRIORITY /* RTC Ints */
  64. #define PRI NO_PRIORITY
  65. #define CUI RTC_PRIORITY
  66. #define ERI SCIF_PRIORITY /* SCIF Ints */
  67. #define RXI SCIF_PRIORITY
  68. #define BRI SCIF_PRIORITY
  69. #define TXI SCIF_PRIORITY
  70. #define ITI TOP_PRIORITY /* WDT Ints */
  71. /*
  72. * Platform dependent structures: maps and parms block.
  73. */
  74. struct resource io_resources[] = {
  75. /* To be updated with external devices */
  76. };
  77. struct resource kram_resources[] = {
  78. { "Kernel code", 0, 0 }, /* These must be last in the array */
  79. { "Kernel data", 0, 0 } /* These must be last in the array */
  80. };
  81. struct resource xram_resources[] = {
  82. /* To be updated with external devices */
  83. };
  84. struct resource rom_resources[] = {
  85. /* To be updated with external devices */
  86. };
  87. struct sh64_platform platform_parms = {
  88. .readonly_rootfs = 1,
  89. .initial_root_dev = 0x0100,
  90. .loader_type = 1,
  91. .io_res_p = io_resources,
  92. .io_res_count = RES_COUNT(io_resources),
  93. .kram_res_p = kram_resources,
  94. .kram_res_count = RES_COUNT(kram_resources),
  95. .xram_res_p = xram_resources,
  96. .xram_res_count = RES_COUNT(xram_resources),
  97. .rom_res_p = rom_resources,
  98. .rom_res_count = RES_COUNT(rom_resources),
  99. };
  100. int platform_int_priority[NR_INTC_IRQS] = {
  101. IR0, IR1, IR2, IR3, PCA, PCB, PCC, PCD, /* IRQ 0- 7 */
  102. RES, RES, RES, RES, SER, ERR, PW3, PW2, /* IRQ 8-15 */
  103. PW1, PW0, DM0, DM1, DM2, DM3, DAE, RES, /* IRQ 16-23 */
  104. RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 24-31 */
  105. TU0, TU1, TU2, TI2, ATI, PRI, CUI, ERI, /* IRQ 32-39 */
  106. RXI, BRI, TXI, RES, RES, RES, RES, RES, /* IRQ 40-47 */
  107. RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 48-55 */
  108. RES, RES, RES, RES, RES, RES, RES, ITI, /* IRQ 56-63 */
  109. };
  110. void __init platform_setup(void)
  111. {
  112. /* ROM/RAM platform leaves the decision to head.S, for now */
  113. platform_parms.fpu_flags = fpu_in_use;
  114. }
  115. void __init platform_monitor(void)
  116. {
  117. /* Nothing yet .. */
  118. }
  119. void __init platform_reserve(void)
  120. {
  121. /* Nothing yet .. */
  122. }
  123. const char *get_system_type(void)
  124. {
  125. return "ROM/RAM";
  126. }