drivers: flash: add API to read JEDEC ID from compatible drivers
Some flash drivers are capable of issuing a JESD216 READ_SFDP command to read serial flash discoverable parameters. Allow applications and utilities access to API that reads the JEDEC ID from those devices. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
parent
4eb8d9dd9e
commit
6a1a246825
2 changed files with 36 additions and 0 deletions
|
@ -85,4 +85,13 @@ static inline int z_vrfy_flash_sfdp_read(struct device *dev, off_t offset,
|
|||
}
|
||||
#include <syscalls/flash_sfdp_read.c>
|
||||
|
||||
static inline int z_vrfy_flash_read_jedec_id(struct device *dev,
|
||||
uint8_t *id)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, read_jedec_id));
|
||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(id, 3));
|
||||
return z_impl_flash_read_jedec_id(dev, id);
|
||||
}
|
||||
#include <syscalls/flash_sfdp_jedec_id.c>
|
||||
|
||||
#endif /* CONFIG_FLASH_JESD216_API */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue