diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/bootm.c | 11 | ||||
-rw-r--r-- | commands/mw.c | 24 | ||||
-rw-r--r-- | commands/spi.c | 1 |
3 files changed, 31 insertions, 5 deletions
diff --git a/commands/bootm.c b/commands/bootm.c index c7cbdbe0f4..100c2e99fb 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -45,7 +45,7 @@ #include <magicvar.h> #include <asm-generic/memory_layout.h> -#define BOOTM_OPTS_COMMON "sca:e:vo:fd" +#define BOOTM_OPTS_COMMON "sca:e:vo:fdt:" #ifdef CONFIG_BOOTM_INITRD #define BOOTM_OPTS BOOTM_OPTS_COMMON "L:r:" @@ -96,6 +96,9 @@ static int do_bootm(int argc, char *argv[]) case 'd': data.dryrun = 1; break; + case 't': + data.tee_file = optarg; + break; default: return COMMAND_ERROR_USAGE; } @@ -134,6 +137,9 @@ BAREBOX_CMD_HELP_OPT ("-e OFFS\t","entry point to the image relative to start (0 #ifdef CONFIG_OFTREE BAREBOX_CMD_HELP_OPT ("-o DTB\t","specify open firmware device tree") #endif +#ifdef CONFIG_BOOTM_OPTEE +BAREBOX_CMD_HELP_OPT ("-t TEE\t","specify TEE image") +#endif #ifdef CONFIG_BOOTM_VERBOSE BAREBOX_CMD_HELP_OPT ("-v\t","verbose") #endif @@ -153,6 +159,9 @@ BAREBOX_CMD_START(bootm) #ifdef CONFIG_BOOTM_VERBOSE "v" #endif +#ifdef CONFIG_BOOTM_OPTEE + "t" +#endif "] IMAGE") BAREBOX_CMD_GROUP(CMD_GRP_BOOT) BAREBOX_CMD_HELP(cmd_bootm_help) diff --git a/commands/mw.c b/commands/mw.c index 2912997a31..3ed6c820d0 100644 --- a/commands/mw.c +++ b/commands/mw.c @@ -63,23 +63,31 @@ static int do_mem_mw(int argc, char *argv[]) u64 val64; switch (mode) { case O_RWSIZE_1: - val8 = simple_strtoul(argv[optind], NULL, 0); + ret = kstrtou8(argv[optind], 0, &val8); + if (ret) + goto illegal_number; ret = write(fd, &val8, 1); break; case O_RWSIZE_2: - val16 = simple_strtoul(argv[optind], NULL, 0); + ret = kstrtou16(argv[optind], 0, &val16); + if (ret) + goto illegal_number; if (swab) val16 = __swab16(val16); ret = write(fd, &val16, 2); break; case O_RWSIZE_4: - val32 = simple_strtoul(argv[optind], NULL, 0); + ret = kstrtou32(argv[optind], 0, &val32); + if (ret) + goto illegal_number; if (swab) val32 = __swab32(val32); ret = write(fd, &val32, 4); break; case O_RWSIZE_8: - val64 = simple_strtoull(argv[optind], NULL, 0); + ret = kstrtou64(argv[optind], 0, &val64); + if (ret) + goto illegal_number; if (swab) val64 = __swab64(val64); ret = write(fd, &val64, 8); @@ -96,6 +104,14 @@ static int do_mem_mw(int argc, char *argv[]) close(fd); return ret ? 1 : 0; + +illegal_number: + printf("\"%s\" is not a valid %d bit number\n", argv[optind], + (mode >> O_RWSIZE_SHIFT) * 8); + + close(fd); + + return 1; } BAREBOX_CMD_HELP_START(mw) diff --git a/commands/spi.c b/commands/spi.c index 55a0e255af..d35aa1cd81 100644 --- a/commands/spi.c +++ b/commands/spi.c @@ -67,6 +67,7 @@ static int do_spi(int argc, char *argv[]) printf("spi bus %d not found\n", bus); return -ENODEV; } + spi.master = spi.controller; if (spi.chip_select >= spi.controller->num_chipselect) { printf("spi chip select (%d) >= controller num chipselect (%d)\n", |