linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: Eric Anholt <eric@anholt.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-watchdog@vger.kernel.org
Cc: linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com,
	Sebastian Reichel <sre@kernel.org>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v3 1/5] dt-bindings: soc: Add a new binding for the BCM2835 PM node.
Date: Sun, 9 Dec 2018 13:14:01 +0100 (CET)	[thread overview]
Message-ID: <53380420.68255.1544357641824@email.ionos.de> (raw)
In-Reply-To: <20181130202743.20585-2-eric@anholt.net>

Hi Eric,

[add Sebastian]

> Eric Anholt <eric@anholt.net> hat am 30. November 2018 um 21:27 geschrieben:
> 
> 
> This binding supersedes the bcm2835-pm-wdt binding which only covered
> enough to provide a watchdog, but the HW block is actually mostly
> about power domains.
> 
> Signed-off-by: Eric Anholt <eric@anholt.net>
> ---
>  .../bindings/soc/bcm/brcm,bcm2835-pm.txt      | 42 +++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt
> 
> diff --git a/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt
> new file mode 100644
> index 000000000000..7818d33a158f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt
> @@ -0,0 +1,42 @@
> +BCM2835 PM (Power domains, watchdog)
> +
> +The PM block controls power domains and some reset lines, and includes
> +a watchdog timer.  This binding supersedes the brcm,bcm2835-pm-wdt
> +binding which covered some of PM's register range and functionality.
> +
> +Required properties:
> +
> +- compatible:		Should be "brcm,bcm2835-pm"
> +- reg:			Specifies base physical address and size of the two
> +			  register ranges ("PM" and "ASYNC_BRIDGE" in that
> +			  order)
> +- clocks:		a) v3d: The V3D clock from CPRMAN
> +			b) peri_image: The PERI_IMAGE clock from CPRMAN
> +			c) h264: The H264 clock from CPRMAN
> +			d) isp: The ISP clock from CPRMAN
> +- #reset-cells: 	Should be 1.  This property follows the reset controller
> +			  bindings[1].
> +- #power-domain-cells:	Should be 1.  This property follows the power domain
> +			  bindings[2].
> +
> +Optional properties:
> +
> +- timeout-sec:	Contains the watchdog timeout in seconds
> +
> +[1] Documentation/devicetree/bindings/reset/reset.txt
> +[2] Documentation/devicetree/bindings/power/power_domain.txt
> +

sorry for my late reply. I hope we can take the opportunity of a new binding to fix an old issue of the bcm2835-wdt driver. The watchdog driver sets the pm_power_off callback without checking for "system-power-controller" property [3]. As a result we can't use another poweroff controller like e.g. gpio-poweroff. In downstream this has been workarounded by an additional devicetree property for the gpio-poweroff driver [4]. But this isn't the right way because the issue is in the bcm2835 watchdog driver not in all the other reset controller.

Suggested pseudo code:

if (!pm_power_off) {
    /* Preserve the old behavior of watchdog driver in case of old DTB */
    if (!of_device_is_compatible(dev->of.node, "brcm,bcm2835-pm") ||
        of_device_is_system_power_controller(dev->of.node))
        pm_power_off = bcm2835_power_off;
}

Best regards
Stefan

[3] - https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/power/power-controller.txt
[4] - https://github.com/raspberrypi/linux/commit/f86dcfac0a4e478fee40b5a3729ff1b159ae91ee

  parent reply	other threads:[~2018-12-09 12:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 20:27 [PATCH v3 0/5] BCM2835 PM driver (MFD version respin) Eric Anholt
2018-11-30 20:27 ` [PATCH v3 1/5] dt-bindings: soc: Add a new binding for the BCM2835 PM node Eric Anholt
2018-12-07 23:48   ` Rob Herring
2018-12-09 12:14   ` Stefan Wahren [this message]
2018-11-30 20:27 ` [PATCH v3 2/5] bcm2835-pm: Move bcm2835-watchdog's DT probe to an MFD Eric Anholt
2018-11-30 22:10   ` Guenter Roeck
2018-11-30 20:27 ` [PATCH v3 3/5] soc: bcm: bcm2835-pm: Add support for power domains under a new binding Eric Anholt
2018-12-07 23:49   ` Rob Herring
2018-11-30 20:27 ` [PATCH v3 4/5] ARM: bcm283x: Extend the WDT DT node out to cover the whole PM block Eric Anholt
2018-11-30 20:27 ` [PATCH v3 5/5] ARM: bcm283x: Switch V3D over to using the PM driver instead of firmware Eric Anholt

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=53380420.68255.1544357641824@email.ionos.de \
    --to=stefan.wahren@i2se.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eric@anholt.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    --cc=wim@linux-watchdog.org \
    /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).