Commit 7b452355 authored by Daniel DeGrasse's avatar Daniel DeGrasse Committed by Fabio Baltieri
Browse files

samples: subsys: mcumgr: rework ram load support for multiple boards



MCUMgr ram load support was hardcoding the overlay file for the
nrf52840dk. To make this support generic, move the _ram_load overlay
file to the MCUBoot repository, as part of the mcuboot application.

Signed-off-by: default avatarDaniel DeGrasse <ddegrasse@tenstorrent.com>
parent 1bc008da
Loading
Loading
Loading
Loading
+35 −1
Original line number Diff line number Diff line
/delete-node/ &sram0;

#include "../sysbuild/nrf52840dk_nrf52840_mcuboot_ram_load.overlay"
/*
 * Layout must match the nrf52840dk_nrf52840_ram_load overlay file within mcuboot
 * application configuration directory
 */

&gpregret1 {
	/delete-node/ boot_mode@0;
};

/ {
	sram@2003FC00 {
		compatible = "zephyr,memory-region", "mmio-sram";
		reg = <0x2003FC00 DT_SIZE_K(1)>;
		zephyr,memory-region = "RetainedMem";
		status = "okay";

		retainedmem {
			compatible = "zephyr,retained-ram";
			status = "okay";
			#address-cells = <1>;
			#size-cells = <1>;

			boot_info0: boot_info@0 {
				compatible = "zephyr,retention";
				status = "okay";
				reg = <0x0 0x100>;
			};
		};
	};

	chosen {
		/delete-property/ zephyr,boot-mode;
		zephyr,bootloader-info = &boot_info0;
	};
};

/ {
	chosen {
+0 −4
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

if("${FILE_SUFFIX}" STREQUAL "ram_load")
  set(mcuboot_EXTRA_DTC_OVERLAY_FILE "${CMAKE_CURRENT_LIST_DIR}/nrf52840dk_nrf52840_mcuboot_ram_load.overlay" CACHE INTERNAL "" FORCE)
endif()

find_package(Sysbuild REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(sysbuild LANGUAGES)
+0 −33
Original line number Diff line number Diff line
&gpregret1 {
	/delete-node/ boot_mode@0;
};

/ {
	chosen {
		/delete-property/ zephyr,boot-mode;
	};

	sram@2003FC00 {
		compatible = "zephyr,memory-region", "mmio-sram";
		reg = <0x2003FC00 DT_SIZE_K(1)>;
		zephyr,memory-region = "RetainedMem";
		status = "okay";

		retainedmem {
			compatible = "zephyr,retained-ram";
			status = "okay";
			#address-cells = <1>;
			#size-cells = <1>;

			boot_info0: boot_info@0 {
				compatible = "zephyr,retention";
				status = "okay";
				reg = <0x0 0x100>;
			};
		};
	};

	chosen {
		zephyr,bootloader-info = &boot_info0;
	};
};