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
37		slot0_partition: partition@10000 {
38			label = "image-0";
39			reg = <0x00010000 0x40000>;
40		};
41
42		slot0_ns_partition: partition@50000 {
43			label = "image-0-nonsecure";
44			reg = <0x00050000 0x30000>;
45		};
46
47		slot1_partition: partition@80000 {
48			label = "image-1";
49			reg = <0x00080000 0x40000>;
50		};
51
52		slot1_ns_partition: partition@c0000 {
53			label = "image-1-nonsecure";
54			reg = <0x000c0000 0x30000>;
55		};
56
57		tfm_ps_partition: partition@f0000 {
58			label = "tfm-ps";
59			reg = <0x000f0000 0x00004000>;
60		};
61
62		tfm_its_partition: partition@f4000 {
63			label = "tfm-its";
64			reg = <0x000f4000 0x00002000>;
65		};
66
67		tfm_otp_partition: partition@f6000 {
68			label = "tfm-otp";
69			reg = <0x000f6000 0x00002000>;
70		};
71
72		storage_partition: partition@f8000 {
73			label = "storage";
74			reg = <0x000f8000 0x00008000>;
75		};
76	};
77};
78
79/ {
80	/*
81	 * Default SRAM planning when building for nRF91xx with
82	 * ARM TrustZone-M support
83	 * - Lowest 88 kB SRAM allocated to Secure image (sram0_s).
84	 * - Upper 168 kB SRAM allocated to Non-Secure image (sram0_ns).
85	 * Of the memory allocated to the Non-Secure image
86	 * - 40 kB SRAM reserved for and used by the modem library (sram0_ns_modem).
87	 * - 128 kB allocated to the application (sram0_ns_app).
88	 */
89	reserved-memory {
90		#address-cells = <1>;
91		#size-cells = <1>;
92		ranges;
93
94		sram0_s: image_s@20000000 {
95			/* Secure image memory */
96			reg = <0x20000000 DT_SIZE_K(88)>;
97		};
98
99		sram0_ns: image_ns@20016000 {
100			/* Non-Secure image memory */
101			reg = <0x20016000 DT_SIZE_K(168)>;
102		};
103
104		sram0_ns_modem: image_ns_modem@20016000 {
105			/* Modem (shared) memory */
106			reg = <0x20016000 DT_SIZE_K(40)>;
107		};
108
109		sram0_ns_app: image_ns_app@20020000 {
110			/* Non-Secure application memory */
111			reg = <0x20020000 DT_SIZE_K(128)>;
112		};
113	};
114};
115