<div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 3, 2020 at 7:21 PM Christian Mauderer <<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 02/02/2020 18:34, Vijay Kumar Banerjee wrote:<br>
> <br>
> <br>
> <br>
> On Sun, Feb 2, 2020 at 9:49 PM Christian Mauderer <<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a><br>
> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>>> wrote:<br>
> <br>
> <br>
> On 31/01/2020 17:43, Vijay Kumar Banerjee wrote:<br>
> ><br>
> ><br>
> > On Fri, Jan 31, 2020 at 9:59 PM Christian Mauderer<br>
> <<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>><br>
> > <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>>>> wrote:<br>
> ><br>
> > On 31/01/2020 17:25, Christian Mauderer wrote:<br>
> > > On 31/01/2020 16:04, Vijay Kumar Banerjee wrote:<br>
> > >> Hi,<br>
> > >><br>
> > >> While trying to run an rtems-littlevgl app on BBB, I found that<br>
> > the device<br>
> > >> tree generated from the freebsd source matching the freebsd-org<br>
> > >> HEAD commit doesn't work with the app and framebuffer<br>
> device fails<br>
> > >> to open. This is most likely due to the changes in the<br>
> freebsd dts<br>
> > >> sources because of which the overlay isn't working as expected.<br>
> > ><br>
> > > If I remember correctly, SD card doesn't work either with a FDT<br>
> > that is<br>
> > > too new.<br>
> > ><br>
> > >><br>
> > >> I haven't had a detailed look at what's missing and the<br>
> u-boot isn't<br>
> > >> reporting any error in applying the overlay either. I checked<br>
> > that the<br>
> > >> device tree built from freebsd tree matching the<br>
> following commit<br>
> > >> works:<br>
> > >> 19a6ceb89dbacf74697d493e48c388767126d418<br>
> > ><br>
> > > At the moment that's the right one. But that can change if<br>
> someone<br>
> > > updates libbsd again.<br>
> ><br>
> > And I have to correct myself: That is not the right one. The<br>
> current<br>
> > libbsd HEAD should work with<br>
> 6b0307a0a5184339393f555d5d424190d8a8277a.<br>
> ><br>
> > I meant to say that the framebuffer doesn't work with the current HEAD<br>
> > (6b0307).<br>
> > I checked with a previous commit, which is 19a6ce and found it<br>
> working.<br>
> > I should have been clear in the problem statement, sorry about that.<br>
> <br>
> Thats not good. But the correct way would be to find out what's wrong<br>
> and fix it. Did they add a fix in a future FreeBSD version?<br>
> <br>
> Most likely the overlay isn't working as expected. I'll have to have a<br>
> detailed<br>
> look to figure out what's going on there. <br>
> <br></blockquote><div>Hi!</div><div><br></div><div>I looked into it in more detail, the issue isn't with the overlay, I verified it</div><div>using u-boot fdt tool as well. Looks like the base dts file is producing a lot</div><div>of "target-module" and during startup, the driver probes are looping over</div><div>these target modules for the device tree values instead of looking at the</div><div>device node under the target module.</div><div><br></div><div>For example, in case of i2c the device tree looks like this:</div><div>```<br> target-module@b000 {<br> status = "okay";<br> compatible = "ti,sysc-omap2\0ti,sysc";<br> ....</div><div><br> i2c@0 {<br> rtems-pinctrl-0 = < 0x2e >;<br> rtems,i2c-path = "/dev/i2c-0";<br> compatible = "rtems,bsp-i2c\0ti,omap4-i2c";<br> .....<br></div><div>```</div><div><br></div><div>In the above snippet, the probe function expects the compat value to be</div><div>"rtems,bsp-i2c" but is getting "ti,sysc-omap2" from the target-module</div><div>and returning ENXIO. This is true for all the values, not just compat.</div><div><br></div><div>When I added all the required values of i2c into the target-module through</div><div>overlay, the iicbus worked. As you said in the thread, looks like i2c isn't the</div><div>only device that's affected looks like a lot of devices are failing because of</div><div>this dts issue. Here's a <a href="https://paste.ofcode.org/iDKusQxibBXCLMVJb6KG6q">dump</a> of start messages after applying the overlay</div><div>hack for i2c and lcd probe. (Note that this is an issue with the tda19988 as well,</div><div>because of which framebuffer isn't working) </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> > </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> > ><br>
> > >><br>
> > >> This brings up two questions:<br>
> > >> 1. Should we add the commit hash in the user manual so that the<br>
> > user can<br>
> > >> build<br>
> > >> from source matching that commits instead of HEAD. This<br>
> can be a<br>
> > >> problem <br>
> > >> as other codes ported from freebsd might break if the<br>
> device tree<br>
> > >> doesn't<br>
> > >> match the HEAD commit of freebsd-org<br>
> > ><br>
> > > Adding a fixed commit id isn't really a good idea either. It<br>
> is nearly<br>
> > > guaranteed that no one updates it if libbsd is updated. It<br>
> would be<br>
> > > better to add instructions how to find out which commit<br>
> should be<br>
> > used.<br>
> ><br>
> > The command would be:<br>
> ><br>
> > git ls-files -s freebsd-org<br>
> ><br>
> > It works regardless whether the sub-module is initialized or not.<br>
> ><br>
> > ><br>
> > >><br>
> > >> 2. How do we manage the device tree overlays required by<br>
> RTEMS or<br>
> > libbsd?<br>
> > >> I guess only BBB uses an overlay currently. Can we add<br>
> a BSD<br>
> > license to<br>
> > >> the overlay and add it somewhere in rtems or rtems-libbsd<br>
> > repository and<br>
> > >> maintain it?<br>
> > ><br>
> > > I think you wrote the overlay so you can add any license you<br>
> want. But<br>
> > > I'm really not sure where to put it. We currently don't have a<br>
> > location<br>
> > > for that. Do you have a good suggestion?<br>
> > ><br>
> ><br>
> > How about rtemsbsd/sys/dts/arm/overlays ?<br>
> > Following the freebsd tree freebsd/sys/dts/arm/overlays/<br>
> <br>
> Following the FreeBSD tree is a good point. But would they be visible<br>
> there? Beneath that: We currently don't have support for building the<br>
> overlays. Do you have an idea how that could look like?<br>
> <br>
> keeping it visible will be a problem. For building the overlay, we can<br>
> use dtc<br>
> and add a script to build the overlay. I see that rsb has a build<br>
> package for<br>
> devel/dtc.bset as well. <br>
<br>
Hm. Optimal would be an integration into waf. Something like "waf<br>
fdt-overlay". Even better would be if we could build the original fdt<br>
too. But I'm sure that both would be quite a bit tricky to integrate<br>
(the waf scripts in libbsd are not really easy to understand). So I'm<br>
not insisting on that.<br>
<br></blockquote><div>Sounds like it can become a good small project. Do we want a ticket</div><div>for this? </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> Best regards<br>
> <br>
> Christian<br>
> <br>
> ><br>
> > > Best regards<br>
> > ><br>
> > > Christian<br>
> > ><br>
> > >><br>
> > >> Best regards,<br>
> > >> Vijay><br>
> > >> _______________________________________________<br>
> > >> devel mailing list<br>
> > >> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a>><br>
> <mailto:<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a>>><br>
> > >> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
> > >><br>
> ><br>
> <br>
> <br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
> <br>
<br>
-- <br>
--------------------------------------------<br>
embedded brains GmbH<br>
Herr Christian Mauderer<br>
Dornierstr. 4<br>
D-82178 Puchheim<br>
Germany<br>
email: <a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
Phone: +49-89-18 94 741 - 18<br>
Fax: +49-89-18 94 741 - 08<br>
PGP: Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
</blockquote></div></div>
</div>