summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@chromium.org>2018-06-11 13:07:09 -0600
committerSimon Glass <sjg@chromium.org>2018-07-09 09:11:00 -0600
commit90c08fa038451d6d7b7d8711bfd829b61d64c490 (patch)
tree7cfd0d58221ae95037dea8e435ef8b55ea2898d4 /doc
parent8c5d4fd0ec222701598a27b26ab7265d4cee45a3 (diff)
downloadu-boot-90c08fa038451d6d7b7d8711bfd829b61d64c490.tar.gz
fdt: Add device tree memory bindings
Support a default memory bank, specified in reg, as well as board-specific memory banks in subtree board-id nodes. This allows memory information to be provided in the device tree, rather than hard-coded in, which will make it simpler to handle similar devices with different memory banks, as the board-id values or masks can be used to match devices. Signed-off-by: Michael Pratt <mpratt@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/device-tree-bindings/memory/memory.txt67
1 files changed, 67 insertions, 0 deletions
diff --git a/doc/device-tree-bindings/memory/memory.txt b/doc/device-tree-bindings/memory/memory.txt
new file mode 100644
index 0000000000..321894e01d
--- /dev/null
+++ b/doc/device-tree-bindings/memory/memory.txt
@@ -0,0 +1,67 @@
+* Memory binding
+
+The memory binding for U-Boot is as in the ePAPR with the following additions:
+
+Optional subnodes can be used defining the memory layout for different board
+ID masks. To match a set of board ids, a board-id node may define match-mask
+and match-value ints to define a mask to apply to the board id, and the value
+that the result should have for the match to be considered valid. The mask
+defaults to -1, meaning that the value must fully match the board id.
+
+If subnodes are present, then the /memory node must define these properties:
+
+- #address-cells: should be 1.
+- #size-cells: should be 0.
+
+Each subnode must define
+
+ reg - board ID or mask for this subnode
+ memory-banks - list of memory banks in the same format as normal
+
+Each subnode may optionally define:
+
+ match-mask - A mask to apply to the board id. This must be accompanied by
+ match-value.
+ match-value - The required resulting value of the board id mask for the given
+ node to be considered a match.
+ auto-size - Indicates that the value given for a bank is the maximum size,
+ each bank is probed to determine its actual size, which may be
+ smaller
+
+
+The board id determination is up to the vendor and is not defined by this
+binding.
+
+Example:
+
+memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0x20000000 0x20000000
+ 0x40000000 0x20000000
+ 0x60000000 0x20000000
+ 0x80000000 0x20000000>;
+ auto-size;
+ board-id@0 {
+ match-value = <17>;
+ reg = <0x20000000 0x20000000
+ 0x40000000 0x20000000>;
+ };
+ board-id@1 {
+ match-mask = <2>;
+ match-value = <2>;
+ reg = <0x20000000 0x20000000
+ 0x40000000 0x20000000
+ 0x60000000 0x20000000
+ 0x80000000 0x20000000
+ 0xa0000000 0x20000000
+ 0xc0000000 0x20000000
+ 0xe0000000 0x20000000>;
+ };
+};
+
+
+This shows a system with the following properties:
+* Default of 2GB of memory, auto-sized, so could be smaller
+* 3.5GB of memory (with no auto-size) if (board id & 2) is 2
+* 1GB of memory (with no auto-size) if board id is 17.