Commit f36ad4f1 authored by Ollie Lho's avatar Ollie Lho
Browse files

Remove unused code in pm49fl004, remove experimental delay in sst49lf040

Corresponding to flashrom svn r10 and coreboot v2 svn r1436.
parent 789ad3db
...@@ -31,34 +31,6 @@ ...@@ -31,34 +31,6 @@
#define RESET 0xFF #define RESET 0xFF
#define READ_ID 0x90 #define READ_ID 0x90
static __inline__ void protect_49fl004 (volatile char * bios)
{
/* ask compiler not to optimize this */
volatile unsigned char tmp;
tmp = *(volatile unsigned char *) (bios + 0x1823);
tmp = *(volatile unsigned char *) (bios + 0x1820);
tmp = *(volatile unsigned char *) (bios + 0x1822);
tmp = *(volatile unsigned char *) (bios + 0x0418);
tmp = *(volatile unsigned char *) (bios + 0x041B);
tmp = *(volatile unsigned char *) (bios + 0x0419);
tmp = *(volatile unsigned char *) (bios + 0x040A);
}
static __inline__ void unprotect_49fl004 (volatile char * bios)
{
/* ask compiler not to optimize this */
volatile unsigned char tmp;
tmp = *(volatile unsigned char *) (bios + 0x1823);
tmp = *(volatile unsigned char *) (bios + 0x1820);
tmp = *(volatile unsigned char *) (bios + 0x1822);
tmp = *(volatile unsigned char *) (bios + 0x0418);
tmp = *(volatile unsigned char *) (bios + 0x041B);
tmp = *(volatile unsigned char *) (bios + 0x0419);
tmp = *(volatile unsigned char *) (bios + 0x041A);
}
static __inline__ int erase_block_49fl004 ( volatile unsigned char * bios ,unsigned long address) static __inline__ int erase_block_49fl004 ( volatile unsigned char * bios ,unsigned long address)
{ {
volatile unsigned char *Temp; volatile unsigned char *Temp;
...@@ -188,8 +160,6 @@ int write_49fl004 (struct flashchip * flash, unsigned char * buf) ...@@ -188,8 +160,6 @@ int write_49fl004 (struct flashchip * flash, unsigned char * buf)
int total_size = flash->total_size * 1024, page_size = flash->page_size; int total_size = flash->total_size * 1024, page_size = flash->page_size;
volatile char * bios = flash->virt_addr; volatile char * bios = flash->virt_addr;
// unprotect_49fl004 (bios);
// erase_49fl004(flash);
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 */
...@@ -198,13 +168,11 @@ int write_49fl004 (struct flashchip * flash, unsigned char * buf) ...@@ -198,13 +168,11 @@ int write_49fl004 (struct flashchip * flash, unsigned char * buf)
/* write to the sector */ /* write to the sector */
printf ("%04d at address: 0x%08x", i, i * page_size); printf ("%04d at address: 0x%08x", i, i * page_size);
write_block_49fl004(bios, buf + i * page_size, bios + i * page_size, write_block_49fl004(bios, buf + i * page_size, bios + i * page_size,
page_size); page_size);
printf ("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); printf ("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
fflush(stdout); fflush(stdout);
} }
printf("\n"); printf("\n");
// protect_49fl004 (bios);
return(0); return(0);
} }
...@@ -61,11 +61,9 @@ static int erase_sector_49lf040 (volatile char * bios, unsigned int page) ...@@ -61,11 +61,9 @@ static int erase_sector_49lf040 (volatile char * bios, unsigned int page)
myusec_delay(10); myusec_delay(10);
Temp = bios + page; /* set up address to be the current sector */ Temp = bios + page; /* set up address to be the current sector */
*Temp = 0x30; /* write data 0x30 to the address */ *Temp = 0x30; /* write data 0x30 to the address */
myusec_delay(50000);
/* wait for Toggle bit ready */ /* wait for Toggle bit ready */
toggle_ready_jedec(bios); toggle_ready_jedec(bios);
myusec_delay(25000);
return(0); return(0);
} }
...@@ -97,8 +95,6 @@ static __inline__ int write_sector_49lf040(volatile char * bios, ...@@ -97,8 +95,6 @@ static __inline__ int write_sector_49lf040(volatile char * bios,
*Temp = 0xA0; *Temp = 0xA0;
*dst = *src; *dst = *src;
toggle_ready_jedec(bios); toggle_ready_jedec(bios);
data_polling_jedec(dst, *src);
if (*dst != *src) if (*dst != *src)
printf("BAD! dst 0x%lx val 0x%x src 0x%x\n", printf("BAD! dst 0x%lx val 0x%x src 0x%x\n",
(unsigned long)dst, *dst, *src); (unsigned long)dst, *dst, *src);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment