update usbdrv to recent release 20121206

taken from repository: https://github.com/obdev/v-usb.git
HEAD: f1311e1cd5a841906fb9f26a49e49d97efe21b51

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
add new feature: "BOOTUP_CLEARRAM"

Under normal circumstances, RESET will not clear contents of RAM.
As always, if you want it done - do it yourself...

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
add additional "funcaddr___bootloader__do_spm"-checking into spminterface

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
update list of tested devices

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
add support for ATmega16

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
add support for ATmega640, ATmega1280, ATmega1281, ATmega2560 and ATmega2561

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
BUGFIX: fix issue 6 to really disable watchdog timer

On "https://github.com/baerwolf/USBaspLoader/issues/6" coldtobi
reported an issue of disabling the watchdog timer in a wrong way.
(At least on some newer devices.)
This can lead to unexpected reboots within bootloader mode,
and result in data losses / broken firmwares.

The original report:
====================

At least on the ATMega644, the MCUSR bit WDRF in the MCUSR needs to be cleared first, otherwise it is not possible to disable the watchdog. (See http://www.atmel.com/Images/doc2593.pdf, p.53)

    ? Bit 3 - WDE: Watchdog System Reset Enable
    WDE is overridden by WDRF in MCUSR. This means that WDE is always set when
    WDRF is set. To clear WDE, WDRF must be cleared first. This feature ensures
    multiple resets during conditions causing failure, and a safe start-up after the failure.

    Otherwise the software cannot disable the wdt.

This line just before wdt_disable will fix this

MCUCSR = ~(1<<WDRF);
wdt_disable(); /* main app may have enabled watchdog */

Reported-by: coldtobi <https://github.com/coldtobi>
Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
fix minor compiler warning issue

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
improve build process by adding new features to Makefiles

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Workaround "eicall" compiler bug

There seems to be another funny compiler Bug.
When gcc is using "eicall" opcode it forgets to modify EIND.
On devices with large flash memory there are some target address bits
missing.

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
BUGFIX: spminterface: use eicall to call "___bootloader__do_spm__ptr" if flash>128kib

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
final preparations for upcoming version 0.96

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
ATmega2560 passed extensive testing (20MHz)

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
USBaspLoader v0.96 release

 - full tested support of ATmega2560
 - improved layout for testboard (Rev.3)

 - improved build process
 - fixed issue 6 to really disable watchdog timer
 - additional support for ATmega640, ATmega1280, ATmega1281, ATmega2560 and ATmega2561
 - additional support for ATmega16
 - additional safety checkings
 - new feature: "BOOTUP_CLEARRAM"
 - new usbdrv recent release 20121206

Precompiled bootloader v0.96 for atmega8 (Rev.3),
default (Rev.3) schematics clocked with 16 MHz
(not all AVRs are tested, yet! But please report!)

sha1sums are:

	bd3dd35e8ca43eae88e7e73d4e846fed62c5b5c1        "raw bytecode usbasp"
	4f236bf72f6e9ce5737c2b16c0eb7169234c6b20        "raw bytecode update"

	cd0184257ffd0d8be400fdeafe398ee1e4290304        "elf firmware usbasp"
	c72d1742f1ec785c6265cc8da9bc86538e224c7a        "elf firmware update"

	4ee602ad24f467a531142e4a23b2b7c12b4c291d        firmware_usbasploader.hex
	cfcbd7ab283768d21c097ac0755dc437022f487b        update_usbasploader.hex

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>