setup.h 5.3 KB

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