callback addr as u32 not a void ptr
[my-code/arm.git] / betty / flash.c
index 64488e2..5e1a593 100644 (file)
@@ -11,7 +11,7 @@
  * sector addresses
  */
 
-unsigned long sector_address[19]={
+unsigned long sector_address[20]={
        0x00000,0x02000,0x03000,0x04000,0x08000,
        0x10000,0x18000,
        0x20000,0x28000,
@@ -19,7 +19,8 @@ unsigned long sector_address[19]={
        0x40000,0x48000,
        0x50000,0x58000,
        0x60000,0x68000,
-       0x70000,0x78000
+       0x70000,0x78000,
+       0x80000                 // not a sector, end of flash!
 };
 
 /*
@@ -28,30 +29,8 @@ unsigned long sector_address[19]={
 
 void flash_init(void) {
 
-       /*
-        * idle clocks between rad & write: 0+1
-        * length of read access: 1+3
-        * bls lines high during write access
-        * length of write access: 0+1
-        * no write protect, no burst-rom
-        * 16 bit data width
-        */
-
-       BCFG0=0x10000420;       // flash 1
-       BCFG2=0x10000420;       // flash 2
-
-       /*
-        * p3.27: write enable
-        * p3.25: chip select 2
-        * p2.15 - p2.8: data bus
-        * a[1:15] -> address lines
-        */
-
-       PINSEL2=(PINSEL2&P2MASK)|(1<<8);
-       PINSEL2=(PINSEL2&P2MASK&~((1<<15)|(1<<14)))|(1<<14);
-       PINSEL2=(PINSEL2&P2MASK&~((1<<5)|(1<<4)))|(1<<4);
-       PINSEL2=(PINSEL2&P2MASK)|(1<<24);
-       PINSEL2=(PINSEL2&P2MASK&~((1<<27)|(1<<26)|(1<<25)))|(1<<27)|(1<<26);
+       flash_reset('0');
+       flash_reset('2');
 }
 
 void flash_reset(u8 bank) {