Clean-up the Xmega erase functions.

* jtagmkII_private.h: Add CMND_XMEGA_ERASE as well as
the various XMEGA_ERASE_* definitions (from updated
appnote AVR067)
* jtagmkII.c (jtagmkII_chip_erase): Correctly implement
Xmega chip erase based on CMND_XMEGA_ERASE.
* jtagmkII.c (jtagmkII_pre_write): Remove, this turned out
to be just a chip erase.
* jtagmkII.c (jtagmkII_program_disable): Don't try reading
"hfuse" for Xmega parts; they don't have it.
* main.c (main): Re-enable auto-erase.  It's been done
before (as "jtagmkII_pre_write") in jtagmkII_paged_write()
anyway.  Xmega boot and application flash areas should be
handled separately in the future, so auto_erase can only
affect the area just being programmed.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@903 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
joerg_wunsch
2010-01-11 15:27:44 +00:00
parent 5dceef2b5c
commit b827263faa
4 changed files with 47 additions and 59 deletions

View File

@@ -103,7 +103,7 @@
#define CMND_SPI_CMD 0x1D
#define CMND_WRITE_MEMORY 0x04
#define CMND_WRITE_PC 0x06
#define CMND_0x34 0x34
#define CMND_XMEGA_ERASE 0x34
// AVR32 - DFH
#define CMND_GET_IR 0x24
#define CMND_GET_xxx 0x25
@@ -252,6 +252,16 @@
# define PAGEPROG_NOT_ALLOWED 0x00
# define PAGEPROG_ALLOWED 0x01
/* Xmega erase memory types, for CMND_XMEGA_ERASE */
#define XMEGA_ERASE_CHIP 0x00
#define XMEGA_ERASE_APP 0x01
#define XMEGA_ERASE_BOOT 0x02
#define XMEGA_ERASE_EEPROM 0x03
#define XMEGA_ERASE_APP_PAGE 0x04
#define XMEGA_ERASE_BOOT_PAGE 0x05
#define XMEGA_ERASE_EEPROM_PAGE 0x06
#define XMEGA_ERASE_USERSIG 0x07
#if !defined(JTAGMKII_PRIVATE_EXPORTED)
/*
* In appnote AVR067, struct device_descriptor is written with