setup.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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 << 2)
  54. #define MACHINE_FLAG_MVPG (1UL << 3)
  55. #define MACHINE_FLAG_DIAG44 (1UL << 4)
  56. #define MACHINE_FLAG_IDTE (1UL << 5)
  57. #define MACHINE_FLAG_DIAG9C (1UL << 6)
  58. #define MACHINE_FLAG_MVCOS (1UL << 7)
  59. #define MACHINE_FLAG_KVM (1UL << 8)
  60. #define MACHINE_FLAG_ESOP (1UL << 9)
  61. #define MACHINE_FLAG_EDAT1 (1UL << 10)
  62. #define MACHINE_FLAG_EDAT2 (1UL << 11)
  63. #define MACHINE_FLAG_LPAR (1UL << 12)
  64. #define MACHINE_FLAG_LPP (1UL << 13)
  65. #define MACHINE_FLAG_TOPOLOGY (1UL << 14)
  66. #define MACHINE_FLAG_TE (1UL << 15)
  67. #define MACHINE_FLAG_RRBM (1UL << 16)
  68. #define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
  69. #define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
  70. #define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
  71. #define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
  72. #define MACHINE_HAS_ESOP (S390_lowcore.machine_flags & MACHINE_FLAG_ESOP)
  73. #define MACHINE_HAS_PFMF MACHINE_HAS_EDAT1
  74. #define MACHINE_HAS_HPAGE MACHINE_HAS_EDAT1
  75. #ifndef CONFIG_64BIT
  76. #define MACHINE_HAS_IEEE (S390_lowcore.machine_flags & MACHINE_FLAG_IEEE)
  77. #define MACHINE_HAS_CSP (S390_lowcore.machine_flags & MACHINE_FLAG_CSP)
  78. #define MACHINE_HAS_IDTE (0)
  79. #define MACHINE_HAS_DIAG44 (1)
  80. #define MACHINE_HAS_MVPG (S390_lowcore.machine_flags & MACHINE_FLAG_MVPG)
  81. #define MACHINE_HAS_MVCOS (0)
  82. #define MACHINE_HAS_EDAT1 (0)
  83. #define MACHINE_HAS_EDAT2 (0)
  84. #define MACHINE_HAS_LPP (0)
  85. #define MACHINE_HAS_TOPOLOGY (0)
  86. #define MACHINE_HAS_TE (0)
  87. #define MACHINE_HAS_RRBM (0)
  88. #else /* CONFIG_64BIT */
  89. #define MACHINE_HAS_IEEE (1)
  90. #define MACHINE_HAS_CSP (1)
  91. #define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
  92. #define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
  93. #define MACHINE_HAS_MVPG (1)
  94. #define MACHINE_HAS_MVCOS (S390_lowcore.machine_flags & MACHINE_FLAG_MVCOS)
  95. #define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
  96. #define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
  97. #define MACHINE_HAS_LPP (S390_lowcore.machine_flags & MACHINE_FLAG_LPP)
  98. #define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
  99. #define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
  100. #define MACHINE_HAS_RRBM (S390_lowcore.machine_flags & MACHINE_FLAG_RRBM)
  101. #endif /* CONFIG_64BIT */
  102. #define ZFCPDUMP_HSA_SIZE (32UL<<20)
  103. #define ZFCPDUMP_HSA_SIZE_MAX (64UL<<20)
  104. /*
  105. * Console mode. Override with conmode=
  106. */
  107. extern unsigned int console_mode;
  108. extern unsigned int console_devno;
  109. extern unsigned int console_irq;
  110. extern char vmhalt_cmd[];
  111. extern char vmpoff_cmd[];
  112. #define CONSOLE_IS_UNDEFINED (console_mode == 0)
  113. #define CONSOLE_IS_SCLP (console_mode == 1)
  114. #define CONSOLE_IS_3215 (console_mode == 2)
  115. #define CONSOLE_IS_3270 (console_mode == 3)
  116. #define SET_CONSOLE_SCLP do { console_mode = 1; } while (0)
  117. #define SET_CONSOLE_3215 do { console_mode = 2; } while (0)
  118. #define SET_CONSOLE_3270 do { console_mode = 3; } while (0)
  119. #define NSS_NAME_SIZE 8
  120. extern char kernel_nss_name[];
  121. #ifdef CONFIG_PFAULT
  122. extern int pfault_init(void);
  123. extern void pfault_fini(void);
  124. #else /* CONFIG_PFAULT */
  125. #define pfault_init() ({-1;})
  126. #define pfault_fini() do { } while (0)
  127. #endif /* CONFIG_PFAULT */
  128. extern void cmma_init(void);
  129. extern void (*_machine_restart)(char *command);
  130. extern void (*_machine_halt)(void);
  131. extern void (*_machine_power_off)(void);
  132. #else /* __ASSEMBLY__ */
  133. #ifndef CONFIG_64BIT
  134. #define IPL_DEVICE 0x10404
  135. #define INITRD_START 0x1040C
  136. #define INITRD_SIZE 0x10414
  137. #define OLDMEM_BASE 0x1041C
  138. #define OLDMEM_SIZE 0x10424
  139. #else /* CONFIG_64BIT */
  140. #define IPL_DEVICE 0x10400
  141. #define INITRD_START 0x10408
  142. #define INITRD_SIZE 0x10410
  143. #define OLDMEM_BASE 0x10418
  144. #define OLDMEM_SIZE 0x10420
  145. #endif /* CONFIG_64BIT */
  146. #define COMMAND_LINE 0x10480
  147. #endif /* __ASSEMBLY__ */
  148. #endif /* _ASM_S390_SETUP_H */