<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hello Alan,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 23, 2021 at 9:06 PM Alan Cudmore <<a href="mailto:alan.cudmore@gmail.com" target="_blank">alan.cudmore@gmail.com</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">Hi Niteesh,<br>
Here are my latest tests:<br>
- Using your firmware and the rtems.img in your firmware repo, I can<br>
see that it runs on my Raspberry Pi 3. The hello example reports RTEMS<br>
5.1. Was this from the 5 branch?<br></blockquote><div><span class="gmail_default" style="font-size:small"><br></span></div><div><span class="gmail_default" style="font-size:small">Yes. The image is built from RTEMS 5.1 because I wasn't able to</span></div><div><span class="gmail_default" style="font-size:small">get RTEMS 6 working. There is some other issue not related to this patch</span></div><div><span class="gmail_default" style="font-size:small">or console.</span></div><div><span class="gmail_default" style="font-size:small"><br></span></div><div><span class="gmail_default" style="font-size:small"></span><span class="gmail_default" style="font-size:small"></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- The same image does not seem to boot on the Raspberry Pi 1 modules,<br>
but I think that's because I need to add the command line option. What<br>
file should I add that in, and what command line option I should use?<br></blockquote><div><div class="gmail_default" style="font-size:small">I am not sure about RPi 1. Maybe Christian could help here.</div></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">
With the code I build:<br>
- I can get your patch to apply on the master/6 branch, and it builds<br>
OK, but I cannot get the raspberrypi BSP to run on any of my boards<br>
yet (with or without your patch and firmware)<br></blockquote><div><span class="gmail_default" style="font-size:small">I too face the same issue with RTEMS 6.</span></div><div><span class="gmail_default" style="font-size:small"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-  I can run the unmodified RTEMS 5 branch raspberry pi BSP on all of<br>
the single core models I have (using your firmware). Interestingly,<br>
the samples run on the Raspberry Pi Zero W (with wireless and<br>
bluetooth) without a patch. I thought the Zero W would have the same<br>
console problem as the RPI 3.</blockquote><div><div class="gmail_default" style="font-size:small">Hmm, that's odd</div></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">
- I applied your patch to my RTEMS 5 branch (had to change the include<br>
path for arm-pl011.h). It runs the same on the single core models<br>
without the patch, and the console does not come up on the Pi 3 like<br>
it does with your rtems.img.</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Is there something else that needs to be<br>
done in RTEMS 5 to default to the pl011 uart?</blockquote><div> </div><div><span class="gmail_default" style="font-size:small"></span>I did no other modification to the 5 branch other than adding the define</div><div><span class="gmail_default" style="font-size:small">I mentioned previously to trigger the issue.</span></div><div><span class="gmail_default" style="font-size:small"><br></span></div><div><div class="gmail_default" style="font-size:small">Let me summarize once again.</div><div class="gmail_default" style="font-size:small">In RTEMS - 5 as far as I have tested the default hello example should work</div><div class="gmail_default" style="font-size:small">on all models without any issue. The problem occurs when someone uses</div><div class="gmail_default" style="font-size:small">the *NEEDS_CONSOLE_DRIVER* option instead of the *NEEDS_SIMPLE_CONSOLE_DRIVER*</div><div class="gmail_default" style="font-size:small">This is because when the *NEEDS_CONSOLE_DRIVER* option is given,</div><div class="gmail_default" style="font-size:small">the console_initialize function gets called, this, in turn, calls console_select</div><div class="gmail_default" style="font-size:small">which when no cmdline option is given selects the PL011 as the UART</div><div class="gmail_default" style="font-size:small">irrespective of the model.</div><div class="gmail_default" style="font-size:small">This patch fixes that. I was able to get the hello world example in RTEMS with</div><div class="gmail_default" style="font-size:small">both options working with no other modification.</div><div class="gmail_default" style="font-size:small">Also, I was able to run the images with and without uboot.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In RTEMS - 6, </div><div class="gmail_default" style="font-size:small">Seems like something broke Rpi in RTEMS 6 but it was later fixed by the following</div><div class="gmail_default" style="font-size:small">commit</div></div><div class="gmail_default" style="font-size:small"><a href="https://devel.rtems.org/ticket/4395" target="_blank">https://devel.rtems.org/ticket/4395</a><br></div><div class="gmail_default" style="font-size:small">But this isn't the case for me. I  still can't get it running.</div><div class="gmail_default" style="font-size:small">I tried some commits before and after the mentioned commit but I couldn't get a</div><div class="gmail_default" style="font-size:small">working image.</div><div class="gmail_default" style="font-size:small">I don't know if it is a toolchain issue on my side or something else.</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">
All of my tests are not using u-boot.<br>
<br>
What should be next?<br>
- I can try the rest of my Raspberry Pi single core models with your<br>
firmware and rtems.img, once I know the command line option I need.<br></blockquote><div><span class="gmail_default" style="font-size:small">This I am really sure about. AFAIR nothing is needed. Christian, can you please</span></div><div><span class="gmail_default" style="font-size:small">confirm this?</span> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- After that, maybe we should figure out how to configure the console<br>
with your patch on the RTEMS 5 branch. </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">- Finally, we need to figure out how to get the master/6 branch working again.</blockquote><div><span class="gmail_default" style="font-size:small"></span>Since we have a GSoC student working the BSP I think our first goal should be</div><div><span class="gmail_default">to fix RTEMS 6 on Rpi. For Backporting the patch on RTEMS 5, Gadare mentioned</span></div><div>creating a ticket. I am currently a bit occupied with my own GSoC project.<span class="gmail_default" style="font-size:small"> So can't</span></div><div><span class="gmail_default" style="font-size:small">really work on figuring out why RTEMS is not working on RPI.</span></div><div class="gmail_default" style="font-size:small">Regarding backporting, once you give me an acknowledgment that it works fine on RTEMS5</div><div class="gmail_default" style="font-size:small">I'll create a ticket for this.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks,</div><div class="gmail_default" style="font-size:small">Niteesh.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail_default"></span> </blockquote><div><span class="gmail_default" style="font-size:small"></span> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks!<br>
Alan<br>
<br>
On Thu, May 20, 2021 at 7:41 AM Alan Cudmore <<a href="mailto:alan.cudmore@gmail.com" target="_blank">alan.cudmore@gmail.com</a>> wrote:<br>
><br>
> Hi Niteesh,<br>
> I tried your firmware, booting directly instead of using u-boot. I was<br>
> able to get the RTEMS 5 branch to run on the Raspberry Pi Zero, but I<br>
> still cannot get the master/6 branch to run. I need some time to do<br>
> additional tests. I was also going to re-try your patch and see if I<br>
> can run the master branch and your firmware with the Pi 3.<br>
><br>
> Our GSOC student just started a RPi improvement project, so I think<br>
> the first step should be to sort all of this out.<br>
> I'm pretty busy right now, but I'll see if I can continue testing in<br>
> the next few days. I want to try loading from u-boot next.<br>
><br>
> Alan<br>
><br>
><br>
> On Thu, May 20, 2021 at 12:52 AM Niteesh G. S. <<a href="mailto:niteesh.gs@gmail.com" target="_blank">niteesh.gs@gmail.com</a>> wrote:<br>
> ><br>
> > ping.<br>
> ><br>
> > On Tue, May 11, 2021 at 1:09 AM Niteesh G. S. <<a href="mailto:niteesh.gs@gmail.com" target="_blank">niteesh.gs@gmail.com</a>> wrote:<br>
> >><br>
> >> Hello Gedare,<br>
> >><br>
> >> On Mon, May 10, 2021 at 8:57 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br>
> >>><br>
> >>> On Thu, May 6, 2021 at 8:49 AM Niteesh G. S. <<a href="mailto:niteesh.gs@gmail.com" target="_blank">niteesh.gs@gmail.com</a>> wrote:<br>
> >>> ><br>
> >>> > Hi Alan,<br>
> >>> ><br>
> >>> > On Thu, May 6, 2021 at 6:12 PM Alan Cudmore <<a href="mailto:alan.cudmore@gmail.com" target="_blank">alan.cudmore@gmail.com</a>> wrote:<br>
> >>> >><br>
> >>> >> Hi Niteesh,<br>
> >>> >><br>
> >>> >> I was hoping to try this out as soon as I get some time. No later than weekend. So if nobody else is able to check it out, I will be able to provide some feedback soon.<br>
> >>> >><br>
> >>> >> I should be able to bring up the console on a RPi Zero W and RPi3, correct?<br>
> >>> ><br>
> >>> > the consoles should work on Zero W and Pi3 by default. They only fail to work when  CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER<br>
> >>> > this option is used. This is because when that option is used it calls console_initialize which checks if any boot options were present if none were<br>
> >>> > given it defaults to pl011 which is the secondary UART in Zero w and Pi3 so we get no output. This patch defaults to the primary UART instead of<br>
> >>> > pl011 depending on the board.<br>
> >>> > Also, this patch should be applied on RTEMS 5 since we started supporting Pi3 and Zero w from RTEMS 5.<br>
> >>> ><br>
> >>> You'll need to provide a separate patch with a ticket to close on 5<br>
> >>> for a backport. Wait until you get the approval for the master branch<br>
> >>> though.<br>
> >><br>
> >> OK. I'll create a ticket and request for a backport once this is pushed on<br>
> >> to the current master<br>
> >><br>
> >> Thanks,<br>
> >> Niteesh.<br>
> >>><br>
> >>><br>
> >>> > Thanks,<br>
> >>> > Niteesh.<br>
> >>> ><br>
> >>> ><br>
> >>> >><br>
> >>> >> Thanks,<br>
> >>> >><br>
> >>> >> Alan<br>
> >>> >><br>
> >>> >><br>
> >>> >><br>
> >>> >> From: Niteesh G. S.<br>
> >>> >> Sent: Thursday, May 6, 2021 4:29 AM<br>
> >>> >> To: Joel Sherrill; Christian Mauderer<br>
> >>> >> Cc: <a href="mailto:rtems-devel@rtems.org" target="_blank">rtems-devel@rtems.org</a><br>
> >>> >> Subject: Re: [PATCH] bsps/raspberrypi/console: Fix default console device<br>
> >>> >><br>
> >>> >><br>
> >>> >><br>
> >>> >> ping.<br>
> >>> >><br>
> >>> >><br>
> >>> >><br>
> >>> >> On Sat, May 1, 2021 at 9:47 PM Niteesh G. S. <<a href="mailto:niteesh.gs@gmail.com" target="_blank">niteesh.gs@gmail.com</a>> wrote:<br>
> >>> >><br>
> >>> >> On Sat, May 1, 2021 at 8:31 PM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> wrote:<br>
> >>> >><br>
> >>> >><br>
> >>> >><br>
> >>> >> On Sat, May 1, 2021, 8:53 AM Niteesh G. S. <<a href="mailto:niteesh.gs@gmail.com" target="_blank">niteesh.gs@gmail.com</a>> wrote:<br>
> >>> >><br>
> >>> >> Just to provide more context,<br>
> >>> >><br>
> >>> >> When the CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER option is used<br>
> >>> >><br>
> >>> >> and no --console option is provided, the console driver defaults to PL011.<br>
> >>> >><br>
> >>> >> In raspberry pi 3 and other models whose primary UART is not PL011, we get no output.<br>
> >>> >><br>
> >>> >> This patch fixes that by linking the primary UART to the console device.<br>
> >>> >><br>
> >>> >><br>
> >>> >><br>
> >>> >> Thanks,<br>
> >>> >><br>
> >>> >> Niteesh<br>
> >>> >><br>
> >>> >><br>
> >>> >><br>
> >>> >> On Sat, May 1, 2021 at 7:05 PM G S Niteesh Babu <<a href="mailto:niteesh.gs@gmail.com" target="_blank">niteesh.gs@gmail.com</a>> wrote:<br>
> >>> >><br>
> >>> >> When no console argument is given, the driver defaults to pl011<br>
> >>> >> this results in no output in case of Rpi3 whose primary uart is<br>
> >>> >> miniuart.<br>
> >>> >> This patch fixes that by defaulting to the primary uart when no<br>
> >>> >> console option is provided.<br>
> >>> >><br>
> >>> >><br>
> >>> >><br>
> >>> >> Does the default need to vary by model?<br>
> >>> >><br>
> >>> >> Yes, the primary UART is different across models.<br>
> >>> >><br>
> >>> >><br>
> >>> >><br>
> >>> >> Rpi's have two UARTs PL011 and miniuart, on models which have Bluetooth<br>
> >>> >><br>
> >>> >> the PL011 is used to talk to the Bluetooth and miniuart acts as the primary UART.<br>
> >>> >><br>
> >>> >> Now we can change this by adding miniuart-bt to config.txt but the miniuart is<br>
> >>> >><br>
> >>> >> based on the VPU core and requires to add another option which sets the core to<br>
> >>> >><br>
> >>> >> a fixed freq.<br>
> >>> >><br>
> >>> >><br>
> >>> >><br>
> >>> >> ---<br>
> >>> >>  bsps/arm/raspberrypi/console/console-config.c | 12 +++++++++---<br>
> >>> >>  1 file changed, 9 insertions(+), 3 deletions(-)<br>
> >>> >><br>
> >>> >> diff --git a/bsps/arm/raspberrypi/console/console-config.c b/bsps/arm/raspberrypi/console/console-config.c<br>
> >>> >> index 6b8eb80aa4..bd3a8d34c2 100644<br>
> >>> >> --- a/bsps/arm/raspberrypi/console/console-config.c<br>
> >>> >> +++ b/bsps/arm/raspberrypi/console/console-config.c<br>
> >>> >> @@ -165,10 +165,16 @@ static void console_select( void )<br>
> >>> >>      }<br>
> >>> >>    }else {<br>
> >>> >>      /**<br>
> >>> >> -     * If no command line option was given, default to PL011.<br>
> >>> >> +     * If no console option was given we default to the primary uarts.<br>
> >>> >> +     * The initialization of the uart's and BSP_output_char is already done<br>
> >>> >> +     * in the uart_probe function called before this. So now we can safely<br>
> >>> >> +     * compare BSP_output_char.<br>
> >>> >>       */<br>
> >>> >> -    BSP_output_char = output_char_pl011;<br>
> >>> >> -    link(PL011, CONSOLE_DEVICE_NAME);<br>
> >>> >> +    if (BSP_output_char == output_char_pl011) {<br>
> >>> >> +      link(PL011, CONSOLE_DEVICE_NAME);<br>
> >>> >> +    }else {<br>
> >>> >> +      link(MINIUART, CONSOLE_DEVICE_NAME);<br>
> >>> >> +    }<br>
> >>> >>    }<br>
> >>> >>  }<br>
> >>> >><br>
> >>> >> --<br>
> >>> >> 2.17.1<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>
> >>> > 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>
</blockquote></div></div>