From patchwork Tue Feb 4 12:09:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 24094 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9BDFA20445 for ; Tue, 4 Feb 2014 12:10:52 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf22475972pab.3 for ; Tue, 04 Feb 2014 04:10:51 -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=qX6c5h5yCF+nqoZWiIDeL9/qUfejF6H1l44KVfWccJo=; b=VZITxeRTIaRBBs4m5oU7kiC0iS2yxGg15O8I2SGH4Ou6kZXqy3Q7DBPkKK7BGCgUHy aO5R+qAXiSCplhEmArA9aIgNzX8L9JvEi1W3K+iQWhpU2Vfhuvg8vv/QVd+uWDItKva8 PISGJx5ki5v3ma09f3EKN/defnDtNclSb8shKTDSU6DkZzkqe8P9One37dQmOGMRBx2p uzsfFBdpI6fFyFGVwc6yTxfc7z0E704cr19w5fyPh6MOiD4vGa4A4NjH5DUgd/OA/Bzu IsNVq2BpRe3399WP1m9APnupYCsERFdZWNq0kfuIAuOeEHUkEyGJ7KsKLZom3s2uUSTW eb4g== X-Gm-Message-State: ALoCoQnZcX5fhC6d6jSKvhK1LCwo9eaDrgkBK8qbzm+oEK0WoBq8S3NmjwSe+zUqPpMVl2PskviI X-Received: by 10.67.14.70 with SMTP id fe6mr15480981pad.15.1391515851884; Tue, 04 Feb 2014 04:10:51 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.16 with SMTP id e16ls2331375qgd.63.gmail; Tue, 04 Feb 2014 04:10:51 -0800 (PST) X-Received: by 10.52.26.148 with SMTP id l20mr7544302vdg.28.1391515851788; Tue, 04 Feb 2014 04:10:51 -0800 (PST) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id n8si8063666vdv.16.2014.02.04.04.10.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 04:10:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id ij19so5621487vcb.6 for ; Tue, 04 Feb 2014 04:10:51 -0800 (PST) X-Received: by 10.52.244.102 with SMTP id xf6mr14852vdc.42.1391515851645; Tue, 04 Feb 2014 04:10:51 -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 u4csp229355vcz; Tue, 4 Feb 2014 04:10:48 -0800 (PST) X-Received: by 10.14.93.199 with SMTP id l47mr14246324eef.58.1391515847882; Tue, 04 Feb 2014 04:10:47 -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 43si41847266eeh.31.2014.02.04.04.10.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 04 Feb 2014 04:10:47 -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 1WAep4-0006Jb-RZ; Tue, 04 Feb 2014 12:09:50 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WAeox-0006IR-Rz for linaro-mm-sig@lists.linaro.org; Tue, 04 Feb 2014 12:09:44 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N0H00NNU0HI3E20@mailout1.samsung.com> for linaro-mm-sig@lists.linaro.org; Tue, 04 Feb 2014 21:10:31 +0900 (KST) X-AuditID: cbfee61b-b7f456d000006dfd-6c-52f0d8b61ad3 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 5A.C0.28157.6B8D0F25; Tue, 04 Feb 2014 21:10:30 +0900 (KST) Received: from amdc1339.mshome.net ([106.116.147.30]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N0H006N40FZEA91@mmp1.samsung.com>; Tue, 04 Feb 2014 21:10:30 +0900 (KST) 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: Tue, 04 Feb 2014 13:09:33 +0100 Message-id: <1391515773-6112-6-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1391515773-6112-1-git-send-email-m.szyprowski@samsung.com> References: <1391515773-6112-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFIsWRmVeSWpSXmKPExsVy+t9jAd1tNz4EGVybaGrxd9IxdosPTa3M FvOPnGO16H+zkNXiwJ8djBZvejtYLHaue8docbbpDbvF9s4Z7BZfrjxkstj0+BqrxcK2JSwW l3fNYbNYe+Quu8WGlweZLJZev8hkseB4C6vFn+lyFqeuf2azmDB9LYvFpvtrGS3+bt/EYvHq YBuLxfoZr1ksVu36w+gg6bFm3hpGj9+/JjF6vJ48gdHjcl8vk8fOWXfZPXretLB63Lm2h81j 85J6j9v/HjN7XDnRxOqx7s8rJo/+vwYefVtWMXp83iTnsXFuaAB/FJdNSmpOZllqkb5dAlfG 2zVrmAu+GFbM+3SftYHxhXoXIyeHhICJxIKfJ5ggbDGJC/fWs3UxcnEICSxilOievJwZwmll kpg84zEbSBWbgKFE19suMFtEYCGjxOd5LCBFzALT2CQ+L3zJCpIQFnCXWH32IQuIzSKgKvFq zk2gBg4OXqD4grM1IKaEgILEnEk2IBWcAh4SK27/B6sQAqpYv9BzAiPvAkaGVYyiqQXJBcVJ 6blGesWJucWleel6yfm5mxjBMfZMegfjqgaLQ4wCHIxKPLwKKh+ChFgTy4orcw8xSnAwK4nw mm8DCvGmJFZWpRblxxeV5qQWH2KU5mBREuc92GodKCSQnliSmp2aWpBaBJNl4uCUamAsWXBg yTrFyysr6idNdTzV/8fnVJHzB5cWh7DbK8RXzLt2YamC39XJKl873UK1v9ZP1XPtXjc5WfRN 3hqrp00FffdFXvYybLCsPMbzN+plktr73LtXzWMyPi2z7t+Vl+r5/KS81FUe9R08q2rNzy4p v/dT2dzmxb6vkVyfFpbNvN3+vX35fj91JZbijERDLeai4kQAu8du/q0CAAA= Cc: Mark Rutland , Pawel Moll , Arnd Bergmann , Stephen Warren , Josh Cartwright , Benjamin Herrenschmidt , Tomasz Figa , Olof Johansson , Tomasz Figa , Michal Nazarewicz , Rob Herring , Kyungmin Park , Kumar Gala , Grant Likely , Ian Campbell , Sascha Hauer Subject: [Linaro-mm-sig] [PATCH v2 5/5] 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.175 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. [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 Cc: Laura Abbott Signed-off-by: Josh Cartwright Signed-off-by: Marek Szyprowski Signed-off-by: Grant Likely --- .../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>; + /* ... */ + }; +};