BPI-F3 opensbi compile problem

I downloaded the source files zip file “pi-opensbi-1.3-k1.zip”

I tried to compile it by doing “make”

The first error I got was:

fatal error: spacemit/spacemit_config.h: No such file or directory 5 | #include <spacemit/spacemit_config.h>

so I copied the /platform/generic/include/spacemit files to pi-opensbi-1.3-k1/include

then when I tried “make” I got lots of errors that look like:

/home/bugs/Documents/dev_code/pi-opensbi-1.3-k1/include/sbi_utils/psci/psci.h:142:45: error: ‘PLAT_MAX_PWR_LVL’ undeclared here (not in a function) 142 | plat_local_state_t pwr_domain_state[PLAT_MAX_PWR_LVL + 1U ];

What am I doing wrong?

Thanks for any help

if you want to compile opensbi independently:

  1. set cross compile env
  export PATH=/path/to/spacemit-toolchain-linux-glibc-x86_64-v0.3.3/bin:$PATH
  export CROSS_COMPILE=riscv64-unknown-linux-gnu-
  export ARCH=riscv
  1. compile
 cd /path/to/opensbi  
 make -j$(nproc) PLATFORM_DEFCONFIG=k1_defconfig PLATFORM=generic