summaryrefslogtreecommitdiff
path: root/common/cmd_mem.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-12-06 23:55:10 +0000
committerwdenk <wdenk>2003-12-06 23:55:10 +0000
commit5779d8d985d95104ad74332f5fa3cb6c67645509 (patch)
treefe9c2bacd2e097b24c4968ae8e929bd28d74c167 /common/cmd_mem.c
parent8bf3b005ddee3eee179ec961e1c2bd0693e3b79d (diff)
* Patch by Nicolas Lacressonnière, 12 Nov 2003:
update for for Atmel AT91RM9200DK development kit: - support for environment variables in DataFlash - Atmel DataFlash AT45DB1282 support * Patch by Jeff Carr, 11 Nov 2003: add support for new version of 8270 processors * Patches by George G. Davis, 05 Nov 2003: - only pass the ARM linux initrd tag to the kernel when an initrd is actually present - update omap1510inn configuration file
Diffstat (limited to 'common/cmd_mem.c')
-rw-r--r--common/cmd_mem.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 391867814..35b3901d2 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -136,13 +136,19 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
uint *uip = (uint *)linebuf;
ushort *usp = (ushort *)linebuf;
u_char *ucp = (u_char *)linebuf;
-
+#ifdef CONFIG_HAS_DATAFLASH
+ int rc;
+#endif
printf("%08lx:", addr);
linebytes = (nbytes>DISP_LINE_LEN)?DISP_LINE_LEN:nbytes;
#ifdef CONFIG_HAS_DATAFLASH
- if (read_dataflash(addr, (linebytes/size)*size, linebuf) != -1){
-
+ if ((rc = read_dataflash(addr, (linebytes/size)*size, linebuf)) == DATAFLASH_OK){
+ /* if outside dataflash */
+ /*if (rc != 1) {
+ dataflash_perror (rc);
+ return (1);
+ }*/
for (i=0; i<linebytes; i+= size) {
if (size == 4) {
printf(" %08x", *uip++);
@@ -430,7 +436,12 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* Check if we are copying from DataFlash to RAM */
if (addr_dataflash(addr) && !addr_dataflash(dest) && (addr2info(dest)==NULL) ){
- read_dataflash(addr, count * size, (char *) dest);
+ int rc;
+ rc = read_dataflash(addr, count * size, (char *) dest);
+ if (rc != 1) {
+ dataflash_perror (rc);
+ return (1);
+ }
return 0;
}