<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 27 Jul 2019 at 14:34, Christian Mauderer <<a href="mailto:list@c-mauderer.de">list@c-mauderer.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 24/07/2019 16:53, Nils Hölscher wrote:<br>
> Hi,<br>
> <br>
> @Vijay Kumar Banerjee <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank">vijaykumar9597@gmail.com</a>>  thanks for the<br>
> dtb file.<br>
> I build my file from FreeBSD master.<br>
> <br>
> Prcm attaches now but still after the pruss driver...:<br>
> "<br>
> nexus0: <RTEMS Nexus device><br>
> ofwbus0: <Open Firmware Device Tree> on nexus0<br>
> simplebus0: <Flattened device tree simple bus> on ofwbus0<br>
> *ti_pruss0: <TI Programmable Realtime Unit Subsystem> mem<br>
> 0x4a300000-0x4a37ffff irq 20,21,22,23,24,25,26,27 on simplebus0<br>
> ti_pruss0: could not enable PRUSS clock<br>
> device_attach: ti_pruss0 attach returned 6*<br>
> simplebus1: <Flattened device tree simple bus> on simplebus0*<br>
> am335x_prcm0: <AM335x Power and Clock Management> mem 0x200000-0x203fff<br>
> on simplebus1*<br>
<br>
Hello Nils,<br>
<br>
I'm not sure about the order. But what seems a little bit odd is that<br>
the prcm0 is found in simplebus0 while am335x_prcm0 is found on<br>
simplebus1. Maybe it's worth investigating how that order is created and<br>
how it is handled in RTEMS.</blockquote><div><br></div><div>Thanks for the information.</div><div>I think the way rtems initializes the bsd modules differs from the way described in the libbsd manuel.</div><div>But I will have to investigate that further.</div><div><br></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>
A general note regarding the prcm module: In RTEMS most (non-libbsd)<br>
drivers enable their power and clocks themself. Please make sure that<br>
the FreeBSD prcm doesn't interfere with that. Otherwise you might get<br>
odd effects.<br></blockquote><div>Thanks I will keep that in mind.</div><div><br></div><div>Best,</div><div>Nils <br></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>
> *====am335x_prcm_attach====*<br>
> "<br>
> <br>
> Is there anything else I can do besides using MODULE_DEPENDENCY, which I<br>
> already use.<br>
> The prcm module is also a EARLY_DRIVER_MODULE.<br>
> <br>
> Best,<br>
> Nils<br>
> <br>
> On Wed, 24 Jul 2019 at 16:04, Vijay Kumar Banerjee<br>
> <<a href="mailto:vijaykumar9597@gmail.com" target="_blank">vijaykumar9597@gmail.com</a> <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank">vijaykumar9597@gmail.com</a>>> wrote:<br>
> <br>
> <br>
> <br>
>     On Wed, Jul 24, 2019 at 7:03 PM Nils Hölscher <<a href="mailto:nilhoel1@gmail.com" target="_blank">nilhoel1@gmail.com</a><br>
>     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank">nilhoel1@gmail.com</a>>> wrote:<br>
> <br>
> <br>
> <br>
>         On Wed, 24 Jul 2019 at 15:14, Vijay Kumar Banerjee<br>
>         <<a href="mailto:vijaykumar9597@gmail.com" target="_blank">vijaykumar9597@gmail.com</a> <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank">vijaykumar9597@gmail.com</a>>> wrote:<br>
> <br>
> <br>
> <br>
> <br>
>             On Wed, Jul 24, 2019 at 6:36 PM Nils Hölscher<br>
>             <<a href="mailto:nilhoel1@gmail.com" target="_blank">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank">nilhoel1@gmail.com</a>>> wrote:<br>
> <br>
>                 Hi again,<br>
> <br>
>             Hi Nils <br>
> <br>
>                 I just decompiled my device tree and checked.<br>
>                 The probe code of the prcm driver is as follows:<br>
>                 "<br>
>                 static int<br>
>                 am335x_prcm_probe(device_t dev)<br>
>                 {<br>
>                     printk("am335x_prcm_probe\n");<br>
> <br>
>                     if (!ofw_bus_status_okay(dev)){<br>
>                         printk("ofw_bus_status_not_okay\n");<br>
>                         return (ENXIO);<br>
>                     }<br>
> <br>
>             Do you get the "ofw_bus_status_not_okay" print ? <br>
> <br>
>         Yes. But I also see the other print. except the success one. <br>
> <br>
>                     if (ofw_bus_is_compatible(dev, "ti,am3-prcm")) {<br>
>                         device_set_desc(dev, "AM335x Power and Clock<br>
>                 Management");<br>
>                         printk("PROBE SUCESSFULL\n");<br>
>                         return(BUS_PROBE_DEFAULT);<br>
>                     }<br>
>                     printk("ofw_bus incompatible\n");<br>
>                     return (ENXIO);<br>
>                 }<br>
>                 "<br>
>                 So it seems the prcm part in the device tree has to be<br>
>                 compatible to "ti,am3-prcm".<br>
>                 The thing is the decompiled device tree states just that:<br>
>                 "<br>
>                 prcm@0 {<br>
>                                         compatible =<br>
>                 "ti,am3-prcm\0simple-bus";<br>
> <br>
>             In my device tree, it runs successfully and the decompiled<br>
>             compatible looks like  :<br>
>             ```<br>
>                         prcm@200000 {<br>
>                             compatible = "ti,am3-prcm";<br>
>                             reg = < 0x200000 0x4000 >;<br>
>                             linux,phandle = < 0x4a >;<br>
>                             phandle = < 0x4a >;<br>
>             ```<br>
> <br>
>         OK, this is awkward, cause we both should have used the same<br>
>         sources.<br>
> <br>
>     Have you checked that your source is from the tree matching the<br>
>     libBSD HEAD<br>
>     commit? <br>
> <br>
>                                         reg = <0x00 0x2000>;<br>
>                                         #address-cells = <0x01>;<br>
>                                         #size-cells = <0x01>;<br>
>                                         ranges = <0x00 0x00 0x2000>;<br>
>                                         phandle = <0x5a>;<br>
>                 [...]<br>
>                 "<br>
>                 Any ideas would help, cause I am currently not able to<br>
>                 understand this behaviour.<br>
>                 Also without this driver even the dev_usb_bbb driver<br>
>                 shouldn't work.<br>
>                 However it attaches because it doesn't check for the<br>
>                 clocks error code.<br>
> <br>
>             I remember testing this a few days ago for my fb drivers and<br>
>             it was attaching alright,<br>
>             if I remember correctly. If changing the dtb doesn't work<br>
>             for you, I won't mind checking<br>
>             again, this will give me a hint for the display issue as well. <br>
> <br>
>         I will keep you updated on this.<br>
>         Would you be so kind and send me your compiled device tree? <br>
> <br>
>     Please find it attached in this mail. <br>
> <br>
>     Note: I have removed the devel from the cc because the attachment<br>
>     might be<br>
>     big for the list. Please continue the discussion in the mailing list<br>
>     and maybe note<br>
>     it somewhere that you already received the dtb from me in private mail.<br>
> <br>
>     Regards,<br>
>     Vijay<br>
> <br>
>                  <br>
> <br>
>                 Best,<br>
>                 Nils<br>
> <br>
> <br>
> <br>
>                 On Wed, 24 Jul 2019 at 14:43, Nils Hölscher<br>
>                 <<a href="mailto:nilhoel1@gmail.com" target="_blank">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank">nilhoel1@gmail.com</a>>> wrote:<br>
> <br>
>                     Hi,<br>
> <br>
>                     I just found out that the prcm driver fails to probe<br>
>                     on the simplebus and therefore cannot apply itself.<br>
>                     Seems like I am back to checking dtb.<br>
> <br>
>                     Best,<br>
>                     Nils<br>
> <br>
>                     On Tue, 23 Jul 2019 at 14:26, Nils Hölscher<br>
>                     <<a href="mailto:nilhoel1@gmail.com" target="_blank">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank">nilhoel1@gmail.com</a>>> wrote:<br>
> <br>
>                         Hi,<br>
> <br>
>                         After debugging with printk, didn't get the<br>
>                         module loading working as suggested by Sebastian.<br>
>                         I just found out that my PRU driver can't be<br>
>                         attached, cause the AM35xx clock driver isn't<br>
>                         loaded.<br>
>                         The driver can be found her:<br>
>                         <a href="https://github.com/RTEMS/rtems-libbsd/blob/610349693dd31d8b0efd33776516b7187cc5cda2/freebsd/sys/arm/ti/am335x/am335x_prcm.c" rel="noreferrer" target="_blank">https://github.com/RTEMS/rtems-libbsd/blob/610349693dd31d8b0efd33776516b7187cc5cda2/freebsd/sys/arm/ti/am335x/am335x_prcm.c</a><br>
> <br>
>                         Can anyone tell me how to load this driver and<br>
>                         obisouly before I initialize my BSD modules?<br>
> <br>
>                         FYI: The code line that fails is this one, cause<br>
>                         the driver hasn't been initialized.<br>
>                         <a href="https://github.com/RTEMS/rtems-libbsd/blob/610349693dd31d8b0efd33776516b7187cc5cda2/freebsd/sys/arm/ti/am335x/am335x_prcm.c#L854" rel="noreferrer" target="_blank">https://github.com/RTEMS/rtems-libbsd/blob/610349693dd31d8b0efd33776516b7187cc5cda2/freebsd/sys/arm/ti/am335x/am335x_prcm.c#L854</a><br>
> <br>
>                         Thanks,<br>
>                         Nils<br>
> <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>
>                 <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>
> 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>
</blockquote></div></div>