You are right. There are many other drivers missing. There is a lot of code from TI that can be used as start point but I don't know how to include something in the seL4 tree. Another point is that although seL4 became open source, based in the philosophy from the code that has to be proofed, contributions from outside the community of original developers it's probably not much stimulated (what make sense).




On Wed, Aug 6, 2014 at 5:49 PM, Peter Chubb <peter.chubb@nicta.com.au> wrote:
>>>>> "Jorge" == Jorge Ventura <jorge.araujo.ventura@gmail.com> writes:

Jorge> I am trying to create a test for
Jorge> beaglebone using the seL4test suite but I am having the
Jorge> following error:

Jorge> seL4Test/libs/libplatsupport/src/plat/am335x/dm.c:56:25: error:
Jorge> ‘timer’ undeclared (first use in this function) dm_t *dm =
Jorge> (dm_t *) timer->data;

I don't think libplatsupport is finished for the Beaglebone.

Even if you fix this error (not too difficult) you'll run into other
issues =-- for instance the clock driver hasn't been finished.

Here's a patch that'll get the timer compiling -- it's untested.

diff --git a/src/plat/am335x/dm.c b/src/plat/am335x/dm.c
index f49779a..b0adbaa 100644
--- a/src/plat/am335x/dm.c
+++ b/src/plat/am335x/dm.c
@@ -8,6 +8,7 @@
  * @TAG(NICTA_BSD)
  */

+#include <utils/arith.h> /* BIT() */
 #include <platsupport/timer.h>
 #include <platsupport/plat/timer.h>
 #include <stdio.h>
@@ -53,30 +54,35 @@ typedef volatile struct dm {
 static int
 dm_stop_timer(const pstimer_t *device)
 {
-    dm_t *dm = (dm_t *) timer->data;
+    dm_t *dm = (dm_t *) device->data;
     /* Disable timer. */
     dm->tier = 0;
     dm->tclr = 0;
     dm->tisr = TISR_OVF_FLAG;
+    return 0;
 }

 static int
 dm_start_timer(const pstimer_t *device)
 {
     /* Do nothing */
+    return 0;
 }


 static int
-dm_periodic(uint64_t ns)
+dm_periodic(const pstimer_t *timer, uint64_t ns)
 {
+    dm_t *dm = (dm_t *)timer->data;
+
     /* Stop time. */
     dm->tclr = 0;

     /* Reset timer. */
     dm->cfg = TIOCP_CFG_SOFTRESET;

-    while (dm->cfg & TIOCP_CFG_SOFTRESET);
+    while (dm->cfg & TIOCP_CFG_SOFTRESET)
+        ;

     /* Enable interrupt on overflow. */
     dm->tier = TIER_OVERFLOWENABLE;
@@ -92,17 +98,19 @@ dm_periodic(uint64_t ns)

     /* Set autoreload and start the timer. */
     dm->tclr = TCLR_AUTORELOAD | TCLR_STARTTIMER;
+
+    return 0;
 }

 static int
-dm_oneshot_absolute(uint64_t ns)
+dm_oneshot_absolute(const pstimer_t *timer, uint64_t ns)
 {
     assert(!"Not implemented");
     return ENOSYS;
 }

 static int
-dm_oneshot_relative(uint64_t ns)
+dm_oneshot_relative(const pstimer_t *timer, uint64_t ns)
 {
     assert(!"Not implemented");
     return ENOSYS;
@@ -115,13 +123,13 @@ dm_get_time(const pstimer_t *timer) {
 }

 static void
-dm_handle_irq(const pstimer_t *timer) {
+dm_handle_irq(const pstimer_t *timer, uint32_t irq) {
     /* nothing */
 }

 static uint32_t
 dm_get_nth_irq(const pstimer_t *timer, uint32_t n) {
-    return DMTIMER2_INTTERRUPT;
+    return DMTIMER2_INTERRUPT;
 }

 static pstimer_t singleton_timer;
@@ -131,15 +139,15 @@ dm_get_timer(void *vaddr)
 {
     pstimer_t *timer = &singleton_timer;

-    timer->properties.upcounter = false;
+    timer->properties.upcounter = 0;
     timer->properties.timeouts = 1;
-    timer->properties.bitwidth = 32;
+    timer->properties.bit_width = 32;
     timer->properties.irqs = 1;

     /* data just points to the dm itself for now */
     timer->data = vaddr;
-    timer->start = dm_timer_start;
-    timer->stop = dm_timer_stop;
+    timer->start = dm_start_timer;
+    timer->stop = dm_stop_timer;
     timer->get_time = dm_get_time;
     timer->oneshot_absolute = dm_oneshot_absolute;
     timer->oneshot_relative = dm_oneshot_relative;