<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">On Fri, May 8, 2020 at 11:43 AM Christian Mauderer <<a href="mailto:christian.mauderer@embedded-brains.de">christian.mauderer@embedded-brains.de</a>> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
On 07/05/2020 17:19, Niteesh G. S. wrote:<br>
> On Thu, May 7, 2020 at 4:07 PM Sebastian Huber<br>
> <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
> <mailto:<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>>> wrote:<br>
> <br>
> On 07/05/2020 12:28, Niteesh G. S. wrote:<br>
> <br>
> > On Thu, May 7, 2020 at 1:21 PM Sebastian Huber<br>
> > <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
> <mailto:<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>><br>
> > <mailto:<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
> <mailto:<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>>>> wrote:<br>
> ><br>
> > On 07/05/2020 09:35, Niteesh G. S. wrote:<br>
> ><br>
> > > This is what I was trying to convey in one of the previous<br>
> mails.<br>
> > > <a href="https://lists.rtems.org/pipermail/devel/2020-May/059717.html" rel="noreferrer" target="_blank">https://lists.rtems.org/pipermail/devel/2020-May/059717.html</a><br>
> > > But in that mail, I was planning to replace KOBJLOOKUP.<br>
> > > Should I start working on it? From the top of my mind, the<br>
> > following has<br>
> > > to be done.<br>
> > > 1) Import openfirm.c openfirm.h, ofw_fdt.c<br>
> > > 2) Add ofw_fdt.h since all the functions in ofw_fdt are static.<br>
> > > Should we also import ofw_if.h? Because that is where OFW_*<br>
> > functions<br>
> > > are defined or just add a ofw_rtems_map.h which redefines them,<br>
> > instead<br>
> > > of importing ofw_if.h?<br>
> ><br>
> > The KOBJ stuff in the OFW support enables FreeBSD to have three<br>
> > different implementations of the OFW API which can be selected at<br>
> > runtime:<br>
> ><br>
> > sys/powerpc/ofw/ofw_real.c<br>
> > sys/dev/ofw/ofw_standard.c<br>
> > sys/dev/ofw/ofw_fdt.c<br>
> ><br>
> > In libbsd this is already short cut to the FDT implementation:<br>
> ><br>
> > #ifndef __rtems__<br>
> > static ofw_def_t *ofw_def_impl = NULL;<br>
> > #else /* __rtems__ */<br>
> > #define ofw_def_impl (&ofw_fdt)<br>
> > #endif /* __rtems__ */<br>
> ><br>
> > To me this looks like the KOBJ stuff was just used to enable some<br>
> > sort<br>
> > of object oriented programming. Do we need this flexibility at<br>
> > runtime<br>
> > in RTEMS? I would say no. I would hard wire this to the FDT<br>
> > implementation. If someone has a problem with it in the<br>
> future, this<br>
> > decision can be readdressed.<br>
> ><br>
> ><br>
> > Ok. But what is the neatest way to hardwire this to the FDT<br>
> > implementation?<br>
> > One way as Christian mentioned would be to redefine OFW_* functions to<br>
> > call the functions in ofw_fdt.c directly. Is there any other way?<br>
> <br>
> I would try to replace the function declarations in openfirm.h with<br>
> inline functions which call the ofw_fdt.c functions.<br>
> <br>
> <br>
> Should I proceed with the above method? or should I wait for others<br>
> to comment?<br>
> If I can proceed, the following is what I will be doing.<br>
> 1) import openfirm.h and ofw_fdt.c into RTEMS.<br>
> 2) Add ofw_fdt.h with functions declarations for functions in ofw_fdt.c<br>
> 3) Add necessary compile-time guards. This would include using __rtems__<br>
> preprocessor directive to avoid FreeBSD stuff and change the function<br>
> definitions in ofw_fdt.c from static to non-static.<br>
> Am I missing something? or is there any other way to do this?<br>
<br>
Maybe wait one or two more days for others to comment. For me the<br>
direction sounds OK.<br>
<br>
You maybe can start thinking about where you want to import the files to.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Since this has scope for future development. I think we should put it in a </div><div class="gmail_default" style="font-size:small">separate directory under cpukit/include/ofw for header files and cpukit/ofw</div><div class="gmail_default" style="font-size:small">for the source files. What do you think?</div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-- <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>