Code review for Raspberry Pi USB driver

Pavel Pisa ppisa4lists at pikron.com
Sat Jun 25 08:11:50 UTC 2016


Hello Deval Shah,

On Saturday 25 of June 2016 07:13:40 Deval Shah wrote:
> On Friday 24 June 2016, Pavel Pisa <ppisa4lists at pikron.com> wrote:
> > Hello Deval Shah and others,
> >
> > On Friday 24 of June 2016 10:45:34 Deval Shah wrote:
> > > Hello all,
> > >
> > > I have successfully ported the bcm283x_dwcotg driver for the Raspberry
> >
> > Pi.
> >
> > > Changes are shown in the commit >
> >
> > https://github.com/deval-maker/rtems-libbsd/commit/fd650f7ded413a0d891b53
> >95
> >
> > >abb0c8768d71acc7. I need feedback on the code.
> > >
> > > Also am getting error in mailbox functions (failed to set power state,
> > > err=-2). As far as I know Pavel and Mudit are looking into this
> > > problem.
> >
> > I
> >
> > > can not move to next part before solving this issue. Please let me know
> >
> > how
> >
> > > can I contribute if the problem is not already solved.
> >
> > I have pushes workaround patch to mainline to ensure that
> > your projects are not blocked by mailbox access problem.
> > So the problem should be solved for you.
> >
> > I am currently using latest mainline rtems kernel. And I am still getting
>
> this error. Any other possible reason?

Are you using RPi1 or RPi2?

check that next change is applied

c/src/lib/libbsp/arm/raspberrypi/misc/vc.c


@@ -58,11 +59,22 @@ bcm2835_mailbox_buffer_flush_and_invalidate(void *buf, size_t size)
 
   sctlr_val = arm_cp15_get_control();
 
+  RTEMS_COMPILER_MEMORY_BARRIER();
   arm_cp15_drain_write_buffer();
   if (sctlr_val & (ARM_CP15_CTRL_C | ARM_CP15_CTRL_M)) {
-    arm_cp15_drain_write_buffer();
+#if 0
+    /*
+    These architecture independent RTEMS API functions should be
+    used there but CPU_DATA_CACHE_ALIGNMENT is not defined
+    for ARM architecture version used on RPi and functions
+    are dummy for now and do not provide required synchronization
+    */
     rtems_cache_flush_multiple_data_lines(buf, size);
     rtems_cache_invalidate_multiple_data_lines(buf, size);
+#else
+    /* Flush complete data cache */
+    arm_cp15_data_cache_clean_and_invalidate();
+#endif
   }
 }

try to rebuild (and install) whole RTEMS build from scratch
to ensure that there is no stale object and report
result.

You can try to check call of VC firmware from bsp_start_hook_1
to check if it works at that phase.

See my debug hacks.

https://github.com/ppisa/rtems/blob/rtems-rpi-devel/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c#L112

Best wishes,

              Pavel





More information about the devel mailing list