Update of /cvsroot/blob/blob/src/blob
In directory usw-pr-cvs1:/tmp/cvs-serv17049/src/blob
Modified Files:
flash.c
Log Message:
Flash driver can use the new functions
Index: flash.c
===================================================================
RCS file: /cvsroot/blob/blob/src/blob/flash.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- flash.c 2001/10/15 21:52:09 1.4
+++ flash.c 2001/10/21 21:36:15 1.5
@@ -61,6 +61,9 @@
static flash_block_t flash_blocks[NEW_NUM_FLASH_BLOCKS];
static int num_flash_blocks;
+flash_descriptor_t *flash_descriptors;
+flash_driver_t *flash_driver;
+
/* initialise the flash blocks table */
@@ -70,6 +73,20 @@
int j;
u32 start = 0;
+#ifdef BLOB_DEBUG
+ if(flash_descriptors == NULL) {
+ printerrprefix();
+ SerialOutputString("undefined flash_descriptors\n");
+ return;
+ }
+
+ if(flash_driver == NULL) {
+ printerrprefix();
+ SerialOutputString("undefined flash_driver\n");
+ return;
+ }
+#endif
+
num_flash_blocks = 0;
while(flash_descriptors[i].size != 0) {
@@ -126,7 +143,7 @@
}
-__initlist(init_flash, INIT_LEVEL_OTHER_STUFF);
+__initlist(init_flash, INIT_LEVEL_OTHER_STUFF + 1);
int flash_erase_region(u32 *start, u32 nwords)
@@ -147,7 +164,7 @@
SerialOutputByte('\n');
#endif
/* dirty block */
- rv = erase_flash(cur);
+ rv = flash_driver->flash_erase(cur);
if(rv < 0) {
printerrprefix();
@@ -192,7 +209,7 @@
led_toggle();
}
- rv = write_flash(cur, src);
+ rv = flash_driver->flash_write(cur, src);
if(rv < 0) {
printerrprefix();
|