2 # Copyright 2003,2006 Free Software Foundation, Inc.
4 # This file is part of GNU Radio
6 # GNU Radio is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
11 # GNU Radio is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Radio; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 51 Franklin Street,
19 # Boston, MA 02110-1301, USA.
22 firmware2dir = $(prefix)/share/usrp/rev2
23 firmware2_DATA = std.ihx
25 # we put the same stuff in the rev4 directory
26 firmware4dir = $(prefix)/share/usrp/rev4
27 firmware4_DATA = std.ihx
57 FW_INCLUDES=-I$(top_srcdir)/usrp/firmware/include \
58 -I$(top_srcdir)/usrp/firmware/src/usrp2 \
59 -I$(top_srcdir)/usrp/firmware/src/common \
60 -I$(top_builddir)/usrp/firmware/src/common
62 # with EA = 0, the FX2 implements a portion of the 8051 "external memory"
63 # on chip. This memory is mapped like this:
65 # The bottom 8K of memory (0x0000 - 0x1fff) is used for both data and
66 # code accesses. There's also 512 bytes for data only from 0xe000 - 0xe1ff.
68 # We tell the linker to start the xdata segment at 0x1800, 6K up from
71 MEMOPTS = --code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 \
72 -Wl '-b USBDESCSEG = 0xE000'
74 LIBOPTS = -L ../../lib libfx2.lib
75 LIBDEP = ../../lib/libfx2.lib
77 LINKOPTS = $(MEMOPTS) $(LIBOPTS)
86 STARTUP = _startup.rel
94 $(XCC) $(FW_INCLUDES) $(DEFINES) \
95 -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
98 test -f `basename '$<'` || $(LN_S) '$<' .
99 test -f ../common/`basename '$<'` -o \
100 \! -f `dirname '$<'`/../common/`basename '$<'` \
101 || $(LN_S) `dirname '$<'`/../common/`basename '$<'` ../common/`basename '$<'`
102 $(XAS) `basename '$<'`
105 EEPROM_BOOT_OBJS = eeprom_boot.rel eeprom_init.rel $(STARTUP)
107 eeprom_boot.ihx: $(EEPROM_BOOT_OBJS) $(LIBDEP)
108 $(XCC) $(LINKOPTS) -o $@ $(EEPROM_BOOT_OBJS)
110 burn-usrp2-eeprom: eeprom_boot.ihx
111 $(PYTHON) $(srcdir)/../common/build_eeprom.py -p$(prefix) -r2 eeprom_boot.ihx > $@
114 burn-usrp4-eeprom: eeprom_boot.ihx
115 $(PYTHON) $(srcdir)/../common/build_eeprom.py -p$(prefix) -r4 eeprom_boot.ihx > $@
119 BLINK_LEDS_OBJS = blink_leds.rel usrp_common.rel board_specific.rel spi.rel $(STARTUP)
121 blink_leds.ihx: $(BLINK_LEDS_OBJS) $(LIBDEP)
122 $(XCC) $(LINKOPTS) -o $@ $(BLINK_LEDS_OBJS)
125 CHECK_MDELAY_OBJS = check_mdelay.rel usrp_common.rel board_specific.rel spi.rel $(STARTUP)
127 check_mdelay.ihx: $(CHECK_MDELAY_OBJS) $(LIBDEP)
128 $(XCC) $(LINKOPTS) -o $@ $(CHECK_MDELAY_OBJS)
132 CHECK_UDELAY_OBJS = check_udelay.rel usrp_common.rel board_specific.rel spi.rel $(STARTUP)
134 check_udelay.ihx: $(CHECK_UDELAY_OBJS) $(LIBDEP)
135 $(XCC) $(LINKOPTS) -o $@ $(CHECK_UDELAY_OBJS)
141 usrp_main.rel usrp_common.rel board_specific.rel \
142 fpga_load.rel fpga_rev2.rel init_gpif.rel usrp_gpif.rel \
143 usb_descriptors.rel spi.rel eeprom_io.rel $(STARTUP)
145 std.ihx: $(USRP_OBJS) $(LIBDEP)
146 $(XCC) $(LINKOPTS) -o $@ $(USRP_OBJS)
149 *.ihx *.lnk *.lst *.map *.mem *.rel *.rst *.sym *.asm *.lib \
150 usrp_gpif.c usrp_gpif_inline.h \
155 *.ihx *.lnk *.lst *.map *.mem *.rel *.rst *.sym *.asm *.lib
161 usrp_gpif.c usrp_gpif_inline.h : gpif.c
162 srcdir=$(srcdir) $(PYTHON) $(srcdir)/edit-gpif $(srcdir)/gpif.c usrp_gpif.c usrp_gpif_inline.h
167 usrp_main.rel: usrp_gpif_inline.h
168 #usrp_main.rel: fpga.h usrp_common.h ../../include/usrp_commands.h usrp_gpif_inline.h ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h
169 #usrp_common.rel: usrp_common.h ../../include/usrp_commands.h ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h
170 #fpga.rel: usrp_common.h ../../include/usrp_commands.h fpga.h ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h
171 #init_gpif.rel: usrp_common.h ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h