All of lore.kernel.org
 help / color / mirror / Atom feed
* [ARM:PATCH v2 1/1] Pass the timer clock-frequency to DOM0
@ 2014-03-27  3:54 Suriyan Ramasami
  2014-03-27 21:48 ` Julien Grall
  0 siblings, 1 reply; 12+ messages in thread
From: Suriyan Ramasami @ 2014-03-27  3:54 UTC (permalink / raw)
  To: xen-devel; +Cc: Suriyan Ramasami, julien.grall, ian.campbell

    xen/arm: Pass the timer "clock-frequency" to DOM0 in make_timer_node

    If the DT representing the ARM generic timer mentions a clock-frequency,
    propragate it to the DT that is built for DOM0.

    This is necessary as a workaround for boards (Odroid-XU) where CNTFRQ is
    not set or returns a wrong value.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>

---
Changed since v1:
    * Fix typo for quotes around clock-frequency.

---
 xen/arch/arm/domain_build.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index c9dda0e..645f9c6 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -622,6 +622,8 @@ static int make_timer_node(const struct domain *d, void *fdt,
     int res;
     const struct dt_irq *irq;
     gic_interrupt_t intrs[3];
+    u32 clock_frequency;
+    bool_t clock_valid;
 
     DPRINT("Create timer node\n");
 
@@ -639,6 +641,9 @@ static int make_timer_node(const struct domain *d, void *fdt,
         return -FDT_ERR_XEN(ENOENT);
     }
 
+    clock_valid = dt_property_read_u32(dev, "clock-frequency",
+                                       &clock_frequency);
+
     res = fdt_begin_node(fdt, "timer");
     if ( res )
         return res;
@@ -663,6 +668,13 @@ static int make_timer_node(const struct domain *d, void *fdt,
     if ( res )
         return res;
 
+    if ( clock_valid )
+    {
+        res = fdt_property_cell(fdt, "clock-frequency", clock_frequency);
+        if ( res )
+            return res;
+    }
+
     res = fdt_end_node(fdt);
 
     return res;
-- 
1.8.3.2

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

end of thread, other threads:[~2014-04-13 22:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-27  3:54 [ARM:PATCH v2 1/1] Pass the timer clock-frequency to DOM0 Suriyan Ramasami
2014-03-27 21:48 ` Julien Grall
2014-03-27 22:16   ` Suriyan Ramasami
2014-03-28 14:04     ` Julien Grall
2014-04-01 11:12       ` Ian Campbell
2014-04-11 16:05         ` Suriyan Ramasami
2014-04-11 16:32           ` Julien Grall
2014-04-13 19:28             ` Suriyan Ramasami
2014-04-13 20:20               ` Julien Grall
2014-04-13 20:48                 ` Suriyan Ramasami
2014-04-13 21:40                   ` Julien Grall
2014-04-13 22:55                     ` Suriyan Ramasami

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.