Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/s390/kernel/early.c |
| 3 | * |
Hans-Joachim Picht | 155af2f | 2009-06-16 10:30:52 +0200 | [diff] [blame] | 4 | * Copyright IBM Corp. 2007, 2009 |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 5 | * Author(s): Hongjie Yang <hongjie@us.ibm.com>, |
| 6 | * Heiko Carstens <heiko.carstens@de.ibm.com> |
| 7 | */ |
| 8 | |
Christian Borntraeger | 92e6ecf | 2009-03-26 15:23:58 +0100 | [diff] [blame] | 9 | #include <linux/compiler.h> |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 10 | #include <linux/init.h> |
| 11 | #include <linux/errno.h> |
| 12 | #include <linux/string.h> |
| 13 | #include <linux/ctype.h> |
Heiko Carstens | dfd9f7a | 2009-06-12 10:26:44 +0200 | [diff] [blame] | 14 | #include <linux/ftrace.h> |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 15 | #include <linux/lockdep.h> |
| 16 | #include <linux/module.h> |
| 17 | #include <linux/pfn.h> |
| 18 | #include <linux/uaccess.h> |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 19 | #include <asm/ebcdic.h> |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 20 | #include <asm/ipl.h> |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 21 | #include <asm/lowcore.h> |
| 22 | #include <asm/processor.h> |
| 23 | #include <asm/sections.h> |
| 24 | #include <asm/setup.h> |
Christian Borntraeger | 92e6ecf | 2009-03-26 15:23:58 +0100 | [diff] [blame] | 25 | #include <asm/sysinfo.h> |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 26 | #include <asm/cpcmd.h> |
| 27 | #include <asm/sclp.h> |
Heiko Carstens | a806170 | 2008-04-17 07:46:26 +0200 | [diff] [blame] | 28 | #include "entry.h" |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 29 | |
| 30 | /* |
| 31 | * Create a Kernel NSS if the SAVESYS= parameter is defined |
| 32 | */ |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 33 | #define DEFSYS_CMD_SIZE 128 |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 34 | #define SAVESYS_CMD_SIZE 32 |
| 35 | |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 36 | char kernel_nss_name[NSS_NAME_SIZE + 1]; |
| 37 | |
Christian Ehrhardt | 25097bf | 2009-04-14 15:36:16 +0200 | [diff] [blame] | 38 | static unsigned long machine_flags; |
| 39 | |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 40 | static void __init setup_boot_command_line(void); |
| 41 | |
Martin Schwidefsky | b6112cc | 2009-04-14 15:36:28 +0200 | [diff] [blame] | 42 | /* |
| 43 | * Get the TOD clock running. |
| 44 | */ |
| 45 | static void __init reset_tod_clock(void) |
| 46 | { |
| 47 | u64 time; |
| 48 | |
| 49 | if (store_clock(&time) == 0) |
| 50 | return; |
| 51 | /* TOD clock not running. Set the clock to Unix Epoch. */ |
| 52 | if (set_clock(TOD_UNIX_EPOCH) != 0 || store_clock(&time) != 0) |
| 53 | disabled_wait(0); |
| 54 | |
| 55 | sched_clock_base_cc = TOD_UNIX_EPOCH; |
| 56 | } |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 57 | |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 58 | #ifdef CONFIG_SHARED_KERNEL |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 59 | int __init savesys_ipl_nss(char *cmd, const int cmdlen); |
| 60 | |
| 61 | asm( |
| 62 | " .section .init.text,\"ax\",@progbits\n" |
| 63 | " .align 4\n" |
| 64 | " .type savesys_ipl_nss, @function\n" |
| 65 | "savesys_ipl_nss:\n" |
| 66 | #ifdef CONFIG_64BIT |
| 67 | " stmg 6,15,48(15)\n" |
| 68 | " lgr 14,3\n" |
| 69 | " sam31\n" |
| 70 | " diag 2,14,0x8\n" |
| 71 | " sam64\n" |
| 72 | " lgr 2,14\n" |
| 73 | " lmg 6,15,48(15)\n" |
| 74 | #else |
| 75 | " stm 6,15,24(15)\n" |
| 76 | " lr 14,3\n" |
| 77 | " diag 2,14,0x8\n" |
| 78 | " lr 2,14\n" |
| 79 | " lm 6,15,24(15)\n" |
| 80 | #endif |
| 81 | " br 14\n" |
| 82 | " .size savesys_ipl_nss, .-savesys_ipl_nss\n"); |
| 83 | |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 84 | static noinline __init void create_kernel_nss(void) |
| 85 | { |
| 86 | unsigned int i, stext_pfn, eshared_pfn, end_pfn, min_size; |
| 87 | #ifdef CONFIG_BLK_DEV_INITRD |
| 88 | unsigned int sinitrd_pfn, einitrd_pfn; |
| 89 | #endif |
| 90 | int response; |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 91 | size_t len; |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 92 | char *savesys_ptr; |
| 93 | char upper_command_line[COMMAND_LINE_SIZE]; |
| 94 | char defsys_cmd[DEFSYS_CMD_SIZE]; |
| 95 | char savesys_cmd[SAVESYS_CMD_SIZE]; |
| 96 | |
| 97 | /* Do nothing if we are not running under VM */ |
| 98 | if (!MACHINE_IS_VM) |
| 99 | return; |
| 100 | |
| 101 | /* Convert COMMAND_LINE to upper case */ |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 102 | for (i = 0; i < strlen(boot_command_line); i++) |
| 103 | upper_command_line[i] = toupper(boot_command_line[i]); |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 104 | |
| 105 | savesys_ptr = strstr(upper_command_line, "SAVESYS="); |
| 106 | |
| 107 | if (!savesys_ptr) |
| 108 | return; |
| 109 | |
| 110 | savesys_ptr += 8; /* Point to the beginning of the NSS name */ |
| 111 | for (i = 0; i < NSS_NAME_SIZE; i++) { |
| 112 | if (savesys_ptr[i] == ' ' || savesys_ptr[i] == '\0') |
| 113 | break; |
| 114 | kernel_nss_name[i] = savesys_ptr[i]; |
| 115 | } |
| 116 | |
| 117 | stext_pfn = PFN_DOWN(__pa(&_stext)); |
| 118 | eshared_pfn = PFN_DOWN(__pa(&_eshared)); |
| 119 | end_pfn = PFN_UP(__pa(&_end)); |
| 120 | min_size = end_pfn << 2; |
| 121 | |
| 122 | sprintf(defsys_cmd, "DEFSYS %s 00000-%.5X EW %.5X-%.5X SR %.5X-%.5X", |
| 123 | kernel_nss_name, stext_pfn - 1, stext_pfn, eshared_pfn - 1, |
| 124 | eshared_pfn, end_pfn); |
| 125 | |
| 126 | #ifdef CONFIG_BLK_DEV_INITRD |
| 127 | if (INITRD_START && INITRD_SIZE) { |
| 128 | sinitrd_pfn = PFN_DOWN(__pa(INITRD_START)); |
| 129 | einitrd_pfn = PFN_UP(__pa(INITRD_START + INITRD_SIZE)); |
| 130 | min_size = einitrd_pfn << 2; |
| 131 | sprintf(defsys_cmd, "%s EW %.5X-%.5X", defsys_cmd, |
| 132 | sinitrd_pfn, einitrd_pfn); |
| 133 | } |
| 134 | #endif |
| 135 | |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 136 | sprintf(defsys_cmd, "%s EW MINSIZE=%.7iK PARMREGS=0-13", |
| 137 | defsys_cmd, min_size); |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 138 | sprintf(savesys_cmd, "SAVESYS %s \n IPL %s", |
| 139 | kernel_nss_name, kernel_nss_name); |
| 140 | |
| 141 | __cpcmd(defsys_cmd, NULL, 0, &response); |
| 142 | |
Hongjie Yang | 583b33b | 2008-03-05 12:37:16 +0100 | [diff] [blame] | 143 | if (response != 0) { |
| 144 | kernel_nss_name[0] = '\0'; |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 145 | return; |
Hongjie Yang | 583b33b | 2008-03-05 12:37:16 +0100 | [diff] [blame] | 146 | } |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 147 | |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 148 | len = strlen(savesys_cmd); |
| 149 | ASCEBC(savesys_cmd, len); |
| 150 | response = savesys_ipl_nss(savesys_cmd, len); |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 151 | |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 152 | /* On success: response is equal to the command size, |
| 153 | * max SAVESYS_CMD_SIZE |
| 154 | * On error: response contains the numeric portion of cp error message. |
| 155 | * for SAVESYS it will be >= 263 |
| 156 | */ |
| 157 | if (response > SAVESYS_CMD_SIZE) { |
Hongjie Yang | 583b33b | 2008-03-05 12:37:16 +0100 | [diff] [blame] | 158 | kernel_nss_name[0] = '\0'; |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 159 | return; |
Hongjie Yang | 583b33b | 2008-03-05 12:37:16 +0100 | [diff] [blame] | 160 | } |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 161 | |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 162 | /* re-setup boot command line with new ipl vm parms */ |
| 163 | ipl_update_parameters(); |
| 164 | setup_boot_command_line(); |
| 165 | |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 166 | ipl_flags = IPL_NSS_VALID; |
| 167 | } |
| 168 | |
| 169 | #else /* CONFIG_SHARED_KERNEL */ |
| 170 | |
| 171 | static inline void create_kernel_nss(void) { } |
| 172 | |
| 173 | #endif /* CONFIG_SHARED_KERNEL */ |
| 174 | |
| 175 | /* |
| 176 | * Clear bss memory |
| 177 | */ |
| 178 | static noinline __init void clear_bss_section(void) |
| 179 | { |
Heiko Carstens | 229d9c6 | 2007-02-21 10:55:29 +0100 | [diff] [blame] | 180 | memset(__bss_start, 0, __bss_stop - __bss_start); |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 181 | } |
| 182 | |
| 183 | /* |
| 184 | * Initialize storage key for kernel pages |
| 185 | */ |
| 186 | static noinline __init void init_kernel_storage_key(void) |
| 187 | { |
| 188 | unsigned long end_pfn, init_pfn; |
| 189 | |
| 190 | end_pfn = PFN_UP(__pa(&_end)); |
| 191 | |
| 192 | for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++) |
| 193 | page_set_storage_key(init_pfn << PAGE_SHIFT, PAGE_DEFAULT_KEY); |
| 194 | } |
| 195 | |
Christian Borntraeger | 92e6ecf | 2009-03-26 15:23:58 +0100 | [diff] [blame] | 196 | static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE); |
| 197 | |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 198 | static noinline __init void detect_machine_type(void) |
| 199 | { |
Christian Borntraeger | 92e6ecf | 2009-03-26 15:23:58 +0100 | [diff] [blame] | 200 | /* No VM information? Looks like LPAR */ |
| 201 | if (stsi(&vmms, 3, 2, 2) == -ENOSYS) |
| 202 | return; |
| 203 | if (!vmms.count) |
| 204 | return; |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 205 | |
Christian Borntraeger | 92e6ecf | 2009-03-26 15:23:58 +0100 | [diff] [blame] | 206 | /* Running under KVM? If not we assume z/VM */ |
| 207 | if (!memcmp(vmms.vm[0].cpi, "\xd2\xe5\xd4", 3)) |
Heiko Carstens | 2e5061e | 2008-04-30 13:38:45 +0200 | [diff] [blame] | 208 | machine_flags |= MACHINE_FLAG_KVM; |
Christian Borntraeger | 92e6ecf | 2009-03-26 15:23:58 +0100 | [diff] [blame] | 209 | else |
| 210 | machine_flags |= MACHINE_FLAG_VM; |
Hendrik Brueckner | 677c1dd | 2009-08-07 10:39:24 +0200 | [diff] [blame] | 211 | |
| 212 | /* Store machine flags for setting up lowcore early */ |
| 213 | S390_lowcore.machine_flags = machine_flags; |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 214 | } |
| 215 | |
Heiko Carstens | 5f954c3 | 2009-07-24 12:39:49 +0200 | [diff] [blame] | 216 | static __init void early_pgm_check_handler(void) |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 217 | { |
| 218 | unsigned long addr; |
| 219 | const struct exception_table_entry *fixup; |
| 220 | |
| 221 | addr = S390_lowcore.program_old_psw.addr; |
| 222 | fixup = search_exception_tables(addr & PSW_ADDR_INSN); |
| 223 | if (!fixup) |
| 224 | disabled_wait(0); |
| 225 | S390_lowcore.program_old_psw.addr = fixup->fixup | PSW_ADDR_AMODE; |
| 226 | } |
| 227 | |
Heiko Carstens | 5f954c3 | 2009-07-24 12:39:49 +0200 | [diff] [blame] | 228 | static noinline __init void setup_lowcore_early(void) |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 229 | { |
| 230 | psw_t psw; |
| 231 | |
| 232 | psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY; |
| 233 | psw.addr = PSW_ADDR_AMODE | (unsigned long) s390_base_ext_handler; |
| 234 | S390_lowcore.external_new_psw = psw; |
| 235 | psw.addr = PSW_ADDR_AMODE | (unsigned long) s390_base_pgm_handler; |
| 236 | S390_lowcore.program_new_psw = psw; |
| 237 | s390_base_pgm_handler_fn = early_pgm_check_handler; |
| 238 | } |
| 239 | |
Gerald Schaefer | 53492b1 | 2008-04-30 13:38:46 +0200 | [diff] [blame] | 240 | static noinline __init void setup_hpage(void) |
| 241 | { |
| 242 | #ifndef CONFIG_DEBUG_PAGEALLOC |
| 243 | unsigned int facilities; |
| 244 | |
| 245 | facilities = stfl(); |
| 246 | if (!(facilities & (1UL << 23)) || !(facilities & (1UL << 29))) |
| 247 | return; |
| 248 | machine_flags |= MACHINE_FLAG_HPAGE; |
| 249 | __ctl_set_bit(0, 23); |
| 250 | #endif |
| 251 | } |
| 252 | |
Heiko Carstens | 2e5061e | 2008-04-30 13:38:45 +0200 | [diff] [blame] | 253 | static __init void detect_mvpg(void) |
| 254 | { |
| 255 | #ifndef CONFIG_64BIT |
| 256 | int rc; |
| 257 | |
| 258 | asm volatile( |
| 259 | " la 0,0\n" |
| 260 | " mvpg %2,%2\n" |
| 261 | "0: la %0,0\n" |
| 262 | "1:\n" |
| 263 | EX_TABLE(0b,1b) |
| 264 | : "=d" (rc) : "0" (-EOPNOTSUPP), "a" (0) : "memory", "cc", "0"); |
| 265 | if (!rc) |
| 266 | machine_flags |= MACHINE_FLAG_MVPG; |
| 267 | #endif |
| 268 | } |
| 269 | |
| 270 | static __init void detect_ieee(void) |
| 271 | { |
| 272 | #ifndef CONFIG_64BIT |
| 273 | int rc, tmp; |
| 274 | |
| 275 | asm volatile( |
| 276 | " efpc %1,0\n" |
| 277 | "0: la %0,0\n" |
| 278 | "1:\n" |
| 279 | EX_TABLE(0b,1b) |
| 280 | : "=d" (rc), "=d" (tmp): "0" (-EOPNOTSUPP) : "cc"); |
| 281 | if (!rc) |
| 282 | machine_flags |= MACHINE_FLAG_IEEE; |
| 283 | #endif |
| 284 | } |
| 285 | |
| 286 | static __init void detect_csp(void) |
| 287 | { |
| 288 | #ifndef CONFIG_64BIT |
| 289 | int rc; |
| 290 | |
| 291 | asm volatile( |
| 292 | " la 0,0\n" |
| 293 | " la 1,0\n" |
| 294 | " la 2,4\n" |
| 295 | " csp 0,2\n" |
| 296 | "0: la %0,0\n" |
| 297 | "1:\n" |
| 298 | EX_TABLE(0b,1b) |
| 299 | : "=d" (rc) : "0" (-EOPNOTSUPP) : "cc", "0", "1", "2"); |
| 300 | if (!rc) |
| 301 | machine_flags |= MACHINE_FLAG_CSP; |
| 302 | #endif |
| 303 | } |
| 304 | |
| 305 | static __init void detect_diag9c(void) |
| 306 | { |
| 307 | unsigned int cpu_address; |
| 308 | int rc; |
| 309 | |
| 310 | cpu_address = stap(); |
| 311 | asm volatile( |
| 312 | " diag %2,0,0x9c\n" |
| 313 | "0: la %0,0\n" |
| 314 | "1:\n" |
| 315 | EX_TABLE(0b,1b) |
| 316 | : "=d" (rc) : "0" (-EOPNOTSUPP), "d" (cpu_address) : "cc"); |
| 317 | if (!rc) |
| 318 | machine_flags |= MACHINE_FLAG_DIAG9C; |
| 319 | } |
| 320 | |
| 321 | static __init void detect_diag44(void) |
| 322 | { |
| 323 | #ifdef CONFIG_64BIT |
| 324 | int rc; |
| 325 | |
| 326 | asm volatile( |
| 327 | " diag 0,0,0x44\n" |
| 328 | "0: la %0,0\n" |
| 329 | "1:\n" |
| 330 | EX_TABLE(0b,1b) |
| 331 | : "=d" (rc) : "0" (-EOPNOTSUPP) : "cc"); |
| 332 | if (!rc) |
| 333 | machine_flags |= MACHINE_FLAG_DIAG44; |
| 334 | #endif |
| 335 | } |
| 336 | |
| 337 | static __init void detect_machine_facilities(void) |
| 338 | { |
| 339 | #ifdef CONFIG_64BIT |
| 340 | unsigned int facilities; |
| 341 | |
| 342 | facilities = stfl(); |
| 343 | if (facilities & (1 << 28)) |
| 344 | machine_flags |= MACHINE_FLAG_IDTE; |
Gerald Schaefer | 53492b1 | 2008-04-30 13:38:46 +0200 | [diff] [blame] | 345 | if (facilities & (1 << 23)) |
| 346 | machine_flags |= MACHINE_FLAG_PFMF; |
Heiko Carstens | 2e5061e | 2008-04-30 13:38:45 +0200 | [diff] [blame] | 347 | if (facilities & (1 << 4)) |
| 348 | machine_flags |= MACHINE_FLAG_MVCOS; |
| 349 | #endif |
| 350 | } |
| 351 | |
Heiko Carstens | 761cdf6 | 2008-07-14 09:58:55 +0200 | [diff] [blame] | 352 | static __init void rescue_initrd(void) |
| 353 | { |
| 354 | #ifdef CONFIG_BLK_DEV_INITRD |
| 355 | /* |
| 356 | * Move the initrd right behind the bss section in case it starts |
| 357 | * within the bss section. So we don't overwrite it when the bss |
| 358 | * section gets cleared. |
| 359 | */ |
| 360 | if (!INITRD_START || !INITRD_SIZE) |
| 361 | return; |
| 362 | if (INITRD_START >= (unsigned long) __bss_stop) |
| 363 | return; |
| 364 | memmove(__bss_stop, (void *) INITRD_START, INITRD_SIZE); |
| 365 | INITRD_START = (unsigned long) __bss_stop; |
| 366 | #endif |
| 367 | } |
| 368 | |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 369 | /* Set up boot command line */ |
| 370 | static void __init setup_boot_command_line(void) |
| 371 | { |
| 372 | char *parm = NULL; |
| 373 | |
| 374 | /* copy arch command line */ |
| 375 | strlcpy(boot_command_line, COMMAND_LINE, ARCH_COMMAND_LINE_SIZE); |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 376 | |
| 377 | /* append IPL PARM data to the boot command line */ |
| 378 | if (MACHINE_IS_VM) { |
| 379 | parm = boot_command_line + strlen(boot_command_line); |
| 380 | *parm++ = ' '; |
| 381 | get_ipl_vmparm(parm); |
| 382 | if (parm[0] == '=') |
| 383 | memmove(boot_command_line, parm + 1, strlen(parm)); |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 388 | /* |
| 389 | * Save ipl parameters, clear bss memory, initialize storage keys |
| 390 | * and create a kernel NSS at startup if the SAVESYS= parm is defined |
| 391 | */ |
| 392 | void __init startup_init(void) |
| 393 | { |
Martin Schwidefsky | b6112cc | 2009-04-14 15:36:28 +0200 | [diff] [blame] | 394 | reset_tod_clock(); |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 395 | ipl_save_parameters(); |
Heiko Carstens | 761cdf6 | 2008-07-14 09:58:55 +0200 | [diff] [blame] | 396 | rescue_initrd(); |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 397 | clear_bss_section(); |
| 398 | init_kernel_storage_key(); |
| 399 | lockdep_init(); |
| 400 | lockdep_off(); |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 401 | sort_main_extable(); |
| 402 | setup_lowcore_early(); |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 403 | detect_machine_type(); |
| 404 | ipl_update_parameters(); |
| 405 | setup_boot_command_line(); |
| 406 | create_kernel_nss(); |
Heiko Carstens | 2e5061e | 2008-04-30 13:38:45 +0200 | [diff] [blame] | 407 | detect_mvpg(); |
| 408 | detect_ieee(); |
| 409 | detect_csp(); |
| 410 | detect_diag9c(); |
| 411 | detect_diag44(); |
| 412 | detect_machine_facilities(); |
Gerald Schaefer | 53492b1 | 2008-04-30 13:38:46 +0200 | [diff] [blame] | 413 | setup_hpage(); |
Heiko Carstens | 83119ad | 2007-07-10 11:24:10 +0200 | [diff] [blame] | 414 | sclp_facilities_detect(); |
Heiko Carstens | 23d1742 | 2008-07-14 09:59:21 +0200 | [diff] [blame] | 415 | detect_memory_layout(memory_chunk); |
Christian Ehrhardt | 25097bf | 2009-04-14 15:36:16 +0200 | [diff] [blame] | 416 | S390_lowcore.machine_flags = machine_flags; |
Heiko Carstens | dfd9f7a | 2009-06-12 10:26:44 +0200 | [diff] [blame] | 417 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 418 | S390_lowcore.ftrace_func = (unsigned long)ftrace_caller; |
| 419 | #endif |
Heiko Carstens | ab14de6 | 2007-02-05 21:18:37 +0100 | [diff] [blame] | 420 | lockdep_on(); |
| 421 | } |