start.sh 782 B

1234567891011121314151617181920212223
  1. #! /bin/sh
  2. SCRIPT_DIR="$(dirname "$0")"
  3. BR_BASEDIR="$(readlink -e "${SCRIPT_DIR}/../../..")"
  4. # spike uses dtc at runtime startup, so make sure buildroot host
  5. # directory is in the PATH
  6. export PATH="${BR_BASEDIR}/output/host/usr/bin:$PATH"
  7. # Use Buildroot host spike by default, but allow the caller to
  8. # redefine another spike binary
  9. : "${SPIKE:=spike}"
  10. # Note 1: Kernel with initrd fail to boot on riscv32 when the system
  11. # has more than 1GB of RAM. So we set exactly this amount of RAM.
  12. # Note 2: The default spike ISA is RV64IMAFDC_zicntr_zihpm, so we need
  13. # to force the RV32 ISA here.
  14. exec "${SPIKE}" \
  15. -m1024 \
  16. --initrd "${BR_BASEDIR}"/output/images/rootfs.cpio \
  17. --isa="RV32IMAFDC_zicntr_zihpm" \
  18. "${@}" \
  19. "${BR_BASEDIR}"/output/images/fw_payload.elf