18c2ecf20Sopenharmony_ciDevice-tree bindings for persistent memory regions
28c2ecf20Sopenharmony_ci-----------------------------------------------------
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciPersistent memory refers to a class of memory devices that are:
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci	a) Usable as main system memory (i.e. cacheable), and
78c2ecf20Sopenharmony_ci	b) Retain their contents across power failure.
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciGiven b) it is best to think of persistent memory as a kind of memory mapped
108c2ecf20Sopenharmony_cistorage device. To ensure data integrity the operating system needs to manage
118c2ecf20Sopenharmony_cipersistent regions separately to the normal memory pool. To aid with that this
128c2ecf20Sopenharmony_cibinding provides a standardised interface for discovering where persistent
138c2ecf20Sopenharmony_cimemory regions exist inside the physical address space.
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciBindings for the region nodes:
168c2ecf20Sopenharmony_ci-----------------------------
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciRequired properties:
198c2ecf20Sopenharmony_ci	- compatible = "pmem-region"
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci	- reg = <base, size>;
228c2ecf20Sopenharmony_ci		The reg property should specificy an address range that is
238c2ecf20Sopenharmony_ci		translatable to a system physical address range. This address
248c2ecf20Sopenharmony_ci		range should be mappable as normal system memory would be
258c2ecf20Sopenharmony_ci		(i.e cacheable).
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci		If the reg property contains multiple address ranges
288c2ecf20Sopenharmony_ci		each address range will be treated as though it was specified
298c2ecf20Sopenharmony_ci		in a separate device node. Having multiple address ranges in a
308c2ecf20Sopenharmony_ci		node implies no special relationship between the two ranges.
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciOptional properties:
338c2ecf20Sopenharmony_ci	- Any relevant NUMA assocativity properties for the target platform.
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci	- volatile; This property indicates that this region is actually
368c2ecf20Sopenharmony_ci	  backed by non-persistent memory. This lets the OS know that it
378c2ecf20Sopenharmony_ci	  may skip the cache flushes required to ensure data is made
388c2ecf20Sopenharmony_ci	  persistent after a write.
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci	  If this property is absent then the OS must assume that the region
418c2ecf20Sopenharmony_ci	  is backed by non-volatile memory.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciExamples:
448c2ecf20Sopenharmony_ci--------------------
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci	/*
478c2ecf20Sopenharmony_ci	 * This node specifies one 4KB region spanning from
488c2ecf20Sopenharmony_ci	 * 0x5000 to 0x5fff that is backed by non-volatile memory.
498c2ecf20Sopenharmony_ci	 */
508c2ecf20Sopenharmony_ci	pmem@5000 {
518c2ecf20Sopenharmony_ci		compatible = "pmem-region";
528c2ecf20Sopenharmony_ci		reg = <0x00005000 0x00001000>;
538c2ecf20Sopenharmony_ci	};
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci	/*
568c2ecf20Sopenharmony_ci	 * This node specifies two 4KB regions that are backed by
578c2ecf20Sopenharmony_ci	 * volatile (normal) memory.
588c2ecf20Sopenharmony_ci	 */
598c2ecf20Sopenharmony_ci	pmem@6000 {
608c2ecf20Sopenharmony_ci		compatible = "pmem-region";
618c2ecf20Sopenharmony_ci		reg = < 0x00006000 0x00001000
628c2ecf20Sopenharmony_ci			0x00008000 0x00001000 >;
638c2ecf20Sopenharmony_ci		volatile;
648c2ecf20Sopenharmony_ci	};
658c2ecf20Sopenharmony_ci
66