diff options
| author | wdenk <wdenk> | 2003-07-16 21:53:01 +0000 | 
|---|---|---|
| committer | wdenk <wdenk> | 2003-07-16 21:53:01 +0000 | 
| commit | 945af8d723a29e9b6289d84250745ed0dc16fc81 (patch) | |
| tree | 6798d0b717c05b01742df0c410038c702b8a1979 /board/exbitgen/flash.c | |
| parent | cb4dbb7bbc271f988e14ec353a5e86d7f10e1da0 (diff) | |
| download | olio-uboot-2014.01-945af8d723a29e9b6289d84250745ed0dc16fc81.tar.xz olio-uboot-2014.01-945af8d723a29e9b6289d84250745ed0dc16fc81.zip | |
* Add support for IceCube board (with MGT5100 and MPC5200 CPUs)U-Boot-0_4_4
* Add support for MGT5100 and MPC5200 processors
Diffstat (limited to 'board/exbitgen/flash.c')
| -rw-r--r-- | board/exbitgen/flash.c | 24 | 
1 files changed, 12 insertions, 12 deletions
| diff --git a/board/exbitgen/flash.c b/board/exbitgen/flash.c index f687ea3a2..ae88994b2 100644 --- a/board/exbitgen/flash.c +++ b/board/exbitgen/flash.c @@ -217,7 +217,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)  	short i;  	FLASH_WORD_SIZE value;  	ulong base = (ulong)addr; -        volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)addr; +	volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)addr;  	/* Write auto select command: read Manufacturer ID */  	addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA; @@ -247,7 +247,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)  	switch (value) {  	case (FLASH_WORD_SIZE)AMD_ID_F040B: -	        info->flash_id += FLASH_AM040; +		info->flash_id += FLASH_AM040;  		info->sector_count = 8;  		info->size = 0x0080000; /* => 512 ko */  		break; @@ -335,14 +335,14 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)  	}  	/* set up sector start address table */ -        if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) || +	if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) ||  		(info->flash_id  == FLASH_AM040) ||  		(info->flash_id == FLASH_AMDLV033C) ||  		(info->flash_id == FLASH_AMDLV065D)) {  		ulong sectsize = info->size / info->sector_count;  		for (i = 0; i < info->sector_count; i++)  			info->start[i] = base + (i * sectsize); -        } else { +	} else {  	    if (info->flash_id & FLASH_BTYPE) {  		/* set sector offsets for bottom boot block type	*/  		info->start[0] = base + 0x00000000; @@ -370,9 +370,9 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)  		/* D0 = 1 if protected */  		addr2 = (volatile FLASH_WORD_SIZE *)(info->start[i]); -                if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) +		if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST)  			info->protect[i] = 0; -                else +		else  			info->protect[i] = addr2[2] & 1;  	} @@ -450,7 +450,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)  			while ((addr2[0] & 0x00800080) !=  				(FLASH_WORD_SIZE) 0x00800080) {  				if ((now=get_timer(start)) > -				           CFG_FLASH_ERASE_TOUT) { +					   CFG_FLASH_ERASE_TOUT) {  					printf ("Timeout\n");  					addr[0] = (FLASH_WORD_SIZE)0x00F000F0;  					return 1; @@ -551,12 +551,12 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)   */  static int write_word (flash_info_t *info, ulong dest, ulong data)  { -        volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]); -        volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest; -        volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data; +	volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]); +	volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest; +	volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data;  	ulong start;  	int flag; -        int i; +	int i;  	/* Check if Flash is (sufficiently) erased */  	if ((*((volatile ulong *)dest) & data) != data) { @@ -565,7 +565,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)  		return 2;  	} -        for (i=0; i < 4/sizeof(FLASH_WORD_SIZE); i++) { +	for (i=0; i < 4/sizeof(FLASH_WORD_SIZE); i++) {  		/* Disable interrupts which might cause a timeout here */  		flag = disable_interrupts(); |