integrator: fix Linux boot failure by emulating dbg region
PATCH v4 1/1 integrator: fix Linux boot failure by emulating dbg region
From: Alex Bennée <[email protected]>
Commit 9b8c69243 (since reverted) broke the ability to boot the kernel as the value returned by unassigned_mem_read returned non-zero and left the kernel looping forever waiting for it to change (see integrator_led_set in the kernel code).
Relying on a varying implementation detail is incorrect anyway so this introduces a basic stub of a memory region for the debug/LED section on the integrator board.
---
Changes for v4:
* Moved hw/arm/integrator_debug.c -> hw/misc/arm_integrator_debug.c
default-configs/arm-softmmu.mak | 1 + hw/arm/integratorcp.c | 2 + hw/misc/Makefile.objs | 1 + hw/misc/arm_integrator_debug.c | 103 +++++++++++++++++++++++++++++++++ include/hw/misc/arm_integrator_debug.h | 18 ++++++ 5 files changed, 125 insertions(+) create mode 100644 hw/misc/arm_integrator_debug.c create mode 100644 include/hw/misc/arm_integrator_debug.h
default-configs/arm-softmmu.mak +1 -0
@@ -79,3 +79,4 @@ CONFIG_VERSATILE_PCI=y CONFIG_VERSATILE_I2C=y CONFIG_SDHCI=y +CONFIG_INTEGRATOR_DEBUG=y
hw/arm/integratorcp.c +2 -0
@@ -11,6 +11,7 @@#include "hw/devices.h" #include "hw/boards.h" #include "hw/arm/arm.h" +#include "hw/misc/arm_integrator_debug.h" #include "net/net.h" #include "exec/address-spaces.h" #include "sysemu/sysemu.h"
@@ -508,6 +509,7 @@ static void integratorcp_init(QEMUMachineInitArgs *args)icp_control_init (0xcb000000 );sysbus_create_simple ("pl050_keyboard" ,0x18000000 , pic[3 ]);sysbus_create_simple ("pl050_mouse" ,0x19000000 , pic[4 ]); +sysbus_create_simple (TYPE_INTEGRATOR_DEBUG ,0x1a000000 ,0 );sysbus_create_varargs ("pl181" ,0x1c000000 , pic[23 ], pic[24 ],NULL );if (nd_table[0 ].used)smc91c111_init (&nd_table[0 ],0xc8000000 , pic[27 ]);
hw/misc/Makefile.objs +1 -0
@@ -10,6 +10,7 @@ obj-$(CONFIG_VMPORT) += vmport.o # ARM devices common-obj-$(CONFIG_PL310) += arm_l2x0.o +common-obj-$(CONFIG_INTEGRATOR_DEBUG) += arm_integrator_debug.o # PKUnity SoC devices common-obj-$(CONFIG_PUV3) += puv3_pm.o
hw/misc/arm_integrator_debug.c new file +103 -0
103 lines not on this page · raw message
include/hw/misc/arm_integrator_debug.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* ARM Integrator Board Debug, switch and LED section +* +* Browse the data sheet: +* +* http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0159b/Babbfijf.html +* +* Copyright (c) 2013 Alex Bennée <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ +#ifndef QEMU_INTEGRATOR_DEBUG_H +#define QEMU_INTEGRATOR_DEBUG_H + +#define TYPE_INTEGRATOR_DEBUG "integrator_debug" + +#endif
Signature · 1 line
1.8.4
hw/misc/arm_integrator_debug.c
Quoted 9 lines · On 22 October 2013 15:16, <[email protected]> wrote:
hw/misc/arm_integrator_debug.c new file +9
-0+typedef struct { +SysBusDevice parent_obj; + +MemoryRegion iomem; + +uint32_t alpha; +uint32_t leds; +uint32_t switches; +}IntegratorDebugState
You forgot to remove these unused fields. I've done so and added that slightly-edited patch to target-arm.next.
thanks
-- PMM
Quoted 13 lines · [email protected] writes:
hw/misc/arm_integrator_debug.c
Quoted 9 lines · On 22 October 2013 15:16, <[email protected]> wrote:
hw/misc/arm_integrator_debug.c new file +9
-0+typedef struct { +SysBusDevice parent_obj; + +MemoryRegion iomem; + +uint32_t alpha; +uint32_t leds; +uint32_t switches; +}IntegratorDebugState You forgot to remove these unused fields. I've done so and added that slightly-edited patch to target-arm.next.
Doh, sorry about that. Thanks.
Quoted 3 lines
thanks
-- PMM
Signature · 1 line
Alex Bennée