From patchwork Sat Aug 7 08:01:06 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: 493383 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp1031095jap; Sat, 7 Aug 2021 00:33:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtr8FzizzC4K0/FwwfNSfDj3qFLGCwOX923/yhUQg6kVC16eYqMDbhxWos0VmsrTtSsCde X-Received: by 2002:a17:907:6297:: with SMTP id nd23mr12961186ejc.62.1628321625718; Sat, 07 Aug 2021 00:33:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1628321625; cv=pass; d=google.com; s=arc-20160816; b=c+KyZfaDedumvf82FwR1tIwktNd2rjR/V/6ak+bvaAWcd2mcnauRJYCOXYGAinTXNb YLHCriCEkJejdIs7Bokt/T88zWKf3OE1q2eTLeuX7p2OrkjF8bqBt5fTk+61QRp6uvGs 7+7JtUTE65KVCEEHzLYSM9IFCiMgkAyYToRyHD8nVCAb8nsB7LlPL81Z6Pi/OmEvoSi+ shfKYZNueVO7cQQrKO8cpT5L1Y9WiCmUeWxMNIYO69LXbLzPz9/W/T0tsyJL7JqXFD9u qS66MT6n6Mg2xgl9kkoesh/S4hMsAIyKlIes77bwgmVpcNelNCxh9ZIWyQ66rzQKKu+O 6gfQ== 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=wNslmvD7hFbxHl4nGaJlkwvWxcNbQnitInltGBAUkcBeWsIg/KPCu0kZSXb0hmtKCm QM0N10zhrZB+o7ZOnSc7xeTKFHilkdX3W1ECxCff1vM53tuyBsqw4FyBlmpFDD8JmN9R xoM0cYK3bDZhc25a+X9PPyGLxuuIkUkEMUQOjPyjzK7rzksRohg1hcCjEpidAmNjeGBr IZC9bpvPnHv5wTs/tDV+JXBri/yF2SgaavIsHkiUPA5rSO1QOjiKW1mc9m6rArD2zjy6 3dfg99gnmtr5nHBBQMZwRJcFM2BPxWMikSqR4R5Yv6I+QXLd/fCQc38PJ/ZxIMl1nNK/ zUqQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=MRFSZnxL; 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 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id q15si29617edd.558.2021.08.07.00.33.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Aug 2021 00:33:45 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=MRFSZnxL; 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 85.214.62.61 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 0B190832DB; Sat, 7 Aug 2021 09:30:25 +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="MRFSZnxL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 024D383208; Sat, 7 Aug 2021 09:28: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 EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2062d.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::62d]) (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 615FE83238 for ; Sat, 7 Aug 2021 09:28:18 +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=Atxg4iYMVg/zgfJ+/dTEOAcy4okOAPMSpNy8y78VzIFz+W79dwICpa+wylLTaHk3bPJ9+/kmYZCu+FKbyRD9pUmJ4lHPMXMk1xMTQ/miKoU49Olxky2yEIm4/HapecbowGTT3guao4MWtr8WXsVa1UAS8jv0V8mJhfcr7zWBnw4ixFT7VWjbnEtVnh7MOmOuBd4nj+27FrpnqeUr7pOv9G61kzj4/kGq5tgzWWCrjMAF7CAyAgMa/+tiWGyh8CC+fm7BltaVSwuY0Hid2CS0dk6ExiYHKDVSV7GiUoT8ZL3CKXMY/wFn1N1gXX1Qp8cvecveJhE2U1wyTU+FeX3OwA== 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=Q77Or37tXkfAvy74ag+kIBclXS0fUDqSOV0MmsGc61FHmWszjzD9fglXJ+ALDy2/hq3hIv7wHguw1B7ejEGJfTaxM0pb/AbsW6HPmWrYaJoWKIWmZ/8ldE8Pt9fvP1f0Nsfa1t3SOXIjzZDxSI7WZyDR9LSDbV4ombZY62VkS4lVmFIlE8TbVwtWdcsX9yvqQWNkF/lF6znRkS9uEwZVZvqTg8VQDiVZjCViiqvIgFImS7XkeHj/8U3NvJ+LIMIKZP6mZFI0Oe1NMooaUWZqKZ5kro0NoccP9hHLxpj+vDAjbhxGzLrTMMPxPnqNgaWn0jzvcgs3DgJPdV6k5qtosQ== 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=MRFSZnxLCiqNDo5wc/kcDTPEHQ988a2+vwBfB0lRSJJZ+y8XDMiDDjZnz0NSwV79akCa6028H1lCDh+dYCEKr4Laekl3TRI9nIT2XO3GOW/Coh7L2H8Ax36NySJsdBC+NMGkndPqJ6Wd65P2J89udPSSuB6WCy+oHECmOnwF7oA= 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 DB8PR04MB6857.eurprd04.prod.outlook.com (2603:10a6:10:114::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Sat, 7 Aug 2021 07:28:17 +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.4394.019; Sat, 7 Aug 2021 07:28:17 +0000 From: "Peng Fan (OSS)" To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de, uboot-imx@nxp.com, Peng Fan , Ye Li Subject: [PATCH V5 37/44] imx8ulp: soc: correct reset cause Date: Sat, 7 Aug 2021 16:01:06 +0800 Message-Id: <20210807080113.16020-38-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210807080113.16020-1-peng.fan@oss.nxp.com> References: <20210807080113.16020-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR01CA0133.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::13) 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 SG2PR01CA0133.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Sat, 7 Aug 2021 07:28:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 554bf0fa-c1b4-4daa-555d-08d95974ec75 X-MS-TrafficTypeDiagnostic: DB8PR04MB6857: 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: XBJ06Ie8cr0cRVQEJJxrRhfGrd6CtOE4jHxwJCj0+FGM+VabsVR2g4cly+Lf+67Swu14BrwUkfsMP04GXxdlD9EKosjK9/wSNw5PplTFm3Fct/3hWVHBebmNqy+0MFkDLi9YXyjtk9WuZDk/8Tj4zooxvGtCevJ7k1C+O1lB825MRX5E7jPbDHMx9LZzTpyiSWemZy9urLwmUEH2XrDru8hLf/2q3D2ZfIvIdgISiKBHG5b2Mm7MqE5ZTAZ7nIArvt+aQSRuqM1yuAyZq+nInqmhI0CYk4RcRSqIHW9lxBcDKxfTmU7HFtBCwO19kMBVilSP7GRpRXOm6qE0fLCznNaa/vG73RXRBOsYma8FPnLWWQ2BpyVnpLBVyCDQ1TfbpAZnioicIntlOkSA2QEHW8cjioJo0eEZn6+nTufyINuXrs0vdoT1C8wAOCv0DCs32fK93uOgZcC6CaIPMXVDzHgajOY9kKp4cxLQbhsvHltfeY5Xbkk3xNbsh0Pv/gp9V/cELqe0hqhxgvmANwPrkJOBCA74rKyygKzLBSow1+jJ/Jw1/oR9fOxhIk6dIK+2NgN0E0tIW3w6IH0pHTTkjSQJJMDW+ky5g1voJ+wiqUyxd6fO1me+jCqUI02Po73qLUBnhzia4g2O6E4nL2wExTQ9eYzsoASpcwfsTB40NBnleALIMQ+A5ccAqAORPn3cqHCVoLJokS7sPfbm6uD1JBDnsYfgwPPDCX/0KjrAO0g= 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)(346002)(366004)(136003)(39860400002)(6486002)(956004)(8676002)(54906003)(6506007)(26005)(4326008)(8936002)(66946007)(83380400001)(2906002)(2616005)(66556008)(66476007)(5660300002)(6512007)(1076003)(38100700002)(38350700002)(86362001)(186003)(478600001)(6666004)(52116002)(316002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 15UWgmsmoZXwNeTULJGRoUade2obol68+pG/4uTe0UyDoOZHUrymKks0x0VRxDJAV4H7jNYqo8giDTFW9vtHrgMFV+PDZGzAzbYS71pUKTnUy8zWlHQ1vninR/DSoJ6Wh0WlvPCKo/98sxcqz563f9zuFFOddhfxZ5azuijZNsfHlstG5DnL5d/zLToWIus1QvyGKTV7aGnMwZeqninUnHDejNMwNc+gcCH/bC/HrAe+KaPu0gjxCXALdTdGM20X+L0lE+bv/uDqxgXyYkl0J5rpOAoyxEiCPk3Q5wOCgN8WyzLum4lvWcFjJkVgQWqyXXHSkZdxO/pMdflmRuUxfsnkLRMhQylN0DFZUPjJdEsJnitYVduHe9uadaPyEhy6rKRPDDGPAUqj+xWnntjFxhxswmSS3IdoLswUbIvZB9uQL2nyRzCOVrgNi2ZKW773bfzj42dKMtJQjicZkd5cSrEhFmaJH0yiuCzYGePvdo6NoExgT2eTU1fU5iE2HBUsfymBm6mEktQbnoP0S9jV0HkYYUTj+lgL0A4k9l3F+ndTIepASJPXPYBtIUwB2tNFteoD2iua1WI6RGsXDAhkypS2US5d9rnvfixj9t4oGd8qBR03Cr5D1bE2b0xKwKp/bv6zMy4hocqTlGQRO4xEjVO81k8XgKzEaOdSd5UM8SuMDkoTBcxTJDSABRfXkC7GXOaeV+cQmHP5ZrU0ejHkYWf41KAJUU097FgDmeC8SwyA8Un6oZ4AZnLGbskixpLfz9MtvhuMcDvjYuDQ4orT+qxygCoGPKfa0E6Mf01cVzg2Py8b5iFreh9pf9OOPKfVXL/7vRC9nwpPfxqMXA6nEXmGW++kveTB4FWcUPOdr6EsUVgP5imzDknUQVoUZdY6SaVx2oJfdT12Nw+v0RSAFYWTMdDexPfyVwRbu4ATfPv1Duc2+arBu/a4QAamzLEej0fInF5Jx3a65no+L0YwXPz6FpjlCw4iJzToTD3d+1Oxe+Gdb54SmjOstIYIK/9oNcndQAGLDJP/VDj3cTleDrz5I0iNnGbnoHVqgYl/eYvTXGnJtAKt08ud2USPkpp0tM7pho3OouaWf7mnFWr2hucbkC4OxUzA4YGt3o5WsfEV4vBy1eOwpTrmXaxnEIuc9wnFwWvOZ8wIvEsgxPbvEBQCFHPzJg1H2YJjpjTfxyoWWcCjF2zmjwsIzDLGilvF/Vo/VBIqNR7MTEzCe6dx7F84S8vE8LJkwlbpfR6QM2Qyn9x4uVAc96UdjKsvFFwGm0hvBZxs3xB9pMdedR7+YGCU6gj+y0O7VX09OAvypXlfTd10jNEdOS4nOo8I73S/ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 554bf0fa-c1b4-4daa-555d-08d95974ec75 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2021 07:28:16.9795 (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: VVdjAhMU89uhztZpr6xnAXykUrEQS/hWVrK7LnnBwngq420aTfTsbh+2GSE9IfexGvhWYrgxK8fVnkNphhybwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6857 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; }