Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *    Copyright IBM Corp. 2007
0004  */
0005 
0006 #ifndef _ASM_S390_SCLP_H
0007 #define _ASM_S390_SCLP_H
0008 
0009 #include <linux/types.h>
0010 
0011 #define SCLP_CHP_INFO_MASK_SIZE     32
0012 #define EARLY_SCCB_SIZE     PAGE_SIZE
0013 #define SCLP_MAX_CORES      512
0014 /* 144 + 16 * SCLP_MAX_CORES + 2 * (SCLP_MAX_CORES - 1) */
0015 #define EXT_SCCB_READ_SCP   (3 * PAGE_SIZE)
0016 /* 24 + 16 * SCLP_MAX_CORES */
0017 #define EXT_SCCB_READ_CPU   (3 * PAGE_SIZE)
0018 
0019 #ifndef __ASSEMBLY__
0020 #include <linux/uio.h>
0021 #include <asm/chpid.h>
0022 #include <asm/cpu.h>
0023 
0024 struct sclp_chp_info {
0025     u8 recognized[SCLP_CHP_INFO_MASK_SIZE];
0026     u8 standby[SCLP_CHP_INFO_MASK_SIZE];
0027     u8 configured[SCLP_CHP_INFO_MASK_SIZE];
0028 };
0029 
0030 #define LOADPARM_LEN 8
0031 
0032 struct sclp_ipl_info {
0033     int is_valid;
0034     int has_dump;
0035     char loadparm[LOADPARM_LEN];
0036 };
0037 
0038 struct sclp_core_entry {
0039     u8 core_id;
0040     u8 reserved0;
0041     u8 : 4;
0042     u8 sief2 : 1;
0043     u8 skey : 1;
0044     u8 : 2;
0045     u8 : 2;
0046     u8 gpere : 1;
0047     u8 siif : 1;
0048     u8 sigpif : 1;
0049     u8 : 3;
0050     u8 reserved2[3];
0051     u8 : 2;
0052     u8 ib : 1;
0053     u8 cei : 1;
0054     u8 : 4;
0055     u8 reserved3[6];
0056     u8 type;
0057     u8 reserved1;
0058 } __attribute__((packed));
0059 
0060 struct sclp_core_info {
0061     unsigned int configured;
0062     unsigned int standby;
0063     unsigned int combined;
0064     struct sclp_core_entry core[SCLP_MAX_CORES];
0065 };
0066 
0067 struct sclp_info {
0068     unsigned char has_linemode : 1;
0069     unsigned char has_vt220 : 1;
0070     unsigned char has_siif : 1;
0071     unsigned char has_sigpif : 1;
0072     unsigned char has_core_type : 1;
0073     unsigned char has_sprp : 1;
0074     unsigned char has_hvs : 1;
0075     unsigned char has_esca : 1;
0076     unsigned char has_sief2 : 1;
0077     unsigned char has_64bscao : 1;
0078     unsigned char has_gpere : 1;
0079     unsigned char has_cmma : 1;
0080     unsigned char has_gsls : 1;
0081     unsigned char has_ib : 1;
0082     unsigned char has_cei : 1;
0083     unsigned char has_pfmfi : 1;
0084     unsigned char has_ibs : 1;
0085     unsigned char has_skey : 1;
0086     unsigned char has_kss : 1;
0087     unsigned char has_gisaf : 1;
0088     unsigned char has_diag318 : 1;
0089     unsigned char has_sipl : 1;
0090     unsigned char has_dirq : 1;
0091     unsigned char has_iplcc : 1;
0092     unsigned char has_zpci_lsi : 1;
0093     unsigned char has_aisii : 1;
0094     unsigned char has_aeni : 1;
0095     unsigned char has_aisi : 1;
0096     unsigned int ibc;
0097     unsigned int mtid;
0098     unsigned int mtid_cp;
0099     unsigned int mtid_prev;
0100     unsigned long rzm;
0101     unsigned long rnmax;
0102     unsigned long hamax;
0103     unsigned int max_cores;
0104     unsigned long hsa_size;
0105     unsigned long facilities;
0106     unsigned int hmfai;
0107 };
0108 extern struct sclp_info sclp;
0109 
0110 struct zpci_report_error_header {
0111     u8 version; /* Interface version byte */
0112     u8 action;  /* Action qualifier byte
0113              * 0: Adapter Reset Request
0114              * 1: Deconfigure and repair action requested
0115              *  (OpenCrypto Problem Call Home)
0116              * 2: Informational Report
0117              *  (OpenCrypto Successful Diagnostics Execution)
0118              */
0119     u16 length; /* Length of Subsequent Data (up to 4K – SCLP header */
0120     u8 data[];  /* Subsequent Data passed verbatim to SCLP ET 24 */
0121 } __packed;
0122 
0123 extern char *sclp_early_sccb;
0124 
0125 void sclp_early_adjust_va(void);
0126 void sclp_early_set_buffer(void *sccb);
0127 int sclp_early_read_info(void);
0128 int sclp_early_read_storage_info(void);
0129 int sclp_early_get_core_info(struct sclp_core_info *info);
0130 void sclp_early_get_ipl_info(struct sclp_ipl_info *info);
0131 void sclp_early_detect(void);
0132 void sclp_early_printk(const char *s);
0133 void __sclp_early_printk(const char *s, unsigned int len);
0134 
0135 int sclp_early_get_memsize(unsigned long *mem);
0136 int sclp_early_get_hsa_size(unsigned long *hsa_size);
0137 int _sclp_get_core_info(struct sclp_core_info *info);
0138 int sclp_core_configure(u8 core);
0139 int sclp_core_deconfigure(u8 core);
0140 int sclp_sdias_blk_count(void);
0141 int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
0142 int sclp_chp_configure(struct chp_id chpid);
0143 int sclp_chp_deconfigure(struct chp_id chpid);
0144 int sclp_chp_read_info(struct sclp_chp_info *info);
0145 int sclp_pci_configure(u32 fid);
0146 int sclp_pci_deconfigure(u32 fid);
0147 int sclp_ap_configure(u32 apid);
0148 int sclp_ap_deconfigure(u32 apid);
0149 int sclp_pci_report(struct zpci_report_error_header *report, u32 fh, u32 fid);
0150 size_t memcpy_hsa_iter(struct iov_iter *iter, unsigned long src, size_t count);
0151 void sclp_ocf_cpc_name_copy(char *dst);
0152 
0153 static inline int sclp_get_core_info(struct sclp_core_info *info, int early)
0154 {
0155     if (early)
0156         return sclp_early_get_core_info(info);
0157     return _sclp_get_core_info(info);
0158 }
0159 
0160 #endif /* __ASSEMBLY__ */
0161 #endif /* _ASM_S390_SCLP_H */