From a91e8e01b2879c191ac3dd60bf21a359b35ca7e7 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Fri, 31 Oct 2008 21:16:46 +0000 Subject: [PATCH] This change actually dates back to July 29: add preliminary support for Xmega programming using the JTAG ICE mkII in JTAG mode. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@780 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 5 +++++ NEWS | 3 +++ jtagmkII.c | 10 ++++++++++ jtagmkII_private.h | 1 + 4 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 53233330..53281b49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-29 Joerg Wunsch + + * jtagmkII.c: Implement Xmega JTAG support. + * jtagmkII_private.h: Add EMULATOR_MODE_JTAG_XMEGA. + 2008-07-29 Joerg Wunsch * main.c: Remember whether the device initialization worked, and diff --git a/NEWS b/NEWS index 557948ba..c0718788 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,9 @@ Current: device initialization failed, so the user can modify programmer parameters (like Vtarget). + * Add preliminary support for ATxmega128A1 for the JTAG ICE mkII using + JTAG. + Version 5.5: * Add support for the USBtinyISP programmer (patch #6233) diff --git a/jtagmkII.c b/jtagmkII.c index 8a77ab33..13f5e3ff 100644 --- a/jtagmkII.c +++ b/jtagmkII.c @@ -261,6 +261,7 @@ static void jtagmkII_prmsg(PROGRAMMER * pgm, unsigned char * data, size_t len) case EMULATOR_MODE_JTAG: fprintf(stderr, ": JTAG"); break; case EMULATOR_MODE_HV: fprintf(stderr, ": HVSP/PP"); break; case EMULATOR_MODE_SPI: fprintf(stderr, ": SPI"); break; + case EMULATOR_MODE_JTAG_XMEGA: fprintf(stderr, ": JTAG/Xmega"); break; } putc('\n', stderr); break; @@ -876,6 +877,8 @@ static void jtagmkII_set_devdescr(PROGRAMMER * pgm, AVRPART * p) sendbuf.dd.ucEepromPageSize = PDATA(pgm)->eeprom_pagesize = m->page_size; } } + sendbuf.dd.ucCacheType = + (p->flags & AVRPART_HAS_PDI)? 0x02 /* ATxmega */: 0x00; if (verbose >= 2) fprintf(stderr, "%s: jtagmkII_set_devdescr(): " @@ -1143,6 +1146,13 @@ static int jtagmkII_initialize(PROGRAMMER * pgm, AVRPART * p) * Must set the device descriptor before entering programming mode. */ jtagmkII_set_devdescr(pgm, p); + /* + * If this is an ATxmega device, change the emulator mode from JTAG + * to JTAG_XMEGA. + */ + if (!(pgm->flag & PGM_FL_IS_DW) && + (p->flags & AVRPART_HAS_PDI)) + jtagmkII_getsync(pgm, EMULATOR_MODE_JTAG_XMEGA); free(PDATA(pgm)->flash_pagecache); free(PDATA(pgm)->eeprom_pagecache); diff --git a/jtagmkII_private.h b/jtagmkII_private.h index c7f8ce7f..25774642 100644 --- a/jtagmkII_private.h +++ b/jtagmkII_private.h @@ -179,6 +179,7 @@ # define EMULATOR_MODE_JTAG 0x01 # define EMULATOR_MODE_HV 0x02 /* HVSP or PP mode of AVR Dragon */ # define EMULATOR_MODE_SPI 0x03 +# define EMULATOR_MODE_JTAG_XMEGA 0x05 #define PAR_IREG 0x04 #define PAR_BAUD_RATE 0x05 # define PAR_BAUD_2400 0x01