From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Date: Sun, 27 May 2012 10:33:24 -0700 Subject: [U-Boot] [PATCH 1/3] common/cmd_rsmode.c: add imx reset mode command In-Reply-To: <1338066111-5835-1-git-send-email-troy.kisky@boundarydevices.com> References: <1338066111-5835-1-git-send-email-troy.kisky@boundarydevices.com> Message-ID: <4FC26564.3090003@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > > 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 > > > > > 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 > > > > +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; > + }