From patchwork Fri Oct 18 05:51:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Looijmans X-Patchwork-Id: 1179152 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=topic.nl Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46vZt34j7Sz9sPF for ; Fri, 18 Oct 2019 16:51:53 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 12F4CC21D8E; Fri, 18 Oct 2019 05:51:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id F0FE5C21C51; Fri, 18 Oct 2019 05:51:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4B6B4C21C51; Fri, 18 Oct 2019 05:51:38 +0000 (UTC) Received: from jax4mhob02.myregisteredsite.com (jax4mhob02.myregisteredsite.com [64.69.218.82]) by lists.denx.de (Postfix) with ESMTPS id AEC76C21BE5 for ; Fri, 18 Oct 2019 05:51:37 +0000 (UTC) Received: from mailpod.hostingplatform.com (atl4qobmail01pod0.registeredsite.com [10.30.71.203]) by jax4mhob02.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id x9I5pY2r010908 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 18 Oct 2019 01:51:34 -0400 Received: (qmail 27096 invoked by uid 0); 18 Oct 2019 05:51:34 -0000 X-TCPREMOTEIP: 81.173.50.109 X-Authenticated-UID: mike@milosoftware.com Received: from unknown (HELO mikebuntu.TOPIC.LOCAL) (mike@milosoftware.com@81.173.50.109) by 0 with ESMTPA; 18 Oct 2019 05:51:33 -0000 From: Mike Looijmans To: michal.simek@xilinx.com, u-boot@lists.denx.de Date: Fri, 18 Oct 2019 07:51:22 +0200 Message-Id: <20191018055122.25604-1-mike.looijmans@topic.nl> X-Mailer: git-send-email 2.17.1 Subject: [U-Boot] [PATCH] board, zynqmp: Fix for wrong AMS setting by ROM X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" A bug in the ZynqMP bootrom sets the PS_SYSMON_ANALOG_BUS register at 0xFFA50914 to the wrong value 0x3201. This causes the AMS to exchange the PS supply voltages 0 and 1. On Xilinx boards this is not noticable since these are tied together, it's only really noticable if banks 500 and 501 have different supplies. Xilinx' tech support reported this undocumented register to be the cause, and this patch applies a fix for all boards by programming the correct value. Signed-off-by: Mike Looijmans --- board/xilinx/zynqmp/zynqmp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index b94936474d..8d926c803b 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -326,6 +326,9 @@ int board_early_init_f(void) return ret; } +#define PS_SYSMON_ANALOG_BUS_VAL 0x3210 +#define PS_SYSMON_ANALOG_BUS_REG 0xFFA50914 + int board_init(void) { struct udevice *dev; @@ -343,6 +346,9 @@ int board_init(void) printf("EL Level:\tEL%d\n", current_el()); + /* Bug in ROM sets wrong value in this register */ + writel(PS_SYSMON_ANALOG_BUS_VAL, PS_SYSMON_ANALOG_BUS_REG); + #if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ZYNQMPPL) && \ !defined(CONFIG_SPL_BUILD) || (defined(CONFIG_SPL_FPGA_SUPPORT) && \ defined(CONFIG_SPL_BUILD))