From: Max Filippov <jcmvbkbc@gmail.com>
To: qemu-devel@nongnu.org
Cc: Max Filippov <jcmvbkbc@gmail.com>
Subject: [Qemu-devel] [PATCH 2/3] target-xtensa: xtfpga: attach FLASH to system IO
Date: Sun, 27 Sep 2015 20:16:53 +0300 [thread overview]
Message-ID: <1443374214-27149-3-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1443374214-27149-1-git-send-email-jcmvbkbc@gmail.com>
XTFPGA FLASH is tied to XTFPGA system IO block. It's not very important
for systems with MMU where system IO block is visible at single
location, but it's important for noMMU systems, where system IO block is
accessible through two separate physical address ranges.
Map XTFPGA FLASH to system IO block and fix offsets used for mapping.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
hw/xtensa/xtfpga.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index 72350f1..d4b9afb 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -247,16 +247,20 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
dinfo = drive_get(IF_PFLASH, 0, 0);
if (dinfo) {
- flash = pflash_cfi01_register(board->flash_base,
- NULL, "lx60.io.flash", board->flash_size,
- blk_by_legacy_dinfo(dinfo),
- board->flash_sector_size,
- board->flash_size / board->flash_sector_size,
- 4, 0x0000, 0x0000, 0x0000, 0x0000, be);
+ SysBusDevice *s;
+
+ flash = pflash_cfi01_init(NULL, "lx60.io.flash", board->flash_size,
+ blk_by_legacy_dinfo(dinfo),
+ board->flash_sector_size,
+ board->flash_size / board->flash_sector_size,
+ 4, 0x0000, 0x0000, 0x0000, 0x0000, be);
if (flash == NULL) {
error_report("unable to mount pflash");
exit(EXIT_FAILURE);
}
+ s = SYS_BUS_DEVICE(flash);
+ memory_region_add_subregion(system_io, board->flash_base,
+ sysbus_mmio_get_region(s, 0));
}
/* Use presence of kernel file name as 'boot from SRAM' switch. */
@@ -386,7 +390,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
static void xtensa_lx60_init(MachineState *machine)
{
static const LxBoardDesc lx60_board = {
- .flash_base = 0xf8000000,
+ .flash_base = 0x08000000,
.flash_size = 0x00400000,
.flash_sector_size = 0x10000,
.sram_size = 0x20000,
@@ -397,7 +401,7 @@ static void xtensa_lx60_init(MachineState *machine)
static void xtensa_lx200_init(MachineState *machine)
{
static const LxBoardDesc lx200_board = {
- .flash_base = 0xf8000000,
+ .flash_base = 0x08000000,
.flash_size = 0x01000000,
.flash_sector_size = 0x20000,
.sram_size = 0x2000000,
@@ -408,7 +412,7 @@ static void xtensa_lx200_init(MachineState *machine)
static void xtensa_ml605_init(MachineState *machine)
{
static const LxBoardDesc ml605_board = {
- .flash_base = 0xf8000000,
+ .flash_base = 0x08000000,
.flash_size = 0x01000000,
.flash_sector_size = 0x20000,
.sram_size = 0x2000000,
@@ -419,7 +423,7 @@ static void xtensa_ml605_init(MachineState *machine)
static void xtensa_kc705_init(MachineState *machine)
{
static const LxBoardDesc kc705_board = {
- .flash_base = 0xf0000000,
+ .flash_base = 0x00000000,
.flash_size = 0x08000000,
.flash_boot_base = 0x06000000,
.flash_sector_size = 0x20000,
--
1.8.1.4
next prev parent reply other threads:[~2015-09-27 17:17 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-27 17:16 [Qemu-devel] [PATCH 0/3] target-xtensa: xtfpga: support cores without MMU Max Filippov
2015-09-27 17:16 ` [Qemu-devel] [PATCH 1/3] pflash_cfi01: add pflash_cfi01_init Max Filippov
2015-09-27 17:25 ` Peter Crosthwaite
2015-09-27 17:51 ` Max Filippov
2015-09-27 18:32 ` Peter Crosthwaite
2015-09-27 18:43 ` Max Filippov
2015-09-27 17:16 ` Max Filippov [this message]
2015-09-27 17:42 ` [Qemu-devel] [PATCH 2/3] target-xtensa: xtfpga: attach FLASH to system IO Peter Crosthwaite
2015-09-27 18:01 ` Max Filippov
2015-09-27 18:36 ` Peter Crosthwaite
2015-09-27 17:16 ` [Qemu-devel] [PATCH 3/3] target-xtensa: xtfpga: support noMMU cores Max Filippov
2015-09-27 17:38 ` Peter Crosthwaite
2015-09-27 18:13 ` Max Filippov
2015-09-27 18:43 ` Peter Crosthwaite
2015-09-27 19:01 ` Max Filippov
2015-09-27 21:28 ` Peter Crosthwaite
2015-09-27 21:48 ` Max Filippov
2015-09-27 21:59 ` Peter Crosthwaite
2015-09-29 10:34 ` Max Filippov
2015-09-29 19:20 ` Peter Crosthwaite
2015-09-30 17:41 ` Max Filippov
2015-09-29 20:42 ` Peter Maydell
2015-09-30 20:17 ` Max Filippov
2015-09-30 20:45 ` Peter Maydell
2015-09-30 20:54 ` Max Filippov
2015-09-30 21:02 ` Peter Crosthwaite
2015-09-30 22:07 ` Max Filippov
2015-09-30 22:23 ` Peter Crosthwaite
2015-09-30 22:33 ` Peter Crosthwaite
2015-09-30 22:42 ` Max Filippov
2015-10-01 18:06 ` Peter Crosthwaite
2015-10-01 18:25 ` Max Filippov
2015-10-01 19:18 ` Peter Crosthwaite
2015-10-01 20:13 ` Max Filippov
2015-10-01 21:19 ` 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=1443374214-27149-3-git-send-email-jcmvbkbc@gmail.com \
--to=jcmvbkbc@gmail.com \
--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).