diff options
author | Balbir singh <bsingharora@gmail.com> | 2018-06-19 18:34:07 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-06-27 17:19:01 +1000 |
commit | 6ede024c810ffeb64814a8d6c4c338f12d357458 (patch) | |
tree | 85f9c064911659dbd45b119c505d1c7d876f025f | |
parent | 9b394a32c8ea45c56db62ddddb322b45ffef9fd0 (diff) | |
download | skiboot-6ede024c810ffeb64814a8d6c4c338f12d357458.zip skiboot-6ede024c810ffeb64814a8d6c4c338f12d357458.tar.gz skiboot-6ede024c810ffeb64814a8d6c4c338f12d357458.tar.bz2 |
pmem: volatile bindings for the poorly enabled
PMEM_DISK bindings were added, but they rely on a rather
recent mmap feature. This patch steals from those bindings
to add volatile bindings. I've used these bindings with
PMEM_VOLATILE to launch an instance with the publicly
available systemsim-p9. The bindings are volatile and one
should not expect any data to be saved/retrieved.
Signed-off-by: Balbir singh <bsingharora@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r-- | external/mambo/skiboot.tcl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl index 7068c80..7f92a53 100644 --- a/external/mambo/skiboot.tcl +++ b/external/mambo/skiboot.tcl @@ -267,6 +267,32 @@ if { [info exists env(PMEM_DISK)] } { } } +if { [info exists env(PMEM_VOLATILE)] } { + + set pmem_sizes [split $env(PMEM_VOLATILE) ","] + + set pmem_root [mysim of addchild $root_node "pmem" ""] + mysim of addprop $pmem_root int "#address-cells" 2 + mysim of addprop $pmem_root int "#size-cells" 2 + mysim of addprop $pmem_root empty "ranges" "" + + # Start above where XICS normally is at 0x1A0000000000 + if (![info exists pmem_start]) { + set pmem_start [expr 0x20000000000] + } + + foreach pmem_size $pmem_sizes { + set pmem_size [string trim $pmem_size] + set pmem_start_hex [format %x $pmem_start] + set pmem_node [mysim of addchild $pmem_root "pmem@$pmem_start_hex" ""] + set reg [list [expr $pmem_start >> 32] [expr $pmem_start & 0xffffffff] [expr $pmem_size >> 32] [expr $pmem_size & 0xffffffff] ] + mysim of addprop $pmem_node array "reg" reg + mysim of addprop $pmem_node string "compatible" "pmem-region" + mysim of addprop $pmem_root int "volatile" 1 + set pmem_start [expr $pmem_start + $pmem_size] + } +} + # Default NVRAM is blank and will be formatted by Skiboot if no file is provided set fake_nvram_start $cpio_end set fake_nvram_size 0x40000 |