From patchwork Fri Sep 30 07:36:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1684729 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=r1GAQFVc; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mf29S1Btnz1yqc for ; Fri, 30 Sep 2022 17:36:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0955A84CD7; Fri, 30 Sep 2022 09:36:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="r1GAQFVc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E3DD184CD9; Fri, 30 Sep 2022 09:36:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2060.outbound.protection.outlook.com [40.107.237.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 526CE84CCB for ; Fri, 30 Sep 2022 09:36:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=michal.simek@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NTfJod863X45aI3ElVv/iz/29bKMLdYMW8F590+gzAi+IeI/l+l5k+aE8itRpswF9mev6Cb9nRYshtGwO7znLppF+bpfnMRNrIMXJHcCkHAwWbdJW29nLVsC7eAKtG3gcsItibBmRuWq5uIbXYxZ+NXvwRrBHjjcg7WE95gqSCKqp0nb3VwNidW+9itYXS9Q9tlR5eFiysclWH2qEThy2Di0AH1Nv9D8Z0uuMKuo0DzP18ZmZ6FLv7DrYxDCdCP3qQ8Kjv9L4jKblWa7PM4aRyLTlqn4sWZyKEKXz0Xg8b/BTTohmr154I8hU2GssPEnaeCHudZucRLnjTx/7AlRiA== 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=JseqnBS37uX1xRASoUEJFZRL0wv2Fx9mdOtJaZQwbjE=; b=Og4eagmbHQPdvQX1VCgRdYTDN3h+hz3+GsAWgkcXXnB5X4GkZiFq0pQ1Otm2g7Z3CLLp+Ej0EJNX2QbffR5f9bGxIMBPEtd9NomDfryCxO+ikQr2sKyAZ0rx8etwMewXBRpqBk+NMDh1GheY/F6I320FKX5UnO379Bo1oP1croOrdbv4W5kYveHaYAjZRH/NKpGPojsUFutVaWJ6Xf/HG+fFPY1T1xCHDdbqWUqVVevegrW1PyX/hGohFGj+BpiFHPoaRx2ghD0Zfnetv+eDVOTlCM9xjPTTlRjI7E/9Psu4tUnBGYSZv3Rv6QbVAdYRhpdzj1DxOw01pytNMk5x6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.denx.de 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=JseqnBS37uX1xRASoUEJFZRL0wv2Fx9mdOtJaZQwbjE=; b=r1GAQFVcCI7YA1JiYJ+ZbXZ74nH0UelVvarBfUxBCvRWtHp67f/cNu/q8CxOHJ6IHAd4mTZl1NGeQRt0TMq/xCs0frAo19xdaaLsvV9UypXTG3hhQpl8i4CrKuU4gkRYp67PPYnbhT9Nl3pkO0d8u/g5q6kRMeRwaFanBa4779c= Received: from BN0PR04CA0064.namprd04.prod.outlook.com (2603:10b6:408:ea::9) by MN2PR12MB4455.namprd12.prod.outlook.com (2603:10b6:208:265::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Fri, 30 Sep 2022 07:36:31 +0000 Received: from BN8NAM11FT085.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ea:cafe::d8) by BN0PR04CA0064.outlook.office365.com (2603:10b6:408:ea::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Fri, 30 Sep 2022 07:36:31 +0000 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 (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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT085.mail.protection.outlook.com (10.13.176.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5676.17 via Frontend Transport; Fri, 30 Sep 2022 07:36:31 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 30 Sep 2022 02:36:29 -0500 From: Michal Simek To: , Subject: [PATCH] xilinx: zynqmp: Load pmufw configuration before checking access Date: Fri, 30 Sep 2022 09:36:27 +0200 Message-ID: <8d9d465b448d7a01c1a07e5835f8a1f5a338e3a1.1664523385.git.michal.simek@amd.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT085:EE_|MN2PR12MB4455:EE_ X-MS-Office365-Filtering-Correlation-Id: 3efedfc6-bd0b-4974-e3e7-08daa2b67e37 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bUjUJB74eC3VgnHB5qfQzFErrSkkZ9m0aljt1HerpOCGHCqDXrM19MT1g8ZevebY6Wzry0wU7Ai+7ja/FcBIz+dRw5LzPurH8wMcdqtGjFnqVLLAwOADOqYAMN6Wrjr6LeUK43n6gPtY5xO17zN1I77GAoS9rbBl+16NVF4nXz4xlTp432tWGRmbhDedkRD0HJThPF4AkncCpmiCfzLAJuJHm4fnhepiIWAca6lwweLtT2+kz+3hx8Egu03gve71ghgkAfkOfefIgu/2AD4YfodtM5PsIleFTfDl9xZF9c255BgCqliI1NOk8O0qXvez3UuEwnXqOOMdzxOdMdwIfo/66/L6iSaetpPx74P4NCTvIiwTZ3VO0d1ITLG687K3dnV2IT42rWRtmnQf+jL3em+5pM6ZVx5dXXsCbZdgpdN8oK7+ChWezIS0GebLJv5NLDRVaPSTgDz1SVo4NatCcXmhajdI54CdZlxU5gTj/B29nWJi3e4L0pCFQkgT8bdDcB02fEbbbixMY7eK+pQAqWFv8TVNF6D2r/AZaEQuvZf5e3Y2FrDtRwNi0yutOb2B74ktwgS6Ggma+7HrK3Z7ExFkQaD9ePj34L00houB0cjFJ//g+yUjCsVYoB6X3I97veksfZsIsi1ULJpSmuky8v1k8JW7VzZU6pb0KxQFGrBauYQumdh6LSjDYs62l+CDYd9d1psIH9Ax2JL4GIjkw3orPFZIvEpihj6o0/sxHFncpTb9lARcMfxuGTfgFb0O+gxZDiVFnMwR2hZf3Lh5A5qrS0c9vqcLRx24Ptt0i4U= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199015)(46966006)(40470700004)(36840700001)(40480700001)(83380400001)(356005)(478600001)(81166007)(82740400003)(82310400005)(36756003)(26005)(2616005)(8936002)(2906002)(47076005)(86362001)(5660300002)(186003)(16526019)(44832011)(316002)(41300700001)(426003)(8676002)(36860700001)(70206006)(70586007)(40460700003)(110136005)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2022 07:36:31.1061 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3efedfc6-bd0b-4974-e3e7-08daa2b67e37 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT085.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4455 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Before this patch you could see in the log: U-Boot SPL 2022.10-rc5 (Sep 29 2022 - 15:29:27 +0200) PMUFW: v1.1 Loading new PMUFW cfg obj (32 bytes) PMUFW: No permission to change config object Loading new PMUFW cfg obj (2032 bytes) where it is visible that permission is check before sending PMUFW configuration (big size). When this patch is applied it is visible that order is correct. U-Boot SPL 2022.10-rc5 (Sep 29 2022 - 15:47:08 +0200) Loading new PMUFW cfg obj (2032 bytes) PMUFW: v1.1 Loading new PMUFW cfg obj (32 bytes) Signed-off-by: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 0b30dd048eb5..f1eb4ff38908 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -227,6 +227,14 @@ int board_init(void) char name[SOC_MAX_STR_SIZE]; int ret; #endif + + if (IS_ENABLED(CONFIG_SPL_BUILD)) { + /* Check *at build time* if the filename is an non-empty string */ + if (sizeof(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE) > 1) + zynqmp_pmufw_load_config_object(zynqmp_pm_cfg_obj, + zynqmp_pm_cfg_obj_size); + } + #if defined(CONFIG_ZYNQMP_FIRMWARE) struct udevice *dev; @@ -236,10 +244,6 @@ int board_init(void) #endif #if defined(CONFIG_SPL_BUILD) - /* Check *at build time* if the filename is an non-empty string */ - if (sizeof(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE) > 1) - zynqmp_pmufw_load_config_object(zynqmp_pm_cfg_obj, - zynqmp_pm_cfg_obj_size); printf("Silicon version:\t%d\n", zynqmp_get_silicon_version()); /* the CSU disables the JTAG interface when secure boot is enabled */