Source code for the Trusted Boot Module.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
tbm-mcu/source/shell/ftl.c

39 lines
690 B

#include <ctype.h>
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <console.h>
#include <flash.h>
#include <ftl.h>
#include <macros.h>
#include <shell.h>
extern struct flash_dev *flash;
int shell_ftl_probe(struct console *con, size_t argc, const char **argv)
{
(void)argv;
(void)argc;
if (flash) {
flash_release(flash);
flash = NULL;
}
if (!(flash = flash_probe())) {
fprintf(con->fp, "error: unable to probe the flash device.\n");
return -1;
}
if (!(flash = ftl_mount(flash))) {
fprintf(con->fp, "error: unable to mount the flash translation layer.\n");
return -1;
}
return 0;
}