1
0
mirror of https://github.com/wfjm/w11.git synced 2026-05-03 22:59:46 +00:00

- migrate to rlink protocol version 4

- Goals for rlink v4
    - 16 bit addresses (instead of 8 bit)
    - more robust encoding, support for error recovery at transport level
    - add features to reduce round trips
      - improved attention handling
      - new 'list abort' command
  - For further details see README_Rlink_V4.txt
- use own C++ based tcl shell tclshcpp instead of tclsh
This commit is contained in:
Walter F.J. Mueller
2014-12-20 16:39:52 +00:00
parent 093d540121
commit d87ac86f53
203 changed files with 9324 additions and 10881 deletions

View File

@@ -7,4 +7,5 @@
*.rel
*.rst
*.sym
*.lk
dscr_*.a51

View File

@@ -1,6 +1,6 @@
# $Id: Makefile 461 2012-04-09 21:17:54Z mueller $
# $Id: Makefile 604 2014-11-16 22:33:09Z mueller $
#
# Copyright 2011-2012 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
# Copyright 2011-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
# Code was forked from ixo-jtag.svn.sourceforge.net on 2011-07-17
#
# - original copyright and licence disclaimer --------------------------------
@@ -22,6 +22,7 @@
#
# Revision History:
# Date Rev Version Comment
# 2014-11-16 604 2.0 add sdcc 3.x migration
# 2012-04-09 461 1.5.1 fixed nexys3_jtag_3fifo_ic.ihx rule,used _2fifo code
# 2012-02-11 457 1.5 re-organize VID/PID and descriptor handling
# 2012-01-02 448 1.4 add support for sync fifo w/ int. clock (_ic)
@@ -48,6 +49,8 @@
# (for instance because someone else did not follow the previous rule).
# See also http://www.voti.nl/pids/pidfaq.html
#
# Define default VID/PID -----------------------------------------------
#
ifndef RETRO_FX2_VID
RETRO_FX2_VID = 16c0
endif
@@ -57,15 +60,18 @@ endif
#
DEFVIDPID=-DUSE_VID=0x${RETRO_FX2_VID} -DUSE_PID=0x${RETRO_FX2_PID}
#
# compiler and assembler flags
# defs for sdcc 2.9 to 3.x transition handling -------------------------
#
include sdccdefs.mk
#
# compiler and assembler flags -----------------------------------------
#
LIBDIR=lib
LIB=libfx2.lib
CC=sdcc
CFLAGS+=-mmcs51 --no-xinit-opt -I${LIBDIR}
CFLAGS+=${CC29COMPOPT}
AS=asx8051
ASFLAGS+=-plosgff
LDFLAGS=--code-loc 0x0000 --code-size 0x1800
@@ -165,7 +171,7 @@ LIB_REL=$(LIBDIR)/$(LIB)
# rules to compile all code
#
$(LIBDIR)/$(LIB) :
make -C $(LIBDIR)
make -C $(LIBDIR) $(MAKELIBOPT)
eeprom.rel : eeprom.c eeprom.h
main.rel : main.c hardware.h eeprom.h
@@ -210,7 +216,7 @@ nexys3_jtag_3fifo_ic.ihx : $(COM_REL) dscr_nexys3_jtag_3fifo_ic.rel \
clean :
make -C ${LIBDIR} clean
rm -f *.lst *.asm *.lib *.sym *.rel *.mem *.map *.rst *.lnk
rm -f *.lst *.asm *.lib *.sym *.rel *.mem *.map *.rst *.lnk *.lk
rm -f dscr_*.a51
distclean : clean

View File

@@ -1,17 +1,71 @@
# $Id: README.txt 395 2011-07-17 22:02:55Z mueller $
# $Id: README.txt 604 2014-11-16 22:33:09Z mueller $
#
The FX2 software is based on the Sourceforge project ixo-jtag
http://sourceforge.net/projects/ixo-jtag/
The usb_jtag sub project was checked out on 2011-07-17 (Rev 204)
from Sourceforge and take as the basis for the further developement.
The usb_jtag sub project was checked out on 2011-07-17 (Rev 204) from
Sourceforge and take as the basis for the further developement.
The original README.txt is preserved under README_iso_jtag.txt.
Only the hw_nexys.c branch is kept on the import.
Change log:
2014-11-16 (Rev 604)
- ported to sdcc 3.3
- all prior development was done with sdcc 2.x, latest sdcc 2.9 was bundled
with Ubuntu 12.04 LTS.
- now switching to sdcc 3.3 as bundled with Ubuntu 14.04 LTS.
- mayor changes:
1. assembler now named sdas8051 (was asx8051)
2. all special reserved keywords start now with a double underscore
at --> __at
bit --> __bit
interrupt --> __interrupt
sbit --> __sbit
sfr --> __sfr
xdata --> __xdata
_asm --> __asm
_endasm --> __endasm
_naked --> __naked
- in general sources stayed untouched in the sdcc 2.9 form, all keyword
mappings are done with the preprocessor and defs like "-Dat=__at"
- make usage now
- default is now sdcc 3.x, in this case simply use
make clean && make
- on systems with sdcc 2.x use
make clean && make SDCC29=1
- detected and fixed BUG inherted from ixo-jtag and GNU Radio in SYNCDELAY
The macro SYNCDELAY (defined in lib/syncdelay.h) inserts 'nop' needed
to resolve some timing issues in the FX2. The old implementation was
#define SYNCDELAY _asm nop; nop; nop; _endasm
#define NOP _asm nop; _endasm
This inserts into the assembler output a single line
nop; nop; nop;
Since ';' is the comment delimiter for the assember the 2nd and 3rd nop
are simply ignored.
This wrong implementation was changed to
#define SYNCDELAY NOP; NOP; NOP
That created three lines in the assembler output
nop;
nop;
nop;
and generated the three desired nops in the binary.
!! This was definitively broken from the very beginning. !!
!! The code ran alway. Reason is mosu likely that the SYNCDELAY !!
!! macros were only used in the setup phase and never is a !!
!! really time critical context. !!
2011-07-17 (Rev 395)
- Makefile: reorganized to support multiple target/fifo configs
- renames:

View File

@@ -1,7 +1,7 @@
;;; -*- asm -*-
;;; $Id: dscr_gen.A51 457 2012-02-12 22:34:20Z mueller $
;;; $Id: dscr_gen.A51 605 2014-11-18 22:34:44Z mueller $
;;;
;;; Copyright 2011-2012 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
;;; Copyright 2011-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
;;; Code was forked from ixo-jtag.svn.sourceforge.net on 2011-07-17
;;;
;;;- original copyright and licence disclaimer ---------------------------------
@@ -56,6 +56,7 @@
;;; Revision History:
;;;
;;; Date Rev Version Comment
;;; 2014-11-18 605 2.2 BUGFIX: correct string 0 descriptor
;;; 2012-02-11 457 2.1 iVendor string now reflects firmware file name;
;;; iSerial string now 00000000;
;;; VID/PID now via USE_VID/USE_PID defines
@@ -357,8 +358,6 @@ _string_descriptors_end:
_str0::
str0: .db str0_end - str0
.db DSCR_STRING
.db 0
.db 0
.db <0x0409 ; magic code for US English (LSB)
.db >0x0409 ; magic code for US English (MSB)
str0_end:

View File

@@ -1,23 +1,44 @@
# $Id: Makefile 394 2011-07-17 17:03:19Z mueller $
# $Id: Makefile 604 2014-11-16 22:33:09Z mueller $
#
# Copyright 2014- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
# Code was forked from ixo-jtag.svn.sourceforge.net on 2011-07-17
#
# - original copyright and licence disclaimer --------------------------------
# - Copyright 2007 Kolja Waschk, ixo.de
# - This code is part of usbjtag. usbjtag is free software;
#-----------------------------------------------------------------------------
# Makefile for FX2 library code
#-----------------------------------------------------------------------------
# Copyright (C) 2007 Kolja Waschk, ixo.de
#-----------------------------------------------------------------------------
# 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
#
# This program is free software; you may redistribute and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 2, or at your option any later version.
#
# This program 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 complete details.
#-----------------------------------------------------------------------------
CC=sdcc
#-----------------------------------------------------------------------------
# Makefile for FX2 library code
#
# Revision History in retro projects
#
# Date Rev Version Comment
# 2014-11-16 604 1.1 add sdcc 3.x migration support
# 2011-07-17 394 1.0 Initial version (from ixo-jtag/usb_jtag Rev 204)
#
#-----------------------------------------------------------------------------
#
# defs for sdcc 2.9 to 3.x transition handling -------------------------
#
include ../sdccdefs.mk
CFLAGS+=-mmcs51 --no-xinit-opt -I.
CFLAGS+=${CC29COMPOPT}
CPPFLAGS+=
OBJS=delay.rel fx2utils.rel i2c.rel isr.rel timer.rel usb_common.rel
AR=sdcclib

View File

@@ -1,5 +1,5 @@
/* -*- c++ -*- */
/* $Id: fx2regs.h 395 2011-07-17 22:02:55Z mueller $ */
/* $Id: fx2regs.h 604 2014-11-16 22:33:09Z mueller $ */
/*-----------------------------------------------------------------------------
* FX2 register definitions
*-----------------------------------------------------------------------------
@@ -20,6 +20,7 @@
*/
/*
// original Cypress disclaimer
//-----------------------------------------------------------------------------
// File: FX2regs.h
// Contents: EZ-USB FX2 register declarations and bit mask definitions.
@@ -28,11 +29,19 @@
// $Date: 2006-09-13 14:30:04 -0700 (Wed, 13 Sep 2006) $
// $Revision: 3534 $
//
//
// Copyright (c) 2000 Cypress Semiconductor, All rights reserved
//-----------------------------------------------------------------------------
*/
/*
* Revision History in retro projects
*
* Date Rev Version Comment
* 2014-11-16 604 1.1 add sdcc 3.x migration support
* 2011-07-17 394 1.0 Initial version (from ixo-jtag/usb_jtag Rev 204)
*
*-----------------------------------------------------------------------------
*/
#ifndef FX2REGS_H /* Header Sentry */
#define FX2REGS_H
@@ -59,10 +68,19 @@
// to cut off the end of the line, "_at_ 0x7B40;", which is not wanted.
*/
/*
* Note on sdcc 3.x compatibility:
* Only the _AT_ macro is touched in the original Cypress sources.
* all other keyword mappings are done via pre-processor defines.
*/
#ifdef ALLOCATE_EXTERN
#define EXTERN
#ifdef SDCC3XCOMPAT
#define _AT_(a) __at a
#else
#define _AT_(a) at a
#endif
#else
#define EXTERN extern
#define _AT_ ;/ ## /

View File

@@ -1,22 +1,32 @@
/* -*- c++ -*- */
/* $Id: syncdelay.h 395 2011-07-17 22:02:55Z mueller $ */
/*-----------------------------------------------------------------------------
* Synchronization delay for FX2 access to specific registers
*-----------------------------------------------------------------------------
* Code taken from USRP2 firmware (GNU Radio Project), version 3.0.2,
/* $Id: syncdelay.h 604 2014-11-16 22:33:09Z mueller $ */
/*
* Copyright 2014- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
* Code was forked from USRP2 firmware (GNU Radio Project), version 3.0.2
*
* - original copyright and licence disclaimers -------------------------------
* Copyright 2003 Free Software Foundation, Inc.
* This code is part of usbjtag.
*-----------------------------------------------------------------------------
* 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
*
* This program is free software; you may redistribute and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 2, or at your option any later version.
*
* This program 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 complete details.
*
*-----------------------------------------------------------------------------
*
* Synchronization delay for FX2 access to specific registers
*
* Revision History:
*
* Date Rev Version Comment
* 2014-11-16 604 1.1 BUGFIX: handle triple nop properly
* 2011-07-17 394 1.0 Initial version (from ixo-jtag/usb_jtag Rev 204)
*/
#ifndef _SYNCDELAY_H_
@@ -58,8 +68,7 @@
/*
* FIXME ensure that the peep hole optimizer isn't screwing us
*/
#define SYNCDELAY _asm nop; nop; nop; _endasm
#define SYNCDELAY NOP; NOP; NOP
#define NOP _asm nop; _endasm
#endif /* _SYNCDELAY_H_ */

View File

@@ -1,4 +1,4 @@
/* $Id: main.c 472 2013-01-06 14:39:10Z mueller $ */
/* $Id: main.c 606 2014-11-24 07:08:51Z mueller $ */
/*
* Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
* Code was forked from ixo-jtag.svn.sourceforge.net on 2011-07-17
@@ -355,6 +355,10 @@ void main(void)
// EE and FF are active high. In nexys2 boards they are active low
// All config regs should be set (even when power on defaults are
// use, but this one especially....
// no SYNCHDELAY here because a subroutine call follows, slow enough
// !! if more regs will be touched here add SYNCHDELAYs !!
FIFOPINPOLAR = 0;
usb_jtag_init();

31
tools/fx2/src/sdccdefs.mk Normal file
View File

@@ -0,0 +1,31 @@
# $Id: sdccdefs.mk 604 2014-11-16 22:33:09Z mueller $
#
# Revision History:
# Date Rev Version Comment
# 2014-11-16 604 1.0 Initial version
#---
#
# sdcc 2.9 to 3.x transition handling ----------------------------------
# default is sdcc 3.x; if SDCC29 is specified sdcc 2.9 is used
#
CC=sdcc
ifdef SDCC29
MAKELIBOPT=SDCC29=1
AS=asx8051
CC29COMPOPT=
else
MAKELIBOPT=
AS=sdas8051
CC29COMPOPT+=-DSDCC3XCOMPAT=1
CC29COMPOPT+=-Dat=__at
CC29COMPOPT+=-Dsfr=__sfr
CC29COMPOPT+=-Dsbit=__sbit
CC29COMPOPT+=-Dbit=__bit
CC29COMPOPT+=-Dxdata=__xdata
CC29COMPOPT+=-D_asm=__asm
CC29COMPOPT+=-D_endasm=__endasm
CC29COMPOPT+=-D_naked=__naked
CC29COMPOPT+=-Dinterrupt=__interrupt
endif