<div dir="ltr"><div dir="ltr">Thanks, Gabriel, I will surely go through it this week. <div><br><div>I have been reading about writing driver code and noted the following steps that I would need to follow:</div><div><span id="gmail-docs-internal-guid-d4b5f3e2-7fff-4051-cb78-7c258b27478d"><ol style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:decimal;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Select the hardware device for which the driver has to be written.</span></p></li><li dir="ltr" style="list-style-type:decimal;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Read the device specification and protocol used. Find the device address to communicate with the device</span></p></li><li dir="ltr" style="list-style-type:decimal;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Write the skeleton driver to handle basic operations such as input/output, and initialization.</span></p></li><li dir="ltr" style="list-style-type:decimal;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Implement necessary functions for Greth lwip, such as a low-level interface between the driver and lwip networking stack.</span></p></li><li dir="ltr" style="list-style-type:decimal;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Testing and optimizing the driver.</span></p></li></ol><div><br></div><div>As Daniel suggested, I read about the GBIT Ethernet MAC and made notes on Google Docs. As I learn more about the various sections, I will add more content to this <a href="https://docs.google.com/document/d/1a12F6O883W9g06EP9k1KFMJX8wQq0TGRg9nUP0qLyfI/edit?usp=sharing">doc file</a>.</div><div><br>I had a question about hardware. Can I complete this project with the Qemu emulator?<br></div><div><font color="#000000" face="Arial"><span style="white-space:pre-wrap"><br></span></font></div><div><font color="#000000" face="Arial"><span style="white-space:pre-wrap">Regards,</span></font></div><div><font color="#000000" face="Arial"><span style="white-space:pre-wrap">Viraj</span></font></div></span></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 24, 2023 at 4:28 PM <<a href="mailto:Gabriel.Moyano@dlr.de">Gabriel.Moyano@dlr.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"><div class="msg8529700377714191363">





<div lang="DE">
<div class="m_8529700377714191363WordSection1">
<p class="MsoNormal"><span>Hi Viraj,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Please find the code in this branch:
</span><span><a href="https://github.com/GabrielDai/rtems-libbsd/tree/port-greth-to-5-freebsd-12" target="_blank"><span lang="EN-US">https://github.com/GabrielDai/rtems-libbsd/tree/port-greth-to-5-freebsd-12</span></a></span><span>
<span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Since this driver depends on drvmgr, you’ll have to compile your bsp with support for it (make sure your bsp register the driver for your gaisler card using the drvmgr functions).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Moreover, it is needed to add the following line for your bsp in “nexus-devices.h” (rtems-libbsd):<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">                SYSINIT_DRIVER_REFERENCE(grcard, pci);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">This line will add a device (called grcard).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">During booting (if the gaisler card get recognized) it will create child devices (greth#) for the ethernet interfaces.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I hope this helps you.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Have fun coding,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Gabriel<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><b>Von:</b> Viraj Jagadale <<a href="mailto:virajjagadale123@gmail.com" target="_blank">virajjagadale123@gmail.com</a>> <br>
<b>Gesendet:</b> Dienstag, 21. Februar 2023 17:36<br>
<b>An:</b> Moyano Heredia, Victor Gabriel <<a href="mailto:Gabriel.Moyano@dlr.de" target="_blank">Gabriel.Moyano@dlr.de</a>>; <a href="mailto:daniel@gaisler.com" target="_blank">daniel@gaisler.com</a>; <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<b>Betreff:</b> Re: Project Discussion for GSoC 2023<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">Hi Daniel and Gabriel,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thank you for responding. I don't own an ARTY A7-100T board. As suggested, I will study the GRETH_GBIT manual at the same time. Can I refer to the DP83848 or LAN8742A documentation for stm32, both of which support legacy stack and lwip?
 If not, could you please recommend a device?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><br>
Please share the driver for rtems-libbsd with me as it will be very useful as a starting point.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Viraj.<u></u><u></u></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Tue, Feb 21, 2023 at 2:00 PM <<a href="mailto:Gabriel.Moyano@dlr.de" target="_blank">Gabriel.Moyano@dlr.de</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Hi Viraj,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">We ported the driver for greth to rtems-libbsd in the past but never got to submit it (it might need some further refinement). The driver depends on the driver
 manager (drvmgr). Not sure if this is the best approach but it is a good starting point and we’d be happy to share it.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal">Best regards,<u></u><u></u></p>
<p class="MsoNormal">Gabriel<u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>Von:</b> devel <<a href="mailto:devel-bounces@rtems.org" target="_blank">devel-bounces@rtems.org</a>>
<b>Im Auftrag von </b>Daniel Hellstrom<br>
<b>Gesendet:</b> Montag, 20. <span lang="EN-US">Februar 2023 15:59<br>
<b>An:</b> Viraj Jagadale <<a href="mailto:virajjagadale123@gmail.com" target="_blank">virajjagadale123@gmail.com</a>>;
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<b>Cc:</b> <a href="mailto:kinsey.moore@rtems.org" target="_blank">kinsey.moore@rtems.org</a>;
<a href="mailto:andrei@chichak.ca" target="_blank">andrei@chichak.ca</a><br>
<b>Betreff:</b> Re: Project Discussion for GSoC 2023</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p><span lang="EN-US">Hi Viraj,</span><u></u><u></u></p>
<p><span lang="EN-US">There is an old GRETH network driver as part of the old network stack that would be a good reference.</span><u></u><u></u></p>
<p><span lang="EN-US">Note that the old driver supports two IPs (GRETH 10/100, and GRETH_GBIT 10/100/1000). The GRETH_GBIT IP is mostly backwards compatible with the GRETH, but as some additional functionality to off load the CPU with UDP/TCP check-summing,
 unaligned DMA, and scatter-gather DMA for example. One approach could be to begin to focus on the more capable GRETH_GBIT IP first, section 14:</span><u></u><u></u></p>
<p><span lang="EN-US">    </span><a href="https://www.gaisler.com/doc/gr740/GR740-UM-DS-2-5.pdf" target="_blank"><span lang="EN-US">https://www.gaisler.com/doc/gr740/GR740-UM-DS-2-5.pdf</span></a><u></u><u></u></p>
<p><span lang="EN-US">    or from the IP manual, section XX:</span><u></u><u></u></p>
<p><span lang="EN-US">    </span><a href="https://www.gaisler.com/products/grlib/grip.pdf" target="_blank"><span lang="EN-US">https://www.gaisler.com/products/grlib/grip.pdf</span></a><u></u><u></u></p>
<p><span lang="EN-US">Please keep in mind that the GRETH driver will be used by both SPARC/LEON3 BSP and RISC-V/NOEL-V BSP in the future.</span><u></u><u></u></p>
<p><span lang="EN-US">It sounds as a good approach to look at the interface of the LWIP stack towards the Network Device Driver, for example the DEC driver to learn however the best would be if there is a MAC device supported both by legacy stack and the LWIP?
 Simultaneously you could study the GRETH_GBIT manual with register and DMA interface and the old device driver source code?</span><u></u><u></u></p>
<p><span lang="EN-US">If you have a ARTY A7-100T board you could use the RISC-V design to get access to the GRETH IP easily get started with. The GRMON eval version would also work together with it for a hardware-debugger (no additional cost required) which
 you can connect GDB for source debugging if you wish:</span><u></u><u></u></p>
<p><span lang="EN-US">    </span><a href="https://www.gaisler.com/index.php/products/processors/noel-v-examples" target="_blank"><span lang="EN-US">https://www.gaisler.com/index.php/products/processors/noel-v-examples</span></a><u></u><u></u></p>
<p><span lang="EN-US">    </span><a href="https://www.gaisler.com/index.php/products/debug-tools/grmon3" target="_blank"><span lang="EN-US">https://www.gaisler.com/index.php/products/debug-tools/grmon3</span></a><u></u><u></u></p>
<p><span lang="EN-US">Kind Regards,<br>
Daniel</span><u></u><u></u></p>
<p><span lang="EN-US"> </span><u></u><u></u></p>
<div>
<pre><span lang="EN-US"> </span><u></u><u></u></pre>
<pre><span lang="EN-US">      </span><u></u><u></u></pre>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">On 2023-02-13 04:25, Viraj Jagadale wrote:</span><u></u><u></u></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal"><span lang="EN-US">Dear Community,
</span><u></u><u></u></p>
<div>
<p class="MsoNormal"><span lang="EN-US">I am interested in contributing to RTEMS and will be participating in GSoC 2023. I am interested in projects </span><a href="https://devel.rtems.org/ticket/4595" target="_blank"><span lang="EN-US">#4595</span></a><span lang="EN-US">
 and </span><a href="https://devel.rtems.org/ticket/4596" target="_blank"><span lang="EN-US">#4596</span></a><span lang="EN-US"> because I am passionate about networking. I'm currently concentrating solely on #4595. I'm aware that I'll need to study and comprehend
 the lwip stack documentation, as well as how the Ethernet protocol is implemented and networking services are provided for applications. Then I'll have to devise a strategy for designing the driver architecture. I'm thinking about reading the RTEMS Legacy
 Networking User Manual and understanding the DEC 21140 example to get started. I'm not sure if this is the right approach, and I'll need your advice. I am also willing to help with existing bugs and documentation updates.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Viraj Jagadale.<u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>

</div></blockquote></div></div>