| Message ID | 20190321083553.4068-1-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBB7EZZXSAKGQEMALZUMI@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 94AC73F9BA for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 21 Mar 2019 09:36:14 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id u8sf4935081pfm.6 for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 21 Mar 2019 01:36:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1553157372; cv=pass; d=google.com; s=arc-20160816; b=hZdeLa4j7GKUChzi489TUEfScBzBaCqgZTc+Fs9wENgzihWiLP4AEhGZ1usREUeZzN 31w4UYKCWkJwdvkN+z7Lk9AsUoh77LgoKU6qxi76rkcxkCdBjASkA52XWRykyF7Ma8Dt AbXA5H8+p8vudg0jgPmrKlHMUTnHbbo9jJibXMlXplFBkslCPMs6F1kIBwTJ5+8O1DEQ bMz0QgkZYacEl5vKt0d7tUDFc1lq7Jhemug+T8xZu8WMQGM4PW5AmzyzQc96phlu9QiM vKfzx7Ml+L+tUQu6HlQKcB6NFRIqx6LjP8dYraJyHQ4oCh37P39R0kND6anP9TkoOuwq sg3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=z8q9SzetWUmIPy2tteJ0bGgY8J8zxvgDb5MQ7PGsy/A=; b=nCBLplhTrJNwwyAFiFMx0kn0v/T5xfokyNQUcWXY2IW0q8Yrd69nvc7LomHQYxIkpz gRGVV8k6BMai0kpavWIjYHjPPUAddiHsFs+XK8TrA8KgAPhREEJWwldIW0o+6h4CBG1K s11shhGs52ECN6cFPoZ66tvY/6Qg8bsm3OatjTfUSAjMt+apDxUqfZ0IeXjLpu8xpq6h fnoL3/bYcOpP2LL7IBZllXxlk/DuW3IcqTLcFEWNo8vi+fMURyaF7y1zT6ow3uhmBHm6 KArj+zW5Fsy23Oa4tMB+YnohLXlXHowp/SIxPhBtrIxbPk9XLNFA9v5mTKDZQLfS9BaV NmTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ggYSDUcd; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=z8q9SzetWUmIPy2tteJ0bGgY8J8zxvgDb5MQ7PGsy/A=; b=r5/HaW9ih3OzWQSar2dcv/8JPcIZJG3VGXDIp8cjHW2tjDkOle7fTV6Ti3Z1x2LHH5 Ys1By1D+Q1WqtZGdTMKIU5eWw68H9vO+Yv665n2U4no6Sb1USq6idoaiUgsI293vqNZj ld1ub808P+EtcFxjH5FPvT51N7fgEyur+WB6s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=z8q9SzetWUmIPy2tteJ0bGgY8J8zxvgDb5MQ7PGsy/A=; b=qnsn7is1YLwprUsHGUdgnN9M3pPGE0MMtvf0SeBElUR5LjzH8py0K4N8ayXHO75jEK UHVqs/nqGjkaoyuTSk28vT95wn9Rn+CUT37p9RISSQ4HsPfBlIPg8zekRYJiXO5CzT0z VBQp0gwfD8PHCsFptUKDt7uBnHEeCw6ItDL2dEObS7XmJesy4yk2wvYJ52f+0cZ3q/bc CwhbTIPurynSqt1sesBYBKbNxW/f+DPJUNpb84Emb81tdsoLsGNr6VsR2/Grl1iux+kv CrVKnCHrBMWnbuJZiNEY35/gw7Ppd53yl0aRq/OsAahp8o2LcX1QWKP/nRb/oPOxZ/gA uKIw== X-Gm-Message-State: APjAAAXEluXESiGEIaZoj3yCJvP8kke4kGWbmJsvl1iLy2Gl9VypOtnM ViBG+JzyRzxNKPQh6bp1dlT3TNdk X-Google-Smtp-Source: APXvYqwsE+wxUNte2rg8i5xWdd088qlB7jbUotlWVb1VMUit7OmVE9b47gSx417+GqYPQ5HNgzXkGA== X-Received: by 2002:a65:6410:: with SMTP id a16mr106038pgv.33.1553157372461; Thu, 21 Mar 2019 01:36:12 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:5081:: with SMTP id r1ls1904601pgp.9.gmail; Thu, 21 Mar 2019 01:36:12 -0700 (PDT) X-Received: by 2002:a63:e850:: with SMTP id a16mr2212868pgk.195.1553157372144; Thu, 21 Mar 2019 01:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553157372; cv=none; d=google.com; s=arc-20160816; b=P7hg2a+0xxvykQI8mlq2rcPOVrUWzDjdJSFnuTaUtdV0vw73xMonW9j11y28PzAn1O KTYMH1CYP4ZcotYj4/94SeKy0Cf93Z0B4x6lkstHetkQmy7qdZh4Qm3MEIGRwbIJ/TL1 fZZ8MNhQMzanw2IcSnLGZemsyQKF18MfxN8Lw5mWuy+FBrfUw5rR3A20LIWzPm8dsUZ6 jKfbEmtCVeX3srVVADPEH+Q2eDcnIyeIetXmEj8qIOzOHRt6AG8uddZj5IJF27TlXQ/I svw9dsVXTKTEJeuMvfXKXYABOB2A7Oa1+6ZEWcBkF03MsnxMHwQHy2Mbt4/kPKs4O8FF /qNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=F70DqvQgUsMKiZsp1a+ESsYxZoT9YWELCEBuJwS27pE=; b=Qyd9Bpcaqgk/UP8JnUrspRrzAk20IAhi6DSwdt/9M3AwcPjTioRsNFPYHMn+PCGhlh sErL65RYEskVmHqF5S2kPAJIbxRwYl68qeVYuXNqRMEDGK4/+w0iNDqV/BhDend9bwAN pLIJhJXWUd0oDJK+KoR42VUrWray0bwOdQFx9/7hqUw4VPieGl0WX4FUkGUvTyEXBTDi Vf6oqFg2z2WNw2cGpze2zZB5hVcN7aNhvQS9chwyjjl7ADmGG7inMNiTRnBHoyZ0l2tl VB5h+Wn18MpV3aQP7ixaOWqqFUs9VCkmSLdVspvBVyEkWJu35NJWL1lhQ33XPUHHJamf pFZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ggYSDUcd; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h22sor4822754pgh.71.2019.03.21.01.36.11 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Thu, 21 Mar 2019 01:36:11 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a65:43cc:: with SMTP id n12mr2171356pgp.218.1553157371231; Thu, 21 Mar 2019 01:36:11 -0700 (PDT) Received: from localhost.localdomain ([49.206.202.234]) by smtp.gmail.com with ESMTPSA id n65sm12501420pfb.160.2019.03.21.01.36.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 01:36:10 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Stefano Babic <sbabic@denx.de>, Fabio Estevam <festevam@gmail.com>, uboot-imx@nxp.com Cc: u-boot@lists.denx.de, Shyam Saini <shyam@amarulasolutions.com>, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com>, Michael Trimarchi <michael@amarulasolutions.com> Subject: [PATCH] configs: icorem6: Use imx6 cratch register for bootcount Date: Thu, 21 Mar 2019 14:05:53 +0530 Message-Id: <20190321083553.4068-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ggYSDUcd; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
configs: icorem6: Use imx6 cratch register for bootcount
|
|
Commit Message
Jagan Teki
March 21, 2019, 8:35 a.m. UTC
SRAM address used for bootcount on exiting code is erasing
previous count value when system reset from Linux. So use
the dedicated imx6 scratch register, GPR2 to preserve the
contents even if the system reset from Linux.
Fixes: 4eb9aa39350e ("configs: imx6qdl_icore_mmc: Enable watchdog and bootcounter")
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
configs/imx6qdl_icore_mmc_defconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi, > SRAM address used for bootcount on exiting code is erasing > previous count value when system reset from Linux. So use > the dedicated imx6 scratch register, GPR2 to preserve the > contents even if the system reset from Linux. > > Fixes: 4eb9aa39350e ("configs: imx6qdl_icore_mmc: Enable watchdog and bootcounter") > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> I tested this on Engicam imx6q-icore, so Tested-by: Shyam Saini <shyam.saini@amarulasolutions.com>
Hi Jagan, nitpick: cratch ==> scratch On 21/03/19 09:35, Jagan Teki wrote: > SRAM address used for bootcount on exiting code is erasing > previous count value when system reset from Linux. So use > the dedicated imx6 scratch register, GPR2 to preserve the > contents even if the system reset from Linux. > > Fixes: 4eb9aa39350e ("configs: imx6qdl_icore_mmc: Enable watchdog and bootcounter") > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > configs/imx6qdl_icore_mmc_defconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/configs/imx6qdl_icore_mmc_defconfig b/configs/imx6qdl_icore_mmc_defconfig > index 68ad1c6d20..24e99718e6 100644 > --- a/configs/imx6qdl_icore_mmc_defconfig > +++ b/configs/imx6qdl_icore_mmc_defconfig > @@ -16,7 +16,7 @@ CONFIG_CMD_BOOTCOUNT=y > CONFIG_BOOTCOUNT_LIMIT=y > CONFIG_BOOTCOUNT_BOOTLIMIT=3 > CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y > -CONFIG_SYS_BOOTCOUNT_ADDR=0x00900000 > +CONFIG_SYS_BOOTCOUNT_ADDR=0x020D8024 > CONFIG_SYS_BOOTCOUNT_MAGIC=0x0B01C041 > CONFIG_IMX_WATCHDOG=y > CONFIG_DEBUG_UART=y > Just as info: I confirm that using start address of SRAM does not work. Rather even the GPRx registers are not a common solution. I have already seen that even the GPRx registers are touched and cannot be used on some i.MX6 variant. Anyway, if this works on your board, fine. Reviewed-by: Stefano Babic <sbabic@denx.de> Best regards, Stefano Babic
Hi Stefano, Thanks a lot for reviewing this > nitpick: cratch ==> scratch > > On 21/03/19 09:35, Jagan Teki wrote: > > SRAM address used for bootcount on exiting code is erasing > > previous count value when system reset from Linux. So use > > the dedicated imx6 scratch register, GPR2 to preserve the > > contents even if the system reset from Linux. > > > > Fixes: 4eb9aa39350e ("configs: imx6qdl_icore_mmc: Enable watchdog and bootcounter") > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > --- > > configs/imx6qdl_icore_mmc_defconfig | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/configs/imx6qdl_icore_mmc_defconfig b/configs/imx6qdl_icore_mmc_defconfig > > index 68ad1c6d20..24e99718e6 100644 > > --- a/configs/imx6qdl_icore_mmc_defconfig > > +++ b/configs/imx6qdl_icore_mmc_defconfig > > @@ -16,7 +16,7 @@ CONFIG_CMD_BOOTCOUNT=y > > CONFIG_BOOTCOUNT_LIMIT=y > > CONFIG_BOOTCOUNT_BOOTLIMIT=3 > > CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y > > -CONFIG_SYS_BOOTCOUNT_ADDR=0x00900000 > > +CONFIG_SYS_BOOTCOUNT_ADDR=0x020D8024 > > CONFIG_SYS_BOOTCOUNT_MAGIC=0x0B01C041 > > CONFIG_IMX_WATCHDOG=y > > CONFIG_DEBUG_UART=y > > > > Just as info: I confirm that using start address of SRAM does not work. > Rather even the GPRx registers are not a common solution. I have already > seen that even the GPRx registers are touched and cannot be used on some > i.MX6 variant. Anyway, if this works on your board, fine. Since GPRx registers are common to i.MX6, I think it can work irrespective of boards, please correct me if I am missing something here. Did you come across any generic and robust solution for this ? It would be great if we can use more generic or better solution. Please let us know. Thanks a lot, Shyam
diff --git a/configs/imx6qdl_icore_mmc_defconfig b/configs/imx6qdl_icore_mmc_defconfig index 68ad1c6d20..24e99718e6 100644 --- a/configs/imx6qdl_icore_mmc_defconfig +++ b/configs/imx6qdl_icore_mmc_defconfig @@ -16,7 +16,7 @@ CONFIG_CMD_BOOTCOUNT=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_BOOTLIMIT=3 CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y -CONFIG_SYS_BOOTCOUNT_ADDR=0x00900000 +CONFIG_SYS_BOOTCOUNT_ADDR=0x020D8024 CONFIG_SYS_BOOTCOUNT_MAGIC=0x0B01C041 CONFIG_IMX_WATCHDOG=y CONFIG_DEBUG_UART=y