From: Ulf Samuelsson <ulf@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] "24.noflash":(1 of 1) [PATCH] Remove unneccessary code, if parallel flash is not available.
Date: Tue, 27 Mar 2007 18:20:18 +0200 [thread overview]
Message-ID: <46094442.1080109@atmel.com> (raw)
Author: Ulf Samuelsson <ulf@atmel.com>
Date: 2007-03-27
Subject: "24.noflash":(1 of 1) [PATCH] Remove unneccessary code, if parallel flash is not available.
CHANGELOG:
[PATCH] Remove unneccessary code, if parallel flash is not available.
Patch generated from files:
common_cmd_flash.c.patch
common_cmd_mem.c.patch
Signed-off-by: Ulf Samuelsson
---------------------------------------------------------------------------------------------------------------------------------
diff -urN u-boot-1.2.0/common/cmd_flash.c u-boot-1.2.0-atmel/common/cmd_flash.c
--- u-boot-1.2.0/common/cmd_flash.c 2007-01-07 00:13:11.000000000 +0100
+++ u-boot-1.2.0-atmel/common/cmd_flash.c 2007-03-24 20:07:32.000000000 +0100
@@ -43,6 +43,7 @@
u8 *part_num, struct part_info **part);
#endif
+#ifndef CFG_NO_FLASH
extern flash_info_t flash_info[]; /* info for FLASH chips */
/*
@@ -277,6 +278,7 @@
return rcode;
}
+#endif /* CFG_NO_FLASH */
int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
@@ -285,7 +287,7 @@
#ifdef CONFIG_HAS_DATAFLASH
dataflash_print_info();
#endif
-
+#ifndef CFG_NO_FLASH
if (argc == 1) { /* print info for all FLASH banks */
for (bank=0; bank <CFG_MAX_FLASH_BANKS; ++bank) {
printf ("\nBank # %ld: ", bank+1);
@@ -303,11 +305,13 @@
}
printf ("\nBank # %ld: ", bank);
flash_print_info (&flash_info[bank-1]);
+#endif /* CFG_NO_FLASH */
return 0;
}
int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
+#ifndef CFG_NO_FLASH
flash_info_t *info;
ulong bank, addr_first, addr_last;
int n, sect_first, sect_last;
@@ -399,8 +403,13 @@
rcode = flash_sect_erase(addr_first, addr_last);
return rcode;
+#else
+ return 0;
+#endif /* CFG_NO_FLASH */
+
}
+#ifndef CFG_NO_FLASH
int flash_sect_erase (ulong addr_first, ulong addr_last)
{
flash_info_t *info;
@@ -441,12 +450,19 @@
}
return rcode;
}
+#endif /* CFG_NO_FLASH */
int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
+#ifndef CFG_NO_FLASH
flash_info_t *info;
ulong bank, addr_first, addr_last;
- int i, p, n, sect_first, sect_last;
+ int i, p, n, sect_first, sect_last;
+#else
+ ulong addr_first, addr_last;
+ int p;
+#endif
+
#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
struct mtd_device *dev;
struct part_info *part;
@@ -488,7 +504,7 @@
}
}
#endif
-
+#ifndef CFG_NO_FLASH
if (strcmp(argv[2], "all") == 0) {
for (bank=1; bank<=CFG_MAX_FLASH_BANKS; ++bank) {
info = &flash_info[bank-1];
@@ -613,10 +629,11 @@
return 1;
}
rcode = flash_sect_protect (p, addr_first, addr_last);
+#endif /* CFG_NO_FLASH */
return rcode;
}
-
+#ifndef CFG_NO_FLASH
int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
{
flash_info_t *info;
@@ -669,7 +686,7 @@
}
return rcode;
}
-
+#endif /* CFG_NO_FLASH */
/**************************************************/
#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
diff -urN u-boot-1.2.0/common/cmd_mem.c u-boot-1.2.0-atmel/common/cmd_mem.c
--- u-boot-1.2.0/common/cmd_mem.c 2007-01-07 00:13:11.000000000 +0100
+++ u-boot-1.2.0-atmel/common/cmd_mem.c 2007-03-24 20:07:32.000000000 +0100
@@ -498,7 +498,11 @@
}
/* Check if we are copying from DataFlash to RAM */
- if (addr_dataflash(addr) && !addr_dataflash(dest) && (addr2info(dest)==NULL) ){
+ if (addr_dataflash(addr) && !addr_dataflash(dest)
+#ifndef CFG_NO_FLASH
+ && (addr2info(dest)==NULL)
+#endif
+ ){
int rc;
rc = read_dataflash(addr, count * size, (char *) dest);
if (rc != 1) {
--
Best Regards,
Ulf Samuelsson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ulf.vcf
Type: text/x-vcard
Size: 301 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20070327/e0ce7139/attachment.vcf
next reply other threads:[~2007-03-27 16:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-27 16:20 Ulf Samuelsson [this message]
2007-03-27 16:42 ` [U-Boot-Users] "24.noflash":(1 of 1) [PATCH] Remove unneccessary code, if parallel flash is not available Wolfgang Denk
-- strict thread matches above, loose matches on Subject: below --
2007-03-27 18:10 Ulf Samuelsson
2007-03-27 20:15 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46094442.1080109@atmel.com \
--to=ulf@atmel.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.