aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2007-04-27 10:01:25 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-04-27 10:01:38 -0400
commit6fc321fd7dd91f0592f37503219196835314fbb7 (patch)
treed512811f8f6761608829c8df44a55a2ada074cdc
parent29c380f5f06d0c5a320b9bb6f8987065e7b81c91 (diff)
[S390] cio/ipl: Clean interface between cio and ipl code.
Clean interface between cio and ipl code, so Peter stops complaining. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
-rw-r--r--arch/s390/kernel/ipl.c23
-rw-r--r--drivers/s390/cio/cio.c38
-rw-r--r--include/asm-s390/cio.h7
-rw-r--r--include/asm-s390/ipl.h3
4 files changed, 40 insertions, 31 deletions
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index f731185bf2bd..a83cf1fdd8f5 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -47,7 +47,7 @@ enum ipl_type {
47 * Must be in data section since the bss section 47 * Must be in data section since the bss section
48 * is not cleared when these are accessed. 48 * is not cleared when these are accessed.
49 */ 49 */
50u16 ipl_devno __attribute__((__section__(".data"))) = 0; 50static u16 ipl_devno __attribute__((__section__(".data"))) = 0;
51u32 ipl_flags __attribute__((__section__(".data"))) = 0; 51u32 ipl_flags __attribute__((__section__(".data"))) = 0;
52 52
53static char *ipl_type_str(enum ipl_type type) 53static char *ipl_type_str(enum ipl_type type)
@@ -1038,6 +1038,27 @@ static int __init s390_ipl_init(void)
1038 1038
1039__initcall(s390_ipl_init); 1039__initcall(s390_ipl_init);
1040 1040
1041void __init ipl_save_parameters(void)
1042{
1043 struct cio_iplinfo iplinfo;
1044 unsigned int *ipl_ptr;
1045 void *src, *dst;
1046
1047 if (cio_get_iplinfo(&iplinfo))
1048 return;
1049
1050 ipl_devno = iplinfo.devno;
1051 ipl_flags |= IPL_DEVNO_VALID;
1052 if (!iplinfo.is_qdio)
1053 return;
1054 ipl_flags |= IPL_PARMBLOCK_VALID;
1055 ipl_ptr = (unsigned int *)__LC_IPL_PARMBLOCK_PTR;
1056 src = (void *)(unsigned long)*ipl_ptr;
1057 dst = (void *)IPL_PARMBLOCK_ORIGIN;
1058 memmove(dst, src, PAGE_SIZE);
1059 *ipl_ptr = IPL_PARMBLOCK_ORIGIN;
1060}
1061
1041static LIST_HEAD(rcall); 1062static LIST_HEAD(rcall);
1042static DEFINE_MUTEX(rcall_mutex); 1063static DEFINE_MUTEX(rcall_mutex);
1043 1064
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
1051static struct schib __initdata ipl_schib; 1051int __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 */
1061void 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}
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h
index d92785030980..0db017bc7d09 100644
--- a/include/asm-s390/cio.h
+++ b/include/asm-s390/cio.h
@@ -292,6 +292,13 @@ extern void css_schedule_reprobe(void);
292 292
293extern void reipl_ccw_dev(struct ccw_dev_id *id); 293extern void reipl_ccw_dev(struct ccw_dev_id *id);
294 294
295struct cio_iplinfo {
296 u16 devno;
297 int is_qdio;
298};
299
300extern int cio_get_iplinfo(struct cio_iplinfo *iplinfo);
301
295#endif 302#endif
296 303
297#endif 304#endif
diff --git a/include/asm-s390/ipl.h b/include/asm-s390/ipl.h
index 0eb64083480a..15bb0b529551 100644
--- a/include/asm-s390/ipl.h
+++ b/include/asm-s390/ipl.h
@@ -74,10 +74,9 @@ struct ipl_parameter_block {
74} __attribute__((packed)); 74} __attribute__((packed));
75 75
76/* 76/*
77 * IPL validity flags and parameters as detected in head.S 77 * IPL validity flags
78 */ 78 */
79extern u32 ipl_flags; 79extern u32 ipl_flags;
80extern u16 ipl_devno;
81 80
82extern u32 dump_prefix_page; 81extern u32 dump_prefix_page;
83extern void do_reipl(void); 82extern void do_reipl(void);