1/*
2 * Copyright 2024 Embeint Inc
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Default memory partitioning for nRF91 devices.
7 */
8
9&flash0 {
10	/*
11	 * Default Flash planning for nRF91 series SoCs.
12	 * This layout matches (by necessity) that in the TF-M repository:
13	 *
14	 * 0x0000_0000 BL2 - MCUBoot (64 KB)
15	 * 0x0001_0000 Primary image area (448 KB):
16	 *    0x0001_0000 Secure     image primary (256 KB)
17	 *    0x0005_0000 Non-secure image primary (192 KB)
18	 * 0x0008_0000 Secondary image area (448 KB):
19	 *    0x0008_0000 Secure     image secondary (256 KB)
20	 *    0x000c_0000 Non-secure image secondary (192 KB)
21	 * 0x000f_0000 Protected Storage Area (16 KB)
22	 * 0x000f_4000 Internal Trusted Storage Area (8 KB)
23	 * 0x000f_6000 OTP / NV counters area (8 KB)
24	 * 0x000f_8000 Non-secure storage, used when built with NRF_NS_STORAGE=ON,
25	 *             otherwise unused (32 KB)
26	 */
27	partitions {
28		compatible = "fixed-partitions";
29		#address-cells = <1>;
30		#size-cells = <1>;
31
32		boot_partition: partition@0 {
33			label = "mcuboot";
34			reg = <0x00000000 0x10000>;
35		};
36		slot0_partition: partition@10000 {
37			label = "image-0";
38			reg = <0x00010000 0x40000>;
39		};
40		slot0_ns_partition: partition@50000 {
41			label = "image-0-nonsecure";
42			reg = <0x00050000 0x30000>;
43		};
44		slot1_partition: partition@80000 {
45			label = "image-1";
46			reg = <0x00080000 0x40000>;
47		};
48		slot1_ns_partition: partition@c0000 {
49			label = "image-1-nonsecure";
50			reg = <0x000c0000 0x30000>;
51		};
52		tfm_ps_partition: partition@f0000 {
53			label = "tfm-ps";
54			reg = <0x000f0000 0x00004000>;
55		};
56		tfm_its_partition: partition@f4000 {
57			label = "tfm-its";
58			reg = <0x000f4000 0x00002000>;
59		};
60		tfm_otp_partition: partition@f6000 {
61			label = "tfm-otp";
62			reg = <0x000f6000 0x00002000>;
63		};
64		storage_partition: partition@f8000 {
65			label = "storage";
66			reg = <0x000f8000 0x00008000>;
67		};
68	};
69};
70
71/ {
72	/*
73	 * Default SRAM planning when building for nRF91xx with
74	 * ARM TrustZone-M support
75	 * - Lowest 88 kB SRAM allocated to Secure image (sram0_s).
76	 * - Upper 168 kB SRAM allocated to Non-Secure image (sram0_ns).
77	 * Of the memory allocated to the Non-Secure image
78	 * - 40 kB SRAM reserved for and used by the modem library (sram0_ns_modem).
79	 * - 128 kB allocated to the application (sram0_ns_app).
80	 */
81	reserved-memory {
82		#address-cells = <1>;
83		#size-cells = <1>;
84		ranges;
85
86		sram0_s: image_s@20000000 {
87			/* Secure image memory */
88			reg = <0x20000000 DT_SIZE_K(88)>;
89		};
90
91		sram0_ns: image_ns@20016000 {
92			/* Non-Secure image memory */
93			reg = <0x20016000 DT_SIZE_K(168)>;
94		};
95
96		sram0_ns_modem: image_ns_modem@20016000 {
97			/* Modem (shared) memory */
98			reg = <0x20016000 DT_SIZE_K(40)>;
99		};
100
101		sram0_ns_app: image_ns_app@20020000 {
102			/* Non-Secure application memory */
103			reg = <0x20020000 DT_SIZE_K(128)>;
104		};
105	};
106};
107