From 94e923ef4656ff327bc88e35553a975b75d74bf3 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Thu, 8 Aug 2024 00:00:52 -0700 Subject: [PATCH] Additional Linux README updates --- linux/Makefile | 3 --- linux/README.MD | 29 ++++++++++++++++++----------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index 65632a0d0..033629255 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -76,8 +76,6 @@ $(RISCV): @ echo "and sourced setup.sh" # Disassembly rules --------------------------------------------------- - - disassemble: rm -rf $(BUILDROOT)/output/images/disassembly find $(BUILDROOT)/output/build/linux-* -maxdepth 1 -name "vmlinux" | xargs cp -t $(BUILDROOT)/output/images/ @@ -106,7 +104,6 @@ $(IMAGES)/busybox: cp $$busyboxDir/busybox $@ ;\ # Generating new Buildroot directories -------------------------------- - download: $(WALLYBOARD) cp $(WALLYBOARD)/main.config $(BUILDROOT)/.config @echo "Buildroot successfully download." diff --git a/linux/README.MD b/linux/README.MD index e052df9ae..ba7fb8dd4 100644 --- a/linux/README.MD +++ b/linux/README.MD @@ -5,30 +5,31 @@ 1. [Setting up Buildroot](#buildroot) 2. [Generating Device Tree Binaries](#devicetree) 3. [Disassembling the Binaries for Debugging](#disassembly) -4. [Creating a Bootable SD Card](#sdcard) +4. [Generating test-vectors for regression](#testvectors) +5. [Creating a Bootable SD Card](#sdcard) ## Setting up Buildroot -In order to generate the Linux and boot stage binaries compatible with Wally, Buildroot is used for cross-compilation. +In order to generate the Linux and boot stage binaries compatible with Wally, Buildroot is used for cross-compilation. To set up a Buildroot directory, configuration files for Buildroot, Linux, and Busybox must be copied into the correct locations inside the main Buildroot directory. Buildroot and device tree binaries must be generated as well. This can all be done automatically using the Makefile inside Wally's Linux subdirectory (this one). To install a new buildroot directory, build the Buildroot binaries, generate the device tree binaries, generate test-vectors for simulation, and install the buildroot package needed to build the SD card driver for Linux, run: $ make -This installs to the `$RISCV` directory. +This installs to the `$RISCV` directory. Buildroot itself is installed to `$RISCV/buildroot` and the test-vectors are installed to `$RISCV/linux-testvectors`. + +Optionally, you can override the `BUILDROOT` variable to install a different buildroot source directory. -Optionally, you can override the `BUILDROOT` variable to use a different buildroot source directory. - $ make install BUILDROOT=path/to/buildroot - + ## Generating Device Tree Binaries -The device tree files for the various FPGA's Wally supports, as well as QEMU's device tree for the virt machine, are located in the `./devicetree` subdirectory. These device tree files are necessary for the boot process. +The device tree files for the various FPGA's Wally supports, as well as QEMU's device tree for the virt machine, are located in the `./devicetree` subdirectory. These device tree files are necessary for the boot process. They are built automatically using the main `make` command. To build the device tree binaries (.dtb) from the device tree sources (.dts) separately, we can build all of them at once using: $ make generate #optionally override BUILDROOT - + The .dts files will end up in the `/output/images` folder of your chosen buildroot directory. ## Disassembling the Binaries for Debugging @@ -38,16 +39,22 @@ By using the `riscv64-unknown-elf-objdump` utility, we can disassemble the binar The disassembled binaries are built automatically using the main `make` command. To create the disassembled binaries separately, run: $ make disassemble #optionally override BUILDROOT - + You'll find the resulting disassembled files in `/output/images/disassembly`. +## Generate Memory Files for Linux Boot + +Running a linux boot simulation uses a preloaded bootrom and ram memory. We use QEMU to generate these preloaded memory files. The files are output to $RISCV/linux-testvectors. The memory files are generated automatically when using the main `make` command. Alternatively, they can be generated by running + + make dumptvs + ## Creating a Bootable SD Card To flash a bootable sd card for Wally's bootloader, use the `flash-sd.sh` script located in `/linux/sdcard`. The script allows you to specify which buildroot directory you would like to use and to specify the device tree. By default it is set up for the default location of buildroot in `$RISCV` and uses the vcu108 device tree. To use the script with your own buildroot directory and device tree, type: $ cd sdcard $ ./flash-sd.sh -b -d - + for example - + $ ./flash-sd.sh -b ~/repos/buildroot -d wally-vcu118.dtb /dev/sdb