[PATCH 3/3] qemu-malta: add nor flash support

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Apr 30 08:00:07 EDT 2012


Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 arch/mips/boards/qemu-malta/init.c     |   13 +++++++++++++
 arch/mips/configs/qemu-malta_defconfig |    5 +++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/mips/boards/qemu-malta/init.c b/arch/mips/boards/qemu-malta/init.c
index 502b346..4709989 100644
--- a/arch/mips/boards/qemu-malta/init.c
+++ b/arch/mips/boards/qemu-malta/init.c
@@ -25,8 +25,21 @@
 #include <ns16550.h>
 #include <mach/hardware.h>
 #include <io.h>
+#include <partition.h>
+#include <sizes.h>
 #include <asm/common.h>
 
+static int malta_devices_init(void)
+{
+	add_cfi_flash_device(0, 0x1e000000, SZ_4M, 0);
+
+	devfs_add_partition("nor0", 0x0, SZ_512K, PARTITION_FIXED, "self");
+	devfs_add_partition("nor0", SZ_512K, SZ_64K, PARTITION_FIXED, "env0");
+
+	return 0;
+}
+device_initcall(malta_devices_init);
+
 static struct NS16550_plat serial_plat = {
 	.clock = 1843200, /* no matter for emulated port */
 	.shift = 0,
diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig
index eac21e7..50e0dc4 100644
--- a/arch/mips/configs/qemu-malta_defconfig
+++ b/arch/mips/configs/qemu-malta_defconfig
@@ -50,6 +50,11 @@ CONFIG_NET_TFTP_PUSH=y
 CONFIG_NET_NETCONSOLE=y
 CONFIG_NET_RESOLV=y
 # CONFIG_SPI is not set
+CONFIG_DRIVER_CFI=y
+# CONFIG_DRIVER_CFI_AMD is not set
+# CONFIG_DRIVER_CFI_BANK_WIDTH_1 is not set
+# CONFIG_DRIVER_CFI_BANK_WIDTH_2 is not set
+CONFIG_CFI_BUFFER_WRITE=y
 CONFIG_MTD=y
 CONFIG_FS_CRAMFS=y
 CONFIG_FS_FAT=y
-- 
1.7.9.1




More information about the barebox mailing list