make am29f040b driver more solid by printing every 4096th flash address.

This fixes the timing when flashing over a serial console.


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2204 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Stefan Reinauer 2006-03-16 16:46:19 +00:00
parent f3ecf106fa
commit 9b107715f9
1 changed files with 6 additions and 4 deletions

View File

@ -54,8 +54,9 @@ static __inline__ int write_sector_29f040b(volatile uint8_t *bios,
int i; int i;
for (i = 0; i < page_size; i++) { for (i = 0; i < page_size; i++) {
printf("0x%08lx", if( (i & 0xfff) == 0xfff )
(unsigned long) dst - (unsigned long) bios); printf("0x%08lx", (unsigned long) dst -
(unsigned long) bios);
*(bios + 0x555) = 0xAA; *(bios + 0x555) = 0xAA;
*(bios + 0x2AA) = 0x55; *(bios + 0x2AA) = 0x55;
@ -65,6 +66,7 @@ static __inline__ int write_sector_29f040b(volatile uint8_t *bios,
/* wait for Toggle bit ready */ /* wait for Toggle bit ready */
toggle_ready_jedec(bios); toggle_ready_jedec(bios);
if( (i & 0xfff) == 0xfff )
printf("\b\b\b\b\b\b\b\b\b\b"); printf("\b\b\b\b\b\b\b\b\b\b");
} }
@ -118,7 +120,7 @@ int write_29f040b(struct flashchip *flash, uint8_t *buf)
flash->page_size; flash->page_size;
volatile uint8_t *bios = flash->virt_addr; volatile uint8_t *bios = flash->virt_addr;
printf("Programming Page: "); printf("Programming page ");
for (i = 0; i < total_size / page_size; i++) { for (i = 0; i < total_size / page_size; i++) {
/* erase the page before programming */ /* erase the page before programming */
erase_sector_29f040b(bios, i * page_size); erase_sector_29f040b(bios, i * page_size);