3 * Copyright 2003 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * 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 GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
26 * Magic delay required between access to certain xdata registers (TRM page 15-106).
27 * For our configuration, 48 MHz FX2 / 48 MHz IFCLK, we need three cycles. Each
28 * NOP is a single cycle....
30 * From TRM page 15-105:
32 * Under certain conditions, some read and write access to the FX2 registers must
33 * be separated by a "synchronization delay". The delay is necessary only under the
34 * following conditions:
36 * - between a write to any register in the 0xE600 - 0xE6FF range and a write to one
37 * of the registers listed below.
39 * - between a write to one of the registers listed below and a read from any register
40 * in the 0xE600 - 0xE6FF range.
42 * Registers which require a synchronization delay:
44 * FIFORESET FIFOPINPOLAR
46 * EPxFIFOPFH:L EPxAUTOINLENH:L
47 * EPxFIFOCFG EPxGPIFFLGSEL
48 * PINFLAGSAB PINFLAGSCD
49 * EPxFIFOIE EPxFIFOIRQ
51 * UDMACRCH:L GPIFADRH:L
52 * GPIFTRIG EPxGPIFTRIG
59 * FIXME ensure that the peep hole optimizer isn't screwing us
61 #define SYNCDELAY _asm nop; nop; nop; _endasm
62 #define NOP _asm nop; _endasm
65 #endif /* _SYNCDELAY_H_ */