forked from timvideos/HDMI2USB-litex-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (51 loc) · 1.82 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
BOARD ?= atlys
MSCDIR ?= ../misoc
PROG ?= impact
SERIAL ?= /dev/ttyVIZ0
TARGET ?= hdmi2usb
HDMI2USBDIR = ../HDMI2USB-misoc-firmware
PYTHON = python3
CMD = $(PYTHON) make.py -X $(HDMI2USBDIR) -t $(BOARD)_$(TARGET) -Ot firmware_filename $(HDMI2USBDIR)/firmware/lm32/firmware.bin -Op programmer $(PROG)
ifeq ($(OS),Windows_NT)
FLTERM = $(PYTHON) $(MSCDIR)/tools/flterm.py
else
FLTERM = $(MSCDIR)/tools/flterm
endif
help:
@echo "Targets avaliable:"
@echo " make gateware"
@echo " make load-gateware"
@echo " make load-lm32-firmware"
@echo " make clean"
@echo ""
@echo "Environment:"
@echo " BOARD=atlys OR opsis (current: $(BOARD))"
@echo " TARGET=base OR hdmi2usb OR hdmi2ethernet"
@echo " (current: $(TARGET)"
@echo " MSCDIR=misoc directory (current: $(MSCDIR))"
@echo " PROG=programmer (current: $(PROG))"
@echo " SERIAL=serial port (current: $(SERIAL))"
gateware: lm32-firmware
cd $(MSCDIR) && $(CMD) --csr_csv $(HDMI2USBDIR)/test/csr.csv clean
cp hdl/encoder/vhdl/header.hex $(MSCDIR)/build/header.hex
cd $(MSCDIR) && $(CMD) --csr_csv $(HDMI2USBDIR)/test/csr.csv build-csr-csv build-bitstream
load-gateware:
cd $(MSCDIR) && $(CMD) load-bitstream
lm32-firmware:
cd $(MSCDIR) && $(CMD) build-headers
$(MAKE) -C firmware/lm32 all
load-lm32-firmware: lm32-firmware
$(FLTERM) --port $(SERIAL) --kernel=firmware/lm32/firmware.bin --kernel-adr=0x20000000 --speed 115200
fx2-firmware:
$(MAKE) -C firmware/fx2
load-fx2-firmware: fx2-firmware
firmware/fx2/download.sh firmware/fx2/hdmi2usb.hex
clean:
cd $(MSCDIR) && $(CMD) clean
$(MAKE) -C firmware/lm32 clean
$(MAKE) -C firmware/fx2 clean
load: load-gateware load-lm32-firmware load-fx2-firmware
view:
guvcview --device=/dev/video0 --show_fps=1 --size=1024X768
all: gateware load-gateware load-lm32-firmware
.PHONY: lm32-firmware load clean