sclp.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright IBM Corp. 2007
  4. * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
  5. */
  6. #ifndef _ASM_S390_SCLP_H
  7. #define _ASM_S390_SCLP_H
  8. #include <linux/types.h>
  9. #include <asm/chpid.h>
  10. #include <asm/cpu.h>
  11. #define SCLP_CHP_INFO_MASK_SIZE 32
  12. #define SCLP_MAX_CORES 256
  13. struct sclp_chp_info {
  14. u8 recognized[SCLP_CHP_INFO_MASK_SIZE];
  15. u8 standby[SCLP_CHP_INFO_MASK_SIZE];
  16. u8 configured[SCLP_CHP_INFO_MASK_SIZE];
  17. };
  18. #define LOADPARM_LEN 8
  19. struct sclp_ipl_info {
  20. int is_valid;
  21. int has_dump;
  22. char loadparm[LOADPARM_LEN];
  23. };
  24. struct sclp_core_entry {
  25. u8 core_id;
  26. u8 reserved0;
  27. u8 : 4;
  28. u8 sief2 : 1;
  29. u8 skey : 1;
  30. u8 : 2;
  31. u8 : 2;
  32. u8 gpere : 1;
  33. u8 siif : 1;
  34. u8 sigpif : 1;
  35. u8 : 3;
  36. u8 reserved2[3];
  37. u8 : 2;
  38. u8 ib : 1;
  39. u8 cei : 1;
  40. u8 : 4;
  41. u8 reserved3[6];
  42. u8 type;
  43. u8 reserved1;
  44. } __attribute__((packed));
  45. struct sclp_core_info {
  46. unsigned int configured;
  47. unsigned int standby;
  48. unsigned int combined;
  49. struct sclp_core_entry core[SCLP_MAX_CORES];
  50. };
  51. struct sclp_info {
  52. unsigned char has_linemode : 1;
  53. unsigned char has_vt220 : 1;
  54. unsigned char has_siif : 1;
  55. unsigned char has_sigpif : 1;
  56. unsigned char has_core_type : 1;
  57. unsigned char has_sprp : 1;
  58. unsigned char has_hvs : 1;
  59. unsigned char has_esca : 1;
  60. unsigned char has_sief2 : 1;
  61. unsigned char has_64bscao : 1;
  62. unsigned char has_gpere : 1;
  63. unsigned char has_cmma : 1;
  64. unsigned char has_gsls : 1;
  65. unsigned char has_ib : 1;
  66. unsigned char has_cei : 1;
  67. unsigned char has_pfmfi : 1;
  68. unsigned char has_ibs : 1;
  69. unsigned char has_skey : 1;
  70. unsigned char has_kss : 1;
  71. unsigned char has_gisaf : 1;
  72. unsigned int ibc;
  73. unsigned int mtid;
  74. unsigned int mtid_cp;
  75. unsigned int mtid_prev;
  76. unsigned long rzm;
  77. unsigned long rnmax;
  78. unsigned long hamax;
  79. unsigned int max_cores;
  80. unsigned long hsa_size;
  81. unsigned long facilities;
  82. unsigned int hmfai;
  83. };
  84. extern struct sclp_info sclp;
  85. struct zpci_report_error_header {
  86. u8 version; /* Interface version byte */
  87. u8 action; /* Action qualifier byte
  88. * 1: Deconfigure and repair action requested
  89. * (OpenCrypto Problem Call Home)
  90. * 2: Informational Report
  91. * (OpenCrypto Successful Diagnostics Execution)
  92. */
  93. u16 length; /* Length of Subsequent Data (up to 4K – SCLP header */
  94. u8 data[0]; /* Subsequent Data passed verbatim to SCLP ET 24 */
  95. } __packed;
  96. int sclp_early_get_core_info(struct sclp_core_info *info);
  97. void sclp_early_get_ipl_info(struct sclp_ipl_info *info);
  98. void sclp_early_detect(void);
  99. void sclp_early_printk(const char *s);
  100. void sclp_early_printk_force(const char *s);
  101. void __sclp_early_printk(const char *s, unsigned int len, unsigned int force);
  102. int _sclp_get_core_info(struct sclp_core_info *info);
  103. int sclp_core_configure(u8 core);
  104. int sclp_core_deconfigure(u8 core);
  105. int sclp_sdias_blk_count(void);
  106. int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
  107. int sclp_chp_configure(struct chp_id chpid);
  108. int sclp_chp_deconfigure(struct chp_id chpid);
  109. int sclp_chp_read_info(struct sclp_chp_info *info);
  110. int sclp_pci_configure(u32 fid);
  111. int sclp_pci_deconfigure(u32 fid);
  112. int sclp_pci_report(struct zpci_report_error_header *report, u32 fh, u32 fid);
  113. int memcpy_hsa_kernel(void *dest, unsigned long src, size_t count);
  114. int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count);
  115. void sclp_ocf_cpc_name_copy(char *dst);
  116. static inline int sclp_get_core_info(struct sclp_core_info *info, int early)
  117. {
  118. if (early)
  119. return sclp_early_get_core_info(info);
  120. return _sclp_get_core_info(info);
  121. }
  122. #endif /* _ASM_S390_SCLP_H */