Re: [RFC 2/4] libnvdimm: Add a device-tree interface
From: Mark Rutland <mark.rutland@arm.com>
Date: 2017-06-27 10:43:28
Also in:
linux-devicetree, nvdimm
Hi, On Tue, Jun 27, 2017 at 08:28:49PM +1000, Oliver O'Halloran wrote:
A fairly bare-bones set of device-tree bindings so libnvdimm can be used on powerpc and other, less cool, device-tree based platforms.
;)
Cc: devicetree@vger.kernel.org
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
The current bindings are essentially this:
nonvolatile-memory {
compatible = "nonvolatile-memory", "special-memory";
ranges;
region@0 {
compatible = "nvdimm,byte-addressable";
reg = <0x0 0x1000>;
};
region@1000 {
compatible = "nvdimm,byte-addressable";
reg = <0x1000 0x1000>;
};
};This needs to have a proper binding document under Documentation/devicetree/bindings/. Something like the reserved-memory bdings would be a good template. If we want thet "nvdimm" vendor-prefix, that'll have to be reserved, too (see Documentation/devicetree/bindings/vendor-prefixes.txt). What is "special-memory"? What other memory types would be described here? What exacctly does "nvdimm,byte-addressable" imply? I suspect that you also expect such memory to be compatible with mappings using (some) cacheable attributes? Perhaps the byte-addressable property should be a boolean property on the region, rather than part of the compatible string.
To handle interleave sets, etc the plan was the add an extra property with the interleave stride and a "mapping" property with <&DIMM, dimm-start-offset> tuples for each dimm in the interleave set. Block MMIO regions can be added with a different compatible type, but I'm not too concerned with them for now.
Sorry, I'm not too familiar with nonvolatile memory. What are interleave sets? What are block MMIO regions? Is there any documentation one can refer to for any of this? [...]
+static const struct of_device_id of_nvdimm_bus_match[] = {
+ { .compatible = "nonvolatile-memory" },
+ { .compatible = "special-memory" },
+ { },
+};Why both? Is the driver handling other "special-memory"? Thanks, Mark.