From patchwork Fri Feb 21 12:25:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 25102 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9238C20143 for ; Fri, 21 Feb 2014 12:26:33 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wo20sf14321618obc.11 for ; Fri, 21 Feb 2014 04:26:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=+h3a9wY6tD7bmmJvetUDaoTkl0agHQrzjHC23oMm4Qc=; b=PRYO5wwpVNcuKq7XHLOttaAhzxuh0U0Kspfbcs+An+TDxV46hC351aZ1of+PEBdHPb jDErx9nVmUALYRM846gBMQ0mzNQ/91o2KFB25h80tA/Cpks4HBTZ936/eG8RMWZI2YTR 6tf2YYheX5pSKEK9/6sgG68LWIE+4YaYZwjiPYm6rUzJdsNSHjrVY8xZfzvKoATQq5Au Vrk9IRCjGVn3QubaftbIL6LgLnwNYd+itonAL72gjvlV+kr8/wHE7tTeWczqZkCJz5/O lUqFlO1etsKOagFxbu3epJcHNfWzcOn1bpcpE2DPEo6QDYmUpEAobPDXxUoaBVVUw3qT v7Mw== X-Gm-Message-State: ALoCoQmGf+ryns7qM3GVfrz/zaHM6D2n5dLdURG6x9wLAW7oWRtfz8IAPs+a6BHcY11v3+TvQ0Yo X-Received: by 10.43.14.137 with SMTP id pq9mr3071131icb.12.1392985593013; Fri, 21 Feb 2014 04:26:33 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.52 with SMTP id j49ls1011673qge.7.gmail; Fri, 21 Feb 2014 04:26:32 -0800 (PST) X-Received: by 10.52.186.230 with SMTP id fn6mr3959945vdc.14.1392985592906; Fri, 21 Feb 2014 04:26:32 -0800 (PST) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id sx1si2903510vdc.101.2014.02.21.04.26.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 04:26:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id lf12so3178146vcb.31 for ; Fri, 21 Feb 2014 04:26:32 -0800 (PST) X-Received: by 10.52.185.196 with SMTP id fe4mr3833042vdc.27.1392985592787; Fri, 21 Feb 2014 04:26:32 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp30028vcz; Fri, 21 Feb 2014 04:26:32 -0800 (PST) X-Received: by 10.180.100.70 with SMTP id ew6mr2855460wib.57.1392985590280; Fri, 21 Feb 2014 04:26:30 -0800 (PST) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id ua15si2687372wib.15.2014.02.21.04.26.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Feb 2014 04:26:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WGpAD-0004Er-Tp; Fri, 21 Feb 2014 12:25:09 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WGpA2-0004D6-Li for linaro-mm-sig@lists.linaro.org; Fri, 21 Feb 2014 12:24:58 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N1C00FGPIJLXX90@mailout1.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Fri, 21 Feb 2014 12:26:09 +0000 (GMT) X-AuditID: cbfec7f4-b7f796d000005a13-82-530745e067d8 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id B6.21.23059.0E547035; Fri, 21 Feb 2014 12:26: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 <0N1C001ZAIJD5M60@eusync3.samsung.com>; Fri, 21 Feb 2014 12:26: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 Date: Fri, 21 Feb 2014 13:25:17 +0100 Message-id: <1392985527-6260-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1392985527-6260-1-git-send-email-m.szyprowski@samsung.com> References: <1392985527-6260-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAyWRa0hTYRyHe8/OzjkbLo7T4k1DZFBa4GVg8VJ2g9JXDIqkPgiVU5caTmVz klGk5kTnNpdFipi5vKRrai1BN9TcnBeym3lDalb4YajTyvmhy5Rcfnv+z+/59mc4wntkEJOV ky+V50iyRRSfHN8cnY74eoZOin5fy0Mb1SM0+lGi4qDvrRqAHjvecVGV28BFg95egNzachJZ OlcBelviplFPRS2N1qe+Eci8MMNFhrJmEk1a6ynU4XDS6PmijUAtsxMEahwt5SJvTQh6Peuh kMnRRCN9TQeJVP0OGm30mEm0ZCsjUVftMomMVi9Aiz/HyJN7sanBBPDfP9UAL9/XAzyp0xLY UuekscZdysVmYwWFP8/0Ufhl8x38aXOBg6fGSri407tE4KqNaPzIqgNY120E2GMOOe+fzI9N l2ZnFUjlUcdT+JmDr+4SeWPiGxOrxWQRGApTAx4D2RjY9kBFbvNu+GG+i1IDPiNkWwAcbnKS 20clAZ8OaTi+imLFUL2ipnwcyBoA9DT8jzjsFwqWT2gI3xDAJsC5xqItZhiS3Qdtris+LWDj obVFy/FpyIbC+upYn+axGL4ZdNE+LdxKOsuv64GgEewwgl1SZVqeIjVDJo5USGQKZU5GZFqu zAy237jeC5pGjtgBywCRnyAPUklCrqRAUSizA8hwRIECWxSdJBSkSwpvSuW5V+XKbKnCDgiG F1QETtdZjh3KX+8w/gqv2mPpr/jojnhWsjPeNbA8cM4VfvFJtz3AeKkruO/sSDhUVsyFVV5r azpsc6Zob5nka8VONcUrbTe0708cO7UZNx5jfbFGXUjIv/ww9nfqCZ2T0Ncf8EzGFKhW5hPY x7eDQ5PX5+TD/tNHW+MSLZkCt99AkIhUZErEBzlyheQfN7sXLaQCAAA= Cc: Mark Rutland , Benjamin Herrenschmidt , Tomasz Figa , Will Deacon , Tomasz Figa , Paul Mackerras , Arnd Bergmann , Josh Cartwright , Catalin Marinas , Grant Likely , Ian Campbell , Pawel Moll , Stephen Warren , Sascha Hauer , Michal Nazarewicz , Rob Herring , Kumar Gala , Olof Johansson Subject: [Linaro-mm-sig] [PATCH v5 01/11] of: document bindings for reserved-memory nodes X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-mm-sig-bounces@lists.linaro.org Sender: linaro-mm-sig-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Signed-off-by: Marek Szyprowski --- .../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 +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>; + /* ... */ + }; +};