Skip to content

Commit

Permalink
[timvideos#387] Temporarily switch to a built-in DTB file on mor1kx
Browse files Browse the repository at this point in the history
This is to be reverted after the support for an external DTB file
is brought back to LiteX.
  • Loading branch information
mateusz-holenko committed Jul 13, 2020
1 parent a38d237 commit acae7a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,14 @@ tftp: $(FIRMWARE_FILEBASE).bin

ifeq ($(FIRMWARE),linux)
cp $(FIRMWARE_FILEBASE).bin $(TFTPD_DIR)/Image
cp $(FIRMWARE_DIR)/$(ROOTFS_FILE) $(TFTPD_DIR)/rootfs.cpio
cp $(FIRMWARE_DIR)/boot.json $(TFTPD_DIR)
ifeq ($(CPU),vexriscv)
cp $(FIRMWARE_DIR)/rv32.dtb $(TFTPD_DIR)
cp $(TARGET_BUILD_DIR)/emulator/emulator.bin $(TFTPD_DIR)
cp $(FIRMWARE_DIR)/$(ROOTFS_FILE) $(TFTPD_DIR)/rootfs.cpio
endif
ifeq ($(CPU),mor1kx)
cp $(FIRMWARE_DIR)/mor1kx.dtb $(TFTPD_DIR)
# ATM nothing, DTB in the future
endif
else
cp $(FIRMWARE_FILEBASE).bin $(TFTPD_DIR)/boot.bin
Expand Down
5 changes: 3 additions & 2 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ fi

LINUX_REMOTE="${LINUX_REMOTE:-https://github.com/litex-hub/linux.git}"
LINUX_REMOTE_NAME=litex-hub-linux
LINUX_BRANCH=${LINUX_BRANCH:-litex_buildenv}

RESOURCES_LOCATION="https://dl.antmicro.com/projects/renode/litex-buildenv/"

Expand All @@ -64,7 +63,9 @@ if [ ${CPU} = mor1kx ]; then
DTB=mor1kx.dtb
ROOTFS_MD5="c9ef89b45b0d2c34d14978a21f2863bd"
DTB_MD5="0271bc8f63f2d928dc9536ac31a2c6b9"
LINUX_BRANCH=${LINUX_BRANCH:-litex_buildenv-mor1kx}
elif [ ${CPU} = vexriscv ]; then
LINUX_BRANCH=${LINUX_BRANCH:-litex_buildenv}
export ARCH=riscv
ROOTFS=riscv32-rootfs.cpio
DTB=rv32.dtb
Expand Down Expand Up @@ -222,11 +223,11 @@ LLV_SRC="$TOP_DIR/third_party/linux-on-litex-vexriscv"
fetch_file $RESOURCES_LOCATION/$DTB_MD5-$DTB $DTB_MD5 $TARGET_LINUX_BUILD_DIR/$DTB

if [ ${CPU} = mor1kx ]; then
cp $TARGET_LINUX_BUILD_DIR/$DTB arch/openrisc/boot/dts
KERNEL_BINARY=vmlinux.bin

cat << EOF > $TARGET_LINUX_BUILD_DIR/boot.json
{
"mor1kx.dtb": "0x01000000",
"Image": "0x00000000"
}
EOF
Expand Down

0 comments on commit acae7a1

Please sign in to comment.