ipl.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /*
  2. * s390 (re)ipl support
  3. *
  4. * Copyright IBM Corp. 2007
  5. */
  6. #ifndef _ASM_S390_IPL_H
  7. #define _ASM_S390_IPL_H
  8. #include <asm/types.h>
  9. #include <asm/cio.h>
  10. #include <asm/setup.h>
  11. #define IPL_PARMBLOCK_ORIGIN 0x2000
  12. #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \
  13. sizeof(struct ipl_block_fcp))
  14. #define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8)
  15. #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \
  16. sizeof(struct ipl_block_ccw))
  17. #define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8)
  18. #define IPL_MAX_SUPPORTED_VERSION (0)
  19. #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \
  20. IPL_PARMBLOCK_ORIGIN)
  21. #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len)
  22. struct ipl_list_hdr {
  23. u32 len;
  24. u8 reserved1[3];
  25. u8 version;
  26. u32 blk0_len;
  27. u8 pbt;
  28. u8 flags;
  29. u16 reserved2;
  30. } __attribute__((packed));
  31. struct ipl_block_fcp {
  32. u8 reserved1[313-1];
  33. u8 opt;
  34. u8 reserved2[3];
  35. u16 reserved3;
  36. u16 devno;
  37. u8 reserved4[4];
  38. u64 wwpn;
  39. u64 lun;
  40. u32 bootprog;
  41. u8 reserved5[12];
  42. u64 br_lba;
  43. u32 scp_data_len;
  44. u8 reserved6[260];
  45. u8 scp_data[];
  46. } __attribute__((packed));
  47. #define DIAG308_VMPARM_SIZE 64
  48. #define DIAG308_SCPDATA_SIZE (PAGE_SIZE - (sizeof(struct ipl_list_hdr) + \
  49. offsetof(struct ipl_block_fcp, scp_data)))
  50. struct ipl_block_ccw {
  51. u8 load_parm[8];
  52. u8 reserved1[84];
  53. u8 reserved2[2];
  54. u16 devno;
  55. u8 vm_flags;
  56. u8 reserved3[3];
  57. u32 vm_parm_len;
  58. u8 nss_name[8];
  59. u8 vm_parm[DIAG308_VMPARM_SIZE];
  60. u8 reserved4[8];
  61. } __attribute__((packed));
  62. struct ipl_parameter_block {
  63. struct ipl_list_hdr hdr;
  64. union {
  65. struct ipl_block_fcp fcp;
  66. struct ipl_block_ccw ccw;
  67. } ipl_info;
  68. } __attribute__((packed,aligned(4096)));
  69. /*
  70. * IPL validity flags
  71. */
  72. extern u32 ipl_flags;
  73. extern u32 dump_prefix_page;
  74. extern unsigned int zfcpdump_prefix_array[];
  75. extern void do_reipl(void);
  76. extern void do_halt(void);
  77. extern void do_poff(void);
  78. extern void ipl_save_parameters(void);
  79. extern void ipl_update_parameters(void);
  80. extern size_t append_ipl_vmparm(char *, size_t);
  81. extern size_t append_ipl_scpdata(char *, size_t);
  82. enum {
  83. IPL_DEVNO_VALID = 1,
  84. IPL_PARMBLOCK_VALID = 2,
  85. IPL_NSS_VALID = 4,
  86. };
  87. enum ipl_type {
  88. IPL_TYPE_UNKNOWN = 1,
  89. IPL_TYPE_CCW = 2,
  90. IPL_TYPE_FCP = 4,
  91. IPL_TYPE_FCP_DUMP = 8,
  92. IPL_TYPE_NSS = 16,
  93. };
  94. struct ipl_info
  95. {
  96. enum ipl_type type;
  97. union {
  98. struct {
  99. struct ccw_dev_id dev_id;
  100. } ccw;
  101. struct {
  102. struct ccw_dev_id dev_id;
  103. u64 wwpn;
  104. u64 lun;
  105. } fcp;
  106. struct {
  107. char name[NSS_NAME_SIZE + 1];
  108. } nss;
  109. } data;
  110. };
  111. extern struct ipl_info ipl_info;
  112. extern void setup_ipl(void);
  113. /*
  114. * DIAG 308 support
  115. */
  116. enum diag308_subcode {
  117. DIAG308_REL_HSA = 2,
  118. DIAG308_IPL = 3,
  119. DIAG308_DUMP = 4,
  120. DIAG308_SET = 5,
  121. DIAG308_STORE = 6,
  122. };
  123. enum diag308_ipl_type {
  124. DIAG308_IPL_TYPE_FCP = 0,
  125. DIAG308_IPL_TYPE_CCW = 2,
  126. };
  127. enum diag308_opt {
  128. DIAG308_IPL_OPT_IPL = 0x10,
  129. DIAG308_IPL_OPT_DUMP = 0x20,
  130. };
  131. enum diag308_flags {
  132. DIAG308_FLAGS_LP_VALID = 0x80,
  133. };
  134. enum diag308_vm_flags {
  135. DIAG308_VM_FLAGS_NSS_VALID = 0x80,
  136. DIAG308_VM_FLAGS_VP_VALID = 0x40,
  137. };
  138. enum diag308_rc {
  139. DIAG308_RC_OK = 0x0001,
  140. DIAG308_RC_NOCONFIG = 0x0102,
  141. };
  142. extern int diag308(unsigned long subcode, void *addr);
  143. extern void diag308_reset(void);
  144. extern void store_status(void);
  145. extern void lgr_info_log(void);
  146. #endif /* _ASM_S390_IPL_H */