From 8ab7a78c23c5e62566646aa9d5ac8749dfd73837 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Tue, 19 May 2015 17:05:38 +0800 Subject: core: Add node-style memory reservation to device tree Linux supports a newer memory reservation layout in the device-tree, where each reservation is represented by a subnode under a top-level "reserved-memory" node. This change adds these nodes, using the mem_region names as the property names (minus any cell addresses). The reserved-memory node looks like this: / { name = "reserved-memory"; ranges; #address-cells = <0x2>; #size-cells = <0x2>; ibm,firmware-code@30000000 { reg = <0x0 0x30000000 0x0 0x200000>; }; ibm,firmware-data@30e00000 { reg = <0x0 0x30e00000 0x0 0xc00000>; }; ibm,firmware-stacks@31a00000 { reg = <0x0 0x31a00000 0x0 0x8000000>; }; ibm,firmware-allocs-memory@39a00000 { reg = <0x0 0x39a00000 0x0 0x1c0200>; }; ibm,firmware-heap@30200000 { reg = <0x0 0x30200000 0x0 0xc00000>; }; }; We also store a pointer to the reservation nodes in struct mem_region, so they can be used by other skiboot code. We keep the property-style reservation information (reserved-names and reserved-ranges) unchanged. Signed-off-by: Jeremy Kerr Signed-off-by: Stewart Smith --- doc/device-tree/reserved-memory.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 doc/device-tree/reserved-memory.txt (limited to 'doc') diff --git a/doc/device-tree/reserved-memory.txt b/doc/device-tree/reserved-memory.txt new file mode 100644 index 0000000..0f6002d --- /dev/null +++ b/doc/device-tree/reserved-memory.txt @@ -0,0 +1,27 @@ +reserved-memory device tree nodes + +OPAL exposes reserved memory through a top-level reserved-memory node, +containing subnodes that represent each reserved memory region. + +This follows the Linux specification for the /reserved-memory node, +described in the kernel source tree, in: + + Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt + +The top-level /reserved-memory node contains: + + #size-cells = <2> + #address-cells = <2> + - addresses and sizes are all 64-bits + + ranges; + - the empty ranges node indicates no translation of physical + addresses in the subnodes. + +The sub-nodes under the /reserved-memory node contain: + + reg =
+ - the address and size of the reserved memory region. The address + and size values are two cells each, as signified by the top-level + #{address,size}-cells + -- cgit v1.1