From patchwork Sun Sep 25 13:27:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michal_Such=C3=A1nek?= X-Patchwork-Id: 1682166 X-Patchwork-Delegate: trini@ti.com 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=NbnnBcTs; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3J4aiuAs; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mb6C20x23z1yqM for ; Sun, 25 Sep 2022 23:27:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 65D83848C2; Sun, 25 Sep 2022 15:27:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de 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=suse.de header.i=@suse.de header.b="NbnnBcTs"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="3J4aiuAs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8E5CD84966; Sun, 25 Sep 2022 15:27:43 +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,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3783B845EF for ; Sun, 25 Sep 2022 15:27:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=msuchanek@suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id F15D91FD16; Sun, 25 Sep 2022 13:27:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664112460; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TqpXrzZkyeXhCdpyyF7cWua04rgALF820spiOeM0i5Q=; b=NbnnBcTsVt7Yuuq/EUuU5oYj7c7Jf6yqGTnUyB/53CcpKeUsrtJ8/hEdH8LK8Q3iE4vODB RXTx2B6Abo7VXHmVcT7dVS5Qud5mLUbskpFuhCOUxnA/LFlc6CFR9pvllULcrfC4/pOW46 QHwLEkPbc680z37OwCNCWfcxsjCLWlc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664112460; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TqpXrzZkyeXhCdpyyF7cWua04rgALF820spiOeM0i5Q=; b=3J4aiuAspMzxU0ZVrzSqueQ1yaWyXDhL5TTWhCfpfY6wA+tta8tFCNVx78Y3SdfLBLWAJp Tu+dLMYL3Kp7Q+CQ== Received: from naga.suse.cz (unknown [10.100.224.114]) by relay2.suse.de (Postfix) with ESMTP id 9026D2C178; Sun, 25 Sep 2022 13:27:40 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Cc: Michal Suchanek , Andrew Scull , Etienne Carriere , Heinrich Schuchardt , =?utf-8?q?Marek_Beh=C3=BAn?= , Philippe Reynes , Ramon Fried , Sean Anderson , Simon Glass Subject: [PATCH 1/2] sandbox: Initialize sysreset before relocation Date: Sun, 25 Sep 2022 15:27:30 +0200 Message-Id: <20220925132731.6293-1-msuchanek@suse.de> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 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 Without this the early sysreset code cannot be tested. Signed-off-by: Michal Suchanek Reviewed-by: Simon Glass --- arch/sandbox/dts/sandbox.dtsi | 1 + arch/sandbox/dts/test.dts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi index 56e6b38bfa..9e96ff12a1 100644 --- a/arch/sandbox/dts/sandbox.dtsi +++ b/arch/sandbox/dts/sandbox.dtsi @@ -239,6 +239,7 @@ reset@1 { compatible = "sandbox,reset"; + u-boot,dm-pre-reloc; }; rng { diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 2761588f0d..c59b118e96 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -1119,10 +1119,12 @@ reset@0 { compatible = "sandbox,warm-reset"; + u-boot,dm-pre-reloc; }; reset@1 { compatible = "sandbox,reset"; + u-boot,dm-pre-reloc; }; resetc: reset-ctl { From patchwork Sun Sep 25 13:27:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michal_Such=C3=A1nek?= X-Patchwork-Id: 1682167 X-Patchwork-Delegate: trini@ti.com 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=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=SJyJTxF3; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=lNZhUFa9; 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mb6C725lpz1yqM for ; Sun, 25 Sep 2022 23:28:03 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 40D098492C; Sun, 25 Sep 2022 15:27:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de 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=suse.de header.i=@suse.de header.b="SJyJTxF3"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="lNZhUFa9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A7AAF84975; Sun, 25 Sep 2022 15:27:45 +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,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F20488492C for ; Sun, 25 Sep 2022 15:27:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=msuchanek@suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id BCD8B21B4B; Sun, 25 Sep 2022 13:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664112461; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MEfOOCAdkX6otc+fEUAczQ5BCTsV8RkJHlwIWViXqC8=; b=SJyJTxF3mjPFTiaYsAVoet2qqvgGBmLa6e3PK+e01M0+6ypzb8rtIfF6gdbchhSwsRqzl5 sshRil9t8qvEfTFUUp7mmGtFFdNIayEGJvanCRaBici4OeSQYIOlxp2hhZwzfqfWqQaqU1 I+tD1vqnzi3wLObsQZdkDgPr+sRhn3U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664112461; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MEfOOCAdkX6otc+fEUAczQ5BCTsV8RkJHlwIWViXqC8=; b=lNZhUFa94qEHvXEZqNgP11z+6/u0yNum1TyvJVopQiLzqJP14f4YA7fp9Fr6L7z6A933Xz rVMRKPYlmmBfyVBg== Received: from naga.suse.cz (unknown [10.100.224.114]) by relay2.suse.de (Postfix) with ESMTP id 41AAC2C17A; Sun, 25 Sep 2022 13:27:41 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Cc: Michal Suchanek , Marek Vasut , Mario Six , Michal Simek , Rick Chen , Simon Glass Subject: [PATCH 2/2] common: board_f: Print information for all sysresets Date: Sun, 25 Sep 2022 15:27:31 +0200 Message-Id: <20220925132731.6293-2-msuchanek@suse.de> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220925132731.6293-1-msuchanek@suse.de> References: <20220925132731.6293-1-msuchanek@suse.de> MIME-Version: 1.0 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 Boards can have multiple sysresets, iterate all when printing sysreset info. Also print the symbolic error when reporting sysreset failure. Fixes: 23471aed5c ("board_f: Add reset status printing") Signed-off-by: Michal Suchanek --- common/board_f.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index 18e2246733..0835b376bc 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -55,7 +55,7 @@ #include #include #include -#include +#include /* * Pointer to initial global data area @@ -163,20 +163,27 @@ static int print_resetinfo(void) { struct udevice *dev; char status[256]; + bool first = true; int ret; - ret = uclass_first_device_err(UCLASS_SYSRESET, &dev); - if (ret) { - debug("%s: No sysreset device found (error: %d)\n", - __func__, ret); - /* Not all boards have sysreset drivers available during early - * boot, so don't fail if one can't be found. - */ - return 0; - } + /* Not all boards have sysreset drivers available during early + * boot, so don't fail if one can't be found. + */ + for (ret = uclass_first_device_check(UCLASS_SYSRESET, &dev); dev; + ret = uclass_next_device_check(&dev)) { + if (ret) { + debug("%s: %s sysreset device (error: %d %s)\n", + __func__, dev->name, ret, errno_str(ret)); + continue; + } - if (!sysreset_get_status(dev, status, sizeof(status))) - printf("%s", status); + if (!sysreset_get_status(dev, status, sizeof(status))) { + printf("%s%s", first ? "" : " ", status); + first = false; + } + } + if (!first) + printf("\n"); return 0; }