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 D713CC433EF for ; Thu, 24 Mar 2022 21:03:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5B56084021; Thu, 24 Mar 2022 22:03:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.b="BaBZ2g5o"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4C2EE8404E; Thu, 24 Mar 2022 22:03:17 +0100 (CET) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4F0B483FCE for ; Thu, 24 Mar 2022 22:03:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jorge@foundries.io Received: by mail-wr1-x42b.google.com with SMTP id b19so8274989wrh.11 for ; Thu, 24 Mar 2022 14:03:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=sROvS7v9O4HMNppiOomtcuuWLEfZgld7HPaZlQlR8+w=; b=BaBZ2g5oOQIc6iGAn6J4+Ds1U3ZjisCHtADXbNNHCzsyDVxoDvJo28FAetEPx9mPDC qCJXLC+qOD9sY23zGJLctREXRzScMoN9EBCztMzMZnF8NACxgzjAHSOwDnL/hLtDy2wj Dh6Z9/kjuM3R9vnH/RQNETXWuLD4z7RlJJbCKhyHMcdnMbFatmZ/nbqMf+/M30MNVjvP op06ZTxerdir9ExY200ToyJtOuJv62YvIAuEQ4RRARkjuTQWCEc/eyWc+hmIB8xbKd6C 4e0EHzCxaiwrrOvxVX5zFds5TdkDeATHeiq00f4C3mG1uAvfEHXzO4V08RGzSNGDu/W6 B5Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=sROvS7v9O4HMNppiOomtcuuWLEfZgld7HPaZlQlR8+w=; b=GluYF0RQDksOuwZTRMRUVDu93wquBrYM6zYsWdxAvw+BaIe3fL9hr+rCNQuOIKUg8l 3unoJ2I6HKpginUQ9xcLV4BS5Jf/hQyMEDlZSPKHs4mfwnACaiDyDu1Jv4YiAoDcgMuB xX10fHLp1rgAMyGF3fxWBN9v/btPKplQ06IWYcGqOWFDfxplD3WziRw7XKUeKBHM90Kd s33o+TSu1nv0xNOzkarpUGpQPnjjTR1bNpVDpoDCqj66z5aT7Ak19taJdAQIGptQEEDy Vg6om1FoBpPQDFuzn6e0YTMk51cSsZvgySiVKbW82N1Naw/n0NVynwiH1dO8B39Njqij TP1w== X-Gm-Message-State: AOAM530X3bYIqZkQDtU/KLq4ICpZ1bC8sUNzGIKerC1PZGytB2QLxGQc lL3MmR9f2D+5tguCltNCEg87kw== X-Google-Smtp-Source: ABdhPJxJgJ2CGoW/V0KnNVDwVnMJOGH1ckPifXCdZkCevc6FPKiRAFlyTVNp9iSoCeUlBJM1fYyqRw== X-Received: by 2002:a5d:518e:0:b0:204:5a3:763d with SMTP id k14-20020a5d518e000000b0020405a3763dmr5975619wrv.360.1648155793869; Thu, 24 Mar 2022 14:03:13 -0700 (PDT) Received: from trex (95.red-81-38-138.dynamicip.rima-tde.net. [81.38.138.95]) by smtp.gmail.com with ESMTPSA id p23-20020a1c5457000000b0038c98c12ea9sm2919701wmi.1.2022.03.24.14.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 14:03:13 -0700 (PDT) From: "Jorge Ramirez-Ortiz, Foundries" X-Google-Original-From: "Jorge Ramirez-Ortiz, Foundries" Date: Thu, 24 Mar 2022 22:03:11 +0100 To: Michal Simek Cc: Jorge Ramirez-Ortiz , t.karthik.reddy@xilinx.com, ashok.reddy.soma@xilinx.com, adrian.fiergolski@fastree3d.com, igor.opaniuk@foundries.io, ricardo@foundries.io, u-boot@lists.denx.de Subject: Re: [PATCH] arm64: zynqmp: enable the PMUFW watchdog Message-ID: <20220324210311.GA1801385@trex> References: <20220323140458.1087767-1-jorge@foundries.io> <41d78294-8f0d-3b08-e614-f61425a38751@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41d78294-8f0d-3b08-e614-f61425a38751@xilinx.com> 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 24/03/22, Michal Simek wrote: > > > 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. yeah I guess it depends what you mean by boot - unless SPL configures it, it wont really boot to a functional state. but anyway ok, will change. > > > > > > > > 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. not sure what you mean. This piece of code I am posting only executes in SPL, doesn it? > > > There is also any XFSBL_FSBL_ENCRYPTED_MASK which maybe you should take a > look in connection your other patches. um, ok thanks for the info! > > > + > > /* the CSU disables the JTAG interface when secure boot is enabled */ > > if (CONFIG_IS_ENABLED(ZYNQMP_RESTORE_JTAG)) > > restore_jtag(); > > M