From patchwork Fri May 1 14:55:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1281351 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=none (p=none dis=none) header.from=prevas.dk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=fcnaKmNF; 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49DFh94FgFz9sRY for ; Sat, 2 May 2020 00:56:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8583C822B3; Fri, 1 May 2020 16:55:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=prevas.dk 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=prevas.dk header.i=@prevas.dk header.b="fcnaKmNF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 11BAD82291; Fri, 1 May 2020 16:55:36 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on0730.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::730]) (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 7E8808228E for ; Fri, 1 May 2020 16:55:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hsWAqul/D9GU8amNSsDtDZNyXIHWyJHaZo2xjPQuRd0/H7lZVJaPUC2B+I5KLrRwhYeKWS7Di+eITsgccnEQAknQH9i4zfXx1fwI5gwDE9Vd5MsUDLIgVhlKXUYwrydUkmF7xNpbRzlBE9vE11AS3Z1FflMJ+t0ahmUgOyO/EmGm1afq8LdlEYycRJQU61rF4G6FhvJWi5qQMRQZH/cC1ah9LesliilKfZ8WNxDoVb3XAreicI+8jt84GE8YMtUqj6sm/HFqd6mwBpNUvif/GJaDrEpndYSfVm7lnurXzwlBYWkD6x6tA8k6unYndBR+o7F6XutRIl7ReSoGbV4oOw== 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-SenderADCheck; bh=TwKfSoDSNyqeH3kgTyWiWyZkgvH9q6oiSvIEc1OZ9d0=; b=jCKZVSCLW/3pHp9Ws0bK1VhfbHlp4AQ0hmePdgwaoslIopc8btqDgnr0p8SmjFOIRLXVbh8h4mipTWTxXymYUg5P3EJc3RPFfrBJNFkKx3NDcisCGy5swW3ml8N6GpVZJEYktVKwo6uashaZUUFqNAxdM/7Dz0rUiBQxOs4DgzlPXYHuzEoNEYnv5Xgjb51fiEzMp0qR0mm7lhZVab1sc+yUC3fTxjoZTIW82nVqxXxVHH7OQjbNJmUljgCLTQj6UTIQBvX+iXIztNw8YhjlH6BjBEZtyK/NQxNBKU6KZYPYc6g7mzVzyly4WvSK7eQJGNfXCjDcvFlzuoawQWe+Nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TwKfSoDSNyqeH3kgTyWiWyZkgvH9q6oiSvIEc1OZ9d0=; b=fcnaKmNFt3jVUqR922WBSL4t5KVAVyY6kDnajbcMOW0LgVuxG+/oY0mYjbImZa2KmdWnK2zhbQeC82nnoTcS9yvRWubLe4GH3nwo4pVjUJ0zdlKqPoEwnxQ3+4jYOFhFLXIn0sjcpRRdBAaH5+uB7cvSWFKJrkVg0/pu6cuDFd4= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=prevas.dk; Received: from VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:e1::21) by VI1PR10MB1967.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:32::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Fri, 1 May 2020 14:55:30 +0000 Received: from VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM ([fe80::f0ac:4e97:2536:faa]) by VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM ([fe80::f0ac:4e97:2536:faa%7]) with mapi id 15.20.2958.020; Fri, 1 May 2020 14:55:30 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Simon Glass , Mario Six , Bin Meng , Urja Rannikko , Rasmus Villemoes Subject: [PATCH 4/5] sysreset: mpc83xx: add output in case of cold boot Date: Fri, 1 May 2020 16:55:15 +0200 Message-Id: <20200501145516.18168-5-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200501145516.18168-1-rasmus.villemoes@prevas.dk> References: <20200501145516.18168-1-rasmus.villemoes@prevas.dk> X-ClientProxiedBy: AM6PR0502CA0065.eurprd05.prod.outlook.com (2603:10a6:20b:56::42) To VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:e1::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.116.45) by AM6PR0502CA0065.eurprd05.prod.outlook.com (2603:10a6:20b:56::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Fri, 1 May 2020 14:55:29 +0000 X-Mailer: git-send-email 2.23.0 X-Originating-IP: [5.186.116.45] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 98375361-7e6f-4cab-c267-08d7eddfb0e9 X-MS-TrafficTypeDiagnostic: VI1PR10MB1967: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:459; X-Forefront-PRVS: 0390DB4BDA X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F/s6HIe/Y/A6v0nqxL+Drf4DnyzbZeahBJfy7XtOVpCYo8KZgFcawbf0fmxaIn3/IAmlLQN2GTlEbqg57dmon2DyZBjyAfF14J1bEvAcwOLYCJHJ6vfcCq9lprYad9cpTDl6kqUm3KEylNrFQCZNSmqDNPQEJkFX7jkU8RP6IRviclLpdO36FNixMIwKFfowqGV1ujnVJQSWe7N8ppPNLAGd8fPKFsdyBpqwLf4Tp7xZq6+bpOHVRC7WT0G/MAsqH874+F8RJli4wrwwZg1J/UInsiJsTgBOIEuNI2Q1etSxvUHdFr/2kX0BgXiYZ34XVviHzdpBxvOkAaGvtd/8fMb+2X1vLIOkjYH7zFcfQO//gsqKqLVHAlScNsAt2WcGSF6Bfywzq02sQauZdmFqnN9MjWHtid5SwEp5hVEpQIt18FKpMLniHAoYRnlwAYyP X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(396003)(376002)(39840400004)(136003)(346002)(366004)(52116002)(66946007)(8676002)(66556008)(66476007)(26005)(186003)(6486002)(6666004)(16526019)(316002)(6506007)(2906002)(54906003)(86362001)(107886003)(6916009)(8976002)(8936002)(4326008)(6512007)(478600001)(2616005)(44832011)(1076003)(36756003)(956004)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: lEgim9YgPohe+tfCc6evzPYke8Omgz3LCJAWgNdMdQg0rvHBVQ0w72e+baWiHpG6j5mQenZTaHDG4Wr5XdKLQ+TLgMJhKWDRppBeBDiyLO9XthpJ6qHxXA7K3KTYSWnCwiFX38ma7mYf/8Cg11A3DLA0YHzzqmSEG+UTTK+4M7vhs4mmxf1VfbTcM2tU3mEGx2QLLqJTdPxiZEfGY1pNbw1iTyFe4uEJYuRxDrj/wv1FZbhz6utbDVY3FpkpeC53YMHZqKizZRpwz5ftnrbt6ec2mpFhaGuqIZR8JfrTyfGjSlaKPszGV+rVaSoh/YpyIXBm2aHGYA0bVUcoqJfhm9CNvlAwRyWJatEgKjRngB+wtnb+9XMEMYQKoqf10c78EXcAeHB1I+x2HnxW1QsYAJVnFjK2ewDw5MeGQoQW2OBpqxLE9O8GK+RE70EGzY56w1Ixw2sCQ1+6wmEOHe/wkvBaPpFB9y+cSRUIyK3xXhVb+ktdxtyoaa0Y7scMzr0yJWjowdD/K30chUHnY52raqskRH97H8tb2Fn+PGvOUiXl549biJxWGu+SsTJjLvj8GkD8LAqNv4ltMuRWmd6kxfvkJuK/9YGXhuua0aMYRZFTtE2OfBsdO4YA2AU7+2AjPwywKjJDwAgjvmF7UxSsgykw7Wuo9/iNtxFPIKyvPFACl8ndrsYaeQmy8Pnk5ZWlS7idRy9FpC+fQmY5+8f3OaWb2mFJHY7a4QTS6k6ieenhVJpE0KnnkQVcNmIA99F1tSn65IkFJipnjIg60if198p1O+AL4HjPLM2vjhmT6u0= X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 98375361-7e6f-4cab-c267-08d7eddfb0e9 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2020 14:55:29.9473 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3OoC/QrJurMQEsEL0CwT5ett+NiEbOQQa4ZF7HNaXDLlKTSFY8hEGAqBLIq0S2BJXQp2mBr+RGSBK/CZq2mvRXoxVBh82MWHINIltCv18bk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB1967 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean For a powercycle/cold boot, none of the RSR_* bits in the reset status register are set, so one gets an empty Reset Status: line. Print an indication that this was likely a cold boot. Signed-off-by: Rasmus Villemoes --- drivers/sysreset/sysreset_mpc83xx.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/sysreset/sysreset_mpc83xx.c b/drivers/sysreset/sysreset_mpc83xx.c index 631ae6a5dc..6457d73418 100644 --- a/drivers/sysreset/sysreset_mpc83xx.c +++ b/drivers/sysreset/sysreset_mpc83xx.c @@ -149,20 +149,28 @@ static int mpc83xx_sysreset_get_status(struct udevice *dev, char *buf, int size) ulong rsr = gd->arch.reset_status; int i; char *sep; + ulong known_bits = RSR_SWSR | RSR_SWHR | RSR_JSRS | RSR_CSHR | + RSR_SWRS | RSR_BMRS | RSR_SRS | RSR_HRS; res = scnprintf(buf, size, "Reset Status:"); buf += res; size -= res; - sep = " "; - for (i = 0; i < ARRAY_SIZE(bits); i++) - /* Print description of set bits */ - if (rsr & bits[i].mask) { - res = scnprintf(buf, size, "%s%s", sep, bits[i].desc); - buf += res; - size -= res; - sep = ", "; - } + if (rsr & known_bits) { + sep = " "; + for (i = 0; i < ARRAY_SIZE(bits); i++) + /* Print description of set bits */ + if (rsr & bits[i].mask) { + res = scnprintf(buf, size, "%s%s", sep, bits[i].desc); + buf += res; + size -= res; + sep = ", "; + } + } else { + res = scnprintf(buf, size, " Unknown/Cold boot"); + buf += res; + size -= res; + } res = scnprintf(buf, size, "\n"); buf += res;