Patchwork Fix reset bit for realview platform.

login
register
mail settings
Submitter Jean-Christophe DUBOIS
Date Nov. 4, 2011, 11:22 p.m.
Message ID <1320448956-14162-1-git-send-email-jcd@tribudubois.net>
Download mbox | patch
Permalink /patch/123716/
State New
Headers show

Comments

Jean-Christophe DUBOIS - Nov. 4, 2011, 11:22 p.m.
According to realview documentation [1], the bit used to reset the board
is bit 2 and not bit 8.

This is also in sync with Linux source code [2].

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0417d/BBACIGAD.html
[2] http://lxr.free-electrons.com/source/arch/arm/mach-realview/realview_pba8.c#L274

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
---
 hw/arm_sysctl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Peter Maydell - Nov. 4, 2011, 11:43 p.m.
On 4 November 2011 23:22, Jean-Christophe DUBOIS <jcd@tribudubois.net> wrote:
> According to realview documentation [1], the bit used to reset the board
> is bit 2 and not bit 8.

True for PBA8 and PBXA9, but not true for PB1176, PB926 (where it
is bit 8) or Emulation Baseboard (which doesn't implement this
register at all). You need to make this all into a switch() on
board_id() (combine this with the existing 'RAZ/WI on vexpress'
if()).

-- PMM

Patch

diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c
index 17cf6f7..aef271e 100644
--- a/hw/arm_sysctl.c
+++ b/hw/arm_sysctl.c
@@ -237,7 +237,7 @@  static void arm_sysctl_write(void *opaque, target_phys_addr_t offset,
         }
         if (s->lockval == LOCK_VALUE) {
             s->resetlevel = val;
-            if (val & 0x100)
+            if (val & 0x04)
                 qemu_system_reset_request ();
         }
         break;