linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Andrianov <andrew@ncrmnt.org>
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	pebolle@tiscali.nl, "Arve Hj�nnev�g" <arve@android.com>,
	"Riley Andrews" <riandrews@android.com>,
	"Chen Gang" <gang.chen.5i5j@gmail.com>,
	"Fabian Frederick" <fabf@skynet.be>,
	"Android Kernel Team" <kernel-team@android.com>
Cc: Andrew Andrianov <andrew@ncrmnt.org>, linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/2] staging: ion: Add ion-physmem documentation
Date: Sat, 11 Apr 2015 00:13:00 +0300	[thread overview]
Message-ID: <1428700380-8059-3-git-send-email-andrew@ncrmnt.org> (raw)
In-Reply-To: <1428700380-8059-1-git-send-email-andrew@ncrmnt.org>

Signed-off-by: Andrew Andrianov <andrew@ncrmnt.org>
---
 Documentation/devicetree/bindings/ion,physmem.txt |   96 +++++++++++++++++++++
 1 file changed, 96 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ion,physmem.txt

diff --git a/Documentation/devicetree/bindings/ion,physmem.txt b/Documentation/devicetree/bindings/ion,physmem.txt
new file mode 100644
index 0000000..b83ae22
--- /dev/null
+++ b/Documentation/devicetree/bindings/ion,physmem.txt
@@ -0,0 +1,96 @@
+ION PhysMem Driver
+#include <dt-bindings/ion,physmem.h>
+
+
+ION PhysMem is a generic driver for ION Memory Manager that allows you to 
+define ION Memory Manager heaps using device tree. This is mostly useful if 
+your SoC has several 'special' regions (e.g. SRAM, dedicated memory banks, 
+etc) that are present in the physical memory map and you want to add them to 
+ION as heaps of memory. 
+
+
+Examples: 
+
+1. 256KiB On-chip SRAM used as ION DMA heap. reg range is treated as a physical
+   address range
+
+	ion_im0: ion@0x00100000 { 
+	     compatible = "ion,physmem";
+	     reg = <0x00100000 0x40000>;
+	     reg-names = "memory";
+	     ion-heap-id   = <2>;
+	     ion-heap-type = <ION_HEAP_TYPE_DMA>;
+	     ion-heap-align = <0x10>;		     
+	     ion-heap-name = "IM0";
+	};
+
+2. The same, but using system DMA memory. 
+
+	ion_dma: ion@0xdeadbeef { 
+	     compatible = "ion,physmem";
+	     ion-heap-id   = <2>;
+	     ion-heap-type = <ION_HEAP_TYPE_DMA>;
+	     ion-heap-align = <0x10>;		     
+	     ion-heap-name = "SYSDMA";
+	};
+
+2. Carveout heap, 1MiB size, ion-physmem will alloc pages for it using 
+   alloc_pages_exact(). reg range is used for specifying size only.
+
+		ion_crv: ion@deadbeef {
+		     compatible = "ion,physmem";
+		     reg = <0x00000000 0x100000>;
+		     reg-names = "memory";
+		     ion-heap-id   = <3>;
+		     ion-heap-type = <ION_HEAP_TYPE_CARVEOUT>;
+		     ion-heap-align = <0x10>;
+		     ion-heap-name = "carveout";
+		};
+
+3. Chunk heap. 1MiB size, ion-physmem will alloc pages for it using 
+   alloc_pages_exact(). reg range is used for specifying size only.
+
+	ion_chunk: ion@0xdeadbeef { 
+	     compatible = "ion,physmem";
+	     ion-heap-id   = <2>;
+	     ion-heap-type = <ION_HEAP_TYPE_CHUNK>;
+	     ion-heap-align = <0x10>;		     
+	     ion-heap-name = "chunky";
+	};
+
+
+4. vmalloc();
+
+	ion_chunk: ion@0xdeadbeef { 
+	     compatible = "ion,physmem";
+	     ion-heap-id   = <2>;
+	     ion-heap-type = <ION_HEAP_TYPE_SYSTEM>;
+	     ion-heap-align = <0x10>;		     
+	     ion-heap-name = "sys";
+	};
+
+5. kmalloc();
+
+	ion_chunk: ion@0xdeadbeef { 
+	     compatible = "ion,physmem";
+	     ion-heap-id   = <2>;
+	     ion-heap-type = <ION_HEAP_TYPE_SYSTEM_CONTIG>;
+	     ion-heap-align = <0x10>;		     
+	     ion-heap-name = "syscont";
+	};
+
+If the underlying heap relies on some physical device that needs clock 
+gating, you can need to fill the clock field in. E.g.: 
+
+ 
+	ion_im0: ion@0x00100000 { 
+	     compatible = "ion,physmem";
+	     reg = <0x00100000 0x40000>;
+	     reg-names = "memory";
+	     ion-heap-id   = <2>;
+	     ion-heap-type = <ION_HEAP_TYPE_DMA>;
+	     ion-heap-align = <0x10>;		     
+	     ion-heap-name = "IM0";
+	     clocks = <&oscillator_27m>;
+	     clock-names = "clk_27m";
+	};
-- 
1.7.10.4


      parent reply	other threads:[~2015-04-10 21:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10 21:12 [PATCH v2 0/2] staging: ion: Generic ion-physmem driver Andrew Andrianov
2015-04-10 21:12 ` [PATCH v2 1/2] staging: ion: Add generic " Andrew Andrianov
2015-05-31  0:18   ` Greg Kroah-Hartman
2015-06-02 16:00     ` [PATCH v3 0/2] staging: ion: " Andrew Andrianov
2015-06-02 16:00       ` [PATCH v3 1/2] staging: ion: Add generic " Andrew Andrianov
2015-06-03  6:15         ` Sudip Mukherjee
2015-06-02 16:00       ` [PATCH v3 2/2] staging: ion: Add ion-physmem documentation Andrew Andrianov
2015-06-03  6:17         ` Sudip Mukherjee
2015-06-09 14:58           ` [PATCH v4 0/2] staging: ion: Add generic ion-physmem driver Andrew Andrianov
2015-06-09 14:58             ` [PATCH v4 1/2] " Andrew Andrianov
2015-06-13  0:16               ` Greg Kroah-Hartman
2015-06-13 12:33                 ` Andrew
2015-06-22 15:05                 ` [PATCH v5 0/2] " Andrew Andrianov
2015-06-22 15:05                   ` [PATCH v5 1/2] " Andrew Andrianov
2015-06-22 15:05                   ` [PATCH v5 2/2] staging: ion: Add ion-physmem documentation Andrew Andrianov
2015-06-30 15:34                 ` [PATCH v5.1 0/2] staging: ion: Add generic ion-physmem driver Andrew Andrianov
2015-06-30 15:34                   ` [PATCH v5.1 1/2] " Andrew Andrianov
2015-06-30 17:56                     ` Laura Abbott
2015-06-30 21:05                       ` Andrew
2015-07-01  7:39                       ` Dan Carpenter
2015-06-30 15:34                   ` [PATCH v5.1 2/2] staging: ion: Add ion-physmem documentation Andrew Andrianov
2015-06-30 17:54                     ` Laura Abbott
2015-06-30 21:33                       ` Andrew
2015-06-09 14:58             ` [PATCH v4 " Andrew Andrianov
2015-04-10 21:13 ` Andrew Andrianov [this message]

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=1428700380-8059-3-git-send-email-andrew@ncrmnt.org \
    --to=andrew@ncrmnt.org \
    --cc=arve@android.com \
    --cc=fabf@skynet.be \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pebolle@tiscali.nl \
    --cc=riandrews@android.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;
as well as URLs for NNTP newsgroup(s).