ipl.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. #define IPL_PARMBLOCK_ORIGIN 0x2000
  10. #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \
  11. sizeof(struct ipl_block_fcp))
  12. #define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8)
  13. #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \
  14. sizeof(struct ipl_block_ccw))
  15. #define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8)
  16. #define IPL_MAX_SUPPORTED_VERSION (0)
  17. #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \
  18. IPL_PARMBLOCK_ORIGIN)
  19. #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len)
  20. struct ipl_list_hdr {
  21. u32 len;
  22. u8 reserved1[3];
  23. u8 version;
  24. u32 blk0_len;
  25. u8 pbt;
  26. u8 flags;
  27. u16 reserved2;
  28. } __attribute__((packed));
  29. struct ipl_block_fcp {
  30. u8 reserved1[313-1];
  31. u8 opt;
  32. u8 reserved2[3];
  33. u16 reserved3;
  34. u16 devno;
  35. u8 reserved4[4];
  36. u64 wwpn;
  37. u64 lun;
  38. u32 bootprog;
  39. u8 reserved5[12];
  40. u64 br_lba;
  41. u32 scp_data_len;
  42. u8 reserved6[260];
  43. u8 scp_data[];
  44. } __attribute__((packed));
  45. struct ipl_block_ccw {
  46. u8 load_param[8];
  47. u8 reserved1[84];
  48. u8 reserved2[2];
  49. u16 devno;
  50. u8 vm_flags;
  51. u8 reserved3[3];
  52. u32 vm_parm_len;
  53. u8 reserved4[80];
  54. } __attribute__((packed));
  55. struct ipl_parameter_block {
  56. struct ipl_list_hdr hdr;
  57. union {
  58. struct ipl_block_fcp fcp;
  59. struct ipl_block_ccw ccw;
  60. } ipl_info;
  61. } __attribute__((packed));
  62. /*
  63. * IPL validity flags
  64. */
  65. extern u32 ipl_flags;
  66. extern u32 dump_prefix_page;
  67. extern void do_reipl(void);
  68. extern void ipl_save_parameters(void);
  69. enum {
  70. IPL_DEVNO_VALID = 1,
  71. IPL_PARMBLOCK_VALID = 2,
  72. IPL_NSS_VALID = 4,
  73. };
  74. /*
  75. * DIAG 308 support
  76. */
  77. enum diag308_subcode {
  78. DIAG308_REL_HSA = 2,
  79. DIAG308_IPL = 3,
  80. DIAG308_DUMP = 4,
  81. DIAG308_SET = 5,
  82. DIAG308_STORE = 6,
  83. };
  84. enum diag308_ipl_type {
  85. DIAG308_IPL_TYPE_FCP = 0,
  86. DIAG308_IPL_TYPE_CCW = 2,
  87. };
  88. enum diag308_opt {
  89. DIAG308_IPL_OPT_IPL = 0x10,
  90. DIAG308_IPL_OPT_DUMP = 0x20,
  91. };
  92. enum diag308_rc {
  93. DIAG308_RC_OK = 1,
  94. };
  95. extern int diag308(unsigned long subcode, void *addr);
  96. #endif /* _ASM_S390_IPL_H */