blob: e4f6f73afe2f91018ade009782534041d03b52c5 [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;
Heiko Carstens217a4402013-12-30 12:54:14 +010036 u8 : 3;
37 u8 siif : 1;
David Hildenbrandd614be02014-10-14 12:11:02 +020038 u8 sigpif : 1;
39 u8 : 3;
Heiko Carstens217a4402013-12-30 12:54:14 +010040 u8 reserved2[10];
Heiko Carstens08d07962008-01-26 14:10:56 +010041 u8 type;
42 u8 reserved1;
43} __attribute__((packed));
44
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020045struct sclp_core_info {
Heiko Carstens08d07962008-01-26 14:10:56 +010046 unsigned int configured;
47 unsigned int standby;
48 unsigned int combined;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020049 struct sclp_core_entry core[SCLP_MAX_CORES];
Heiko Carstens08d07962008-01-26 14:10:56 +010050};
51
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020052struct sclp_info {
53 unsigned char has_linemode : 1;
54 unsigned char has_vt220 : 1;
55 unsigned char has_siif : 1;
56 unsigned char has_sigpif : 1;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020057 unsigned char has_core_type : 1;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020058 unsigned char has_sprp : 1;
Eugene (jno) Dvurechenskif7ba1d32014-10-09 16:04:48 +020059 unsigned char has_hvs : 1;
60 unsigned char has_esca : 1;
David Hildenbrand8dfd5232015-02-24 15:51:55 +010061 unsigned char has_sief2 : 1;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020062 unsigned int ibc;
63 unsigned int mtid;
64 unsigned int mtid_cp;
65 unsigned int mtid_prev;
Heiko Carstens423d5b32015-12-31 10:07:21 +010066 unsigned long rzm;
67 unsigned long rnmax;
68 unsigned long hamax;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020069 unsigned int max_cores;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020070 unsigned long hsa_size;
Heiko Carstens423d5b32015-12-31 10:07:21 +010071 unsigned long facilities;
Alexander Yarygin154fa272016-04-01 15:36:51 +030072 unsigned int hmfai;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020073};
74extern struct sclp_info sclp;
75
Sebastian Ott12283a42015-11-27 11:18:02 +010076struct zpci_report_error_header {
77 u8 version; /* Interface version byte */
78 u8 action; /* Action qualifier byte
79 * 1: Deconfigure and repair action requested
80 * (OpenCrypto Problem Call Home)
81 * 2: Informational Report
82 * (OpenCrypto Successful Diagnostics Execution)
83 */
84 u16 length; /* Length of Subsequent Data (up to 4K – SCLP header */
85 u8 data[0]; /* Subsequent Data passed verbatim to SCLP ET 24 */
86} __packed;
87
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020088int sclp_get_core_info(struct sclp_core_info *info);
89int sclp_core_configure(u8 core);
90int sclp_core_deconfigure(u8 core);
Heiko Carstens05dd2532007-07-10 11:24:09 +020091int sclp_sdias_blk_count(void);
92int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
93int sclp_chp_configure(struct chp_id chpid);
94int sclp_chp_deconfigure(struct chp_id chpid);
95int sclp_chp_read_info(struct sclp_chp_info *info);
96void sclp_get_ipl_info(struct sclp_ipl_info *info);
Jan Glauber7441b062012-11-29 14:35:47 +010097int sclp_pci_configure(u32 fid);
98int sclp_pci_deconfigure(u32 fid);
Sebastian Ott12283a42015-11-27 11:18:02 +010099int sclp_pci_report(struct zpci_report_error_header *report, u32 fh, u32 fid);
Martin Schwidefskydf9694c2015-10-12 10:43:37 +0200100int memcpy_hsa_kernel(void *dest, unsigned long src, size_t count);
101int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count);
Michael Holzheu7b50da52013-11-13 10:38:27 +0100102void sclp_early_detect(void);
Sascha Silbe3f975df2015-11-24 16:28:55 +0100103void _sclp_print_early(const char *);
Chen Gangfbf87df2015-01-03 17:29:07 +0800104
Heiko Carstensab14de62007-02-05 21:18:37 +0100105#endif /* _ASM_S390_SCLP_H */