diff options
| author | stroese <stroese> | 2003-12-09 14:54:43 +0000 | 
|---|---|---|
| committer | stroese <stroese> | 2003-12-09 14:54:43 +0000 | 
| commit | b828dda657dd26b5580c4a85e5680a5d16352a4c (patch) | |
| tree | 60eed193717770e0ac566e362c36d706d9a35301 /board/bubinga405ep/flash.c | |
| parent | 4e5ca3eb670460cd5ad9b07fa4aafc0dee6178be (diff) | |
| download | olio-uboot-2014.01-b828dda657dd26b5580c4a85e5680a5d16352a4c.tar.xz olio-uboot-2014.01-b828dda657dd26b5580c4a85e5680a5d16352a4c.zip  | |
BUBINGA405EP port fixed.
Diffstat (limited to 'board/bubinga405ep/flash.c')
| -rw-r--r-- | board/bubinga405ep/flash.c | 37 | 
1 files changed, 26 insertions, 11 deletions
diff --git a/board/bubinga405ep/flash.c b/board/bubinga405ep/flash.c index 6a9907c01..d4bd7eef7 100644 --- a/board/bubinga405ep/flash.c +++ b/board/bubinga405ep/flash.c @@ -101,6 +101,11 @@ unsigned long flash_init (void)  				FLASH_BASE0_PRELIM,  				FLASH_BASE0_PRELIM+CFG_MONITOR_LEN-1,  				&flash_info[0]); +	    /* Also protect sector containing initial power-up instruction */ +	    (void)flash_protect(FLAG_PROTECT_SET, +				0xFFFFFFFC, +				0xFFFFFFFF, +				&flash_info[0]);  	    size_b1 = 0 ;  	    flash_info[0].size = size_b0;  	  } @@ -143,6 +148,16 @@ unsigned long flash_init (void)  				base_b0+size_b0-CFG_MONITOR_LEN,  				base_b0+size_b0-1,  				&flash_info[0]); +	    /* Also protect sector containing initial power-up instruction */ +	    /* (flash_protect() checks address range - other call ignored) */ +	    (void)flash_protect(FLAG_PROTECT_SET, +				0xFFFFFFFC, +				0xFFFFFFFF, +				&flash_info[0]); +	    (void)flash_protect(FLAG_PROTECT_SET, +				0xFFFFFFFC, +				0xFFFFFFFF, +				&flash_info[1]);  	    if (size_b1) {  	      /* Re-do sizing to get full correct info */ @@ -493,18 +508,18 @@ int wait_for_DQ7(flash_info_t *info, int sect)  	volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[sect]);  	start = get_timer (0); -    last  = start; -    while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) { -	if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) { -	    printf ("Timeout\n"); -	    return -1; -	} -	/* show that we're waiting */ -	if ((now - last) > 1000) {  /* every second */ -	    putc ('.'); -	    last = now; +	last  = 0; +	while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) { +		if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) { +			printf ("Timeout\n"); +			return -1; +		} +		/* show that we're waiting */ +		if ((now - last) > 1000) {  /* every second */ +			putc ('.'); +			last = now; +		}  	} -    }  	return 0;  }  |