setup.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /*
  2. * S390 version
  3. * Copyright IBM Corp. 1999, 2010
  4. */
  5. #ifndef _ASM_S390_SETUP_H
  6. #define _ASM_S390_SETUP_H
  7. #include <uapi/asm/setup.h>
  8. #define PARMAREA 0x10400
  9. #define MEMORY_CHUNKS 256
  10. #ifndef __ASSEMBLY__
  11. #include <asm/lowcore.h>
  12. #include <asm/types.h>
  13. #ifndef CONFIG_64BIT
  14. #define IPL_DEVICE (*(unsigned long *) (0x10404))
  15. #define INITRD_START (*(unsigned long *) (0x1040C))
  16. #define INITRD_SIZE (*(unsigned long *) (0x10414))
  17. #define OLDMEM_BASE (*(unsigned long *) (0x1041C))
  18. #define OLDMEM_SIZE (*(unsigned long *) (0x10424))
  19. #else /* CONFIG_64BIT */
  20. #define IPL_DEVICE (*(unsigned long *) (0x10400))
  21. #define INITRD_START (*(unsigned long *) (0x10408))
  22. #define INITRD_SIZE (*(unsigned long *) (0x10410))
  23. #define OLDMEM_BASE (*(unsigned long *) (0x10418))
  24. #define OLDMEM_SIZE (*(unsigned long *) (0x10420))
  25. #endif /* CONFIG_64BIT */
  26. #define COMMAND_LINE ((char *) (0x10480))
  27. #define CHUNK_READ_WRITE 0
  28. #define CHUNK_READ_ONLY 1
  29. #define CHUNK_OLDMEM 4
  30. #define CHUNK_CRASHK 5
  31. struct mem_chunk {
  32. unsigned long addr;
  33. unsigned long size;
  34. int type;
  35. };
  36. extern struct mem_chunk memory_chunk[];
  37. extern unsigned long real_memory_size;
  38. extern int memory_end_set;
  39. extern unsigned long memory_end;
  40. void detect_memory_layout(struct mem_chunk chunk[]);
  41. void create_mem_hole(struct mem_chunk memory_chunk[], unsigned long addr,
  42. unsigned long size, int type);
  43. #define PRIMARY_SPACE_MODE 0
  44. #define ACCESS_REGISTER_MODE 1
  45. #define SECONDARY_SPACE_MODE 2
  46. #define HOME_SPACE_MODE 3
  47. extern unsigned int s390_user_mode;
  48. /*
  49. * Machine features detected in head.S
  50. */
  51. #define MACHINE_FLAG_VM (1UL << 0)
  52. #define MACHINE_FLAG_IEEE (1UL << 1)
  53. #define MACHINE_FLAG_CSP (1UL << 3)
  54. #define MACHINE_FLAG_MVPG (1UL << 4)
  55. #define MACHINE_FLAG_DIAG44 (1UL << 5)
  56. #define MACHINE_FLAG_IDTE (1UL << 6)
  57. #define MACHINE_FLAG_DIAG9C (1UL << 7)
  58. #define MACHINE_FLAG_MVCOS (1UL << 8)
  59. #define MACHINE_FLAG_KVM (1UL << 9)
  60. #define MACHINE_FLAG_EDAT1 (1UL << 10)
  61. #define MACHINE_FLAG_EDAT2 (1UL << 11)
  62. #define MACHINE_FLAG_LPAR (1UL << 12)
  63. #define MACHINE_FLAG_SPP (1UL << 13)
  64. #define MACHINE_FLAG_TOPOLOGY (1UL << 14)
  65. #define MACHINE_FLAG_TE (1UL << 15)
  66. #define MACHINE_FLAG_RRBM (1UL << 16)
  67. #define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
  68. #define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
  69. #define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
  70. #define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
  71. #define MACHINE_HAS_PFMF MACHINE_HAS_EDAT1
  72. #define MACHINE_HAS_HPAGE MACHINE_HAS_EDAT1
  73. #ifndef CONFIG_64BIT
  74. #define MACHINE_HAS_IEEE (S390_lowcore.machine_flags & MACHINE_FLAG_IEEE)
  75. #define MACHINE_HAS_CSP (S390_lowcore.machine_flags & MACHINE_FLAG_CSP)
  76. #define MACHINE_HAS_IDTE (0)
  77. #define MACHINE_HAS_DIAG44 (1)
  78. #define MACHINE_HAS_MVPG (S390_lowcore.machine_flags & MACHINE_FLAG_MVPG)
  79. #define MACHINE_HAS_MVCOS (0)
  80. #define MACHINE_HAS_EDAT1 (0)
  81. #define MACHINE_HAS_EDAT2 (0)
  82. #define MACHINE_HAS_SPP (0)
  83. #define MACHINE_HAS_TOPOLOGY (0)
  84. #define MACHINE_HAS_TE (0)
  85. #define MACHINE_HAS_RRBM (0)
  86. #else /* CONFIG_64BIT */
  87. #define MACHINE_HAS_IEEE (1)
  88. #define MACHINE_HAS_CSP (1)
  89. #define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
  90. #define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
  91. #define MACHINE_HAS_MVPG (1)
  92. #define MACHINE_HAS_MVCOS (S390_lowcore.machine_flags & MACHINE_FLAG_MVCOS)
  93. #define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
  94. #define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
  95. #define MACHINE_HAS_SPP (S390_lowcore.machine_flags & MACHINE_FLAG_SPP)
  96. #define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
  97. #define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
  98. #define MACHINE_HAS_RRBM (S390_lowcore.machine_flags & MACHINE_FLAG_RRBM)
  99. #endif /* CONFIG_64BIT */
  100. #define ZFCPDUMP_HSA_SIZE (32UL<<20)
  101. #define ZFCPDUMP_HSA_SIZE_MAX (64UL<<20)
  102. /*
  103. * Console mode. Override with conmode=
  104. */
  105. extern unsigned int console_mode;
  106. extern unsigned int console_devno;
  107. extern unsigned int console_irq;
  108. extern char vmhalt_cmd[];
  109. extern char vmpoff_cmd[];
  110. #define CONSOLE_IS_UNDEFINED (console_mode == 0)
  111. #define CONSOLE_IS_SCLP (console_mode == 1)
  112. #define CONSOLE_IS_3215 (console_mode == 2)
  113. #define CONSOLE_IS_3270 (console_mode == 3)
  114. #define SET_CONSOLE_SCLP do { console_mode = 1; } while (0)
  115. #define SET_CONSOLE_3215 do { console_mode = 2; } while (0)
  116. #define SET_CONSOLE_3270 do { console_mode = 3; } while (0)
  117. #define NSS_NAME_SIZE 8
  118. extern char kernel_nss_name[];
  119. #ifdef CONFIG_PFAULT
  120. extern int pfault_init(void);
  121. extern void pfault_fini(void);
  122. #else /* CONFIG_PFAULT */
  123. #define pfault_init() ({-1;})
  124. #define pfault_fini() do { } while (0)
  125. #endif /* CONFIG_PFAULT */
  126. extern void cmma_init(void);
  127. extern void (*_machine_restart)(char *command);
  128. extern void (*_machine_halt)(void);
  129. extern void (*_machine_power_off)(void);
  130. #else /* __ASSEMBLY__ */
  131. #ifndef CONFIG_64BIT
  132. #define IPL_DEVICE 0x10404
  133. #define INITRD_START 0x1040C
  134. #define INITRD_SIZE 0x10414
  135. #define OLDMEM_BASE 0x1041C
  136. #define OLDMEM_SIZE 0x10424
  137. #else /* CONFIG_64BIT */
  138. #define IPL_DEVICE 0x10400
  139. #define INITRD_START 0x10408
  140. #define INITRD_SIZE 0x10410
  141. #define OLDMEM_BASE 0x10418
  142. #define OLDMEM_SIZE 0x10420
  143. #endif /* CONFIG_64BIT */
  144. #define COMMAND_LINE 0x10480
  145. #endif /* __ASSEMBLY__ */
  146. #endif /* _ASM_S390_SETUP_H */