From patchwork Wed Jul 21 14:17:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 483300 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp6213744jao; Wed, 21 Jul 2021 06:49:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCW5GVBKYipPTsyNMfhGfdyory9EQVyjH0oV3Rc0W6hhfnkesdaqo4eu8bLtZB97+LJv0L X-Received: by 2002:a17:906:2dc9:: with SMTP id h9mr39320724eji.345.1626875381957; Wed, 21 Jul 2021 06:49:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1626875381; cv=pass; d=google.com; s=arc-20160816; b=vbiL39aO7nVB8h85DAcqtZbuyRHZyw4nH4w1CamexNhTs+MB3WRicOgXVgB7VvgwkV cWEuioFcxTm9RCK5JqC9OKy0lTHuwTOxl077JdvyXhB8WXZPAR4HXqcuit/DXf58rCGw tWKg2J6AP7rlBTLpzOq4dcMrlNMKJy8E1L39khbCCeFfZEu5puph6vOj9XhlG6kI/w6M nqE9YckPMqLpXtEBADLMYg2PPwuAB5J3lkPhcm42sRxvCmVsWTYCzDYqenRhVDSMuDii lQeR/QS5Q09CSrWmceDbYplOKEKu/jHSWVCPCmy8a59JICCfTVeSs/514bdw/iqo7jv2 imGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=JBv5/095WfUHzw3MkRrlwP8nwalHDMpBURHwMaW4H/0=; b=qi1XMR25RPM2ldzOinGBCrBC7qsnckM4+9t/TuSxhtYUoR4uDc/5yrYpp24C3CTN+v FmXTuNYegvf77zQIKJGzQ4sMIVidOwxTh0lZoss03AX5y5+agwoX7MP2kU5cZJFgjRMl +NiH2mIIiyMulYokcFZCu0yOaZn3TlBUuk0ClxM1afihrOQx8z4GBNd/Mm0zujx+QxJb NxQcSBISd3S2va31EzbsdPeZ+g9PSzZnvFjDrk8+V+jEQxfhnFqH/JDPmI67Q+h3AafM 1grPOBR1eulFJHB95HfA7Gizv7cd/Cu/RnGVtXSCm+NI4bjyevXsHLUfatlhC2/f0vIz RRiw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=mHYBo79Z; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id w5si28197920ejz.287.2021.07.21.06.49.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 06:49:41 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=mHYBo79Z; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6322782DD8; Wed, 21 Jul 2021 15:46:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com 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=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="mHYBo79Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6986582C57; Wed, 21 Jul 2021 15:44:59 +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=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on0631.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0e::631]) (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 A86F882CC1 for ; Wed, 21 Jul 2021 15:44:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fi236S3QhavP3VYsyg5o5DZEmFFPWPBz0uGWBXUC4e9qHh970AvZgqtDYAA8lW9lPh6yPlBI2y3Vzv7tWP3xCMWHrR8sryryZMrnuGP8l0vzzpJ6hb5pNh7Jpbna+Y51V6s/i5AybK8lzk4mMhW7/jTxTroIrQISvUSqMlocZdfWw7SklBpPY4XsIO1cHA7kmwNGEfF+y4l/aszCSStiYWZ761UYFzUq3YB00VKNJkx85cKPMDhdn2VobRDeumQF+gLQLUyaDyQdLMTBysUCqChYTBs+WVN7uPTRGqnOhgS03DK4/t5VMHyNlsQHL9wRKPU4xgbohy4hrCkIsj16gw== 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=JBv5/095WfUHzw3MkRrlwP8nwalHDMpBURHwMaW4H/0=; b=LFKPMk8TAMGfxSq9SLWud+tmdhDBWh3N2+PUWD2GbAFk6euPsvn+f1coDs93mQrb6dPhv3yEufQnXl79FumfE3IwfvSCgoCYjymjkvszSfonBRV+0T4sQuqNEOPgWHpmxrNpkyckgvovihOEKF/AM07leGXKiOeIbfvmVt90ZULA42JzP/FDqwAJKyAd68l6HwXcWKhdUJNN7gZnGc0BIaQoLXAJN/T+3PB3tOSc5DGm4mVw4lmA4tMv0vCs6r7PsTbRo2LKA04LfHvfy7nU2gHFWvk9yl1M9CjqW9QvquiswsZ05cD49ADkPPBmhu68cdt7AhOx+0YmYsHpH5mYMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JBv5/095WfUHzw3MkRrlwP8nwalHDMpBURHwMaW4H/0=; b=mHYBo79ZBH4m/s3a5vXAxof2nx3nbaso//sekx9rFXyKrj6RwhJCbp/Cb+1v5Nnb7io227uNunxgwoGr4rlLM1Dk4P25Jn8VZ2PYBy55lS3ciXpeOEnM5KQj86wSxLZyYGC2Gk4E/Eo6OvxUKBxZEPQyXq0WyKMlUQ6kBIqinXg= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none; denx.de; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2757.eurprd04.prod.outlook.com (2603:10a6:4:94::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.29; Wed, 21 Jul 2021 13:44:52 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd%9]) with mapi id 15.20.4331.034; Wed, 21 Jul 2021 13:44:52 +0000 From: "Peng Fan (OSS)" To: sbabic@denx.de, festevam@gmail.com Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Peng Fan , Ye Li Subject: [PATCH V4 37/44] imx8ulp: soc: correct reset cause Date: Wed, 21 Jul 2021 22:17:18 +0800 Message-Id: <20210721141725.23346-38-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210721141725.23346-1-peng.fan@oss.nxp.com> References: <20210721141725.23346-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR0401CA0015.apcprd04.prod.outlook.com (2603:1096:3:1::25) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR0401CA0015.apcprd04.prod.outlook.com (2603:1096:3:1::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Wed, 21 Jul 2021 13:44:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9183437d-d0b3-433d-f3cf-08d94c4db705 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2757: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:107; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xhbY9j8+IQzOwIbW5zDckWtvYkdYXSMtn9CleF0dGGR0mBeMO+tleqZjoScQ7jEi1NbLvRCVwAWALSTTLaHl8kqVUR1xNYrdMGv3RkKA234iOyAMrLhYK2cBFqtlTz1ar6JItmLEHFe6508p+dNYD0afNYaLeVnuqlsDpTPOJzXGqvaCcir56Ig2BZBQI+rkdV8MfsfDDX7IMcfgTuOVQP/q9CF4ZHiSFmalAm5dfJzSBY23ipRzY3UXj4NrWofsEQi2mb+KzCG7U90IvDhdn8xw501bfM6LDO3Uqxli/llqstc5BfDt71LxdZp7fb93E2FV+AEsfXOEB5HQVHZQ0luZt8xDkL9cyRnqKSsZhb9tSPyEXuHZrcswLBTUr0GOXS5ovWz5drqPSvDYswOqS+CW4Ic7DJstlq1TFrbyKP2oljdQ1gLCZqmgBWIE7kj5aEvjNfDcIAOcSYbIBPXqYTzKM1R1CBsY5c5XJa4RYbS88Q5WioUabPBlGPNZOo+FKU7b1qGHa/RdsnD/KsYrOk6NDx2oWkSzwxfe1yN5Ghre+ydqW7gVx3OXKSSCW57DmMU6vp1GMPMWt9bLACziQxvu7uLK4MTl3mcZykDePAxxMLYdYllaJIFYMDytmWLFYrYw5jQ72nc+2eTOffgMgnjG7yyMYVL5mVk0HV5hebL/DSza3gZLrvQSuIfD5Zu/lrRV2qqqh0ogvHat1juRZ2s60mQDZtdJamHH/KTgGeM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(396003)(39860400002)(346002)(366004)(136003)(4326008)(38350700002)(5660300002)(186003)(86362001)(6666004)(6506007)(2906002)(26005)(8676002)(83380400001)(52116002)(8936002)(6486002)(478600001)(316002)(6512007)(38100700002)(66946007)(66556008)(956004)(1076003)(2616005)(66476007)(54906003)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JhcJNZZrG3pprctsYYzkARyQ9njBS8xb/R9Asf1vn9lxX4KRF2yLt7jk50JHDrQK+6/Wz8QwEazeYx7pRzb1hbec2Ari6C8sqdxQreU0ckzsAJiTJ0zMzBHjYohj60jGwyiPP5wXRB+nhHHy1pzUeSJdS+omw9aQRfK8nOUEY0IpdAGgKKu14BQ3ydsSmtLWvkVWQJNqo3fIK5wyDn8s3siAkj2t9Ul0f8r0Grq0gQ0xHn3DvscrCx3k1xuErJoYfna4AyngbC2pDQchJmd+KkuPedrbagQJGT97teNqMGkl1TMdS92xmPBB8i++NqDrsCbJxEAFrORuuLQqToGheVwTzxSU5pNv3Y0EM5jiFYrEwhsvBYjhzIMc1d8a2IQTFsmIMJmehD1RjygDCU0MMWgV0SkJ73RzOWvSqxCqGmMEYImoDoPVmWnC4MEkpPwv6SoaJmnmYdGmbSr70XmdVx31nT8yASlUx+oFbq2/5kecBUU3w4uMZHtIzBUVtlDmMPFxDNT4JEirlGx7eqXxtjxJPTcAHkfbOosB/MUU3Fux9+fZbrpFNbZ51tetmHUGZZfIdN1qMnqGEABbTU5PQTX8fouBo2V53honwUpDIdfJK29RJh31gI0RCMiBOn2r32vKPGcSgLbXv+VYVnqD9XrrcLBLsuJR26w6aMV0pV9g1in1csFYJgmn1q5V0lc0P701FWbslfnFyt5J7qrim1kY303LaPzBruJbW6LSltpcbVB7ypzttbSmvakZ4tQBdDLYzxXadJ/3Sda435KrIjoGP3WIYfI2ITd5LxLUqBH3R0tDnffJysWTSAWuOAJ2RTWCekdRhddgBmcBqjrY7s2+S58vW5gtRs6HSb67P/zll+ywejsTmQDDRgw9BKbG7JFjN0JniVoOl9/c5JLl9hTvzZUxMM2Ly9UwwUnFkNzfatBEOI8ntLrHxkPXeG4MUtLBPlRZQg3W1rR78LY1D0YpipZ1u4stXQPrkRJMh+h131BGVUsWdViztxytFgPn7a1qqKUH1YsC8VK5tvBsJlgxn7uoFjX3gKWrXrvuLr2cnVicFywxA0Oj88gjCf/Li5dg+cOPeLdBt7g/XhX7RiVPt0WnXDTXUqcINT1bgSms5Wf8cidSdKD62Xl+S3SN9JdTa+w2IyoRMKRlbmrttzcJXkIGWILIU/li079evNZHzafg3q8SGfaiB1zyFvCrkmVrITUCq2bldLvynMFkcEqv5amrYKtUqWhs9UAKYEdXuPAj6eLp7Xq71AnIsqSKp8CcWK11fTyhTStkJlJC09gCe7WGGYpCgQGaftBRzGHIeZBaI4uljF3AnhFEkDhz X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9183437d-d0b3-433d-f3cf-08d94c4db705 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2021 13:44:51.8568 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2Z7i+hFk7uuH3vDmex6QQeWrMmHncwFW7nlBY+XUFFqh58wGBTbrlYsBxU4eWnYAItArEzdXGSlKJkCU7GKGnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2757 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean From: Peng Fan The CMC1 SRS reflects the current reset cause, not SSRS. Then you could get "Reset cause: WARM-WDG" when issue reset in U-Boot. Reviewed-by: Ye Li Signed-off-by: Peng Fan --- arch/arm/mach-imx/imx8ulp/soc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) -- 2.30.0 diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c index 0728cb9847..9bdbe3c846 100644 --- a/arch/arm/mach-imx/imx8ulp/soc.c +++ b/arch/arm/mach-imx/imx8ulp/soc.c @@ -149,8 +149,6 @@ enum bt_mode get_boot_mode(void) #define CMC_SRS_POR BIT(1) #define CMC_SRS_WUP BIT(0) -static u32 reset_cause = -1; - static char *get_reset_cause(char *ret) { u32 cause1, cause = 0, srs = 0; @@ -163,9 +161,7 @@ static char *get_reset_cause(char *ret) srs = readl(reg_srs); cause1 = readl(reg_ssrs); - reset_cause = cause1; - - cause = cause1 & (CMC_SRS_POR | CMC_SRS_WUP | CMC_SRS_WARM); + cause = srs & (CMC_SRS_POR | CMC_SRS_WUP | CMC_SRS_WARM); switch (cause) { case CMC_SRS_POR: @@ -175,7 +171,7 @@ static char *get_reset_cause(char *ret) sprintf(ret, "%s", "WUP"); break; case CMC_SRS_WARM: - cause = cause1 & (CMC_SRS_WDG | CMC_SRS_SW | + cause = srs & (CMC_SRS_WDG | CMC_SRS_SW | CMC_SRS_JTAG_RST); switch (cause) { case CMC_SRS_WDG: @@ -193,7 +189,7 @@ static char *get_reset_cause(char *ret) } break; default: - sprintf(ret, "%s-%X", "UNKN", cause1); + sprintf(ret, "%s-%X", "UNKN", srs); break; }