aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2014-11-25 15:20:14 +0530
committerNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2014-12-03 16:08:41 +0530
commitea2b48a7a352146b34f25bbb55cc24c53d9daf7b (patch)
tree6d2a61f3ce3160646e0f5eb7ee2a6ddf7e090040
parent112cdf93751b5090b344d3b3f3062fcdcda8c31d (diff)
downloadSLOF-ea2b48a7a352146b34f25bbb55cc24c53d9daf7b.zip
SLOF-ea2b48a7a352146b34f25bbb55cc24c53d9daf7b.tar.gz
SLOF-ea2b48a7a352146b34f25bbb55cc24c53d9daf7b.tar.bz2
cas: reconfigure memory nodes
For supporting memory hotplug feature, some changes are need in the way memory is represented during VM bootup. Now the guest boots from RMA and rest of the memory is configured only during client-architecture call. SLOF adds support for creation of these nodes dynamically. If the guest supports ibm,dynamic-reconfiguration-memory, qemu would create memory as part of /ibm,dynamic-reconfiguration-memory While for older guests, memory@ would be populated. CC: bharata@linux.vnet.ibm.com Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
-rw-r--r--board-qemu/slof/fdt.fs36
1 files changed, 31 insertions, 5 deletions
diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs
index bd94a1b..8d4635f 100644
--- a/board-qemu/slof/fdt.fs
+++ b/board-qemu/slof/fdt.fs
@@ -346,6 +346,33 @@ fdt-claim-reserve
device-end
;
+: fdt-create-cas-node ( name -- )
+ 2dup
+ 2dup " memory@" find-substr 0 = IF
+ fdt-debug IF ." Creating memory@ " cr THEN
+ new-device
+ 2dup " @" find-substr nip device-name \ Parse the node name
+ 2dup
+ 2dup " @" find-substr rot over + 1 + -rot - 1 - \ Jump to addr afte "@"
+ parse-2int nip xlsplit set-unit \ Parse and set unit
+ finish-device
+ ELSE
+ 2dup " ibm,dynamic-reconfiguration-memory" find-substr 0 = IF
+ fdt-debug IF ." Creating ibm,dynamic-reconfiguration-memory " cr THEN
+ new-device
+ device-name
+ finish-device
+ ELSE
+ 2drop 2drop
+ false to fdt-cas-fix?
+ ." Node not supported " cr
+ EXIT
+ THEN
+ THEN
+
+ find-node ?dup 0 <> IF set-node THEN
+;
+
: fdt-fix-cas-node ( start -- end )
recursive
fdt-next-tag dup OF_DT_BEGIN_NODE <> IF
@@ -363,12 +390,11 @@ fdt-claim-reserve
drop
THEN
fdt-debug IF ." Setting node: " 2dup type cr THEN
- find-node ?dup 0 <> IF
- set-node
+ 2dup find-node ?dup 0 <> IF
+ set-node 2drop
ELSE
- ." Node not found " cr
- false to fdt-cas-fix?
- EXIT
+ fdt-debug IF ." Node not found, creating " 2dup type cr THEN
+ fdt-create-cas-node
THEN
fdt-debug IF ." Current now: " pwd cr THEN
BEGIN