X-Git-Url: http://git.rot13.org/?p=fx2fw-sdcc;a=blobdiff_plain;f=fx2%2Fsyncdelay.h;fp=fx2%2Fsyncdelay.h;h=3293fd922f2254151071de2fe796dca95d200514;hp=178f316eb5d75249d09d1939e1f5f20b8e7e1dfd;hb=bfdb50c8dfa96ad8a804b152c92c5a5880c8bdb7;hpb=750d9b37905b7a1cf9e8708c4688f3342c8be133 diff --git a/fx2/syncdelay.h b/fx2/syncdelay.h index 178f316..3293fd9 100644 --- a/fx2/syncdelay.h +++ b/fx2/syncdelay.h @@ -1,128 +1,64 @@ /* -*- c++ -*- */ - /*----------------------------------------------------------------------------- - * Synchronization delay for FX2 access to specific registers - *----------------------------------------------------------------------------- - * Code taken from USRP2 firmware (GNU Radio Project), version 3.0.2, - * Copyright 2003 Free Software Foundation, Inc. - *----------------------------------------------------------------------------- - * This code is part of usbjtag. usbjtag is free software; you can redistribute - * it and/or modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the License, - * or (at your option) any later version. usbjtag is distributed in the hope - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. You should have received a - * copy of the GNU General Public License along with this program in the file - * COPYING; if not, write to the Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - *----------------------------------------------------------------------------- - */ - - #ifndef _SYNCDELAY_H_ - #define _SYNCDELAY_H_ - - /* - * Magic delay required between access to certain xdata registers (TRM page 15-106). - * For our configuration, 48 MHz FX2 / 48 MHz IFCLK, we need three cycles. Each - * NOP is a single cycle.... - * - * From TRM page 15-105: - * - * Under certain conditions, some read and write access to the FX2 registers must - * be separated by a "synchronization delay". The delay is necessary only under the - * following conditions: - * - * - between a write to any register in the 0xE600 - 0xE6FF range and a write to one - * of the registers listed below. - * - * - between a write to one of the registers listed below and a read from any register - * in the 0xE600 - 0xE6FF range. - * - * Registers which require a synchronization delay: - * - * FIFORESET FIFOPINPOLAR - * INPKTEND EPxBCH:L - * EPxFIFOPFH:L EPxAUTOINLENH:L - * EPxFIFOCFG EPxGPIFFLGSEL - * PINFLAGSAB PINFLAGSCD - * EPxFIFOIE EPxFIFOIRQ - * GPIFIE GPIFIRQ - * UDMACRCH:L GPIFADRH:L - * GPIFTRIG EPxGPIFTRIG - * OUTPKTEND REVCTL - * GPIFTCB3 GPIFTCB2 - * GPIFTCB1 GPIFTCB0 - */ - - /* - * FIXME ensure that the peep hole optimizer isn't screwing us - */ - #define SYNCDELAY _asm nop; nop; nop; _endasm - #define NOP _asm nop; _endasm - - - #endif /* _SYNCDELAY_H_ */ -