setup.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. #ifndef __ASSEMBLY__
  10. #include <asm/lowcore.h>
  11. #include <asm/types.h>
  12. #ifndef CONFIG_64BIT
  13. #define IPL_DEVICE (*(unsigned long *) (0x10404))
  14. #define INITRD_START (*(unsigned long *) (0x1040C))
  15. #define INITRD_SIZE (*(unsigned long *) (0x10414))
  16. #define OLDMEM_BASE (*(unsigned long *) (0x1041C))
  17. #define OLDMEM_SIZE (*(unsigned long *) (0x10424))
  18. #else /* CONFIG_64BIT */
  19. #define IPL_DEVICE (*(unsigned long *) (0x10400))
  20. #define INITRD_START (*(unsigned long *) (0x10408))
  21. #define INITRD_SIZE (*(unsigned long *) (0x10410))
  22. #define OLDMEM_BASE (*(unsigned long *) (0x10418))
  23. #define OLDMEM_SIZE (*(unsigned long *) (0x10420))
  24. #endif /* CONFIG_64BIT */
  25. #define COMMAND_LINE ((char *) (0x10480))
  26. extern int memory_end_set;
  27. extern unsigned long memory_end;
  28. extern unsigned long max_physmem_end;
  29. extern void detect_memory_memblock(void);
  30. /*
  31. * Machine features detected in head.S
  32. */
  33. #define MACHINE_FLAG_VM (1UL << 0)
  34. #define MACHINE_FLAG_IEEE (1UL << 1)
  35. #define MACHINE_FLAG_CSP (1UL << 2)
  36. #define MACHINE_FLAG_MVPG (1UL << 3)
  37. #define MACHINE_FLAG_DIAG44 (1UL << 4)
  38. #define MACHINE_FLAG_IDTE (1UL << 5)
  39. #define MACHINE_FLAG_DIAG9C (1UL << 6)
  40. #define MACHINE_FLAG_KVM (1UL << 8)
  41. #define MACHINE_FLAG_ESOP (1UL << 9)
  42. #define MACHINE_FLAG_EDAT1 (1UL << 10)
  43. #define MACHINE_FLAG_EDAT2 (1UL << 11)
  44. #define MACHINE_FLAG_LPAR (1UL << 12)
  45. #define MACHINE_FLAG_LPP (1UL << 13)
  46. #define MACHINE_FLAG_TOPOLOGY (1UL << 14)
  47. #define MACHINE_FLAG_TE (1UL << 15)
  48. #define MACHINE_FLAG_RRBM (1UL << 16)
  49. #define MACHINE_FLAG_TLB_LC (1UL << 17)
  50. #define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
  51. #define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
  52. #define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
  53. #define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
  54. #define MACHINE_HAS_ESOP (S390_lowcore.machine_flags & MACHINE_FLAG_ESOP)
  55. #define MACHINE_HAS_PFMF MACHINE_HAS_EDAT1
  56. #define MACHINE_HAS_HPAGE MACHINE_HAS_EDAT1
  57. #ifndef CONFIG_64BIT
  58. #define MACHINE_HAS_IEEE (S390_lowcore.machine_flags & MACHINE_FLAG_IEEE)
  59. #define MACHINE_HAS_CSP (S390_lowcore.machine_flags & MACHINE_FLAG_CSP)
  60. #define MACHINE_HAS_IDTE (0)
  61. #define MACHINE_HAS_DIAG44 (1)
  62. #define MACHINE_HAS_MVPG (S390_lowcore.machine_flags & MACHINE_FLAG_MVPG)
  63. #define MACHINE_HAS_EDAT1 (0)
  64. #define MACHINE_HAS_EDAT2 (0)
  65. #define MACHINE_HAS_LPP (0)
  66. #define MACHINE_HAS_TOPOLOGY (0)
  67. #define MACHINE_HAS_TE (0)
  68. #define MACHINE_HAS_RRBM (0)
  69. #define MACHINE_HAS_TLB_LC (0)
  70. #else /* CONFIG_64BIT */
  71. #define MACHINE_HAS_IEEE (1)
  72. #define MACHINE_HAS_CSP (1)
  73. #define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
  74. #define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
  75. #define MACHINE_HAS_MVPG (1)
  76. #define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
  77. #define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
  78. #define MACHINE_HAS_LPP (S390_lowcore.machine_flags & MACHINE_FLAG_LPP)
  79. #define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
  80. #define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
  81. #define MACHINE_HAS_RRBM (S390_lowcore.machine_flags & MACHINE_FLAG_RRBM)
  82. #define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
  83. #endif /* CONFIG_64BIT */
  84. /*
  85. * Console mode. Override with conmode=
  86. */
  87. extern unsigned int console_mode;
  88. extern unsigned int console_devno;
  89. extern unsigned int console_irq;
  90. extern char vmhalt_cmd[];
  91. extern char vmpoff_cmd[];
  92. #define CONSOLE_IS_UNDEFINED (console_mode == 0)
  93. #define CONSOLE_IS_SCLP (console_mode == 1)
  94. #define CONSOLE_IS_3215 (console_mode == 2)
  95. #define CONSOLE_IS_3270 (console_mode == 3)
  96. #define SET_CONSOLE_SCLP do { console_mode = 1; } while (0)
  97. #define SET_CONSOLE_3215 do { console_mode = 2; } while (0)
  98. #define SET_CONSOLE_3270 do { console_mode = 3; } while (0)
  99. #define NSS_NAME_SIZE 8
  100. extern char kernel_nss_name[];
  101. #ifdef CONFIG_PFAULT
  102. extern int pfault_init(void);
  103. extern void pfault_fini(void);
  104. #else /* CONFIG_PFAULT */
  105. #define pfault_init() ({-1;})
  106. #define pfault_fini() do { } while (0)
  107. #endif /* CONFIG_PFAULT */
  108. extern void cmma_init(void);
  109. extern void (*_machine_restart)(char *command);
  110. extern void (*_machine_halt)(void);
  111. extern void (*_machine_power_off)(void);
  112. #else /* __ASSEMBLY__ */
  113. #ifndef CONFIG_64BIT
  114. #define IPL_DEVICE 0x10404
  115. #define INITRD_START 0x1040C
  116. #define INITRD_SIZE 0x10414
  117. #define OLDMEM_BASE 0x1041C
  118. #define OLDMEM_SIZE 0x10424
  119. #else /* CONFIG_64BIT */
  120. #define IPL_DEVICE 0x10400
  121. #define INITRD_START 0x10408
  122. #define INITRD_SIZE 0x10410
  123. #define OLDMEM_BASE 0x10418
  124. #define OLDMEM_SIZE 0x10420
  125. #endif /* CONFIG_64BIT */
  126. #define COMMAND_LINE 0x10480
  127. #endif /* __ASSEMBLY__ */
  128. #endif /* _ASM_S390_SETUP_H */