setup.h 5.1 KB

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