linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Xingyu Chen <xingyu.chen@amlogic.com>
To: Julius Werner <jwerner@chromium.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	Yonghui Yu <yonghui.yu@amlogic.com>,
	Leonard Crestez <leonard.crestez@nxp.com>,
	Will Deacon <will@kernel.org>, Rob Herring <robh@kernel.org>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Anson Huang <Anson.Huang@nxp.com>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>,
	Valentin Schneider <valentin.schneider@arm.com>,
	Guenter Roeck <linux@roeck-us.net>,
	devicetree@vger.kernel.org,
	LINUX-WATCHDOG <linux-watchdog@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	"moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	"open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	Jianxin Pan <jianxin.pan@amlogic.com>,
	Evan Benn <evanbenn@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Vinod Koul <vkoul@kernel.org>, Olof Johansson <olof@lixom.net>,
	Shawn Guo <shawnguo@kernel.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls.
Date: Thu, 16 Apr 2020 11:23:39 +0800	[thread overview]
Message-ID: <ea5ae44f-8b63-d34d-b313-c8deeafd86e1@amlogic.com> (raw)
In-Reply-To: <CAODwPW9RSB37+4EJ2QXAwz=ShFB23L1GKC2mLYE5L5JuQR2tPw@mail.gmail.com>

Hi,Julius

On 2020/4/16 6:29, Julius Werner wrote:
>> In addition, It looks more reasonable to use the "msec" as the unit of
>> timeout parameter for the ATF fw interface with SMCWD_SET_TIMEOUT:
>>
>> - The fw interface will compatible with the uboot generic watchdog
>> interface at [0], and there is no need to convert timeout from msec
>> to sec.
> 
> I think we're trying hard to keep this compatible to a Trusted
> Firmware counterpart that we have already shipped, so we would prefer
> to keep it at seconds if possible. That's what the Linux watchdog core
> uses as well after all, so it just seems natural. I don't really see
> how what U-Boot does would have anything to do with this.

If the uboot introduces a smcwd driver, and it maybe work like this:

static const struct wdt_ops XXX_wdt_ops = {
	.start = XXX_wdt_start,
	...
}

static int XXX_wdt_start(struct udevice *dev, u64 ms, ulong flags) {
	timeout =  ms / 1000;  //convert timeout from msec to sec.
	smcwd_call(SMCWD_SET_TIMEOUT, timeout, NULL);
	smcwd_call(SMCWD_ENABLE, 0, NULL);
}

Best Regards
> 
>> - Some vendor's watchdog may be not support the "wdt_trigger_reset"
>> reset operation, but they can use the method below to reset the system
>> by the watchdog right now.
>>
>> watchdog_set_time(1);  //1ms
>> watchdog_enable();
> 
> They can still do that but they should do that on the Trusted Firmware
> side. Emulating a missing reset functionality should be handled by the
> hardware abstraction layer (in this case Trusted Firmware), not at the
> Linux API level. So Linux would still send a PSCI_SYSTEM_RESET SMC,
> but then Trusted Firmware can choose to implement that by setting the
> watchdog to the smallest possible timeout (which it can because it's
> accessing it directly, not through this SMC interface) and letting it
> expire.
> 
> .
> 

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

  parent reply	other threads:[~2020-04-16  3:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03  5:28 [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls Evan Benn
2020-04-03  5:28 ` [PATCH v2 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog Evan Benn
2020-04-03  5:29 ` [PATCH v2 2/2] watchdog: Add new arm_smd_wdt watchdog driver Evan Benn
2020-04-03  6:00   ` Guenter Roeck
2020-04-03 22:56   ` Julius Werner
2020-04-04  1:00     ` Evan Benn
2020-04-03  6:08 ` [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls Evan Benn
     [not found] ` <CAKz_xw0gV+w_gMkLfB4qUBdULLfFoiv1TBWp9_PHy33wP_XWyA@mail.gmail.com>
     [not found]   ` <890948ef-7276-fdae-d270-eb30eff3eab2@amlogic.com>
2020-04-15 11:54     ` Xingyu Chen
2020-04-15 22:29       ` Julius Werner
2020-04-15 23:12         ` Guenter Roeck
2020-04-16  0:46           ` Evan Benn
2020-04-16  0:56             ` Julius Werner
2020-04-16  3:48               ` Florian Fainelli
2020-04-21  1:08                 ` Evan Benn
2020-04-21  2:36                   ` Florian Fainelli
2020-04-16  3:23         ` Xingyu Chen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-04-21 11:05 Evan Benn
2020-04-21 14:32 ` Guenter Roeck
2020-04-22  0:40   ` Evan Benn
2020-02-21  5:38 Evan Benn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea5ae44f-8b63-d34d-b313-c8deeafd86e1@amlogic.com \
    --to=xingyu.chen@amlogic.com \
    --cc=Anson.Huang@nxp.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=evanbenn@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jianxin.pan@amlogic.com \
    --cc=jwerner@chromium.org \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=marcin.juszkiewicz@linaro.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=olof@lixom.net \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=valentin.schneider@arm.com \
    --cc=vkoul@kernel.org \
    --cc=will@kernel.org \
    --cc=wim@linux-watchdog.org \
    --cc=yonghui.yu@amlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).