blob: 821dde5f425d0b3e97fbe32f5496fe968e4899fd [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;
Heiko Carstens217a4402013-12-30 12:54:14 +010032 u8 reserved0[2];
33 u8 : 3;
34 u8 siif : 1;
David Hildenbrandd614be02014-10-14 12:11:02 +020035 u8 sigpif : 1;
36 u8 : 3;
Heiko Carstens217a4402013-12-30 12:54:14 +010037 u8 reserved2[10];
Heiko Carstens08d07962008-01-26 14:10:56 +010038 u8 type;
39 u8 reserved1;
40} __attribute__((packed));
41
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020042struct sclp_core_info {
Heiko Carstens08d07962008-01-26 14:10:56 +010043 unsigned int configured;
44 unsigned int standby;
45 unsigned int combined;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020046 struct sclp_core_entry core[SCLP_MAX_CORES];
Heiko Carstens08d07962008-01-26 14:10:56 +010047};
48
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020049struct sclp_info {
50 unsigned char has_linemode : 1;
51 unsigned char has_vt220 : 1;
52 unsigned char has_siif : 1;
53 unsigned char has_sigpif : 1;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020054 unsigned char has_core_type : 1;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020055 unsigned char has_sprp : 1;
56 unsigned int ibc;
57 unsigned int mtid;
58 unsigned int mtid_cp;
59 unsigned int mtid_prev;
60 unsigned long long rzm;
61 unsigned long long rnmax;
62 unsigned long long hamax;
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020063 unsigned int max_cores;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020064 unsigned long hsa_size;
David Hildenbrand78335a32015-05-06 09:17:51 +020065 unsigned long long facilities;
David Hildenbrand37c5f6c2015-05-06 13:18:59 +020066};
67extern struct sclp_info sclp;
68
Martin Schwidefskyd08d9432015-06-18 14:23:00 +020069int sclp_get_core_info(struct sclp_core_info *info);
70int sclp_core_configure(u8 core);
71int sclp_core_deconfigure(u8 core);
Heiko Carstens05dd2532007-07-10 11:24:09 +020072int sclp_sdias_blk_count(void);
73int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
74int sclp_chp_configure(struct chp_id chpid);
75int sclp_chp_deconfigure(struct chp_id chpid);
76int sclp_chp_read_info(struct sclp_chp_info *info);
77void sclp_get_ipl_info(struct sclp_ipl_info *info);
Jan Glauber7441b062012-11-29 14:35:47 +010078int sclp_pci_configure(u32 fid);
79int sclp_pci_deconfigure(u32 fid);
Michael Holzheu6f79d332013-09-11 14:24:54 -070080int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode);
Michael Holzheu7b50da52013-11-13 10:38:27 +010081void sclp_early_detect(void);
Martin Schwidefsky22362a02015-07-08 10:20:04 +020082int _sclp_print_early(const char *);
Chen Gangfbf87df2015-01-03 17:29:07 +080083
Heiko Carstensab14de62007-02-05 21:18:37 +010084#endif /* _ASM_S390_SCLP_H */