Zerocat Chipflasher  v0.4.3 (board-edition-1)
Flash free firmware to BIOS chips, kick the Manageability Engine.
Startfile.mk
Go to the documentation of this file.
1 ##>!
2 ##>! Zerocat Chipflasher --- Flash free firmware to BIOS chips,
3 ##>! kick the Manageability Engine.
4 ##>!
5 ##>! Copyright (C) 2017, 2018 Kai Mertens <kmx@posteo.net>
6 ##>!
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.
11 ##>!
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.
16 ##>!
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/>.
19 ##>!
20 ##>! This file is part of the Zerocat Chipflasher.
21 ##>!
22 ##>!
23 ##>! @file Startfile.mk
24 ##>!
25 ##>! @brief Operate the chipflasher.
26 ##>!
27 ##>! Usage:
28 ##>! `$ make -f Startfile.mk <target>`
29 ##>!
30 
31 ##>! @cond
32 #######################################################################
33 # Variable settings for sub-shells. FIXME refine this:
34 # Have to set shell explicitly for PATH setting to take effect (why?)
35 SHELL := /bin/sh
36 
37 
38 #######################################################################
39 # Options
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
45 
46 
47 #######################################################################
48 # Settings
49 # possibly to be overridden by those in Startfile.cfg
50 PROPLOAD = $(PROPLOAD_PARALLAX)
51 -include Startfile.cfg
52 
53 
54 #######################################################################
55 # options for propeller-load and connect
56 TTY_PORT = ./tty_port_pointer
57 
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
62 
63 CHIP2FILE = chip2file.txt
64 FILE2CHIP = file2chip.txt
65 
66 
67 #######################################################################
68 # Explicit dependencies
69 .PHONY: terminal loadram loadrom startram startrom start
70 
71 # load kick into ram, run and start a propeller-terminal
72 terminal:
73  $(PROPLOAD) -p $(TTY_PORT) -b board:terminal kick.elf -r -t -q;
74 
75 # load kick into ram and run
76 loadram:
77  $(PROPLOAD) -p $(TTY_PORT) -b board:rstdisable kick.elf -r; \
78  sleep 1.5s;
79 
80 # load kick into eeprom, don't run
81 loadrom:
82  $(PROPLOAD) -p $(TTY_PORT) -b board kick.elf -e;
83 
84 # load kick into RAM and start connect
85 startram: loadram start
86 
87 # load kick into eeprom and start connect
88 startrom: loadrom start
89 
90 # start connect
91 start:
92  $(PATH_HOST_SRC)./connect $(CHIP2FILE) $(FILE2CHIP) $(TTY_PORT) $(TTY_BAUDRATE);
93 
94 
95 #######################################################################
96 # FIXME Those steps missing:
97 # propeller-load -s cmm/libfdserial.elf
98 # propeller-elf-objdump -h cmm/libfdserial.elf
99 ##>! @endcond