From nobody Fri May 3 12:51:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail(p=none dis=none) header.from=oss.nxp.com ARC-Seal: i=2; a=rsa-sha256; t=1657729920; cv=pass; d=zohomail.com; s=zohoarc; b=GDEa7ROl3Hdh5i4e0So73aQvOQHfwO85ld6u5cWNwIhsfVahdUgqAGDFVVxVyBDDiUwclrorVYwbKqvlbDnSjy9jCTQb8MgjsTCBQHOsTmPaQKn3+/SSKeprCvGtjQ1X9cpYzEwgi7SC/0IBVQvyZUJU4Pj9pd0MklmM3YpGl60= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657729920; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0p9WID8wCWme7yTVDlS/nHDHlNEKgtykRbLwYbaQeI4=; b=RNYrAjfv3D55ZBKyjLCZYo7ZGcU3g7B2VGcYW9AVR0m8SHoOtYFX+c4FJ8FEvrn9UjWgG1/xRb2DieDsp01UzDctyANHVa77fZutS0o9tgAHSB9uWB7iu853evgxn5b8nG5jB/zrcONi4IVZT6id+nZEENDBiMljrF+C9EUCFok= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1657729920363806.4305296984707; Wed, 13 Jul 2022 09:32:00 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.366874.597795 (Exim 4.92) (envelope-from ) id 1oBfGg-000391-0D; Wed, 13 Jul 2022 16:31:18 +0000 Received: by outflank-mailman (output) from mailman id 366874.597795; Wed, 13 Jul 2022 16:31:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oBfGf-00038F-Pt; Wed, 13 Jul 2022 16:31:17 +0000 Received: by outflank-mailman (input) for mailman id 366874; Wed, 13 Jul 2022 16:31:16 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oBfGe-00035D-7H for xen-devel@lists.xenproject.org; Wed, 13 Jul 2022 16:31:16 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2067.outbound.protection.outlook.com [40.107.104.67]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 36bf0573-02c9-11ed-bd2d-47488cf2e6aa; Wed, 13 Jul 2022 18:31:15 +0200 (CEST) Received: from VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) by VI1PR04MB4893.eurprd04.prod.outlook.com (2603:10a6:803:5c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Wed, 13 Jul 2022 16:31:12 +0000 Received: from VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::c2a:42b9:f908:e991]) by VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::c2a:42b9:f908:e991%6]) with mapi id 15.20.5417.026; Wed, 13 Jul 2022 16:31:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 36bf0573-02c9-11ed-bd2d-47488cf2e6aa ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kdqDrjrPfltX+vj28Yq5YzPy2OIt/4OHk1ktTlhWd0krippHSguVhd8tFktQ0dTO/DCVJtamcahOk+nxWaFVGJlg4BHAlhkjaC07b4ZosAbAvVqQfkfjDbs0cTBz6acN7CCo6DoloSjNQmNcHaeD6IM+l4nHD0eSxlFzDUu/Bm7g6wr87swlyWyCWYnaTl8Bd5HFgFNuAo/QIrgkzr3s6t+HM1wX81a8ve6ANMCRxE7PX5chMJyefonqceMYKzvY3oRg+CSTtvDu50aY0AxywsLo7PS/zPwYp4PqHXz7UYXurOaLGIPXTtQnztkvVFRHoGL56+IKWolPz3d8bm8K5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=0p9WID8wCWme7yTVDlS/nHDHlNEKgtykRbLwYbaQeI4=; b=Emulg3+6T4a3SE2tes00OcPcEfuIyQlVJXu9xPOqBCQyJvFXNHqCgVwIqt6vipKj8Zjpc9CxZXIbza+31qx2nNtZtYccHov2wn984eobkcKz7LVFajQUgPqNB+77O9IGLJ6paQ90LBZRnMBqR+EJGWKWTKk0Dhes185hk2FKtTiu+mNiz/EqPqnOP4m17FZRfTSVNT9CKR/0+EhKZtyL2rIgaBmeXovhVi07G5wTRKK79pEI7aS8YfbgtvQRDARV6MwpiPwShTecgyVTA2+V2lriPnwoYtmAJVJbGhP+lmJqkSGS4RKN5FK8Y8qdb6V2Utms7FxlDA7kmAaq4Snb+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0p9WID8wCWme7yTVDlS/nHDHlNEKgtykRbLwYbaQeI4=; b=MBOLXsBVERafZbLh7mkeLaZFo2epkrLgUA/HZW1MFs0A6SZ2zt26DRSBFEa1BQ/464BczpJR1H4u1/5OAhakuUVHFj8w+YD5z/bCddeq697DfQJvxU9g9CIAiJBMTmlOUBptaqodKEgSTHHDSoZHt2O3KypqBv1y24GcnCgLoAo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; From: "Andrei Cherechesu (OSS)" To: xen-devel@lists.xenproject.org Cc: viryaos-discuss@lists.sourceforge.net, sstabellini@kernel.org, Andrei Cherechesu Subject: [ImageBuilder][PATCH v3 1/3] uboot-script-gen: Dynamically compute addr and size when loading binaries Date: Wed, 13 Jul 2022 19:30:42 +0300 Message-Id: <20220713163044.3541661-2-andrei.cherechesu@oss.nxp.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220713163044.3541661-1-andrei.cherechesu@oss.nxp.com> References: <20220713163044.3541661-1-andrei.cherechesu@oss.nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM0PR08CA0022.eurprd08.prod.outlook.com (2603:10a6:208:d2::35) To VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9cf94d7b-33f0-47f4-4bbb-08da64ed1918 X-MS-TrafficTypeDiagnostic: VI1PR04MB4893:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AafPFvYV+v5lxHgOj7XIkckOVmNDIuWbDaSt/XJeXaZbr9pGGZC8v8m+z16Bq8HsW2c5W/FEX1PaszfRqvXpTiAphcK896JethKJu4PKUBJfG4vGBPAPYoTGWSTN7retkOFKFUZCNOwQlb6Uuy1AWcQH8SQ8EFQKZ6xUHjT91fhOmuw2x7mZie7HrJLu2rNq5GfRvG5nrP6ATXwlIxncHucxELVQ2FTX2kiz8WBANjvgnvILRqoK7Yd8+y3x53R6zMMwLPBp+f6ZazN5eHYWaC8dj/xbBlpcx4K1LV8sOVa6qN6UNcotnESS3NlFNlnl0eUiUoBhjDxbRjsAp0w0d7bl6ESHAsg06RQIf7Y1bBA5KXEIuEeWH3dN4YtPFm6oQor023SckcNyto3fRh+veoU+B1965Wt7rcnjIm9umBNP44Z2riQ/NEbsnyGNNf3f5NrJR4x9dYf4rqBrN/qSM4Mw81pD+iGYUzDLQELIC6cmXM2YkwxqZjH4orBUk+IkbUfWIhWiS6HQmQwQml5VscDdjNlef/gs5pgYfuU//QvPK7BTquo6+o8H4esbksSqDv5nBmDsuIpiMjyNxct4dYxZgqVL5PIaULWm18VfCB1ozs2j53xUMSWxVCFnGVIXvm+S+T37STCxgXnAMtCiW05Qa5eJclbnwLeIF+gopccyqeU6mKw+a9CsZTuVWB/pdA8qS1LNziwe2ZrAZvGSeI8qMyvill5W0e6kl3NoLGYIHHH3kuIp42xXzLwZgxY4SHIMo4SAgEgMMU49JI1M+XBYUnja4JSWjRs0l1E7Mkwoy79DLEoaRWxAWNcTF/Wd X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5056.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(396003)(376002)(136003)(366004)(346002)(39860400002)(83380400001)(86362001)(38350700002)(38100700002)(8936002)(5660300002)(478600001)(6486002)(30864003)(6666004)(41300700001)(6916009)(6506007)(316002)(52116002)(4326008)(66476007)(66556008)(8676002)(66946007)(186003)(6512007)(2906002)(2616005)(1076003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?lg6aoX5P3bHY0og/gSzld682c3Ky/vP+JCeMrimuoCuJYDzGBTSzEKN3jnUo?= =?us-ascii?Q?KOzCsDnyUvzTWNlOHOp68V/WuVPh1LQYKme5EqRAvFIjyde/5nE9aWhoAly4?= =?us-ascii?Q?5mnGWq3O9VnJ0UwLjqoYyblNoNVeRc4iyWCNNbyrFXot5XnR2zFpyX3DLyFx?= =?us-ascii?Q?GRYSlwBvawq4H9u8Gt4Zto+A91PcCgncdkhOcTrGoM0gB4miK8/5jKS/s/8A?= =?us-ascii?Q?3GZuTGbQU03CfZOQZhXENPCuIxMtTz9sx7VXWC+AUniMKMhG+0R/0Au8T3D6?= =?us-ascii?Q?mkgnl0mLGGyUlAoBJ0yrLo/DV5linFDn5RWrPfWM5pyowntaL+8RZRUHTCzk?= =?us-ascii?Q?8VYWFW9EVeFRI/Lpn90tmICyDZUE2p7mNJda0kenKvEaeSfZl1lFBaZi0zSw?= =?us-ascii?Q?prNxgisBtZS4y0x1rIAB34Wu3MHgrYXWSvpaIp8E8b6ikAP0HFve+m/xjPDd?= =?us-ascii?Q?dwzFyrXlsTVC96UAbclHlBaDIg/55rKqmASTCSIghePjfBku7iJ7mq040itK?= =?us-ascii?Q?TdPfw8xeWDv9snan3XE7tqzVXRmTP982oFrrQj81pSPUqXl048kPCC6sVxmU?= =?us-ascii?Q?eC4F/vtp9z+4W2UjwfDB96FsYPMKrQmEDO899EEatazdfU5Al3V1LC79r5NH?= =?us-ascii?Q?X8qfm14+20pCPq7ExX8doCM3dIuIkSOlK9JqtiEyFhg4GWoaX31iJzlwnJ/n?= =?us-ascii?Q?D1nNSu+mw0R4GlO2ObU310pz19mvx3FSMXn3ewhrVF0waEv0tflJLrebJADs?= =?us-ascii?Q?I0Xe5PCTTp6pwI42HRK/gjqVpXA5V4jgjKMxsCr5gt6HsWxTx8rQDoaPrxW4?= =?us-ascii?Q?h4OQ9aBK1pjd8mLjqjBHj21SU1TQbQblWj3HM3QBxEuISpwbZv6bfG9vrVBX?= =?us-ascii?Q?+lzl3NgXhqAWY6w2vrLpxYV8vwS715jXq4yOhDcFctWPOL2soB3ZSK/Rlw6n?= =?us-ascii?Q?7DG295ejYgtb4mXFPS2VKGyBxxxcsQ7hc4u6imHhC5Z+XhTwU+bBzMX2dblm?= =?us-ascii?Q?JwWm/NRWCyVAPh4PjuEDrnZbLPmSAvC/Llv3phjTzC9thpRJTc37tgODhNU5?= =?us-ascii?Q?CkoAl2w8P73YvuaMDhaDLuax9tHGfH+yWS4NG3T05wy2G7ohcdc/SJswXhHc?= =?us-ascii?Q?lyalWp0UdVoKmptA3Kp9BPYQXVAKhDrq1iQjUxogk3Jy+F4BVXUceZbYtLr1?= =?us-ascii?Q?LBxc+9O/cgyjWcku36AN7pnAFe6VP24o6jCexRSos6Xj9ie5jvj5/0c7UoDn?= =?us-ascii?Q?W2sB5Zvr9JwapjJu9BCTOBdbg11EFj0ypJzgi6gzgl4IuvQ8GXG2o29fDqVT?= =?us-ascii?Q?gGd0p6LZnx/fgn2jLpOkv+N+/2hrulD/kb2L4qo5WaRkBp1SiyLeWqFhGQ0S?= =?us-ascii?Q?tyFZMAvhutIWPOM3KVw/MRxDCmVfLDHTZnADGcNAVPvawjA+p8GvxSwDq/Ib?= =?us-ascii?Q?g57l1PaqpTxl+ppXfU0+rbvUXkgs16DKbQWdZrRpVlhoaQjY/vwqcGEfepmP?= =?us-ascii?Q?9+WMzJOfHO0bZmrcCo95z8YZNb4Ej7lOs4Hxat1AgIu2K/gOYdfXx9ymYAiG?= =?us-ascii?Q?+xk2yWyRWSld7ZfXBBAjqUKkmUkxNL8n462ypAh5ra+TGaty2ufgi+S1M/LU?= =?us-ascii?Q?lg=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cf94d7b-33f0-47f4-4bbb-08da64ed1918 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5056.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2022 16:31:11.9270 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: C/4rivODVPS8rlEtcax28qLBlyExKlhpPxp/1P2jNn3Khd1MEptHoQW1iG7/EYF6F97Ibr9tHH6gf/C+VBQzwqMsD28a/ldkQBw5WkicvXM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4893 X-ZohoMail-DKIM: pass (identity @NXP1.onmicrosoft.com) X-ZM-MESSAGEID: 1657729922389100002 Content-Type: text/plain; charset="utf-8" From: Andrei Cherechesu Normally, the script would precompute the sizes of the loaded binaries and addresses where they are loaded before generating the script, and the sizes and addresses that needed to be provided to Xen via /chosen would be hardcoded in the boot script. Added option via "-s" parameter to use the ${filesize} variable in u-boot, which is set automatically after a *load command. The value stored by filesize is now stored in a u-boot env variable with the name corresponding to the binary that was loaded before. The newly set variables are now used in setting the /chosen node, instead of the hardcoded values. Also, the loading addresses for the files are dynamically computed and aligned to 0x200000 using the `setexpr` u-boot command. Basically, if the option is used, there are zero hardcoded addresses inside the boot script, and everything is determined based on the MEMORY_START parameter and each binary's size. If the "-s" parameter is not used, the script does not store the binaries' sizes and addresses in variables and uses the precomputed ones when advertising them in the /chosen node. Signed-off-by: Andrei Cherechesu --- scripts/uboot-script-gen | 136 ++++++++++++++++++++++++++++++++------- 1 file changed, 114 insertions(+), 22 deletions(-) diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index 8f08cd6..f8d2fb0 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -4,6 +4,9 @@ offset=3D$((2*1024*1024)) filesize=3D0 prog_req=3D(mkimage file fdtput mktemp awk) =20 +padding_mask=3D`printf "0x%X\n" $(($offset - 1))` +padding_mask_inv=3D`printf "0x%X\n" $((~$padding_mask))` + function cleanup_and_return_err() { rm -f $UBOOT_SOURCE $UBOOT_SCRIPT @@ -91,10 +94,18 @@ function add_device_tree_kernel() local size=3D$3 local bootargs=3D$4 =20 - dt_mknode "$path" "module$addr" - dt_set "$path/module$addr" "compatible" "str_a" "multiboot,kernel mult= iboot,module" - dt_set "$path/module$addr" "reg" "hex" "0x0 $addr 0x0 $(printf "0x%x"= $size)" - dt_set "$path/module$addr" "bootargs" "str" "$bootargs" + if test "$dynamic_loading_opt" + then + dt_mknode "$path" "module\${"$addr"}" + dt_set "$path/module\${"$addr"}" "compatible" "str_a" "multiboot,k= ernel multiboot,module" + dt_set "$path/module\${"$addr"}" "reg" "hex" "0x0 0x\${"$addr"} 0= x0 0x\${"$size"}" + dt_set "$path/module\${"$addr"}" "bootargs" "str" "$bootargs" + else + dt_mknode "$path" "module$addr" + dt_set "$path/module$addr" "compatible" "str_a" "multiboot,kernel = multiboot,module" + dt_set "$path/module$addr" "reg" "hex" "0x0 $addr 0x0 $(printf "0= x%x" $size)" + dt_set "$path/module$addr" "bootargs" "str" "$bootargs" + fi } =20 =20 @@ -104,9 +115,16 @@ function add_device_tree_ramdisk() local addr=3D$2 local size=3D$3 =20 - dt_mknode "$path" "module$addr" - dt_set "$path/module$addr" "compatible" "str_a" "multiboot,ramdisk mul= tiboot,module" - dt_set "$path/module$addr" "reg" "hex" "0x0 $addr 0x0 $(printf "0x%x"= $size)" + if test "$dynamic_loading_opt" + then + dt_mknode "$path" "module\${"$addr"}" + dt_set "$path/module\${"$addr"}" "compatible" "str_a" "multiboot,r= amdisk multiboot,module" + dt_set "$path/module\${"$addr"}" "reg" "hex" "0x0 0x\${"$addr"} 0= x0 0x\${"$size"}" + else + dt_mknode "$path" "module$addr" + dt_set "$path/module$addr" "compatible" "str_a" "multiboot,ramdisk= multiboot,module" + dt_set "$path/module$addr" "reg" "hex" "0x0 $addr 0x0 $(printf "0= x%x" $size)" + fi } =20 =20 @@ -116,9 +134,16 @@ function add_device_tree_passthrough() local addr=3D$2 local size=3D$3 =20 - 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" "0x0 $addr 0x0 $(printf "0x%x"= $size)" + if test "$dynamic_loading_opt" + then + dt_mknode "$path" "module\${"$addr"}" + dt_set "$path/module\${"$addr"}" "compatible" "str_a" "multiboot,d= evice-tree multiboot,module" + dt_set "$path/module\${"$addr"}" "reg" "hex" "0x0 0x\${"$addr"} 0= x0 0x\${"$size"}" + else + 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" "0x0 $addr 0x0 $(printf "0= x%x" $size)" + fi } =20 function add_device_tree_mem() @@ -186,7 +211,12 @@ function xen_device_tree_editing() then dt_mknode "/chosen" "dom0" dt_set "/chosen/dom0" "compatible" "str_a" "xen,linux-zimage xen,m= ultiboot-module multiboot,module" - dt_set "/chosen/dom0" "reg" "hex" "0x0 $dom0_kernel_addr 0x0 $(pri= ntf "0x%x" $dom0_kernel_size)" + if test "$dynamic_loading_opt" + then + dt_set "/chosen/dom0" "reg" "hex" "0x0 0x\${dom0_linux_addr} 0= x0 0x\${dom0_linux_size}" + else + dt_set "/chosen/dom0" "reg" "hex" "0x0 $dom0_kernel_addr 0x0 $= (printf "0x%x" $dom0_kernel_size)" + fi dt_set "/chosen" "xen,dom0-bootargs" "str" "$DOM0_CMD" fi =20 @@ -194,7 +224,12 @@ function xen_device_tree_editing() then dt_mknode "/chosen" "dom0-ramdisk" dt_set "/chosen/dom0-ramdisk" "compatible" "str_a" "xen,linux-init= rd xen,multiboot-module multiboot,module" - dt_set "/chosen/dom0-ramdisk" "reg" "hex" "0x0 $ramdisk_addr 0x0 $= (printf "0x%x" $ramdisk_size)" + if test "$dynamic_loading_opt" + then + dt_set "/chosen/dom0-ramdisk" "reg" "hex" "0x0 0x\${dom0_ramdi= sk_addr} 0x0 0x\${dom0_ramdisk_size}" + else + dt_set "/chosen/dom0-ramdisk" "reg" "hex" "0x0 $ramdisk_addr 0= x0 $(printf "0x%x" $ramdisk_size)" + fi fi =20 i=3D0 @@ -241,14 +276,29 @@ function xen_device_tree_editing() dt_set "/chosen/domU$i" "colors" "hex" "$(printf "0x%x" $bitco= lors)" fi =20 - add_device_tree_kernel "/chosen/domU$i" ${domU_kernel_addr[$i]} ${= domU_kernel_size[$i]} "${DOMU_CMD[$i]}" + if test "$dynamic_loading_opt" + then + add_device_tree_kernel "/chosen/domU$i" "domU${i}_kernel_addr"= "domU${i}_kernel_size" "${DOMU_CMD[$i]}" + else + add_device_tree_kernel "/chosen/domU$i" ${domU_kernel_addr[$i]= } ${domU_kernel_size[$i]} "${DOMU_CMD[$i]}" + fi if test "${domU_ramdisk_addr[$i]}" then - add_device_tree_ramdisk "/chosen/domU$i" ${domU_ramdisk_addr[$= i]} ${domU_ramdisk_size[$i]} + if test "$dynamic_loading_opt" + then + add_device_tree_ramdisk "/chosen/domU$i" "domU${i}_ramdisk= _addr" "domU${i}_ramdisk_size" + else + add_device_tree_ramdisk "/chosen/domU$i" ${domU_ramdisk_ad= dr[$i]} ${domU_ramdisk_size[$i]} + fi fi if test "${domU_passthrough_dtb_addr[$i]}" then - add_device_tree_passthrough "/chosen/domU$i" ${domU_passthroug= h_dtb_addr[$i]} ${domU_passthrough_dtb_size[$i]} + if test "$dynamic_loading_opt" + then + add_device_tree_passthrough "/chosen/domU$i" "domU${i}_fdt= _addr" "domU${i}_fdt_size" + else + add_device_tree_passthrough "/chosen/domU$i" ${domU_passth= rough_dtb_addr[$i]} ${domU_passthrough_dtb_size[$i]} + fi fi i=3D$(( $i + 1 )) done @@ -271,7 +321,12 @@ function device_tree_editing() =20 if test $UBOOT_SOURCE then - echo "fdt addr $device_tree_addr" >> $UBOOT_SOURCE + if test $dynamic_loading_opt + then + echo "fdt addr \${host_fdt_addr}" >> $UBOOT_SOURCE + else + echo "fdt addr $device_tree_addr" >> $UBOOT_SOURCE + fi echo "fdt resize 1024" >> $UBOOT_SOURCE =20 if test $NUM_DT_OVERLAY && test $NUM_DT_OVERLAY -gt 0 @@ -306,7 +361,7 @@ function add_size() function load_file() { local filename=3D$1 - local fit_scr_name=3D$2 + local binary_name=3D$2 =20 local absolute_path=3D"$(realpath --no-symlinks $filename)" local base=3D"$(realpath $PWD)"/ @@ -314,11 +369,30 @@ function load_file() =20 if test "$FIT" then - echo "imxtract \$fit_addr $fit_scr_name $memaddr" >> $UBOOT_SOURCE + echo "imxtract \$fit_addr $binary_name $memaddr" >> $UBOOT_SOURCE else - echo "$LOAD_CMD $memaddr ${prepend_path:+$prepend_path/}$relative_= path" >> $UBOOT_SOURCE + if test "$dynamic_loading_opt" + then + echo "$LOAD_CMD \${curr_addr} ${prepend_path:+$prepend_path/}$= relative_path" >> $UBOOT_SOURCE + else + echo "$LOAD_CMD $memaddr ${prepend_path:+$prepend_path/}$relat= ive_path" >> $UBOOT_SOURCE + fi fi add_size $filename + + if test "$dynamic_loading_opt" && test ! "$FIT" + then + # Store each binary's load addr and size + local binary_name_addr=3D"${binary_name}_addr" + local binary_name_size=3D"${binary_name}_size" + echo "setenv $binary_name_addr \${curr_addr}" >> $UBOOT_SOURCE + echo "setenv $binary_name_size \${filesize}" >> $UBOOT_SOURCE + =20 + # Compute load addr for next binary dynamically + echo "setexpr curr_addr \${curr_addr} \+ \${filesize}" >> $UBOOT_S= OURCE + echo "setexpr curr_addr \${curr_addr} \+ \${padding_mask}" >> $UBO= OT_SOURCE + echo "setexpr curr_addr \${curr_addr} \& \${padding_mask_inv}" >> = $UBOOT_SOURCE + fi } =20 function check_file_type() @@ -536,6 +610,14 @@ generate_uboot_images() =20 xen_file_loading() { + if test "$dynamic_loading_opt" + then + local curr_addr=3D`printf "%x\n" $memaddr` + echo "setenv curr_addr $curr_addr" >> $UBOOT_SOURCE + echo "setenv padding_mask $padding_mask" >> $UBOOT_SOURCE + echo "setenv padding_mask_inv $padding_mask_inv" >> $UBOOT_SOURCE + fi + if test "$DOM0_KERNEL" then check_compressed_file_type $DOM0_KERNEL "executable" @@ -891,7 +973,7 @@ function print_help { script=3D`basename "$0"` echo "usage:" - echo " $script -c CONFIG_FILE -d DIRECTORY [-t LOAD_CMD] [-o FILE] [-k= KEY_DIR/HINT [-u U-BOOT_DTB]] [-e] [-f] [-p PREPEND_PATH]" + echo " $script -c CONFIG_FILE -d DIRECTORY [-t LOAD_CMD] [-o FILE] [-k= KEY_DIR/HINT [-u U-BOOT_DTB]] [-e] [-f] [-p PREPEND_PATH] [-s]" echo " $script -h" echo "where:" echo " CONFIG_FILE - configuration file" @@ -908,6 +990,7 @@ function print_help echo " U-BOOT_DTB - u-boot control dtb so that the public key gets add= ed to it" echo " -f - enable generating a FIT image" echo " PREPEND_PATH - path to be appended before file names to match d= eploy location within rootfs" + echo " -s - enable dynamic loading of binaries by storing their addres= ses and sizes u-boot env variables" echo " -h - prints out the help message and exits " echo "Defaults:" echo " CONFIG_FILE=3D$cfg_file, UBOOT_TYPE=3D\"LOAD_CMD\" env var, DIR= ECTORY=3D$uboot_dir" @@ -915,7 +998,7 @@ function print_help echo " $script -c ../config -d ./build42 -t \"scsi load 1:1\"" } =20 -while getopts ":c:t:d:ho:k:u:fp:" opt; do +while getopts ":c:t:d:ho:k:u:fp:s" opt; do case ${opt} in t ) case $OPTARG in @@ -957,6 +1040,9 @@ while getopts ":c:t:d:ho:k:u:fp:" opt; do p ) prepend_path=3D"$OPTARG" ;; + s ) + dynamic_loading_opt=3Dy + ;; h ) print_help exit 0 @@ -1151,7 +1237,13 @@ device_tree_editing $device_tree_addr =20 # disable device tree reloation echo "setenv fdt_high 0xffffffffffffffff" >> $UBOOT_SOURCE -echo "$BOOT_CMD $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE + +if test "$dynamic_loading_opt" +then + echo "$BOOT_CMD \${host_kernel_addr} - \${host_fdt_addr}" >> $UBOOT_SO= URCE +else + echo "$BOOT_CMD $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE +fi =20 if test "$FIT" then --=20 2.35.1 From nobody Fri May 3 12:51:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail(p=none dis=none) header.from=oss.nxp.com ARC-Seal: i=2; a=rsa-sha256; t=1657729907; cv=pass; d=zohomail.com; s=zohoarc; b=agWbbfuxQJKWO64Q+9WztGJR+aXaswmeSVuqDHHnD2SOzdXHmD2KuEo105gMZ4YV8ljHJfVPEfdyhfN+F+ZYCS/oigLnjo2I+KEPrWoBnzJ29nLsB2bxuAu3qSqkUhoX/PsgLWkKCcqFA9q3k8GHF+DtB1ozLI0OOUi+wmIjXx0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657729907; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FmqTgyPFFWr6Cy0aMCwaNL1SgYThtx501TxRMDkfl/c=; b=T9gPVeAf4+SY7CFapfcF/dc5S4a4tZDRqJPOqVIaRZvSgaU0Jf3Oa69ssmqyZIu06ttZhbz0C5X87PB2uz5JsSpYCmLHs07JeZJD+12UqzOR/YmbRR2jM8vq/ZehHjEYNQqObbIj4Y5fCnFECmlBnoxgR+yU419dW8ylHklnwCc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1657729906943409.72342855439877; Wed, 13 Jul 2022 09:31:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.366875.597809 (Exim 4.92) (envelope-from ) id 1oBfGi-0003bW-Ae; Wed, 13 Jul 2022 16:31:20 +0000 Received: by outflank-mailman (output) from mailman id 366875.597809; Wed, 13 Jul 2022 16:31:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oBfGi-0003bO-6I; Wed, 13 Jul 2022 16:31:20 +0000 Received: by outflank-mailman (input) for mailman id 366875; Wed, 13 Jul 2022 16:31:18 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oBfGg-00035D-Iz for xen-devel@lists.xenproject.org; Wed, 13 Jul 2022 16:31:18 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2041.outbound.protection.outlook.com [40.107.104.41]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 382e66dd-02c9-11ed-bd2d-47488cf2e6aa; Wed, 13 Jul 2022 18:31:17 +0200 (CEST) Received: from VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) by VI1PR04MB4893.eurprd04.prod.outlook.com (2603:10a6:803:5c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Wed, 13 Jul 2022 16:31:15 +0000 Received: from VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::c2a:42b9:f908:e991]) by VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::c2a:42b9:f908:e991%6]) with mapi id 15.20.5417.026; Wed, 13 Jul 2022 16:31:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 382e66dd-02c9-11ed-bd2d-47488cf2e6aa ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HR8xtkUATNFYuRzWZKrnDCi8y/1Do2U5afdZaF6ksnyCcc7I0UHUxmmRC7JvpVZ9etHScboqnIRP7i4JJvcHTM3qOsYlHUJ6q8cztR9SsSbIxmudytC1bGsgdSOlucDL0vjQjBnnI+ct6jg+bYSC/EQLlTeIdXF+P8KmAJABouhPuYodbkU9NXuZZkQiOnaKJbdEV02kLLGETSZ566xhuC3JbvFiq04MLrjeXkjwC3FR7D39UTDg3l9Q20LPWHHpXfyl0OaqLSxV5VsOu1SyfiDL0PeHGs4NctErTImPDBbCh061SHbK4zkwVhj2NKeSwuZ8CiQdi3wVPPqaZ1ZwCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=FmqTgyPFFWr6Cy0aMCwaNL1SgYThtx501TxRMDkfl/c=; b=TRgDIP+2NzxZRMJ3Tu0mcTQiA9GVqPSH88x8BTlKzCM+ZdS2ljP0UM9g9euekpThTLy5DSwjKvvlL/8/5xhzU8WKq6HvtTUXmPHXQmdlGSd5hUjK5v/moCdyuwmtdtXvsevfiSMbr16lyLwitkxa4PDOL9gD1248uH4eseaVznqfM2DX/waWsukOzlneAMEUlydlN1ycN5RrFVYQSkk6WsK8SuGurBqrs9mbDRuDNU3bQBbA/nzAd5J4qEyZ0UCc6/On+LMx2cdkZTrq1d7+o+XDXeIRYbOcsfI33wpzKbk1X5mtJPW2cmymSL5ACB0OC3XMvHGFHol0cxTNTu4BKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FmqTgyPFFWr6Cy0aMCwaNL1SgYThtx501TxRMDkfl/c=; b=Uy0YfAtcMIb45xb6Kf+PJ0ObyB15W/Q9rdAzfj7QkidqCXeRSxDqFY24YwiItNIiCZfmHfhU23jAJHiI8wQFLbnMeWY4W3n+lrkYbZsf274ZEL6MnJLIqt45JYYE3fudR8aWaH4o+nR5lf+OIqcHhbNuvJJS5lGiz0YSFwiZ6z0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; From: "Andrei Cherechesu (OSS)" To: xen-devel@lists.xenproject.org Cc: viryaos-discuss@lists.sourceforge.net, sstabellini@kernel.org, Andrei Cherechesu Subject: [ImageBuilder][PATCH v3 2/3] uboot-script-gen: Enable appending extra commands to boot script Date: Wed, 13 Jul 2022 19:30:43 +0300 Message-Id: <20220713163044.3541661-3-andrei.cherechesu@oss.nxp.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220713163044.3541661-1-andrei.cherechesu@oss.nxp.com> References: <20220713163044.3541661-1-andrei.cherechesu@oss.nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM0PR08CA0022.eurprd08.prod.outlook.com (2603:10a6:208:d2::35) To VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ee13a77-9f45-432e-eba0-08da64ed1b4a X-MS-TrafficTypeDiagnostic: VI1PR04MB4893:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1U1NCAxm426kbrrJSQm+ZUSU+sb7yeRZ/Y1U4e9TzYf/qYpe/4FGct29qXg4T5/Ells4X/K4Hd/4MeZlvpoiWz3HPEvwD/++e48NiA9KAJ1MnrDZ0DMFaf4qo3TyV7ZhGNuAAp214CsIzhzr8st8udITALDLvlhioqMMmRJfzw3QtfbDtfUenNKjDvK3baIDJw7MaJOwTGK4yKeqFNnDqjPsK3MLG5Dx6deU4ouC9EF8SSEEMBz46jriniZR1ZU2DnNAo39hN4RJEzsd6Gq7qEnFh+SQsMrekVz5236iqCEpZRrppUI2q7IrLTclMotvGxboTMeqNP35nIiIH5cyL6LdS+T1yBuLRGBgf0C//U+WtgMSy7pDoaH98Pk83K4XnQ8P1m0gaBQ70O8CbmUTk2PTWeCVOiAf/oxSLrP+NGtgiX6o1eI2y5CC2TrHpwD5DQZuNka98gqpQxExMe4944l3mTpAnDrzJQHuYgRBtcdYqHfT5lUtfaBYZE3xzNcaskn2wi2dlXtP3l6cNcMW9fbU78MDGO2l77vf2phrPUOc2kJRi3uzrZxp1P2Ok/99LsPOA+KIc/REq1FCR1YK4m7p3qp73p8HkNHRXbNXCPjSFLgw45sqy6YQ2+MILCT008iN2ZYk29oS62zpyn28KP8i7jjoc91YUGfm2XRBLFOBSw08aXYMK8dCFPIBAOZupXGRSzJHK/R/zLZ2MXmqXiwvoAmvembrihCdLu874PymoxD8UFcrjmjK/YVw1fgHmbVO3g37Thz31RwOGIw5NNPSL2652zWv6MN9d1i83fm0yP4M8IafQnBuHe0AVH1YABgfDbyHprASGGdUJk2SFA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5056.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(396003)(376002)(136003)(366004)(346002)(39860400002)(86362001)(38350700002)(38100700002)(8936002)(5660300002)(478600001)(6486002)(6666004)(41300700001)(6916009)(6506007)(316002)(52116002)(4326008)(66476007)(66556008)(8676002)(66946007)(186003)(6512007)(2906002)(2616005)(1076003)(26005)(139555002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2dJVpksJKh6Ah6mquzNtwx9fNdnTBLO0eIEi7huZ0oiiGh0U9T0AVmPEW9xL?= =?us-ascii?Q?APf7jfEjrf5luxfXtlEsoBT51LPGDz/8IVWTt9oA1uJcr4B/ECjRioWesE3W?= =?us-ascii?Q?nZa4F1q7Imjrb1jk6W175oSKaRbacLxqpTCErgpZyME7mjNMXWVl9WPM3S64?= =?us-ascii?Q?xT5ZBjbZKLYOlVVz/HHw/zMvgp9bt2ty2huGmiEQLDqrZeAqsHV/j0RT1LJY?= =?us-ascii?Q?ZUBK8Co6YkcDJZCdbV3dpKD8TpMUahXCGhOavVvFESDG5CcR+byOs15ovYHm?= =?us-ascii?Q?kEPWFU/xfwfaxzbRB14QxfLqdo+NKG++CYg+yPf5y67bQ1tRJ9D6Yt9U4xUJ?= =?us-ascii?Q?xeON3XmgWxqUHLJdB6mAZqaukFtqD09x5F5VK08I8VP/+197bLPk2igZgPiL?= =?us-ascii?Q?5MKg6iNflOvbSujkk0x9FVPGRfEZ4H7uegcR1YPGbDtSIGHG5RhusNX7LZ+i?= =?us-ascii?Q?ZpUisyCva4M9zS0UoNgACWWQsIubCw1vwKseqIgNCOmMie3Khn15KdWrQ1t3?= =?us-ascii?Q?0JnnEs+2e90LkJm/LaI+bV5KOFBtLFg6T8KzNoxCvzh+JjRW0KX+q6faodJX?= =?us-ascii?Q?od5TBEQAGpOC4NP60MYIeRmqTWDSOmB8olSymstjXZiZ9YmU7Apfks2Da8Rr?= =?us-ascii?Q?iu3ziP2Im57239IhKMPp/zFwpjkv5FpVxyriLTw56zYZatE0t0YYN0/ILqou?= =?us-ascii?Q?5ebockCSO3IaRGofhl5npQ0b7XKkjB5CoizBmIdWwdZN6u6THqN0tmUwvblG?= =?us-ascii?Q?U5aOooumNI5whYcIn7aDtrf+v/l/TWpHP31ZP1Ld8hlZV43XX2cEaXt85Om7?= =?us-ascii?Q?INyTNv4q51T/sVjL36zH9QNFr7cQkD2vtSkl3xaZv0Rk5iTnzceCYAXHYC4F?= =?us-ascii?Q?MsBWDuXxHKqBE0QmQZdw0NSirK4dF7IXxafLcUeJKlrGe2fvvYuCYL7EDUBM?= =?us-ascii?Q?MmNmDdNzdjMI/CIxww7rscnhzAxvwkcW3gb1aj4RWG2tFuLyrI5g9d26R1QU?= =?us-ascii?Q?QBn4pIz27vjKRhf6bQ0zi8k6tqf6lgczWYGy0lO53BHQmwk32L7k6pSJOV0Z?= =?us-ascii?Q?daViSTIbFssEPkIVTKVqTNKfK0Sp6TcLECM8loJDDOUK1eKO0VpoETLoIqyT?= =?us-ascii?Q?NdBFUa47JcMQRBEmUCVjnT5r3ihJ0veSK12mm30f7xwnhgXIed3x6azpBj72?= =?us-ascii?Q?viXT7AUIf5+dyp8juUYb+D8b28APHH/0vBMztnIWMuDdFq2yv0XsFyZPDfdh?= =?us-ascii?Q?D8a6ahNS7PTftkRZ1JANj9gSoQVNZ7jSFbIAD7Va3/luCNzG+zqZy8CVSOhK?= =?us-ascii?Q?V0nO/BvhmJDwEylJlhnXNMEqmSdXJBxyhn8Xx5IsnliRbyG+yM6NbS184Ihi?= =?us-ascii?Q?wVzqF60kRrKJ87YF2mexS5e2+aiS93pj7PTC0HGxOufEORYaBucnZ3wMy86n?= =?us-ascii?Q?XdnL/op5d2ocAXHSti7m05ajGvsz5gxHsgOwD0JDUSM/VMmQgJ+gzLxYC457?= =?us-ascii?Q?7VYRkLsyk1+bUP153oP1kwXOc5feEgqeKU17luJ6BPasp1oF/a7qkh/7HoHY?= =?us-ascii?Q?ewO1nBXCqTLdZSapLiB7w+otxLEiRvIM2yuxnCrasBc/tojiL/LhKnW56oc0?= =?us-ascii?Q?5Q=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ee13a77-9f45-432e-eba0-08da64ed1b4a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5056.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2022 16:31:15.6142 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9g312/3O5qxeaMK1nJ90tWipBRIQs+2SoIKYIFc4VB+XNpgOJfLnnRSCN/5R5aCcOgybJkV0ElolyD32SE9wXrPu34H3+4y2ukLPjP13FKA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4893 X-ZohoMail-DKIM: pass (identity @NXP1.onmicrosoft.com) X-ZM-MESSAGEID: 1657729908717100001 Content-Type: text/plain; charset="utf-8" From: Andrei Cherechesu Added the parsing for APPEND_EXTRA_CMDS variable, which enables the user to specify the path to a text file that contains, on each line, u-boot commands that will be added to the generated script as "fixups", before the boot command. The file specified by the APPEND_EXTRA_CMDS variable parameter will be copied as-is in the generated script. Signed-off-by: Andrei Cherechesu Reviewed-by: Stefano Stabellini --- README.md | 5 +++++ scripts/uboot-script-gen | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index cb15ca5..3566a6d 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ BOOT_AUX_FILE[1]=3D"uboot.cfg" =20 UBOOT_SOURCE=3D"boot.source" UBOOT_SCRIPT=3D"boot.scr" +APPEND_EXTRA_CMDS=3D"extra.txt" FDTEDIT=3D"imagebuilder.dtb" FIT=3D"boot.fit" FIT_ENC_KEY_DIR=3D"dir/key" @@ -197,6 +198,10 @@ Where: as you can pass -o FILENAME to uboot-script-gen as a command line parameter =20 +- APPEND_EXTRA_CMDS: is optional and specifies the path to a text file + containing extra u-boot commands to be added to the boot script before + the boot command. Useful for running custom fixup commands. + - FDTEDIT is an optional and is off by default. Specifies the output modified dtb, used for reference and fdt_std. =20 diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index f8d2fb0..f72551a 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -416,6 +416,10 @@ function check_file_type() elif [ "$type" =3D "Device Tree Blob" ] then type=3D"Device Tree Blob\|data" + + elif [ "$type" =3D "text" ] + then + type=3D"ASCII text" fi =20 file -L $filename | grep "$type" &> /dev/null @@ -1238,6 +1242,13 @@ device_tree_editing $device_tree_addr # disable device tree reloation echo "setenv fdt_high 0xffffffffffffffff" >> $UBOOT_SOURCE =20 +# append extra u-boot commands (fixups) to script before boot command +if test "$APPEND_EXTRA_CMDS" +then + check_file_type "$APPEND_EXTRA_CMDS" "text" + cat $APPEND_EXTRA_CMDS >> $UBOOT_SOURCE +fi + if test "$dynamic_loading_opt" then echo "$BOOT_CMD \${host_kernel_addr} - \${host_fdt_addr}" >> $UBOOT_SO= URCE --=20 2.35.1 From nobody Fri May 3 12:51:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail(p=none dis=none) header.from=oss.nxp.com ARC-Seal: i=2; a=rsa-sha256; t=1657729920; cv=pass; d=zohomail.com; s=zohoarc; b=HvdHLg8UkCDDsXmL7Kx5S6dSB6TMIaBmARtW0X7SVa//vp1q6QUTK8CGUWOKHHxnqdO7q5ZhkWqrP9uMAv7EHSSCYNSeLIeyB1WN3sp7KHo69Cvi0NmW+pxAoK+5Jr7frMidbZe8+n+t/jx4F+sXiaJwt30d1TgmTJn7IJ2Xzq4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657729920; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uwKeDBebJwjIYx1Qo5KRUn+UFPyCgLpm22C/91nkWr4=; b=Gj0TUL8zZ31X+LMViSWFpW0x0qDXiJ4UQFFyMmgx6+JHeGeHcI0H38iIZfPMw5W5xez2jwyM7nNLky/0dCScLBlISH2zUUlZP/VHEZE3TWSPoElUF1quNWbtexIJzbf0SDJmhRmg4AXkgGUgPw7MHo8MZSaPgS4Ji5mMPxJT3j8= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1657729920342172.84014203507695; Wed, 13 Jul 2022 09:32:00 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.366876.597821 (Exim 4.92) (envelope-from ) id 1oBfGj-0003te-QI; Wed, 13 Jul 2022 16:31:21 +0000 Received: by outflank-mailman (output) from mailman id 366876.597821; Wed, 13 Jul 2022 16:31:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oBfGj-0003tR-N7; Wed, 13 Jul 2022 16:31:21 +0000 Received: by outflank-mailman (input) for mailman id 366876; Wed, 13 Jul 2022 16:31:20 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oBfGh-00035D-WD for xen-devel@lists.xenproject.org; Wed, 13 Jul 2022 16:31:20 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2068.outbound.protection.outlook.com [40.107.104.68]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 390a49aa-02c9-11ed-bd2d-47488cf2e6aa; Wed, 13 Jul 2022 18:31:19 +0200 (CEST) Received: from VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) by VI1PR04MB4893.eurprd04.prod.outlook.com (2603:10a6:803:5c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Wed, 13 Jul 2022 16:31:17 +0000 Received: from VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::c2a:42b9:f908:e991]) by VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::c2a:42b9:f908:e991%6]) with mapi id 15.20.5417.026; Wed, 13 Jul 2022 16:31:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 390a49aa-02c9-11ed-bd2d-47488cf2e6aa ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DAjRY1aKk49WIgUCzjN5b31/IZaXOTKvzbgaAXnXoBkC/IqTbCcvjubhofKh0YdmRMljEA0ZPvvO+fPum++5Gt43ajl9Xe99eiPk+XRSPpEzqZMIlHRZkB92ecHsldMviPf30FpFk+TS8Pdmvleu4ARcjvguvf6Jg1M6w2EuG1hWH/TxdoXs67PQtX2ECnbHsGOUcEFru/KthMuIPFJhocxutIa2V+AHi2KISwtRH7j6pmWQ4Bj5k62IJXxIbv9XL/mZRjfX/H2Pe5oLo994LKdNEsa0RnOQWAK1O7wfxXZHQYW9QA/2h6CkMWlDct5Zd0lZCjpq1Fw8M7Amyb2jTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=uwKeDBebJwjIYx1Qo5KRUn+UFPyCgLpm22C/91nkWr4=; b=e9cYdKKXgnwoIR3Av1erPKvEdGXSkshryzcHBcfYeegALLH9btawuMkk0wbYIXEmtLzN7mwDIQYYaHGOsgMrHvHm6/WyvM6cq75imrCb1H3ZEQWlSA8VPE8wIjpub+mBwH5Sbg41fWEKR8D4jt38N/o5Q+NXqrAmMe6Q/zOw9OrgF0nDVmwy0x1O3z8KVEf+M1TYnGqPHvnT3lEGD5TufEIzYkigUx4euRw0WpCloKN3arkkzJFJBtOggGgK4b+AWJVWaOWPrl29zIFSAlYry51ibPWrFQoF5DE3zUszt1L3YUgYL480T05k2wFFJRe14e4dD8SDIbvAuxKGTWrAag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uwKeDBebJwjIYx1Qo5KRUn+UFPyCgLpm22C/91nkWr4=; b=XcMemcdtYKM6RIOzQefMhfarzQGBCgh3BTBFj1OenFQj6PLZZbW+8O+4HPidUjpKJMnFvhDttOCwqY6pZYPtKHbEjkRnRAbaXuNP7oKkUw1b8NHJ4g8VGg1ni8U76u0z6EClLqigOk8G6AP9DwHGsCM2c0Y0wwMeKciUvEYVUWw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; From: "Andrei Cherechesu (OSS)" To: xen-devel@lists.xenproject.org Cc: viryaos-discuss@lists.sourceforge.net, sstabellini@kernel.org, Andrei Cherechesu Subject: [ImageBuilder][PATCH v3 3/3] uboot-script-gen: Enable not adding boot command to script Date: Wed, 13 Jul 2022 19:30:44 +0300 Message-Id: <20220713163044.3541661-4-andrei.cherechesu@oss.nxp.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220713163044.3541661-1-andrei.cherechesu@oss.nxp.com> References: <20220713163044.3541661-1-andrei.cherechesu@oss.nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM0PR08CA0022.eurprd08.prod.outlook.com (2603:10a6:208:d2::35) To VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38a5bd6a-79c7-4edc-b45b-08da64ed1c3b X-MS-TrafficTypeDiagnostic: VI1PR04MB4893:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jXvn7kw9b3BAlgk70W448MiIJ1FF35LvFMhX5LMWEp7bEnpJOc5uiwMq5XPeCVyIl+7dcrmFlytKgkRoxElZ8YlJY3m9zj+q1woVyBnczV8HDDWEwCwTHm0HYeiWFFCIlOfsH0zxQ4OzGo5hg3Q0n4drfhDb1yBnCttIDHq3unwtrXnelESyk5YR6RgY+AU8sEnytPNIOUcvHvNsZrPd70bWuMpu16ejVL6ZlK+MaUDsU1CtiDQNMa59xYUhldJ8caRUqa2mtQB19kCO9dQS0wKbIr+uj1HUP0pNgElQiw8m7aCarI2NHToqGGmFwrY1v4wS65nn08Vbc9nWpcWtVoA6S60r8U5zeOoaC4Fq97Fq4gfTOhPJmg6RuH+NX2Mgw6Kd6bEhBBkBnh8wRYkvbdGZbyHU5+0CazU5xGe/P3WrvgZq8jO451M1dXXwH58eTt+y2ggbJzKqcUY64XBWcniMrZtGdJ7EleHeFrrjiJw3aCu8WYtRK8P3kLEJ5aQN4U8GMQwEnRWUGmCYm37BamelQc94L5JUo9dkpAiRO5+sPWhKbaPYBS3M6c8gFNL32HNrYgqhzzhd1HpPoIycbvNq/l1eDFaWfJtNBQwoRkr9gNegg6VV/7C9tgvHdtZpxDw1q97yPBkatjBI9Ao670V06yutYEwPeR3+LiQqd6ZgvWwjDjP70X2hH580ql3pC+94PtaTFNrGuFm+fykQ/NH7DYN16swvlmEYDl32380lVZnuD8v5NcMg7e1z62RBM93unjKeWbu3r3nSlR7qLQkwY+1t4U68cqSDlwv6r6urYGPmQhM+jTQkk5TIGRRH X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5056.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(396003)(376002)(136003)(366004)(346002)(39860400002)(83380400001)(86362001)(38350700002)(38100700002)(8936002)(5660300002)(478600001)(6486002)(6666004)(41300700001)(6916009)(6506007)(316002)(52116002)(4326008)(66476007)(66556008)(8676002)(66946007)(186003)(6512007)(2906002)(2616005)(1076003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?0YmgZcCCpqZiq7pxm2LR7EhPrSHzChZZfuj/Hrsz5gaQJI60RyLa0h4pPuGe?= =?us-ascii?Q?iS8hG3KQ2uY/gPR1vx1yXhnGa9oSBk080jKVGCg35o8/oW7MQGNrqfZiVyPm?= =?us-ascii?Q?Atl5ITez4N2igPFlx24T/ARuwKFTwHpGqAnUp2mA+bELpK229rOTT3Cd8+tP?= =?us-ascii?Q?7JurHNt9CJ9RZBM7Bwe/IHPuiXwCmBhHPzpYXZzviLWldiIBcpcH+Zd4Itnv?= =?us-ascii?Q?l7XK9Xk/fBEvO964UbtbHyIHrCaQjnOVH0URXJ6J+BWOF9biKdJaKxCz8g1f?= =?us-ascii?Q?R60gxeTP/QdZJfpFAHr6g2YDU/v5RNmwjnk/nv2tI8LEUUpcKckyfrfPjofk?= =?us-ascii?Q?BCCcai5ojSXGr7JwJz4U/R5J+SH9rlh5laV2h/gkND8MCXY3UUIrPf4VUnJx?= =?us-ascii?Q?v3ancvV7Sr81K+fcW5zKO5/t1wsyCaFKJTImgKcC/fZhPi8hM/pIFl/zmmYG?= =?us-ascii?Q?Q5GcKmst5Sxcc3TsAoTA2a3JyHTVZ21DlHQIXpDA0vkFohvRoY+ZZFXmIivj?= =?us-ascii?Q?F57FUG35rAo/0G6RK74tdWSun5M20laQQ3bhrXQNJKlJHhxiiJYv3l6tVmp8?= =?us-ascii?Q?LfnUiB6Ykiu+SFcrYtYyfK+b/jqSxEgUoTIWF9h59Sc1QNpLe46G6+PWOPhd?= =?us-ascii?Q?rVFW2AtpEjOJf/R+Mk8gGAee6IjvLaTv94Ryvnan4VK3PAAxSCouKScahGol?= =?us-ascii?Q?rB07PNXMh72RMzYn9mx2pvKu0uADwxFd1J4relI9eZeSI78+0uuG5L4eb7gE?= =?us-ascii?Q?OI/owmhG1Xk5s01EGNQAu7VEr1zXrcLGOuQRrt9NBsbi2S2bpx7+yNjsS7Jy?= =?us-ascii?Q?bCL32g083s1VJJSprsfOkjhQQcetC9TF1OZhEjV77Q4s1nG+LMPQr/8aggh/?= =?us-ascii?Q?K14kTp+OAZHHTDsMGa69D73CZliPKbcVXywm2fkMUQFM4rd8NlE8f8P4TJlR?= =?us-ascii?Q?ON6A9ZyHkyLpJE/gD2MGWjwG+yCLQAZ+s5+LcL58xRn12tg+ZwnrmpRPpD2p?= =?us-ascii?Q?K9ilitoFs7IGuXCXQlSIJ2NS6bKHac5XE6Vl/QUUgMo6NOhEwcqDqY5x/AjG?= =?us-ascii?Q?Rr2mmvEDJl3QG2J5dg2SDqQYpALC57eBRcednL8ubexBHkWPqflaThkoS0iE?= =?us-ascii?Q?pSnZZDtYQK37kDWJwb80CpmdK4bzmFfPSgD88nFhT684QBci7YBijHsaV8VQ?= =?us-ascii?Q?09t7dP3Ic3cG3Cq3H6TWIjRTolwoI3tw8GMUoV2bot+oyrwGJg316Un2+3Ql?= =?us-ascii?Q?h/m3fxtUkkqbY6QCIxk42L9+WleES/6vBqTGFx60W0drcbjElQlnYTDNzbzj?= =?us-ascii?Q?zJY+B4ZadDSuvZ3sBnShynQLaAw1h/ZiL/DkK+GziMrB8yVA3fNdVmpad9La?= =?us-ascii?Q?7vN294dS72h+Wo3Z4eR3TMilRevw2c9h4ss4qt2VeatezzamdCw9LZO1Py3/?= =?us-ascii?Q?coPmvs5LlgzWs+SDJOi1I63pb74WTiq/JMwHrASZTo98W/HeiN+2L4edeG/j?= =?us-ascii?Q?lKade289aoTMrZ50Hub2Mtfml1b27NbZDQhGgv6OaEMurnOUD+svs1JHLEnQ?= =?us-ascii?Q?RBF7uAZAHVqMxW4bFGGBiUFLcgFny29ZO/YG3a6hDIzEC7wERkIqHJo6peQ7?= =?us-ascii?Q?EQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38a5bd6a-79c7-4edc-b45b-08da64ed1c3b X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5056.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2022 16:31:17.1297 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KuGgE3vq74fc35QzRSq1CGbyOLhwc8k4vQqqEB0KJqmjPFTX1zJaVKDiEgoKyHFkzZQYSgrRJb36nuw/4WpwLbpAmRx37nnVe3F6SY2f5YU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4893 X-ZohoMail-DKIM: pass (identity @NXP1.onmicrosoft.com) X-ZM-MESSAGEID: 1657729922354100001 Content-Type: text/plain; charset="utf-8" From: Andrei Cherechesu If the "BOOT_CMD" variable is set to "none" inside the config file, the boot command (i.e. "booti") will not by added to the generated script, to allow the user to customize the u-boot env or the device-tree after executing the script commands and before actually booting. Added commands to store the addresses where the Xen image and device-tree file are loaded, in 'host_kernel_addr' and 'host_fdt_addr' variables, if BOOTCMD =3D "none". The `booti` command can then be executed as part of the 'bootcmd' variable in u-boot, which should contain: 1. fetching the generated u-boot script 2. executing the script 3. running `booti ${host_kernel_addr} - ${host_fdt_addr}` command Signed-off-by: Andrei Cherechesu Reviewed-by: Stefano Stabellini --- README.md | 5 ++++- scripts/uboot-script-gen | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3566a6d..07ad432 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,10 @@ Where: =20 - BOOT_CMD specifies the u-boot command used to boot the binaries. By default, it is 'booti'. The acceptable values are 'booti', 'bootm' - and 'bootefi'. + and 'bootefi' and 'none'. If the value is 'none', the BOOT_CMD is not + added to the boot script, and the addresses for the Xen binary and the + DTB are stored in 'host_kernel_addr' and 'host_fdt_addr' u-boot + env variables respectively, to be used manually when booting. =20 - DEVICE_TREE specifies the DTB file to load. =20 diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index f72551a..6a8a2b8 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -966,7 +966,7 @@ function check_depends() =20 function check_boot_cmd() { - if ! [[ " bootm booti bootefi " =3D~ " ${BOOT_CMD}" ]] + if ! [[ " bootm booti bootefi none " =3D~ " ${BOOT_CMD}" ]] then echo "\"BOOT_CMD=3D$BOOT_CMD\" is not valid" exit 1 @@ -1251,9 +1251,19 @@ fi =20 if test "$dynamic_loading_opt" then - echo "$BOOT_CMD \${host_kernel_addr} - \${host_fdt_addr}" >> $UBOOT_SO= URCE + if [ "$BOOT_CMD" !=3D "none" ] + then + echo "$BOOT_CMD \${host_kernel_addr} - \${host_fdt_addr}" >> $UBOO= T_SOURCE + fi else - echo "$BOOT_CMD $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE + if [ "$BOOT_CMD" !=3D "none" ] + then + echo "$BOOT_CMD $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE + else + # skip boot command but store load addresses to be used later + echo "setenv host_kernel_addr $kernel_addr" >> $UBOOT_SOURCE + echo "setenv host_fdt_addr $device_tree_addr" >> $UBOOT_SOURCE + fi fi =20 if test "$FIT" --=20 2.35.1