blob: dea883f85d66ae59edf460320ca2db07e5be4523 [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;
66 unsigned long long rzm;
67 unsigned long long rnmax;
68 unsigned long 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;
David Hildenbrand78335a32015-05-06 09:17:51 +020071 unsigned long long facilities;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020072};
73extern struct sclp_info sclp;
74
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020075int sclp_get_core_info(struct sclp_core_info *info);
76int sclp_core_configure(u8 core);
77int sclp_core_deconfigure(u8 core);
Heiko Carstens05dd2532007-07-10 11:24:09 +020078int sclp_sdias_blk_count(void);
79int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
80int sclp_chp_configure(struct chp_id chpid);
81int sclp_chp_deconfigure(struct chp_id chpid);
82int sclp_chp_read_info(struct sclp_chp_info *info);
83void sclp_get_ipl_info(struct sclp_ipl_info *info);
Jan Glauber7441b062012-11-29 14:35:47 +010084int sclp_pci_configure(u32 fid);
85int sclp_pci_deconfigure(u32 fid);
Michael Holzheu6f79d332013-09-11 14:24:54 -070086int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode);
Michael Holzheu7b50da52013-11-13 10:38:27 +010087void sclp_early_detect(void);
Martin Schwidefsky22362a02015-07-08 10:20:04 +020088int _sclp_print_early(const char *);
Chen Gangfbf87df2015-01-03 17:29:07 +080089
Heiko Carstensab14de62007-02-05 21:18:37 +010090#endif /* _ASM_S390_SCLP_H */