Hello,
While working on adding reserved RAM support to the MTD physmap
driver, I encountered a limitation in the kernel's reserved memory
support: although the Device Tree specification allows multiple reg
entries for a memory-region node, the kernel only processed the first
one. This limitation prevented proper support for reserved RAM regions
in MTD.
This series addresses both issues:
First, the reserved memory support is extended to fully support
multiple reg entries per memory-region node, ensuring compliance with
the Device Tree specification.
Then, with this foundation in place, the series updates the MTD
physmap driver to support reserved RAM regions. The DT bindings are
extended to allow memory-region phandles for RAM access, and the
physmap driver is modified to use these regions.
Gregory
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
Changes in v2:
- Properly managed cases where register entries used by the memory
region are out of order, particularly when one or more register
entries are mixed with memory region entries in an other node.
- Used "memlog" as the node name instead of "sram," which was misleading.
- Link to v1: https://lore.kernel.org/r/20251117-mtd-memregion-v1-0-7b35611c79a6@bootlin.com
---
Gregory CLEMENT (3):
of: reserved_mem: Support multiple 'reg' entries for memory-region
dt-bindings: mtd: physmap: Allow using memory-region to access memory resources
mtd: physmap: Add support for RAM reserved memory regions
.../devicetree/bindings/mtd/mtd-physmap.yaml | 59 ++++++---
drivers/mtd/maps/physmap-core.c | 56 +++++++--
drivers/of/of_reserved_mem.c | 139 +++++++++++++++++++--
include/linux/of_reserved_mem.h | 4 +
4 files changed, 218 insertions(+), 40 deletions(-)
---
base-commit: b55d426c390f2a4762b2a88b113cc44c37e08e46
change-id: 20251117-mtd-memregion-8830c1dd70ce
Best regards,
--
Grégory CLEMENT, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com