public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Jorge Ramirez-Ortiz, Foundries" <jorge@foundries.io>
To: monstr@monstr.eu
Cc: u-boot@lists.denx.de
Subject: cdns_wdt: who enables the clock
Date: Wed, 8 Sep 2021 17:39:30 +0200	[thread overview]
Message-ID: <20210908153930.GA15019@trex> (raw)

Hi Michal

The *linux* cadence_wdt driver for the watchdog enables the clock that
controls its  behaviour. However this is not done in the U-boot
driver; I dont think it is safe to assume that the clock will be active.
do you know why is the driver making that assumption? and how to
enable the clock?

Also, I am not sure it is either safe to assume that the WDT IP will
be enabled; IMO during probe we should do something like this
(otherwise the AXI bus will complain and fault the boot)

 static int cdns_wdt_probe(struct udevice *dev)
 {
-   debug("%s: Probing wdt%u\n", __func__, dev_seq(dev));
+ u32 rst = 0;
+
+ /* release WDT from reset */
+ rst = readl(0xFD1A0100) & ~BIT(15);
+ writel(rst, 0xFD1A0100);
+
+ debug("%s: Probing wdt%u)\n", __func__, dev_seq(dev));
 
        return 0;
 }

thanks
Jorge

             reply	other threads:[~2021-09-08 15:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08 15:39 Jorge Ramirez-Ortiz, Foundries [this message]
2021-09-10  6:56 ` cdns_wdt: who enables the clock Michal Simek
2021-09-10  7:56   ` Jorge Ramirez-Ortiz, Foundries

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=20210908153930.GA15019@trex \
    --to=jorge@foundries.io \
    --cc=monstr@monstr.eu \
    --cc=u-boot@lists.denx.de \
    /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