devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
To: Geert Uytterhoeven
	<geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
Cc: Magnus Damm <magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	Kevin Hilman <khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v3 0/4] drivers: bus: Add Simple Power-Managed Bus
Date: Thu, 22 Jan 2015 11:44:27 +0900	[thread overview]
Message-ID: <20150122024425.GD31170@verge.net.au> (raw)
In-Reply-To: <1420809155-4015-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>

On Fri, Jan 09, 2015 at 02:12:31PM +0100, Geert Uytterhoeven wrote:
> 	Hi Simon, Magnus,
> 
> The Renesas Bus State Controller (BSC) provides an external bus for
> connecting multiple external devices to an SoC, driving several chip
> select lines, for e.g. NOR FLASH, Ethernet and USB.
> On the kzm9g and ape6evm development boards, an smsc9220 Ethernet
> controller is connnected to the BSC of an SH-Mobile AG5 (sh73a0) resp.
> R-Mobile APE6 (r8a73a4) SoC.

For the record: Olof has asked for review comments for these patches
so I have dropped them from next pending that activity.

> The BSC is a fairly simple memory-mapped bus, hence a "simple-bus"
> compatibility seems suitable.  However, the BSC is special in two
> ways:
>   1. It is part of a PM domain (A4S),
>   2. It has a gateable functional clock (ZB).
> Before a device connected to the BSC can be accessed, the PM domain
> containing the BSC must be powered on, and the functional clock
> driving the BSC must be enabled.
> 
> Both special properties can be described in DT in a standardized way
> ("power-domains = <&pd_a4s>" and "clocks = <&zb_clk>", cfr. the
> example in the DT binding documentation).  Externally connected
> devices are described as children of the BSC node.
> 
> Unfortunately this doesn't mean everything will work out-of-the-box.
> There are two problems:
>   1. Without a device driver bound to the bus device, this device is
>      not attached to the PM domain. And although a child device is
>      present and active, the PM domain may be powered down, as it's
>      considered unused by the PM domain core.
>   2. Without a device driver calling pm_runtime_enable(), its
>      functional clock is not enabled. Once runtime PM is enabled, the
>      R-Mobile PM domain platform driver manages the functional clock
>      using runtime PM.
> 
> As none of the above is really bus hardware-specific (PM domains and
> functional clocks in clock domains are handled from genpd and platform
> code), this series adds a Simple Power-Managed Bus driver for
> transparent busses, which just enables runtime PM for the bus device.
> Due to the child-parent relationship of devices connected to the bus,
> as long as the device drivers for the child devices are runtime PM
> enabled, the bus's PM domain will be powered, and the bus's clock will
> be enabled automatically when needed, for both runtime PM and s2ram.
> 
> Currently this driver supports the Renesas Bus State Controller only,
> but support for other SoCs and other bus controllers can easily be
> added later by adding more compatible values.
> Note that this driver cannot just bind against "simple-bus", as that
> may prevent a device-specific driver from taking precedence.
> 
> This was tested on sh73a0/kzm9g-multiplatform (by me), and on
> r8a73a4/ape6evm-multiplatform (by Ulrich Hecht). Without this,
> Ethernet doesn't work, as the ZB clock is disabled by
> clk_disable_unused().
> 
> As drivers/bus doesn't have a maintainer, and this driver is needed to
> move two shmobile platforms away from legacy to multiplatform, I think
> this can go in through Simon's shmobile tree.  There are no conflicts
> with today's linux-next.
> 
> Changes compared to v2:
>   - Document required properties inherited from "simple-bus",
>   - Document required "reg" property for "renesas,bsc",
>   - Move "ranges" before "reg" in the example,
>   - Add Tested-by,
>   - Split-off sh73a0/kzm9g and r8a73a4/ape6evm DTS updates.
> 
> Changes compared to v1 (more detailed change logs in the individual
> patches):
>   - Added sorting of drivers/bus Kconfig and Makefile entries,
>   - Added DT binding documentation,
>   - Rename from "Renesas Bus State Controller Driver" (renesas-bsc) to
>     "Simple Power-Managed Bus Driver" (simple-pm-bus),
>   - Postponed adding power-domains properties to the dtsi,
>   - Added updates for r8a73a4/ape6evm.
> 
> Thanks for applying!
> 
> Geert Uytterhoeven (4):
>   drivers: bus: Sort Kconfig entries alphabetically
>   drivers: bus: Sort Makefile entries alphabetically
>   drivers: bus: Add Simple Power-Managed Bus DT Bindings
>   drivers: bus: Add Simple Power-Managed Bus Driver
> 
>  .../devicetree/bindings/bus/simple-pm-bus.txt      | 52 +++++++++++++++++++++
>  drivers/bus/Kconfig                                | 53 ++++++++++++++--------
>  drivers/bus/Makefile                               | 15 +++---
>  drivers/bus/simple-pm-bus.c                        | 51 +++++++++++++++++++++
>  4 files changed, 144 insertions(+), 27 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.txt
>  create mode 100644 drivers/bus/simple-pm-bus.c
> 
> -- 
> 1.9.1
> 
> Gr{oetje,eeting}s,
> 
> 						Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> 							    -- Linus Torvalds
> 
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-01-22  2:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 13:12 [PATCH v3 0/4] drivers: bus: Add Simple Power-Managed Bus Geert Uytterhoeven
2015-01-09 13:12 ` [PATCH v3 1/4] drivers: bus: Sort Kconfig entries alphabetically Geert Uytterhoeven
     [not found] ` <1420809155-4015-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2015-01-09 13:12   ` [PATCH v3 2/4] drivers: bus: Sort Makefile " Geert Uytterhoeven
2015-01-22  2:44   ` Simon Horman [this message]
2015-01-09 13:12 ` [PATCH v3 3/4] drivers: bus: Add Simple Power-Managed Bus DT Bindings Geert Uytterhoeven
2015-01-09 13:12 ` [PATCH v3 4/4] drivers: bus: Add Simple Power-Managed Bus Driver Geert Uytterhoeven

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=20150122024425.GD31170@verge.net.au \
    --to=horms-/r6kz+ddxgppr4jqbcensq@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).