Skip to content

Commit

Permalink
Add riscv32 target.
Browse files Browse the repository at this point in the history
  • Loading branch information
landley committed Aug 12, 2024
1 parent 650ff11 commit b9a4c1a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mkroot/mkroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,17 @@ get_target_config()
PPC_{PSERIES,OF_BOOT_TRAMPOLINE,TRANSACTIONAL_MEM,DISABLE_WERROR} \
SCSI_{LOWLEVEL,IBMVSCSI})"
[ "$CROSS" == powerpc64le ] && KCONF=$KCONF,CPU_LITTLE_ENDIAN
elif [ "$CROSS" = riscv32 ]; then
# Note: -hda file.img doesn't work, but this insane overcomplicated pile:
# -drive file=file.img,format=raw,id=hd0 -device virtio-blk-device,drive=hd0
QEMU="riscv32 -M virt -netdev user,id=net0 -device virtio-net-device,netdev=net0"
KARCH=riscv VMLINUX=Image
# Probably only about half of these kernel symbols are actually needed?
KCONF="$(be2csv MMU SOC_VIRT NONPORTABLE ARCH_RV32I CMODEL_MEDANY \
RISCV_ISA_{ZICBO{M,Z},FALLBACK} FPU PCI{,_HOST_GENERIC} BLK_DEV_SD \
SCSI_{PROC_FS,LOWLEVEL,VIRTIO} VIRTIO_{MENU,NET,BLK,PCI} SERIO_SERPORT \
SERIAL_{EARLYCON,8250{,_CONSOLE,_PCI},OF_PLATFORM} HW_RANDOM{,_VIRTIO} \
RTC_{CLASS,HCTOSYS} DMADEVICES VIRTIO_{MENU,PCI{,_LEGACY},INPUT,MMIO})"
elif [ "$CROSS" = s390x ]; then
QEMU="s390x" KARCH=s390 VMLINUX=bzImage
KCONF="$(be2csv MARCH_Z900 PACK_STACK S390_GUEST VIRTIO_{NET,BLK} \
Expand Down

0 comments on commit b9a4c1a

Please sign in to comment.