Index: avrdude.conf.in
===================================================================
--- avrdude.conf.in	(revision 1450)
+++ avrdude.conf.in	(working copy)
@@ -1230,6 +1230,30 @@
 ;
 
 programmer
+  id    = "pickit4_updi";
+  desc  = "MPLAB(R) PICkit 4 in UPDI mode";
+  type  = "jtagice3_updi";
+  connection_type = usb;
+  usbpid = 0x2177, 0x2178, 0x2179;
+;
+
+programmer
+  id    = "snap_updi";
+  desc  = "MPLAB(R) SNAP in UPDI mode";
+  type  = "jtagice3_updi";
+  connection_type = usb;
+  usbpid = 0x217F, 0x2180, 0x2181;
+;
+
+programmer
+  id    = "pkobn_updi";
+  desc  = "PKOB nano (nEDBG) in UPDI mode";
+  type  = "jtagice3_updi";
+  connection_type = usb;
+  usbpid = 0x2175;
+;
+
+programmer
   id    = "pavr";
   desc  = "Jason Kyle's pAVR Serial Programmer";
   type  = "avr910";
@@ -15267,6 +15291,7 @@
     memory "signature"
         size		= 3;
         offset		= 0x1100;
+        readsize	= 0x3;
     ;
 
     memory "prodsig"
@@ -15279,51 +15304,62 @@
     memory "fuses"
         size		= 9;
         offset		= 0x1280;
+        page_size = 0x0A;
+        readsize  = 0x0A;
     ;
 
     memory "fuse0"
         size		= 1;
         offset		= 0x1280;
+        readsize  = 1;
     ;
 
     memory "fuse1"
         size		= 1;
         offset		= 0x1281;
+        readsize  = 1;
     ;
 
     memory "fuse2"
         size		= 1;
         offset		= 0x1282;
+        readsize  = 1;
     ;
 
     memory "fuse4"
         size		= 1;
         offset		= 0x1284;
+        readsize  = 1;
     ;
 
     memory "fuse5"
         size		= 1;
         offset		= 0x1285;
+        readsize  = 1;
     ;
 
     memory "fuse6"
         size		= 1;
         offset		= 0x1286;
+        readsize  = 1;
     ;
 
     memory "fuse7"
         size		= 1;
         offset		= 0x1287;
+        readsize  = 1;
     ;
 
     memory "fuse8"
         size		= 1;
         offset		= 0x1288;
+        readsize  = 1;
     ;
 
     memory "lock"
         size		= 1;
         offset		= 0x128a;
+        readsize  = 1;
     ;
 
     memory "data"
@@ -15421,7 +15457,7 @@
 part parent    ".avr8x_tiny"
     id        = "t402";
     desc      = "ATtiny402";
-    signature = 0x1E 0x92 0x23;
+    signature = 0x1E 0x92 0x27;
 
     memory "flash"
         size      = 0x1000;
@@ -15923,13 +15959,13 @@
 ;
 
 #------------------------------------------------------------
-# ATtiny3214
+# ATtiny3216
 #------------------------------------------------------------
 
 part parent    ".avr8x_tiny"
-    id        = "t3214";
-    desc      = "ATtiny3214";
-    signature = 0x1E 0x95 0x20;
+    id        = "t3216";
+    desc      = "ATtiny3216";
+    signature = 0x1E 0x95 0x21;
 
     memory "flash"
         size      = 0x8000;
@@ -15947,13 +15983,13 @@
 ;
 
 #------------------------------------------------------------
-# ATtiny3216
+# ATtiny3217
 #------------------------------------------------------------
 
 part parent    ".avr8x_tiny"
-    id        = "t3216";
-    desc      = "ATtiny3216";
-    signature = 0x1E 0x95 0x21;
+    id        = "t3217";
+    desc      = "ATtiny3217";
+    signature = 0x1E 0x95 0x22;
 
     memory "flash"
         size      = 0x8000;
@@ -15971,30 +16007,317 @@
 ;
 
 #------------------------------------------------------------
-# ATtiny3217
+# ATtiny424
 #------------------------------------------------------------
 
-part parent    ".avr8x_tiny"
-    id        = "t3217";
-    desc      = "ATtiny3217";
-    signature = 0x1E 0x95 0x22;
+part parent    ".avr8x_tiny";
+    id        = "t424";
+    desc      = "ATtiny424";
+    signature = 0x1E 0x92 0x2C;
 
     memory "flash"
-        size      = 0x8000;
+        size      = 0x1000;
         offset    = 0x8000;
-        page_size = 0x80;
+        page_size = 0x40;
         readsize  = 0x100;
     ;
 
     memory "eeprom"
+        size      = 0x80;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# ATtiny426
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny";
+    id        = "t426";
+    desc      = "ATtiny426";
+    signature = 0x1E 0x92 0x2B;
+
+    memory "flash"
+        size      = 0x1000;
+        offset    = 0x8000;
+        page_size = 0x40;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x80;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# ATtiny427
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny";
+    id        = "t427";
+    desc      = "ATtiny427";
+    signature = 0x1E 0x92 0x2A;
+
+    memory "flash"
+        size      = 0x1000;
+        offset    = 0x8000;
+        page_size = 0x40;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x80;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# ATtiny824
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny";
+    id        = "t824";
+    desc      = "ATtiny824";
+    signature = 0x1E 0x93 0x29;
+
+    memory "flash"
+        size      = 0x2000;
+        offset    = 0x8000;
+        page_size = 0x40;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x80;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# ATtiny826
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny";
+    id        = "t826";
+    desc      = "ATtiny826";
+    signature = 0x1E 0x93 0x28;
+
+    memory "flash"
+        size      = 0x2000;
+        offset    = 0x8000;
+        page_size = 0x40;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x80;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# ATtiny827
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny";
+    id        = "t827";
+    desc      = "ATtiny827";
+    signature = 0x1E 0x93 0x27;
+
+    memory "flash"
+        size      = 0x2000;
+        offset    = 0x8000;
+        page_size = 0x40;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x80;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# ATtiny1624
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny";
+    id        = "t1624";
+    desc      = "ATtiny1624";
+    signature = 0x1E 0x94 0x2A;
+
+    memory "flash"
+        size      = 0x4000;
+        offset    = 0x8000;
+        page_size = 0x40;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
         size      = 0x100;
         offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+#------------------------------------------------------------
+# ATtiny1626
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny";
+    id        = "t1626";
+    desc      = "ATtiny1626";
+    signature = 0x1E 0x94 0x29;
+
+    memory "flash"
+        size      = 0x4000;
+        offset    = 0x8000;
         page_size = 0x40;
         readsize  = 0x100;
     ;
+
+    memory "eeprom"
+        size      = 0x100;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
 ;
 
 #------------------------------------------------------------
+# ATtiny1627
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny";
+    id        = "t1627";
+    desc      = "ATtiny1627";
+    signature = 0x1E 0x94 0x28;
+
+    memory "flash"
+        size      = 0x4000;
+        offset    = 0x8000;
+        page_size = 0x40;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x100;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# ATmega808
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny"
+    id        = "m808";
+    desc      = "ATmega808";
+    signature = 0x1E 0x93 0x26;
+
+    memory "flash"
+        size      = 0x2000;
+        offset    = 0x4000;
+        page_size = 0x40;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x100;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# ATmega809
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny"
+    id        = "m809";
+    desc      = "ATmega809";
+    signature = 0x1E 0x93 0x2A;
+
+    memory "flash"
+        size      = 0x2000;
+        offset    = 0x4000;
+        page_size = 0x40;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x100;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# ATmega1608
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny"
+    id        = "m1608";
+    desc      = "ATmega1608";
+    signature = 0x1E 0x94 0x27;
+
+    memory "flash"
+        size      = 0x4000;
+        offset    = 0x4000;
+        page_size = 0x40;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x100;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# ATmega1609
+#------------------------------------------------------------
+
+part parent    ".avr8x_tiny"
+    id        = "m1609";
+    desc      = "ATmega1609";
+    signature = 0x1E 0x94 0x26;
+
+    memory "flash"
+        size      = 0x4000;
+        offset    = 0x4000;
+        page_size = 0x40;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x100;
+        offset    = 0x1400;
+        page_size = 0x20;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
 # ATmega3208
 #------------------------------------------------------------
 
@@ -16001,7 +16324,7 @@
 part parent    ".avr8x_mega"
     id        = "m3208";
     desc      = "ATmega3208";
-    signature = 0x1E 0x95 0x52;
+    signature = 0x1E 0x95 0x30;
 
     memory "flash"
         size      = 0x8000;
@@ -16025,7 +16348,7 @@
 part parent    ".avr8x_mega"
     id        = "m3209";
     desc      = "ATmega3209";
-    signature = 0x1E 0x95 0x53;
+    signature = 0x1E 0x95 0x31;
 
     memory "flash"
         size      = 0x8000;
@@ -16089,3 +16412,623 @@
         readsize  = 0x100;
     ;
 ;
+
+#------------------------------------------------------------
+# AVR-Dx family common values
+#------------------------------------------------------------
+
+part
+    id		= ".avrdx";
+    desc	= "AVR-Dx family common values";
+    has_updi	= yes;
+    nvm_base	= 0x1000;
+    ocd_base	= 0x0F80;
+
+    memory "signature"
+        size		= 3;
+        offset		= 0x1100;
+        readsize	= 0x3;
+    ;
+
+    memory "prodsig"
+        size		= 0x7D;
+        offset		= 0x1103;
+        page_size	= 0x7D;
+        readsize	= 0x7D;
+    ;
+
+    memory "fuses"
+        size		= 9;
+        offset		= 0x1050;
+        page_size = 0x10;
+        readsize  = 0x10;
+    ;
+
+    memory "fuse0"
+        size		= 1;
+        offset		= 0x1050;
+        readsize  = 1;
+    ;
+
+    memory "fuse1"
+        size		= 1;
+        offset		= 0x1051;
+        readsize  = 1;
+    ;
+
+    memory "fuse2"
+        size		= 1;
+        offset		= 0x1052;
+        readsize  = 1;
+    ;
+
+    memory "fuse4"
+        size		= 1;
+        offset		= 0x1054;
+        readsize  = 1;
+    ;
+
+    memory "fuse5"
+        size		= 1;
+        offset		= 0x1055;
+        readsize  = 1;
+    ;
+
+    memory "fuse6"
+        size		= 1;
+        offset		= 0x1056;
+        readsize  = 1;
+    ;
+
+    memory "fuse7"
+        size		= 1;
+        offset		= 0x1057;
+        readsize  = 1;
+    ;
+
+    memory "fuse8"
+        size		= 1;
+        offset		= 0x1058;
+        readsize  = 1;
+    ;
+
+    memory "lock"
+        size		= 4;
+        offset		= 0x1040;
+        page_size = 0x1;
+        readsize  = 0x4;
+    ;
+
+    memory "data"
+        # SRAM, only used to supply the offset
+        offset		= 0x1000000;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR32DA28
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr32da28";
+    desc      = "AVR32DA28";
+    signature = 0x1E 0x95 0x34;
+
+    memory "flash"
+        size      = 0x8000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR32DA32
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr32da32";
+    desc      = "AVR32DA32";
+    signature = 0x1E 0x95 0x33;
+
+    memory "flash"
+        size      = 0x8000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR32DA48
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr32da48";
+    desc      = "AVR32DA48";
+    signature = 0x1E 0x95 0x32;
+
+    memory "flash"
+        size      = 0x8000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR64DA28
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr64da28";
+    desc      = "AVR64DA28";
+    signature = 0x1E 0x96 0x15;
+
+    memory "flash"
+        size      = 0x10000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR64DA32
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr64da32";
+    desc      = "AVR64DA32";
+    signature = 0x1E 0x96 0x14;
+
+    memory "flash"
+        size      = 0x10000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR64DA48
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr64da48";
+    desc      = "AVR64DA48";
+    signature = 0x1E 0x96 0x13;
+
+    memory "flash"
+        size      = 0x10000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR64DA64
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr64da64";
+    desc      = "AVR64DA64";
+    signature = 0x1E 0x96 0x12;
+
+    memory "flash"
+        size      = 0x10000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR128DA28
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr128da28";
+    desc      = "AVR128DA28";
+    signature = 0x1E 0x97 0x0A;
+
+    memory "flash"
+        size      = 0x20000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR128DA32
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr128da32";
+    desc      = "AVR128DA32";
+    signature = 0x1E 0x97 0x09;
+
+    memory "flash"
+        size      = 0x20000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR128DA48
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr128da48";
+    desc      = "AVR128DA48";
+    signature = 0x1E 0x97 0x08;
+
+    memory "flash"
+        size      = 0x20000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR128DA64
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr128da64";
+    desc      = "AVR128DA64";
+    signature = 0x1E 0x97 0x07;
+
+    memory "flash"
+        size      = 0x20000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR32DB28
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr32db28";
+    desc      = "AVR32DB28";
+    signature = 0x1E 0x95 0x37;
+
+    memory "flash"
+        size      = 0x8000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR32DB32
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr32db32";
+    desc      = "AVR32DB32";
+    signature = 0x1E 0x95 0x36;
+
+    memory "flash"
+        size      = 0x8000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR32DB48
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr32db48";
+    desc      = "AVR32DB48";
+    signature = 0x1E 0x95 0x35;
+
+    memory "flash"
+        size      = 0x8000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR64DB28
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr64db28";
+    desc      = "AVR64DB28";
+    signature = 0x1E 0x96 0x19;
+
+    memory "flash"
+        size      = 0x10000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR64DB32
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr64db32";
+    desc      = "AVR64DB32";
+    signature = 0x1E 0x96 0x18;
+
+    memory "flash"
+        size      = 0x10000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR64DB48
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr64db48";
+    desc      = "AVR64DB48";
+    signature = 0x1E 0x96 0x17;
+
+    memory "flash"
+        size      = 0x10000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR64DB64
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr64db64";
+    desc      = "AVR64DB64";
+    signature = 0x1E 0x96 0x16;
+
+    memory "flash"
+        size      = 0x10000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR128DB28
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr128db28";
+    desc      = "AVR128DB28";
+    signature = 0x1E 0x97 0x0E;
+
+    memory "flash"
+        size      = 0x20000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR128DB32
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr128db32";
+    desc      = "AVR128DB32";
+    signature = 0x1E 0x97 0x0D;
+
+    memory "flash"
+        size      = 0x20000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR128DB48
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr128db48";
+    desc      = "AVR128DB48";
+    signature = 0x1E 0x97 0x0C;
+
+    memory "flash"
+        size      = 0x20000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
+
+#------------------------------------------------------------
+# AVR128DB64
+#------------------------------------------------------------
+
+part parent    ".avrdx";
+    id        = "avr128db64";
+    desc      = "AVR128DB64";
+    signature = 0x1E 0x97 0x0B;
+
+    memory "flash"
+        size      = 0x20000;
+        offset    = 0x800000;
+        page_size = 0x200;
+        readsize  = 0x100;
+    ;
+
+    memory "eeprom"
+        size      = 0x200;
+        offset    = 0x1400;
+        page_size = 0x1;
+        readsize  = 0x100;
+    ;
+;
Index: jtag3.c
===================================================================
--- jtag3.c	(revision 1450)
+++ jtag3.c	(working copy)
@@ -1181,32 +1181,81 @@
       m = ldata(ln);
       if (strcmp(m->desc, "flash") == 0)
       {
-        u16_to_b2(xd.prog_base, m->offset);
+        u16_to_b2(xd.prog_base, m->offset&0xFFFF);
+        xd.prog_base_msb = m->offset>>16;
 
         if (m->readsize != 0 && m->readsize < m->page_size)
           PDATA(pgm)->flash_pagesize = m->readsize;
         else
           PDATA(pgm)->flash_pagesize = m->page_size;
-        xd.flash_page_size = m->page_size;
+        xd.flash_page_size = m->page_size & 0xFF;
+        xd.flash_page_size_msb = (m->page_size)>>8;
+
+        u32_to_b4(xd.flash_bytes, m->size);
+
+        if (m->offset > 0xFFFF)
+          xd.address_mode = UPDI_ADDRESS_MODE_24BIT;
+        else
+          xd.address_mode = UPDI_ADDRESS_MODE_16BIT;
       }
       else if (strcmp(m->desc, "eeprom") == 0)
       {
         PDATA(pgm)->eeprom_pagesize = m->page_size;
         xd.eeprom_page_size = m->page_size;
+
+        u16_to_b2(xd.eeprom_bytes, m->size);
+        u16_to_b2(xd.eeprom_base, m->offset);
       }
+      else if (strcmp(m->desc, "usersig") == 0)
+      {
+        u16_to_b2(xd.user_sig_bytes, m->size);
+        u16_to_b2(xd.user_sig_base, m->offset);
+      }
+      else if (strcmp(m->desc, "signature") == 0)
+      {
+        u16_to_b2(xd.signature_base, m->offset);
+        xd.device_id[0] = p->signature[1];
+        xd.device_id[1] = p->signature[2];
+      }
+      else if (strcmp(m->desc, "fuses") == 0)
+      {
+        xd.fuses_bytes = m->size;
+        u16_to_b2(xd.fuses_base, m->offset);
+      }
+      else if (strcmp(m->desc, "lock") == 0)
+      {
+        u16_to_b2(xd.lockbits_base, m->offset);
+      }
     }
 
+    u16_to_b2(xd.default_min_div1_voltage, DEFAULT_MINIMUM_CHARACTERISED_DIV1_VOLTAGE_MV);
+    u16_to_b2(xd.default_min_div2_voltage, DEFAULT_MINIMUM_CHARACTERISED_DIV2_VOLTAGE_MV);
+    u16_to_b2(xd.default_min_div4_voltage, DEFAULT_MINIMUM_CHARACTERISED_DIV4_VOLTAGE_MV);
+    u16_to_b2(xd.default_min_div8_voltage, DEFAULT_MINIMUM_CHARACTERISED_DIV8_VOLTAGE_MV);
+    u16_to_b2(xd.pdi_pad_fmax, MAX_FREQUENCY_SHARED_UPDI_PIN);
+    xd.syscfg_offset = FUSES_SYSCFG0_OFFSET;
+    xd.syscfg_write_mask_and = 0xFF;
+    xd.syscfg_write_mask_or = 0x00;
+    xd.syscfg_erase_mask_and = 0xFF;
+    xd.syscfg_erase_mask_or = 0x00;
+
     avrdude_message(MSG_NOTICE2, "UPDI SET: \n\t"
+      "xd->prog_base_msb=%x\n\t"
       "xd->prog_base=%x %x\n\t"
+      "xd->flash_page_size_msb=%x\n\t"
       "xd->flash_page_size=%x\n\t"
       "xd->eeprom_page_size=%x\n\t"
       "xd->nvmctrl=%x %x\n\t"
-      "xd->ocd=%x %x\n",
+      "xd->ocd=%x %x\n\t",
+      "xd->address_mode=%x\n",
+      xd.prog_base_msb,
       xd.prog_base[0], xd.prog_base[1],
+      xd.flash_page_size_msb,
       xd.flash_page_size,
       xd.eeprom_page_size,
       xd.nvm_base_addr[0], xd.nvm_base_addr[1],
-      xd.ocd_base_addr[0], xd.ocd_base_addr[1]);
+      xd.ocd_base_addr[0], xd.ocd_base_addr[1],
+      xd.address_mode);
 
     if (jtag3_setparm(pgm, SCOPE_AVR, 2, PARM3_DEVICEDESC, (unsigned char *)&xd, sizeof xd) < 0)
       return -1;
@@ -1787,8 +1836,10 @@
     cmd[3] = MTYPE_USERSIG;
   } else if ( ( strcmp(m->desc, "boot") == 0 ) ) {
     cmd[3] = MTYPE_BOOT_FLASH;
-  } else if ( p->flags & AVRPART_HAS_PDI || p->flags & AVRPART_HAS_UPDI ) {
+  } else if ( p->flags & AVRPART_HAS_PDI ) {
     cmd[3] = MTYPE_FLASH;
+  } else if ( p->flags & AVRPART_HAS_UPDI ) {
+    cmd[3] = MTYPE_SRAM;
   } else {
     cmd[3] = MTYPE_SPM;
   }
Index: jtag3_private.h
===================================================================
--- jtag3_private.h	(revision 1450)
+++ jtag3_private.h	(working copy)
@@ -284,6 +284,16 @@
 
 #define CMSISDAP_CMD_SWD_CONFIGURE 0x13 /* configure SWD protocol; (byte) */
 
+#define DEFAULT_MINIMUM_CHARACTERISED_DIV1_VOLTAGE_MV  4500   // Default minimum voltage for 32M => 4.5V
+#define DEFAULT_MINIMUM_CHARACTERISED_DIV2_VOLTAGE_MV  2700   // Default minimum voltage for 16M => 2.7V
+#define DEFAULT_MINIMUM_CHARACTERISED_DIV4_VOLTAGE_MV  2200   // Default minimum voltage for 8M  => 2.2V
+#define DEFAULT_MINIMUM_CHARACTERISED_DIV8_VOLTAGE_MV  1500   // Default minimum voltage for 4M  => 1.5V
+#define MAX_FREQUENCY_DEDICATED_UPDI_PIN  1500
+#define MAX_FREQUENCY_SHARED_UPDI_PIN     750
+#define UPDI_ADDRESS_MODE_16BIT 0
+#define UPDI_ADDRESS_MODE_24BIT 1
+#define FUSES_SYSCFG0_OFFSET 5
+
 #if !defined(JTAG3_PRIVATE_EXPORTED)
 
 struct mega_device_desc {
@@ -345,5 +355,39 @@
     unsigned char eeprom_page_size;
     unsigned char nvm_base_addr[2];
     unsigned char ocd_base_addr[2];
+
+    // Configuration below, except for "Extended memory support", is only used by kits with
+    // embedded debuggers (XPlained, Curiosity, ...).
+    unsigned char default_min_div1_voltage[2];  // Default minimum voltage for 32M => 4.5V -> 4500
+    unsigned char default_min_div2_voltage[2];  // Default minimum voltage for 16M => 2.7V -> 2700
+    unsigned char default_min_div4_voltage[2];  // Default minimum voltage for 8M  => 2.2V -> 2200
+    unsigned char default_min_div8_voltage[2];  // Default minimum voltage for 4M  => 1.5V -> 1500
+
+    unsigned char pdi_pad_fmax[2];  // 750
+
+    unsigned char flash_bytes[4];     // Flash size in bytes
+    unsigned char eeprom_bytes[2];    // EEPROM size in bytes
+    unsigned char user_sig_bytes[2];  // UserSignture size in bytes
+    unsigned char fuses_bytes;        // Fuses size in bytes
+
+    unsigned char syscfg_offset;          // Offset of SYSCFG0 within FUSE space
+    unsigned char syscfg_write_mask_and;  // AND mask to apply to SYSCFG0 when writing
+    unsigned char syscfg_write_mask_or;   // OR mask to apply to SYSCFG0 when writing
+    unsigned char syscfg_erase_mask_and;  // AND mask to apply to SYSCFG0 after erase
+    unsigned char syscfg_erase_mask_or;   // OR mask to apply to SYSCFG0 after erase
+
+    unsigned char eeprom_base[2];          // Base address for EEPROM memory
+    unsigned char user_sig_base[2];  // Base address for UserSignature memory
+    unsigned char signature_base[2];       // Base address for Signature memory
+    unsigned char fuses_base[2];           // Base address for Fuses memory
+    unsigned char lockbits_base[2];        // Base address for Lockbits memory
+
+    unsigned char device_id[2];  // Two last bytes of the device ID
+
+    // Extended memory support. Needed for flash >= 64kb
+    unsigned char prog_base_msb;        // Extends prog_base, used in 24-bit mode
+    unsigned char flash_page_size_msb;  // Extends flash_page_size, used in 24-bit mode
+
+    unsigned char address_mode;  // 0x00 = 16-bit mode, 0x01 = 24-bit mode
 };
 #endif /* JTAG3_PRIVATE_EXPORTED */
Index: tools/atdf-to-avrdude.xslt
===================================================================
--- tools/atdf-to-avrdude.xslt	(revision 1450)
+++ tools/atdf-to-avrdude.xslt	(working copy)
@@ -154,6 +154,9 @@
             <xsl:when test="contains($device-name, 'ATmega')">
                 <xsl:value-of select="replace($device-name, 'ATmega', 'm')"/>
             </xsl:when>
+            <xsl:when test="starts-with($device-name, 'AVR')">
+                <xsl:value-of select="lower-case($device-name)"/>
+            </xsl:when>
             <xsl:otherwise>
                 <xsl:message terminate="yes">Unable to deduce device id from '<xsl:value-of select="$device-name"/>'</xsl:message>
             </xsl:otherwise>
@@ -166,6 +169,8 @@
         <xsl:choose>
             <xsl:when test="contains($device-name, 'ATtiny')">.avr8x_tiny</xsl:when>
             <xsl:when test="contains($device-name, 'ATmega')">.avr8x_mega</xsl:when>
+            <xsl:when test="matches($device-name, '^AVR[0-9]{1,3}D')">.avrdx</xsl:when>
+            <xsl:when test="matches($device-name, '^AVR[0-9]{1,3}E')">.avrex</xsl:when>
             <xsl:otherwise>
                 <xsl:message terminate="yes">Unable to deduce parent name from '<xsl:value-of select="$device-name"/>'</xsl:message>
             </xsl:otherwise>
Index: usbdevs.h
===================================================================
--- usbdevs.h	(revision 1450)
+++ usbdevs.h	(working copy)
@@ -69,7 +69,14 @@
 #define USBDEV_BULK_EP_WRITE_3    0x01
 #define USBDEV_BULK_EP_READ_3     0x82
 #define USBDEV_EVT_EP_READ_3      0x83
-#define USBDEV_MAX_XFER_3    512
+/* 
+ * The mk3 tools (type jtagice3) have a maxPayloadSize of 912. When
+ * accessing paged memory the access should be limited to pageSize.
+ * When accessing memory without pageSize the payload should be
+ * limited to 256.
+ */
+#define USBDEV_MAX_XFER_3         912
+#define USBDEV_MAX_XFER_3_UNPAGED 256
 
 /*
  * When operating on the JTAGICE3, usbdev_recv_frame() returns an
