Skip to content

Commit 619dcf9

Browse files
authored
Merge pull request #414 from mithro/master
Merging latest LiteX-BuildEnv commits
2 parents a112978 + 50f0ec4 commit 619dcf9

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,13 @@ third_party/%/.git: .gitmodules
178178
# --------------------------------------
179179
ifeq ($(FIRMWARE),none)
180180
OVERRIDE_FIRMWARE=--override-firmware=none
181+
FIRMWARE_FBI=
181182
else
182183
OVERRIDE_FIRMWARE=--override-firmware=$(FIRMWARE_FILEBASE).fbi
184+
FIRMWARE_FBI=$(FIRMWARE_FILEBASE).fbi
183185
endif
184186

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

340-
ATFTPD:=$(shell which atftpd)
342+
ATFTPD:=$(shell which atftpd 2>/dev/null)
341343
ifeq ($(ATFTPD),)
342344
ATFTPD:=/usr/sbin/atftpd
343345
endif
@@ -347,7 +349,7 @@ endif
347349
# even if run as current user, otherwise it reports
348350
# "cannot set groups for user $USER"
349351
#
350-
IN_TFTPD:=$(shell which in.tftpd)
352+
IN_TFTPD:=$(shell which in.tftpd 2>/dev/null)
351353
ifeq ($(IN_TFTPD),)
352354
IN_TFTPD:=/usr/sbin/in.tftpd
353355
endif

scripts/enter-env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,4 @@ litex_buildenv_prompt() {
322322
;;
323323
esac
324324
}
325-
PROMPT_COMMAND=litex_buildenv_prompt
325+
PROMPT_COMMAND="litex_buildenv_prompt; ${PROMPT_COMMAND}"

targets/mimasv2/Makefile.mk

+20-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,26 @@ gateware-load-$(PLATFORM):
3030
@echo "make gateware-flash"
3131
@false
3232

33-
gateware-flash-$(PLATFORM):
34-
$(PYTHON) $$(which MimasV2Config.py) $(PROG_PORT) $(GATEWARE_FILEBASE).bin
33+
# On Mimas v2 both the gateware and the BIOS need to be in the same flash,
34+
# which means that they can only really usefully be updated together. As
35+
# a result we should flash "Gateware + BIOS + no application" if the user
36+
# asks us to flash the gatware. This mirrors the behaviour of embedding
37+
# the BIOS in the Gateware loaded via gateware-load, on other platforms,
38+
# eg, on the Arty.
39+
#
40+
GATEWARE_BIOS_FILE = $(TARGET_BUILD_DIR)/image-gateware+bios+none.bin
41+
42+
gateware-flash-$(PLATFORM): $(GATEWARE_BIOS_FILE)
43+
$(PYTHON) $$(which MimasV2Config.py) $(PROG_PORT) $(GATEWARE_BIOS_FILE)
44+
45+
# To avoid duplicating the mkimage.py call here, if the user has not
46+
# already built a image-gateware+bios+none.bin, we call make recursively
47+
# to build one here, with the FIRMWARE=none override.
48+
#
49+
ifneq ($(GATEWARE_BIOS_FILE),$(IMAGE_FILE))
50+
$(GATEWARE_BIOS_FILE): $(GATEWARE_FILEBASE).bin $(BIOS_FILE) mkimage.py
51+
FIRMWARE=none make image
52+
endif
3553

3654
# Firmware
3755
firmware-load-$(PLATFORM):

0 commit comments

Comments
 (0)