diff options
-rw-r--r-- | .gitmodules | 6 | ||||
-rw-r--r-- | FreedomStudio/E2FPGA/clic_vectored/.project | 12 | ||||
-rw-r--r-- | FreedomStudio/E2FPGA/coreplexip_welcome/.project | 12 | ||||
-rw-r--r-- | FreedomStudio/E2FPGA/dhrystone/.project | 38 | ||||
-rw-r--r-- | Makefile | 87 | ||||
-rw-r--r-- | README.md | 32 | ||||
-rw-r--r-- | bsp/drivers/clic/clic_driver.c | 2 | ||||
-rw-r--r-- | bsp/env/freedom-e300-arty/openocd.cfg | 4 | ||||
m--------- | openocd | 0 | ||||
m--------- | riscv-gnu-toolchain | 0 |
10 files changed, 41 insertions, 152 deletions
diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index eb6b315..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "openocd"] - path = openocd - url = https://github.com/sifive/riscv-openocd.git -[submodule "riscv-gnu-toolchain"] - path = riscv-gnu-toolchain - url = https://github.com/sifive/riscv-gnu-toolchain.git diff --git a/FreedomStudio/E2FPGA/clic_vectored/.project b/FreedomStudio/E2FPGA/clic_vectored/.project index 171cf91..9f821d4 100644 --- a/FreedomStudio/E2FPGA/clic_vectored/.project +++ b/FreedomStudio/E2FPGA/clic_vectored/.project @@ -120,16 +120,11 @@ <locationURI>PARENT-3-PROJECT_LOC/bsp/drivers/clic/clic_driver.c</locationURI> </link> <link> - <name>bsp/drivers/clic/plic_driver.h</name> + <name>bsp/drivers/clic/clic_driver.h</name> <type>1</type> <locationURI>PARENT-3-PROJECT_LOC/bsp/drivers/clic/clic_driver.h</locationURI> </link> <link> - <name>bsp/env/coreip-e2-arty/dhrystone.lds</name> - <type>1</type> - <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/dhrystone.lds</locationURI> - </link> - <link> <name>bsp/env/coreip-e2-arty/flash.lds</name> <type>1</type> <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/flash.lds</locationURI> @@ -315,6 +310,11 @@ <locationURI>PARENT-3-PROJECT_LOC/bsp/include/sifive/devices/aon.h</locationURI> </link> <link> + <name>bsp/include/sifive/devices/clic.h</name> + <type>1</type> + <locationURI>PARENT-3-PROJECT_LOC/bsp/include/sifive/devices/clic.h</locationURI> + </link> + <link> <name>bsp/include/sifive/devices/clint.h</name> <type>1</type> <locationURI>PARENT-3-PROJECT_LOC/bsp/include/sifive/devices/clint.h</locationURI> diff --git a/FreedomStudio/E2FPGA/coreplexip_welcome/.project b/FreedomStudio/E2FPGA/coreplexip_welcome/.project index 0d91d8d..29e06f6 100644 --- a/FreedomStudio/E2FPGA/coreplexip_welcome/.project +++ b/FreedomStudio/E2FPGA/coreplexip_welcome/.project @@ -120,16 +120,11 @@ <locationURI>PARENT-3-PROJECT_LOC/bsp/drivers/clic/clic_driver.c</locationURI> </link> <link> - <name>bsp/drivers/clic/plic_driver.h</name> + <name>bsp/drivers/clic/clic_driver.h</name> <type>1</type> <locationURI>PARENT-3-PROJECT_LOC/bsp/drivers/clic/clic_driver.h</locationURI> </link> <link> - <name>bsp/env/coreip-e2-arty/dhrystone.lds</name> - <type>1</type> - <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/dhrystone.lds</locationURI> - </link> - <link> <name>bsp/env/coreip-e2-arty/flash.lds</name> <type>1</type> <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/flash.lds</locationURI> @@ -315,6 +310,11 @@ <locationURI>PARENT-3-PROJECT_LOC/bsp/include/sifive/devices/aon.h</locationURI> </link> <link> + <name>bsp/include/sifive/devices/clic.h</name> + <type>1</type> + <locationURI>PARENT-3-PROJECT_LOC/bsp/include/sifive/devices/clic.h</locationURI> + </link> + <link> <name>bsp/include/sifive/devices/clint.h</name> <type>1</type> <locationURI>PARENT-3-PROJECT_LOC/bsp/include/sifive/devices/clint.h</locationURI> diff --git a/FreedomStudio/E2FPGA/dhrystone/.project b/FreedomStudio/E2FPGA/dhrystone/.project index 3407cae..9776e74 100644 --- a/FreedomStudio/E2FPGA/dhrystone/.project +++ b/FreedomStudio/E2FPGA/dhrystone/.project @@ -85,16 +85,16 @@ <locationURI>virtual:/virtual</locationURI> </link> <link> - <name>bsp/env/coreplexip-arty.h</name> - <type>1</type> - <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreplexip-arty.h</locationURI> - </link> - <link> <name>bsp/env/coreip-e2-arty</name> <type>2</type> <locationURI>virtual:/virtual</locationURI> </link> <link> + <name>bsp/env/coreplexip-arty.h</name> + <type>1</type> + <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreplexip-arty.h</locationURI> + </link> + <link> <name>bsp/env/encoding.h</name> <type>1</type> <locationURI>PARENT-3-PROJECT_LOC/bsp/env/encoding.h</locationURI> @@ -140,16 +140,6 @@ <locationURI>PARENT-3-PROJECT_LOC/bsp/drivers/fe300prci/fe300prci_driver.c</locationURI> </link> <link> - <name>bsp/env/coreip-e2-arty/tim-split.lds</name> - <type>1</type> - <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/tim-split.lds</locationURI> - </link> - <link> - <name>bsp/env/coreip-e2-arty/tim.lds</name> - <type>1</type> - <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/tim.lds</locationURI> - </link> - <link> <name>bsp/env/coreip-e2-arty/flash.lds</name> <type>1</type> <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/flash.lds</locationURI> @@ -170,14 +160,19 @@ <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/platform.h</locationURI> </link> <link> - <name>bsp/env/coreip-e2-arty/scratchpad.lds</name> + <name>bsp/env/coreip-e2-arty/settings.mk</name> <type>1</type> - <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/scratchpad.lds</locationURI> + <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/settings.mk</locationURI> </link> <link> - <name>bsp/env/coreip-e2-arty/settings.mk</name> + <name>bsp/env/coreip-e2-arty/tim-split.lds</name> <type>1</type> - <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/settings.mk</locationURI> + <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/tim-split.lds</locationURI> + </link> + <link> + <name>bsp/env/coreip-e2-arty/tim.lds</name> + <type>1</type> + <locationURI>PARENT-3-PROJECT_LOC/bsp/env/coreip-e2-arty/tim.lds</locationURI> </link> <link> <name>bsp/include/sifive/bits.h</name> @@ -330,6 +325,11 @@ <locationURI>PARENT-3-PROJECT_LOC/bsp/include/sifive/devices/aon.h</locationURI> </link> <link> + <name>bsp/include/sifive/devices/clic.h</name> + <type>1</type> + <locationURI>PARENT-3-PROJECT_LOC/bsp/include/sifive/devices/clic.h</locationURI> + </link> + <link> <name>bsp/include/sifive/devices/clint.h</name> <type>1</type> <locationURI>PARENT-3-PROJECT_LOC/bsp/include/sifive/devices/clint.h</locationURI> @@ -19,9 +19,6 @@ GDB_PORT ?= 3333 # Variables the user probably shouldn't override. builddir := work/build -installdir := work/install -toolchain_srcdir := riscv-gnu-toolchain -openocd_srcdir := openocd ############################################################# # BSP Loading @@ -68,18 +65,6 @@ help: @echo " SiFive Freedom E Software Development Kit " @echo " Makefile targets:" @echo "" - @echo " tools [BOARD = $(BOARD)]:" - @echo " Install compilation & debugging tools to target your desired board." - @echo "" - @echo " toolchain-clean:" - @echo " Removes the installed toolchain." - @echo "" - @echo " openocd-clean:" - @echo " Removes the locally built instance of OpenOCD." - @echo "" - @echo " uninstall:" - @echo " Uninstall the compilation & debugging tools." - @echo "" @echo " software [PROGRAM=$(PROGRAM) BOARD=$(BOARD)]:" @echo " Build a software program to load with the" @echo " debugger." @@ -103,12 +88,9 @@ help: @echo " For more information, visit dev.sifive.com" ############################################################# -# This section is for tool installation +# This section is for tool configuration ############################################################# -.PHONY: tools -tools: riscv-gnu-toolchain openocd -# Pointers to various important tools in the toolchain. toolchain_builddir := $(builddir)/riscv-gnu-toolchain/riscv64-unknown-elf toolchain_prefix := $(toolchain_builddir)/prefix @@ -122,73 +104,6 @@ RISCV_AR := $(abspath $(RISCV_PATH)/bin/riscv64-unknown-elf-ar) PATH := $(abspath $(RISCV_PATH)/bin):$(PATH) -$(RISCV_GCC) $(RISCV_GXX) $(RISCV_OBJDUMP) $(RISCV_GDB) $(RISCV_AR): $(toolchain_builddir)/install.stamp - touch -c $@ - -# Builds riscv-gnu-toolchain, which contains GCC and all the supporting -# software for C code. -.PHONY: riscv-gnu-toolchain -riscv-gnu-toolchain: $(RISCV_GCC) $(RISCV_GXX) $(RISCV_OBJDUMP) $(RISCV_GDB) $(RISCV_AR) - -$(builddir)/riscv-gnu-toolchain/%/install.stamp: $(builddir)/riscv-gnu-toolchain/%/build.stamp - $(MAKE) -C $(dir $@) install - date > $@ - -$(builddir)/riscv-gnu-toolchain/%/build.stamp: $(builddir)/riscv-gnu-toolchain/%/configure.stamp - $(MAKE) -C $(dir $@) - date > $@ - -$(builddir)/riscv-gnu-toolchain/%-elf/configure.stamp: - $(eval $@_TUPLE := $(patsubst $(builddir)/riscv-gnu-toolchain/%-elf/configure.stamp,%,$@)) - rm -rf $(dir $@) - mkdir -p $(dir $@) - cd $(dir $@); $(abspath $(toolchain_srcdir)/configure) \ - --prefix=$(abspath $(dir $@)/prefix) \ - --disable-linux \ - --enable-multilib \ - --with-cmodel=medany \ - --with-libgcc-cmodel - date > $@ - -.PHONY: toolchain-clean -toolchain-clean: - rm -rf $(toolchain_builddir) - -# Builds and installs OpenOCD, which translates GDB into JTAG for debugging and -# initializing the target. -openocd_builddir := $(builddir)/openocd -openocd_prefix := $(openocd_builddir)/prefix - -RISCV_OPENOCD_PATH ?= $(openocd_prefix) -RISCV_OPENOCD ?= $(RISCV_OPENOCD_PATH)/bin/openocd - -.PHONY: openocd -openocd: $(RISCV_OPENOCD) - -$(RISCV_OPENOCD): $(openocd_builddir)/install.stamp - touch -c $@ - -$(openocd_builddir)/install.stamp: $(openocd_builddir)/build.stamp - $(MAKE) -C $(dir $@) install - date > $@ - -$(openocd_builddir)/build.stamp: $(openocd_builddir)/configure.stamp - $(MAKE) -C $(dir $@) - date > $@ - -$(openocd_builddir)/configure.stamp: - rm -rf $(dir $@) - mkdir -p $(dir $@) - cd $(abspath $(openocd_srcdir)); autoreconf -i - cd $(dir $@); $(abspath $(openocd_srcdir)/configure) \ - --prefix=$(abspath $(dir $@)/prefix) \ - --disable-werror - date > $@ - -.PHONY: openocd-clean -openocd-clean: - rm -rf $(openocd_builddir) - ############################################################# # This Section is for Software Compilation ############################################################# @@ -4,8 +4,6 @@ This repository, maintained by SiFive, Inc, makes it easy to get started develop ### Contents ### -* RISC-V Software Toolchain -* RISC-V Debugging Toolchain * Board Support Packages for FE310 and Development Kits * A Few Example Programs @@ -24,33 +22,15 @@ cd freedom-e-sdk make help ``` -#### Building Tools from Source #### +#### Install the RISC-V Toolchain #### -Ubuntu packages needed: +The RISC-V GNU Toolchain and OpenOCD are available from the SiFive Website at - $ sudo apt-get install autoconf automake libmpc-dev libmpfr-dev libgmp-dev gawk bison flex texinfo libtool libusb-1.0-0-dev make g++ pkg-config libexpat1-dev zlib1g-dev +https://www.sifive.com/boards -Next, build the tools: - -``` -cd freedom-e-sdk -make tools [BOARD=freedom-e300-hifive1] -``` - -If your machine has enough resources, you can speed up the build process by adding `-j n` to `make`, where `n` is the number of processors of your build system. - - -#### Using Pre-Built Binary Tools #### - -If you would like to avoid compiling the tools from source, they are -available as pre-built binaries from - -https://www.sifive.com/products/tools - -For OpenOCD and/or RISC-V GNU Toolchain, -download the .tar.gz for your platform, and unpack it to -your desired location. Then, use the `RISCV_PATH` and `RISCV_OPENOCD_PATH` -variables when attempting to use the tools: +For OpenOCD and/or RISC-V GNU Toolchain, download the .tar.gz for your platform, +and unpack it to your desired location. Then, use the `RISCV_PATH` and +`RISCV_OPENOCD_PATH` variables when attempting to use the tools: ``` cp openocd-<date>-<platform>.tar.gz /my/desired/location/ diff --git a/bsp/drivers/clic/clic_driver.c b/bsp/drivers/clic/clic_driver.c index 0612e58..136ccee 100644 --- a/bsp/drivers/clic/clic_driver.c +++ b/bsp/drivers/clic/clic_driver.c @@ -30,7 +30,7 @@ void clic_init ( this_clic->num_config_bits= num_config_bits; //initialize vector table - for(int i=0;i++;i<num_irq) { + for(int i=0;i<num_irq;i++) { this_clic->vect_table[i] = default_handler; } diff --git a/bsp/env/freedom-e300-arty/openocd.cfg b/bsp/env/freedom-e300-arty/openocd.cfg index f4b28ed..ba13207 100644 --- a/bsp/env/freedom-e300-arty/openocd.cfg +++ b/bsp/env/freedom-e300-arty/openocd.cfg @@ -13,13 +13,13 @@ ftdi_layout_signal LED -data 0x0800 # set _CHIPNAME riscv -jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x10e31913 +jtag newtap $_CHIPNAME cpu -irlen 5 set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME riscv -chain-position $_TARGETNAME $_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 -flash bank my_first_flash fespi 0x20000000 0 0 0 $_TARGETNAME +flash bank my_first_flash fespi 0x20000000 0 0 0 $_TARGETNAME 0x10014000 init #reset if {[ info exists pulse_srst]} { diff --git a/openocd b/openocd deleted file mode 160000 -Subproject 29d37f75a977125127be2760be9e465d2da095a diff --git a/riscv-gnu-toolchain b/riscv-gnu-toolchain deleted file mode 160000 -Subproject efa1d4cc1ab2af031332badf343add080990b82 |