From: Grant Likely <grant.likely@linaro.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linaro-mm-sig@lists.linaro.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Arnd Bergmann <arnd@arndb.de>,
Michal Nazarewicz <mina86@mina86.com>,
Tomasz Figa <t.figa@samsung.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Laura Abbott <lauraa@codeaurora.org>,
Rob Herring <robh+dt@gmail.com>, Olof Johansson <olof@lixom.net>,
Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Ian Campbell <ian.campbell@citrix.com>,
Tomasz Figa <tomasz.figa@gmail.com>,
Kumar Gala <galak@codeaurora.org>,
Nishanth Peethambaran <nishanth.p@gmail.com>,
Marc <marc.ceeeee@gmail.com>,
Josh Cartwright <joshc@codeaurora.org>
Subject: Re: [PATCH v2 5/5] of: document bindings for reserved-memory nodes
Date: Wed, 05 Feb 2014 10:07:50 +0000 [thread overview]
Message-ID: <20140205100750.58EFAC40A89@trevor.secretlab.ca> (raw)
In-Reply-To: <1391515773-6112-6-git-send-email-m.szyprowski@samsung.com>
On Tue, 04 Feb 2014 13:09:33 +0100, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
> From: Grant Likely <grant.likely@linaro.org>
>
> Reserved memory nodes allow for the reservation of static (fixed
> address) regions, or dynamically allocated regions for a specific
> purpose.
>
> [joshc: Based on binding document proposed (in non-patch form) here:
> http://lkml.kernel.org/g/20131030134702.19B57C402A0@trevor.secretlab.ca
> adapted to support #memory-region-cells]
>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Laura Abbott <lauraa@codeaurora.org>
> Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> .../bindings/reserved-memory/reserved-memory.txt | 138 ++++++++++++++++++++
> 1 file changed, 138 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
>
> diff --git a/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt b/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
> new file mode 100644
> index 000000000000..a606ce90c9c4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
> @@ -0,0 +1,138 @@
> +*** Reserved memory regions ***
> +
> +Reserved memory is specified as a node under the /reserved-memory node.
> +The operating system shall exclude reserved memory from normal usage
> +one can create child nodes describing particular reserved (excluded from
> +normal use) memory regions. Such memory regions are usually designed for
> +the special usage by various device drivers.
> +
> +Parameters for each memory region can be encoded into the device tree
> +with the following nodes:
> +
> +/reserved-memory node
> +---------------------
> +#address-cells, #size-cells (required) - standard definition
> + - Should use the same values as the root node
> +#memory-region-cells (required) - dictates number of cells used in the child
> + nodes memory-region specifier
I don't think this isn't defined well enough. These reserved regions may
not have a driver attached to them, so there is no central agent to
decide what the specifier means. That leaves the interpretation of
the memory region in the hands of the client drivers. How do you see the
specifier getting parsed and used?
Otherwise the binding looks good to me. Also, please add my s-o-b line
to the patch (instead of a-b because I authored part of the text)
Signed-off-by: Grant Likely <grant.likely@linaro.org>
g.
> +ranges (required) - standard definition
> + - Should be empty
> +
> +/reserved-memory/ child nodes
> +-----------------------------
> +Each child of the reserved-memory node specifies one or more regions of
> +reserved memory. Each child node may either use a 'reg' property to
> +specify a specific range of reserved memory, or a 'size' property with
> +optional constraints to request a dynamically allocated block of memory.
> +
> +Following the generic-names recommended practice, node names should
> +reflect the purpose of the node (ie. "framebuffer" or "dma-pool"). Unit
> +address (@<address>) should be appended to the name if the node is a
> +static allocation.
> +
> +Properties:
> +Requires either a) or b) below.
> +a) static allocation
> + reg (required) - standard definition
> +b) dynamic allocation
> + size (required) - length based on parent's #size-cells
> + - Size in bytes of memory to reserve.
> + alignment (optional) - length based on parent's #size-cells
> + - Address boundary for alignment of allocation.
> + alloc-ranges (optional) - prop-encoded-array (address, length pairs).
> + - Specifies regions of memory that are
> + acceptable to allocate from.
> +
> +If both reg and size are present, then the reg property takes precedence
> +and size is ignored.
> +
> +Additional properties:
> +compatible (optional) - standard definition
> + - may contain the following strings:
> + - shared-dma-pool: This indicates a region of memory meant to be
> + used as a shared pool of DMA buffers for a set of devices. It can
> + be used by an operating system to instanciate the necessary pool
> + management subsystem if necessary.
> + - vendor specific string in the form <vendor>,[<device>-]<usage>
> +no-map (optional) - empty property
> + - Indicates the operating system must not create a virtual mapping
> + of the region as part of its standard mapping of system memory,
> + nor permit speculative access to it under any circumstances other
> + than under the control of the device driver using the region.
> +reusable (optional) - empty property
> + - The operating system can use the memory in this region with the
> + limitation that the device driver(s) owning the region need to be
> + able to reclaim it back. Typically that means that the operating
> + system can use that region to store volatile or cached data that
> + can be otherwise regenerated or migrated elsewhere.
> +
> +Linux implementation note:
> +- If a "linux,cma-default" property is present, then Linux will use the
> + region for the default pool of the contiguous memory allocator.
> +
> +Device node references to reserved memory
> +-----------------------------------------
> +Regions in the /reserved-memory node may be referenced by other device
> +nodes by adding a memory-region property to the device node.
> +
> +memory-region (optional) - phandle, specifier pairs to children of /reserved-memory
> +
> +Example
> +-------
> +This example defines 3 contiguous regions are defined for Linux kernel:
> +one default of all device drivers (named linux,cma@72000000 and 64MiB in size),
> +one dedicated to the framebuffer device (named framebuffer@78000000, 8MiB), and
> +one for multimedia processing (named multimedia-memory@77000000, 64MiB).
> +
> +/ {
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + memory {
> + reg = <0x40000000 0x40000000>;
> + };
> +
> + reserved-memory {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> +
> + /* global autoconfigured region for contiguous allocations */
> + linux,cma {
> + compatible = "shared-dma-pool";
> + reusable;
> + #memory-region-cells = <0>;
> + size = <0x4000000>;
> + alignment = <0x2000>;
> + linux,cma-default;
> + };
> +
> + display_reserved: framebuffer@78000000 {
> + #memory-region-cells = <0>;
> + reg = <0x78000000 0x800000>;
> + };
> +
> + multimedia_reserved: multimedia@77000000 {
> + compatible = "acme,multimedia-memory";
> + #memory-region-cells = <1>;
> + reg = <0x77000000 0x4000000>;
> + };
> + };
> +
> + /* ... */
> +
> + fb0: video@12300000 {
> + memory-region = <&display_reserved>;
> + /* ... */
> + };
> +
> + scaler: scaler@12500000 {
> + memory-region = <&multimedia_reserved 0xdeadbeef>;
> + /* ... */
> + };
> +
> + codec: codec@12600000 {
> + memory-region = <&multimedia_reserved 0xfeebdaed>;
> + /* ... */
> + };
> +};
> --
> 1.7.9.5
>
next prev parent reply other threads:[~2014-02-05 10:08 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 12:09 [PATCH v2 0/5] reserved-memory regions/CMA in devicetree, again Marek Szyprowski
[not found] ` < 1391515773-6112-2-git-send-email-m.szyprowski@samsung.com>
[not found] ` < 1391515773-6112-5-git-send-email-m.szyprowski@samsung.com>
2014-02-04 12:09 ` [PATCH v2 1/5] drivers: of: add initialization code for reserved memory Marek Szyprowski
[not found] ` < 20140205110538.99E47C40A89@trevor.secretlab.ca>
2014-02-05 11:05 ` Grant Likely
2014-02-11 11:45 ` Marek Szyprowski
[not found] ` < 20140211121316.24032C40C4D@trevor.secretlab.ca>
2014-02-11 12:13 ` Grant Likely
2014-02-11 14:29 ` Tomasz Figa
2014-02-11 19:01 ` Grant Likely
2014-02-11 20:02 ` Benjamin Herrenschmidt
2014-02-11 20:04 ` Tomasz Figa
2014-02-11 20:19 ` Josh Cartwright
2014-02-11 20:27 ` Tomasz Figa
2014-02-13 19:48 ` Josh Cartwright
2014-02-17 16:53 ` Grant Likely
2014-02-17 16:47 ` Grant Likely
2014-02-06 22:08 ` Laura Abbott
2014-02-04 12:09 ` [PATCH v2 2/5] drivers: of: implement reserved-memory handling for dma Marek Szyprowski
2014-02-04 12:09 ` [PATCH v2 3/5] drivers: of: implement reserved-memory handling for cma Marek Szyprowski
2014-02-05 11:09 ` Grant Likely
2014-02-04 12:09 ` [PATCH v2 4/5] ARM: init: add support for reserved memory defined by device tree Marek Szyprowski
2014-02-05 10:15 ` Grant Likely
2014-02-06 13:26 ` Marek Szyprowski
[not found] ` < 20140210215929.4473BC408F7@trevor.secretlab.ca>
2014-02-10 21:59 ` Grant Likely
2014-02-11 10:52 ` Marek Szyprowski
2014-02-11 11:50 ` Grant Likely
2014-02-04 12:09 ` [PATCH v2 5/5] of: document bindings for reserved-memory nodes Marek Szyprowski
2014-02-05 10:07 ` Grant Likely [this message]
2014-02-05 19:25 ` Josh Cartwright
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=20140205100750.58EFAC40A89@trevor.secretlab.ca \
--to=grant.likely@linaro.org \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ian.campbell@citrix.com \
--cc=joshc@codeaurora.org \
--cc=kyungmin.park@samsung.com \
--cc=lauraa@codeaurora.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=marc.ceeeee@gmail.com \
--cc=mark.rutland@arm.com \
--cc=mina86@mina86.com \
--cc=nishanth.p@gmail.com \
--cc=olof@lixom.net \
--cc=pawel.moll@arm.com \
--cc=robh+dt@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=swarren@wwwdotorg.org \
--cc=t.figa@samsung.com \
--cc=tomasz.figa@gmail.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
all inboxes | Powered by JetHome®