summaryrefslogtreecommitdiffstats
path: root/drivers/s390/char
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2018-04-11 11:56:55 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-10-09 11:21:08 +0200
commit6966d604e2ec4ecf5691aea953538f63597a250d (patch)
treebb97b41e8ee7ead33cb952f690820f13d4dd8ab6 /drivers/s390/char
parent17aacfbfa1ae386d3e54d12a13b88b7981e04896 (diff)
downloadblackbird-obmc-linux-6966d604e2ec4ecf5691aea953538f63597a250d.tar.gz
blackbird-obmc-linux-6966d604e2ec4ecf5691aea953538f63597a250d.zip
s390/mem_detect: move tprot loop to early boot phase
Move memory detection to early boot phase. To store online memory regions "struct mem_detect_info" has been introduced together with for_each_mem_detect_block iterator. mem_detect_info is later converted to memblock. Also introduces sclp_early_get_meminfo function to get maximum physical memory and maximum increment number. Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Reviewed-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char')
-rw-r--r--drivers/s390/char/sclp_early_core.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/s390/char/sclp_early_core.c b/drivers/s390/char/sclp_early_core.c
index bbea2154a807..4f04ba689771 100644
--- a/drivers/s390/char/sclp_early_core.c
+++ b/drivers/s390/char/sclp_early_core.c
@@ -270,3 +270,20 @@ int __init sclp_early_get_info(struct read_info_sccb *info)
*info = sclp_info_sccb;
return 0;
}
+
+int __init sclp_early_get_meminfo(unsigned long *mem, unsigned long *rzm)
+{
+ unsigned long rnmax;
+ unsigned long rnsize;
+ struct read_info_sccb *sccb = &sclp_info_sccb;
+
+ if (!sclp_info_sccb_valid)
+ return -EIO;
+
+ rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2;
+ rnsize = sccb->rnsize ? sccb->rnsize : sccb->rnsize2;
+ rnsize <<= 20;
+ *mem = rnsize * rnmax;
+ *rzm = rnsize;
+ return 0;
+}
OpenPOWER on IntegriCloud