setup.h 3.7 KB

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