[U-Boot] [PATCH 1/3] common/cmd_rsmode.c: add imx reset mode command

Eric Nelson eric.nelson at boundarydevices.com
Sun May 27 19:33:24 CEST 2012


Hi Troy,

Nitpicks below.

On 05/26/2012 02:01 PM, Troy Kisky wrote:
> This is useful for forcing the ROM's
> usb downloader to activate upon a watchdog reset.
> Or, you can boot from either SD Card.
>
> Currently, support added for MX53 and MX6Q
> Signed-off-by: Troy Kisky<troy.kisky at boundarydevices.com>
>
> Note: MX53 support untested.
> ---
>   arch/arm/include/asm/arch-mx5/imx-regs.h |   18 +++++
>   arch/arm/include/asm/arch-mx6/imx-regs.h |   21 +++++
>   common/Makefile                          |    1 +
>   common/cmd_rsmode.c                      |  118 ++++++++++++++++++++++++++++++
>   4 files changed, 158 insertions(+), 0 deletions(-)
>   create mode 100644 common/cmd_rsmode.c
>
>
 > <snip>
 >
> diff --git a/common/Makefile b/common/Makefile
> index d9f10f3..8e17cec 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -139,6 +139,7 @@ COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
>   COBJS-$(CONFIG_CMD_PXE) += cmd_pxe.o
>   COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
>   COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
> +COBJS-$(CONFIG_CMD_RSMODE) += cmd_rsmode.o
>   COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
>   COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
>   COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o

Since this code is very machine-specific, should this code
go into the board/freescale/common/ or
arch/arm/cpu/armv7/imx-common/ directory?

> diff --git a/common/cmd_rsmode.c b/common/cmd_rsmode.c
> new file mode 100644
>
 > <snip>
 >
> +int do_rsmode(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> +{
> +	int i;
> +	if (argc<  2) {
> +options:
> +		printf("Options:\n");
> +		for (i = 0; i<  ARRAY_SIZE(modes); i++)
> +			printf("%s\n", modes[i].name);

A leading tab here will make the output easier to parse:

U-Boot> rsmode
Options:
usb
sata

U-Boot> rsmode
Options:
	usb
	sata
	ecspi.0
	...

> +		return 0;
> +	}
> +	for (i = 0; i<  ARRAY_SIZE(modes); i++) {
> +		if (!strcmp(modes[i].name, argv[1]))
> +			break;
> +	}


More information about the U-Boot mailing list