qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: android-virt@lists.cs.columbia.edu, patches@linaro.org
Subject: [Qemu-devel] [PATCH 03/12] hw/arm_boot.c: Make SMP boards specify address to poll in bootup loop
Date: Fri, 13 Jan 2012 20:52:40 +0000	[thread overview]
Message-ID: <1326487969-12462-4-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1326487969-12462-1-git-send-email-peter.maydell@linaro.org>

From: Evgeny Voevodin <e.voevodin@samsung.com>

The secondary CPU bootloader in arm_boot.c holds secondary CPUs in a
pen until the primary CPU releases them. Make boards specify the
address to be polled to determine whether to leave the pen (it was
previously hardcoded to 0x10000030, which is a Versatile Express/
Realview specific system register address).

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm-misc.h |    1 +
 hw/arm_boot.c |   18 ++++++++++--------
 hw/realview.c |    2 ++
 hw/vexpress.c |    2 ++
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/hw/arm-misc.h b/hw/arm-misc.h
index af403a1..6e8ae6b 100644
--- a/hw/arm-misc.h
+++ b/hw/arm-misc.h
@@ -31,6 +31,7 @@ struct arm_boot_info {
     const char *initrd_filename;
     target_phys_addr_t loader_start;
     target_phys_addr_t smp_loader_start;
+    target_phys_addr_t smp_bootreg_addr;
     target_phys_addr_t smp_priv_base;
     int nb_cpus;
     int board_id;
diff --git a/hw/arm_boot.c b/hw/arm_boot.c
index 215d5de..bf509a8 100644
--- a/hw/arm_boot.c
+++ b/hw/arm_boot.c
@@ -31,17 +31,17 @@ static uint32_t bootloader[] = {
 /* Entry point for secondary CPUs.  Enable interrupt controller and
    Issue WFI until start address is written to system controller.  */
 static uint32_t smpboot[] = {
-  0xe59f0020, /* ldr     r0, privbase */
-  0xe3a01001, /* mov     r1, #1 */
-  0xe5801100, /* str     r1, [r0, #0x100] */
-  0xe3a00201, /* mov     r0, #0x10000000 */
-  0xe3800030, /* orr     r0, #0x30 */
+  0xe59f201c, /* ldr r2, privbase */
+  0xe59f001c, /* ldr r0, startaddr */
+  0xe3a01001, /* mov r1, #1 */
+  0xe5821100, /* str r1, [r2, #256] */
   0xe320f003, /* wfi */
   0xe5901000, /* ldr     r1, [r0] */
   0xe1110001, /* tst     r1, r1 */
   0x0afffffb, /* beq     <wfi> */
   0xe12fff11, /* bx      r1 */
-  0 /* privbase: Private memory region base address.  */
+  0,          /* privbase: Private memory region base address.  */
+  0           /* bootreg: Boot register address is held here */
 };
 
 #define WRITE_WORD(p, value) do { \
@@ -197,6 +197,7 @@ static void do_cpu_reset(void *opaque)
                                     info->loader_start);
                 }
             } else {
+                stl_phys_notdirty(info->smp_bootreg_addr, 0);
                 env->regs[15] = info->smp_loader_start;
             }
         }
@@ -272,8 +273,9 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
         rom_add_blob_fixed("bootloader", bootloader, sizeof(bootloader),
                            info->loader_start);
         if (info->nb_cpus > 1) {
-            smpboot[10] = info->smp_priv_base;
-            for (n = 0; n < sizeof(smpboot) / 4; n++) {
+            smpboot[ARRAY_SIZE(smpboot) - 1] = info->smp_bootreg_addr;
+            smpboot[ARRAY_SIZE(smpboot) - 2] = info->smp_priv_base;
+            for (n = 0; n < ARRAY_SIZE(smpboot); n++) {
                 smpboot[n] = tswap32(smpboot[n]);
             }
             rom_add_blob_fixed("smpboot", smpboot, sizeof(smpboot),
diff --git a/hw/realview.c b/hw/realview.c
index e52babc..d2fde44 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -21,6 +21,7 @@
 #include "exec-memory.h"
 
 #define SMP_BOOT_ADDR 0xe0000000
+#define SMP_BOOTREG_ADDR 0x10000030
 
 typedef struct {
     SysBusDevice busdev;
@@ -96,6 +97,7 @@ static void realview_register_devices(void)
 
 static struct arm_boot_info realview_binfo = {
     .smp_loader_start = SMP_BOOT_ADDR,
+    .smp_bootreg_addr = SMP_BOOTREG_ADDR,
 };
 
 /* The following two lists must be consistent.  */
diff --git a/hw/vexpress.c b/hw/vexpress.c
index 613be65..64fab45 100644
--- a/hw/vexpress.c
+++ b/hw/vexpress.c
@@ -31,11 +31,13 @@
 #include "exec-memory.h"
 
 #define SMP_BOOT_ADDR 0xe0000000
+#define SMP_BOOTREG_ADDR 0x10000030
 
 #define VEXPRESS_BOARD_ID 0x8e0
 
 static struct arm_boot_info vexpress_binfo = {
     .smp_loader_start = SMP_BOOT_ADDR,
+    .smp_bootreg_addr = SMP_BOOTREG_ADDR,
 };
 
 static void vexpress_a9_init(ram_addr_t ram_size,
-- 
1.7.1

  parent reply	other threads:[~2012-01-13 20:56 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 20:52 [Qemu-devel] [PATCH 00/12] Add support for Cortex-A15 and vexpress-a15 Peter Maydell
2012-01-13 20:52 ` [Qemu-devel] [PATCH 01/12] vexpress, realview: Add (dummy) L2 cache controller Peter Maydell
2012-01-13 20:52 ` [Qemu-devel] [PATCH 02/12] arm: make the number of GIC interrupts configurable Peter Maydell
2012-01-24  8:42   ` [Qemu-devel] [Android-virt] " Rusty Russell
2012-01-25 15:09     ` Peter Maydell
2012-01-27  0:33       ` Rusty Russell
2012-01-27  9:01         ` Peter Maydell
2012-02-19 23:06         ` [Qemu-devel] [PATCH 1/2] arm: clean up GIC constants Rusty Russell
2012-02-20 17:27           ` Peter Maydell
2012-02-21  2:33             ` Rusty Russell
2012-02-21 12:42               ` Peter Maydell
2012-02-19 23:07         ` [Qemu-devel] [PATCH] arm: make sure that number of irqs can be represented in GICD_TYPER Rusty Russell
2012-02-19 23:40           ` [Qemu-devel] [Android-virt] " Christoffer Dall
2012-02-20  3:52             ` Rusty Russell
2012-02-20  3:53             ` [Qemu-devel] [PATCH 3/2] " Rusty Russell
2012-02-21  2:33   ` [Qemu-devel] [PATCH 2/2] " Rusty Russell
2012-02-21 12:42     ` Peter Maydell
2012-01-13 20:52 ` Peter Maydell [this message]
2012-01-16  1:56   ` [Qemu-devel] [Android-virt] [PATCH 03/12] hw/arm_boot.c: Make SMP boards specify address to poll in bootup loop Alexander Graf
2012-01-16  8:31     ` Peter Maydell
2012-01-16 23:31       ` andrzej zaborowski
2012-01-16 23:41         ` Peter Maydell
2012-01-17  1:16   ` [Qemu-devel] " andrzej zaborowski
2012-01-13 20:52 ` [Qemu-devel] [PATCH 04/12] hw/vexpress.c: Make motherboard peripheral memory map table-driven Peter Maydell
2012-01-13 20:52 ` [Qemu-devel] [PATCH 05/12] hw/vexpress.c: Move secondary CPU boot code to SRAM Peter Maydell
2012-01-13 20:52 ` [Qemu-devel] [PATCH 06/12] hw/vexpress.c: Factor out daughterboard-specific initialization Peter Maydell
2012-01-13 20:52 ` [Qemu-devel] [PATCH 07/12] hw/vexpress.c: Instantiate the motherboard CLCD Peter Maydell
2012-01-13 20:52 ` [Qemu-devel] [PATCH 08/12] hw/a15mpcore.c: Add Cortex-A15 private peripheral model Peter Maydell
2012-01-13 20:52 ` [Qemu-devel] [PATCH 09/12] Add dummy implementation of generic timer cp15 registers Peter Maydell
2012-01-13 20:52 ` [Qemu-devel] [PATCH 10/12] Add Cortex-A15 CPU definition Peter Maydell
2012-01-23 18:12   ` [Qemu-devel] [Android-virt] " Peter Maydell
2012-01-24  7:59   ` [Qemu-devel] " Andreas Färber
2012-01-24  8:33     ` Peter Maydell
2012-01-13 20:52 ` [Qemu-devel] [PATCH 11/12] arm_boot: Pass base address of GIC CPU interface, not whole GIC Peter Maydell
2012-01-13 20:52 ` [Qemu-devel] [PATCH 12/12] hw/vexpress.c: Add vexpress-a15 machine Peter Maydell
2012-01-13 20:57 ` [Qemu-devel] [PATCH 00/12] Add support for Cortex-A15 and vexpress-a15 Peter Maydell
2012-01-15 22:56   ` [Qemu-devel] [Android-virt] " Christoffer Dall
2012-01-17 19:08     ` Peter Maydell
2012-01-27 10:28       ` Marc Zyngier

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=1326487969-12462-4-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=android-virt@lists.cs.columbia.edu \
    --cc=patches@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).