blob: f1096bab5199aef439c33c75395f86e3f38a6e08 [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
14
15struct sclp_chp_info {
16 u8 recognized[SCLP_CHP_INFO_MASK_SIZE];
17 u8 standby[SCLP_CHP_INFO_MASK_SIZE];
18 u8 configured[SCLP_CHP_INFO_MASK_SIZE];
19};
20
Heiko Carstens05dd2532007-07-10 11:24:09 +020021#define LOADPARM_LEN 8
22
23struct sclp_ipl_info {
24 int is_valid;
25 int has_dump;
26 char loadparm[LOADPARM_LEN];
27};
28
Heiko Carstens08d07962008-01-26 14:10:56 +010029struct sclp_cpu_entry {
Martin Schwidefsky10ad34b2015-01-14 17:52:10 +010030 u8 core_id;
Heiko Carstens217a4402013-12-30 12:54:14 +010031 u8 reserved0[2];
32 u8 : 3;
33 u8 siif : 1;
David Hildenbrandd614be02014-10-14 12:11:02 +020034 u8 sigpif : 1;
35 u8 : 3;
Heiko Carstens217a4402013-12-30 12:54:14 +010036 u8 reserved2[10];
Heiko Carstens08d07962008-01-26 14:10:56 +010037 u8 type;
38 u8 reserved1;
39} __attribute__((packed));
40
41struct sclp_cpu_info {
42 unsigned int configured;
43 unsigned int standby;
44 unsigned int combined;
45 int has_cpu_type;
Heiko Carstens9c095232013-11-30 12:00:28 +010046 struct sclp_cpu_entry cpu[MAX_CPU_ADDRESS + 1];
Heiko Carstens08d07962008-01-26 14:10:56 +010047};
48
49int sclp_get_cpu_info(struct sclp_cpu_info *info);
50int sclp_cpu_configure(u8 cpu);
51int sclp_cpu_deconfigure(u8 cpu);
Heiko Carstens23d17422008-07-14 09:59:21 +020052unsigned long long sclp_get_rnmax(void);
53unsigned long long sclp_get_rzm(void);
Heiko Carstenscf813db2014-03-10 14:50:16 +010054unsigned int sclp_get_max_cpu(void);
Martin Schwidefsky10ad34b2015-01-14 17:52:10 +010055unsigned int sclp_get_mtid(u8 cpu_type);
56unsigned int sclp_get_mtid_max(void);
57unsigned int sclp_get_mtid_prev(void);
Heiko Carstens05dd2532007-07-10 11:24:09 +020058int sclp_sdias_blk_count(void);
59int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
60int sclp_chp_configure(struct chp_id chpid);
61int sclp_chp_deconfigure(struct chp_id chpid);
62int sclp_chp_read_info(struct sclp_chp_info *info);
63void sclp_get_ipl_info(struct sclp_ipl_info *info);
Hendrik Brueckner52733e02013-12-05 19:28:39 +010064bool __init sclp_has_linemode(void);
65bool __init sclp_has_vt220(void);
Martin Schwidefsky07be0382014-01-24 09:18:52 +010066bool sclp_has_sprp(void);
Jan Glauber7441b062012-11-29 14:35:47 +010067int sclp_pci_configure(u32 fid);
68int sclp_pci_deconfigure(u32 fid);
Michael Holzheu6f79d332013-09-11 14:24:54 -070069int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode);
Michael Holzheue657d8f2013-11-13 10:38:27 +010070unsigned long sclp_get_hsa_size(void);
Michael Holzheu7b50da52013-11-13 10:38:27 +010071void sclp_early_detect(void);
Heiko Carstens217a4402013-12-30 12:54:14 +010072int sclp_has_siif(void);
David Hildenbrandd614be02014-10-14 12:11:02 +020073int sclp_has_sigpif(void);
Michael Mueller570126d2014-03-15 18:16:26 +010074unsigned int sclp_get_ibc(void);
Heiko Carstensab14de62007-02-05 21:18:37 +010075
Chen Gangfbf87df2015-01-03 17:29:07 +080076long _sclp_print_early(const char *);
77
Heiko Carstensab14de62007-02-05 21:18:37 +010078#endif /* _ASM_S390_SCLP_H */