summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-01-02 14:00:00 +0000
committerwdenk <wdenk>2004-01-02 14:00:00 +0000
commitd4ca31c40e8888b36635967522ec7ea03fd7e70b (patch)
tree126385a917df4665532dc33cff5fee2977e8fc0e /common
parentc18960049f8ea9b0a8ad0a05c93e23fbab025da0 (diff)
* Cleanup lowboot code for MPC5200
* Minor code cleanup (coding style) * Patch by Reinhard Meyer, 30 Dec 2003: - cpu/mpc5xxx/fec.c: added CONFIG_PHY_ADDR, added CONFIG_PHY_TYPE, - added CONFIG_PHY_ADDR to include/configs/IceCube.h, - turned debug print of PHY registers into a function (called in two places) - added support for EMK MPC5200 based modules * Fix MPC8xx PLPRCR_MFD_SHIFT typo * Add support for TQM866M modules * Fixes for TQM855M with 4 MB flash (Am29DL163 = _no_ mirror bit flash) * Fix a few compiler warnings
Diffstat (limited to 'common')
-rw-r--r--common/cmd_bootm.c2
-rw-r--r--common/cmd_flash.c10
-rw-r--r--common/cmd_fpga.c162
-rw-r--r--common/cmd_ide.c2
-rw-r--r--common/cmd_mem.c12
5 files changed, 94 insertions, 94 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 5e31400c9e..34a74ce2c5 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -263,7 +263,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
case IH_TYPE_KERNEL:
name = "Kernel Image";
break;
- case IH_TYPE_MULTI:
+ case IH_TYPE_MULTI:
name = "Multi-File Image";
len = ntohl(len_ptr[0]);
/* OS kernel is always the first image */
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 253f9efbcc..e5b1ca178e 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -333,15 +333,15 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
status = dataflash_real_protect(p,addr_first,addr_last);
if (status < 0){
printf("Bad DataFlash sector specification\n");
- return 1;
- }
- printf("%sProtect %d DataFlash Sectors\n",
- p ? "" : "Un-", status);
+ return 1;
+ }
+ printf("%sProtect %d DataFlash Sectors\n",
+ p ? "" : "Un-", status);
return 0;
}
}
#endif
-
+
if (strcmp(argv[2], "all") == 0) {
for (bank=1; bank<=CFG_MAX_FLASH_BANKS; ++bank) {
info = &flash_info[bank-1];
diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c
index 41ed459949..e674ef4fed 100644
--- a/common/cmd_fpga.c
+++ b/common/cmd_fpga.c
@@ -45,8 +45,8 @@
#if defined (CONFIG_FPGA) && ( CONFIG_COMMANDS & CFG_CMD_FPGA )
/* Local functions */
-static void fpga_usage ( cmd_tbl_t *cmdtp );
-static int fpga_get_op( char *opstr );
+static void fpga_usage (cmd_tbl_t * cmdtp);
+static int fpga_get_op (char *opstr);
/* Local defines */
#define FPGA_NONE -1
@@ -62,106 +62,106 @@ static int fpga_get_op( char *opstr );
* If there is no data addr field, the fpgadata environment variable is used.
* The info command requires no data address field.
*/
-int
-do_fpga (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
- int op, dev = FPGA_INVALID_DEVICE;
- size_t data_size = 0;
- void *fpga_data = NULL;
- char *devstr = getenv("fpga");
- char *datastr = getenv("fpgadata");
- int rc = FPGA_FAIL;
-
- if ( devstr ) dev = (int)simple_strtoul( devstr, NULL, 16 );
- if ( datastr ) fpga_data = (void *)simple_strtoul( datastr, NULL, 16 );
-
- switch ( argc )
- {
- case 5: /* fpga <op> <dev> <data> <datasize> */
- data_size = simple_strtoul( argv[4], NULL, 16 );
- case 4: /* fpga <op> <dev> <data> */
- fpga_data = (void *)simple_strtoul( argv[3], NULL, 16 );
- PRINTF(__FUNCTION__": fpga_data = 0x%x\n", (uint)fpga_data );
- case 3: /* fpga <op> <dev | data addr> */
- dev = (int)simple_strtoul( argv[2], NULL, 16 );
- PRINTF(__FUNCTION__": device = %d\n", dev );
- /* FIXME - this is a really weak test */
- if (( argc == 3 ) && ( dev > fpga_count() )) { /* must be buffer ptr */
- PRINTF(__FUNCTION__": Assuming buffer pointer in arg 3\n");
- fpga_data = (void *)dev;
- PRINTF(__FUNCTION__": fpga_data = 0x%x\n", (uint)fpga_data );
- dev = FPGA_INVALID_DEVICE; /* reset device num */
- }
- case 2: /* fpga <op> */
- op = (int)fpga_get_op( argv[1] );
- break;
- default:
- PRINTF(__FUNCTION__": Too many or too few args (%d)\n", argc );
- op = FPGA_NONE; /* force usage display */
- break;
- }
-
- switch ( op ) {
- case FPGA_NONE:
- fpga_usage( cmdtp );
- break;
-
- case FPGA_INFO:
- rc = fpga_info( dev );
- break;
-
- case FPGA_LOAD:
- rc = fpga_load( dev, fpga_data, data_size );
- break;
-
- case FPGA_DUMP:
- rc = fpga_dump( dev, fpga_data, data_size );
- break;
-
- default:
- printf( "Unknown operation.\n" );
- fpga_usage( cmdtp );
- break;
- }
- return (rc);
+ int op, dev = FPGA_INVALID_DEVICE;
+ size_t data_size = 0;
+ void *fpga_data = NULL;
+ char *devstr = getenv ("fpga");
+ char *datastr = getenv ("fpgadata");
+ int rc = FPGA_FAIL;
+
+ if (devstr)
+ dev = (int) simple_strtoul (devstr, NULL, 16);
+ if (datastr)
+ fpga_data = (void *) simple_strtoul (datastr, NULL, 16);
+
+ switch (argc) {
+ case 5: /* fpga <op> <dev> <data> <datasize> */
+ data_size = simple_strtoul (argv[4], NULL, 16);
+ case 4: /* fpga <op> <dev> <data> */
+ fpga_data = (void *) simple_strtoul (argv[3], NULL, 16);
+ PRINTF (__FUNCTION__ ": fpga_data = 0x%x\n",
+ (uint) fpga_data);
+ case 3: /* fpga <op> <dev | data addr> */
+ dev = (int) simple_strtoul (argv[2], NULL, 16);
+ PRINTF (__FUNCTION__ ": device = %d\n", dev);
+ /* FIXME - this is a really weak test */
+ if ((argc == 3) && (dev > fpga_count ())) { /* must be buffer ptr */
+ PRINTF (__FUNCTION__
+ ": Assuming buffer pointer in arg 3\n");
+ fpga_data = (void *) dev;
+ PRINTF (__FUNCTION__ ": fpga_data = 0x%x\n",
+ (uint) fpga_data);
+ dev = FPGA_INVALID_DEVICE; /* reset device num */
+ }
+ case 2: /* fpga <op> */
+ op = (int) fpga_get_op (argv[1]);
+ break;
+ default:
+ PRINTF (__FUNCTION__ ": Too many or too few args (%d)\n",
+ argc);
+ op = FPGA_NONE; /* force usage display */
+ break;
+ }
+
+ switch (op) {
+ case FPGA_NONE:
+ fpga_usage (cmdtp);
+ break;
+
+ case FPGA_INFO:
+ rc = fpga_info (dev);
+ break;
+
+ case FPGA_LOAD:
+ rc = fpga_load (dev, fpga_data, data_size);
+ break;
+
+ case FPGA_DUMP:
+ rc = fpga_dump (dev, fpga_data, data_size);
+ break;
+
+ default:
+ printf ("Unknown operation.\n");
+ fpga_usage (cmdtp);
+ break;
+ }
+ return (rc);
}
-static void fpga_usage ( cmd_tbl_t *cmdtp )
+static void fpga_usage (cmd_tbl_t * cmdtp)
{
- printf( "Usage:\n%s\n", cmdtp->usage );
+ printf ("Usage:\n%s\n", cmdtp->usage);
}
/*
* Map op to supported operations. We don't use a table since we
* would just have to relocate it from flash anyway.
*/
-static int fpga_get_op( char *opstr )
+static int fpga_get_op (char *opstr)
{
int op = FPGA_NONE;
if (!strcmp ("info", opstr)) {
op = FPGA_INFO;
- }
- else if (!strcmp ("load", opstr)) {
+ } else if (!strcmp ("load", opstr)) {
op = FPGA_LOAD;
- }
- else if (!strcmp ("dump", opstr)) {
+ } else if (!strcmp ("dump", opstr)) {
op = FPGA_DUMP;
}
- if ( op == FPGA_NONE ) {
+ if (op == FPGA_NONE) {
printf ("Unknown fpga operation \"%s\"\n", opstr);
}
return op;
}
-U_BOOT_CMD(
- fpga, 6, 1, do_fpga,
- "fpga - loadable FPGA image support\n",
- "fpga [operation type] [device number] [image address] [image size]\n"
- "fpga operations:\n"
- "\tinfo\tlist known device information.\n"
- "\tload\tLoad device from memory buffer.\n"
- "\tdump\tLoad device to memory buffer.\n"
-);
-#endif /* CONFIG_FPGA && CONFIG_COMMANDS & CFG_CMD_FPGA */
+U_BOOT_CMD (fpga, 6, 1, do_fpga,
+ "fpga - loadable FPGA image support\n",
+ "fpga [operation type] [device number] [image address] [image size]\n"
+ "fpga operations:\n"
+ "\tinfo\tlist known device information.\n"
+ "\tload\tLoad device from memory buffer.\n"
+ "\tdump\tLoad device to memory buffer.\n");
+#endif /* CONFIG_FPGA && CONFIG_COMMANDS & CFG_CMD_FPGA */
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 3f18b00d10..331041c16c 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -771,7 +771,7 @@ ide_outb(int dev, int port, unsigned char val)
{
PRINTF ("ide_outb (dev= %d, port= %d, val= 0x%02x) : @ 0x%08lx\n",
dev, port, val, (ATA_CURR_BASE(dev)+port));
-
+
/* Ensure I/O operations complete */
__asm__ volatile("eieio");
*((uchar *)(ATA_CURR_BASE(dev)+port)) = val;
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 35b3901d23..6ccad70fe1 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -146,9 +146,9 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if ((rc = read_dataflash(addr, (linebytes/size)*size, linebuf)) == DATAFLASH_OK){
/* if outside dataflash */
/*if (rc != 1) {
- dataflash_perror (rc);
- return (1);
- }*/
+ dataflash_perror (rc);
+ return (1);
+ }*/
for (i=0; i<linebytes; i+= size) {
if (size == 4) {
printf(" %08x", *uip++);
@@ -439,9 +439,9 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int rc;
rc = read_dataflash(addr, count * size, (char *) dest);
if (rc != 1) {
- dataflash_perror (rc);
- return (1);
- }
+ dataflash_perror (rc);
+ return (1);
+ }
return 0;
}