ipl.h 2.0 KB

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