Skip to content

Commit

Permalink
Merge pull request #362 from mithro/small-fixes
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
mithro committed Oct 14, 2017
2 parents 8f52555 + 09c224f commit 2c43d00
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 13 deletions.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,18 @@ third_party/%/.git: .gitmodules

# Image - a combination of multiple parts (gateware+bios+firmware+more?)
# --------------------------------------
ifeq ($(FIRMWARE),none)
OVERRIDE_FIRMWARE=--override-firmware=none
else
OVERRIDE_FIRMWARE=--override-firmware=$(FIRMWARE_FILEBASE).fbi
endif

$(IMAGE_FILE): $(GATEWARE_FILEBASE).bin $(BIOS_FILE) $(FIRMWARE_FILEBASE).fbi
$(PYTHON) mkimage.py \
$(MISOC_EXTRA_CMDLINE) $(LITEX_EXTRA_CMDLINE) \
--override-gateware=$(GATEWARE_FILEBASE).bin \
--override-bios=$(BIOS_FILE) \
--override-firmware=$(FIRMWARE_FILEBASE).fbi \
$(OVERRIDE_FIRMWARE) \
--output-file=$(IMAGE_FILE)

$(TARGET_BUILD_DIR)/image.bin: $(IMAGE_FILE)
Expand Down Expand Up @@ -225,6 +231,7 @@ env:
@echo "DEFAULT_TARGET='$(DEFAULT_TARGET)'"
@echo "CPU='$(CPU)'"
@echo "FIRMWARE='$(FIRMWARE)'"
@echo "OVERRIDE_FIRMWARE='$(OVERRIDE_FIRMWARE)'"
@echo "PROG='$(PROG)'"
@echo "TARGET_BUILD_DIR='$(TARGET_BUILD_DIR)'"
@echo "MISOC_EXTRA_CMDLINE='$(MISOC_EXTRA_CMDLINE)'"
Expand Down
4 changes: 1 addition & 3 deletions firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,15 @@ all: firmware.bin firmware.fbi
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
chmod -x $@
$(PYTHON) -m litex.soc.tools.mkmscimg $<

firmware.elf: $(FIRMWARE_DIRECTORY)/linker.ld $(OBJECTS)

%.elf:
%.elf: ../libbase/crt0-$(CPU).o ../libbase/libbase-nofloat.a ../libcompiler_rt/libcompiler_rt.a ../uip/libuip.a
$(LD) $(LDFLAGS) \
-T $(FIRMWARE_DIRECTORY)/linker.ld \
-N -o $@ \
../libbase/crt0-$(CPU).o \
$(OBJECTS) \
-L../libnet \
-L../libbase \
-lbase-nofloat \
-L../libcompiler_rt \
Expand Down
3 changes: 2 additions & 1 deletion gateware/spi_flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,5 @@ def SpiFlash(pads, *args, **kw):
if hasattr(pads, "mosi"):
return SpiFlashSingle(pads, *args, **kw)
else:
return SpiFlashDualQuad(pads, *args, **kw)
return SpiFlashDualQuad(pads, *args, **kw)

12 changes: 6 additions & 6 deletions mkimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def main():
gateware = args.override_gateware
if gateware:
assert os.path.exists(gateware), (
"Gateware file not found! "
"Use --override-gateware=none for no gateware.")
"Gateware file %r not found! "
"Use --override-gateware=none for no gateware." % gateware)

bios = os.path.join(builddir, "software", "bios", "bios.bin")
if args.override_bios:
Expand All @@ -49,8 +49,8 @@ def main():
bios = args.override_bios
if bios:
assert os.path.exists(bios), (
"BIOS file not found! "
"Use --override-bios=none for no BIOS.")
"BIOS file %r not found! "
"Use --override-bios=none for no BIOS." % bios)

firmware = os.path.join(builddir, "software", "firmware", "firmware.fbi")
if args.override_firmware:
Expand All @@ -60,8 +60,8 @@ def main():
firmware = args.override_firmware
if firmware:
assert os.path.exists(firmware), (
"Firmware file not found! "
"Use --override-firmware=none for no firmware.")
"Firmware file %r not found! "
"Use --override-firmware=none for no firmware." % firmware)

platform = make_platform(args)

Expand Down
1 change: 1 addition & 0 deletions scripts/build-micropython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fi

# Imports TARGET, PLATFORM, CPU and TARGET_BUILD_DIR from Makefile
eval $(make env)
make info

set -x
set -e
Expand Down
3 changes: 2 additions & 1 deletion scripts/build-qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fi

# Imports TARGET, PLATFORM, CPU and TARGET_BUILD_DIR from Makefile
eval $(make env)
make info

set -x
set -e
Expand Down Expand Up @@ -85,7 +86,7 @@ cd $TARGET_QEMU_BUILD_DIR
make -j8
cd $OLD_DIR

/usr/bin/env python mkimage.py $MISOC_EXTRA_CMDLINE $LITEX_EXTRA_CMDLINE --output-file=qemu.bin --override-gateware=none --force-image-size=true
/usr/bin/env python mkimage.py $MISOC_EXTRA_CMDLINE $LITEX_EXTRA_CMDLINE --output-file=qemu.bin --override-gateware=none --force-image-size=true $OVERRIDE_FIRMWARE
$TARGET_QEMU_BUILD_DIR/qemu-img convert -f raw $TARGET_BUILD_DIR/qemu.bin -O qcow2 -S 16M $TARGET_BUILD_DIR/qemu.qcow2

# BIOS
Expand Down
1 change: 1 addition & 0 deletions scripts/download-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ echo
echo "Installing python3.5"
conda install python=3.5
check_version python 3.5
echo "python ==3.5.4" > build/conda/conda-meta/pinned # Make sure it stays at version 3.5

echo ""
echo "Installing binaries into environment"
Expand Down
1 change: 1 addition & 0 deletions targets/atlys/Makefile.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# atlys loading

DEFAULT_TARGET = video
TARGET ?= $(DEFAULT_TARGET)

gateware-load-atlys: tftp
atlys-mode-switch --verbose --load-gateware $(GATEWARE_FILEBASE).bit
Expand Down
1 change: 1 addition & 0 deletions targets/opsis/Makefile.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# opsis loading

DEFAULT_TARGET = video
TARGET ?= $(DEFAULT_TARGET)

gateware-load-opsis:
opsis-mode-switch --verbose --load-gateware $(GATEWARE_FILEBASE).bit
Expand Down

0 comments on commit 2c43d00

Please sign in to comment.