From nobody Fri May 17 10:34:23 2024 Delivered-To: importer@patchew.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=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1663071006; cv=pass; d=zohomail.com; s=zohoarc; b=aEnc66l50G1ib5jGYc0PRSjRbeVVro8PVS1CzkfcpCfIGMAOpNSOq8TAasJvYhq6a6IgA+LuD6WLgBthqOvAN4FUzlOEJLL3j1ZllvRW+83KrMj26rfzJmg63oJR0Wn2o+DPga/t2/dm3xzvDrW0beZo+iPwuPeEV9kaVWph0Y0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663071006; 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=MEXWX4yZaSQA0d1dChkxu1twPiiUlC11JnRmnwZf8V0=; b=DkAziWdnD14NbFRl9DbcvggwEuYwWiJ+zJaqzuhfL9J/J08onePdUWfIu9WdR6iC6tKtZYPLC6D+45PWHoPhm/Hs3k8awy+TGTQGGW3rNtY/NZOhcmL06l3I1YEyR/63rP7KeQMtu9EbFCRvPQITRDRULuMk9yYCuCg8qux1Tm8= 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=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1663071006682883.9149643883192; Tue, 13 Sep 2022 05:10:06 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.406346.648726 (Exim 4.92) (envelope-from ) id 1oY4jO-0002JY-KC; Tue, 13 Sep 2022 12:09:34 +0000 Received: by outflank-mailman (output) from mailman id 406346.648726; Tue, 13 Sep 2022 12:09:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oY4jO-0002JB-Fl; Tue, 13 Sep 2022 12:09:34 +0000 Received: by outflank-mailman (input) for mailman id 406346; Tue, 13 Sep 2022 12:09:33 +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 1oY4jN-0002Fj-OI for xen-devel@lists.xenproject.org; Tue, 13 Sep 2022 12:09:33 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2048.outbound.protection.outlook.com [40.107.244.48]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ec5b6bad-335c-11ed-a31c-8f8a9ae3403f; Tue, 13 Sep 2022 14:09:32 +0200 (CEST) Received: from BN0PR03CA0060.namprd03.prod.outlook.com (2603:10b6:408:e7::35) by LV2PR12MB5920.namprd12.prod.outlook.com (2603:10b6:408:172::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 12:09:29 +0000 Received: from BN8NAM11FT110.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e7:cafe::df) by BN0PR03CA0060.outlook.office365.com (2603:10b6:408:e7::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14 via Frontend Transport; Tue, 13 Sep 2022 12:09:29 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by BN8NAM11FT110.mail.protection.outlook.com (10.13.176.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Tue, 13 Sep 2022 12:09:28 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Tue, 13 Sep 2022 07:09:28 -0500 Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Tue, 13 Sep 2022 07:09:27 -0500 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: ec5b6bad-335c-11ed-a31c-8f8a9ae3403f ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XdTVpN6Cnl6mCo9qmBVSjK4vgNuKEKgycPzdr918sRDIOmKuNjHqa3wjoA0ntd8YeoP0qGaHdSlF6Eho3dDz0VH9yxggCQdLz9mXW0Ukgjy3+JKsbVqwkF79D5ZQJE5Idn9vVnd9PzzyR+j8hlLtR/UEzaawnZBs3rH6PG3aHZ+iiUpr8/sKWvGjCCQ9bMo2ppOmT0/2E2NWy4UDN4Ssg8i5bEgkI6sMtQv3izVVhDknGRp739reVAKwrIsc+jFI91/boz+bi5KmFheEDknu1eYyPooES/+fjTV8M1ElKzK4dP4IpiftJzN6TuonBDoP3B1S3kv/C6uaGXKzDM+g+Q== 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=MEXWX4yZaSQA0d1dChkxu1twPiiUlC11JnRmnwZf8V0=; b=Kab2njFk0k3r2FPF09olu7XxApf5K10OjQAryDGNldot/JZTnq87RPqCnxW4KfIZXXb/YYzNtRDITlXkitfugP4aYUnmDlgryLRXZy+FIBLiO7SJIYCyQnc0VcY1jxHwP1AGhzSeKtgcattcjWBQdvsttUC3DGtN8kfRNyxhf94hF9L/OCngCx7vReTggSHg7ROqsS8H1LJWO5eQ+XdQsC99EUUkDgYP7LaL34VJzpiU2wCO3s/B/NziG12tUt6Jn9tBBV0VofQB8D1Ku+6kw6mW2dDXYVaQm7TDtTyExOUA8dJ1UJgxMhBmbfOfqL5lGcnhPGXT+4b1zzk1nYiw4Q== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MEXWX4yZaSQA0d1dChkxu1twPiiUlC11JnRmnwZf8V0=; b=DVdK4G5Q1TB49+OfTgJJpuUBkwBPxG0tF+5Sq0On4aiQmRA9WIydIOYltiJI3jhjpfdERROx4AAyMus40QDcDTXfSwKwio+6VBFh9/fcQLM7IF/VG62lb753JwONNrHYYXB6+ormngar4U2uemMTSMp5+8BP+smIphEAO3SMnqU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; 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; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Michal Orzel To: CC: , Michal Orzel , "Ayan Kumar Halder" Subject: [ImageBuilder v2 1/2] Refactor sanity_check_partial_dts Date: Tue, 13 Sep 2022 14:09:17 +0200 Message-ID: <20220913120918.31162-2-michal.orzel@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220913120918.31162-1-michal.orzel@amd.com> References: <20220913120918.31162-1-michal.orzel@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT110:EE_|LV2PR12MB5920:EE_ X-MS-Office365-Filtering-Correlation-Id: 51cddbc5-53d7-47bf-c536-08da9580cef0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6nHNiyaoQIW7lSrjHpPwLiG4m/jTuZpc67LyMZtZevljMbKDj4Uf125n4F+phYKkb/lZhHjENHyWgMglszbVC5vATNCvwtBUN4cQMxsBTvU1K1bG/TvchuVi6vXeIRec/hEvqg3jEhZyKd91A3Onmc/TL4MmTuL9n9Oy8A9YdGtEasQTofTg5gVyG0pZbemLrQbH/6dS96xh1jazms96tMzyuhKEuku1Zi3rdD2x0wxKRYlErLK+wNogJpz4qL1nayQ6F4+XpEliRurfS7xyzXtecMLT1+6gtHVsKaU3cpwFNaB5CF4WZmr577bHQDF1x6NL38GKwpFIHR8J//B9LkW3oht/2fwOEfMILait8Kkdjszo8WnkVBx9pnsHc6kkLXMz2PuvCM4mKeAgYuayqflpHyy9Mi/gGF/Qozblm+6j7vOFhjSd5tllt6/pLTrgt2xBxp9FG2oixb0VNb0LX7HJZQb9vhFyfFAY0NhPvIISxQJVU1In67ua4kcZhRQaasJiCPTLxySJM5+kavhinHnoKQtOmld9Kc6ahgAU0suiZKYD1AzwFBEbOOqQt5VKh1We1r8nttoba3U8rdkpj2M9NoI8QJxZ9ofCawnEpFkwDZHsLKXh56Z++vuWQ0JMhz8Ev0wnozacPZysDa2JbHsrsGLV2Mz2/St9iFMK4KROerybGaMN2u+Ve39YqpSTX16ztfPaJDfVBvCdHBl0rB7J6vewfXQ8ENpE1kRJxilxqFfcuj6z/I9adbEmuULf+ghCHPEwuNy6Uff1w/cY3EytXFgX9BWVGZu/02jTEChqT/IAZEWsAYrV2nIvAaUm X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(136003)(376002)(396003)(451199015)(36840700001)(46966006)(40470700004)(36860700001)(316002)(356005)(83380400001)(8936002)(36756003)(41300700001)(186003)(2616005)(26005)(82740400003)(6916009)(336012)(81166007)(478600001)(44832011)(8676002)(82310400005)(1076003)(40480700001)(70206006)(4326008)(70586007)(6666004)(2906002)(5660300002)(40460700003)(426003)(86362001)(47076005)(54906003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 12:09:28.5959 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 51cddbc5-53d7-47bf-c536-08da9580cef0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT110.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5920 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1663071009535100001 Content-Type: text/plain; charset="utf-8" Currently function sanity_check_partial_dts from scripts/common takes three arguments where the last two (repo, dir) are used always in conjuction to form a path to a directory storing partial dts. Modify the function to take only two arguments where the second one is to be a path to a directory storing partial dts. This will help reusing this function in the future to perform sanity checks on partial dts that do not originate from a repository. Modify compile_merge_partial_dts to take this change into account. Signed-off-by: Michal Orzel Reviewed-by: Ayan Kumar Halder Acked-by: Stefano Stabellini --- Changes in v2: - none --- scripts/common | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/common b/scripts/common index 25c041270c29..ccad03d82b30 100644 --- a/scripts/common +++ b/scripts/common @@ -40,8 +40,7 @@ function get_next_phandle() function sanity_check_partial_dts() { local domU_passthrough_path=3D"$1" - local repo=3D"$2" - local dir=3D"$3" + local partial_dts_dir=3D"$2" local address_cells_val local size_cells_val local tmpdtb @@ -51,7 +50,7 @@ function sanity_check_partial_dts() for devpath in $domU_passthrough_path do file=3D${devpath##*/} - file=3D"$repo"/"$dir"/"$file".dts + file=3D"$partial_dts_dir"/"$file".dts =20 if ! test -f "$file" then @@ -96,6 +95,7 @@ function compile_merge_partial_dts() local dtb_dir=3D$1 local repo=3D$(echo "$2" | awk '{print $1}') local dir=3D$(echo "$2" | awk '{print $2}') + local partial_dts_dir local tmp local tmpdts local file @@ -123,6 +123,7 @@ function compile_merge_partial_dts() dir=3D"." fi =20 + partial_dts_dir=3D"$repo"/"$dir" i=3D0 while test $i -lt $NUM_DOMUS do @@ -132,7 +133,7 @@ function compile_merge_partial_dts() return 1 fi =20 - sanity_check_partial_dts "${DOMU_PASSTHROUGH_PATHS[$i]}" "$repo" "= $dir" + sanity_check_partial_dts "${DOMU_PASSTHROUGH_PATHS[$i]}" "$partial= _dts_dir" if test $? -ne 0 then return 1 @@ -146,7 +147,7 @@ function compile_merge_partial_dts() for devpath in ${DOMU_PASSTHROUGH_PATHS[$i]} do file=3D${devpath##*/} - file=3D"$repo"/"$dir"/"$file".dts + file=3D"$partial_dts_dir"/"$file".dts =20 # All the subsequent dts files should not have dts version men= tioned if test $j -gt 1 --=20 2.25.1 From nobody Fri May 17 10:34:23 2024 Delivered-To: importer@patchew.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=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1663071010; cv=pass; d=zohomail.com; s=zohoarc; b=nGMyh8qQkAtTJwY0XFbQve+10LYxu6gy4EO3g00qBSumFq9V0QQgupOa1LfgMJ7qMR7m3G97hoO7LT8ul0lTcCdjicCyQ6EeOmq/iie9jA9XPWG4AvAxPU/NeLkS/bA2Prl/qZ1FwOiLwLsKMkkKnPXnagytXlP/0P3tBPm1mk4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663071010; 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=8wTHJSvUWZwgvn3QOmXdODSY/f3JRBIovaGHJFdJ4Dw=; b=DGpSVz64g6Wxkd0qQIiPOIqXO/1ogwQpmkTpzbkwvmbW+E4tS+6PZhhDevN6SkcmIqB2/8Vvj9gZUgTqqmXYDjEwvhTrIspppMlwz/0lO3sb1FvMcCyUA+Hg64w79BxKkCNNzrJKssknbSN23gu+I405uhJcSbQ5DN4iqXezgi0= 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=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1663071010235897.1266874654551; Tue, 13 Sep 2022 05:10:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.406347.648743 (Exim 4.92) (envelope-from ) id 1oY4jQ-0002kw-TT; Tue, 13 Sep 2022 12:09:36 +0000 Received: by outflank-mailman (output) from mailman id 406347.648743; Tue, 13 Sep 2022 12:09:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oY4jQ-0002kp-QH; Tue, 13 Sep 2022 12:09:36 +0000 Received: by outflank-mailman (input) for mailman id 406347; Tue, 13 Sep 2022 12:09:35 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oY4jP-0002YT-EM for xen-devel@lists.xenproject.org; Tue, 13 Sep 2022 12:09:35 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8fe82052-335c-11ed-9761-273f2230c3a0; Tue, 13 Sep 2022 14:06:57 +0200 (CEST) Received: from BN0PR04CA0201.namprd04.prod.outlook.com (2603:10b6:408:e9::26) by BL0PR12MB4882.namprd12.prod.outlook.com (2603:10b6:208:1c3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 12:09:30 +0000 Received: from BN8NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e9:cafe::7) by BN0PR04CA0201.outlook.office365.com (2603:10b6:408:e9::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12 via Frontend Transport; Tue, 13 Sep 2022 12:09:30 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by BN8NAM11FT066.mail.protection.outlook.com (10.13.177.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Tue, 13 Sep 2022 12:09:30 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Tue, 13 Sep 2022 07:09:29 -0500 Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Tue, 13 Sep 2022 07:09:29 -0500 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: 8fe82052-335c-11ed-9761-273f2230c3a0 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mt0++xon76TvOybOQqq/c4KzXztwyfdAcweGxFeFCGhFZYp25wu+H0n/AR3xzPRLbJdNdKE8Njsr4bvQEodd6pEeqmq0baC2hPvJxoxsBkweCFcOkEgLXjRkA/edIN+X4gQCO7JrhzOPXLjv2x1OqsCH96rrAKrRUPSWtvnQ1x8gvJloHf/1ljlFNBgEdeZfTlp4OVkreQx0P4JXJKg/re+oSh8vK3E6B03FDCgq6AAlSLSS785UYPCAf5g6Yn5Y5TZ7YILGOEaGai9xwgQUa146iqAdSRKD8f4BgNaj4hqfUtcbbYDxsrc+COadvOTdb+qNF8/p/JILLllBcoAc7A== 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=8wTHJSvUWZwgvn3QOmXdODSY/f3JRBIovaGHJFdJ4Dw=; b=oMBr9gi0FeLnoPBFt/YdtB3ZusjycvSg+pXnlWhPUzjOjPhvOJzNJ3TkC+6ZeRjpdEkg3TBE6QixIN4UUuWXjZvp4fk9mNIjujilEUX/sluL+oeIoDf38Oloflxl+tts4fuOWp558jwzBRFCSkmSKOteysdS4qf+55ZjY4udy9UQ+GN6ocdm/DnMqzwgga8pI461KGjFQkIWqnMCTi26hnXqUjpm6B8ce+I1kv94nBtt0zGgWtYxuo4HmmizFx6Wh9D/q1fGq/zCfKRnSiaOL63biXsUEKSRn1Kc9o39HLC3hkk21P0dcN17bTjnKkP9f+A2TRYSzgP0yeTvQFppgQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8wTHJSvUWZwgvn3QOmXdODSY/f3JRBIovaGHJFdJ4Dw=; b=rlnPAy1+BizH05ain82NQKcwyK9QEoXK1oyRAgnu1+po5/J9ZvvKlIpBU8OLR4Sak9dLvOWnFPRKvFs80rj1iiQKAFzPa8l8A3QrE/Sn7mRjltTeAIxEIu9KZnR9Y1doxsnkAwhpMUoJADJEZZ9BuUPGjClVpl2kClEfLrgJQ94= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; 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; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Michal Orzel To: CC: , Michal Orzel Subject: [ImageBuilder v2 2/2] Add support for lopper to generate partial dts Date: Tue, 13 Sep 2022 14:09:18 +0200 Message-ID: <20220913120918.31162-3-michal.orzel@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220913120918.31162-1-michal.orzel@amd.com> References: <20220913120918.31162-1-michal.orzel@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT066:EE_|BL0PR12MB4882:EE_ X-MS-Office365-Filtering-Correlation-Id: f7c64088-6f41-417e-dc2b-08da9580d00d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +3dO/v/KiIgL/hIZ7aTCyDK/j6m+JssOY3t6040uJb4JN6tZMjXdCaBGei6t1ahbuWMXEVQV6WmvMEn6SCSfqctMXgl22sCV98DYZgOvmQzRKyEXQ0Cacw7OWNd9lh8pe4x9ab0o+xLPiRN00VHDxZ4Ybcr47Usdk5YBpZdFHQzWAie0EVY8iKBYGCcwZc3wxan8mp6XeBT3Py8xJFwFurFkfNJCqYh8s4owHyz49sswthkQnQrC55Svc8yU4bEvvpWPM3bh8mpOtY2vxiaLauLbYezM0SGcLnp/eRi/iH9STQJy3UzsAi613mQ+EA+yovbNWlDFpvAIt1VvrmweSDuiYmjAtpmZniVKWP+D6Tz9Uj19O87Hf3tmYnFLQ45A6SUbVo6fJ0G31tYYKV3JzoXJNv3rAHKRgTj2LPru9d5eec/FQrgtC1jsv0cTkg8SwL9TafQqPPTSAfKHEVxXVT3Uozcpfwx5uUIMJhzRDcwqMdaI5HDJBKTTZ7/gp3dHdnLfIqytcshAJQYbzo+TiE7H/jBPVKM1asM4bn5f0mMcihi5auxNJTR6Rz8q621lIHdHb66dH4Wi3MO1Jas18Iz7LYjuh2lmtb2zjb3ESe5iR0pMP8Ryk83ymleA82hNQO88zlotBRBi4Vpbo1IL1qjN3UUJYO+Etcr7Mydrjkifuf/x+yexiIjZYyWBxPyQc3yT5G3BligARknMGvg5/bMj3rHRVhoI/iKGp/5IwOByhoIX+XcwUMcIeTFZTpFMbdpzAfRVEpoRjBQAcINUR91dxCTv9DzcGl5ivk2D47woQIBChK3DeyFfrZf+T4Y00e5FmGiM5KbrU9R+UgbitA2c34WuzAKxzvLnrPRhaL4= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(346002)(136003)(396003)(376002)(451199015)(36840700001)(46966006)(40470700004)(26005)(81166007)(4326008)(316002)(40460700003)(356005)(54906003)(6666004)(426003)(5660300002)(86362001)(478600001)(8676002)(82310400005)(336012)(36756003)(36860700001)(2616005)(70206006)(44832011)(1076003)(82740400003)(40480700001)(186003)(70586007)(47076005)(83380400001)(41300700001)(8936002)(6916009)(2906002)(21314003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 12:09:30.4487 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7c64088-6f41-417e-dc2b-08da9580d00d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4882 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1663071011260100005 Content-Type: text/plain; charset="utf-8" Currently ImageBuilder can compile and merge partial dts obtained from a repository specified using PASSTHROUGH_DTS_REPO. With the recent changes done in the lopper, we can use it to generate partial dts automatically (to some extent as this is still an early support). Introduce LOPPER_PATH option to specify a path to a lopper.py script, the main script in the Lopper repository, that if set, will invoke lopper to generate partial dts for the passthrough devices specified in DOMU_PASSTHROUGH_PATHS. Introduce LOPPER_CMD option to specify custom command line arguments (if needed) for lopper's extract assist. Example usage: LOPPER_PATH=3D"/home/user/lopper/lopper.py" DOMU_PASSTHROUGH_PATHS[0]=3D"/axi/spi@ff0f0000 /axi/serial@ff010000" Signed-off-by: Michal Orzel --- Changes in v2: - improve documentation - update commit msg - use node=3D${devpath##*/} instead of file=3D${devpath##*/} --- README.md | 23 ++++++++++-- scripts/common | 77 ++++++++++++++++++++++++++++++---------- scripts/uboot-script-gen | 22 ++++++++++-- 3 files changed, 100 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index da9ba788a3bf..f4213d570033 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,20 @@ Where: - DT_OVERLAY[number] specifies the path to the hosts device tree overlays to be added at boot time in u-boot =20 +- LOPPER_PATH specifies the path to lopper.py script, the main script in t= he + Lopper repository (https://github.com/devicetree-org/lopper). This is + optional. However, if this is specified, then DOMU_PASSTHROUGH_PATHS[num= ber] + needs to be specified. uboot-script-gen will invoke lopper to generate t= he + partial device trees for devices which have been listed in + DOMU_PASSTHROUGH_PATHS[number]. This option is currently in experimental= state + as the corresponding lopper changes are still in an early support state. + +- LOPPER_CMD specifies the command line arguments for lopper's extract ass= ist. + This is optional and only applicable when LOPPER_PATH is specified. Only= to be + used to specify which nodes to include (using -i ) and which + nodes/properties to exclude (using -x ). If not set at all, the d= efault + one is used applicable for ZynqMP MPSoC boards. + - NUM_DOMUS specifies how many Dom0-less DomUs to load =20 - DOMU_KERNEL[number] specifies the DomU kernel to use. @@ -140,7 +154,7 @@ Where: - DOMU_PASSTHROUGH_PATHS[number] specifies the passthrough devices ( separated by spaces). It adds "xen,passthrough" to the corresponding dtb nodes in xen device tree blob. - This option is valid in the following two cases: + This option is valid in the following cases: =20 1. When PASSTHROUGH_DTS_REPO is provided. With this option, the partial device trees (corresponding to the @@ -149,7 +163,12 @@ Where: Note it assumes that the names of the partial device trees will match to the names of the devices specified here. =20 - 2. When DOMU_NOBOOT[number] is provided. In this case, it will only + 2. When LOPPER_PATH is provided. + With this option, the partial device trees (corresponding to the + passthrough devices) are generated by the lopper and then compiled and m= erged + by ImageBuilder to be used as DOMU[number] device tree blob. + + 3. When DOMU_NOBOOT[number] is provided. In this case, it will only add "xen,passthrough" as mentioned before. =20 - DOMU_PASSTHROUGH_DTB[number] specifies the passthrough device trees diff --git a/scripts/common b/scripts/common index ccad03d82b30..2dd98fb94d3e 100644 --- a/scripts/common +++ b/scripts/common @@ -9,6 +9,9 @@ # - NUM_DOMUS # - DOMU_PASSTHROUGH_PATHS # - DOMU_PASSTHROUGH_DTB +# - LOPPER_PATH +# - LOPPER_CMD +# - DEVICE_TREE =20 tmp_files=3D() tmp_dirs=3D() @@ -99,31 +102,41 @@ function compile_merge_partial_dts() local tmp local tmpdts local file + local node local i local j =20 - if [[ "$repo" =3D~ .*@.*:.* ]] + if test "$repo" then - tmp=3D`mktemp -d` - tmp_dirs+=3D($tmp) - - echo "Cloning git repo \"$git_repo\"" - git clone "$repo" $tmp - if test $? -ne 0 + # Partial dts will be obtained from PASSTHROUGH_DTS_REPO + if [[ "$repo" =3D~ .*@.*:.* ]] then - echo "Error occurred while cloning \"$git_repo\"" - return 1 - fi + tmp=3D`mktemp -d` + tmp_dirs+=3D($tmp) =20 - repo=3D$tmp - fi + echo "Cloning git repo \"$git_repo\"" + git clone "$repo" $tmp + if test $? -ne 0 + then + echo "Error occurred while cloning \"$git_repo\"" + return 1 + fi =20 - if test -z "$dir" - then - dir=3D"." + repo=3D$tmp + fi + + if test -z "$dir" + then + dir=3D"." + fi + partial_dts_dir=3D"$repo"/"$dir" + else + # Partial dts will be generated by the lopper + tmp=3D`mktemp -d` + tmp_dirs+=3D($tmp) + partial_dts_dir=3D"$tmp" fi =20 - partial_dts_dir=3D"$repo"/"$dir" i=3D0 while test $i -lt $NUM_DOMUS do @@ -133,6 +146,34 @@ function compile_merge_partial_dts() return 1 fi =20 + if test -z "$repo" + then + # Generate partial dts using lopper + for devpath in ${DOMU_PASSTHROUGH_PATHS[$i]} + do + node=3D${devpath##*/} + file=3D"$partial_dts_dir"/"$node".dts + + # Execute lopper with the following assists: + # - extract: used to take the target node, extract it from= the + # system device tree, chase the phandle references and p= lace + # it in a new extracted tree structure, + # - extract-xen: used to perform Xen specific modifications + # on the extracted tree structure e.g. adding "xen,path", + # "xen,reg", interrupt-parent properties. + # For additional information, please see the lopper's READ= ME + # file as well as usage of the mentioned assists. + $LOPPER_PATH --permissive -f $DEVICE_TREE \ + -- extract -t $devpath $LOPPER_CMD \ + -- extract-xen -t $node -o $file + + if test $? -ne 0 + then + return 1 + fi + done + fi + sanity_check_partial_dts "${DOMU_PASSTHROUGH_PATHS[$i]}" "$partial= _dts_dir" if test $? -ne 0 then @@ -146,8 +187,8 @@ function compile_merge_partial_dts() =20 for devpath in ${DOMU_PASSTHROUGH_PATHS[$i]} do - file=3D${devpath##*/} - file=3D"$partial_dts_dir"/"$file".dts + node=3D${devpath##*/} + file=3D"$partial_dts_dir"/"$node".dts =20 # All the subsequent dts files should not have dts version men= tioned if test $j -gt 1 diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index 1f8ab5ffd193..b24dca2b7f7e 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -1138,10 +1138,28 @@ fi # tftp or move the files to a partition cd "$uboot_dir" =20 -if test "$PASSTHROUGH_DTS_REPO" +# If both PASSTHROUGH_DTS_REPO and LOPPER_PATH options are specified, +# the former takes precedence because the partial device trees are already +# created (probably tested), hence the reliability is higher than using lo= pper. +if test "$PASSTHROUGH_DTS_REPO" || test "$LOPPER_PATH" then output_dir=3D`mktemp -d "partial-dtbs-XXX"` - compile_merge_partial_dts $output_dir "$PASSTHROUGH_DTS_REPO" + if test "$PASSTHROUGH_DTS_REPO" + then + compile_merge_partial_dts $output_dir "$PASSTHROUGH_DTS_REPO" + else + if test -z "$LOPPER_CMD" + then + # Default for ZynqMP MPSoC. + # The following command instructs lopper's extract assist to a= lways + # include zynqmp-firmware node (as it contains e.g. clock-cont= roller + # required by most of the devices) in the extracted tree struc= ture + # and to drop nodes/properties during the extraction process t= hat + # are not needed. + LOPPER_CMD=3D"-i zynqmp-firmware -x interrupt-controller -x pi= nctrl -x power-domains -x resets -x current-speed" + fi + compile_merge_partial_dts $output_dir + fi if test $? -ne 0 then # Remove the output dir holding the partial dtbs in case of any er= ror --=20 2.25.1