ipl.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. struct ipl_block_ccw {
  49. u8 load_parm[8];
  50. u8 reserved1[84];
  51. u8 reserved2[2];
  52. u16 devno;
  53. u8 vm_flags;
  54. u8 reserved3[3];
  55. u32 vm_parm_len;
  56. u8 nss_name[8];
  57. u8 vm_parm[DIAG308_VMPARM_SIZE];
  58. u8 reserved4[8];
  59. } __attribute__((packed));
  60. struct ipl_parameter_block {
  61. struct ipl_list_hdr hdr;
  62. union {
  63. struct ipl_block_fcp fcp;
  64. struct ipl_block_ccw ccw;
  65. } ipl_info;
  66. } __attribute__((packed,aligned(4096)));
  67. /*
  68. * IPL validity flags
  69. */
  70. extern u32 ipl_flags;
  71. extern u32 dump_prefix_page;
  72. extern unsigned int zfcpdump_prefix_array[];
  73. extern void do_reipl(void);
  74. extern void do_halt(void);
  75. extern void do_poff(void);
  76. extern void ipl_save_parameters(void);
  77. extern void ipl_update_parameters(void);
  78. extern void get_ipl_vmparm(char *);
  79. enum {
  80. IPL_DEVNO_VALID = 1,
  81. IPL_PARMBLOCK_VALID = 2,
  82. IPL_NSS_VALID = 4,
  83. };
  84. enum ipl_type {
  85. IPL_TYPE_UNKNOWN = 1,
  86. IPL_TYPE_CCW = 2,
  87. IPL_TYPE_FCP = 4,
  88. IPL_TYPE_FCP_DUMP = 8,
  89. IPL_TYPE_NSS = 16,
  90. };
  91. struct ipl_info
  92. {
  93. enum ipl_type type;
  94. union {
  95. struct {
  96. struct ccw_dev_id dev_id;
  97. } ccw;
  98. struct {
  99. struct ccw_dev_id dev_id;
  100. u64 wwpn;
  101. u64 lun;
  102. } fcp;
  103. struct {
  104. char name[NSS_NAME_SIZE + 1];
  105. } nss;
  106. } data;
  107. };
  108. extern struct ipl_info ipl_info;
  109. extern void setup_ipl(void);
  110. /*
  111. * DIAG 308 support
  112. */
  113. enum diag308_subcode {
  114. DIAG308_REL_HSA = 2,
  115. DIAG308_IPL = 3,
  116. DIAG308_DUMP = 4,
  117. DIAG308_SET = 5,
  118. DIAG308_STORE = 6,
  119. };
  120. enum diag308_ipl_type {
  121. DIAG308_IPL_TYPE_FCP = 0,
  122. DIAG308_IPL_TYPE_CCW = 2,
  123. };
  124. enum diag308_opt {
  125. DIAG308_IPL_OPT_IPL = 0x10,
  126. DIAG308_IPL_OPT_DUMP = 0x20,
  127. };
  128. enum diag308_flags {
  129. DIAG308_FLAGS_LP_VALID = 0x80,
  130. };
  131. enum diag308_vm_flags {
  132. DIAG308_VM_FLAGS_NSS_VALID = 0x80,
  133. DIAG308_VM_FLAGS_VP_VALID = 0x40,
  134. };
  135. enum diag308_rc {
  136. DIAG308_RC_OK = 0x0001,
  137. DIAG308_RC_NOCONFIG = 0x0102,
  138. };
  139. extern int diag308(unsigned long subcode, void *addr);
  140. #endif /* _ASM_S390_IPL_H */