diff options
| author | wdenk <wdenk> | 2004-01-02 14:00:00 +0000 | 
|---|---|---|
| committer | wdenk <wdenk> | 2004-01-02 14:00:00 +0000 | 
| commit | d4ca31c40e8888b36635967522ec7ea03fd7e70b (patch) | |
| tree | 126385a917df4665532dc33cff5fee2977e8fc0e /board/emk/top5200/flash.c | |
| parent | c18960049f8ea9b0a8ad0a05c93e23fbab025da0 (diff) | |
| download | olio-uboot-2014.01-d4ca31c40e8888b36635967522ec7ea03fd7e70b.tar.xz olio-uboot-2014.01-d4ca31c40e8888b36635967522ec7ea03fd7e70b.zip | |
* Cleanup lowboot code for MPC5200
* Minor code cleanup (coding style)
* Patch by Reinhard Meyer, 30 Dec 2003:
  - cpu/mpc5xxx/fec.c: added CONFIG_PHY_ADDR, added CONFIG_PHY_TYPE,
  - added CONFIG_PHY_ADDR to include/configs/IceCube.h,
  - turned debug print of PHY registers into a function (called in two places)
  - added support for EMK MPC5200 based modules
* Fix MPC8xx PLPRCR_MFD_SHIFT typo
* Add support for TQM866M modules
* Fixes for TQM855M with 4 MB flash (Am29DL163 = _no_ mirror bit flash)
* Fix a few compiler warnings
Diffstat (limited to 'board/emk/top5200/flash.c')
| -rw-r--r-- | board/emk/top5200/flash.c | 31 | 
1 files changed, 22 insertions, 9 deletions
| diff --git a/board/emk/top5200/flash.c b/board/emk/top5200/flash.c index b951b5f08..216bce3a8 100644 --- a/board/emk/top5200/flash.c +++ b/board/emk/top5200/flash.c @@ -2,6 +2,9 @@   * (C) Copyright 2003   * Wolfgang Denk, DENX Software Engineering, wd@denx.de.   * + * (C) Copyright 2003 + * Reinhard Meyer, EMK Elektronik GmbH, r.meyer@emk-elektronik.de + *   * See file CREDITS for list of people who contributed to this   * project.   * @@ -51,7 +54,7 @@ static flash_info_t *flash_get_info(ulong base);  unsigned long flash_init (void)  {  	unsigned long size = 0; -	int i; +	int i = 0;  	extern void flash_preinit(void);  	extern void flash_afterinit(uint, ulong, ulong);  	ulong flashbase = CFG_FLASH_BASE; @@ -59,10 +62,10 @@ unsigned long flash_init (void)  	flash_preinit();  	/* There is only ONE FLASH device */ -	memset(&flash_info[0], 0, sizeof(flash_info_t)); -	flash_info[0].size = -			flash_get_size((FPW *)flashbase, &flash_info[0]); -	size += flash_info[0].size; +	memset(&flash_info[i], 0, sizeof(flash_info_t)); +	flash_info[i].size = +			flash_get_size((FPW *)flashbase, &flash_info[i]); +	size += flash_info[i].size;  #if CFG_MONITOR_BASE >= CFG_FLASH_BASE  	/* monitor protection ON by default */ @@ -81,7 +84,7 @@ unsigned long flash_init (void)  #endif -	flash_afterinit(0, flash_info[0].start[0], flash_info[0].size); +	flash_afterinit(i, flash_info[i].start[0], flash_info[i].size);  	return size ? size : 1;  } @@ -151,7 +154,8 @@ void flash_print_info (flash_info_t *info)  	if (info->flash_id & FLASH_BTYPE) {  		boottype = botboottype;  		bootletter = botbootletter; -	} else { +	} +	else {  		boottype = topboottype;  		bootletter = topbootletter;  	} @@ -238,12 +242,17 @@ ulong flash_get_size (FPWV *addr, flash_info_t *info)  		info->flash_id += FLASH_AM160B;  		info->sector_count = 35;  		info->size = 0x00200000; +#ifdef CFG_LOWBOOT +		offset = 0; +#else  		offset = 0x00e00000; +#endif  		info->start[0] = (ulong)addr + offset;  		info->start[1] = (ulong)addr + offset + 0x4000;  		info->start[2] = (ulong)addr + offset + 0x6000;  		info->start[3] = (ulong)addr + offset + 0x8000; -		for (i = 4; i < info->sector_count; i++) { +		for (i = 4; i < info->sector_count; i++) +		{  			info->start[i] = (ulong)addr + offset + 0x10000 * (i-3);  		}  		break; @@ -252,8 +261,12 @@ ulong flash_get_size (FPWV *addr, flash_info_t *info)  		info->flash_id += FLASH_AMDLV065D;  		info->sector_count = 128;  		info->size = 0x00800000; +#ifdef CFG_LOWBOOT +		offset = 0; +#else  		offset = 0x00800000; -		for (i = 0; i < info->sector_count; i++) +#endif +		for( i = 0; i < info->sector_count; i++ )  			info->start[i] = (ulong)addr + offset + (i * 0x10000);  		break;				/* => 8 or 16 MB	*/ |