jlaitine commented on pull request #5782:
URL: https://github.com/apache/incubator-nuttx/pull/5782#issuecomment-1077368297


   I think that we are responsible for the SBI confusion, so let me explain a 
bit where we are.
   
   The OpenSBI library, which we added (by @eenurkka) is not really used by 
NuttX itself. It would be possible to use that to provide the SBI for nuttx in 
theory, but would require quite a lot of extra framework to bind it to nuttx.
   
   So why did we add the support for building the full OpenSBI library to the 
NuttX build scripts then?
   
   We have a NuttX based bootloader application for MPFS, which can either boot 
another NuttX or also uBoot&Linux (actually on in parallel on different harts 
on the same soc even). Now, Linux requires a lot more from the SBI than the 
NuttX, such as a bunch of extra trap handlers (unaligned access etc.), 
detection of hart capabilities etc. etc. So we are only passing the OpenSBI 
libarary from our bootloader app to uBoot and Linux after NuttX has initialized 
the HW. The underlying idea behind integrating the build scripts into NuttX was 
that maybe the OpenSBI could be usable for others as well...
   
   What @pussuw has implemented here is really clever; NuttX running in S-mode 
only needs the timer interrupt handling and hart id reading in M-mode. So it 
makes a world of sense to just make this very minimal "sbi" which is tailored 
for NuttX. But let's not mix these two SBIs at this point. It is most likely 
not feasible to take in the whole OpenSBI into NuttX use (since most of it is 
not really needed - it is way too big and generic).
   
   So I would suggest to let these live side-by-side for now, even though they 
partially implement the same thing. Enabling S-mode in NuttX is really only 
needed when you want to enable address environments (in CONFIG_BUILD_KERNEL), 
and what @pussuw has done here enables just that and nothing extra.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to