blob: e1450dd9d9329771b199f8ebd1bd06f40e8a184c [file] [log] [blame]
Heiko Carstensab14de62007-02-05 21:18:37 +01001/*
Heiko Carstensab14de62007-02-05 21:18:37 +01002 * Copyright IBM Corp. 2007
3 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
4 */
5
6#ifndef _ASM_S390_SCLP_H
7#define _ASM_S390_SCLP_H
8
9#include <linux/types.h>
Peter Oberparleitere5854a52007-04-27 16:01:31 +020010#include <asm/chpid.h>
Heiko Carstens9c095232013-11-30 12:00:28 +010011#include <asm/cpu.h>
Heiko Carstensab14de62007-02-05 21:18:37 +010012
Peter Oberparleitere5854a52007-04-27 16:01:31 +020013#define SCLP_CHP_INFO_MASK_SIZE 32
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020014#define SCLP_MAX_CORES 256
Peter Oberparleitere5854a52007-04-27 16:01:31 +020015
16struct sclp_chp_info {
17 u8 recognized[SCLP_CHP_INFO_MASK_SIZE];
18 u8 standby[SCLP_CHP_INFO_MASK_SIZE];
19 u8 configured[SCLP_CHP_INFO_MASK_SIZE];
20};
21
Heiko Carstens05dd2532007-07-10 11:24:09 +020022#define LOADPARM_LEN 8
23
24struct sclp_ipl_info {
25 int is_valid;
26 int has_dump;
27 char loadparm[LOADPARM_LEN];
28};
29
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020030struct sclp_core_entry {
Martin Schwidefsky10ad34b2015-01-14 17:52:10 +010031 u8 core_id;
David Hildenbrand8dfd5232015-02-24 15:51:55 +010032 u8 reserved0;
33 u8 : 4;
34 u8 sief2 : 1;
35 u8 : 3;
David Hildenbrandb9e28892015-11-24 12:51:52 +010036 u8 : 2;
37 u8 gpere : 1;
Heiko Carstens217a4402013-12-30 12:54:14 +010038 u8 siif : 1;
David Hildenbrandd614be02014-10-14 12:11:02 +020039 u8 sigpif : 1;
40 u8 : 3;
Heiko Carstens217a4402013-12-30 12:54:14 +010041 u8 reserved2[10];
Heiko Carstens08d07962008-01-26 14:10:56 +010042 u8 type;
43 u8 reserved1;
44} __attribute__((packed));
45
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020046struct sclp_core_info {
Heiko Carstens08d07962008-01-26 14:10:56 +010047 unsigned int configured;
48 unsigned int standby;
49 unsigned int combined;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020050 struct sclp_core_entry core[SCLP_MAX_CORES];
Heiko Carstens08d07962008-01-26 14:10:56 +010051};
52
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020053struct sclp_info {
54 unsigned char has_linemode : 1;
55 unsigned char has_vt220 : 1;
56 unsigned char has_siif : 1;
57 unsigned char has_sigpif : 1;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020058 unsigned char has_core_type : 1;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020059 unsigned char has_sprp : 1;
Eugene (jno) Dvurechenskif7ba1d32014-10-09 16:04:48 +020060 unsigned char has_hvs : 1;
61 unsigned char has_esca : 1;
David Hildenbrand8dfd5232015-02-24 15:51:55 +010062 unsigned char has_sief2 : 1;
David Hildenbrand4013ade2015-11-24 12:49:43 +010063 unsigned char has_64bscao : 1;
David Hildenbrandb9e28892015-11-24 12:51:52 +010064 unsigned char has_gpere : 1;
David Hildenbrand09be9cb2015-11-24 12:55:35 +010065 unsigned char has_cmma : 1;
David Hildenbrand5236c752015-11-24 12:53:46 +010066 unsigned char has_gsls : 1;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020067 unsigned int ibc;
68 unsigned int mtid;
69 unsigned int mtid_cp;
70 unsigned int mtid_prev;
Heiko Carstens423d5b32015-12-31 10:07:21 +010071 unsigned long rzm;
72 unsigned long rnmax;
73 unsigned long hamax;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020074 unsigned int max_cores;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020075 unsigned long hsa_size;
Heiko Carstens423d5b32015-12-31 10:07:21 +010076 unsigned long facilities;
Alexander Yarygin154fa272016-04-01 15:36:51 +030077 unsigned int hmfai;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020078};
79extern struct sclp_info sclp;
80
Sebastian Ott12283a42015-11-27 11:18:02 +010081struct zpci_report_error_header {
82 u8 version; /* Interface version byte */
83 u8 action; /* Action qualifier byte
84 * 1: Deconfigure and repair action requested
85 * (OpenCrypto Problem Call Home)
86 * 2: Informational Report
87 * (OpenCrypto Successful Diagnostics Execution)
88 */
89 u16 length; /* Length of Subsequent Data (up to 4K – SCLP header */
90 u8 data[0]; /* Subsequent Data passed verbatim to SCLP ET 24 */
91} __packed;
92
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020093int sclp_get_core_info(struct sclp_core_info *info);
94int sclp_core_configure(u8 core);
95int sclp_core_deconfigure(u8 core);
Heiko Carstens05dd2532007-07-10 11:24:09 +020096int sclp_sdias_blk_count(void);
97int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
98int sclp_chp_configure(struct chp_id chpid);
99int sclp_chp_deconfigure(struct chp_id chpid);
100int sclp_chp_read_info(struct sclp_chp_info *info);
101void sclp_get_ipl_info(struct sclp_ipl_info *info);
Jan Glauber7441b062012-11-29 14:35:47 +0100102int sclp_pci_configure(u32 fid);
103int sclp_pci_deconfigure(u32 fid);
Sebastian Ott12283a42015-11-27 11:18:02 +0100104int sclp_pci_report(struct zpci_report_error_header *report, u32 fh, u32 fid);
Martin Schwidefskydf9694c2015-10-12 10:43:37 +0200105int memcpy_hsa_kernel(void *dest, unsigned long src, size_t count);
106int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count);
Michael Holzheu7b50da52013-11-13 10:38:27 +0100107void sclp_early_detect(void);
Sascha Silbe3f975df2015-11-24 16:28:55 +0100108void _sclp_print_early(const char *);
Janosch Franke435dc32016-02-08 13:36:22 +0100109void sclp_ocf_cpc_name_copy(char *dst);
Chen Gangfbf87df2015-01-03 17:29:07 +0800110
Heiko Carstensab14de62007-02-05 21:18:37 +0100111#endif /* _ASM_S390_SCLP_H */