[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ImageBuilder] Fix device tree node naming


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 21 Oct 2024 13:04:46 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/y+1fO09HSxr0gr6oFKsCoLLbaVbP4p7XDQyh3mR+Bw=; b=pDww5FuAkyhGHQFDFzPOsGWaYsP3A3muQ2DZiV0hlB9DYkQ0yyfNlLSw7hX9Ggr/Y0dx8JgrVlWJrsmrEDpQJsOtbf/uGFTfefFyzll/Uei+CrtORsYNOXPbTUV+XX9QiWFvc4eZbY7KfHeEFXkcmTmby5K9pIeNm2W5NS8drpn3MyF1Cpqz58i2QfUeohKdsuDQ16C14isuR3rIJ5MqmT3CeJAVjlNRbKGQ3bZMGb+pUkbJ/sNw5E673Rg4q4o2iOp1fceMymDGw8TcqT4ZRuCRQAH7G1rp7gttWB7WCeiFa5uvEpi4I3XyGUkoS82ctieoyfGKQ3CEu6kr+TBgfQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=slqEaA8m9bFlzq4ia3DLzvWvqPoVykdu5wAHTzabC8EhDxLK462NJSX2sa7vki24SB+XoOuK8EU27GiiN9DC5Jj2g0sPXz0quZMXBuLx1VvZngwTOVYe98s1nRl13Ek8H2Qo9Nplew0XG/xau0X+ObuZSyriiwCU/F3+c8Bb413j/xK3PUAYAOPV/n/udPPfrY5d0mfd2YVUIXEa1dMM0w7zpHYY9OV2Ra+kurx8sDQOpa4q5QrY8U/EEzX8R7pWPVz3hPDS0UlHEDT4t+1GIonZLLIjxyZgFG4YQpdWIq1pfrEob/6zTW9bWutp087YI2UrpMDkqiu3Q5YqCkKETQ==
  • Cc: <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Mon, 21 Oct 2024 11:05:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

A device tree node is named as follows: node-name@unit-address. The
unit-address must match the first address specified in the reg property
or be omitted if there's no reg property.

Fix the following issues:
1) domU modules are named as: node-name0xunit-address. Fix the naming to
   follow the device tree spec.
2) dom0 kernel and ramdisk, despite having the reg property do not have
   unit addresses specified. Fix it.

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 scripts/uboot-script-gen | 39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index f8a087b881ce..f10e5f4a49bf 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -106,11 +106,12 @@ function add_device_tree_kernel()
     local addr=$2
     local size=$3
     local bootargs=$4
+    local node_name="module@${addr#0x}"
 
-    dt_mknode "$path" "module$addr"
-    dt_set "$path/module$addr" "compatible" "str_a" "multiboot,kernel 
multiboot,module"
-    dt_set "$path/module$addr" "reg" "hex"  "$(split_addr_size $addr $size)"
-    dt_set "$path/module$addr" "bootargs" "str" "$bootargs"
+    dt_mknode "$path" "$node_name"
+    dt_set "$path/$node_name" "compatible" "str_a" "multiboot,kernel 
multiboot,module"
+    dt_set "$path/$node_name" "reg" "hex"  "$(split_addr_size $addr $size)"
+    dt_set "$path/$node_name" "bootargs" "str" "$bootargs"
 }
 
 
@@ -119,10 +120,11 @@ function add_device_tree_ramdisk()
     local path=$1
     local addr=$2
     local size=$3
+    local node_name="module@${addr#0x}"
 
-    dt_mknode "$path"  "module$addr"
-    dt_set "$path/module$addr" "compatible" "str_a" "multiboot,ramdisk 
multiboot,module"
-    dt_set "$path/module$addr" "reg" "hex"  "$(split_addr_size $addr $size)"
+    dt_mknode "$path"  "$node_name"
+    dt_set "$path/$node_name" "compatible" "str_a" "multiboot,ramdisk 
multiboot,module"
+    dt_set "$path/$node_name" "reg" "hex"  "$(split_addr_size $addr $size)"
 }
 
 
@@ -131,10 +133,11 @@ function add_device_tree_passthrough()
     local path=$1
     local addr=$2
     local size=$3
+    local node_name="module@${addr#0x}"
 
-    dt_mknode "$path"  "module$addr"
-    dt_set "$path/module$addr" "compatible" "str_a" "multiboot,device-tree 
multiboot,module"
-    dt_set "$path/module$addr" "reg" "hex"  "$(split_addr_size $addr $size)"
+    dt_mknode "$path"  "$node_name"
+    dt_set "$path/$node_name" "compatible" "str_a" "multiboot,device-tree 
multiboot,module"
+    dt_set "$path/$node_name" "reg" "hex"  "$(split_addr_size $addr $size)"
 }
 
 function add_device_tree_mem()
@@ -314,17 +317,21 @@ function xen_device_tree_editing()
 
     if test "$DOM0_KERNEL"
     then
-        dt_mknode "/chosen" "dom0"
-        dt_set "/chosen/dom0" "compatible" "str_a" "xen,linux-zimage 
xen,multiboot-module multiboot,module"
-        dt_set "/chosen/dom0" "reg" "hex" "$(split_addr_size $dom0_kernel_addr 
$dom0_kernel_size)"
+        local node_name="dom0@${dom0_kernel_addr#0x}"
+
+        dt_mknode "/chosen" "$node_name"
+        dt_set "/chosen/$node_name" "compatible" "str_a" "xen,linux-zimage 
xen,multiboot-module multiboot,module"
+        dt_set "/chosen/$node_name" "reg" "hex" "$(split_addr_size 
$dom0_kernel_addr $dom0_kernel_size)"
         dt_set "/chosen" "xen,dom0-bootargs" "str" "$DOM0_CMD"
     fi
 
     if test "$DOM0_RAMDISK" && test $ramdisk_addr != "-"
     then
-        dt_mknode "/chosen" "dom0-ramdisk"
-        dt_set "/chosen/dom0-ramdisk" "compatible" "str_a" "xen,linux-initrd 
xen,multiboot-module multiboot,module"
-        dt_set "/chosen/dom0-ramdisk" "reg" "hex" "$(split_addr_size 
$ramdisk_addr $ramdisk_size)"
+        local node_name="dom0-ramdisk@${ramdisk_addr#0x}"
+
+        dt_mknode "/chosen" "$node_name"
+        dt_set "/chosen/$node_name" "compatible" "str_a" "xen,linux-initrd 
xen,multiboot-module multiboot,module"
+        dt_set "/chosen/$node_name" "reg" "hex" "$(split_addr_size 
$ramdisk_addr $ramdisk_size)"
     fi
 
     i=0
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.