mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
commit
d3dc6a4237
@ -5,6 +5,7 @@ WALLY := $(shell dirname $(shell pwd))
|
||||
WALLYLINUX := $(shell pwd)
|
||||
DIS := ${IMAGES}/disassembly
|
||||
BRPACKAGES := $(WALLYLINUX)/buildroot-packages
|
||||
BR2023 := $(WALLYLINUX)/buildroot-config-src/buildroot-2023.05.1
|
||||
|
||||
# Buildroot Config Stuff
|
||||
WALLYBOARDSRC := $(WALLYLINUX)/buildroot-config-src/wally
|
||||
@ -26,6 +27,14 @@ BINARIES := fw_jump.elf vmlinux busybox
|
||||
OBJDUMPS := $(foreach name, $(BINARIES), $(basename $(name) .elf))
|
||||
OBJDUMPS := $(foreach name, $(OBJDUMPS), $(DIS)/$(name).objdump)
|
||||
|
||||
# LINUXDIR := $(shell ls $(BUILDROOT)/output/build | grep -e '^linux-[0-9]\+\.[0-9]\+\.[0-9]\+$$' )
|
||||
# LINUXDIR := $(BUILDROOT)/output/build/$(LINUXDIR)
|
||||
# BUSYBOXDIR := $(shell ls $(BUILDROOT)/output/build | grep -e '^linux-[0-9]\+\.[0-9]\+\.[0-9]\+$$' )
|
||||
# BUSYBOXDIR := $(BUILDROOT)/output/build/$(BUSYBOXDIR)
|
||||
|
||||
LINUXDIR := $(shell find $(BUILDROOT)/output/build -maxdepth 2 -type d -regex ".*/linux-[0-9]+\.[0-9]+\.[0-9]+$$")
|
||||
BUSYBOXDIR := $(shell find $(BUILDROOT)/output/build -maxdepth 2 -type d -regex ".*/busybox-[0-9]+\.[0-9]+\.[0-9]+$$")
|
||||
|
||||
.PHONY: all generate disassemble install clean cleanDTB cleanDriver test
|
||||
|
||||
# Generate all device trees -------------------------------------------
|
||||
@ -41,7 +50,8 @@ all:
|
||||
|
||||
# Temp rule for debugging
|
||||
test:
|
||||
@echo $(OBJDUMPS)
|
||||
@echo $(LINUXDIR)
|
||||
@echo $(BUSYBOXDIR)
|
||||
|
||||
generate: $(DTB) $(IMAGES)
|
||||
|
||||
@ -68,10 +78,10 @@ $(DIS)/%.objdump: $(IMAGES)/%.elf
|
||||
$(DIS)/%.objdump: $(IMAGES)/%
|
||||
riscv64-unknown-elf-objdump -S $< >> $@
|
||||
|
||||
$(IMAGES)/vmlinux: $(BUILDROOT)/output/build/linux-5.10.7/vmlinux
|
||||
$(IMAGES)/vmlinux: $(LINUXDIR)/vmlinux
|
||||
cp $< $@
|
||||
|
||||
$(IMAGES)/busybox: $(BUILDROOT)/output/build/busybox-1.33.0/busybox
|
||||
$(IMAGES)/busybox: $(BUSYBOXDIR)/busybox
|
||||
cp $< $@
|
||||
|
||||
# Generating new Buildroot directories --------------------------------
|
||||
@ -87,10 +97,16 @@ install: $(BUILDROOT)/package/fpga-axi-sdc $(WALLYBOARD) $(DRIVER)
|
||||
# $(WALLYBOARD)/linux.config: $(BRPACKAGES)/linux.config $(WALLYBOARD)
|
||||
# cp $(BRPACKAGES)/linux.config $@
|
||||
|
||||
# $(WALLYBOARD): $(BUILDROOT)
|
||||
# cp -r $(WALLYBOARDSRC) $(BUILDROOT)/board
|
||||
# cp $(BRPACKAGES)/wally.config $(WALLYBOARD)/main.config
|
||||
# cp $(BRPACKAGES)/linux.config $(WALLYBOARD)/linux.config
|
||||
|
||||
# CONFIG DEPENDENCIES 2023.05.1 ---------------------------------------
|
||||
$(WALLYBOARD): $(BUILDROOT)
|
||||
cp -r $(WALLYBOARDSRC) $(BUILDROOT)/board
|
||||
cp $(BRPACKAGES)/wally.config $(WALLYBOARD)/main.config
|
||||
cp $(BRPACKAGES)/linux.config $(WALLYBOARD)/linux.config
|
||||
cp $(BR2023)/main.config $(WALLYBOARD)/main.config
|
||||
cp $(BR2023)/linux.config $(WALLYBOARD)/linux.config
|
||||
|
||||
# Buildroot Package ---------------------------------------------------
|
||||
$(BUILDROOT)/package/fpga-axi-sdc: $(BUILDROOT) $(PATCHFILE) $(BRPACKAGES)/fpga-axi-sdc
|
||||
@ -103,14 +119,14 @@ $(PATCHFILE):
|
||||
|
||||
$(BUILDROOT):
|
||||
git clone https://github.com/buildroot/buildroot.git $@
|
||||
# cd $@; git checkout 2023.05.x
|
||||
cd $@; git checkout 2021.05
|
||||
cd $@; git checkout 2023.05.x
|
||||
#cd $@; git checkout 2021.05
|
||||
|
||||
$(DRIVER):
|
||||
@ if [ -d "$(WALLY)/addins/vivado-risc-v" ] ; then git submodule update --init $(WALLY)/addins/vivado-risc-v; fi
|
||||
cp ../addins/vivado-risc-v/patches/fpga-axi-sdc.c $@
|
||||
# For 2021.05
|
||||
sed -i "s|card_hw_reset|hw_reset|1" $@
|
||||
#sed -i "s|card_hw_reset|hw_reset|1" $@
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
|
@ -49,4 +49,13 @@ You'll find the resulting disassembled files in `<BUILDROOT>/output/images/disas
|
||||
|
||||
## Creating a Bootable SD Card <a name="sdcard"></a>
|
||||
|
||||
To flash a bootable sd card for Wally's bootloader, use the `flash-sd.sh` script located in `<WALLY>/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 `/opt/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 <path/to/buildroot> -d <device tree name> <DEVICE>
|
||||
|
||||
for example
|
||||
|
||||
$ ./flash-sd.sh -b ~/repos/buildroot -d wally-vcu118.dtb /dev/sdb
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
chosen {
|
||||
linux,initrd-end = <0x85c43a00>;
|
||||
linux,initrd-start = <0x84200000>;
|
||||
bootargs = "root=/dev/vda ro";
|
||||
bootargs = "console=ttyS0,115200 root=/dev/vda ro";
|
||||
stdout-path = "/soc/uart@10000000";
|
||||
};
|
||||
|
||||
|
@ -22,6 +22,7 @@ BOLDYELLOW="\e[1;33m"
|
||||
NC="\e[0m"
|
||||
NAME="$BOLDGREEN"${0:2}:"$NC"
|
||||
ERRORTEXT="$BOLDRED"ERROR:"$NC"
|
||||
WARNINGTEXT="$BOLDYELLOW"Warning:"$NC"
|
||||
|
||||
# Default values for buildroot and device tree
|
||||
RISCV=/opt/riscv
|
||||
@ -110,7 +111,7 @@ echo -e "$NAME Device tree block size: $DST_SIZE"
|
||||
echo -e "$NAME OpenSBI FW_JUMP block size: $FW_JUMP_SIZE"
|
||||
echo -e "$NAME Kernel block size: $KERNEL_SIZE"
|
||||
|
||||
read -p "Warning: Doing this will replace all data on this card. Continue? y/n: " -n 1 -r
|
||||
read -p $'\e[1;33mWarning:\e[0m Doing this will replace all data on this card. Continue? y/n: ' -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]] ; then
|
||||
DEVBASENAME=$(basename $SDCARD)
|
||||
@ -150,16 +151,16 @@ if [[ $REPLY =~ ^[Yy]$ ]] ; then
|
||||
|
||||
sleep 3
|
||||
|
||||
echo -e "$NAME: Copying binaries into their partitions."
|
||||
echo -e "$NAME Copying binaries into their partitions."
|
||||
DD_FLAGS="bs=4k iflag=fullblock oflag=direct conv=fsync status=progress"
|
||||
|
||||
echo -e "$NAME: Copying device tree"
|
||||
echo -e "$NAME Copying device tree"
|
||||
sudo dd if=$DEVICE_TREE of="$SDCARD"1 $DD_FLAGS
|
||||
|
||||
echo -e "$NAME: Copying OpenSBI"
|
||||
echo -e "$NAME Copying OpenSBI"
|
||||
sudo dd if=$FW_JUMP of="$SDCARD"2 $DD_FLAGS
|
||||
|
||||
echo -e "$NAME: Copying Kernel"
|
||||
echo -e "$NAME Copying Kernel"
|
||||
sudo dd if=$LINUX_KERNEL of="$SDCARD"3 $DD_FLAGS
|
||||
|
||||
sudo mkfs.ext4 "$SDCARD"4
|
||||
|
Loading…
Reference in New Issue
Block a user