Home
last modified time | relevance | path

Searched full:disk (Results 1 – 25 of 247) sorted by relevance

12345678910

/Zephyr-latest/subsys/disk/
Ddisk_access.c19 LOG_MODULE_REGISTER(disk);
29 struct disk_info *disk = NULL, *itr; in disk_access_get_di() local
46 /* Check for disk name match */ in disk_access_get_di()
48 disk = itr; in disk_access_get_di()
54 return disk; in disk_access_get_di()
59 struct disk_info *disk = disk_access_get_di(pdrv); in disk_access_init() local
62 if ((disk != NULL) && (disk->refcnt == 0U)) { in disk_access_init()
63 /* Disk has not been initialized, start it */ in disk_access_init()
64 if ((disk->ops != NULL) && (disk->ops->init != NULL)) { in disk_access_init()
65 rc = disk->ops->init(disk); in disk_access_init()
[all …]
DKconfig5 bool "Disk Interface"
8 Enable disk access over a supported media backend like FLASH or RAM
12 module = DISK
13 module-str = disk
/Zephyr-latest/include/zephyr/drivers/
Ddisk.h10 * @brief Disk Driver Interface
12 * This file contains interface for disk access. Apart from disks, various
22 * @brief Disk Driver Interface
23 * @defgroup disk_driver_interface Disk Driver Interface
42 /** Get the number of sectors in the disk */
44 /** Get the size of a disk SECTOR in bytes */
50 /** Commit any cached read/writes to disk */
52 /** Initialize the disk. This IOCTL must be issued before the disk can be
54 * invocation of this macro on an uninitialized disk will initialize the IO
58 /** Deinitialize the disk. This IOCTL can be used to de-initialize the disk,
[all …]
Dloopback_disk.h10 #include <zephyr/drivers/disk.h>
14 * @brief Context object for an active loopback disk device
24 * @brief Register a loopback disk device
26 * Registers a new loopback disk deviced backed by a file at the specified path.
30 * until the disk access is unregistered. This is trivially true for file_path and disk_access_name
36 * @param disk_access_name Name of the created disk access (for disk_access_*() functions)
45 * @brief Unregister a previously registered loopback disk device
47 * Cleans up resources used by the disk access.
/Zephyr-latest/include/zephyr/storage/
Ddisk_access.h9 * @brief Disk Access layer API
11 * This file contains APIs for disk access.
26 * @brief Disk Access APIs
27 * @defgroup disk_access_interface Disk Access Interface
32 #include <zephyr/drivers/disk.h>
42 * disk or the backing device can do any initialization. Although still
46 * Disk initialization is reference counted, so only the first successful call
47 * to initialize a uninitialized (or previously de-initialized) disk will
48 * actually initialize the disk
50 * @param[in] pdrv Disk name
[all …]
/Zephyr-latest/subsys/fs/ext2/
Dext2_disk_access.c24 struct disk_data *disk = fs->backend; in disk_access_device_size() local
26 return disk->sector_count * disk->sector_size; in disk_access_device_size()
31 struct disk_data *disk = fs->backend; in disk_access_write_size() local
33 return disk->sector_size; in disk_access_write_size()
36 static int disk_read(const char *disk, uint8_t *buf, uint32_t start, uint32_t num) in disk_read() argument
41 rc = disk_access_ioctl(disk, DISK_IOCTL_CTRL_SYNC, NULL); in disk_read()
43 rc = disk_access_read(disk, buf, start, num); in disk_read()
44 LOG_DBG("disk read: (start:%d, num:%d) (ret: %d)", start, num, rc); in disk_read()
50 static int disk_write(const char *disk, const uint8_t *buf, uint32_t start, uint32_t num) in disk_write() argument
55 rc = disk_access_ioctl(disk, DISK_IOCTL_CTRL_SYNC, NULL); in disk_write()
[all …]
/Zephyr-latest/doc/services/storage/disk/
Daccess.rst3 Disk Access
9 The disk access API provides access to storage devices.
14 Since many disk devices (such as SD cards) are hotpluggable, the disk access
15 API provides IOCTLs to initialize and de-initialize the disk. They are
18 * :c:macro:`DISK_IOCTL_CTRL_INIT`: Initialize the disk. Must be called before
19 additional I/O operations can be run on the disk device. Equivalent to
22 * :c:macro:`DISK_IOCTL_CTRL_DEINIT`: De-initialize the disk. Once this IOCTL
24 the disk can be used for addition I/O operations.
26 Init/deinit IOCTL calls are balanced, so a disk will not de-initialize until
29 It is also possible to force a disk de-initialization by passing a
[all …]
Dnvme.rst8 NVMe controllers and disks are supported. Disks can be accessed via the :ref:`Disk Access API <disk…
16 - NVMe controller: :zephyr_file:`drivers/disk/nvme/nvme_controller.c`
17 - NVMe commands: :zephyr_file:`drivers/disk/nvme/nvme_cmd.c`
18 - NVMe namespace: :zephyr_file:`drivers/disk/nvme/nvme_namespace.c`
24 accessing each ones through the Disk Access API :zephyr_file:`drivers/disk/nvme/nvme_disk.c`.
26 If a controller exposes more than 1 namespace (disk), it will be possible to raise the amount of bu…
29 Each exposed disk, via it's related disk_info structure, will be distinguished by its name which is…
30 it's related namespace. As such, the disk name follows NVMe naming which is nvme<k>n<n> where k is …
31 and n the namespame number. Most of the time, if only one NVMe disk is plugged into the system, one…
32 an exposed disk.
[all …]
/Zephyr-latest/drivers/disk/
DKconfig5 bool "Disk drivers"
7 Disk Driver configuration
11 source "drivers/disk/Kconfig.ram"
12 source "drivers/disk/Kconfig.flash"
13 source "drivers/disk/Kconfig.sdmmc"
14 source "drivers/disk/Kconfig.mmc"
15 source "drivers/disk/Kconfig.loopback"
Dmmc_subsys.c8 * MMC disk driver using zephyr SD subsystem
13 #include <zephyr/drivers/disk.h>
34 static int disk_mmc_access_init(struct disk_info *disk) in disk_mmc_access_init() argument
36 const struct device *dev = disk->dev; in disk_mmc_access_init()
50 static int disk_mmc_access_status(struct disk_info *disk) in disk_mmc_access_status() argument
52 const struct device *dev = disk->dev; in disk_mmc_access_status()
62 static int disk_mmc_access_read(struct disk_info *disk, uint8_t *buf, in disk_mmc_access_read() argument
65 const struct device *dev = disk->dev; in disk_mmc_access_read()
71 static int disk_mmc_access_write(struct disk_info *disk, const uint8_t *buf, in disk_mmc_access_write() argument
74 const struct device *dev = disk->dev; in disk_mmc_access_write()
[all …]
Dsdmmc_subsys.c8 * SDMMC disk driver using zephyr SD subsystem
13 #include <zephyr/drivers/disk.h>
33 static int disk_sdmmc_access_init(struct disk_info *disk) in disk_sdmmc_access_init() argument
35 const struct device *dev = disk->dev; in disk_sdmmc_access_init()
53 static int disk_sdmmc_access_status(struct disk_info *disk) in disk_sdmmc_access_status() argument
55 const struct device *dev = disk->dev; in disk_sdmmc_access_status()
69 static int disk_sdmmc_access_read(struct disk_info *disk, uint8_t *buf, in disk_sdmmc_access_read() argument
72 const struct device *dev = disk->dev; in disk_sdmmc_access_read()
78 static int disk_sdmmc_access_write(struct disk_info *disk, const uint8_t *buf, in disk_sdmmc_access_write() argument
81 const struct device *dev = disk->dev; in disk_sdmmc_access_write()
[all …]
Dramdisk.c10 #include <zephyr/drivers/disk.h>
39 static int disk_ram_access_status(struct disk_info *disk) in disk_ram_access_status() argument
44 static int disk_ram_access_read(struct disk_info *disk, uint8_t *buff, in disk_ram_access_read() argument
47 const struct device *dev = disk->dev; in disk_ram_access_read()
62 static int disk_ram_access_write(struct disk_info *disk, const uint8_t *buff, in disk_ram_access_write() argument
65 const struct device *dev = disk->dev; in disk_ram_access_write()
80 static int disk_ram_access_ioctl(struct disk_info *disk, uint8_t cmd, void *buff) in disk_ram_access_ioctl() argument
82 const struct ram_disk_config *config = disk->dev->config; in disk_ram_access_ioctl()
106 static int disk_ram_access_init(struct disk_info *disk) in disk_ram_access_init() argument
108 return disk_ram_access_ioctl(disk, DISK_IOCTL_CTRL_INIT, NULL); in disk_ram_access_init()
[all …]
/Zephyr-latest/dts/bindings/sd/
Dzephyr,sdmmc-disk.yaml2 Zephyr SDMMC disk node. A binding with this compatible present within an SD
3 host controller device node indicates that an SDMMC disk is attached to that
4 SD bus. This binding will enable that disk to be used with the disk driver
7 compatible: "zephyr,sdmmc-disk"
12 disk-name:
16 Disk name.
Dzephyr,mmc-disk.yaml2 Zephyr MMC disk node. A binding with this compatible present within an SD
4 SD bus. This binding will enable that to be used with the disk driver
7 compatible: "zephyr,mmc-disk"
23 disk-name:
27 Disk name.
/Zephyr-latest/tests/drivers/disk/disk_access/
Dtestcase.yaml3 tags: disk
5 drivers.disk.usdhc:
16 drivers.disk.ram:
18 drivers.disk.nvme:
22 drivers.disk.flash:
28 drivers.disk.loopback:
37 drivers.disk.stm32_sdhc:
39 drivers.disk.simulator.no_explicit_erase:
DREADME.txt1 Disk Access Test
4 This test is intended to verify the functionality of disk devices in Zephyr.
5 It is designed to test the NXP USDHC disk driver, but can be used for other
6 disk devices as well. The test has the following phases:
8 * Setup test: Verifies that disk initialization works, as well as testing
9 disk_access_ioctl by querying the disk for its sector size and sector count.
17 The test deliberately will read sectors beyond the end of the disk, and if
24 disk and reads it back to verify correctness. The test first performs writes
26 writes that would be outside the bounds of the disk), then performs multiple
/Zephyr-latest/drivers/disk/nvme/
Dnvme_disk.c14 static int nvme_disk_status(struct disk_info *disk) in nvme_disk_status() argument
19 static int nvme_disk_read(struct disk_info *disk, in nvme_disk_read() argument
24 struct nvme_namespace *ns = CONTAINER_OF(disk->name, in nvme_disk_read()
37 nvme_lock(disk->dev); in nvme_disk_read()
58 LOG_WRN("Reading at sector %u (count %d) on disk %s failed", in nvme_disk_read()
64 nvme_unlock(disk->dev); in nvme_disk_read()
68 static int nvme_disk_write(struct disk_info *disk, in nvme_disk_write() argument
73 struct nvme_namespace *ns = CONTAINER_OF(disk->name, in nvme_disk_write()
86 nvme_lock(disk->dev); in nvme_disk_write()
107 LOG_WRN("Writing at sector %u (count %d) on disk %s failed", in nvme_disk_write()
[all …]
/Zephyr-latest/dts/bindings/disk/
Dzephyr,ram-disk.yaml4 description: RAM disk
6 compatible: "zephyr,ram-disk"
11 disk-name:
15 Disk name.
22 Disk sector size in bytes.
33 Optional phandle to the memory region to be used as a RAM disk,
34 if not used a local buffer is defined for each disk instance.
/Zephyr-latest/tests/drivers/disk/disk_performance/
DREADME.txt1 Disk Performance Test
4 This test is intended to test the performance of disk devices under Zephyr. It
5 was tested with SD cards, but can be used for other disk devices as well.
8 * Setup test: simply sets up the disk, and reads data such as the sector count
14 * Random read test: This test performs random reads across the disk, each one
20 * Random write test: This test performs random writes across the disk, each one
Dtestcase.yaml3 tags: disk
5 drivers.disk.disk_performance.sdhc:
14 drivers.disk.disk_performance.disk.nvme:
/Zephyr-latest/tests/drivers/disk/disk_access/src/
Dmain.c8 * WARNING: This test will overwrite data on any disk utilized. Do not run
9 * this test with an disk that has useful data
37 #error "No disk device defined, is your board supported?"
98 zassert_equal(rc, 0, "Loopback disk access initialization failed"); in setup_loopback_backing()
102 /* Sets up test by initializing disk */
109 zassert_equal(rc, 0, "Disk access initialization failed"); in test_setup()
112 zassert_equal(rc, DISK_STATUS_OK, "Disk status is not OK"); in test_setup()
115 zassert_equal(rc, 0, "Disk ioctl get sector count failed"); in test_setup()
117 TC_PRINT("Disk reports %u sectors\n", cmd_buf); in test_setup()
121 zassert_equal(rc, 0, "Disk ioctl get sector size failed"); in test_setup()
[all …]
/Zephyr-latest/tests/subsys/fs/fat_fs_dual_drive/
Dapp.overlay9 compatible = "zephyr,ram-disk";
10 disk-name = "RAM";
16 compatible = "zephyr,ram-disk";
17 disk-name = "CF";
/Zephyr-latest/tests/drivers/build_all/disk/
Dspi.dtsi13 compatible = "zephyr,sdmmc-disk";
14 disk-name = "SD";
19 compatible = "zephyr,mmc-disk";
20 disk-name = "SD2";
/Zephyr-latest/samples/subsys/fs/fs_sample/boards/
Dnrf52840dk_nrf52840_ram_disk_region.overlay8 * of RAM there is. We need some for the Disk, so we need to
30 * used later in disk definition.
40 compatible = "zephyr,ram-disk";
44 disk-name = "SD";
45 /* Disk size is 64kB, 128 sectors of 512B, the minimal
51 * disk using a phandle; note that we reference the
/Zephyr-latest/tests/drivers/disk/disk_performance/src/
Dmain.c22 #error "No disk device defined, is your board supported?"
55 /* Sets up test by initializing disk */
62 zassert_equal(rc, 0, "Disk access initialization failed"); in test_setup()
65 zassert_equal(rc, DISK_STATUS_OK, "Disk status is not OK"); in test_setup()
68 zassert_equal(rc, 0, "Disk ioctl get sector count failed"); in test_setup()
70 TC_PRINT("Disk reports %u sectors\n", cmd_buf); in test_setup()
74 zassert_equal(rc, 0, "Disk ioctl get sector size failed"); in test_setup()
75 TC_PRINT("Disk reports sector size %u\n", cmd_buf); in test_setup()
100 /* Read from start of disk */ in read_helper()
105 zassert_equal(rc, 0, "disk read failed"); in read_helper()
[all …]

12345678910