mini-rv32ima/Makefile

63 lines
2.5 KiB
Makefile
Raw Permalink Normal View History

2022-11-27 00:55:38 -05:00
all : everything
2022-11-13 04:53:31 -05:00
2022-11-26 02:06:36 -05:00
DTC:=buildroot/output/host/bin/dtc
2022-11-16 04:40:05 -05:00
buildroot :
2022-12-04 04:56:01 -05:00
git clone https://github.com/cnlohr/buildroot --recurse-submodules --depth 1
2022-11-16 04:40:05 -05:00
toolchain : buildroot
2022-11-27 04:50:33 -05:00
cp -a configs/custom_kernel_config buildroot/kernel_config
cp -a configs/buildroot_config buildroot/.config
cp -a configs/busybox_config buildroot/busybox_config
2023-11-28 20:14:39 -08:00
cp -a configs/uclibc_config buildroot/uclibc_config
cp -a configs/uclibc_config buildroot/uclibc_config_extra
2023-04-26 18:02:44 -07:00
true || cp -a configs/rootfsoverlay/* buildroot/output/target/
2022-11-22 18:33:16 -08:00
make -C buildroot
2022-11-16 04:40:05 -05:00
2022-11-27 00:55:38 -05:00
everything : toolchain
make -C hello_linux deploy
2023-11-28 20:29:54 -08:00
#make -C packages/duktapetest deploy
2022-11-28 06:20:38 -05:00
make -C packages/coremark deploy
2023-03-28 21:44:01 -07:00
cp -a configs/rootfsoverlay/* buildroot/output/target/
2022-11-27 00:55:38 -05:00
make -C buildroot
make -C mini-rv32ima testkern
2022-11-26 21:02:08 -05:00
2022-11-27 08:07:46 -05:00
testdlimage :
make -C mini-rv32ima testdlimage
2022-11-27 07:38:36 -05:00
2022-11-27 04:50:33 -05:00
testbare :
make -C baremetal
make -C mini-rv32ima testbare
2022-11-27 04:58:45 -05:00
test_with_qemu :
2022-11-27 06:54:37 -05:00
cd buildroot && output/host/bin/qemu-system-riscv32 -cpu rv32,mmu=false -m 128M -machine virt -nographic -kernel output/images/Image -bios none #-machine dtb=../minimal.dtb
2022-11-27 04:50:33 -05:00
2022-11-26 21:02:08 -05:00
##################################################################
# For Debugging
####
# SBI doesn't work for some reason?
#opensbi_firmware :
2022-11-28 06:20:38 -05:00
# make -C opensbi PLATFORM=../../packages/this_opensbi/platform/riscv_emufun I=../packages/this_opensbi/install B=../packages/this_opensbi/build CROSS_COMPILE=riscv64-unknown-elf- PLATFORM_RISCV_ISA=rv32ima PLATFORM_RISCV_XLEN=32
2022-11-26 21:02:08 -05:00
# # ./mini-rv32ima -i ../opensbi/this_opensbi/platform/riscv_emufun/firmware/fw_payload.bin
# # ../buildroot/output/host/bin/riscv32-buildroot-linux-uclibc-objdump -S ../opensbi/this_opensbi/platform/riscv_emufun/firmware/fw_payload.elf > fw_payload.S
#toolchain_buildrootb : buildroot-2022.02.6
# cp buildroot-2022.02.6-config buildroot-2022.02.6/.config
# cp -a custom_kernel_config buildroot-2022.02.6/kernel_config
# cp riscv_Kconfig buildroot-2022.02.6/output/build/linux-5.15.67/arch/riscv/
# make -C buildroot-2022.02.6
2022-11-27 06:54:37 -05:00
configs/minimal.dtb : configs/minimal.dts $(DTC)
$(DTC) -I dts -O dtb -o $@ $< -S 2048
2022-11-26 21:02:08 -05:00
2022-11-27 00:55:38 -05:00
# Trick for extracting the DTB from
2022-11-26 02:06:36 -05:00
dtbextract : $(DTC)
2022-11-22 18:33:16 -08:00
# Need sudo apt install device-tree-compiler
cd buildroot && output/host/bin/qemu-system-riscv32 -cpu rv32,mmu=false -m 128M -machine virt -nographic -kernel output/images/Image -bios none -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -machine dumpdtb=../dtb.dtb && cd ..
2022-11-26 02:06:36 -05:00
$(DTC) -I dtb -O dts -o dtb.dts dtb.dtb
2022-11-22 18:33:16 -08:00
2022-11-21 07:08:31 -05:00
tests :
git clone https://github.com/riscv-software-src/riscv-tests
./configure --prefix=