[PULL,14/18] hw/arm/mps2: Add timers

Message ID 1500295494-8991-15-git-send-email-peter.maydell@linaro.org
State Accepted
Commit 3d53904a68ff0532a056e799d7bea6c625ade9ce
Headers show
Series
  • target-arm queue
Related show

Commit Message

Peter Maydell July 17, 2017, 12:44 p.m.
Add the CMSDK APB timers to the MPS2 board.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Message-id: 1500029487-14822-6-git-send-email-peter.maydell@linaro.org
---
 hw/arm/mps2.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.7.4

Patch hide | download patch | download mbox

diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index 9c8fa77..4121816 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -33,6 +33,7 @@ 
 #include "sysemu/sysemu.h"
 #include "hw/misc/unimp.h"
 #include "hw/char/cmsdk-apb-uart.h"
+#include "hw/timer/cmsdk-apb-timer.h"
 
 typedef enum MPS2FPGAType {
     FPGA_AN385,
@@ -293,6 +294,9 @@  static void mps2_common_init(MachineState *machine)
         g_assert_not_reached();
     }
 
+    cmsdk_apb_timer_create(0x40000000, qdev_get_gpio_in(armv7m, 8), SYSCLK_FRQ);
+    cmsdk_apb_timer_create(0x40001000, qdev_get_gpio_in(armv7m, 9), SYSCLK_FRQ);
+
     system_clock_scale = NANOSECONDS_PER_SECOND / SYSCLK_FRQ;
 
     armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename,