2 ##>! Zerocat Chipflasher --- Flash free firmware to BIOS chips,
3 ##>! kick the Manageability Engine.
5 ##>! Copyright (C) 2017, 2018 Kai Mertens <kmx@posteo.net>
7 ##>! The Zerocat Chipflasher is free software: you can redistribute it
8 ##>! and/or modify it under the terms of the GNU General Public License
9 ##>! as published by the Free Software Foundation, either version 3 of
10 ##>! the License, or (at your option) any later version.
12 ##>! The Zerocat Chipflasher is distributed in the hope that it will be
13 ##>! useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 ##>! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ##>! GNU General Public License for more details.
17 ##>! You should have received a copy of the GNU General Public License
18 ##>! along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ##>! This file is part of the Zerocat Chipflasher.
23 ##>! @file Startfile.mk
25 ##>! @brief Operate the chipflasher.
28 ##>! `$ make -f Startfile.mk <target>`
32 #######################################################################
33 # Variable settings for sub-shells. FIXME refine this:
34 # Have to set shell explicitly for PATH setting to take effect (why?)
38 #######################################################################
40 PATH_PARALLAX = /opt/parallax/
41 PATH_GNUGUIX = $(shell echo "$$GUIX_ENVIRONMENT"/;)
42 PATH_HOST_SRC = ../../host/src/
43 PROPLOAD_PARALLAX = $(PATH_PARALLAX)bin/propeller-load
44 PROPLOAD_GNUGUIX = $(PATH_GNUGUIX)bin/propeller-load
47 #######################################################################
49 # possibly to be overridden by those in Startfile.cfg
50 PROPLOAD = $(PROPLOAD_PARALLAX)
51 -include Startfile.cfg
54 #######################################################################
55 # options for propeller-load and connect
56 TTY_PORT = ./tty_port_pointer
58 # TTY_BAUDRATE: If you update this to other values like B38400 or B57600,
59 # please don't forget to update 'baudrate' in board.cfg accordingly!
60 TTY_BAUDRATE = B115200
61 #~ TTY_BAUDRATE = B38400
63 CHIP2FILE = chip2file.txt
64 FILE2CHIP = file2chip.txt
67 #######################################################################
68 # Explicit dependencies
69 .PHONY: terminal loadram loadrom startram startrom start
71 # load kick into ram, run and start a propeller-terminal
73 $(PROPLOAD) -p $(TTY_PORT) -b board:terminal kick.elf -r -t -q;
75 # load kick into ram and run
77 $(PROPLOAD) -p $(TTY_PORT) -b board:rstdisable kick.elf -r; \
80 # load kick into eeprom, don't run
82 $(PROPLOAD) -p $(TTY_PORT) -b board kick.elf -e;
84 # load kick into RAM and start connect
85 startram: loadram start
87 # load kick into eeprom and start connect
88 startrom: loadrom start
92 $(PATH_HOST_SRC)./connect $(CHIP2FILE) $(FILE2CHIP) $(TTY_PORT) $(TTY_BAUDRATE);
95 #######################################################################
96 # FIXME Those steps missing:
97 # propeller-load -s cmm/libfdserial.elf
98 # propeller-elf-objdump -h cmm/libfdserial.elf