From 9b831bc77f8a7a0046899075aa0f0016478f5bf2 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Thu, 8 Jun 2017 09:39:14 -0700 Subject: Add linker scripts that target the scratchpad Everything still defaults to the flash, but users can optionally select the scratchpad. Note that you have to be pretty careful about your scratchpad programs, most of them won't fit. For example, printf is too big to fit in the scratchpad. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index eedb007..11f239f 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ endif # Default target BOARD ?= freedom-e300-hifive1 PROGRAM ?= demo_gpio +LINK_TARGET ?= flash GDB_PORT ?= 3333 # Variables the user probably shouldn't override. @@ -191,11 +192,11 @@ PROGRAM_ELF = software/$(PROGRAM)/$(PROGRAM) .PHONY: software_clean software_clean: - $(MAKE) -C $(PROGRAM_DIR) BSP_BASE=$(abspath bsp) BOARD=$(BOARD) clean + $(MAKE) -C $(PROGRAM_DIR) CC=$(RISCV_GCC) RISCV_ARCH=$(RISCV_ARCH) RISCV_ABI=$(RISCV_ABI) AR=$(RISCV_AR) BSP_BASE=$(abspath bsp) BOARD=$(BOARD) LINK_TARGET=$(LINK_TARGET) clean .PHONY: software software: software_clean - $(MAKE) -C $(PROGRAM_DIR) CC=$(RISCV_GCC) RISCV_ARCH=$(RISCV_ARCH) RISCV_ABI=$(RISCV_ABI) AR=$(RISCV_AR) BSP_BASE=$(abspath bsp) BOARD=$(BOARD) + $(MAKE) -C $(PROGRAM_DIR) CC=$(RISCV_GCC) RISCV_ARCH=$(RISCV_ARCH) RISCV_ABI=$(RISCV_ABI) AR=$(RISCV_AR) BSP_BASE=$(abspath bsp) BOARD=$(BOARD) LINK_TARGET=$(LINK_TARGET) dasm: software $(RISCV_OBJDUMP) $(RISCV_OBJDUMP) -D $(PROGRAM_ELF) -- cgit v1.2.3