Skip to contentSkip to conversation

"24.noflash":(1 of 1) [PATCH] Remove unneccessary code, if parallel flash is not available.

U-Boot-Users NAK Ulf Samuelsson 2 participants 2 messages Mar 27, 2007

lore
Share & tools
lore
#0 lore raw

Author: Ulf Samuelsson <[email protected]>
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. Define CONFIG_NO_PARALLEL_FLASH if you do not have par flash on board

Patch generated from files:
common_cmd_flash.c.patch
common_cmd_mem.c.patch

Signed-off-by: Ulf Samuelsson
---------------------------------------------------------------------------------------------------------------------------------

common/cmd_flash.c +22 -5
diff -urN u-boot-1.2.0/common/cmd_flash.c u-boot-1.2.0-atmel/common/cmd_flash.c
@@ -43,6 +43,7 @@
 		u8 *part_num, struct part_info **part);
 #endif
 
+#ifndef CFG_NO_PARALLEL_FLASH
 extern flash_info_t flash_info[];	/* info for FLASH chips */
 
 /*
@@ -277,6 +278,7 @@
 
 	return rcode;
 }
+#endif /* CFG_NO_PARALLEL_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_PARALLEL_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_PARALLEL_FLASH */	
 	return 0;
 }
 
 int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
+#ifndef CFG_NO_PARALLEL_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_PARALLEL_FLASH */
+	
 }
 
+#ifndef CFG_NO_PARALLEL_FLASH
 int flash_sect_erase (ulong addr_first, ulong addr_last)
 {
 	flash_info_t *info;
@@ -441,12 +450,19 @@
 	}
 	return rcode;
 }
+#endif /* CFG_NO_PARALLEL_FLASH */
 
 int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
+#ifndef CFG_NO_PARALLEL_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_PARALLEL_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_PARALLEL_FLASH */
 	return rcode;
 }
 
-
+#ifndef CFG_NO_PARALLEL_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_PARALLEL_FLASH */
 
 /**************************************************/
 #if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
common/cmd_mem.c +5 -1
diff -urN u-boot-1.2.0/common/cmd_mem.c u-boot-1.2.0-atmel/common/cmd_mem.c
@@ -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_PARALLEL_FLASH
+	&& (addr2info(dest)==NULL)
+#endif
+	){
 		int rc;
 		rc = read_dataflash(addr, count * size, (char *) dest);
 		if (rc != 1) {
Signature · 10 lines
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/1bf03fbc/attachment.vcf 
#1 lore raw
Quoted 6 lines · In message <[email protected]> you wrote:

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. Define CONFIG_NO_PARALLEL_FLASH if you do not have par flash on board

NAK.

See my previous longish explanation what the term "flash" means in U-Boot, and shall mean, flash memory, and nothing else. Storage devices (like attached so some sort of serial interface), even when based on some form of flash technology, are not considered as memory. No attempt will be made to support these in the context of the memory or flash commands.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Disc space - the final frontier!