blob: c91ad198a59c8ae45b6c01026e9d033eb2144ba9 [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;
David Hildenbrand72cd82b2015-11-24 12:59:03 +010041 u8 reserved2[3];
42 u8 : 2;
43 u8 ib : 1;
David Hildenbrand4a5c3e02015-11-24 13:00:23 +010044 u8 cei : 1;
45 u8 : 4;
David Hildenbrand72cd82b2015-11-24 12:59:03 +010046 u8 reserved3[6];
Heiko Carstens08d07962008-01-26 14:10:56 +010047 u8 type;
48 u8 reserved1;
49} __attribute__((packed));
50
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020051struct sclp_core_info {
Heiko Carstens08d07962008-01-26 14:10:56 +010052 unsigned int configured;
53 unsigned int standby;
54 unsigned int combined;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020055 struct sclp_core_entry core[SCLP_MAX_CORES];
Heiko Carstens08d07962008-01-26 14:10:56 +010056};
57
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020058struct sclp_info {
59 unsigned char has_linemode : 1;
60 unsigned char has_vt220 : 1;
61 unsigned char has_siif : 1;
62 unsigned char has_sigpif : 1;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020063 unsigned char has_core_type : 1;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020064 unsigned char has_sprp : 1;
Eugene (jno) Dvurechenskif7ba1d32014-10-09 16:04:48 +020065 unsigned char has_hvs : 1;
66 unsigned char has_esca : 1;
David Hildenbrand8dfd5232015-02-24 15:51:55 +010067 unsigned char has_sief2 : 1;
David Hildenbrand4013ade2015-11-24 12:49:43 +010068 unsigned char has_64bscao : 1;
David Hildenbrandb9e28892015-11-24 12:51:52 +010069 unsigned char has_gpere : 1;
David Hildenbrand09be9cb2015-11-24 12:55:35 +010070 unsigned char has_cmma : 1;
David Hildenbrand5236c752015-11-24 12:53:46 +010071 unsigned char has_gsls : 1;
David Hildenbrand72cd82b2015-11-24 12:59:03 +010072 unsigned char has_ib : 1;
David Hildenbrand4a5c3e02015-11-24 13:00:23 +010073 unsigned char has_cei : 1;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020074 unsigned int ibc;
75 unsigned int mtid;
76 unsigned int mtid_cp;
77 unsigned int mtid_prev;
Heiko Carstens423d5b32015-12-31 10:07:21 +010078 unsigned long rzm;
79 unsigned long rnmax;
80 unsigned long hamax;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020081 unsigned int max_cores;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020082 unsigned long hsa_size;
Heiko Carstens423d5b32015-12-31 10:07:21 +010083 unsigned long facilities;
Alexander Yarygin154fa272016-04-01 15:36:51 +030084 unsigned int hmfai;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020085};
86extern struct sclp_info sclp;
87
Sebastian Ott12283a42015-11-27 11:18:02 +010088struct zpci_report_error_header {
89 u8 version; /* Interface version byte */
90 u8 action; /* Action qualifier byte
91 * 1: Deconfigure and repair action requested
92 * (OpenCrypto Problem Call Home)
93 * 2: Informational Report
94 * (OpenCrypto Successful Diagnostics Execution)
95 */
96 u16 length; /* Length of Subsequent Data (up to 4K – SCLP header */
97 u8 data[0]; /* Subsequent Data passed verbatim to SCLP ET 24 */
98} __packed;
99
Martin Schwidefskyd08d9432015-06-18 14:23:00 +0200100int sclp_get_core_info(struct sclp_core_info *info);
101int sclp_core_configure(u8 core);
102int sclp_core_deconfigure(u8 core);
Heiko Carstens05dd2532007-07-10 11:24:09 +0200103int sclp_sdias_blk_count(void);
104int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
105int sclp_chp_configure(struct chp_id chpid);
106int sclp_chp_deconfigure(struct chp_id chpid);
107int sclp_chp_read_info(struct sclp_chp_info *info);
108void sclp_get_ipl_info(struct sclp_ipl_info *info);
Jan Glauber7441b062012-11-29 14:35:47 +0100109int sclp_pci_configure(u32 fid);
110int sclp_pci_deconfigure(u32 fid);
Sebastian Ott12283a42015-11-27 11:18:02 +0100111int sclp_pci_report(struct zpci_report_error_header *report, u32 fh, u32 fid);
Martin Schwidefskydf9694c2015-10-12 10:43:37 +0200112int memcpy_hsa_kernel(void *dest, unsigned long src, size_t count);
113int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count);
Michael Holzheu7b50da52013-11-13 10:38:27 +0100114void sclp_early_detect(void);
Sascha Silbe3f975df2015-11-24 16:28:55 +0100115void _sclp_print_early(const char *);
Janosch Franke435dc32016-02-08 13:36:22 +0100116void sclp_ocf_cpc_name_copy(char *dst);
Chen Gangfbf87df2015-01-03 17:29:07 +0800117
Heiko Carstensab14de62007-02-05 21:18:37 +0100118#endif /* _ASM_S390_SCLP_H */