RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
include
dev
flash
flash_sim_flashdev.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
10
11
/*
12
* Copyright (C) 2025 On-Line Applications Research (OAR) Corporation
13
*
14
* Redistribution and use in source and binary forms, with or without
15
* modification, are permitted provided that the following conditions
16
* are met:
17
* 1. Redistributions of source code must retain the above copyright
18
* notice, this list of conditions and the following disclaimer.
19
* 2. Redistributions in binary form must reproduce the above copyright
20
* notice, this list of conditions and the following disclaimer in the
21
* documentation and/or other materials provided with the distribution.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
24
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
* POSSIBILITY OF SUCH DAMAGE.
34
*/
35
36
#ifndef NAND_SIM_FLASHDEV_H
37
#define NAND_SIM_FLASHDEV_H
38
39
#include <
dev/flash/flashdev.h
>
40
41
#ifdef __cplusplus
42
extern
"C"
{
43
#endif
44
46
struct
flash_sim_flashdev_attributes
{
48
uint64_t
read_delay_ns
;
50
uint64_t
write_delay_ns
;
52
uint64_t
erase_delay_ns
;
54
uint64_t
page_size_bytes
;
56
uint64_t
page_oob_bytes
;
58
uint64_t
pages_per_sector
;
60
uint64_t
total_sectors
;
62
rtems_flashdev_flash_type
type
;
67
void
*(*alloc)(
size_t
size);
72
void (*
free
)(
void
*ptr);
73
};
74
86
rtems_flashdev
*
flash_sim_flashdev_init
(
87
struct
flash_sim_flashdev_attributes
*attr
88
);
89
90
#ifdef __cplusplus
91
}
92
#endif
93
94
#endif
/* NAND_SIM_FLASHDEV_H */
flash_sim_flashdev_init
rtems_flashdev * flash_sim_flashdev_init(struct flash_sim_flashdev_attributes *attr)
Initializes a simulated flash device. The flash device is not registered in this call....
Definition
flash_sim_flashdev.c:370
flashdev.h
Generic Flash API.
rtems_flashdev_flash_type
rtems_flashdev_flash_type
Enum for flash type returned from IOCTL call.
Definition
flashdev.h:239
flash_sim_flashdev_attributes
Configuration options for NAND simulation.
Definition
flash_sim_flashdev.h:46
flash_sim_flashdev_attributes::write_delay_ns
uint64_t write_delay_ns
The minimum delay in nanoseconds for a write operation.
Definition
flash_sim_flashdev.h:50
flash_sim_flashdev_attributes::total_sectors
uint64_t total_sectors
The total number of sectors in the simulated device.
Definition
flash_sim_flashdev.h:60
flash_sim_flashdev_attributes::read_delay_ns
uint64_t read_delay_ns
The minimum delay in nanoseconds for a read operation.
Definition
flash_sim_flashdev.h:48
flash_sim_flashdev_attributes::free
void(*) free(void *ptr)
Free function for simulated flash, but not other allocations. free() will be used if NULL.
Definition
flash_sim_flashdev.h:72
flash_sim_flashdev_attributes::erase_delay_ns
uint64_t erase_delay_ns
The minimum delay in nanoseconds for a erase operation.
Definition
flash_sim_flashdev.h:52
flash_sim_flashdev_attributes::page_size_bytes
uint64_t page_size_bytes
The number of bytes in each page.
Definition
flash_sim_flashdev.h:54
flash_sim_flashdev_attributes::type
rtems_flashdev_flash_type type
The type of flash that is being simulated.
Definition
flash_sim_flashdev.h:62
flash_sim_flashdev_attributes::pages_per_sector
uint64_t pages_per_sector
The number of pages in each sector.
Definition
flash_sim_flashdev.h:58
flash_sim_flashdev_attributes::page_oob_bytes
uint64_t page_oob_bytes
The number of spare/out of band (OOB) bytes per page.
Definition
flash_sim_flashdev.h:56
rtems_flashdev
Flash device.
Definition
flashdev.h:358
Generated by
1.18.0