Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 1 | /* |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 2 | * 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 Oberparleiter | e5854a5 | 2007-04-27 16:01:31 +0200 | [diff] [blame] | 10 | #include <asm/chpid.h> |
Heiko Carstens | 9c09523 | 2013-11-30 12:00:28 +0100 | [diff] [blame] | 11 | #include <asm/cpu.h> |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 12 | |
Peter Oberparleiter | e5854a5 | 2007-04-27 16:01:31 +0200 | [diff] [blame] | 13 | #define SCLP_CHP_INFO_MASK_SIZE 32 |
Martin Schwidefsky | d08d943 | 2015-06-18 14:23:00 +0200 | [diff] [blame] | 14 | #define SCLP_MAX_CORES 256 |
Peter Oberparleiter | e5854a5 | 2007-04-27 16:01:31 +0200 | [diff] [blame] | 15 | |
| 16 | struct 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 Carstens | 05dd253 | 2007-07-10 11:24:09 +0200 | [diff] [blame] | 22 | #define LOADPARM_LEN 8 |
| 23 | |
| 24 | struct sclp_ipl_info { |
| 25 | int is_valid; |
| 26 | int has_dump; |
| 27 | char loadparm[LOADPARM_LEN]; |
| 28 | }; |
| 29 | |
Martin Schwidefsky | d08d943 | 2015-06-18 14:23:00 +0200 | [diff] [blame] | 30 | struct sclp_core_entry { |
Martin Schwidefsky | 10ad34b | 2015-01-14 17:52:10 +0100 | [diff] [blame] | 31 | u8 core_id; |
David Hildenbrand | 8dfd523 | 2015-02-24 15:51:55 +0100 | [diff] [blame] | 32 | u8 reserved0; |
| 33 | u8 : 4; |
| 34 | u8 sief2 : 1; |
| 35 | u8 : 3; |
Heiko Carstens | 217a440 | 2013-12-30 12:54:14 +0100 | [diff] [blame] | 36 | u8 : 3; |
| 37 | u8 siif : 1; |
David Hildenbrand | d614be0 | 2014-10-14 12:11:02 +0200 | [diff] [blame] | 38 | u8 sigpif : 1; |
| 39 | u8 : 3; |
Heiko Carstens | 217a440 | 2013-12-30 12:54:14 +0100 | [diff] [blame] | 40 | u8 reserved2[10]; |
Heiko Carstens | 08d0796 | 2008-01-26 14:10:56 +0100 | [diff] [blame] | 41 | u8 type; |
| 42 | u8 reserved1; |
| 43 | } __attribute__((packed)); |
| 44 | |
Martin Schwidefsky | d08d943 | 2015-06-18 14:23:00 +0200 | [diff] [blame] | 45 | struct sclp_core_info { |
Heiko Carstens | 08d0796 | 2008-01-26 14:10:56 +0100 | [diff] [blame] | 46 | unsigned int configured; |
| 47 | unsigned int standby; |
| 48 | unsigned int combined; |
Martin Schwidefsky | d08d943 | 2015-06-18 14:23:00 +0200 | [diff] [blame] | 49 | struct sclp_core_entry core[SCLP_MAX_CORES]; |
Heiko Carstens | 08d0796 | 2008-01-26 14:10:56 +0100 | [diff] [blame] | 50 | }; |
| 51 | |
David Hildenbrand | 37c5f6c | 2015-05-06 13:18:59 +0200 | [diff] [blame] | 52 | struct 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 Schwidefsky | d08d943 | 2015-06-18 14:23:00 +0200 | [diff] [blame] | 57 | unsigned char has_core_type : 1; |
David Hildenbrand | 37c5f6c | 2015-05-06 13:18:59 +0200 | [diff] [blame] | 58 | unsigned char has_sprp : 1; |
Eugene (jno) Dvurechenski | f7ba1d3 | 2014-10-09 16:04:48 +0200 | [diff] [blame] | 59 | unsigned char has_hvs : 1; |
| 60 | unsigned char has_esca : 1; |
David Hildenbrand | 8dfd523 | 2015-02-24 15:51:55 +0100 | [diff] [blame] | 61 | unsigned char has_sief2 : 1; |
David Hildenbrand | 37c5f6c | 2015-05-06 13:18:59 +0200 | [diff] [blame] | 62 | 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 Schwidefsky | d08d943 | 2015-06-18 14:23:00 +0200 | [diff] [blame] | 69 | unsigned int max_cores; |
David Hildenbrand | 37c5f6c | 2015-05-06 13:18:59 +0200 | [diff] [blame] | 70 | unsigned long hsa_size; |
David Hildenbrand | 78335a3 | 2015-05-06 09:17:51 +0200 | [diff] [blame] | 71 | unsigned long long facilities; |
David Hildenbrand | 37c5f6c | 2015-05-06 13:18:59 +0200 | [diff] [blame] | 72 | }; |
| 73 | extern struct sclp_info sclp; |
| 74 | |
Martin Schwidefsky | d08d943 | 2015-06-18 14:23:00 +0200 | [diff] [blame] | 75 | int sclp_get_core_info(struct sclp_core_info *info); |
| 76 | int sclp_core_configure(u8 core); |
| 77 | int sclp_core_deconfigure(u8 core); |
Heiko Carstens | 05dd253 | 2007-07-10 11:24:09 +0200 | [diff] [blame] | 78 | int sclp_sdias_blk_count(void); |
| 79 | int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); |
| 80 | int sclp_chp_configure(struct chp_id chpid); |
| 81 | int sclp_chp_deconfigure(struct chp_id chpid); |
| 82 | int sclp_chp_read_info(struct sclp_chp_info *info); |
| 83 | void sclp_get_ipl_info(struct sclp_ipl_info *info); |
Jan Glauber | 7441b06 | 2012-11-29 14:35:47 +0100 | [diff] [blame] | 84 | int sclp_pci_configure(u32 fid); |
| 85 | int sclp_pci_deconfigure(u32 fid); |
Michael Holzheu | 6f79d33 | 2013-09-11 14:24:54 -0700 | [diff] [blame] | 86 | int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode); |
Michael Holzheu | 7b50da5 | 2013-11-13 10:38:27 +0100 | [diff] [blame] | 87 | void sclp_early_detect(void); |
Martin Schwidefsky | 22362a0 | 2015-07-08 10:20:04 +0200 | [diff] [blame] | 88 | int _sclp_print_early(const char *); |
Chen Gang | fbf87df | 2015-01-03 17:29:07 +0800 | [diff] [blame] | 89 | |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 90 | #endif /* _ASM_S390_SCLP_H */ |