mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-12-23 01:59:45 +01:00
parent
16b8c06fd3
commit
850b04d59c
1 changed files with 10 additions and 38 deletions
|
@ -1,42 +1,14 @@
|
||||||
{ lib
|
{ opensbi, withPayload, withFDT }:
|
||||||
, stdenv
|
|
||||||
, fetchFromGitHub
|
|
||||||
, python3
|
|
||||||
, withPlatform ? "generic"
|
|
||||||
, withPayload ? null
|
|
||||||
, withFDT ? null
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
(opensbi.override {
|
||||||
pname = "opensbi";
|
inherit withPayload withFDT;
|
||||||
version = "1.3-git-2868f26";
|
}).overrideAttrs (attrs: {
|
||||||
|
makeFlags = attrs.makeFlags ++ [
|
||||||
src = fetchFromGitHub {
|
# opensbi generic platform default FW_TEXT_START is 0x80000000
|
||||||
owner = "riscv-software-src";
|
# For JH7110, need to specify the FW_TEXT_START to 0x40000000
|
||||||
repo = "opensbi";
|
# Otherwise, the fw_payload.bin downloading via jtag will not run.
|
||||||
rev = "2868f26131308ff345382084681ea89c5b0159f1";
|
# https://github.com/starfive-tech/VisionFive2/blob/7733673d27052dc5a48f1cb1d060279dfa3f0241/Makefile#L274
|
||||||
hash = "sha256-E+nVFLSpH6lQ2nVmMlVRTr7qYRVY0ULW7gUvAyTr90I=";
|
|
||||||
};
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
patchShebangs ./scripts
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [ python3 ];
|
|
||||||
|
|
||||||
installFlags = [
|
|
||||||
"I=$(out)"
|
|
||||||
];
|
|
||||||
|
|
||||||
makeFlags = [
|
|
||||||
"PLATFORM=${withPlatform}"
|
|
||||||
"FW_TEXT_START=0x40000000"
|
"FW_TEXT_START=0x40000000"
|
||||||
] ++ lib.optionals (withPayload != null) [
|
|
||||||
"FW_PAYLOAD_PATH=${withPayload}"
|
|
||||||
] ++ lib.optionals (withFDT != null) [
|
|
||||||
"FW_FDT_PATH=${withFDT}"
|
|
||||||
];
|
];
|
||||||
|
})
|
||||||
|
|
||||||
dontStrip = true;
|
|
||||||
dontPatchELF = true;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue