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