Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-s390/setup.h |
| 3 | * |
| 4 | * S390 version |
| 5 | * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation |
| 6 | */ |
| 7 | |
| 8 | #ifndef _ASM_S390_SETUP_H |
| 9 | #define _ASM_S390_SETUP_H |
| 10 | |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame^] | 11 | #include <asm/types.h> |
| 12 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #define PARMAREA 0x10400 |
| 14 | #define COMMAND_LINE_SIZE 896 |
| 15 | #define RAMDISK_ORIGIN 0x800000 |
| 16 | #define RAMDISK_SIZE 0x800000 |
| 17 | #define MEMORY_CHUNKS 16 /* max 0x7fff */ |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame^] | 18 | #define IPL_PARMBLOCK_ORIGIN 0x2000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
| 20 | #ifndef __ASSEMBLY__ |
| 21 | |
| 22 | #ifndef __s390x__ |
| 23 | #define IPL_DEVICE (*(unsigned long *) (0x10404)) |
| 24 | #define INITRD_START (*(unsigned long *) (0x1040C)) |
| 25 | #define INITRD_SIZE (*(unsigned long *) (0x10414)) |
| 26 | #else /* __s390x__ */ |
| 27 | #define IPL_DEVICE (*(unsigned long *) (0x10400)) |
| 28 | #define INITRD_START (*(unsigned long *) (0x10408)) |
| 29 | #define INITRD_SIZE (*(unsigned long *) (0x10410)) |
| 30 | #endif /* __s390x__ */ |
| 31 | #define COMMAND_LINE ((char *) (0x10480)) |
| 32 | |
| 33 | /* |
| 34 | * Machine features detected in head.S |
| 35 | */ |
| 36 | extern unsigned long machine_flags; |
| 37 | |
| 38 | #define MACHINE_IS_VM (machine_flags & 1) |
| 39 | #define MACHINE_IS_P390 (machine_flags & 4) |
| 40 | #define MACHINE_HAS_MVPG (machine_flags & 16) |
| 41 | #define MACHINE_HAS_DIAG44 (machine_flags & 32) |
| 42 | #define MACHINE_HAS_IDTE (machine_flags & 128) |
| 43 | |
| 44 | #ifndef __s390x__ |
| 45 | #define MACHINE_HAS_IEEE (machine_flags & 2) |
| 46 | #define MACHINE_HAS_CSP (machine_flags & 8) |
| 47 | #else /* __s390x__ */ |
| 48 | #define MACHINE_HAS_IEEE (1) |
| 49 | #define MACHINE_HAS_CSP (1) |
| 50 | #endif /* __s390x__ */ |
| 51 | |
| 52 | |
| 53 | #define MACHINE_HAS_SCLP (!MACHINE_IS_P390) |
| 54 | |
| 55 | /* |
| 56 | * Console mode. Override with conmode= |
| 57 | */ |
| 58 | extern unsigned int console_mode; |
| 59 | extern unsigned int console_devno; |
| 60 | extern unsigned int console_irq; |
| 61 | |
| 62 | #define CONSOLE_IS_UNDEFINED (console_mode == 0) |
| 63 | #define CONSOLE_IS_SCLP (console_mode == 1) |
| 64 | #define CONSOLE_IS_3215 (console_mode == 2) |
| 65 | #define CONSOLE_IS_3270 (console_mode == 3) |
| 66 | #define SET_CONSOLE_SCLP do { console_mode = 1; } while (0) |
| 67 | #define SET_CONSOLE_3215 do { console_mode = 2; } while (0) |
| 68 | #define SET_CONSOLE_3270 do { console_mode = 3; } while (0) |
| 69 | |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame^] | 70 | struct ipl_list_header { |
| 71 | u32 length; |
| 72 | u8 reserved[3]; |
| 73 | u8 version; |
| 74 | } __attribute__((packed)); |
| 75 | |
| 76 | struct ipl_block_fcp { |
| 77 | u32 length; |
| 78 | u8 pbt; |
| 79 | u8 reserved1[322-1]; |
| 80 | u16 devno; |
| 81 | u8 reserved2[4]; |
| 82 | u64 wwpn; |
| 83 | u64 lun; |
| 84 | u32 bootprog; |
| 85 | u8 reserved3[12]; |
| 86 | u64 br_lba; |
| 87 | u32 scp_data_len; |
| 88 | u8 reserved4[260]; |
| 89 | u8 scp_data[]; |
| 90 | } __attribute__((packed)); |
| 91 | |
| 92 | struct ipl_parameter_block { |
| 93 | union { |
| 94 | u32 length; |
| 95 | struct ipl_list_header header; |
| 96 | } hdr; |
| 97 | struct ipl_block_fcp fcp; |
| 98 | } __attribute__((packed)); |
| 99 | |
| 100 | #define IPL_MAX_SUPPORTED_VERSION (0) |
| 101 | |
| 102 | #define IPL_TYPE_FCP (0) |
| 103 | |
| 104 | /* |
| 105 | * IPL validity flags and parameters as detected in head.S |
| 106 | */ |
| 107 | extern u32 ipl_parameter_flags; |
| 108 | extern u16 ipl_devno; |
| 109 | |
| 110 | #define IPL_DEVNO_VALID (ipl_parameter_flags & 1) |
| 111 | #define IPL_PARMBLOCK_VALID (ipl_parameter_flags & 2) |
| 112 | |
| 113 | #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ |
| 114 | IPL_PARMBLOCK_ORIGIN) |
| 115 | #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.length) |
| 116 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | #else |
| 118 | |
| 119 | #ifndef __s390x__ |
| 120 | #define IPL_DEVICE 0x10404 |
| 121 | #define INITRD_START 0x1040C |
| 122 | #define INITRD_SIZE 0x10414 |
| 123 | #else /* __s390x__ */ |
| 124 | #define IPL_DEVICE 0x10400 |
| 125 | #define INITRD_START 0x10408 |
| 126 | #define INITRD_SIZE 0x10410 |
| 127 | #endif /* __s390x__ */ |
| 128 | #define COMMAND_LINE 0x10480 |
| 129 | |
| 130 | #endif |
| 131 | |
| 132 | #endif |