Skip to content

Commit

Permalink
firmware: Adding ASM for RISC-V soft cpus.
Browse files Browse the repository at this point in the history
  • Loading branch information
mithro committed Sep 5, 2018
1 parent 9292bb7 commit 951346f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 10 additions & 0 deletions firmware/asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
#define REBOOT __asm__("l.j 0")
#define NOP __asm__("l.nop")

#elif __picorv32__

#define REBOOT __asm__("jalr x0, 0")
#define NOP __asm__("nop")

#elif __vexriscv__

#define REBOOT __asm__("jalr x0, 0")
#define NOP __asm__("nop")

#else

#error "Unknown ARCH."
Expand Down
12 changes: 6 additions & 6 deletions scripts/download-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -326,20 +326,20 @@ check_exists flterm
# binutils for the target
echo
echo "Installing binutils for ${CPU_ARCH} (assembler, linker, and other tools)"
#conda install -y $CONDA_FLAGS binutils-${CPU_ARCH}-elf=$BINUTILS_VERSION
conda install -y $CONDA_FLAGS binutils-${CPU_ARCH}-elf=$BINUTILS_VERSION
check_version ${CPU_ARCH}-elf-ld $BINUTILS_VERSION

# gcc for the target
echo
echo "Installing gcc for ${CPU_ARCH} ('bare metal' C cross compiler)"
#conda install -y $CONDA_FLAGS gcc-${CPU_ARCH}-elf-nostdc=$GCC_VERSION
conda install -y $CONDA_FLAGS gcc-${CPU_ARCH}-elf-nostdc=$GCC_VERSION
check_version ${CPU_ARCH}-elf-gcc $GCC_VERSION

# gdb for the target
#echo
#echo "Installing gdb for ${CPU_ARCH} (debugger)"
#conda install -y $CONDA_FLAGS gdb-${CPU_ARCH}-elf=$GDB_VERSION
#check_version ${CPU_ARCH}-elf-gdb $GDB_VERSION
echo
echo "Installing gdb for ${CPU_ARCH} (debugger)"
conda install -y $CONDA_FLAGS gdb-${CPU_ARCH}-elf=$GDB_VERSION
check_version ${CPU_ARCH}-elf-gdb $GDB_VERSION

# openocd for programming via Cypress FX2
echo
Expand Down

0 comments on commit 951346f

Please sign in to comment.