dt-bindings: memory: Document linux,usable-memory property
PATCH 1/1 dt-bindings: memory: Document linux,usable-memory property
Add Documentation for linux,usable-memory
--- .../bindings/linux,usable-memory.txt | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/linux,usable-memory.txt
Documentation/devicetree/bindings/linux,usable-memory.txt new file +32 -0
@@ -0,0 +1,32 @@ +linux,usable-memory +=================== + +Description +----------- +The ``linux,usable-memory`` property can be used to restrict usable memory +region. This property holds a base address and size, Memory outside of this +range is not accessible by the kernel. This property is particularly useful +in specialized hardware platforms where certain memory regions must be +reserved for specific use. + +Common use cases include: +- Allocating ``ramoops`` region +- Reserving memory for hardware-specific needs +- Fake Protecting persistent memory (PMEM) + +Valid memory may be sparse within the specified range. +An example device tree configuration is shown below: + +.. code-block:: dts +/ { + &memory { + linux,usable-memory = < + 0x00000000 0x80000000 0x00000000 0x1BA00000 + 0x00000000 0xA1000000 0x00000000 0x2AC00000 + >; + }; +}; + +While this property does not represent a real hardware, the address +and the size are expressed in #address-cells and #size-cells, +respectively, of the root node.
Signature · 1 line
2.48.1
Quoted 5 lines · Abhishek Tiwari
Add Documentation for linux,usable-memory
Signed-off-by Abhishek Tiwari <[email protected]>--- .../bindings/linux,usable-memory.txt | 32 +++++++++++++++++++
No TXT bindings anymore.
But anyway, please explain why reserved memory and the standard memory node are not sufficient for you. For example:
Documentation/devicetree/bindings/linux,usable-memory.txt line 13
Quoted 3 lines
Documentation/devicetree/bindings/linux,usable-memory.txt new file +3
-0+ +Common use cases include: +- Allocating ``ramoops`` region
this is reserved memory.
Quoted 1 line
+- Reserving memory for hardware-specific needs
Same.
Quoted 1 line
+- Fake Protecting persistent memory (PMEM)
Same.
What's more, explain why linux,usable-memory-range is not good... or you just send some old patch from downstream forks?
Best regards,
Krzysztof
Rob Herring
maintainerQuoted 15 lines · Abhishek Tiwari
Add Documentation for linux,usable-memory
Signed-off-by Abhishek Tiwari <[email protected]>--- .../bindings/linux,usable-memory.txt | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/linux,usable-memory.txtDocumentation/devicetree/bindings/linux,usable-memory.txt new file +0
-0
Documentation/devicetree/bindings/linux,usable-memory.txt line 2
Quoted 2 lines
Documentation/devicetree/bindings/linux,usable-memory.txt new file +2
-0@@ -0,0 +1,32 @@ +linux,usable-memory +===================
This belongs here:
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/memory.yaml
Documentation/devicetree/bindings/linux,usable-memory.txt line 15
Quoted 13 lines
Documentation/devicetree/bindings/linux,usable-memory.txt new file +13
-0+ +Description +----------- +The ``linux,usable-memory`` property can be used to restrict usable memory +region. This property holds a base address and size, Memory outside of this +range is not accessible by the kernel. This property is particularly useful +in specialized hardware platforms where certain memory regions must be +reserved for specific use. + +Common use cases include: +- Allocating ``ramoops`` region +- Reserving memory for hardware-specific needs +- Fake Protecting persistent memory (PMEM)
All these examples belong in /reserved-memory nodes, not linux,usable-memory. Go see the ramoops binding for example.
This was really for the case where you already have 'reg' (in the memory node), but need to limit memory while at the same time not overwriting 'reg'. Basically, for kexec where you can keep booting another kernel forever. If that's not your usecase, you shouldn't be using this.
Rob
Quoted 40 lines · Rob Herring
Quoted 15 lines · Abhishek Tiwari
Add Documentation for linux,usable-memory
Signed-off-by Abhishek Tiwari <[email protected]>--- .../bindings/linux,usable-memory.txt | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/linux,usable-memory.txtDocumentation/devicetree/bindings/linux,usable-memory.txt new file +0
-0Documentation/devicetree/bindings/linux,usable-memory.txt line 2
Quoted 2 lines
Documentation/devicetree/bindings/linux,usable-memory.txt new file +2
-0@@ -0,0 +1,32 @@ +linux,usable-memory +===================This belongs here:
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/memory.yamlDocumentation/devicetree/bindings/linux,usable-memory.txt line 15
Quoted 13 lines
Documentation/devicetree/bindings/linux,usable-memory.txt new file +13
-0+ +Description +----------- +The ``linux,usable-memory`` property can be used to restrict usable memory +region. This property holds a base address and size, Memory outside of this +range is not accessible by the kernel. This property is particularly useful +in specialized hardware platforms where certain memory regions must be +reserved for specific use. + +Common use cases include: +- Allocating ``ramoops`` region +- Reserving memory for hardware-specific needs +- Fake Protecting persistent memory (PMEM)All these examples belong in /reserved-memory nodes, not linux,usable-memory. Go see the ramoops binding for example.
Quoted 7 lines
This was really for the case where you already have 'reg' (in the memory node), but need to limit memory while at the same time not overwriting 'reg'. Basically, for kexec where you can keep booting another kernel forever. If that's not your usecase, you shouldn't be using this.
Rob
Thank you for your suggestions and explanations. I will update the definition and examples accordingly, and submit a PR with the documentation for this property in the specified repository.