setup.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * include/asm-s390/setup.h
  3. *
  4. * S390 version
  5. * Copyright IBM Corp. 1999,2006
  6. */
  7. #ifndef _ASM_S390_SETUP_H
  8. #define _ASM_S390_SETUP_H
  9. #define COMMAND_LINE_SIZE 896
  10. #ifdef __KERNEL__
  11. #include <asm/types.h>
  12. #define PARMAREA 0x10400
  13. #define MEMORY_CHUNKS 16 /* max 0x7fff */
  14. #define IPL_PARMBLOCK_ORIGIN 0x2000
  15. #ifndef __ASSEMBLY__
  16. #ifndef __s390x__
  17. #define IPL_DEVICE (*(unsigned long *) (0x10404))
  18. #define INITRD_START (*(unsigned long *) (0x1040C))
  19. #define INITRD_SIZE (*(unsigned long *) (0x10414))
  20. #else /* __s390x__ */
  21. #define IPL_DEVICE (*(unsigned long *) (0x10400))
  22. #define INITRD_START (*(unsigned long *) (0x10408))
  23. #define INITRD_SIZE (*(unsigned long *) (0x10410))
  24. #endif /* __s390x__ */
  25. #define COMMAND_LINE ((char *) (0x10480))
  26. #define CHUNK_READ_WRITE 0
  27. #define CHUNK_READ_ONLY 1
  28. struct mem_chunk {
  29. unsigned long addr;
  30. unsigned long size;
  31. unsigned long type;
  32. };
  33. extern struct mem_chunk memory_chunk[];
  34. /*
  35. * Machine features detected in head.S
  36. */
  37. extern unsigned long machine_flags;
  38. #define MACHINE_IS_VM (machine_flags & 1)
  39. #define MACHINE_IS_P390 (machine_flags & 4)
  40. #define MACHINE_HAS_MVPG (machine_flags & 16)
  41. #define MACHINE_HAS_IDTE (machine_flags & 128)
  42. #define MACHINE_HAS_DIAG9C (machine_flags & 256)
  43. #ifndef __s390x__
  44. #define MACHINE_HAS_IEEE (machine_flags & 2)
  45. #define MACHINE_HAS_CSP (machine_flags & 8)
  46. #define MACHINE_HAS_DIAG44 (1)
  47. #define MACHINE_HAS_MVCOS (0)
  48. #else /* __s390x__ */
  49. #define MACHINE_HAS_IEEE (1)
  50. #define MACHINE_HAS_CSP (1)
  51. #define MACHINE_HAS_DIAG44 (machine_flags & 32)
  52. #define MACHINE_HAS_MVCOS (machine_flags & 512)
  53. #endif /* __s390x__ */
  54. #define MACHINE_HAS_SCLP (!MACHINE_IS_P390)
  55. /*
  56. * Console mode. Override with conmode=
  57. */
  58. extern unsigned int console_mode;
  59. extern unsigned int console_devno;
  60. extern unsigned int console_irq;
  61. #define CONSOLE_IS_UNDEFINED (console_mode == 0)
  62. #define CONSOLE_IS_SCLP (console_mode == 1)
  63. #define CONSOLE_IS_3215 (console_mode == 2)
  64. #define CONSOLE_IS_3270 (console_mode == 3)
  65. #define SET_CONSOLE_SCLP do { console_mode = 1; } while (0)
  66. #define SET_CONSOLE_3215 do { console_mode = 2; } while (0)
  67. #define SET_CONSOLE_3270 do { console_mode = 3; } while (0)
  68. struct ipl_list_hdr {
  69. u32 len;
  70. u8 reserved1[3];
  71. u8 version;
  72. u32 blk0_len;
  73. u8 pbt;
  74. u8 flags;
  75. u16 reserved2;
  76. } __attribute__((packed));
  77. struct ipl_block_fcp {
  78. u8 reserved1[313-1];
  79. u8 opt;
  80. u8 reserved2[3];
  81. u16 reserved3;
  82. u16 devno;
  83. u8 reserved4[4];
  84. u64 wwpn;
  85. u64 lun;
  86. u32 bootprog;
  87. u8 reserved5[12];
  88. u64 br_lba;
  89. u32 scp_data_len;
  90. u8 reserved6[260];
  91. u8 scp_data[];
  92. } __attribute__((packed));
  93. struct ipl_block_ccw {
  94. u8 load_param[8];
  95. u8 reserved1[84];
  96. u8 reserved2[2];
  97. u16 devno;
  98. u8 vm_flags;
  99. u8 reserved3[3];
  100. u32 vm_parm_len;
  101. } __attribute__((packed));
  102. struct ipl_parameter_block {
  103. struct ipl_list_hdr hdr;
  104. union {
  105. struct ipl_block_fcp fcp;
  106. struct ipl_block_ccw ccw;
  107. } ipl_info;
  108. } __attribute__((packed));
  109. #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \
  110. sizeof(struct ipl_block_fcp))
  111. #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \
  112. sizeof(struct ipl_block_ccw))
  113. #define IPL_MAX_SUPPORTED_VERSION (0)
  114. /*
  115. * IPL validity flags and parameters as detected in head.S
  116. */
  117. extern u32 ipl_flags;
  118. extern u16 ipl_devno;
  119. void do_reipl(void);
  120. enum {
  121. IPL_DEVNO_VALID = 1,
  122. IPL_PARMBLOCK_VALID = 2,
  123. };
  124. #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \
  125. IPL_PARMBLOCK_ORIGIN)
  126. #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len)
  127. #else /* __ASSEMBLY__ */
  128. #ifndef __s390x__
  129. #define IPL_DEVICE 0x10404
  130. #define INITRD_START 0x1040C
  131. #define INITRD_SIZE 0x10414
  132. #else /* __s390x__ */
  133. #define IPL_DEVICE 0x10400
  134. #define INITRD_START 0x10408
  135. #define INITRD_SIZE 0x10410
  136. #endif /* __s390x__ */
  137. #define COMMAND_LINE 0x10480
  138. #endif /* __ASSEMBLY__ */
  139. #endif /* __KERNEL__ */
  140. #endif /* _ASM_S390_SETUP_H */