remove pflash code

Also part of the cbfs support which is now obsolete.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/Makefile b/Makefile
index ee707a4..adbf1b3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 obj-y = code16.o entry.o main.o string.o printf.o cstart.o fw_cfg.o
-obj-y += linuxboot.o malloc.o pflash.o tables.o hwsetup.o pci.o code32seg.o
+obj-y += linuxboot.o malloc.o tables.o hwsetup.o pci.o code32seg.o
 obj-y += mptable.o
 
 all-y = bios.bin
diff --git a/include/pflash.h b/include/pflash.h
deleted file mode 100644
index 1dbbeae..0000000
--- a/include/pflash.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef BIOS_PFLASH_H
-#define BIOS_PFLASH_H 1
-
-#include <stdint.h>
-
-void *pflash_base(int n, size_t *size);
-
-#endif
diff --git a/main.c b/main.c
index 2f6fc78..ea67f3c 100644
--- a/main.c
+++ b/main.c
@@ -5,7 +5,6 @@
 #include "string.h"
 #include "segment.h"
 #include "fw_cfg.h"
-#include "pflash.h"
 #include "pci.h"
 #include "benchmark.h"
 
diff --git a/pflash.c b/pflash.c
deleted file mode 100644
index 950bc74..0000000
--- a/pflash.c
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <stddef.h>
-#include "bios.h"
-#include "pflash.h"
-#include "stdio.h"
-
-#define CLEAR_STATUS_CMD         0x50
-#define READ_STATUS_CMD          0x70
-#define QUERY_CMD                0x98
-#define READ_ARRAY_CMD           0xff
-
-static void *pflash_detect(uint8_t *top_addr)
-{
-	volatile uint8_t *p = top_addr;
-	uint8_t save;
-	int i, blocks, sector_len;
-
-	/* The low byte of the address is part of the command, so it must be 0.  */
-	if ((uintptr_t)p & 256)
-		panic();
-
-	p -= 256;
-	for (i = 0; i < 256; i++)
-		if (p[i] != CLEAR_STATUS_CMD)
-			break;
-	if (i == 256)
-		return NULL;
-
-	save = p[i];
-	p[i] = CLEAR_STATUS_CMD;
-	if (p[i] == CLEAR_STATUS_CMD) {
-		/* behaves as RAM */
-		p[i] = save;
-		return NULL;
-	}
-	p[i] = READ_STATUS_CMD;
-	if (p[i] != 0) {
-		/* doesn't behave as flash */
-		return NULL;
-	}
-
-	/* 0x2d-0x2e: blocks_per_device - 1, little endian */
-	/* 0x2f-0x30: sector_len / 256 */
-	p[i] = QUERY_CMD;
-	blocks = p[0x2d] + (p[0x2e] << 8) + 1;
-	sector_len = (p[0x2f] + (p[0x30] << 8)) << 8;
-
-	p[i] = READ_ARRAY_CMD;
-	return top_addr - blocks * sector_len;
-}
-
-void *pflash_base(int n, size_t *size)
-{
-	uint8_t *top = NULL;
-	uint8_t *prev;
-	while (n-- >= 0) {
-		prev = top;
-		top = pflash_detect(top);
-		if (!top)
-			return NULL;
-		*size = prev - top;
-	}
-	return top;
-}