From: Max Filippov <jcmvbkbc@gmail.com>
To: qemu-devel@nongnu.org
Cc: Max Filippov <jcmvbkbc@gmail.com>
Subject: [Qemu-devel] [PATCH] hw/xtensa: add support for ML605 and KC705 FPGA board
Date: Sun, 2 Feb 2014 06:31:47 +0400 [thread overview]
Message-ID: <1391308307-8953-1-git-send-email-jcmvbkbc@gmail.com> (raw)
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
hw/xtensa/xtensa_lx60.c | 51 +++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 47 insertions(+), 4 deletions(-)
diff --git a/hw/xtensa/xtensa_lx60.c b/hw/xtensa/xtensa_lx60.c
index 22e124d..49c58d1 100644
--- a/hw/xtensa/xtensa_lx60.c
+++ b/hw/xtensa/xtensa_lx60.c
@@ -40,6 +40,7 @@
#include "xtensa_bootparam.h"
typedef struct LxBoardDesc {
+ hwaddr flash_base;
size_t flash_size;
size_t flash_sector_size;
size_t sram_size;
@@ -219,7 +220,7 @@ static void lx_init(const LxBoardDesc *board, QEMUMachineInitArgs *args)
dinfo = drive_get(IF_PFLASH, 0, 0);
if (dinfo) {
- flash = pflash_cfi01_register(0xf8000000,
+ flash = pflash_cfi01_register(board->flash_base,
NULL, "lx60.io.flash", board->flash_size,
dinfo->bdrv, board->flash_sector_size,
board->flash_size / board->flash_sector_size,
@@ -265,7 +266,9 @@ static void lx_init(const LxBoardDesc *board, QEMUMachineInitArgs *args)
MemoryRegion *flash_io = g_malloc(sizeof(*flash_io));
memory_region_init_alias(flash_io, NULL, "lx60.flash",
- flash_mr, 0, board->flash_size);
+ flash_mr, 0,
+ board->flash_size < 0x02000000 ?
+ board->flash_size : 0x02000000);
memory_region_add_subregion(system_memory, 0xfe000000,
flash_io);
}
@@ -275,7 +278,8 @@ static void lx_init(const LxBoardDesc *board, QEMUMachineInitArgs *args)
static void xtensa_lx60_init(QEMUMachineInitArgs *args)
{
static const LxBoardDesc lx60_board = {
- .flash_size = 0x400000,
+ .flash_base = 0xf8000000,
+ .flash_size = 0x00400000,
.flash_sector_size = 0x10000,
.sram_size = 0x20000,
};
@@ -285,13 +289,36 @@ static void xtensa_lx60_init(QEMUMachineInitArgs *args)
static void xtensa_lx200_init(QEMUMachineInitArgs *args)
{
static const LxBoardDesc lx200_board = {
- .flash_size = 0x1000000,
+ .flash_base = 0xf8000000,
+ .flash_size = 0x01000000,
.flash_sector_size = 0x20000,
.sram_size = 0x2000000,
};
lx_init(&lx200_board, args);
}
+static void xtensa_ml605_init(QEMUMachineInitArgs *args)
+{
+ static const LxBoardDesc ml605_board = {
+ .flash_base = 0xf8000000,
+ .flash_size = 0x02000000,
+ .flash_sector_size = 0x20000,
+ .sram_size = 0x2000000,
+ };
+ lx_init(&ml605_board, args);
+}
+
+static void xtensa_kc705_init(QEMUMachineInitArgs *args)
+{
+ static const LxBoardDesc kc705_board = {
+ .flash_base = 0xf0000000,
+ .flash_size = 0x08000000,
+ .flash_sector_size = 0x20000,
+ .sram_size = 0x2000000,
+ };
+ lx_init(&kc705_board, args);
+}
+
static QEMUMachine xtensa_lx60_machine = {
.name = "lx60",
.desc = "lx60 EVB (" XTENSA_DEFAULT_CPU_MODEL ")",
@@ -306,10 +333,26 @@ static QEMUMachine xtensa_lx200_machine = {
.max_cpus = 4,
};
+static QEMUMachine xtensa_ml605_machine = {
+ .name = "ml605",
+ .desc = "ml605 EVB (" XTENSA_DEFAULT_CPU_MODEL ")",
+ .init = xtensa_ml605_init,
+ .max_cpus = 4,
+};
+
+static QEMUMachine xtensa_kc705_machine = {
+ .name = "kc705",
+ .desc = "kc705 EVB (" XTENSA_DEFAULT_CPU_MODEL ")",
+ .init = xtensa_kc705_init,
+ .max_cpus = 4,
+};
+
static void xtensa_lx_machines_init(void)
{
qemu_register_machine(&xtensa_lx60_machine);
qemu_register_machine(&xtensa_lx200_machine);
+ qemu_register_machine(&xtensa_ml605_machine);
+ qemu_register_machine(&xtensa_kc705_machine);
}
machine_init(xtensa_lx_machines_init);
--
1.8.1.4
next reply other threads:[~2014-02-02 2:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-02 2:31 Max Filippov [this message]
2014-02-03 11:53 ` [Qemu-devel] [PATCH] hw/xtensa: add support for ML605 and KC705 FPGA board Andreas Färber
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=1391308307-8953-1-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).