summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-10-15 18:23:43 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-10-15 18:23:43 +0200
commit84bd92bdda05e6aaae3150ed6ef957b3a67398b7 (patch)
treeea5e3abbeff7e3f8412a2e34645b9773f50578e8 /drivers
parent77ddac9480d63a80b6bb76d7ee4dcc2d1070867e (diff)
parent36247821ef77cc13d5f9fdbf7771564f9f8386bd (diff)
downloadu-boot-imx-84bd92bdda05e6aaae3150ed6ef957b3a67398b7.zip
u-boot-imx-84bd92bdda05e6aaae3150ed6ef957b3a67398b7.tar.gz
u-boot-imx-84bd92bdda05e6aaae3150ed6ef957b3a67398b7.tar.bz2
Merge with /home/m8/git/u-boot
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cfi_flash.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c
index d8dfb4c..113ce11 100644
--- a/drivers/cfi_flash.c
+++ b/drivers/cfi_flash.c
@@ -166,9 +166,15 @@ typedef union {
#define NUM_ERASE_REGIONS 4
+/* use CFG_MAX_FLASH_BANKS_DETECT if defined */
+#ifdef CFG_MAX_FLASH_BANKS_DETECT
+static ulong bank_base[CFG_MAX_FLASH_BANKS_DETECT] = CFG_FLASH_BANKS_LIST;
+flash_info_t flash_info[CFG_MAX_FLASH_BANKS_DETECT]; /* FLASH chips info */
+#else
static ulong bank_base[CFG_MAX_FLASH_BANKS] = CFG_FLASH_BANKS_LIST;
+flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* FLASH chips info */
+#endif
-flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
/*-----------------------------------------------------------------------
* Functions
@@ -184,7 +190,7 @@ static int flash_isequal (flash_info_t * info, flash_sect_t sect, uint offset, u
static int flash_isset (flash_info_t * info, flash_sect_t sect, uint offset, uchar cmd);
static int flash_toggle (flash_info_t * info, flash_sect_t sect, uint offset, uchar cmd);
static int flash_detect_cfi (flash_info_t * info);
-static ulong flash_get_size (ulong base, int banknum);
+ulong flash_get_size (ulong base, int banknum);
static int flash_write_cfiword (flash_info_t * info, ulong dest, cfiword_t cword);
static int flash_full_status_check (flash_info_t * info, flash_sect_t sector,
ulong tout, char *prompt);
@@ -371,7 +377,7 @@ unsigned long flash_init (void)
static flash_info_t *flash_get_info(ulong base)
{
int i;
- flash_info_t * info;
+ flash_info_t * info = 0;
for (i = 0; i < CFG_MAX_FLASH_BANKS; i ++) {
info = & flash_info[i];
@@ -1007,7 +1013,7 @@ static int flash_detect_cfi (flash_info_t * info)
* The following code cannot be run from FLASH!
*
*/
-static ulong flash_get_size (ulong base, int banknum)
+ulong flash_get_size (ulong base, int banknum)
{
flash_info_t *info = &flash_info[banknum];
int i, j;