Skip to content

Instantly share code, notes, and snippets.

@pdp7
Created June 28, 2024 02:22
Show Gist options
  • Save pdp7/0dc4b92e797a2cd349bf96ba2639e687 to your computer and use it in GitHub Desktop.
Save pdp7/0dc4b92e797a2cd349bf96ba2639e687 to your computer and use it in GitHub Desktop.
RISC-V: ACPI: Add external interrupt controller support https://lore.kernel.org/linux-riscv/20240601150411.1929783-1-sunilvl@ventanamicro.com/
cat /data/dfustini/demo/docker/Dockerfile 
#########################
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update
RUN apt-get install -y cmake gcc g++ git libglib2.0-dev ninja-build python3 python3-distutils python3-dev python3-pip
########################
cd /data/dfustini/demo/docker
docker build -t dfustini .

cd /data/dfustini/demo/linux
make ARCH=riscv CROSS_COMPILE=/opt/tenstorrent/tt-riscv-toolchain-latest/bin/riscv64-unknown-linux-gnu- -j128
cd /data/dfustini/demo
docker run -v $HOME/data/demo:/demo -it dfustini bash -c 'cd /demo/qemu; \
  ./configure --target-list=riscv64-softmmu  --enable-slirp'

cd /data/dfustini/demo
docker run -v $HOME/data/demo:/demo -it dfustini bash -c 'cd /demo/qemu; make -j128'
cd /data/dfustini/demo
docker run -v $HOME/data/demo:/demo -it dfustini bash -c 'cd /demo; \
  qemu/build/qemu-system-riscv64 -M virt,pflash0=pflash0,pflash1=pflash1 \
  -m 2G -serial mon:stdio -nographic \
  -blockdev node-name=pflash0,driver=file,read-only=on,filename=RISCV_VIRT_CODE.fd \
  -blockdev node-name=pflash1,driver=file,filename=RISCV_VIRT_VARS.fd \
  -append "root=/dev/ram ro console=hvc earlycon=sbi loglevel=8" \
  -kernel linux/arch/riscv/boot/Image \
  -bios opensbi/build/platform/generic/firmware/fw_dynamic.bin \
  -smp 2'
cd /data/dfustini/demo
docker run -v $HOME/data/demo:/demo -it dfustini bash -c 'cd /demo; \
  qemu/build/qemu-system-riscv64 \
 -M virt,pflash0=pflash0,pflash1=pflash1,aia=aplic-imsic \
 -m 2G -smp 8 \
 -serial mon:stdio \
 -device virtio-gpu-pci -full-screen \
 -device qemu-xhci \
 -device usb-kbd \
 -blockdev node-name=pflash0,driver=file,read-only=on,filename=RISCV_VIRT_CODE.fd \
 -blockdev node-name=pflash1,driver=file,filename=RISCV_VIRT_VARS.fd \
 -netdev user,id=net0 -device virtio-net-pci,netdev=net0 \
 -kernel linux/arch/riscv/boot/Image \
 -initrd buildroot/output/images/rootfs.cpio \
 -append "root=/dev/ram ro console=hvc0 rootwait earlycon=sbi" '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment