aboutsummaryrefslogtreecommitdiff
path: root/scripts/uboot-script-gen
diff options
context:
space:
mode:
authorXenia Ragiadakou2022-06-19 15:43:16 +0300
committerStefano Stabellini2022-06-21 17:13:10 -0700
commitd7ed86141dfed993c15bc0d81dce0426169a176f (patch)
treea7229f1f6ff180574e120e59d755da8f51d7efac /scripts/uboot-script-gen
parentaac7d95c2ebce1e2b42e9a5add1cf24f49aa5757 (diff)
uboot-script-gen: Enable direct mapping of statically allocated memory
Direct mapping for dom0less VMs is disabled by default in XEN and can be enabled through the 'direct-map' property. Add a new config parameter DOMU_DIRECT_MAP to be able to enable or disable direct mapping, i.e set to 1 for enabling and to 0 for disabling. This parameter is optional. Direct mapping is enabled by default for all dom0less VMs with static allocation. The property 'direct-map' is a boolean property. Boolean properties are true if present and false if missing. Add a new data_type 'bool' in function dt_set() to setup a boolean property. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Diffstat (limited to 'scripts/uboot-script-gen')
-rwxr-xr-xscripts/uboot-script-gen18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index bdc8a6b..e85c6ec 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -27,6 +27,7 @@ function dt_mknode()
# hex
# str
# str_a
+# bool
function dt_set()
{
local path=$1
@@ -49,6 +50,12 @@ function dt_set()
array+=" \"$element\""
done
echo "fdt set $path $var $array" >> $UBOOT_SOURCE
+ elif test $data_type = "bool"
+ then
+ if test "$data" -eq 1
+ then
+ echo "fdt set $path $var" >> $UBOOT_SOURCE
+ fi
else
echo "fdt set $path $var \"$data\"" >> $UBOOT_SOURCE
fi
@@ -65,6 +72,12 @@ function dt_set()
elif test $data_type = "str_a"
then
fdtput $FDTEDIT -p -t s $path $var $data
+ elif test $data_type = "bool"
+ then
+ if test "$data" -eq 1
+ then
+ fdtput $FDTEDIT -p $path $var
+ fi
else
fdtput $FDTEDIT -p -t s $path $var "$data"
fi
@@ -206,6 +219,7 @@ function xen_device_tree_editing()
if test "${DOMU_STATIC_MEM[$i]}"
then
add_device_tree_static_mem "/chosen/domU$i" "${DOMU_STATIC_MEM[$i]}"
+ dt_set "/chosen/domU$i" "direct-map" "bool" "${DOMU_DIRECT_MAP[$i]}"
fi
dt_set "/chosen/domU$i" "vpl011" "hex" "0x1"
if test "$DOM0_KERNEL"
@@ -470,6 +484,10 @@ function xen_config()
then
DOMU_CMD[$i]="console=ttyAMA0"
fi
+ if test -z "${DOMU_DIRECT_MAP[$i]}"
+ then
+ DOMU_DIRECT_MAP[$i]=1
+ fi
i=$(( $i + 1 ))
done
}