qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Julia Suvorova <jusual@mail.ru>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Stefan Hajnoczi" <stefanha@gmail.com>,
	"Joel Stanley" <joel@jms.id.au>,
	"Jim Mussared" <jim@groklearning.com>,
	"Steffen Görtz" <mail@steffen-goertz.de>,
	"Julia Suvorova" <jusual@mail.ru>
Subject: [Qemu-devel] [RFC 1/3] hw/arm/nrf51_soc: Fix compilation and memory regions
Date: Wed, 30 May 2018 01:03:36 +0300	[thread overview]
Message-ID: <20180529220338.10879-2-jusual@mail.ru> (raw)
In-Reply-To: <20180529220338.10879-1-jusual@mail.ru>

nRF51 SoC implementation is intended for the BBC Micro:bit board,
which has 256 KB flash and 16 KB RAM.
Added FICR defines.

Signed-off-by: Julia Suvorova <jusual@mail.ru>
---
 hw/arm/nrf51_soc.c         | 12 +++++++-----
 include/hw/arm/nrf51_soc.h |  1 +
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c
index e59ba7079f..6fe06dcfd2 100644
--- a/hw/arm/nrf51_soc.c
+++ b/hw/arm/nrf51_soc.c
@@ -26,15 +26,17 @@
 #define IOMEM_SIZE      0x20000000
 
 #define FLASH_BASE      0x00000000
-#define FLASH_SIZE      (144 * 1024)
+#define FLASH_SIZE      (256 * 1024)
+
+#define FICR_BASE       0x10000000
+#define FICR_SIZE       0x100
 
 #define SRAM_BASE       0x20000000
-#define SRAM_SIZE       (6 * 1024)
+#define SRAM_SIZE       (16 * 1024)
 
 static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
 {
     NRF51State *s = NRF51_SOC(dev_soc);
-    DeviceState *nvic;
     Error *err = NULL;
 
     /* IO space */
@@ -69,8 +71,8 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
     memory_region_add_subregion(system_memory, SRAM_BASE, sram);
 
     /* TODO: implement a cortex m0 and update this */
-    nvic = armv7m_init(get_system_memory(), FLASH_SIZE, 96,
-            s->kernel_filename, ARM_CPU_TYPE_NAME("cortex-m3"));
+    s->nvic = armv7m_init(get_system_memory(), FLASH_SIZE, 96,
+               s->kernel_filename, ARM_CPU_TYPE_NAME("cortex-m3"));
 }
 
 static Property nrf51_soc_properties[] = {
diff --git a/include/hw/arm/nrf51_soc.h b/include/hw/arm/nrf51_soc.h
index 5431d200f8..a6bbe9f108 100644
--- a/include/hw/arm/nrf51_soc.h
+++ b/include/hw/arm/nrf51_soc.h
@@ -23,6 +23,7 @@ typedef struct NRF51State {
 
     /*< public >*/
     char *kernel_filename;
+    DeviceState *nvic;
 
     MemoryRegion iomem;
 } NRF51State;
-- 
2.17.0

  reply	other threads:[~2018-05-29 22:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 22:03 [Qemu-devel] [RFC 0/3] nRF51 SoC: Add UART support Julia Suvorova
2018-05-29 22:03 ` Julia Suvorova [this message]
2018-05-31 10:30   ` [Qemu-devel] [RFC 1/3] hw/arm/nrf51_soc: Fix compilation and memory regions Peter Maydell
2018-05-29 22:03 ` [Qemu-devel] [RFC 2/3] hw/char/nrf51_uart: Implement nRF51 SoC UART Julia Suvorova
2018-05-31  9:42   ` Stefan Hajnoczi
2018-06-01 15:21     ` Julia Suvorova
2018-06-01 15:58       ` Peter Maydell
2018-06-02  8:15         ` Stefan Hajnoczi
2018-05-31 12:28   ` Peter Maydell
2018-05-31 13:58   ` sundeep subbaraya
2018-06-01 10:41     ` Stefan Hajnoczi
2018-06-01 10:44       ` Stefan Hajnoczi
2018-06-01 15:36         ` Julia Suvorova
2018-05-29 22:03 ` [Qemu-devel] [RFC 3/3] tests/boot-serial-test: Add support for the microbit board Julia Suvorova
2018-05-31  9:43   ` Stefan Hajnoczi
2018-05-30  2:57 ` [Qemu-devel] [RFC 0/3] nRF51 SoC: Add UART support Philippe Mathieu-Daudé
2018-05-31  9:44   ` Stefan Hajnoczi

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=20180529220338.10879-2-jusual@mail.ru \
    --to=jusual@mail.ru \
    --cc=jim@groklearning.com \
    --cc=joel@jms.id.au \
    --cc=mail@steffen-goertz.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).