-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(openSBI): add recipe to build OpenSBI
Signed-off-by: Diogo Costa <diogoandreveigacosta@gmail.com>
- Loading branch information
1 parent
1c2fe06
commit 5bfdbec
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright (c) Bao Project and Contributors. All rights reserved. | ||
|
||
{ stdenv | ||
, fetchFromGitHub | ||
, toolchain | ||
, openssl | ||
, platform | ||
, bao_build | ||
, bash | ||
}: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "openSBI"; | ||
version = "bao/demo"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "bao-project"; | ||
repo = "opensbi"; | ||
rev = "4489876e933d8ba0d8bc6c64bae71e295d45faac"; #branch: bao/demos | ||
sha256 = "sha256-k6f4/lWY/f7qqk0AFY4tdEi4cDilSv/jngaJYhKFlnY="; | ||
}; | ||
|
||
nativeBuildInputs = [ toolchain openssl bash ]; #build time dependencies | ||
|
||
postPatch = '' | ||
patchShebangs ./scripts | ||
''; | ||
|
||
buildPhase = '' | ||
export CROSS_COMPILE=riscv64-unknown-elf- | ||
make PLATFORM=generic \ | ||
FW_PAYLOAD=y \ | ||
FW_PAYLOAD_FDT_ADDR=0x80100000 | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/build/ | ||
cp -r ./build/platform/generic/firmware/fw_jump.elf $out/build/opensbi.elf | ||
''; | ||
|
||
} |