ipl.h 2.6 KB

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