Index: chipset_enable.c
===================================================================
--- chipset_enable.c	(revision 312)
+++ chipset_enable.c	(working copy)
@@ -680,8 +680,16 @@
 	flashbus = BUS_TYPE_SB600_SPI;
 
 	/* Enable SPI ROM in SB600 PM register. */
+	/* If we enable SPI ROM here, we have to disable it after we leave.
+	 * But how can we know which ROM we are going to handle? So we have
+	 * to trade off. We only access LPC ROM if we boot via LPC ROM. And
+	 * only SPI ROM if we boot via SPI ROM. If you want to do it crossly,
+	 * you have to use the code below.
+	 */
+	/*
 	OUTB(0x8f, 0xcd6);
 	OUTB(0x0e, 0xcd7);
+	*/
 
 	return 0;
 }
Index: sb600spi.c
===================================================================
--- sb600spi.c	(revision 312)
+++ sb600spi.c	(working copy)
@@ -44,13 +44,11 @@
 
 int sb600_spi_read(struct flashchip *flash, uint8_t *buf)
 {
-	int rc = 0, i;
+	int rc = 0;
 	int total_size = flash->total_size * 1024;
-	int page_size = 8;
 
-	for (i = 0; i < total_size / page_size; i++)
-		spi_nbyte_read(i * page_size, (void *)(buf + i * page_size),
-			       page_size);
+	memcpy(buf, (const char *)flash->virtual_memory, total_size);
+
 	return rc;
 }
 
@@ -68,17 +66,20 @@
 {
 	int rc = 0, i;
 	int total_size = flash->total_size * 1024;
+	uint8_t *bios;
 
 	/* Erase first */
 	printf("Erasing flash before programming... ");
 	flash->erase(flash);
 	printf("done.\n");
 
+	spi_disable_blockprotect();
 	printf("Programming flash");
-	for (i = 0; i < total_size; i++, buf++) {
-		spi_disable_blockprotect();
+	for (i = 0, bios = (uint8_t *)flash->virtual_memory;
+		i < total_size;
+		i++, buf++, bios++) {
 		spi_write_enable();
-		spi_byte_program(i, *buf);
+		*bios =  *buf;
 		/* wait program complete. */
 		if (i % 0x8000 == 0)
 			printf(".");
@@ -97,12 +98,18 @@
 		printf("reset\n");
 }
 
-void execute_command(void)
+int execute_command(void)
 {
+	int timeout = 1000;
+
 	sb600_spibar[2] |= 1;
 
-	while (sb600_spibar[2] & 1)
-		;
+	while ((sb600_spibar[2] & 1) && timeout)
+	{
+		myusec_delay(1);
+		timeout --;
+	}
+	return timeout ? 1 : 0;
 }
 
 int sb600_spi_command(unsigned int writecnt, unsigned int readcnt,
@@ -150,7 +157,8 @@
 	 */
 	reset_internal_fifo_pointer();
 
-	execute_command();
+	if (!execute_command())
+		return 1;
 
 	/*
 	 * After the command executed, we should find out the index of the
