[U-Boot-Users] PATCH: MPC8220 update in flash.c
TsiChung Liew
Tsi-Chung.Liew at freescale.com
Fri May 11 03:59:30 CEST 2007
- Print out KB or MB in flash
Regards,
TsiChung Liew
Signed-off by: TsiChung Liew<Tsi-Chung.Liew at freescale.com>
diff -rupN u-boot-all.git/board/alaska/flash.c u-boot-all-8220-
flash/board/alaska/flash.c
--- u-boot-all.git/board/alaska/flash.c 2007-04-03 19:18:56.000000000
-0500
+++ u-boot-all-8220-flash/board/alaska/flash.c 2007-05-10
15:40:56.000000000 -0500
@@ -27,7 +27,6 @@
#include <common.h>
#include <linux/byteorder/swab.h>
-
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips
*/
/* Board support for 1 or 2 flash devices */
@@ -213,8 +212,12 @@ void flash_print_info (flash_info_t * in
break;
}
+ if (info->size > 0x100000)
printf (" Size: %ld MB in %d Sectors\n",
info->size >> 20, info->sector_count);
+ else
+ printf(" Size: %ld KB in %d Sectors\n",
+ info->size >> 10, info->sector_count);
printf (" Sector Start Addresses:");
for (i = 0; i < info->sector_count; ++i) {
@@ -308,7 +311,6 @@ static ulong flash_get_size (FPW * addr,
return (info->size);
}
-
/*
* This function gets the u-boot flash sector protection status
* (flash_info_t.protect[]) in sync with the sector protection
@@ -331,7 +333,6 @@ static void flash_sync_real_protect (fla
}
}
-
/*
* checks if "sector" in bank "info" is protected. Should work on intel
* strata flash chips 28FxxxJ3x in 8-bit mode.
@@ -384,7 +385,6 @@ static unsigned char intel_sector_protec
return ret;
}
-
/*
* Checks if "bank1" and "bank2" are on the same chip. Returns 1 if
they
* are and 0 otherwise.
@@ -400,7 +400,6 @@ static unsigned char same_chip_banks (in
return same_chip[bank1][bank2];
}
-
/*-----------------------------------------------------------------------
*/
int flash_erase (flash_info_t * info, int s_first, int s_last)
More information about the U-Boot
mailing list