7 #define KMSG_COMPONENT "setup"
8 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
10 #include <linux/compiler.h>
12 #include <linux/errno.h>
13 #include <linux/string.h>
14 #include <linux/ctype.h>
17 #include <linux/module.h>
20 #include <linux/kernel.h>
24 #include <asm/processor.h>
25 #include <asm/sections.h>
26 #include <asm/setup.h>
27 #include <asm/sysinfo.h>
36 #define DEFSYS_CMD_SIZE 128
37 #define SAVESYS_CMD_SIZE 32
41 static void __init setup_boot_command_line(
void);
46 static void __init reset_tod_clock(
void)
50 if (store_clock(&time) == 0)
60 #ifdef CONFIG_SHARED_KERNEL
61 int __init savesys_ipl_nss(
char *
cmd,
const int cmdlen);
64 " .section .init.text,\"ax\",@progbits\n"
66 " .type savesys_ipl_nss, @function\n"
84 " .size savesys_ipl_nss, .-savesys_ipl_nss\n"
91 unsigned int i, stext_pfn, eshared_pfn, end_pfn, min_size;
92 #ifdef CONFIG_BLK_DEV_INITRD
93 unsigned int sinitrd_pfn, einitrd_pfn;
110 savesys_ptr =
strstr(upper_command_line,
"SAVESYS=");
117 if (savesys_ptr[i] ==
' ' || savesys_ptr[i] ==
'\0')
125 min_size = end_pfn << 2;
128 "DEFSYS %s 00000-%.5X EW %.5X-%.5X SR %.5X-%.5X",
130 eshared_pfn - 1, eshared_pfn, end_pfn);
132 #ifdef CONFIG_BLK_DEV_INITRD
136 min_size = einitrd_pfn << 2;
138 " EW %.5X-%.5X", sinitrd_pfn, einitrd_pfn);
143 " EW MINSIZE=%.7iK PARMREGS=0-13", min_size);
152 pr_err(
"Defining the Linux kernel NSS failed with rc=%d\n",
158 len =
strlen(savesys_cmd);
160 response = savesys_ipl_nss(savesys_cmd, len);
169 pr_err(
"Saving the Linux kernel NSS failed with rc=%d\n",
181 asm volatile(
"SPT 0(%0)" : :
"a" (&
S390_lowcore.last_update_timer));
185 setup_boot_command_line();
192 static inline void create_kernel_nss(
void) { }
201 memset(__bss_start, 0, __bss_stop - __bss_start);
209 unsigned long end_pfn, init_pfn;
213 for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++)
234 if (!
memcmp(vmms->
vm[0].cpi,
"\xd2\xe5\xd4", 3))
240 static __init void setup_topology(
void)
245 if (!test_facility(11))
248 for (max_mnest = 6; max_mnest > 1; max_mnest--) {
249 if (
stsi(&sysinfo_page, 15, 1, max_mnest) == 0)
256 static void early_pgm_check_handler(
void)
286 static __init void detect_mvpg(
void)
297 :
"=d" (rc) :
"0" (-
EOPNOTSUPP),
"a" (0) :
"memory",
"cc",
"0");
303 static __init void detect_ieee(
void)
313 :
"=d" (rc),
"=d" (tmp):
"0" (-
EOPNOTSUPP) :
"cc");
319 static __init void detect_csp(
void)
332 :
"=d" (rc) :
"0" (-
EOPNOTSUPP) :
"cc",
"0",
"1",
"2");
338 static __init void detect_diag9c(
void)
340 unsigned int cpu_address;
343 cpu_address = stap();
349 :
"=d" (rc) :
"0" (-
EOPNOTSUPP),
"d" (cpu_address) :
"cc");
354 static __init void detect_diag44(
void)
370 static __init void detect_machine_facilities(
void)
373 if (test_facility(8)) {
377 if (test_facility(78))
379 if (test_facility(3))
381 if (test_facility(27))
383 if (test_facility(40))
385 if (test_facility(50) && test_facility(73))
387 if (test_facility(66))
392 static __init void rescue_initrd(
void)
394 #ifdef CONFIG_BLK_DEV_INITRD
395 unsigned long min_initrd_addr = (
unsigned long) _end + (4
UL << 20);
412 static void __init append_to_cmdline(
size_t (*ipl_data)(
char *,
size_t))
431 static inline int has_ebcdic_char(
const char *
str)
435 for (i = 0; str[
i]; i++)
441 static void __init setup_boot_command_line(
void)
468 init_kernel_storage_key();
471 setup_lowcore_early();
472 setup_facility_list();
473 detect_machine_type();
475 setup_boot_command_line();
482 detect_machine_facilities();
486 #ifdef CONFIG_DYNAMIC_FTRACE