From: 402jagan@gmail.com
To: qemu-devel@nongnu.org
Cc: Jagan <402jagan@gmail.com>, peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH 1/2] vexpress: Add NOR0 Flash support
Date: Thu, 19 Jul 2012 00:33:39 +0530 [thread overview]
Message-ID: <1342638220-3600-2-git-send-email-402jagan@gmail.com> (raw)
In-Reply-To: <1342638220-3600-1-git-send-email-402jagan@gmail.com>
From: Jagan <402jagan@gmail.com>
This patch adds support for NOR0 flash (Bank #1) on
vexpress-a9 platform. It is 64MB CFI01 compliant flash.
Tested on stable u-boot version through Linux.
Signed-off-by: Jagan <402jagan@gmail.com>
---
hw/vexpress.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/hw/vexpress.c b/hw/vexpress.c
index 8072c5a..2e889a8 100644
--- a/hw/vexpress.c
+++ b/hw/vexpress.c
@@ -29,6 +29,11 @@
#include "sysemu.h"
#include "boards.h"
#include "exec-memory.h"
+#include "blockdev.h"
+#include "flash.h"
+
+#define VEXPRESS_FLASH_SIZE (64 * 1024 * 1024)
+#define VEXPRESS_FLASH_SECT_SIZE (256 * 1024)
#define VEXPRESS_BOARD_ID 0x8e0
@@ -355,6 +360,7 @@ static void vexpress_common_init(const VEDBoardInfo *daughterboard,
MemoryRegion *vram = g_new(MemoryRegion, 1);
MemoryRegion *sram = g_new(MemoryRegion, 1);
const target_phys_addr_t *map = daughterboard->motherboard_map;
+ DriveInfo *dinfo;
daughterboard->init(daughterboard, ram_size, cpu_model, pic, &proc_id);
@@ -405,7 +411,16 @@ static void vexpress_common_init(const VEDBoardInfo *daughterboard,
sysbus_create_simple("pl111", map[VE_CLCD], pic[14]);
- /* VE_NORFLASH0: not modelled */
+ /* VE_NORFLASH0: */
+ dinfo = drive_get(IF_PFLASH, 0, 0);
+ if (!pflash_cfi01_register(map[VE_NORFLASH0], NULL, "vexpress.flash0",
+ VEXPRESS_FLASH_SIZE, dinfo ? dinfo->bdrv : NULL,
+ VEXPRESS_FLASH_SECT_SIZE,
+ VEXPRESS_FLASH_SIZE / VEXPRESS_FLASH_SECT_SIZE,
+ 4, 0x0089, 0x0018, 0x0000, 0x0, 0)) {
+ fprintf(stderr, "qemu: Error registering flash0 memory.\n");
+ }
+
/* VE_NORFLASH0ALIAS: not modelled */
/* VE_NORFLASH1: not modelled */
--
1.7.0.4
next prev parent reply other threads:[~2012-07-18 19:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-18 19:03 [Qemu-devel] [PATCH 0/2] vexpress-a9: NOR flash support 402jagan
2012-07-18 19:03 ` 402jagan [this message]
2012-07-20 14:41 ` [Qemu-devel] [PATCH 1/2] vexpress: Add NOR0 Flash support Peter Maydell
2012-07-20 15:03 ` jagan
2012-07-18 19:03 ` [Qemu-devel] [PATCH 2/2] vexpress: Add NOR1 " 402jagan
2012-07-18 23:57 ` Peter Crosthwaite
2012-07-19 9:16 ` jagan
2012-07-19 18:49 ` Igor Mitsyanko
2012-07-20 1:28 ` Peter Crosthwaite
2012-07-20 13:30 ` jagan
2012-07-20 14:12 ` jagan
2012-07-20 14:19 ` Igor Mitsyanko
2012-07-20 14:56 ` jagan
2012-07-23 0:51 ` Peter Crosthwaite
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1342638220-3600-2-git-send-email-402jagan@gmail.com \
--to=402jagan@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).