diff options
Diffstat (limited to 'drivers/s390/cio/cio.c')
| -rw-r--r-- | drivers/s390/cio/cio.c | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 9cb129ab5be5..21af446c1f2d 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
| @@ -1048,37 +1048,19 @@ void reipl_ccw_dev(struct ccw_dev_id *devid) | |||
| 1048 | do_reipl_asm(*((__u32*)&schid)); | 1048 | do_reipl_asm(*((__u32*)&schid)); |
| 1049 | } | 1049 | } |
| 1050 | 1050 | ||
| 1051 | static struct schib __initdata ipl_schib; | 1051 | int __init cio_get_iplinfo(struct cio_iplinfo *iplinfo) |
| 1052 | |||
| 1053 | /* | ||
| 1054 | * ipl_save_parameters gets called very early. It is not allowed to access | ||
| 1055 | * anything in the bss section at all. The bss section is not cleared yet, | ||
| 1056 | * but may contain some ipl parameters written by the firmware. | ||
| 1057 | * These parameters (if present) are copied to 0x2000. | ||
| 1058 | * To avoid corruption of the ipl parameters, all variables used by this | ||
| 1059 | * function must reside on the stack or in the data section. | ||
| 1060 | */ | ||
| 1061 | void ipl_save_parameters(void) | ||
| 1062 | { | 1052 | { |
| 1063 | struct subchannel_id schid; | 1053 | struct subchannel_id schid; |
| 1064 | unsigned int *ipl_ptr; | 1054 | struct schib schib; |
| 1065 | void *src, *dst; | ||
| 1066 | 1055 | ||
| 1067 | schid = *(struct subchannel_id *)__LC_SUBCHANNEL_ID; | 1056 | schid = *(struct subchannel_id *)__LC_SUBCHANNEL_ID; |
| 1068 | if (!schid.one) | 1057 | if (!schid.one) |
| 1069 | return; | 1058 | return -ENODEV; |
| 1070 | if (stsch(schid, &ipl_schib)) | 1059 | if (stsch(schid, &schib)) |
| 1071 | return; | 1060 | return -ENODEV; |
| 1072 | if (!ipl_schib.pmcw.dnv) | 1061 | if (!schib.pmcw.dnv) |
| 1073 | return; | 1062 | return -ENODEV; |
| 1074 | ipl_devno = ipl_schib.pmcw.dev; | 1063 | iplinfo->devno = schib.pmcw.dev; |
| 1075 | ipl_flags |= IPL_DEVNO_VALID; | 1064 | iplinfo->is_qdio = schib.pmcw.qf; |
| 1076 | if (!ipl_schib.pmcw.qf) | 1065 | return 0; |
| 1077 | return; | ||
| 1078 | ipl_flags |= IPL_PARMBLOCK_VALID; | ||
| 1079 | ipl_ptr = (unsigned int *)__LC_IPL_PARMBLOCK_PTR; | ||
| 1080 | src = (void *)(unsigned long)*ipl_ptr; | ||
| 1081 | dst = (void *)IPL_PARMBLOCK_ORIGIN; | ||
| 1082 | memmove(dst, src, PAGE_SIZE); | ||
| 1083 | *ipl_ptr = IPL_PARMBLOCK_ORIGIN; | ||
| 1084 | } | 1066 | } |
