All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] integrator/cp: add support for REFCNT register
@ 2013-11-05 11:41 Jan Petrouš
  2013-11-05 13:54 ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Petrouš @ 2013-11-05 11:41 UTC (permalink / raw)
  To: qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 1111 bytes --]

Linux kernel from version 3.4 requires CM_REFCNT register for sched timer
for Integrator/CP board (integrator_defconfig).

See
http://infocenter.arm.com/help/topic/com.arm.doc.dui0138e/ch04s06s11.html

Signed-off-by: Jan Petrous <jan.petrous@tieto.com>
---
 hw/arm/integratorcp.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index c44b2a4..f419764 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -83,8 +83,11 @@ static uint64_t integratorcm_read(void *opaque, hwaddr
offset,
     case 9: /* CM_INIT */
         return s->cm_init;
     case 10: /* CM_REFCT */
-        /* ??? High frequency timer.  */
-        hw_error("integratorcm_read: CM_REFCT");
+       /* This register, CM_REFCNT, provides a 32-bit count value.
+ * The count increments at the fixed reference clock frequency of 24MHz
+ * and can be used as a real-time counter.
+ */
+       return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), 24, 1000);
     case 12: /* CM_FLAGS */
         return s->cm_flags;
     case 14: /* CM_NVFLAGS */
-- 
1.7.11.3

[-- Attachment #1.2: Type: text/html, Size: 1775 bytes --]

[-- Attachment #2: 0001-integrator-cp-add-support-for-REFCNT-register.patch --]
[-- Type: text/x-patch, Size: 1327 bytes --]

From a4f7f6220df71a7c7540a6722cc5f96c7d061e28 Mon Sep 17 00:00:00 2001
From: Jan Petrous <jan.petrous@tieto.com>
Date: Tue, 5 Nov 2013 12:13:57 +0100
Subject: [PATCH] integrator/cp: add support for REFCNT register

Linux kernel from version 3.4 requires CM_REFCNT register for sched timer
for Integrator/CP board (integrator_defconfig).

See http://infocenter.arm.com/help/topic/com.arm.doc.dui0138e/ch04s06s11.html

Signed-off-by: Jan Petrous <jan.petrous@tieto.com>
---
 hw/arm/integratorcp.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index c44b2a4..f419764 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -83,8 +83,11 @@ static uint64_t integratorcm_read(void *opaque, hwaddr offset,
     case 9: /* CM_INIT */
         return s->cm_init;
     case 10: /* CM_REFCT */
-        /* ??? High frequency timer.  */
-        hw_error("integratorcm_read: CM_REFCT");
+       /* This register, CM_REFCNT, provides a 32-bit count value.
+	* The count increments at the fixed reference clock frequency of 24MHz
+	* and can be used as a real-time counter.
+	*/
+       return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), 24, 1000);
     case 12: /* CM_FLAGS */
         return s->cm_flags;
     case 14: /* CM_NVFLAGS */
-- 
1.7.11.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-11-06 12:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-05 11:41 [Qemu-devel] [PATCH] integrator/cp: add support for REFCNT register Jan Petrouš
2013-11-05 13:54 ` Peter Maydell
2013-11-05 14:44   ` Jan Petrouš
2013-11-05 14:56     ` Peter Maydell
2013-11-05 16:18       ` [Qemu-devel] [PATCH] integrator/cp: add support for REFCNTregisterr Alex Bennée
2013-11-05 16:19         ` Peter Maydell
2013-11-06 12:13           ` Jan Petrouš

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.