summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-12-03 19:43:51 -0500
committerTom Rini <trini@konsulko.com>2016-12-03 19:43:51 -0500
commit73eed452b9c9827474c0789c30729dca6fcf061d (patch)
treeb33a39a41b7b2891b0171f79ea9b5599658884c3 /cmd
parentbfb380b30ad2d678c09037560abb6f09a5e9c9b6 (diff)
parenta2558e8729831e0bcef634ea2440e60425ef0ff6 (diff)
downloadu-boot-imx-73eed452b9c9827474c0789c30729dca6fcf061d.zip
u-boot-imx-73eed452b9c9827474c0789c30729dca6fcf061d.tar.gz
u-boot-imx-73eed452b9c9827474c0789c30729dca6fcf061d.tar.bz2
Merge branch 'master' of git://www.denx.de/git/u-boot-dm
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cros_ec.c23
-rw-r--r--cmd/fdt.c22
-rw-r--r--cmd/tpm_test.c12
3 files changed, 39 insertions, 18 deletions
diff --git a/cmd/cros_ec.c b/cmd/cros_ec.c
index abf11f0..9d42f87 100644
--- a/cmd/cros_ec.c
+++ b/cmd/cros_ec.c
@@ -20,6 +20,29 @@ static const char * const ec_current_image_name[] = {"unknown", "RO", "RW"};
DECLARE_GLOBAL_DATA_PTR;
/**
+ * Decode a flash region parameter
+ *
+ * @param argc Number of params remaining
+ * @param argv List of remaining parameters
+ * @return flash region (EC_FLASH_REGION_...) or -1 on error
+ */
+static int cros_ec_decode_region(int argc, char * const argv[])
+{
+ if (argc > 0) {
+ if (0 == strcmp(*argv, "rw"))
+ return EC_FLASH_REGION_RW;
+ else if (0 == strcmp(*argv, "ro"))
+ return EC_FLASH_REGION_RO;
+
+ debug("%s: Invalid region '%s'\n", __func__, *argv);
+ } else {
+ debug("%s: Missing region parameter\n", __func__);
+ }
+
+ return -1;
+}
+
+/**
* Perform a flash read or write command
*
* @param dev CROS-EC device to read/write
diff --git a/cmd/fdt.c b/cmd/fdt.c
index b503357..8bd345a 100644
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -206,7 +206,17 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 1;
}
working_fdt = newaddr;
+#ifdef CONFIG_OF_SYSTEM_SETUP
+ /* Call the board-specific fixup routine */
+ } else if (strncmp(argv[1], "sys", 3) == 0) {
+ int err = ft_system_setup(working_fdt, gd->bd);
+ if (err) {
+ printf("Failed to add system information to FDT: %s\n",
+ fdt_strerror(err));
+ return CMD_RET_FAILURE;
+ }
+#endif
/*
* Make a new node
*/
@@ -577,18 +587,6 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
}
#endif
-#ifdef CONFIG_OF_SYSTEM_SETUP
- /* Call the board-specific fixup routine */
- else if (strncmp(argv[1], "sys", 3) == 0) {
- int err = ft_system_setup(working_fdt, gd->bd);
-
- if (err) {
- printf("Failed to add system information to FDT: %s\n",
- fdt_strerror(err));
- return CMD_RET_FAILURE;
- }
- }
-#endif
/* Create a chosen node */
else if (strncmp(argv[1], "cho", 3) == 0) {
unsigned long initrd_start = 0, initrd_end = 0;
diff --git a/cmd/tpm_test.c b/cmd/tpm_test.c
index 65332d1..3306405 100644
--- a/cmd/tpm_test.c
+++ b/cmd/tpm_test.c
@@ -532,15 +532,15 @@ static cmd_tbl_t cmd_cros_tpm_sub[] = {
static int do_tpmtest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
cmd_tbl_t *c;
+ int i;
printf("argc = %d, argv = ", argc);
- do {
- int i = 0;
- for (i = 0; i < argc; i++)
- printf(" %s", argv[i]);
- printf("\n------\n");
- } while (0);
+ for (i = 0; i < argc; i++)
+ printf(" %s", argv[i]);
+
+ printf("\n------\n");
+
argc--;
argv++;
c = find_cmd_tbl(argv[0], cmd_cros_tpm_sub,