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 011A6C433F5 for ; Wed, 23 Mar 2022 14:05:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C451283F56; Wed, 23 Mar 2022 15:05:10 +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="abpBDxfG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EE8EE83F55; Wed, 23 Mar 2022 15:05:06 +0100 (CET) Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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 9542E83C0F for ; Wed, 23 Mar 2022 15:05:02 +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-x431.google.com with SMTP id r7so1184166wrc.0 for ; Wed, 23 Mar 2022 07:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RqKyrnclja4lMnU2eSqVJkwrpZnqmgDBBSX7iqrjln8=; b=abpBDxfGWdKOG5s8Jv+/lNs2pLipGNOBJlPFjz5dsKBJqvBW5ImyGwsxv9l+CkH2in aTVttxo6Lm3M+81XKBuxKyDzotuShq2Faf3r4UOqDlFJqw4S+t+JuqdwnCY4EIaZaJtf alGraF5hCNSWl3SvnD/AQDHA0Si5F4yTb2E0ASB6C+goaGjNC44pQcYAWVVKLGJk2YG6 86aFqXC0ejaLimDugZ2bRczsp9hBObimBSBFlPiuqhUtDXoxv6+J413uJvuGp1AQC06d 7C81VxCwQG1E907M8sZTzP3lgnDgQqq8mTH2fAe4j1lRIVDnxYFv4XJU8ez7YFQ5oBmk nkPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RqKyrnclja4lMnU2eSqVJkwrpZnqmgDBBSX7iqrjln8=; b=GmjCvBwZUBWfPNQeBJatXCMQNpGJLIdteu61jJfrQXAZ2alKj5NsFgTUN3lj4ldU9D n1wH/DTj3u/8zBg/NaqnG/Be1ieFR5ejcoH0K3Qldsg1G8PlMQYT63X3WsF8Xqk9KXg5 9h50L7Al2ayEfWaX9eFftd4cKpd3jT1rjMA02asiBYMQTpty8ozZgg9M8cZ9SuhtHHWa 9W6YsA1n9gwf20fZcvSYj5jLCCCNMoWzQjgG+HvNTHCEdwIOMqI660N1Ffo2hHhJENSo 8xH9gLchljGh4M4I2df2Ic2cWoLj6SfPZt7lOrx+K0vs73bLG4/nN1eue/qvHLXIypRs MunA== X-Gm-Message-State: AOAM533fGsNwUT4jSAuGaObb2tptqy4YvDaBUds6WG0RpQpbEVH+sN64 Fa7eTw81Q5dygX3I66mnvcSO4w== X-Google-Smtp-Source: ABdhPJwEKW4Z73Ya/Sw4yR2dX27uWjdCWIs1MpU+4f5CgzWM1Uq9jp9RRXdVmepMV0YW9Xizp9+jkw== X-Received: by 2002:a05:6000:1862:b0:204:e417:9cf8 with SMTP id d2-20020a056000186200b00204e4179cf8mr7907334wri.593.1648044302168; Wed, 23 Mar 2022 07:05:02 -0700 (PDT) Received: from localhost.localdomain (124.red-2-137-188.dynamicip.rima-tde.net. [2.137.188.124]) by smtp.gmail.com with ESMTPSA id m11-20020adff38b000000b002058f767c58sm318080wro.30.2022.03.23.07.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 07:05:01 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge@foundries.io, michal.simek@xilinx.com, t.karthik.reddy@xilinx.com, ashok.reddy.soma@xilinx.com, adrian.fiergolski@fastree3d.com Cc: igor.opaniuk@foundries.io, ricardo@foundries.io, u-boot@lists.denx.de Subject: [PATCH] arm64: zynqmp: enable the PMUFW watchdog Date: Wed, 23 Mar 2022 15:04:58 +0100 Message-Id: <20220323140458.1087767-1-jorge@foundries.io> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 >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 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); + /* the CSU disables the JTAG interface when secure boot is enabled */ if (CONFIG_IS_ENABLED(ZYNQMP_RESTORE_JTAG)) restore_jtag(); -- 2.34.1