From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37E49C433F5 for ; Thu, 24 Mar 2022 14:26:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 20C75840CE; Thu, 24 Mar 2022 15:26:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.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=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="QBDRQm7S"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 32A15840D2; Thu, 24 Mar 2022 15:26:26 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20607.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::607]) (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 0C6C0840CA for ; Thu, 24 Mar 2022 15:26:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michals@xilinx.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k4tUfdPkJqjhiLm2gC+AqP2ntdEoeUuLYoEVhwQ1WeFwhzZV8syX7ZDcjMWS6rcfrelU8wi3/Mpq0DlVSplrpU2l2A9nWMLx4r2UgQwxqpPbVj2mVrRiv9rFZ89Tg57zmtYbJBya4nQLHx8jthKRcRD2xD0CP9P265LeHUwCbKgfDeIi0bEBMPL7IiVdj43vFbd6E1dHMSvdOWj4ipy28zYzJFodugO6W8q07irQ5wCRt/ukLL2aFcNznhOuv+TyWcGWxaWxgFxHCrdNsFJ5ZUP8fMC+RFZFsay5KmC+kMnJJuCUPdsmvKizryk0v8mmS9ol3kC+b0RobYwuGIZMqg== 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=4n5NkYd1UxM7KZmfTdrOIwlJ0GNT9Oq0/WC52t9xMxo=; b=DEWUv6klxx27Ojq43oPhjYixsoc0UZi9jNlzAQfmVyLK/Nd/+xK1SwSgNBI16uRgUANuNFoQt/UZKUrr2JeiFiYwCQq62g4FTafgDkuNUO8PdRU5OgYE7RHjr96n4Mfi61SBjCMSOudAvvLU2xAolqXEDXhPjBFVoyDnNX30FvmtHsfBbbhIEDlg4hDngSEVQh+xJEOtDETCruVtMn2Tc/brNZuJWxsCOJRyKt4TaqT4P8HgAzVnh5/I/JPPoVVuiAvSZWnmZranbQOOiO/FbtnitFMPN6dpJKmURMRzaSGAnXHPSpuYsTpFVHg3z4qSShLHeMTbWls7VDjh2Bd6pA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=foundries.io smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4n5NkYd1UxM7KZmfTdrOIwlJ0GNT9Oq0/WC52t9xMxo=; b=QBDRQm7S4n0Elhl/ckYCg2GY0DcDKEQXJAZCLEidhbU/iPkleojSULIL0AV+l3CBavbXWVGsOgWRrZBXK0V358X6jS1lTYRp4y3xMXKQprzp0psgGu+7sSqR0343qyNCCII7uLTfdCeXolwXjgCz5g6cv35biRXg+Gwi7sWLwQ8= Received: from SN2PR01CA0069.prod.exchangelabs.com (2603:10b6:800::37) by DM6PR02MB6509.namprd02.prod.outlook.com (2603:10b6:5:1b8::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.16; Thu, 24 Mar 2022 14:26:19 +0000 Received: from SN1NAM02FT0037.eop-nam02.prod.protection.outlook.com (2603:10b6:800::4) by SN2PR01CA0069.outlook.office365.com (2603:10b6:800::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.23 via Frontend Transport; Thu, 24 Mar 2022 14:26:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0037.mail.protection.outlook.com (10.97.4.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5102.17 via Frontend Transport; Thu, 24 Mar 2022 14:26:19 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 24 Mar 2022 07:25:39 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 24 Mar 2022 07:25:39 -0700 Envelope-to: jorge@foundries.io, adrian.fiergolski@fastree3d.com, igor.opaniuk@foundries.io, ricardo@foundries.io, u-boot@lists.denx.de Received: from [10.254.241.50] (port=52282) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nXK3o-0007CT-EZ; Thu, 24 Mar 2022 02:47:17 -0700 Message-ID: <41d78294-8f0d-3b08-e614-f61425a38751@xilinx.com> Date: Thu, 24 Mar 2022 10:47:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] arm64: zynqmp: enable the PMUFW watchdog Content-Language: en-US To: Jorge Ramirez-Ortiz , , , , CC: , , References: <20220323140458.1087767-1-jorge@foundries.io> From: Michal Simek In-Reply-To: <20220323140458.1087767-1-jorge@foundries.io> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72b14795-ad7f-40a3-e98d-08da0da24375 X-MS-TrafficTypeDiagnostic: DM6PR02MB6509:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rpAEeTfedj5GrcmBEBg7S2RAEfKE1OhuvbkuVys654XdjIprpHqtZZu7H1oW8dxRi2z+uO76qFwbW+dCFMkOof8YZjkNPgqQFUbUoo/jMQ4ouRv3na24EVEoyiaU+Mmo5FUbQNEPn6XUl/cIEmL+RXzOiry634KRPyKaWiUo35xVdt1kxxqzvjSDQ9eshw3jQFmBDLOWJj3BpW3ovOzcB4vgPpxBnIwIhnww+3eNXPKFRrlaYIq6DPar8GJWz59NP8PEjhn6nCL68/j9zjkgvhYyhJwgz7SPps/vsTtctDn4RtQyIx2zLim/EtFLbK5B/OLVL1qjtoWvo0ZJuUa7M1vHY6kl/5hh1E35kH/bx/2MZyH9m9Ejjkics5PPljwqOhzKVKoJ7Jvu48tOrzUDEOOwIUVL88ZFEdqEl5fJ07M5jpRTxaclKp5m472i9PPubUiL6wiWT7Kn9xLAUBrrETGOiqboiqbNKXTK+E2VDQBfpNHvo7auiEhktvjg1O1KWZODo6q8FjuqfoJwHUG8WzIfx+IScnIVkBQgILS1sm+3G9YZxg5f7odwnU3lVFnmsXmhzpO1vG36ZUH0Qv7Tq8MhJsMKZI6ZcEM8j33AIyI7x4onAE6aMufkPebijgS+4Lh5l1egxevjui4j9+M84htL7ImIfC2OuNLIXmpx3GASGRitKwLaNGN6DXWPZu4O8skFEmTYiQFuYYX2TFVoIepY5oeTpUR3UUD3+y7R5Fq4cEv7Co6CSZs+DoUvPZoUTFn3nNMcjv8nbCXE6gHGt1ylpX46Y2JwB/yDCAkJveDWdxLQfD5JJLwQlal9OuV5M5/wkrAPwBbMLpdsrQTpQNxx+3tPBG0IQS+C8+BWymNveZjb3VZRj5L2Jb6Q5q4V X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(4326008)(8676002)(82310400004)(54906003)(110136005)(316002)(7636003)(356005)(70206006)(53546011)(70586007)(336012)(6666004)(40460700003)(426003)(2616005)(83380400001)(31696002)(26005)(966005)(186003)(47076005)(2906002)(508600001)(36860700001)(31686004)(8936002)(5660300002)(44832011)(9786002)(36756003)(50156003)(43740500002)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2022 14:26:19.3073 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 72b14795-ad7f-40a3-e98d-08da0da24375 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0037.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB6509 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.5 at phobos.denx.de X-Virus-Status: Clean On 3/23/22 15:04, Jorge Ramirez-Ortiz wrote: > From 528b3117a36b7b4eea1839afbea7191d60638b0c Mon Sep 17 00:00:00 2001 > From: Jorge Ramirez-Ortiz > Date: Wed, 23 Mar 2022 14:41:15 +0100 > Subject: [PATCH] arm64: zynqmp: enable the PMUFW watchdog > > If the PMUFW was built with support for the CSU watchdog we must let the > firmware know that it can be started. > > We do this by faking the FSBL done state. > > Reference code in PMUFW: > https://github.com/Xilinx/embeddedsw/blob/master/lib/sw_apps/zynqmp_pmufw/src/xpfw_mod_common.c#L36 > > It needs this fix on the PMUFW > https://github.com/Xilinx/embeddedsw/pull/190 /* FSBL might not be running anywhere - i.e: SPL boots PMUFW */ SPL doesn't boot PMUFW. It is the first firmware in BOOT.BIN which is loaded by bootrom to PMU. It means comment is not correct. FSBL or SPL just sending PMU configuration object to PMUFW. > > Signed-off-by: Jorge Ramirez-Ortiz > --- > arch/arm/mach-zynqmp/include/mach/hardware.h | 5 ++++- > board/xilinx/zynqmp/zynqmp.c | 4 ++++ > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-zynqmp/include/mach/hardware.h b/arch/arm/mach-zynqmp/include/mach/hardware.h > index a70d6d611b..24c3ef3d7d 100644 > --- a/arch/arm/mach-zynqmp/include/mach/hardware.h > +++ b/arch/arm/mach-zynqmp/include/mach/hardware.h > @@ -174,8 +174,11 @@ struct csu_regs { > > #define ZYNQMP_PMU_BASEADDR 0xFFD80000 > > +#define FSBL_COMPLETION 0x1 > + > struct pmu_regs { > - u32 reserved[18]; > + u32 reserved[17]; > + u32 gen_storage5; /* 0x44 */ > u32 gen_storage6; /* 0x48 */ > }; > > diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c > index 70b3c81f12..c88c5fb8ea 100644 > --- a/board/xilinx/zynqmp/zynqmp.c > +++ b/board/xilinx/zynqmp/zynqmp.c > @@ -419,6 +419,10 @@ int board_init(void) > zynqmp_pm_cfg_obj_size); > printf("Silicon version:\t%d\n", zynqmp_get_silicon_version()); > > + /* fake FSBL completion to start the PMUFW watchdog when enabled */ > + writel(readl(&pmu_base->gen_storage5) | FSBL_COMPLETION, > + &pmu_base->gen_storage5); I look at the code in FSBL and it set it up XFsbl_HandoffExit which is at the end of FSBL. It means this should be setup in SPL not in U-Boot proper. There is also any XFSBL_FSBL_ENCRYPTED_MASK which maybe you should take a look in connection your other patches. > + > /* the CSU disables the JTAG interface when secure boot is enabled */ > if (CONFIG_IS_ENABLED(ZYNQMP_RESTORE_JTAG)) > restore_jtag(); M