Reintegrating glitching code.
[goodfet] / firmware / config.mk
1 ##################################
2 ## These are production boards.
3 ##################################
4
5
6 ifneq (,$(findstring $(board),goodfet20 goodfet10 goodfet11))
7 mcu ?= msp430f1612
8 platform := goodfet
9 endif
10
11 ifneq (,$(findstring $(board),goodfet21))
12 mcu ?= msp430f2618
13 platform := goodfet
14 endif
15
16 ifneq (,$(findstring $(board),goodfet30 goodfet31))
17 mcu ?= msp430f2274
18 platform := goodfet
19 # This will link to fit in a '2254, so unneeded packages should be omited.
20 CONFIG_ccspi = n
21 endif
22
23 ifneq (,$(findstring $(board),goodfet40 goodfet41))
24 mcu ?= msp430f2618
25 platform := goodfet
26 endif
27
28 ifneq (,$(findstring $(board),goodfet24))
29 mcu ?= msp430f2618
30 platform := goodfet
31 CONFIG_glitch = y
32 endif
33
34 ifneq (,$(findstring $(board),nhb12b))
35 mcu ?= msp430f2618
36 CONFIG_nrf = y
37 platform := nhb12b
38 endif
39
40 ifneq (,$(findstring $(board),nhb12))
41 mcu ?= msp430f2618
42 CONFIG_nrf = y
43 platform := nhb12
44 endif
45
46 ifneq (,$(findstring $(board),goodfet50 goodfet51))
47 mcu ?= msp430f5510
48 platform := goodfet
49 endif
50
51 ifeq ($(board),telosb)
52 mcu ?= msp430f1611
53 platform := telosb
54 config := monitor spi ccspi
55 CFLAGS += -Duseuart1
56 endif
57
58 ifeq ($(board),telosbbt)
59 mcu ?=msp430f1612
60 platform := telosb
61 config := monitor spi ccspi
62 endif
63
64
65
66
67 ##################################
68 ## These are experimental boards.
69 ##################################
70
71 ifneq (,$(findstring $(board),donbfet))
72 GCC := avr-gcc
73 mcu ?= atmega644p
74 CFLAGS=$(DEBUG) -mmcu=$(mcu) -W -Os -mcall-prologues -Wall -Wextra -Wuninitialized -fpack-struct -fshort-enums -funsigned-bitfields
75 config := monitor avr spi jscan
76 endif
77
78 ifneq (,$(findstring $(board),arduino))
79 GCC := avr-gcc
80 mcu ?= atmega168
81 #BSL := avrdude -V -F -c stk500v1 -p m328p -b 57600 -P /dev/tty.usbserial-* -U flash:w:blink.hex
82 LDFLAGS := 
83 config := monitor
84 endif
85
86 ifneq (,$(findstring $(board),tilaunchpad))
87 mcu ?=msp430f1612
88 CFLAGS := -DDEBUG_LEVEL=3 -DDEBUG_START=1 -DINBAND_DEBUG
89 CFLAGS+= -Werror -Wall
90 config := monitor chipcon i2c
91 endif
92
93
94
95 mcu ?= undef
96 ifeq ($(mcu),undef)
97 $(error Please define board, as explained in the README)
98 endif
99 #platform := $(board)
100
101 AVAILABLE_APPS = monitor spi jtag sbw jtag430 jtag430x2 i2c jtagarm7 ejtag jtagxscale openocd chipcon avr pic adc nrf ccspi glitch smartcard ps2 slc2  maxusb
102
103 # defaults
104 CONFIG_monitor    ?= y
105 CONFIG_spi        ?= y
106 CONFIG_maxusb     ?= y
107 CONFIG_jtag       ?= n
108 CONFIG_sbw        ?= n
109 CONFIG_jtag430    ?= y
110 CONFIG_jtag430x2  ?= y
111 CONFIG_i2c        ?= n
112 CONFIG_jtagarm7   ?= n
113 CONFIG_ejtag      ?= n
114 CONFIG_jtagxscale ?= n
115 CONFIG_openocd    ?= y
116 CONFIG_chipcon    ?= y
117 CONFIG_avr        ?= y
118 CONFIG_pic        ?= n
119 CONFIG_adc        ?= n
120 CONFIG_nrf        ?= n
121 CONFIG_ccspi      ?= y
122 CONFIG_glitch     ?= n
123 CONFIG_smartcard  ?= n
124 CONFIG_ps2        ?= n
125 CONFIG_slc2       ?= n
126
127 #The CONFIG_foo vars are only interpreted if $(config) is unset.
128 ifeq ($(config),undef)
129 config += $(foreach app,$(AVAILABLE_APPS),$(if $(findstring $(CONFIG_$(app)),y yes t true Y YES T TRUE),$(app)))
130 endif