Question regarding non-volatile memory mapped memory in embedded systems
"Andreasen, Bjarki" <[email protected]> Tue, 24 Feb 2026 14:24:36 +0000
| Newsgroups | org.kernel.vger.devicetree-spec |
|---|---|
| Message-ID | <DB8PR05MB6826E032A341ED146299DBC18874A@DB8PR05MB6826.eurprd05.prod.outlook.com> |
Hello from a zephyr-rtos dev,=0A=
=0A=
In embedded systems, it is typical to execute directly from non volatile me=
mory mapped storage.=0A=
Looking through the devicetree spec, there is a node for defining memory ma=
pped system memory, and reserved memory, the /memory and /reserved-memory n=
odes.=0A=
=0A=
Are the /memory and /reserved-memory nodes intended to be used with volatil=
e memory mapped storage in embedded systems?=0A=
=0A=
A client program (which in an embedded system may be the entire program boo=
ted by the soc itself) is to a large extent agnostic to the exact type of m=
emory its executing from since the memory is memory mapped.=0A=
As long as the program was compiled with the appropriate memory access perm=
issions, non volatile memory like flash being read/execute only, RAM being =
read/write/execute of course.=0A=
=0A=
As an example where the client program is compiled to be placed at a fixed =
address in non-volatile memory mapped flash:=0A=
=0A=
/ {=0A=
=A0 =A0 =A0 =A0 /* Non volatile memory mapped flash, programmed by external=
tool */=0A=
=A0 =A0 =A0 =A0 memory@0 {=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 device_type =3D "memory";=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <0x0 0x8000>;=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ranges =3D <0x0 0x0 0x8000>;=0A=
=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 program_region: memory@0 {=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <0x0 0x8000>;=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 };=0A=
=A0 =A0 =A0 =A0 };=0A=
=0A=
=A0 =A0 =A0 =A0 /* RAM */=0A=
=A0 =A0 =A0 =A0 memory@20000000 {=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 device_type =3D "memory";=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <0x20000000 0x4000>;=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ranges =3D <0x0 0x20000000 0x4000>;=0A=
=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ram_region: memory@0 {=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <0x0 0x4000>;=0A=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 };=0A=
=A0 =A0 =A0 =A0 };=0A=
};=0A=
=0A=
I believe memory mapped memory is "just memory", it is from the perspective=
of the program/CPU at least.=0A=
Has this been considered before? Is it already an expected usecase?=0A=
=0A=
Sincerely Bjarki Arge Andreasen=