summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/cmd_autoscript.c2
-rw-r--r--common/cmd_bootm.c11
-rw-r--r--common/cmd_dcr.c2
-rw-r--r--common/cmd_fdc.c136
-rw-r--r--common/cmd_fdt.c4
-rw-r--r--common/cmd_i2c.c16
-rw-r--r--common/cmd_ide.c10
-rw-r--r--common/cmd_log.c4
-rw-r--r--common/cmd_mem.c60
-rw-r--r--common/cmd_nvedit.c10
-rw-r--r--common/cmd_pci.c2
-rw-r--r--common/cmd_reginfo.c112
-rw-r--r--common/cmd_scsi.c2
-rw-r--r--common/cmd_usb.c2
-rw-r--r--common/cmd_vfd.c8
-rw-r--r--common/command.c34
-rw-r--r--common/console.c2
-rw-r--r--common/env_common.c19
-rw-r--r--common/env_dataflash.c2
-rw-r--r--common/env_eeprom.c3
-rw-r--r--common/env_nand.c2
-rw-r--r--common/env_nvram.c2
-rw-r--r--common/ft_build.c1
-rw-r--r--common/hush.c1
-rw-r--r--common/image.c18
-rw-r--r--common/lists.c4
-rw-r--r--common/main.c33
-rw-r--r--common/usb.c8
-rw-r--r--common/usb_kbd.c4
-rw-r--r--common/virtex2.c2
30 files changed, 239 insertions, 277 deletions
diff --git a/common/cmd_autoscript.c b/common/cmd_autoscript.c
index 932f638..13af93e 100644
--- a/common/cmd_autoscript.c
+++ b/common/cmd_autoscript.c
@@ -52,7 +52,7 @@
int
autoscript (ulong addr, const char *fit_uname)
{
- ulong len;
+ ulong len;
image_header_t *hdr;
ulong *data;
char *cmd;
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 44f6b9f..0d67132 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -433,17 +433,6 @@ static int fit_check_kernel (const void *fit, int os_noffset, int verify)
}
show_boot_progress (105);
-#ifdef CONFIG_LOGBUFFER
-#ifndef CONFIG_ALT_LB_ADDR
- kbd=gd->bd;
- /* Prevent initrd from overwriting logbuffer */
- if (initrd_high < (kbd->bi_memsize-LOGBUFF_LEN-LOGBUFF_OVERHEAD))
- initrd_high = kbd->bi_memsize-LOGBUFF_LEN-LOGBUFF_OVERHEAD;
- debug ("## Logbuffer at 0x%08lX ", kbd->bi_memsize-LOGBUFF_LEN);
-#else
- debug ("## Logbuffer at 0x%08lX ", CONFIG_ALT_LB_ADDR);
-#endif
-#endif
if (!fit_image_check_target_arch (fit, os_noffset)) {
puts ("Unsupported Architecture\n");
show_boot_progress (-105);
diff --git a/common/cmd_dcr.c b/common/cmd_dcr.c
index a053343..439d07a 100644
--- a/common/cmd_dcr.c
+++ b/common/cmd_dcr.c
@@ -123,7 +123,7 @@ int do_getidcr (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
return 1;
- }
+ }
/* Find out whether ther is '.' (dot) symbol in the first parameter. */
strncpy (buf, argv[1], sizeof(buf)-1);
diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c
index bf28370..0293d18 100644
--- a/common/cmd_fdc.c
+++ b/common/cmd_fdc.c
@@ -46,24 +46,23 @@
#define FALSE 0
#endif
-
/*#if defined(CONFIG_CMD_DATE) */
/*#include <rtc.h> */
/*#endif */
#if defined(CONFIG_CMD_FDC) || defined(CONFIG_CMD_FDOS)
-
typedef struct {
- int flags; /* connected drives ect */
- unsigned long blnr; /* Logical block nr */
- uchar drive; /* drive no */
- uchar cmdlen; /* cmd length */
- uchar cmd[16]; /* cmd desc */
- uchar dma; /* if > 0 dma enabled */
- uchar result[11];/* status information */
- uchar resultlen; /* lenght of result */
+ int flags; /* connected drives ect */
+ unsigned long blnr; /* Logical block nr */
+ uchar drive; /* drive no */
+ uchar cmdlen; /* cmd length */
+ uchar cmd[16]; /* cmd desc */
+ uchar dma; /* if > 0 dma enabled */
+ uchar result[11]; /* status information */
+ uchar resultlen; /* lenght of result */
} FDC_COMMAND_STRUCT;
+
/* flags: only the lower 8bit used:
* bit 0 if set drive 0 is present
* bit 1 if set drive 1 is present
@@ -75,31 +74,30 @@ typedef struct {
* bit 7 if set disk in drive 4 is inserted
*/
-
/* cmd indexes */
-#define COMMAND 0
-#define DRIVE 1
+#define COMMAND 0
+#define DRIVE 1
#define CONFIG0 1
-#define SPEC_HUTSRT 1
-#define TRACK 2
+#define SPEC_HUTSRT 1
+#define TRACK 2
#define CONFIG1 2
#define SPEC_HLT 2
-#define HEAD 3
+#define HEAD 3
#define CONFIG2 3
-#define SECTOR 4
-#define SECTOR_SIZE 5
-#define LAST_TRACK 6
-#define GAP 7
-#define DTL 8
+#define SECTOR 4
+#define SECTOR_SIZE 5
+#define LAST_TRACK 6
+#define GAP 7
+#define DTL 8
/* result indexes */
-#define STATUS_0 0
-#define STATUS_PCN 1
-#define STATUS_1 1
-#define STATUS_2 2
-#define STATUS_TRACK 3
-#define STATUS_HEAD 4
-#define STATUS_SECT 5
-#define STATUS_SECT_SIZE 6
+#define STATUS_0 0
+#define STATUS_PCN 1
+#define STATUS_1 1
+#define STATUS_2 2
+#define STATUS_TRACK 3
+#define STATUS_HEAD 4
+#define STATUS_SECT 5
+#define STATUS_SECT_SIZE 6
/* Register addresses */
@@ -114,34 +112,34 @@ typedef struct {
#define FDC_DIR FDC_BASE + 6 /* Digital Input Register */
#define FDC_CCR FDC_BASE + 7 /* Configuration Control */
/* Commands */
-#define FDC_CMD_SENSE_INT 0x08
-#define FDC_CMD_CONFIGURE 0x13
-#define FDC_CMD_SPECIFY 0x03
-#define FDC_CMD_RECALIBRATE 0x07
-#define FDC_CMD_READ 0x06
-#define FDC_CMD_READ_TRACK 0x02
-#define FDC_CMD_READ_ID 0x0A
-#define FDC_CMD_DUMP_REG 0x0E
-#define FDC_CMD_SEEK 0x0F
-
-#define FDC_CMD_SENSE_INT_LEN 0x01
-#define FDC_CMD_CONFIGURE_LEN 0x04
-#define FDC_CMD_SPECIFY_LEN 0x03
-#define FDC_CMD_RECALIBRATE_LEN 0x02
-#define FDC_CMD_READ_LEN 0x09
-#define FDC_CMD_READ_TRACK_LEN 0x09
-#define FDC_CMD_READ_ID_LEN 0x02
-#define FDC_CMD_DUMP_REG_LEN 0x01
-#define FDC_CMD_SEEK_LEN 0x03
-
-#define FDC_FIFO_THR 0x0C
-#define FDC_FIFO_DIS 0x00
+#define FDC_CMD_SENSE_INT 0x08
+#define FDC_CMD_CONFIGURE 0x13
+#define FDC_CMD_SPECIFY 0x03
+#define FDC_CMD_RECALIBRATE 0x07
+#define FDC_CMD_READ 0x06
+#define FDC_CMD_READ_TRACK 0x02
+#define FDC_CMD_READ_ID 0x0A
+#define FDC_CMD_DUMP_REG 0x0E
+#define FDC_CMD_SEEK 0x0F
+
+#define FDC_CMD_SENSE_INT_LEN 0x01
+#define FDC_CMD_CONFIGURE_LEN 0x04
+#define FDC_CMD_SPECIFY_LEN 0x03
+#define FDC_CMD_RECALIBRATE_LEN 0x02
+#define FDC_CMD_READ_LEN 0x09
+#define FDC_CMD_READ_TRACK_LEN 0x09
+#define FDC_CMD_READ_ID_LEN 0x02
+#define FDC_CMD_DUMP_REG_LEN 0x01
+#define FDC_CMD_SEEK_LEN 0x03
+
+#define FDC_FIFO_THR 0x0C
+#define FDC_FIFO_DIS 0x00
#define FDC_IMPLIED_SEEK 0x01
-#define FDC_POLL_DIS 0x00
-#define FDC_PRE_TRK 0x00
-#define FDC_CONFIGURE FDC_FIFO_THR | (FDC_POLL_DIS<<4) | (FDC_FIFO_DIS<<5) | (FDC_IMPLIED_SEEK << 6)
-#define FDC_MFM_MODE 0x01 /* MFM enable */
-#define FDC_SKIP_MODE 0x00 /* skip enable */
+#define FDC_POLL_DIS 0x00
+#define FDC_PRE_TRK 0x00
+#define FDC_CONFIGURE FDC_FIFO_THR | (FDC_POLL_DIS<<4) | (FDC_FIFO_DIS<<5) | (FDC_IMPLIED_SEEK << 6)
+#define FDC_MFM_MODE 0x01 /* MFM enable */
+#define FDC_SKIP_MODE 0x00 /* skip enable */
#define FDC_TIME_OUT 100000 /* time out */
#define FDC_RW_RETRIES 3 /* read write retries */
@@ -150,18 +148,18 @@ typedef struct {
/* Disk structure */
typedef struct {
- unsigned int size; /* nr of sectors total */
- unsigned int sect; /* sectors per track */
- unsigned int head; /* nr of heads */
- unsigned int track; /* nr of tracks */
- unsigned int stretch; /* !=0 means double track steps */
- unsigned char gap; /* gap1 size */
- unsigned char rate; /* data rate. |= 0x40 for perpendicular */
- unsigned char spec1; /* stepping rate, head unload time */
- unsigned char fmt_gap; /* gap2 size */
- unsigned char hlt; /* head load time */
- unsigned char sect_code; /* Sector Size code */
- const char * name; /* used only for predefined formats */
+ unsigned int size; /* nr of sectors total */
+ unsigned int sect; /* sectors per track */
+ unsigned int head; /* nr of heads */
+ unsigned int track; /* nr of tracks */
+ unsigned int stretch; /* !=0 means double track steps */
+ unsigned char gap; /* gap1 size */
+ unsigned char rate; /* data rate. |= 0x40 for perpendicular */
+ unsigned char spec1; /* stepping rate, head unload time */
+ unsigned char fmt_gap;/* gap2 size */
+ unsigned char hlt; /* head load time */
+ unsigned char sect_code;/* Sector Size code */
+ const char * name; /* used only for predefined formats */
} FD_GEO_STRUCT;
@@ -342,7 +340,7 @@ int fdc_issue_cmd(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG)
case FDC_CMD_CONFIGURE:
pCMD->cmd[CONFIG0]=0;
pCMD->cmd[CONFIG1]=FDC_CONFIGURE; /* FIFO Threshold, Poll, Enable FIFO */
- pCMD->cmd[CONFIG2]=FDC_PRE_TRK; /* Precompensation Track */
+ pCMD->cmd[CONFIG2]=FDC_PRE_TRK; /* Precompensation Track */
pCMD->cmdlen=FDC_CMD_CONFIGURE_LEN;
pCMD->resultlen=0; /* no result */
break;
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 7436a95..ede65ae 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -464,13 +464,13 @@ static int fdt_valid(void)
/*
* Parse the user's input, partially heuristic. Valid formats:
* <0x00112233 4 05> - an array of cells. Numbers follow standard
- * C conventions.
+ * C conventions.
* [00 11 22 .. nn] - byte stream
* "string" - If the the value doesn't start with "<" or "[", it is
* treated as a string. Note that the quotes are
* stripped by the parser before we get the string.
* newval: An array of strings containing the new property as specified
- * on the command line
+ * on the command line
* count: The number of strings in the array
* data: A bytestream to be placed in the property
* len: The length of the resulting bytestream
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index c60ec99..aac7e9a 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -266,8 +266,8 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
/*
- * Chip is always specified.
- */
+ * Chip is always specified.
+ */
chip = simple_strtoul(argv[1], NULL, 16);
/*
@@ -353,8 +353,8 @@ int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
/*
- * Chip is always specified.
- */
+ * Chip is always specified.
+ */
chip = simple_strtoul(argv[1], NULL, 16);
/*
@@ -444,8 +444,8 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
size = cmd_get_data_size(argv[0], 1);
/*
- * Chip is always specified.
- */
+ * Chip is always specified.
+ */
chip = simple_strtoul(argv[1], NULL, 16);
/*
@@ -1256,7 +1256,7 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
#if defined(CONFIG_I2C_CMD_TREE)
U_BOOT_CMD(
i2c, 6, 1, do_i2c,
- "i2c - I2C sub-system\n",
+ "i2c - I2C sub-system\n",
#if defined(CONFIG_I2C_MULTI_BUS)
"dev [dev] - show or set current I2C bus\n"
#endif /* CONFIG_I2C_MULTI_BUS */
@@ -1280,7 +1280,7 @@ U_BOOT_CMD(
);
U_BOOT_CMD(
- imm, 3, 1, do_i2c_mm,
+ imm, 3, 1, do_i2c_mm,
"imm - i2c memory modify (auto-incrementing)\n",
"chip address[.0, .1, .2]\n"
" - memory modify, auto increment address\n"
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index ead7e10..6560702 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -52,10 +52,6 @@
# include <status_led.h>
#endif
-#ifndef __PPC__
-#include <asm/io.h>
-#endif
-
#ifdef CONFIG_IDE_8xx_DIRECT
DECLARE_GLOBAL_DATA_PTR;
#endif
@@ -1237,7 +1233,7 @@ static void ide_ident (block_dev_desc_t *dev_desc)
dev_desc->blksz=ATA_BLOCKSIZE;
dev_desc->lun=0; /* just to fill something in... */
-#if 0 /* only used to test the powersaving mode,
+#if 0 /* only used to test the powersaving mode,
* if enabled, the drive goes after 5 sec
* in standby mode */
ide_outb (device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device));
@@ -1787,7 +1783,7 @@ unsigned char atapi_issue(int device,unsigned char* ccb,int ccblen, unsigned cha
}
output_data_shorts (device, (unsigned short *)ccb,ccblen/2); /* write command block */
- /* ATAPI Command written wait for completition */
+ /* ATAPI Command written wait for completition */
udelay (5000); /* device must set bsy */
mask = ATA_STAT_DRQ|ATA_STAT_BUSY|ATA_STAT_ERR;
@@ -1856,7 +1852,7 @@ AI_OUT:
* returns, an request_sense will be issued
*/
-#define ATAPI_DRIVE_NOT_READY 100
+#define ATAPI_DRIVE_NOT_READY 100
#define ATAPI_UNIT_ATTN 10
unsigned char atapi_issue_autoreq (int device,
diff --git a/common/cmd_log.c b/common/cmd_log.c
index b9f9ba0..c6e72ac 100644
--- a/common/cmd_log.c
+++ b/common/cmd_log.c
@@ -107,7 +107,7 @@ void logbuff_init_ptrs (void)
if ((s = getenv ("loglevel")) != NULL)
console_loglevel = (int)simple_strtoul (s, NULL, 10);
- gd->post_log_word |= LOGBUFF_INITIALIZED;
+ gd->flags |= GD_FLG_LOGINIT;
}
void logbuff_reset (void)
@@ -168,7 +168,7 @@ static void logbuff_puts (const char *s)
void logbuff_log(char *msg)
{
- if ((gd->post_log_word & LOGBUFF_INITIALIZED)) {
+ if ((gd->flags & GD_FLG_LOGINIT)) {
logbuff_printk (msg);
} else {
/* Can happen only for pre-relocated errors as logging */
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 51aa71f..2606986 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -1201,56 +1201,56 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/**************************************************/
#if defined(CONFIG_CMD_MEMORY)
U_BOOT_CMD(
- md, 3, 1, do_mem_md,
- "md - memory display\n",
- "[.b, .w, .l] address [# of objects]\n - memory display\n"
+ md, 3, 1, do_mem_md,
+ "md - memory display\n",
+ "[.b, .w, .l] address [# of objects]\n - memory display\n"
);
U_BOOT_CMD(
- mm, 2, 1, do_mem_mm,
- "mm - memory modify (auto-incrementing)\n",
+ mm, 2, 1, do_mem_mm,
+ "mm - memory modify (auto-incrementing)\n",
"[.b, .w, .l] address\n" " - memory modify, auto increment address\n"
);
U_BOOT_CMD(
- nm, 2, 1, do_mem_nm,
- "nm - memory modify (constant address)\n",
+ nm, 2, 1, do_mem_nm,
+ "nm - memory modify (constant address)\n",
"[.b, .w, .l] address\n - memory modify, read and keep address\n"
);
U_BOOT_CMD(
- mw, 4, 1, do_mem_mw,
- "mw - memory write (fill)\n",
- "[.b, .w, .l] address value [count]\n - write memory\n"
+ mw, 4, 1, do_mem_mw,
+ "mw - memory write (fill)\n",
+ "[.b, .w, .l] address value [count]\n - write memory\n"
);
U_BOOT_CMD(
- cp, 4, 1, do_mem_cp,
- "cp - memory copy\n",
+ cp, 4, 1, do_mem_cp,
+ "cp - memory copy\n",
"[.b, .w, .l] source target count\n - copy memory\n"
);
U_BOOT_CMD(
- cmp, 4, 1, do_mem_cmp,
- "cmp - memory compare\n",
+ cmp, 4, 1, do_mem_cmp,
+ "cmp - memory compare\n",
"[.b, .w, .l] addr1 addr2 count\n - compare memory\n"
);
#ifndef CONFIG_CRC32_VERIFY
U_BOOT_CMD(
- crc32, 4, 1, do_mem_crc,
- "crc32 - checksum calculation\n",
+ crc32, 4, 1, do_mem_crc,
+ "crc32 - checksum calculation\n",
"address count [addr]\n - compute CRC32 checksum [save at addr]\n"
);
#else /* CONFIG_CRC32_VERIFY */
U_BOOT_CMD(
- crc32, 5, 1, do_mem_crc,
- "crc32 - checksum calculation\n",
+ crc32, 5, 1, do_mem_crc,
+ "crc32 - checksum calculation\n",
"address count [addr]\n - compute CRC32 checksum [save at addr]\n"
"-v address count crc\n - verify crc of memory area\n"
);
@@ -1258,45 +1258,45 @@ U_BOOT_CMD(
#endif /* CONFIG_CRC32_VERIFY */
U_BOOT_CMD(
- base, 2, 1, do_mem_base,
- "base - print or set address offset\n",
+ base, 2, 1, do_mem_base,
+ "base - print or set address offset\n",
"\n - print address offset for memory commands\n"
"base off\n - set address offset for memory commands to 'off'\n"
);
U_BOOT_CMD(
- loop, 3, 1, do_mem_loop,
- "loop - infinite loop on address range\n",
+ loop, 3, 1, do_mem_loop,
+ "loop - infinite loop on address range\n",
"[.b, .w, .l] address number_of_objects\n"
" - loop on a set of addresses\n"
);
#ifdef CONFIG_LOOPW
U_BOOT_CMD(
- loopw, 4, 1, do_mem_loopw,
- "loopw - infinite write loop on address range\n",
+ loopw, 4, 1, do_mem_loopw,
+ "loopw - infinite write loop on address range\n",
"[.b, .w, .l] address number_of_objects data_to_write\n"
" - loop on a set of addresses\n"
);
#endif /* CONFIG_LOOPW */
U_BOOT_CMD(
- mtest, 4, 1, do_mem_mtest,
- "mtest - simple RAM test\n",
+ mtest, 4, 1, do_mem_mtest,
+ "mtest - simple RAM test\n",
"[start [end [pattern]]]\n"
" - simple RAM read/write test\n"
);
#ifdef CONFIG_MX_CYCLIC
U_BOOT_CMD(
- mdc, 4, 1, do_mem_mdc,
- "mdc - memory display cyclic\n",
+ mdc, 4, 1, do_mem_mdc,
+ "mdc - memory display cyclic\n",
"[.b, .w, .l] address count delay(ms)\n - memory display cyclic\n"
);
U_BOOT_CMD(
- mwc, 4, 1, do_mem_mwc,
- "mwc - memory write cyclic\n",
+ mwc, 4, 1, do_mem_mwc,
+ "mwc - memory write cyclic\n",
"[.b, .w, .l] address value delay(ms)\n - memory write cyclic\n"
);
#endif /* CONFIG_MX_CYCLIC */
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index dc05f68..9c5d1fc 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -68,16 +68,6 @@ DECLARE_GLOBAL_DATA_PTR;
/************************************************************************
************************************************************************/
-/* Function that returns a pointer to a value from the environment */
-/* (Only memory version supported / needed). */
-extern uchar *env_get_addr(int);
-
-/* Function that updates CRC of the enironment */
-extern void env_crc_update (void);
-
-/************************************************************************
-************************************************************************/
-
/*
* Table with supported baudrates (defined in config_xyz.h)
*/
diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index 82d9717..8968701 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -173,7 +173,7 @@ static char *pci_classes_str(u8 class)
* Subroutine: pci_header_show_brief
*
* Description: Reads and prints the header of the
- * specified PCI device in short form.
+ * specified PCI device in short form.
*
* Inputs: dev Bus+Device+Function number
*
diff --git a/common/cmd_reginfo.c b/common/cmd_reginfo.c
index dd808ed..1669d74 100644
--- a/common/cmd_reginfo.c
+++ b/common/cmd_reginfo.c
@@ -109,24 +109,24 @@ int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
puts ("\nMemory (SDRAM) Configuration\n"
"besra besrsa besrb besrsb bear mcopt1 rtr pmit\n");
- mtdcr(memcfga,mem_besra); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_besra); printf ("%08x ", mfdcr(memcfgd));
mtdcr(memcfga,mem_besrsa); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_besrb); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_besrsb); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_bear); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_mcopt1); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_rtr); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_pmit); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_besrb); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_besrsb); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_bear); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_mcopt1); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_rtr); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_pmit); printf ("%08x ", mfdcr(memcfgd));
puts ("\n"
"mb0cf mb1cf mb2cf mb3cf sdtr1 ecccf eccerr\n");
- mtdcr(memcfga,mem_mb0cf); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_mb1cf); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_mb2cf); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_mb3cf); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_sdtr1); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_ecccf); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_eccerr); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_mb0cf); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_mb1cf); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_mb2cf); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_mb3cf); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_sdtr1); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_ecccf); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_eccerr); printf ("%08x ", mfdcr(memcfgd));
printf ("\n\n"
"DMA Channels\n"
@@ -149,32 +149,32 @@ int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
puts ("\n"
"External Bus\n"
"pbear pbesr0 pbesr1 epcr\n");
- mtdcr(ebccfga,pbear); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pbesr0); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pbesr1); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,epcr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pbear); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pbesr0); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pbesr1); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,epcr); printf ("%08x ", mfdcr(ebccfgd));
puts ("\n"
"pb0cr pb0ap pb1cr pb1ap pb2cr pb2ap pb3cr pb3ap\n");
- mtdcr(ebccfga,pb0cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb0ap); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb1cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb1ap); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb2cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb2ap); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb3cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb3ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb0cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb0ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb1cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb1ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb2cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb2ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb3cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb3ap); printf ("%08x ", mfdcr(ebccfgd));
puts ("\n"
"pb4cr pb4ap pb5cr bp5ap pb6cr pb6ap pb7cr pb7ap\n");
- mtdcr(ebccfga,pb4cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb4ap); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb5cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb5ap); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb6cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb6ap); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb7cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb7ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb4cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb4ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb5cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb5ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb6cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb6ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb7cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb7ap); printf ("%08x ", mfdcr(ebccfgd));
puts ("\n\n");
@@ -196,12 +196,12 @@ int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
puts ("\nMemory (SDRAM) Configuration\n"
"mcopt1 rtr pmit mb0cf mb1cf sdtr1\n");
- mtdcr(memcfga,mem_mcopt1); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_rtr); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_pmit); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_mb0cf); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_mb1cf); printf ("%08x ", mfdcr(memcfgd));
- mtdcr(memcfga,mem_sdtr1); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_mcopt1); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_rtr); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_pmit); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_mb0cf); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_mb1cf); printf ("%08x ", mfdcr(memcfgd));
+ mtdcr(memcfga,mem_sdtr1); printf ("%08x ", mfdcr(memcfgd));
printf ("\n\n"
"DMA Channels\n"
@@ -221,31 +221,31 @@ int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
puts ("\n"
"External Bus\n"
"pbear pbesr0 pbesr1 epcr\n");
- mtdcr(ebccfga,pbear); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pbesr0); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pbesr1); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,epcr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pbear); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pbesr0); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pbesr1); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,epcr); printf ("%08x ", mfdcr(ebccfgd));
puts ("\n"
"pb0cr pb0ap pb1cr pb1ap pb2cr pb2ap pb3cr pb3ap\n");
- mtdcr(ebccfga,pb0cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb0ap); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb1cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb1ap); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb2cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb2ap); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb3cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb3ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb0cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb0ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb1cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb1ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb2cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb2ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb3cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb3ap); printf ("%08x ", mfdcr(ebccfgd));
puts ("\n"
"pb4cr pb4ap\n");
- mtdcr(ebccfga,pb4cr); printf ("%08x ", mfdcr(ebccfgd));
- mtdcr(ebccfga,pb4ap); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb4cr); printf ("%08x ", mfdcr(ebccfgd));
+ mtdcr(ebccfga,pb4ap); printf ("%08x ", mfdcr(ebccfgd));
puts ("\n\n");
#elif defined(CONFIG_5xx)
- volatile immap_t *immap = (immap_t *)CFG_IMMR;
+ volatile immap_t *immap = (immap_t *)CFG_IMMR;
volatile memctl5xx_t *memctl = &immap->im_memctl;
volatile sysconf5xx_t *sysconf = &immap->im_siu_conf;
volatile sit5xx_t *timers = &immap->im_sit;
@@ -382,7 +382,7 @@ int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#if defined(CONFIG_CMD_REGINFO)
U_BOOT_CMD(
- reginfo, 2, 1, do_reginfo,
+ reginfo, 2, 1, do_reginfo,
"reginfo - print register information\n",
);
#endif
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index f49531e..69028f3 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -393,7 +393,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
printf ("Usage:\n%s\n", cmdtp->usage);
return 1;
- case 3:
+ case 3:
if (strncmp(argv[1],"dev",3) == 0) {
int dev = (int)simple_strtoul(argv[2], NULL, 10);
printf ("\nSCSI device %d: ", dev);
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 23413b5..9be86b8 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -475,7 +475,7 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#ifdef CONFIG_USB_STORAGE
/* try to recognize storage devices immediately */
if (i >= 0)
- usb_stor_curr_dev = usb_stor_scan(1);
+ usb_stor_curr_dev = usb_stor_scan(1);
#endif
return 0;
}
diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c
index 29c349d..104c310 100644
--- a/common/cmd_vfd.c
+++ b/common/cmd_vfd.c
@@ -66,10 +66,10 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
U_BOOT_CMD(
- vfd, 2, 0, do_vfd,
- "vfd - load a bitmap to the VFDs on TRAB\n",
- "/N\n"
- " - load bitmap N to the VFDs (N is _decimal_ !!!)\n"
+ vfd, 2, 0, do_vfd,
+ "vfd - load a bitmap to the VFDs on TRAB\n",
+ "/N\n"
+ " - load bitmap N to the VFDs (N is _decimal_ !!!)\n"
"vfd ADDR\n"
" - load bitmap at address ADDR\n"
);
diff --git a/common/command.c b/common/command.c
index af2f8cb..861796d 100644
--- a/common/command.c
+++ b/common/command.c
@@ -38,7 +38,7 @@ do_version (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(
version, 1, 1, do_version,
- "version - print monitor version\n",
+ "version - print monitor version\n",
NULL
);
@@ -71,8 +71,8 @@ do_echo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(
echo, CFG_MAXARGS, 1, do_echo,
- "echo - echo args to console\n",
- "[args..]\n"
+ "echo - echo args to console\n",
+ "[args..]\n"
" - echo args to console; \\c suppresses newline\n"
);
@@ -196,17 +196,15 @@ do_test (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
expr = !expr;
-#if 0
- printf(": returns %d\n", expr);
-#endif
+ debug (": returns %d\n", expr);
return expr;
}
U_BOOT_CMD(
test, CFG_MAXARGS, 1, do_test,
- "test - minimal test like /bin/sh\n",
- "[args..]\n"
+ "test - minimal test like /bin/sh\n",
+ "[args..]\n"
" - test functionality\n"
);
@@ -224,7 +222,7 @@ do_exit (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(
exit, 2, 1, do_exit,
- "exit - exit script\n",
+ "exit - exit script\n",
" - exit functionality\n"
);
@@ -317,12 +315,12 @@ int do_help (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(
help, CFG_MAXARGS, 1, do_help,
- "help - print online help\n",
- "[command ...]\n"
- " - show help information (for 'command')\n"
- "'help' prints online help for the monitor commands.\n\n"
- "Without arguments, it prints a short usage message for all commands.\n\n"
- "To get detailed help information for specific commands you can type\n"
+ "help - print online help\n",
+ "[command ...]\n"
+ " - show help information (for 'command')\n"
+ "'help' prints online help for the monitor commands.\n\n"
+ "Without arguments, it prints a short usage message for all commands.\n\n"
+ "To get detailed help information for specific commands you can type\n"
"'help' with one or more command names as arguments.\n"
);
@@ -330,13 +328,13 @@ U_BOOT_CMD(
#ifdef CFG_LONGHELP
cmd_tbl_t __u_boot_cmd_question_mark Struct_Section = {
"?", CFG_MAXARGS, 1, do_help,
- "? - alias for 'help'\n",
+ "? - alias for 'help'\n",
NULL
};
#else
cmd_tbl_t __u_boot_cmd_question_mark Struct_Section = {
"?", CFG_MAXARGS, 1, do_help,
- "? - alias for 'help'\n"
+ "? - alias for 'help'\n"
};
#endif /* CFG_LONGHELP */
@@ -498,7 +496,7 @@ static int make_argv(char *s, int argvsz, char *argv[])
while ((*s == ' ') || (*s == '\t'))
++s;
- if (*s == '\0') /* end of s, no more args */
+ if (*s == '\0') /* end of s, no more args */
break;
argv[argc++] = s; /* begin of argument string */
diff --git a/common/console.c b/common/console.c
index d8a0cb6..1b095b1 100644
--- a/common/console.c
+++ b/common/console.c
@@ -415,7 +415,7 @@ int console_init_r (void)
stdoutname = getenv ("stdout");
stderrname = getenv ("stderr");
- if (OVERWRITE_CONSOLE == 0) { /* if not overwritten by config switch */
+ if (OVERWRITE_CONSOLE == 0) { /* if not overwritten by config switch */
inputdev = search_device (DEV_FLAGS_INPUT, stdinname);
outputdev = search_device (DEV_FLAGS_OUTPUT, stdoutname);
errdev = search_device (DEV_FLAGS_OUTPUT, stderrname);
diff --git a/common/env_common.c b/common/env_common.c
index f366fdb..a494812 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -50,6 +50,7 @@ extern void env_relocate_spec (void);
extern uchar env_get_char_spec(int);
static uchar env_get_char_init (int index);
+uchar (*env_get_char)(int) = env_get_char_init;
/************************************************************************
* Default settings to be used when no valid environment is found
@@ -181,19 +182,6 @@ uchar env_get_char_memory (int index)
}
#endif
-uchar env_get_char (int index)
-{
- uchar c;
-
- /* if relocated to RAM */
- if (gd->flags & GD_FLG_RELOC)
- c = env_get_char_memory(index);
- else
- c = env_get_char_init(index);
-
- return (c);
-}
-
uchar *env_get_addr (int index)
{
if (gd->env_valid) {
@@ -227,6 +215,11 @@ void env_relocate (void)
DEBUGF ("%s[%d] malloced ENV at %p\n", __FUNCTION__,__LINE__,env_ptr);
#endif
+ /*
+ * After relocation to RAM, we can always use the "memory" functions
+ */
+ env_get_char = env_get_char_memory;
+
if (gd->env_valid == 0) {
#if defined(CONFIG_GTH) || defined(CFG_ENV_IS_NOWHERE) /* Environment not changable */
puts ("Using default environment\n\n");
diff --git a/common/env_dataflash.c b/common/env_dataflash.c
index 8a94432..2945364 100644
--- a/common/env_dataflash.c
+++ b/common/env_dataflash.c
@@ -98,7 +98,7 @@ int env_init(void)
}
}
- return (0);
+ return (0);
}
#endif /* CFG_ENV_IS_IN_DATAFLASH */
diff --git a/common/env_eeprom.c b/common/env_eeprom.c
index fae87ca..9e1a201 100644
--- a/common/env_eeprom.c
+++ b/common/env_eeprom.c
@@ -38,9 +38,6 @@ env_t *env_ptr = NULL;
char * env_name_spec = "EEPROM";
-extern uchar env_get_char_memory (int index);
-
-
uchar env_get_char_spec (int index)
{
uchar c;
diff --git a/common/env_nand.c b/common/env_nand.c
index f12674d..3a98d2b 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -270,7 +270,7 @@ void env_relocate_spec (void)
total = CFG_ENV_SIZE;
ret = nand_read(&nand_info[0], CFG_ENV_OFFSET, &total, (u_char*)env_ptr);
- if (ret || total != CFG_ENV_SIZE)
+ if (ret || total != CFG_ENV_SIZE)
return use_default();
if (crc32(0, env_ptr->data, ENV_SIZE) != env_ptr->crc)
diff --git a/common/env_nvram.c b/common/env_nvram.c
index bfc8d02..fa77719 100644
--- a/common/env_nvram.c
+++ b/common/env_nvram.c
@@ -63,8 +63,6 @@ char * env_name_spec = "NVRAM";
extern uchar default_environment[];
extern int default_environment_size;
-extern uchar env_get_char_memory (int index);
-
#ifdef CONFIG_AMIGAONEG3SE
uchar env_get_char_spec (int index)
{
diff --git a/common/ft_build.c b/common/ft_build.c
index 0b6c2b7..b951178 100644
--- a/common/ft_build.c
+++ b/common/ft_build.c
@@ -396,7 +396,6 @@ void *ft_get_prop(void *bphp, const char *propname, int *szp)
/********************************************************************/
-
void ft_setup(void *blob, bd_t * bd, ulong initrd_start, ulong initrd_end)
{
u32 *p;
diff --git a/common/hush.c b/common/hush.c
index 582635c..b43f618 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -1,4 +1,3 @@
-/* vi: set sw=4 ts=4: */
/*
* sh.c -- a prototype Bourne shell grammar parser
* Intended to follow the original Thompson and Ritchie
diff --git a/common/image.c b/common/image.c
index 4a024d4..67e594d 100644
--- a/common/image.c
+++ b/common/image.c
@@ -23,7 +23,6 @@
* MA 02111-1307 USA
*/
-
#ifndef USE_HOSTCC
#include <common.h>
#include <watchdog.h>
@@ -36,10 +35,6 @@
#include <dataflash.h>
#endif
-#ifdef CONFIG_LOGBUFFER
-#include <logbuff.h>
-#endif
-
#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
#include <rtc.h>
#endif
@@ -93,6 +88,7 @@ static table_entry_t uimage_arch[] = {
{ IH_ARCH_MIPS64, "mips64", "MIPS 64 Bit", },
{ IH_ARCH_NIOS, "nios", "NIOS", },
{ IH_ARCH_NIOS2, "nios2", "NIOS II", },
+ { IH_ARCH_PPC, "powerpc", "PowerPC", },
{ IH_ARCH_PPC, "ppc", "PowerPC", },
{ IH_ARCH_S390, "s390", "IBM S390", },
{ IH_ARCH_SH, "sh", "SuperH", },
@@ -241,7 +237,7 @@ void image_multi_getimg (image_header_t *hdr, ulong idx,
{
int i;
uint32_t *size;
- ulong offset, tail, count, img_data;
+ ulong offset, count, img_data;
/* get number of component */
count = image_multi_count (hdr);
@@ -257,19 +253,15 @@ void image_multi_getimg (image_header_t *hdr, ulong idx,
if (idx < count) {
*len = uimage_to_cpu (size[idx]);
offset = 0;
- tail = 0;
/* go over all indices preceding requested component idx */
for (i = 0; i < idx; i++) {
- /* add up i-th component size */
- offset += uimage_to_cpu (size[i]);
-
- /* add up alignment for i-th component */
- tail += (4 - uimage_to_cpu (size[i]) % 4);
+ /* add up i-th component size, rounding up to 4 bytes */
+ offset += (uimage_to_cpu (size[i]) + 3) & ~3 ;
}
/* calculate idx-th component data address */
- *data = img_data + offset + tail;
+ *data = img_data + offset;
} else {
*len = 0;
*data = 0;
diff --git a/common/lists.c b/common/lists.c
index 3f117b5..0dc090a 100644
--- a/common/lists.c
+++ b/common/lists.c
@@ -2,8 +2,8 @@
#include <malloc.h>
#include <lists.h>
-#define MAX(a,b) (((a)>(b)) ? (a) : (b))
-#define MIN(a,b) (((a)<(b)) ? (a) : (b))
+#define MAX(a,b) (((a)>(b)) ? (a) : (b))
+#define MIN(a,b) (((a)<(b)) ? (a) : (b))
#define CAT4CHARS(a,b,c,d) ((a<<24) | (b<<16) | (c<<8) | d)
/* increase list size by 10% every time it is full */
diff --git a/common/main.c b/common/main.c
index 21e7afa..a17b60b 100644
--- a/common/main.c
+++ b/common/main.c
@@ -40,7 +40,7 @@
#include <post.h>
-#if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST)
+#if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) || defined(CONFIG_CMDLINE_EDITING)
DECLARE_GLOBAL_DATA_PTR;
#endif
@@ -67,11 +67,9 @@ static int abortboot(int);
char console_buffer[CFG_CBSIZE]; /* console I/O buffer */
-#ifndef CONFIG_CMDLINE_EDITING
static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen);
static char erase_seq[] = "\b \b"; /* erase sequence */
static char tab_seq[] = " "; /* used to expand TABs */
-#endif /* CONFIG_CMDLINE_EDITING */
#ifdef CONFIG_BOOT_RETRY_TIME
static uint64_t endtime = 0; /* must be set, default is instant timeout */
@@ -947,11 +945,26 @@ int readline_into_buffer (const char *const prompt, char * buffer)
initted = 1;
}
- puts (prompt);
- rc = cread_line(prompt, p, &len);
- return rc < 0 ? rc : len;
-#else
+ /*
+ * History uses a global array which is not
+ * writable until after relocation to RAM.
+ * Revert to non-history version if still
+ * running from flash.
+ */
+ if (gd->flags & GD_FLG_RELOC) {
+ if (!initted) {
+ hist_init();
+ initted = 1;
+ }
+
+ puts (prompt);
+
+ rc = cread_line(prompt, p, &len);
+ return rc < 0 ? rc : len;
+
+ } else {
+#endif /* CONFIG_CMDLINE_EDITING */
char * p_buf = p;
int n = 0; /* buffer index */
int plen = 0; /* prompt length */
@@ -1047,12 +1060,13 @@ int readline_into_buffer (const char *const prompt, char * buffer)
}
}
}
-#endif /* CONFIG_CMDLINE_EDITING */
+#ifdef CONFIG_CMDLINE_EDITING
+ }
+#endif
}
/****************************************************************************/
-#ifndef CONFIG_CMDLINE_EDITING
static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen)
{
char *s;
@@ -1082,7 +1096,6 @@ static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen)
(*np)--;
return (p);
}
-#endif /* CONFIG_CMDLINE_EDITING */
/****************************************************************************/
diff --git a/common/usb.c b/common/usb.c
index 4df01ea..52e8472 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -180,7 +180,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
setup_packet.value = swap_16(value);
setup_packet.index = swap_16(index);
setup_packet.length = swap_16(size);
- USB_PRINTF("usb_control_msg: request: 0x%X, requesttype: 0x%X\nvalue 0x%X index 0x%X length 0x%X\n",
+ USB_PRINTF("usb_control_msg: request: 0x%X, requesttype: 0x%X\nvalue 0x%X index 0x%X length 0x%X\n",
request,requesttype,value,index,size);
dev->status=USB_ST_NOT_PROC; /*not yet processed */
@@ -387,7 +387,7 @@ int usb_clear_halt(struct usb_device *dev, int pipe)
int usb_get_descriptor(struct usb_device *dev, unsigned char type, unsigned char index, void *buf, int size)
{
int res;
- res = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+ res = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
(type << 8) + index, 0,
buf, size, USB_CNTL_TIMEOUT);
@@ -399,7 +399,7 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type, unsigned char
*/
int usb_get_configuration_no(struct usb_device *dev,unsigned char *buffer,int cfgno)
{
- int result;
+ int result;
unsigned int tmp;
struct usb_config_descriptor *config;
@@ -1088,7 +1088,7 @@ int usb_hub_configure(struct usb_device *dev)
/* silence compiler warning if USB_BUFSIZ is > 256 [= sizeof(char)] */
i = descriptor->bLength;
if (i > USB_BUFSIZ) {
- USB_HUB_PRINTF("usb_hub_configure: failed to get hub descriptor - too long: %d\N",
+ USB_HUB_PRINTF("usb_hub_configure: failed to get hub descriptor - too long: %d\n",
descriptor->bLength);
return -1;
}
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 1703b23..11e861d 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -238,7 +238,7 @@ static void usb_kbd_setled(struct usb_device *dev)
leds|=1;
usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_SET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE,
- 0x200, iface->bInterfaceNumber,(void *)&leds, 1, 0);
+ 0x200, iface->bInterfaceNumber,(void *)&leds, 1, 0);
}
@@ -251,7 +251,7 @@ static int usb_kbd_translate(unsigned char scancode,unsigned char modifier,int p
if(pressed==0) {
/* key released */
- repeat_delay=0;
+ repeat_delay=0;
return 0;
}
if(pressed==2) {
diff --git a/common/virtex2.c b/common/virtex2.c
index 1283ff6..665a503 100644
--- a/common/virtex2.c
+++ b/common/virtex2.c
@@ -84,7 +84,7 @@
* an XC2V1000, if anyone can ever get ahold of one.
*/
#ifndef CFG_FPGA_WAIT_INIT
-#define CFG_FPGA_WAIT_INIT CFG_HZ/2 /* 500 ms */
+#define CFG_FPGA_WAIT_INIT CFG_HZ/2 /* 500 ms */
#endif
/*