From patchwork Mon Jul 19 07:47:10 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: 479817 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3868727jao; Mon, 19 Jul 2021 00:17:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoNxXDrgJ+OtUtTGZ4cSZ0hLq3WJRlXtETj5xdaqQalVAIp38u6BBkLo6NywbwVNYHuvUG X-Received: by 2002:a17:907:7ba7:: with SMTP id ne39mr25639483ejc.467.1626679042843; Mon, 19 Jul 2021 00:17:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1626679042; cv=pass; d=google.com; s=arc-20160816; b=W74Lw7BwUBF0xr9o7kEqRxgc17SSjKe1gByv5VM9EmrTwwabk7WKvBwaLCTBj6RARb mc7Qbksg/XGEvaj91LquTrTsv2f+wJJyO2dfFWgmYzuoSyQ3yTA/c3vsZ/FGdML/iWYe JsdDDUmUdZNTw7QZUAZctsg860JYg7NCigPTthP3OiNrYG5gm38XQ+JrCJPW0g7sLans BYnHCi/VxRO/FAXyNFDxs21DQ47DQKJHFzfyT33XaejA02ZQ5pi3OWFtPCfySiut5V4Y njAoIUP37/FB9IhHIcI9vBvwK9Wbsr4KfN9oZ8GoCdnwcj+Asb2Ty3XOUe/GBOvPqhNc BYmg== 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=cNnsAIW7am4/EyhfDfCEZegNaceeUtF2nfS6EfZVEmo=; b=CzDfn5AoAacz0nW0JE19lYRxg3kj+TvYLw+TjBQdzf2icLjhhYCf4FX23MBO3QSMc0 em/9Z7+Y+BNvuehim6uqYJXwTy4RvVAjCISyeLP2gKTKYEzBg4TQoz4yc4RoOBPmQxnV yC19dEyAz2dNkNao7phTOF7IjAuWcM9vVmAbcocR/5IarRrOdteEPqgFAM/d44K/9519 Ro0RyW1fk8EbU4WOgqBBfac/mKBqKK0cX6TsvB5hCsLYJ1zW6ixWfONcdPjAb8TbRfLb jozjbCohKHYak8Zzsd15JMGqZOUGx+Yb1nkfeSUoIioTkn6qfP/+JA4L8wftGpp1DmcH wdGA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=aX7SqJUB; 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 j23si24996938eje.21.2021.07.19.00.17.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 00:17:22 -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=aX7SqJUB; 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 346D182C8A; Mon, 19 Jul 2021 09:15:07 +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="aX7SqJUB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 239BE82C59; Mon, 19 Jul 2021 09:14:34 +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.6 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-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20609.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::609]) (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 5E1B1829FB for ; Mon, 19 Jul 2021 09:14:27 +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=jNZHPLlK4rodlu7EmKX4mWxyX2jql4mc++7FbvbEa6NU0v3VMlFodCW/XHWjSEb3u1pIwx6wnpwF0sQTskwGtcZrliGytAMLI5ZLUulgzVq5OWO7GABUMlQRw4yHK6FIEHp5X/SANngRefy70zvfAq7gUkmCP1ptbmdRx3fps/kkAlFHT+E9Vc2bmbdbF+4w2sukvi9MCjOabxDS2l3+RyeUo/K/GdE4ikjYq84uENh74r58AX+3kJRuvYrZS1D5DwKXRO68AUK5Vf4LV9DomSKp/Mp90okRvW7hlle4ak7yzGILfsxJAZItHr8ycAxFlizO9gwh8zG27owZ0lEzow== 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=cNnsAIW7am4/EyhfDfCEZegNaceeUtF2nfS6EfZVEmo=; b=V+Kk+NO3TWU+mS+nWt8qPOalMtuRjAfrjbanxYPv3/eg766FSfmj/ha9zRC3MtX1HjLNN7/WY0JI+pFE7onHDIJRA1yBXIjB0Y8UTLBcrdKGtMPhw6cjxtRlly4s2UI7lV3HeRhNCs1uP+hjZeKuyoVU07n8KvR/QTlencZf2FtSNPllptbqQ5WJVaip7VEOgyeJA/4y6WpllpTv7dS4MFQMNAvekCwRMePguOFChwqkNaef0kXHbmXuI5O/yvBk6asNE7SOw3IbhSdEBD/0+pZpvNctbZ7alas/pjdLbLM3dp4MEP+Uibt6jJ9q17BAtQwJ/oBzuHimtdnyLGuVHw== 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=cNnsAIW7am4/EyhfDfCEZegNaceeUtF2nfS6EfZVEmo=; b=aX7SqJUBHAWHmgg8jDYTJ7/+dzWHYsuaRoJjaz8G4TIxTfWZ1CH66UEMoHjjpISWwkYbpQhVEXXkqyGSmHr2H2WpveNCDgwB1zUP00Zkn5GJI8EjqZQKBjWPpqxdyZ2ed4nU45VIPYDSm8I3b0AgCVq5UHMo1HwM+yzqHGiJ8Es= 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 DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Mon, 19 Jul 2021 07:14:24 +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.032; Mon, 19 Jul 2021 07:14:24 +0000 From: "Peng Fan (OSS)" To: sbabic@denx.de, festevam@gmail.com Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Peng Fan Subject: [Patch V3 20/44] arm: imx8ulp: disable wdog3 Date: Mon, 19 Jul 2021 15:47:10 +0800 Message-Id: <20210719074734.29170-21-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210719074734.29170-1-peng.fan@oss.nxp.com> References: <20210719074734.29170-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SGAP274CA0006.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::18) 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 SGAP274CA0006.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Mon, 19 Jul 2021 07:14:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 235750f7-4f54-4e1f-04c0-08d94a84d60d X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1247; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BGR/7Bw+FYn63dben0p3MjE2iLYWza5Dqtm6cv8YJOTSlFMwQsjwwXzA06Yj/e8b6dLKsG443Zwb6soQT3/+dl1C/IDtUytdVxVyLCyUf65iMRQNvl6hoo5x1TAccPfBDfr3RaJng7oLE4aRnLv34RgRJWyNLS7hg4mYPCj6rnV7AqGjJ/p5cBNj1EAIVuAl7ho0I4Ju148z8GIEMkMHlaZoQTIgAo/4BdG/aSIQQklKoGaQnSKtUSSvtcRpHHytEEdh0y28r1BB+gqf6Be6jzCBljSdyoFJrk75Nf8zZvk5Ovl/+4KVe0D/4kqQVEMpBL3egRNR0COjKKmH47M8JpFql8eUJaxRnQPppuD72wq2R47vn05PAx1YQHySuej9kH4v4K+A+RoFCwGxfgTrs2T68tDZeIeQ5p0xoi1FMWynsPoqEHTOKPAWoSinT7uUkxavKW3gPZ0BKNDuEQZn6P+j2V/rk+svFin1Vhm5mjXD+se5INg+TAyBHMnI0t1ODPzJ1FINbpfOaExHOTVw8opN7aknyHt9cyUcJaNhvKqWuo/iKPiQ4QfJeKKI1gPCWoTQz8wCH5Kx7EL+x0U0pm63tXNLQJcIkp30LL4gWZ2ZjjaDP9OhRJJY9Lm6toGjfhMwLUE1anBqOETvc2qegEmxNhS86pFUWyykBrOeYbHtG1byZfWhVJ/sXjynTtb1cu3vudwC+bPV5ZO1+aBptuosf0ly+b81bxPs4cdpriM= 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)(366004)(5660300002)(508600001)(6666004)(316002)(956004)(83380400001)(8676002)(66946007)(6486002)(6512007)(66476007)(66556008)(8936002)(2616005)(1076003)(26005)(52116002)(4326008)(186003)(86362001)(38100700002)(6506007)(38350700002)(2906002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wLn2sAi6flE85B5ixJCEVVncm4ND/765CgmfZMS+4vM7rAtZ3PKf58ITc2zfO8F60L3zyLwpmmzfJDSOoOsJNOvpRbq5eJ3nxM94MvL73pt0MW7EgpH+i97FsyATAP15ThwWTffIYJHIhSdQBunR3axiykNIJ77Ep/ii7uzFBPxMWsrr0ItvJCfhk+IgdVl0zWi+iz1CjoR0W6RvZCdz2GKlqCMOrlqXaXBwamLOMT/sIbeJ6WBjRYdjKgq0awcXnGbJFsScxGRpna5h7dZRiWUQ3Kw+oxRZQsdtG86ebHfuyLtytRwp9YipInaKgZZIyWNvSdToeIS+zw83E3SZgAp5eB5eqZb4P9b+PXXGETawZvBo5bTpGJK40LQ2DXu+5KfPc3XTocbT5VykJBsfOFfA+jUrMFbtgqyXH4dgO2Wy6RQ5uZqh9g1YHe5dq4Q6AnxhvvrR76bE6o2RPGdLTiiY6jPi67TEDs3YDwGKQzsbu3juwtnhSNWG1pQt4TBo/qlgD7cKZLu7vvs0Azjzg7b3tYTIr1vQwKDMe/FechfzaemxkNmAiXXeXOCx/gx6oSN0oYH0QzWf5y42wc4xhsKI+Mjn5jwm16zRl3vhzXjBheSbYzfSz+zz5Euc6VCLPFhqLJFHN/PV9ABAZ+c7qLgn97uj9O+8sN3CrjDzo89pnfZVUfUr4T2d56oVmRbtdI8qR0xgZD78xCYnT1vNYBoPIytN0wcrPrUQJMeE3JWaEgKJUyBTOrLVzvx3ruBKTk9sHwfdAx4O28IvuvYC1FboIN43H3JhhcKEj4JXDFVOUbk0adeFltFKPxWckcyvuB6lQlSd0WkS7kNlKvGGPriZ+CwQ8Iq5BIUJAq0hQTsdHl+r6qU2aTmuyWHPAWbXMwWJXaDhajcrtkPYfw0b6h5v9tSk0QgPZDf6QhrKNpC3+PMsG5Jb5O+mJynqSrqT1LgP6NdnKQKHeUFtntjog50RprbJ1YTe9dTKW4MvlPvAdnJni+pApRrbNRuzBU29AcMyDPKJ7Lr68biq7QK6ivWJFekyx1NzTVcc2a+4saHjBlq0sTfcpiE7Sy4dERcwliCbOzzt/GIemOttZUzp7/5BQjvxFjBv9EmzxEPdjfVBz7F9OJy1PisXXHQ0EhiAn+cSALQ706lSIsjAxbHA//p99hOGQo5F5hpTrO9dlkVbhEKNYSzXE+HblQ2jKOordhg9DggbK3bFj9uXS9dQhEahGz+scbCKn5A73XIMqIQ15TRngebh/2Iq8v4GN3WYZlvKL/0DQ3bYPOkKu6bGumqR0jIef8lri2YZMvjjehTkIt0czUX1ZAAtrC0C/vPL X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 235750f7-4f54-4e1f-04c0-08d94a84d60d X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2021 07:14:23.9320 (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: e03HBHSo+D+TuXU3AD3AjHZbEU0ov+1QqaQ80XYB7fNsydyZ/20nwWia/1rMaMKFDC8cr/BHKv99EDjI2p+Vug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 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 Disable wdog3 which is configured by ROM Signed-off-by: Peng Fan --- arch/arm/mach-imx/imx8ulp/soc.c | 36 ++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) -- 2.30.0 diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c index 33aec228e3..051dec1a5a 100644 --- a/arch/arm/mach-imx/imx8ulp/soc.c +++ b/arch/arm/mach-imx/imx8ulp/soc.c @@ -144,9 +144,43 @@ int print_cpuinfo(void) } #endif +#define UNLOCK_WORD0 0xC520 /* 1st unlock word */ +#define UNLOCK_WORD1 0xD928 /* 2nd unlock word */ +#define REFRESH_WORD0 0xA602 /* 1st refresh word */ +#define REFRESH_WORD1 0xB480 /* 2nd refresh word */ + +static void disable_wdog(void __iomem *wdog_base) +{ + u32 val_cs = readl(wdog_base + 0x00); + + if (!(val_cs & 0x80)) + return; + + dmb(); + __raw_writel(REFRESH_WORD0, (wdog_base + 0x04)); /* Refresh the CNT */ + __raw_writel(REFRESH_WORD1, (wdog_base + 0x04)); + dmb(); + + if (!(val_cs & 800)) { + dmb(); + __raw_writel(UNLOCK_WORD0, (wdog_base + 0x04)); + __raw_writel(UNLOCK_WORD1, (wdog_base + 0x04)); + dmb(); + + while (!(readl(wdog_base + 0x00) & 0x800)) + ; + } + writel(0x0, (wdog_base + 0x0C)); /* Set WIN to 0 */ + writel(0x400, (wdog_base + 0x08)); /* Set timeout to default 0x400 */ + writel(0x120, (wdog_base + 0x00)); /* Disable it and set update */ + + while (!(readl(wdog_base + 0x00) & 0x400)) + ; +} + void init_wdog(void) { - /* TODO */ + disable_wdog((void __iomem *)WDG3_RBASE); } static struct mm_region imx8ulp_arm64_mem_map[] = {