From patchwork Fri Feb 28 13:42:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 3741271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 706F5BF13A for ; Fri, 28 Feb 2014 13:43:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 659DE2024D for ; Fri, 28 Feb 2014 13:43:46 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30C1E20148 for ; Fri, 28 Feb 2014 13:43:45 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJNj3-0002Ba-L6; Fri, 28 Feb 2014 13:43:41 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJNj0-0004BL-UJ; Fri, 28 Feb 2014 13:43:38 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJNiw-00048o-Lo for linux-arm-kernel@lists.infradead.org; Fri, 28 Feb 2014 13:43:36 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N1P00HZWKRSYH70@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 28 Feb 2014 13:43:04 +0000 (GMT) X-AuditID: cbfec7f4-b7f796d000005a13-f9-5310926cb61e Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id DB.45.23059.C6290135; Fri, 28 Feb 2014 13:43:08 +0000 (GMT) Received: from amdc1339.mshome.net ([106.116.147.30]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N1P002ZJKROU750@eusync3.samsung.com>; Fri, 28 Feb 2014 13:43:08 +0000 (GMT) From: Marek Szyprowski To: 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 Subject: [PATCH v6 01/11] of: document bindings for reserved-memory nodes Date: Fri, 28 Feb 2014 14:42:46 +0100 Message-id: <1393594976-16728-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1393594976-16728-1-git-send-email-m.szyprowski@samsung.com> References: <1393594976-16728-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAyWRa0hTYRzGfc/ObcPRcS05SYxaRBFoM6LeyiKD8LUviUZgSbp0qLGp7TTR QhpLTedtzEJTmxM1YaiLFXiPlOWsUSheFti0vEC6pZmiXabl8NuP//P783x4aJ6oAg+h0zPu KtQZcqWUFODOLcd4qNLIxMnezZ2Gm8ZBCv7QFfDg8vNSAOvtHwlY4W0g4BtfJ4DesiIcdrUv AfhB56VgR3E1BdfGvmLQNjtBwIbCJhyOdteRsM3upuCLhX4MNrtGMGh25BPQVyWB712rJGy1 N1LQUNWGw4I+OwU3O2w4XOwvxKG12oNDS7cPwIWVIfzCPtRqagXo7x8jQJ5KA0Cj5WUY6qpx U6jUm08gm6WYRJ8nekn0sukBmtya5aGxIR2B2n2LGKrYlKFn3eUAlb+yALRqk8QEXRdEpCiU 6dkK9bHzSYI0c009nrUoy5mxeigtMB7WAz7NMidYz5dJfIeD2eEpK6kHAlrENAPWbfEBfyBi SjDWYcrzM8mEs/rvetLPYqYBsKsm3P/AY6ZJtmikFPMHu5lodqOwZZtpGmcOsbNL8XpA0UIG sWUH/UeW2c/WGSP8Ln/b1VZNEztFiJ385QIGIDSDAAvYo9AkZ3G3UlXhYZxcxWkyUsOSM1U2 sDPiWidoHDwzABgaSAOFhuhdcSJCns3lqgYAS/OkYuGcjokTCVPkufcU6sxEtUap4AYARvND tOByXnxCkrn4aex6rMRpNiVeiolUUp86JVemAmTyhJPHN7QHWiKrY0OXvwWuzztub2hnrr6e P4LzbzjlvVuPuCDT2X8aX/BNUnjuYl9UkbPHMe4er4wqsIrravfmzPBrt0UJ7brzOPXJ25Ws ten1nw/F90t+Xxseiusxn6rUp0txLk0efpSn5uT/AW3hekqiAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140228_084334_806525_7F303FB2 X-CRM114-Status: GOOD ( 17.68 ) X-Spam-Score: -3.8 (---) Cc: Mark Rutland , Benjamin Herrenschmidt , Tomasz Figa , Will Deacon , Tomasz Figa , Paul Mackerras , Marek Szyprowski , Arnd Bergmann , Josh Cartwright , Catalin Marinas , Grant Likely , Laura Abbott , Ian Campbell , Pawel Moll , Stephen Warren , Sascha Hauer , Michal Nazarewicz , Marc , Nishanth Peethambaran , Rob Herring , Kumar Gala , Olof Johansson X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Grant Likely Reserved memory nodes allow for the reservation of static (fixed address) regions, or dynamically allocated regions for a specific purpose. Signed-off-by: Grant Likely [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] Signed-off-by: Josh Cartwright [mszyprow: removed #memory-region-cells property] Signed-off-by: Marek Szyprowski --- .../bindings/reserved-memory/reserved-memory.txt | 136 ++++++++++++++++++++ 1 file changed, 136 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..8b0d747a38e7 --- /dev/null +++ b/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt @@ -0,0 +1,136 @@ +*** 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 +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 (@
) 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 ,[-] +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>; + /* ... */ + }; +};