Ouss4 commented on a change in pull request #5040:
URL: https://github.com/apache/incubator-nuttx/pull/5040#discussion_r773260326
##########
File path: arch/risc-v/src/mpfs/Make.defs
##########
@@ -89,3 +89,39 @@ endif
ifeq (${CONFIG_MPFS_BOOTLOADER},y)
CHIP_CSRCS += mpfs_cache.c
endif
+
+ifeq (${CONFIG_MPFS_OPENSBI},y)
+CHIP_ASRCS += mpfs_opensbi_utils.S
+CHIP_CSRCS += mpfs_opensbi.c
+
+OPENSBI_UNPACK = opensbi-3rdparty
+OPENSBI_COMMIT = 69d7e536138ae71a24028ca849d401a4d64d564b
+OPENSBI_URL = https://github.com/riscv-software-src/opensbi/tarball
+OPENSBI_TARBALL = opensbi.tar.gz
+OPENSBI_DIR = riscv-software-src-opensbi-69d7e53
+
+$(OPENSBI_TARBALL):
+ $(Q) echo "Downloading: OpenSBI"
+ $(Q) curl -L $(OPENSBI_URL)/$(OPENSBI_COMMIT) -o chip/$(OPENSBI_TARBALL)
+
+chip/$(OPENSBI_UNPACK): $(OPENSBI_TARBALL)
+ $(Q) echo "Unpacking: OpenSBI"
+ $(Q) tar xzf chip/$(OPENSBI_TARBALL) --directory chip/
+ $(Q) mv chip/$(OPENSBI_DIR)* chip/$(OPENSBI_UNPACK)
+ $(Q) touch chip/$(OPENSBI_UNPACK)
+ $(Q) (cd chip/$(OPENSBI_UNPACK); make;)
Review comment:
Yes, I too think it should be under riscv folder.
Also, you can just add the files to `CSCR` and include the opensbi/Make.defs
file into arch/risc-v/src/Makefile. This way you won't have to implement other
common targets and add the opensbi directory to the build. I think this way it
will be cleaner.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]