Skip to content

Commit

Permalink
Merge pull request #414 from mithro/master
Browse files Browse the repository at this point in the history
Merging latest LiteX-BuildEnv commits
  • Loading branch information
mithro committed Mar 10, 2018
2 parents a112978 + 50f0ec4 commit 619dcf9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,13 @@ third_party/%/.git: .gitmodules
# --------------------------------------
ifeq ($(FIRMWARE),none)
OVERRIDE_FIRMWARE=--override-firmware=none
FIRMWARE_FBI=
else
OVERRIDE_FIRMWARE=--override-firmware=$(FIRMWARE_FILEBASE).fbi
FIRMWARE_FBI=$(FIRMWARE_FILEBASE).fbi
endif

$(IMAGE_FILE): $(GATEWARE_FILEBASE).bin $(BIOS_FILE) $(FIRMWARE_FILEBASE).fbi
$(IMAGE_FILE): $(GATEWARE_FILEBASE).bin $(BIOS_FILE) $(FIRMWARE_FBI)
$(PYTHON) mkimage.py \
$(MISOC_EXTRA_CMDLINE) $(LITEX_EXTRA_CMDLINE) $(MAKE_LITEX_EXTRA_CMDLINE) \
--override-gateware=$(GATEWARE_FILEBASE).bin \
Expand Down Expand Up @@ -337,7 +339,7 @@ bios-flash: $(BIOS_FILE) bios-flash-$(PLATFORM)
# We can run the TFTP server as the user if port >= 1024
# otherwise we need to run as root using sudo

ATFTPD:=$(shell which atftpd)
ATFTPD:=$(shell which atftpd 2>/dev/null)
ifeq ($(ATFTPD),)
ATFTPD:=/usr/sbin/atftpd
endif
Expand All @@ -347,7 +349,7 @@ endif
# even if run as current user, otherwise it reports
# "cannot set groups for user $USER"
#
IN_TFTPD:=$(shell which in.tftpd)
IN_TFTPD:=$(shell which in.tftpd 2>/dev/null)
ifeq ($(IN_TFTPD),)
IN_TFTPD:=/usr/sbin/in.tftpd
endif
Expand Down
2 changes: 1 addition & 1 deletion scripts/enter-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,4 @@ litex_buildenv_prompt() {
;;
esac
}
PROMPT_COMMAND=litex_buildenv_prompt
PROMPT_COMMAND="litex_buildenv_prompt; ${PROMPT_COMMAND}"
22 changes: 20 additions & 2 deletions targets/mimasv2/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,26 @@ gateware-load-$(PLATFORM):
@echo "make gateware-flash"
@false

gateware-flash-$(PLATFORM):
$(PYTHON) $$(which MimasV2Config.py) $(PROG_PORT) $(GATEWARE_FILEBASE).bin
# On Mimas v2 both the gateware and the BIOS need to be in the same flash,
# which means that they can only really usefully be updated together. As
# a result we should flash "Gateware + BIOS + no application" if the user
# asks us to flash the gatware. This mirrors the behaviour of embedding
# the BIOS in the Gateware loaded via gateware-load, on other platforms,
# eg, on the Arty.
#
GATEWARE_BIOS_FILE = $(TARGET_BUILD_DIR)/image-gateware+bios+none.bin

gateware-flash-$(PLATFORM): $(GATEWARE_BIOS_FILE)
$(PYTHON) $$(which MimasV2Config.py) $(PROG_PORT) $(GATEWARE_BIOS_FILE)

# To avoid duplicating the mkimage.py call here, if the user has not
# already built a image-gateware+bios+none.bin, we call make recursively
# to build one here, with the FIRMWARE=none override.
#
ifneq ($(GATEWARE_BIOS_FILE),$(IMAGE_FILE))
$(GATEWARE_BIOS_FILE): $(GATEWARE_FILEBASE).bin $(BIOS_FILE) mkimage.py
FIRMWARE=none make image
endif

# Firmware
firmware-load-$(PLATFORM):
Expand Down

0 comments on commit 619dcf9

Please sign in to comment.