From 51c46e98c78f8f48fc279853a74bb3f67d041c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 19 Oct 2022 12:49:44 +0200 Subject: [PATCH] samples: usb: mass: add disk description to overlays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add flash disk description to overlays. Specify custom flashdisk partition for fat fs api test to match the Kconfig values, because native posix storage partition is too small for FatFS filesystem. Co-authored-by: Johann Fischer Signed-off-by: Tomasz Moń --- .../boards/adafruit_feather_nrf52840.overlay | 9 ++++++ .../mass/boards/nrf52840dk_nrf52840.overlay | 9 ++++++ .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 9 ++++++ .../fs/fat_fs_api/boards/native_posix.overlay | 32 +++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 tests/subsys/fs/fat_fs_api/boards/native_posix.overlay diff --git a/samples/subsys/usb/mass/boards/adafruit_feather_nrf52840.overlay b/samples/subsys/usb/mass/boards/adafruit_feather_nrf52840.overlay index 9f71ca7a3d321f..5112c025af316f 100644 --- a/samples/subsys/usb/mass/boards/adafruit_feather_nrf52840.overlay +++ b/samples/subsys/usb/mass/boards/adafruit_feather_nrf52840.overlay @@ -18,3 +18,12 @@ }; }; }; + +/ { + msc_disk0 { + compatible = "zephyr,flash-disk"; + partition = <&storage_partition>; + disk-name = "NAND"; + cache-size = <4096>; + }; +}; diff --git a/samples/subsys/usb/mass/boards/nrf52840dk_nrf52840.overlay b/samples/subsys/usb/mass/boards/nrf52840dk_nrf52840.overlay index e05776cad08b0d..fce982fff44ac8 100644 --- a/samples/subsys/usb/mass/boards/nrf52840dk_nrf52840.overlay +++ b/samples/subsys/usb/mass/boards/nrf52840dk_nrf52840.overlay @@ -18,3 +18,12 @@ }; }; }; + +/ { + msc_disk0 { + compatible = "zephyr,flash-disk"; + partition = <&storage_partition>; + disk-name = "NAND"; + cache-size = <4096>; + }; +}; diff --git a/samples/subsys/usb/mass/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/subsys/usb/mass/boards/nrf5340dk_nrf5340_cpuapp.overlay index 0204fec1e468af..e529ffe9705443 100644 --- a/samples/subsys/usb/mass/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/samples/subsys/usb/mass/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -18,3 +18,12 @@ }; }; }; + +/ { + msc_disk0 { + compatible = "zephyr,flash-disk"; + partition = <&storage_partition>; + disk-name = "NAND"; + cache-size = <4096>; + }; +}; diff --git a/tests/subsys/fs/fat_fs_api/boards/native_posix.overlay b/tests/subsys/fs/fat_fs_api/boards/native_posix.overlay new file mode 100644 index 00000000000000..1be4fd320713be --- /dev/null +++ b/tests/subsys/fs/fat_fs_api/boards/native_posix.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&flashcontroller0 { + reg = <0x00000000 DT_SIZE_K(2048)>; +}; + +&flash0 { + reg = <0x00000000 DT_SIZE_K(2048)>; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + flashdisk_partition: partition@0 { + label = "flashdisk"; + reg = <0x00000000 0x00200000>; + }; + }; +}; + +/ { + storage_disk { + compatible = "zephyr,flash-disk"; + partition = <&flashdisk_partition>; + disk-name = "NAND"; + cache-size = <4096>; + }; +};