xiaoxiang781216 edited a comment on pull request #5782:
URL: https://github.com/apache/incubator-nuttx/pull/5782#issuecomment-1077456944


   > > Since OpenSBI is the standard way to expose M-mode functionality to 
S-mode, what I suggest it's that we use OpenSBI API definition, but write our 
own minimal implementation.
   > 
   > I must disagree on this part, yes you need SBI, but I don't consider 
OpenSBI library as "standard" the same way as posix is. It is much better to 
have a native SBI implementation which is designed for the OS. I guess only 
reason why Linux is using OpenSBI is, that the library happened to be available 
when the first port was done.
   > 
   
   From my understanding, OpenSBI is an effort to enable the different S-mode 
software(Linux, FreeBSD...) has a standard interface talk with M-mode firmware:
   https://github.com/riscv-software-src/opensbi
   NuttX is an implementation of S-mode, I don't see there is any reason to 
replace a standard way with a private approach.
   
   > > If you don' want to implement the minimal OpenSBI this time. It's better 
to use other hardware timer for OS scheduler. Since most SoC has a dozen of 
hardware timer, it isn't too difficult to find a free one. Actually, many chips 
supported NuttX use the chip specific hardware timer, instead of ARM recommend 
SYSTICK or general timer.
   > 
   > I don't have an extra timer available on mpfs at the moment, and why 
wouldn't I want to use the one that is already there for the purpose, and also 
used for running NuttX in CONFIG_BUILD_FLAT? And in addition to that, in S-mode 
the hart-id reading needs to be implemented as well.
   > 
   > Sorry, but I don't really see the point here. If someone has implemented a 
native SBI for NuttX, so that you can run it in S-mode, why mess with some 
extra interface which needs to be retro-fitted to NuttX? This is not an 
interface visible to applications anyhow, but very much OS internal thing, like 
interrupt handling or such.
   > 
   
   No, it isn't an OS internal thing, because M-mode mayn't run NuttX at all. 
You can't assume M mode also run NuttX too, in this case, how do you tell other 
people to implement a private interface?
   
   > Remind you, that the current flag "CONFIG_OPENSBI" does not mean that 
you'll get SBI support for NuttX. It only means that it builds a companion 
library out of OpenSBI on the side.
   
   Ok, understand, but it isn't a reason to not follow OpenSBI spec to talk 
with M-mode software.
   
   > This PR actually brings in native S-mode support for RiscV/NuttX
   
   Yes, but the code in S-mode talk with M-mode is better to follow OpenSBI 
spec.


-- 
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