Changes from NIKI

Corresponding to coreboot v1 svn r873.
diff --git a/mx29f002.c b/mx29f002.c
index 4ff98a0..4c22cd4 100644
--- a/mx29f002.c
+++ b/mx29f002.c
@@ -25,13 +25,15 @@
  * $Id$
  */
 
+#include <stdio.h>
 #include "flash.h"
 #include "jedec.h"
+#include "mx29f002.h"
 
 int probe_29f002 (struct flashchip * flash)
 {
 	volatile char * bios = flash->virt_addr;
-	unsigned char id1, id2, id3;
+	unsigned char id1, id2;
 
 	*(bios + 0x5555) = 0xAA;
 	*(bios + 0x2AAA) = 0x55;
@@ -55,7 +57,6 @@
 {
 	volatile char * bios = flash->virt_addr;
 
- again:
 	*(bios + 0x555) = 0xF0;
 	*(bios + 0x555) = 0xAA;
 	*(bios + 0x2AA) = 0x55;
@@ -80,14 +81,15 @@
 	*(bios + 0x3bfff) = 0x30;
 #endif
 
+	return(0);
 }
 
-int write_29f002 (struct flashchip * flash, char * buf)
+int write_29f002 (struct flashchip * flash, unsigned char * buf)
 {
     int i;
-    int total_size = flash->total_size * 1024, page_size = flash->page_size;
+    int total_size = flash->total_size * 1024;
     volatile char * bios = flash->virt_addr;
-    volatile char * dst = bios, * src = buf;
+    volatile char * dst = bios;
 
     *bios = 0xF0;
     myusec_delay(10);
@@ -98,7 +100,7 @@
     for (i = 0; i < total_size; i++) {
 	/* write to the sector */
 	if ((i & 0xfff) == 0)
-	    printf ("address: 0x%08lx", i);
+	    printf ("address: 0x%08lx", (unsigned long)i);
 	*(bios + 0x5555) = 0xAA;
 	*(bios + 0x2AAA) = 0x55;
 	*(bios + 0x5555) = 0xA0;
@@ -112,4 +114,6 @@
     }
 #endif
     printf("\n");
+
+    return(0);
 }