Commit 78ddcdd6 authored by Dominik Ermel's avatar Dominik Ermel Committed by Anas Nashif
Browse files

tests/disk_access: Add flash-disk overlay for testing



Adds native_posix overlay and modifies code to allow testing
flash-disk access.

Signed-off-by: default avatarDominik Ermel <dominik.ermel@nordicsemi.no>
parent e37d1a54
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2024 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

&flashcontroller0 {
	reg = <0x00000000 DT_SIZE_K(1024)>;
};

&flash0 {
	reg = <0x00000000 DT_SIZE_K(1024)>;
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		flashdisk_partition: partition@0 {
			label = "flashdisk";
			reg = <0x00000000 DT_SIZE_K(1024)>;
		};
	};
};

/ {
	test_disk: storage_disk {
		compatible = "zephyr,flash-disk";
		partition = <&flashdisk_partition>;
		disk-name = "NAND";
		cache-size = <4096>;
	};
};
+7 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2024 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include "native_sim.overlay"
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#define DISK_NAME CONFIG_MMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_RAM)
#define DISK_NAME "RAM"
#elif IS_ENABLED(CONFIG_DISK_DRIVER_FLASH)
#define DISK_NAME "NAND"
#elif IS_ENABLED(CONFIG_NVME)
#define DISK_NAME "nvme0n0"
#else
+6 −0
Original line number Diff line number Diff line
@@ -19,3 +19,9 @@ tests:
    extra_configs:
      - CONFIG_NVME=y
    platform_allow: qemu_x86_64
  drivers.disk.flash:
    extra_configs:
      - CONFIG_DISK_DRIVER_FLASH=y
    platform_allow:
      - native_sim/native/64
      - native_sim