xref: /freebsd-src/sys/contrib/device-tree/Bindings/pmem/pmem-region.txt (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1c66ec88fSEmmanuel VadotDevice-tree bindings for persistent memory regions
2c66ec88fSEmmanuel Vadot-----------------------------------------------------
3c66ec88fSEmmanuel Vadot
4c66ec88fSEmmanuel VadotPersistent memory refers to a class of memory devices that are:
5c66ec88fSEmmanuel Vadot
6c66ec88fSEmmanuel Vadot	a) Usable as main system memory (i.e. cacheable), and
7c66ec88fSEmmanuel Vadot	b) Retain their contents across power failure.
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel VadotGiven b) it is best to think of persistent memory as a kind of memory mapped
10c66ec88fSEmmanuel Vadotstorage device. To ensure data integrity the operating system needs to manage
11c66ec88fSEmmanuel Vadotpersistent regions separately to the normal memory pool. To aid with that this
12c66ec88fSEmmanuel Vadotbinding provides a standardised interface for discovering where persistent
13c66ec88fSEmmanuel Vadotmemory regions exist inside the physical address space.
14c66ec88fSEmmanuel Vadot
15c66ec88fSEmmanuel VadotBindings for the region nodes:
16c66ec88fSEmmanuel Vadot-----------------------------
17c66ec88fSEmmanuel Vadot
18c66ec88fSEmmanuel VadotRequired properties:
19c66ec88fSEmmanuel Vadot	- compatible = "pmem-region"
20c66ec88fSEmmanuel Vadot
21c66ec88fSEmmanuel Vadot	- reg = <base, size>;
22*aa1a8ff2SEmmanuel Vadot		The reg property should specify an address range that is
23c66ec88fSEmmanuel Vadot		translatable to a system physical address range. This address
24c66ec88fSEmmanuel Vadot		range should be mappable as normal system memory would be
25c66ec88fSEmmanuel Vadot		(i.e cacheable).
26c66ec88fSEmmanuel Vadot
27c66ec88fSEmmanuel Vadot		If the reg property contains multiple address ranges
28c66ec88fSEmmanuel Vadot		each address range will be treated as though it was specified
29c66ec88fSEmmanuel Vadot		in a separate device node. Having multiple address ranges in a
30c66ec88fSEmmanuel Vadot		node implies no special relationship between the two ranges.
31c66ec88fSEmmanuel Vadot
32c66ec88fSEmmanuel VadotOptional properties:
33*aa1a8ff2SEmmanuel Vadot	- Any relevant NUMA associativity properties for the target platform.
34c66ec88fSEmmanuel Vadot
35c66ec88fSEmmanuel Vadot	- volatile; This property indicates that this region is actually
36c66ec88fSEmmanuel Vadot	  backed by non-persistent memory. This lets the OS know that it
37c66ec88fSEmmanuel Vadot	  may skip the cache flushes required to ensure data is made
38c66ec88fSEmmanuel Vadot	  persistent after a write.
39c66ec88fSEmmanuel Vadot
40c66ec88fSEmmanuel Vadot	  If this property is absent then the OS must assume that the region
41c66ec88fSEmmanuel Vadot	  is backed by non-volatile memory.
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel VadotExamples:
44c66ec88fSEmmanuel Vadot--------------------
45c66ec88fSEmmanuel Vadot
46c66ec88fSEmmanuel Vadot	/*
47c66ec88fSEmmanuel Vadot	 * This node specifies one 4KB region spanning from
48c66ec88fSEmmanuel Vadot	 * 0x5000 to 0x5fff that is backed by non-volatile memory.
49c66ec88fSEmmanuel Vadot	 */
50c66ec88fSEmmanuel Vadot	pmem@5000 {
51c66ec88fSEmmanuel Vadot		compatible = "pmem-region";
52c66ec88fSEmmanuel Vadot		reg = <0x00005000 0x00001000>;
53c66ec88fSEmmanuel Vadot	};
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel Vadot	/*
56c66ec88fSEmmanuel Vadot	 * This node specifies two 4KB regions that are backed by
57c66ec88fSEmmanuel Vadot	 * volatile (normal) memory.
58c66ec88fSEmmanuel Vadot	 */
59c66ec88fSEmmanuel Vadot	pmem@6000 {
60c66ec88fSEmmanuel Vadot		compatible = "pmem-region";
61c66ec88fSEmmanuel Vadot		reg = < 0x00006000 0x00001000
62c66ec88fSEmmanuel Vadot			0x00008000 0x00001000 >;
63c66ec88fSEmmanuel Vadot		volatile;
64c66ec88fSEmmanuel Vadot	};
65c66ec88fSEmmanuel Vadot
66