<div dir="auto">Hi Christian,<div dir="auto"><br></div><div dir="auto">I want to thank you again, since you actually helped me a lot with this problem.</div><div dir="auto">But I already patched this problem, didn't I.</div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div dir="auto">Nils</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Christian Mauderer <<a href="mailto:list@c-mauderer.de">list@c-mauderer.de</a>> schrieb am Fr., 9. Aug. 2019, 19:50:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Nils,<br>
<br>
great that you found your problem. It sounds like it is a general bug in<br>
libbsd. What did you change and do you have a patch that would fix this?<br>
<br>
Best regards<br>
<br>
Christian<br>
<br>
On 09/08/2019 15:42, Nils Hölscher wrote:<br>
> Hi,<br>
> <br>
> I was able to resolve the problem.<br>
> The reason that all the devices attached in the last pass and not in the<br>
> pass they were assigned, was the nexus bus being loaded as a standard<br>
> driver Module.<br>
> So the pass level of nexus bus was BUS_PASS_DEFAULT and all devices<br>
> depend on nexus bus.<br>
> Please see my Output attached.<br>
> The prints print the linkpass list and the link list and some other parts.<br>
> <br>
> At the bottom you can also see the pruss device in /dev.<br>
> <br>
> I will create a patch right away.<br>
> <br>
> Best,<br>
> Nils<br>
> <br>
> On Wed, 7 Aug 2019 at 11:35, Nils Hölscher <<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>> wrote:<br>
> <br>
>     Hi,<br>
> <br>
>     I was able to confirm that the current libBSD implementation scans<br>
>     the fdt only once.<br>
>     caller: <a href="https://github.com/RTEMS/rtems-libbsd/blob/f60ac53420f36060c13104f9a555f39ebc619b09/freebsd/sys/kern/subr_bus.c#L5100" rel="noreferrer noreferrer" target="_blank">https://github.com/RTEMS/rtems-libbsd/blob/f60ac53420f36060c13104f9a555f39ebc619b09/freebsd/sys/kern/subr_bus.c#L5100</a><br>
>     callee: <a href="https://github.com/RTEMS/rtems-libbsd/blob/f60ac53420f36060c13104f9a555f39ebc619b09/freebsd/sys/kern/subr_bus.c#L969" rel="noreferrer noreferrer" target="_blank">https://github.com/RTEMS/rtems-libbsd/blob/f60ac53420f36060c13104f9a555f39ebc619b09/freebsd/sys/kern/subr_bus.c#L969</a><br>
>     The function BUS_NEW_PASS initialises a pass over fdt with all<br>
>     drivers of the current pass level.<br>
> <br>
>     However after trying to add another pass, I realized that all<br>
>     drivers are on the DEFAULT_PASS_LEVEL (max_integer).<br>
> <br>
>     Best and thanks,<br>
>     Nils<br>
> <br>
>     On Thu, 1 Aug 2019 at 11:36, Christian Mauderer<br>
>     <<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank" rel="noreferrer">christian.mauderer@embedded-brains.de</a><br>
>     <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank" rel="noreferrer">christian.mauderer@embedded-brains.de</a>>> wrote:<br>
> <br>
>         Hello Nils,<br>
> <br>
>         On 31/07/2019 14:54, Nils Hölscher wrote:<br>
>         > Hi,<br>
>         ><br>
>         > I have been reading into the FreeBSD init code the past few days,<br>
>         > especially for Driver_MODULE.<br>
>         > Expect an Blog entry today or tomorrow.<br>
>         ><br>
>         > Because I don't have JTAG, it took me quite some time.<br>
> <br>
>         I would always suggest a JTAG or some other kind of debugger for<br>
>         embedded work. In a professional work environment you should try to<br>
>         convince your boss that it is a big time saver (which is<br>
>         definitively<br>
>         true) so that even an expensive debugger is a good investment<br>
> <br>
>         By the way: For understanding the initialization sequence you<br>
>         might can<br>
>         use a simulator too. For the basic sequence you can simulate any<br>
>         BSP and<br>
>         are not bound to BBB.<br>
> <br>
>         > With BUS_DEBUG enabled I saw that the problem is indeed that<br>
>         the pruss<br>
>         > unit is discovered too early.<br>
>         > Is this device tree related?<br>
> <br>
>         It's possible that this is a difference in how modules are<br>
>         handled. I'm<br>
>         not sure whether FreeBSD loads EARLY_MODULES dynamically at<br>
>         another time<br>
>         during boot while we link everything in from the start. If that<br>
>         is true,<br>
>         the mechanism might not work the same like in FreeBSD. You might<br>
>         want to<br>
>         have a look at that.<br>
> <br>
>         ><br>
>         > I am not sure, cause the overlay I am using is from the BSD<br>
>         community.<br>
>         ><br>
>         > I added my output to a gist and link to the interesting parts.<br>
>         > The EARLY_DRIVER_MODULE's are indeed loaded first.<br>
>         ><br>
>         <a href="https://gist.github.com/nilhoel1/dac4b9d6b1798b97846b24162ef227e4#file-bus_debug-output-log-L125" rel="noreferrer noreferrer" target="_blank">https://gist.github.com/nilhoel1/dac4b9d6b1798b97846b24162ef227e4#file-bus_debug-output-log-L125</a><br>
>         > Nexus bus attaches and the driver goes over every discovered<br>
>         device and<br>
>         > tries to attach the drivers in order:<br>
>         ><br>
>         <a href="https://gist.github.com/nilhoel1/dac4b9d6b1798b97846b24162ef227e4#file-bus_debug-output-log-L326" rel="noreferrer noreferrer" target="_blank">https://gist.github.com/nilhoel1/dac4b9d6b1798b97846b24162ef227e4#file-bus_debug-output-log-L326</a><br>
>         > ofwbus gets discovered:<br>
>         ><br>
>         <a href="https://gist.github.com/nilhoel1/dac4b9d6b1798b97846b24162ef227e4#file-bus_debug-output-log-L747" rel="noreferrer noreferrer" target="_blank">https://gist.github.com/nilhoel1/dac4b9d6b1798b97846b24162ef227e4#file-bus_debug-output-log-L747</a><br>
>         > Here the ti_pruss device gets discovered too early in the fdt<br>
>         and fails:<br>
>         ><br>
>         <a href="https://gist.github.com/nilhoel1/dac4b9d6b1798b97846b24162ef227e4#file-bus_debug-output-log-L904" rel="noreferrer noreferrer" target="_blank">https://gist.github.com/nilhoel1/dac4b9d6b1798b97846b24162ef227e4#file-bus_debug-output-log-L904</a><br>
>         ><br>
>         > I still haven't found the loop running over fdt.<br>
> <br>
>         Don't have a test environment ready so this is just from a quick<br>
>         glance<br>
>         at the code. I might have missed something:<br>
> <br>
>         simplebus_attach adds all child nodes from the tree to the bus:<br>
> <br>
>         <a href="https://git.rtems.org/rtems-libbsd/tree/freebsd/sys/dev/fdt/simplebus.c#n157" rel="noreferrer noreferrer" target="_blank">https://git.rtems.org/rtems-libbsd/tree/freebsd/sys/dev/fdt/simplebus.c#n157</a><br>
> <br>
>         The bus_generic_attach then loops over all children and calls their<br>
>         probe and attach functions:<br>
> <br>
>         <a href="https://git.rtems.org/rtems-libbsd/tree/freebsd/sys/kern/subr_bus.c#n3768" rel="noreferrer noreferrer" target="_blank">https://git.rtems.org/rtems-libbsd/tree/freebsd/sys/kern/subr_bus.c#n3768</a><br>
> <br>
>         Best regards<br>
> <br>
>         Christian<br>
> <br>
>         > And it seems that the device tree only gets one iteration.<br>
>         > But the BSD man page for EARLY_DRIVER_MODULE states that every<br>
>         > PASS_LEVEL has an iteration.<br>
>         > " <br>
>         ><br>
>         >      The *EARLY*_*DRIVER*_*MODULE*() macro allows a driver to<br>
>         be registered for a<br>
>         >      specific pass level.  The boot time probe and attach<br>
>         process makes       *_multi- _ _ple passes over the device<br>
>         tree_*.  Certain critical        drivers that provide<br>
>         >      basic services needed by other devices are       attach<br>
>         during earlier passes.<br>
>         >      Most drivers are attached in a final general pass.       <br>
>         A driver that<br>
>         >      attaches during an       early pass must register for a<br>
>         specific pass level<br>
>         >      (BUS_PASS_*) via the /pass/ argument.  Once a driver   <br>
>          is registered it is<br>
>         >      available to attach to devices for       all subsequent<br>
>         passes."<br>
>         ><br>
>         ><br>
>         <a href="https://www.freebsd.org/cgi/man.cgi?query=DRIVER_MODULE&sektion=9&apropos=0&manpath=FreeBSD+12.0-RELEASE+and+Ports" rel="noreferrer noreferrer" target="_blank">https://www.freebsd.org/cgi/man.cgi?query=DRIVER_MODULE&sektion=9&apropos=0&manpath=FreeBSD+12.0-RELEASE+and+Ports</a><br>
>         ><br>
>         > Best,<br>
>         > Nils<br>
>         ><br>
>         ><br>
>         > On Sun, 28 Jul 2019 at 11:34, Christian Mauderer<br>
>         <<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a>><br>
>         > <mailto:<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a>>>> wrote:<br>
>         ><br>
>         >     On 28/07/2019 11:22, Nils Hölscher wrote:<br>
>         >     ><br>
>         >     ><br>
>         >     > On Sat, 27 Jul 2019 at 14:34, Christian Mauderer<br>
>         >     <<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a>><br>
>         <mailto:<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a>>><br>
>         >     > <mailto:<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a>><br>
>         <mailto:<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank" rel="noreferrer">list@c-mauderer.de</a>>>>> wrote:<br>
>         >     ><br>
>         >     >     On 24/07/2019 16:53, Nils Hölscher wrote:<br>
>         >     >     > Hi,<br>
>         >     >     ><br>
>         >     >     > @Vijay Kumar Banerjee<br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a> <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>><br>
>         >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>>><br>
>         >     >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>><br>
>         >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">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<br>
>         ofwbus0<br>
>         >     >     > *ti_pruss0: <TI Programmable Realtime Unit<br>
>         Subsystem> mem<br>
>         >     >     > 0x4a300000-0x4a37ffff irq 20,21,22,23,24,25,26,27<br>
>         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<br>
>         simplebus0*<br>
>         >     >     > am335x_prcm0: <AM335x Power and Clock Management> mem<br>
>         >     >     0x200000-0x203fff<br>
>         >     >     > on simplebus1*<br>
>         >     ><br>
>         >     >     Hello Nils,<br>
>         >     ><br>
>         >     >     I'm not sure about the order. But what seems a<br>
>         little bit odd<br>
>         >     is that<br>
>         >     >     the prcm0 is found in simplebus0 while am335x_prcm0<br>
>         is found on<br>
>         >     >     simplebus1. Maybe it's worth investigating how that<br>
>         order is<br>
>         >     created and<br>
>         >     >     how it is handled in RTEMS.<br>
>         >     ><br>
>         >     ><br>
>         >     > Thanks for the information.<br>
>         >     > I think the way rtems initializes the bsd modules<br>
>         differs from the way<br>
>         >     > described in the libbsd manuel.<br>
>         >     > But I will have to investigate that further.<br>
>         >     ><br>
>         >     >      <br>
>         ><br>
>         >     I'm not 100% sure but as far as I know the _modules_ should be<br>
>         >     initialized in the given order (early module prior to<br>
>         normal module).<br>
>         >     But the device detection is something different. I think<br>
>         there is some<br>
>         >     loop in simplebus that loops over the devices and asks<br>
>         every driver<br>
>         >     whether it wants to handle that device. If yes the driver<br>
>         can have it.<br>
>         >     If no the device is unhandled.<br>
>         ><br>
>         >     For a module that is mentioned in the device tree I would<br>
>         expect that<br>
>         >     the order in the device tree binary is the one used. For<br>
>         devices outside<br>
>         >     of the device tree most likely some link order is used.<br>
>         ><br>
>         >     If you have a debugger you might want to search for the<br>
>         loops and take a<br>
>         >     look at when they are called and how they add devices. I<br>
>         don't think<br>
>         >     that there are that many early modules yet that would use<br>
>         the device<br>
>         >     tree. So it's possible that there is some call missing<br>
>         that would parse<br>
>         >     the device tree for early modules.<br>
>         ><br>
>         >     ><br>
>         >     ><br>
>         >     >     A general note regarding the prcm module: In RTEMS most<br>
>         >     (non-libbsd)<br>
>         >     >     drivers enable their power and clocks themself.<br>
>         Please make<br>
>         >     sure that<br>
>         >     >     the FreeBSD prcm doesn't interfere with that.<br>
>         Otherwise you<br>
>         >     might get<br>
>         >     >     odd effects.<br>
>         >     ><br>
>         >     > Thanks I will keep that in mind.<br>
>         >     ><br>
>         >     > Best,<br>
>         >     > Nils <br>
>         >     ><br>
>         >     ><br>
>         >     >     Best regards<br>
>         >     ><br>
>         >     >     Christian<br>
>         >     ><br>
>         >     >     > *====am335x_prcm_attach====*<br>
>         >     >     > "<br>
>         >     >     ><br>
>         >     >     > Is there anything else I can do besides using<br>
>         MODULE_DEPENDENCY,<br>
>         >     >     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" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a> <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>>><br>
>         >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a> <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>>>><br>
>         >     >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>><br>
>         >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>>><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a> <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>><br>
>         >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>>>>>><br>
>         >     >     wrote:<br>
>         >     >     ><br>
>         >     >     ><br>
>         >     >     ><br>
>         >     >     >     On Wed, Jul 24, 2019 at 7:03 PM Nils Hölscher<br>
>         >     >     <<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>><br>
>         >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>>><br>
>         >     >     >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>><br>
>         >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>>>>> wrote:<br>
>         >     >     ><br>
>         >     >     ><br>
>         >     >     ><br>
>         >     >     >         On Wed, 24 Jul 2019 at 15:14, Vijay Kumar<br>
>         Banerjee<br>
>         >     >     >         <<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>><br>
>         >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>>><br>
>         >     >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>><br>
>         >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>>>><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a> <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>><br>
>         >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>>><br>
>         >     >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>><br>
>         >     <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a><br>
>         <mailto:<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>>>>>> wrote:<br>
>         >     >     ><br>
>         >     >     ><br>
>         >     >     ><br>
>         >     >     ><br>
>         >     >     >             On Wed, Jul 24, 2019 at 6:36 PM Nils<br>
>         Hölscher<br>
>         >     >     >             <<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>><br>
>         >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>>><br>
>         >     >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>><br>
>         >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>>>>> wrote:<br>
>         >     >     ><br>
>         >     >     >                 Hi again,<br>
>         >     >     ><br>
>         >     >     >             Hi Nils <br>
>         >     >     ><br>
>         >     >     >                 I just decompiled my device tree<br>
>         and checked.<br>
>         >     >     >                 The probe code of the prcm driver<br>
>         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>
>         >     >     >               <br>
>                  printk("ofw_bus_status_not_okay\n");<br>
>         >     >     >                         return (ENXIO);<br>
>         >     >     >                     }<br>
>         >     >     ><br>
>         >     >     >             Do you get the<br>
>         "ofw_bus_status_not_okay" print ? <br>
>         >     >     ><br>
>         >     >     >         Yes. But I also see the other print.<br>
>         except the<br>
>         >     success one. <br>
>         >     >     ><br>
>         >     >     >                     if (ofw_bus_is_compatible(dev,<br>
>         >     "ti,am3-prcm")) {<br>
>         >     >     >                         device_set_desc(dev,<br>
>         "AM335x Power<br>
>         >     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<br>
>         device tree<br>
>         >     has to be<br>
>         >     >     >                 compatible to "ti,am3-prcm".<br>
>         >     >     >                 The thing is the decompiled device<br>
>         tree states<br>
>         >     >     just that:<br>
>         >     >     >                 "<br>
>         >     >     >                 prcm@0 {<br>
>         >     >     >                                         compatible =<br>
>         >     >     >                 "ti,am3-prcm\0simple-bus";<br>
>         >     >     ><br>
>         >     >     >             In my device tree, it runs<br>
>         successfully and the<br>
>         >     decompiled<br>
>         >     >     >             compatible looks like  :<br>
>         >     >     >             ```<br>
>         >     >     >                         prcm@200000 {<br>
>         >     >     >                             compatible =<br>
>         "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<br>
>         have used<br>
>         >     the same<br>
>         >     >     >         sources.<br>
>         >     >     ><br>
>         >     >     >     Have you checked that your source is from the tree<br>
>         >     matching the<br>
>         >     >     >     libBSD HEAD<br>
>         >     >     >     commit? <br>
>         >     >     ><br>
>         >     >     >                                         reg =<br>
>         <0x00 0x2000>;<br>
>         >     >     >               <br>
>                                  #address-cells = <0x01>;<br>
>         >     >     >               <br>
>                                  #size-cells = <0x01>;<br>
>         >     >     >                                         ranges =<br>
>         <0x00 0x00<br>
>         >     0x2000>;<br>
>         >     >     >                                         phandle =<br>
>         <0x5a>;<br>
>         >     >     >                 [...]<br>
>         >     >     >                 "<br>
>         >     >     >                 Any ideas would help, cause I am<br>
>         currently<br>
>         >     not able to<br>
>         >     >     >                 understand this behaviour.<br>
>         >     >     >                 Also without this driver even the<br>
>         >     dev_usb_bbb driver<br>
>         >     >     >                 shouldn't work.<br>
>         >     >     >                 However it attaches because it<br>
>         doesn't check<br>
>         >     for the<br>
>         >     >     >                 clocks error code.<br>
>         >     >     ><br>
>         >     >     >             I remember testing this a few days ago<br>
>         for my fb<br>
>         >     >     drivers and<br>
>         >     >     >             it was attaching alright,<br>
>         >     >     >             if I remember correctly. If changing<br>
>         the dtb<br>
>         >     doesn't work<br>
>         >     >     >             for you, I won't mind checking<br>
>         >     >     >             again, this will give me a hint for<br>
>         the display<br>
>         >     issue<br>
>         >     >     as well. <br>
>         >     >     ><br>
>         >     >     >         I will keep you updated on this.<br>
>         >     >     >         Would you be so kind and send me your compiled<br>
>         >     device tree? <br>
>         >     >     ><br>
>         >     >     >     Please find it attached in this mail. <br>
>         >     >     ><br>
>         >     >     >     Note: I have removed the devel from the cc<br>
>         because the<br>
>         >     attachment<br>
>         >     >     >     might be<br>
>         >     >     >     big for the list. Please continue the<br>
>         discussion in the<br>
>         >     >     mailing list<br>
>         >     >     >     and maybe note<br>
>         >     >     >     it somewhere that you already received the dtb<br>
>         from me in<br>
>         >     >     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<br>
>         Hölscher<br>
>         >     >     >                 <<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>><br>
>         >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>><br>
>         >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>>><br>
>         >     >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>><br>
>         >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>>>>> wrote:<br>
>         >     >     ><br>
>         >     >     >                     Hi,<br>
>         >     >     ><br>
>         >     >     >                     I just found out that the prcm<br>
>         driver<br>
>         >     fails to<br>
>         >     >     probe<br>
>         >     >     >                     on the simplebus and therefore<br>
>         cannot apply<br>
>         >     >     itself.<br>
>         >     >     >                     Seems like I am back to<br>
>         checking dtb.<br>
>         >     >     ><br>
>         >     >     >                     Best,<br>
>         >     >     >                     Nils<br>
>         >     >     ><br>
>         >     >     >                     On Tue, 23 Jul 2019 at 14:26,<br>
>         Nils Hölscher<br>
>         >     >     >                     <<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>><br>
>         >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>><br>
>         >     >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>>><br>
>         >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>><br>
>         >     >     <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>> <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a><br>
>         <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank" rel="noreferrer">nilhoel1@gmail.com</a>>>>>> wrote:<br>
>         >     >     ><br>
>         >     >     >                         Hi,<br>
>         >     >     ><br>
>         >     >     >                         After debugging with<br>
>         printk, didn't<br>
>         >     get the<br>
>         >     >     >                         module loading working as<br>
>         suggested by<br>
>         >     >     Sebastian.<br>
>         >     >     >                         I just found out that my<br>
>         PRU driver<br>
>         >     can't be<br>
>         >     >     >                         attached, cause the AM35xx<br>
>         clock<br>
>         >     driver isn't<br>
>         >     >     >                         loaded.<br>
>         >     >     >                         The driver can be found her:<br>
>         >     >     >                       <br>
>         >     >   <br>
>         >   <br>
>            <a href="https://github.com/RTEMS/rtems-libbsd/blob/610349693dd31d8b0efd33776516b7187cc5cda2/freebsd/sys/arm/ti/am335x/am335x_prcm.c" rel="noreferrer 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<br>
>         load this<br>
>         >     driver and<br>
>         >     >     >                         obisouly before I<br>
>         initialize my BSD<br>
>         >     modules?<br>
>         >     >     ><br>
>         >     >     >                         FYI: The code line that<br>
>         fails is<br>
>         >     this one,<br>
>         >     >     cause<br>
>         >     >     >                         the driver hasn't been<br>
>         initialized.<br>
>         >     >     >                       <br>
>         >     >   <br>
>         >   <br>
>            <a href="https://github.com/RTEMS/rtems-libbsd/blob/610349693dd31d8b0efd33776516b7187cc5cda2/freebsd/sys/arm/ti/am335x/am335x_prcm.c#L854" rel="noreferrer 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>
>          _______________________________________________<br>
>         >     >     >                 devel mailing list<br>
>         >     >     >                 <a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
>         <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
>         <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>>><br>
>         >     <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>><br>
>         <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>>>><br>
>         >     >     <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>><br>
>         <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>>><br>
>         >     <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>><br>
>         <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>>>>><br>
>         >     >     >               <br>
>          <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer 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" rel="noreferrer">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>><br>
>         <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>>><br>
>         >     <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>><br>
>         <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>>>><br>
>         >     >     > <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer 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" rel="noreferrer">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a>><br>
>         > <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer 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" rel="noreferrer">christian.mauderer@embedded-brains.de</a><br>
>         <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank" rel="noreferrer">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<br>
>         EHUG.<br>
> <br>
</blockquote></div>