On 07/24/2010 12:50 AM, Phil Dibowitz wrote:
On Fri, Jul 23, 2010 at 09:41:14PM -0600, Stephen Warren wrote:
On 07/23/2010 12:40 PM, Phil Dibowitz wrote:
On Thu, Jul 22, 2010 at 07:18:50PM -0600, Stephen Warren wrote:
Oh, and I added the new functions to the Python bindings too, which I
forgot before.

Cool. Can you either (1) do the same for the perl bindings or (2) create a bug
(and assign it to me) to do it?

Um, do the Perl bindings work at all? I don't see any implementation of
pretty much any libconcord functionality. Perhaps swig automatically
parses libconcord.h and auto-generates the functions? If so, I guess
it'll "just work" for the new functions, just like it does for the
existing similar functions?

It reads libconcord.h to generate every function, and there's a lot of
overrides and custom handling in concord.i.

However, in this case test.pl needs to be updated for the new firmware changes
you did, plus make sure it works for the 700 (it needs to call prep/post
update and make sure the swig bindings work correctly and no additional
overrides are needed).

OK. I added the prep_config/finish_config to test.pl and validated that this works on the 700. Updated version is attached.
? install
? concordance/.deps
? concordance/.libs
? concordance/Makefile
? concordance/Makefile.in
? concordance/aclocal.m4
? concordance/autom4te.cache
? concordance/concordance
? concordance/config.h
? concordance/config.h.in
? concordance/config.log
? concordance/config.status
? concordance/configure
? concordance/libtool
? concordance/ltmain.sh
? concordance/stamp-h1
? consnoop/consnoop
? libconcord/.deps
? libconcord/.libconcord.h.swp
? libconcord/.libs
? libconcord/Makefile
? libconcord/Makefile.in
? libconcord/aclocal.m4
? libconcord/autom4te.cache
? libconcord/binaryfile.lo
? libconcord/config.guess
? libconcord/config.h
? libconcord/config.h.in
? libconcord/config.log
? libconcord/config.status
? libconcord/config.sub
? libconcord/configure
? libconcord/depcomp
? libconcord/install-sh
? libconcord/libconcord.la
? libconcord/libconcord.lo
? libconcord/libtool
? libconcord/libusbhid.lo
? libconcord/ltmain.sh
? libconcord/missing
? libconcord/remote.lo
? libconcord/remote_z.lo
? libconcord/stamp-h1
? libconcord/usblan.lo
? libconcord/web.lo
? libconcord/bindings/perl/.concord.pm.swp
? libconcord/bindings/perl/.test.pl.swp
? libconcord/bindings/perl/Makefile
? libconcord/bindings/perl/blib
? libconcord/bindings/perl/concord.bs
? libconcord/bindings/perl/concord.pm
? libconcord/bindings/perl/concord_wrap.c
? libconcord/bindings/perl/pm_to_blib
? libconcord/bindings/python/libconcord.pyc
Index: concordance/concordance.c
===================================================================
RCS file: /cvsroot/concordance/concordance/concordance/concordance.c,v
retrieving revision 1.39
diff -u -p -r1.39 concordance.c
--- concordance/concordance.c   5 Jul 2009 13:46:56 -0000       1.39
+++ concordance/concordance.c   25 Jul 2010 01:55:19 -0000
@@ -467,6 +467,11 @@ int upload_config(uint8_t *data, uint32_
                        post_preconfig(data, size);
        }
 
+       printf("Preparing Update:    ");
+       if ((err = prep_config())) {
+               return err;
+       }
+       printf("                     done\n");
        /*
         * We must invalidate flash before we erase and write so that
         * nothing will attempt to reference it while we're working.
@@ -500,6 +505,12 @@ int upload_config(uint8_t *data, uint32_
        }
        printf("       done\n");
 
+       printf("Finalizing Update:   ");
+       if ((err = finish_config())) {
+               return err;
+       }
+       printf("                     done\n");
+
        if ((*options).noreset) {
                return 0;
        }
Index: libconcord/libconcord.cpp
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/libconcord.cpp,v
retrieving revision 1.41
diff -u -p -r1.41 libconcord.cpp
--- libconcord/libconcord.cpp   20 May 2009 19:46:09 -0000      1.41
+++ libconcord/libconcord.cpp   25 Jul 2010 01:55:19 -0000
@@ -880,6 +880,28 @@ int verify_remote_config(uint8_t *in, ui
        return 0;
 }
 
+int prep_config()
+{
+       int err = 0;
+
+       if ((err = rmt->PrepConfig(ri))) {
+               return LC_ERROR;
+       }
+
+       return 0;
+}
+
+int finish_config()
+{
+       int err = 0;
+
+       if ((err = rmt->FinishConfig(ri))) {
+               return LC_ERROR;
+       }
+
+       return 0;
+}
+
 int erase_config(uint32_t size, lc_callback cb, void *cb_arg)
 {
        int err = 0;
@@ -1023,34 +1045,9 @@ int is_config_safe_after_fw()
 int prep_firmware()
 {
        int err = 0;
-       uint8_t data[1];
 
-       if (ri.arch->firmware_update_base == ri.arch->firmware_base) {
-               /*
-                * The preperation for where the staging area IS the config
-                * area.
-                *    restart config
-                *    write "1" to flash addr 200000
-                */
-               if ((err = rmt->RestartConfig()))
-                       return LC_ERROR;
-               data[0] = 0x00;
-               if ((err = rmt->WriteFlash(0x200000, 1, data, ri.protocol, NULL,
-                               NULL)))
-                       return LC_ERROR;
-       } else {
-               /*
-                * The preperation for where the staging area is distinct.
-                *    write "1" to ram addr 0
-                *    read it back
-                */
-               data[0] = 0x00;
-               if ((err = rmt->WriteRam(0, 1, data)))
-                       return LC_ERROR_WRITE;
-               if ((err = rmt->ReadRam(0, 1, data)))
-                       return LC_ERROR_WRITE;
-               if (data[0] != 0)
-                       return LC_ERROR_VERIFY;
+       if ((err = rmt->PrepFirmware(ri))) {
+               return LC_ERROR;
        }
 
        return 0;
@@ -1060,27 +1057,8 @@ int finish_firmware()
 {
        int err = 0;
 
-       uint8_t data[1];
-       if (ri.arch->firmware_update_base == ri.arch->firmware_base) {
-               data[0] = 0x02;
-               if ((err = rmt->WriteFlash(0x200000, 1, data, ri.protocol, NULL,
-                       NULL)))
-                       return LC_ERROR;
-       } else {
-               data[0] = 0x02;
-               if ((err = rmt->WriteRam(0, 1, data))) {
-                       debug("Failed to write 2 to RAM 0");
-                       return LC_ERROR_WRITE;
-               }
-               if ((err = rmt->ReadRam(0, 1, data))) {
-                       debug("Failed to from RAM 0");
-                       return LC_ERROR_WRITE;
-               }
-               if (data[0] != 2) {
-                       printf("byte is %d\n",data[0]);
-                       debug("Finalize byte didn't match");
-                       return LC_ERROR_VERIFY;
-               }
+       if ((err = rmt->FinishFirmware(ri))) {
+               return LC_ERROR;
        }
 
        return 0;
Index: libconcord/libconcord.h
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/libconcord.h,v
retrieving revision 1.21
diff -u -p -r1.21 libconcord.h
--- libconcord/libconcord.h     14 Oct 2008 19:35:01 -0000      1.21
+++ libconcord/libconcord.h     25 Jul 2010 01:55:19 -0000
@@ -275,6 +275,21 @@ int write_config_to_file(uint8_t *in, ui
 int verify_remote_config(uint8_t *in, uint32_t size, lc_callback cb,
        void *cb_arg);
 /*
+ * Preps the remote for a config upgrade.
+ *
+ * Note that this and finish_config are NO-OPs for most remotes, and even on
+ * remotes where it is implemented, testing implies that it's not necessary.
+ * However, calling these functions is necessary to completely match the
+ * original Windows software, and future remotes may require these functions
+ * to be executed to operate correctly.
+ */
+int prep_config();
+/*
+ * Tells the remote the config upgrade was successful and that it should
+ * use the new config upon next reboot.
+ */
+int finish_config();
+/*
  * Flash can be changed to 0, but not back to 1, so you must erase the
  * flash (to 1) in order to write the flash.
  */
Index: libconcord/remote.cpp
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/remote.cpp,v
retrieving revision 1.39
diff -u -p -r1.39 remote.cpp
--- libconcord/remote.cpp       11 Feb 2009 20:00:13 -0000      1.39
+++ libconcord/remote.cpp       25 Jul 2010 01:55:19 -0000
@@ -103,7 +103,7 @@ int CRemote::GetIdentity(TRemoteInfo &ri
        const unsigned int rx_len = rsp[0] & 0x0F;
 
        if ((rsp[0] & 0xF0) != RESPONSE_VERSION_DATA ||
-           (rx_len != 7 && rx_len != 5)) {
+           (rx_len != 5 && rx_len != 7 && rx_len != 8)) {
                debug("Bogus ident response: %02X", rsp[1]);
                return LC_ERROR_INVALID_DATA_FROM_REMOTE;
        }
@@ -117,7 +117,13 @@ int CRemote::GetIdentity(TRemoteInfo &ri
        ri.architecture = rx_len < 6 ? 2 : rsp[5] >> 4;
        ri.fw_type = rx_len < 6 ? 0 : rsp[5] & 0x0F;
        ri.skin = rx_len < 6 ? 2 : rsp[6];
-       ri.protocol = rx_len < 7 ? 0 : rsp[7];
+       if (rx_len < 7) {
+               ri.protocol = 0;
+       } else if (rx_len < 8) {
+               ri.protocol = rsp[7];
+       } else {
+               ri.protocol = ri.architecture;
+       }
 
        setup_ri_pointers(ri);
 
@@ -156,12 +162,20 @@ int CRemote::GetIdentity(TRemoteInfo &ri
        }
                
        // read serial (see specs/protocol.txt for details)
-       if ((err = (ri.architecture == 2)
-               // The old 745 stores the serial number in EEPROM
-               ? ReadMiscByte(FLASH_EEPROM_ADDR, FLASH_SIZE,
-                       COMMAND_MISC_EEPROM, rsp)
-               // All newer models store it in Flash
-               : ReadFlash(FLASH_SERIAL_ADDR, 48, rsp, ri.protocol))) {
+       switch (ri.arch->serial_location) {
+       case SERIAL_LOCATION_EEPROM:
+               err = ReadMiscByte(ri.arch->serial_address, SERIAL_SIZE,
+                       COMMAND_MISC_EEPROM, rsp);
+               break;
+       case SERIAL_LOCATION_FLASH:
+               err = ReadFlash(ri.arch->serial_address, SERIAL_SIZE, rsp,
+                       ri.protocol);
+               break;
+       default:
+               debug("Invalid TArchInfo\n");
+               return LC_ERROR_READ;
+       }
+       if (err) {
                debug("Couldn't read serial\n");
                return LC_ERROR_READ;
        }
@@ -344,11 +358,107 @@ int CRemote::EraseFlash(uint32_t addr, u
        return err;
 }
 
-int CRemote::RestartConfig()
+int CRemote::PrepFirmware(const TRemoteInfo &ri)
 {
+       int err = 0;
        uint8_t data[1] = { 0x00 };
 
-       return WriteMiscByte(0x09, 1, COMMAND_MISC_RESTART_CONFIG, data);
+       if (ri.arch->firmware_update_base == ri.arch->firmware_base) {
+               /*
+                * The preperation for where the staging area IS the config
+                * area.
+                *    restart config
+                *    write "1" to flash addr 200000
+                */
+               if ((err = WriteMiscByte(0x09, 1, COMMAND_MISC_RESTART_CONFIG, 
data)))
+                       return LC_ERROR;
+               if ((err = WriteFlash(0x200000, 1, data, ri.protocol, NULL,
+                               NULL)))
+                       return LC_ERROR;
+       } else {
+               /*
+                * The preperation for where the staging area is distinct.
+                *    write "1" to ram addr 0
+                *    read it back
+                */
+               if ((err = WriteRam(0, 1, data)))
+                       return LC_ERROR_WRITE;
+               if ((err = ReadRam(0, 1, data)))
+                       return LC_ERROR_WRITE;
+               if (data[0] != 0)
+                       return LC_ERROR_VERIFY;
+       }
+
+       return 0;
+}
+
+int CRemote::FinishFirmware(const TRemoteInfo &ri)
+{
+       int err = 0;
+
+       uint8_t data[1];
+       if (ri.arch->firmware_update_base == ri.arch->firmware_base) {
+               data[0] = 0x02;
+               if ((err = WriteFlash(0x200000, 1, data, ri.protocol, NULL,
+                       NULL)))
+                       return LC_ERROR;
+       } else {
+               data[0] = 0x02;
+               if ((err = WriteRam(0, 1, data))) {
+                       debug("Failed to write 2 to RAM 0");
+                       return LC_ERROR_WRITE;
+               }
+               if ((err = ReadRam(0, 1, data))) {
+                       debug("Failed to from RAM 0");
+                       return LC_ERROR_WRITE;
+               }
+               if (data[0] != 2) {
+                       printf("byte is %d\n",data[0]);
+                       debug("Finalize byte didn't match");
+                       return LC_ERROR_VERIFY;
+               }
+       }
+
+       return 0;
+}
+
+int CRemote::PrepConfig(const TRemoteInfo &ri)
+{
+       int err;
+       uint8_t data_zero[1] = { 0x00 };
+
+       if (ri.architecture != 14) {
+               return 0;
+       }
+
+       if ((err = WriteMiscByte(0x02, 1, COMMAND_MISC_RESTART_CONFIG, 
data_zero))) {
+               return err;
+       }
+       if ((err = WriteMiscByte(0x05, 1, COMMAND_MISC_RESTART_CONFIG, 
data_zero))) {
+               return err;
+       }
+
+       return 0;
+}
+
+int CRemote::FinishConfig(const TRemoteInfo &ri)
+{
+       int err;
+       uint8_t data_one[1]  = { 0x01 };
+       uint8_t data_zero[1] = { 0x00 };
+
+       if (ri.architecture != 14) {
+               return 0;
+       }
+
+       if ((err = WriteMiscByte(0x03, 1, COMMAND_MISC_RESTART_CONFIG, 
data_one))) {
+               return err;
+       }
+       if ((err = WriteMiscByte(0x06, 1, COMMAND_MISC_RESTART_CONFIG, 
data_zero))) {
+               return err;
+       }
+
+       return 0;
 }
 
 int CRemote::WriteRam(uint32_t addr, const uint32_t len, uint8_t *wr)
Index: libconcord/remote.h
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/remote.h,v
retrieving revision 1.19
diff -u -p -r1.19 remote.h
--- libconcord/remote.h 14 Oct 2008 19:35:01 -0000      1.19
+++ libconcord/remote.h 25 Jul 2010 01:55:19 -0000
@@ -24,9 +24,7 @@
 #ifndef REMOTE_H
 #define REMOTE_H
 
-#define FLASH_EEPROM_ADDR 0x10
-#define FLASH_SERIAL_ADDR 0x000110
-#define FLASH_SIZE 48
+#define SERIAL_SIZE 48
 /*
  * limits for IR signal learning, stop when any is reached:
  * timeouts in milliseconds, length in number of mark/space durations
@@ -74,7 +72,11 @@ struct TFlash {
        const char              *part;
 };
 
+#define SERIAL_LOCATION_EEPROM 1
+#define SERIAL_LOCATION_FLASH  2
 struct TArchInfo {
+       int             serial_location;
+       uint32_t        serial_address;
        uint32_t        flash_base;
        uint32_t        firmware_base;
        uint32_t        config_base;
@@ -149,7 +151,10 @@ public:
                lc_callback cb=NULL, void *cb_arg=NULL)=0;
        virtual int WriteRam(uint32_t addr, const uint32_t len, uint8_t *wr)=0;
        virtual int ReadRam(uint32_t addr, const uint32_t len, uint8_t *rd)=0;
-       virtual int RestartConfig()=0;
+       virtual int PrepFirmware(const TRemoteInfo &ri) = 0;
+       virtual int FinishFirmware(const TRemoteInfo &ri) = 0;
+       virtual int PrepConfig(const TRemoteInfo &ri)=0;
+       virtual int FinishConfig(const TRemoteInfo &ri)=0;
 
        virtual int GetTime(const TRemoteInfo &ri, THarmonyTime &ht)=0;
        virtual int SetTime(const TRemoteInfo &ri, const THarmonyTime &ht)=0;
@@ -188,7 +193,10 @@ public:
                void *cb_arg=NULL);
        int WriteRam(uint32_t addr, const uint32_t len, uint8_t *wr);
        int ReadRam(uint32_t addr, const uint32_t len, uint8_t *rd);
-       int RestartConfig();
+       int PrepFirmware(const TRemoteInfo &ri);
+       int FinishFirmware(const TRemoteInfo &ri);
+       int PrepConfig(const TRemoteInfo &ri);
+       int FinishConfig(const TRemoteInfo &ri);
 
        int GetTime(const TRemoteInfo &ri, THarmonyTime &ht);
        int SetTime(const TRemoteInfo &ri, const THarmonyTime &ht);
@@ -230,7 +238,10 @@ public:
                void *cb_arg=NULL);
        int WriteRam(uint32_t addr, const uint32_t len, uint8_t *wr);
        int ReadRam(uint32_t addr, const uint32_t len, uint8_t *rd);
-       int RestartConfig();
+       int PrepFirmware(const TRemoteInfo &ri);
+       int FinishFirmware(const TRemoteInfo &ri);
+       int PrepConfig(const TRemoteInfo &ri);
+       int FinishConfig(const TRemoteInfo &ri);
 
        int GetTime(const TRemoteInfo &ri, THarmonyTime &ht);
        int SetTime(const TRemoteInfo &ri, const THarmonyTime &ht);
Index: libconcord/remote_info.h
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/remote_info.h,v
retrieving revision 1.10
diff -u -p -r1.10 remote_info.h
--- libconcord/remote_info.h    6 Oct 2008 21:01:18 -0000       1.10
+++ libconcord/remote_info.h    25 Jul 2010 01:55:19 -0000
@@ -84,7 +84,20 @@ static const TModel ModelList[]={
        { MFG_HAR,      "Harmony 670",          NULL },                         
// 50
        { MFG_COOL,     "Harmony 552",          "Mocha Grande" },
        { MFG_HAR,      "Harmony 1000i",        "Cognac" },
-       { MFG_UNK,      "Unknown",                      NULL }
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_UNK,      "Unknown",                      NULL },                 
// 60
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_UNK,      "Unknown",                      NULL },
+       { MFG_HAR,      "Harmony 700",          "Molson" }
 };
 
 static const unsigned int max_model=sizeof(ModelList)/sizeof(TModel)-1;
@@ -110,39 +123,300 @@ static const uint32_t sectors3[]={ 0x010
 static const uint32_t sectors4[]={ 0x010000, 0x020000, 0x030000, 0x040000, 
0x050000,
        0x060000, 0x070000, 0x080000, 0 };
 
+// 1c:15 EON F16-100HIP (Uniform Sectors)
+// Manufacturer 1c, flash 15. But, firmware returns these swapped
+static const uint32_t sectors5[]={
+       0x010000, 0x020000, 0x030000, 0x040000, 0x050000, 0x060000, 0x070000, 
0x080000,
+       0x090000, 0x0a0000, 0x0b0000, 0x0c0000, 0x0d0000, 0x0e0000, 0x0f0000, 
0x100000,
+       0x110000, 0x120000, 0x130000, 0x140000, 0x150000, 0x160000, 0x170000, 
0x180000,
+       0x190000, 0x1a0000, 0x1b0000, 0x1c0000, 0x1d0000, 0x1e0000, 0x1f0000, 
0x200000,
+       0x210000, 0x220000, 0x230000, 0x240000, 0x250000, 0x260000, 0x270000, 
0x280000,
+       0x290000, 0x2a0000, 0x2b0000, 0x2c0000, 0x2d0000, 0x2e0000, 0x2f0000, 
0x300000,
+       0x310000, 0x320000, 0x330000, 0x340000, 0x350000, 0x360000, 0x370000, 
0x380000,
+       0x390000, 0x3a0000, 0x3b0000, 0x3c0000, 0x1d0000, 0x3e0000, 0x3f0000, 
0x400000,
+       0 };
+
 static const TFlash FlashList[]={
        { 0x01,         0x37,   1024,   8,      sectors1,       "AMD 
Am29LV008B" },
        { 0x01,         0x49,   2048,   16,     sectors2,       "AMD 
Am29LV160BB" },
        { 0x01,         0x4C,   2048,   8,      sectors2,       "AMD 
Am29LV116DB" },
+       { 0x15,         0x1C,   4096,   8,      sectors5,       "EON 
F16-100HIP" },
        { 0xFF,         0x11,   256,    1,      sectors3,       "25F020" },
        { 0xFF,         0x12,   512,    1,      sectors4,       "25F040" } ,
        { 0,            0,              0,              0,      NULL,           
"" }
 };
 
-static const TArchInfo ArchList[11]={
-//        fl_base,  fw_base,    config_base,    fw_up_base,    fw_4847_off,    
cookie,         ck_sz,  endvec, micro,          fl_sz,  ram_sz, ee_sz, usb
-// 0
-       { 0,        0,          0,              0,              0,              
0,              0,      0,      "",             0,      0,      0,      "" },
-// 1
-       { 0,        0,          0,              0,              0,              
0,              0,      0,      "",             0,      0,      0,      "" },
-// 2 - 745
-       { 0x000000, 0,          0x006000,       0,              0,              
0x03A5,         2,      2,      "PIC16LF877",   8,      368,    256,    
"USBN9603" },
-// 3 - 748, 768
-       { 0x000000, 0x010000,   0x020000,       0x020000,       2,              
0x0369,         2,      2,      "PIC18LC801",   0,      1536,   0,      
"USBN9604" },
-// 4
-       { 0,        0,          0,              0,              0,              
0,              0,      0,      "",             0,      0,      0,      "" },
-// 5
-       { 0,        0,          0,              0,              0,              
0,              0,      0,      "",             0,      0,      0,      "" },
-// 6
-       { 0,        0,          0,              0,              0,              
0,              0,      0,      "",             0,      0,      0,      "" },
-// 7 - 6xx
-       { 0x000000, 0x010000,   0x020000,       0x020000,       2,              
0x4D424D42,     4,      5,      "PIC18LC801",   0,      1536,   0,      
"USBN9604" },
-// 8 - 880
-       { 0x000000, 0x010000,   0x020000,       0x1D0000,       4,              
0x50545054,     4,      4,      "PIC18LC801",   0,      1536,   0,      
"USBN9604" },
-// 9 - 360, 52x, 55x
-       { 0x800000, 0x810000,   0x820000,       0x810000,       4,              
0x4D434841,     4,      4,      "PIC18LF4550",  16,     2048,   256,    
"Internal" },
-// 10 - 890
-       { 0x000000, 0x010000,   0x020000,       0,              0,              
0x1, /*hack*/   4,      4,      "PIC18LC801",   0,      1536,   0,      
"USBN9604" },
+static const TArchInfo ArchList[]={
+       /* arch 0 */
+       {
+               0,                              // serial_location
+               0,                              // serial_address
+               0,                              // flash_base
+               0,                              // firmware_base
+               0,                              // config_base
+               0,                              // firmware_update_base
+               0,                              // firmware_4847_offset
+               0,                              // cookie
+               0,                              // cookie_size
+               0,                              // end_vector
+               "",                             // micro
+               0,                              // flash_size
+               0,                              // ram_size
+               0,                              // eeprom_size
+               "",                             // usb
+       },
+       /* arch 1 */
+       {
+               0,                              // serial_location
+               0,                              // serial_address
+               0,                              // flash_base
+               0,                              // firmware_base
+               0,                              // config_base
+               0,                              // firmware_update_base
+               0,                              // firmware_4847_offset
+               0,                              // cookie
+               0,                              // cookie_size
+               0,                              // end_vector
+               "",                             // micro
+               0,                              // flash_size
+               0,                              // ram_size
+               0,                              // eeprom_size
+               "",                             // usb
+       },
+       /* arch 2: 745 */
+       {
+               SERIAL_LOCATION_EEPROM,         // serial_location
+               0x10,                           // serial_address
+               0x000000,                       // flash_base
+               0,                              // firmware_base
+               0x006000,                       // config_base
+               0,                              // firmware_update_base
+               0,                              // firmware_4847_offset
+               0x03A5,                         // cookie
+               2,                              // cookie_size
+               2,                              // end_vector
+               "PIC16LF877",                   // micro
+               8,                              // flash_size
+               368,                            // ram_size
+               256,                            // eeprom_size
+               "USBN9603",                             // usb
+       },
+       /* arch 3: 748, 768 */
+       {
+               SERIAL_LOCATION_FLASH,          // serial_location
+               0x000110,                       // serial_address
+               0x000000,                       // flash_base
+               0x010000,                       // firmware_base
+               0x020000,                       // config_base
+               0x020000,                       // firmware_update_base
+               2,                              // firmware_4847_offset
+               0x0369,                         // cookie
+               2,                              // cookie_size
+               2,                              // end_vector
+               "PIC18LC801",                   // micro
+               0,                              // flash_size
+               1536,                           // ram_size
+               0,                              // eeprom_size
+               "USBN9604",                     // usb
+       },
+       /* arch 4 */
+       {
+               0,                              // serial_location
+               0,                              // serial_address
+               0,                              // flash_base
+               0,                              // firmware_base
+               0,                              // config_base
+               0,                              // firmware_update_base
+               0,                              // firmware_4847_offset
+               0,                              // cookie
+               0,                              // cookie_size
+               0,                              // end_vector
+               "",                             // micro
+               0,                              // flash_size
+               0,                              // ram_size
+               0,                              // eeprom_size
+               "",                             // usb
+       },
+       /* arch 5 */
+       {
+               0,                              // serial_location
+               0,                              // serial_address
+               0,                              // flash_base
+               0,                              // firmware_base
+               0,                              // config_base
+               0,                              // firmware_update_base
+               0,                              // firmware_4847_offset
+               0,                              // cookie
+               0,                              // cookie_size
+               0,                              // end_vector
+               "",                             // micro
+               0,                              // flash_size
+               0,                              // ram_size
+               0,                              // eeprom_size
+               "",                             // usb
+       },
+       /* arch 6 */
+       {
+               0,                              // serial_location
+               0,                              // serial_address
+               0,                              // flash_base
+               0,                              // firmware_base
+               0,                              // config_base
+               0,                              // firmware_update_base
+               0,                              // firmware_4847_offset
+               0,                              // cookie
+               0,                              // cookie_size
+               0,                              // end_vector
+               "",                             // micro
+               0,                              // flash_size
+               0,                              // ram_size
+               0,                              // eeprom_size
+               "",                             // usb
+       },
+       /* arch 7: 6xx */
+       {
+               SERIAL_LOCATION_FLASH,          // serial_location
+               0x000110,                       // serial_address
+               0x000000,                       // flash_base
+               0x010000,                       // firmware_base
+               0x020000,                       // config_base
+               0x020000,                       // firmware_update_base
+               2,                              // firmware_4847_offset
+               0x4D424D42,                     // cookie
+               4,                              // cookie_size
+               5,                              // end_vector
+               "PIC18LC801",                   // micro
+               0,                              // flash_size
+               1536,                           // ram_size
+               0,                              // eeprom_size
+               "USBN9604",                     // usb
+       },
+       /* arch 8: 880 */
+       {
+               SERIAL_LOCATION_FLASH,          // serial_location
+               0x000110,                       // serial_address
+               0x000000,                       // flash_base
+               0x010000,                       // firmware_base
+               0x020000,                       // config_base
+               0x1D0000,                       // firmware_update_base
+               2,                              // firmware_4847_offset
+               0x50545054,                     // cookie
+               4,                              // cookie_size
+               5,                              // end_vector
+               "PIC18LC801",                   // micro
+               0,                              // flash_size
+               1536,                           // ram_size
+               0,                              // eeprom_size
+               "USBN9604",                     // usb
+       },
+       /* arch 9: 360, 52x, 55x */
+       {
+               SERIAL_LOCATION_FLASH,          // serial_location
+               0x000110,                       // serial_address
+               0x000000,                       // flash_base
+               0x810000,                       // firmware_base
+               0x820000,                       // config_base
+               0x810000,                       // firmware_update_base
+               2,                              // firmware_4847_offset
+               0x4D434841,                     // cookie
+               4,                              // cookie_size
+               4,                              // end_vector
+               "PIC18LF4550",                  // micro
+               0,                              // flash_size
+               2048,                           // ram_size
+               256,                            // eeprom_size
+               "Internal",                     // usb
+       },
+       /* arch 10: 890 */
+       {
+               SERIAL_LOCATION_FLASH,          // serial_location
+               0x000110,                       // serial_address
+               0x000000,                       // flash_base
+               0x010000,                       // firmware_base
+               0x020000,                       // config_base
+               0,                              // firmware_update_base
+               0,                              // firmware_4847_offset
+               0x1, /* hack */                 // cookie
+               4,                              // cookie_size
+               4,                              // end_vector
+               "PIC18LC801",                   // micro
+               0,                              // flash_size
+               1536,                           // ram_size
+               0,                              // eeprom_size
+               "USBN9604",                     // usb
+       },
+       /* arch 11 */
+       {
+               0,                              // serial_location
+               0,                              // serial_address
+               0,                              // flash_base
+               0,                              // firmware_base
+               0,                              // config_base
+               0,                              // firmware_update_base
+               0,                              // firmware_4847_offset
+               0,                              // cookie
+               0,                              // cookie_size
+               0,                              // end_vector
+               "",                             // micro
+               0,                              // flash_size
+               0,                              // ram_size
+               0,                              // eeprom_size
+               "",                             // usb
+       },
+       /* arch 12 */
+       {
+               0,                              // serial_location
+               0,                              // serial_address
+               0,                              // flash_base
+               0,                              // firmware_base
+               0,                              // config_base
+               0,                              // firmware_update_base
+               0,                              // firmware_4847_offset
+               0,                              // cookie
+               0,                              // cookie_size
+               0,                              // end_vector
+               "",                             // micro
+               0,                              // flash_size
+               0,                              // ram_size
+               0,                              // eeprom_size
+               "",                             // usb
+       },
+       /* arch 13 */
+       {
+               0,                              // serial_location
+               0,                              // serial_address
+               0,                              // flash_base
+               0,                              // firmware_base
+               0,                              // config_base
+               0,                              // firmware_update_base
+               0,                              // firmware_4847_offset
+               0,                              // cookie
+               0,                              // cookie_size
+               0,                              // end_vector
+               "",                             // micro
+               0,                              // flash_size
+               0,                              // ram_size
+               0,                              // eeprom_size
+               "",                             // usb
+       },
+       /* arch 14: 700 */
+       {
+               SERIAL_LOCATION_FLASH,          // serial_location
+               0xfff400,                       // serial_address
+               0x000000,                       // flash_base
+               0x000000,                       // firmware_base (0x010000 but 
not yet supported)
+               0x030000,                       // config_base
+               0,                              // firmware_update_base
+               8,                              // firmware_4847_offset
+               0x4D505347,                     // cookie
+               4,                              // cookie_size
+               4,                              // end_vector
+               "PIC18F67J50",                  // micro
+               0,                              // flash_size
+               0,                              // ram_size
+               0,                              // eeprom_size
+               "Internal",                     // usb
+       }
 };
 
 #endif
Index: libconcord/remote_z.cpp
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/remote_z.cpp,v
retrieving revision 1.23
diff -u -p -r1.23 remote_z.cpp
--- libconcord/remote_z.cpp     21 Jul 2010 18:37:06 -0000      1.23
+++ libconcord/remote_z.cpp     25 Jul 2010 01:55:19 -0000
@@ -365,7 +365,22 @@ int CRemoteZ_Base::ReadRam(uint32_t addr
        return 0;
 }
 
-int CRemoteZ_Base::RestartConfig()
+int CRemoteZ_Base::PrepFirmware(const TRemoteInfo &ri)
+{
+       return 0;
+}
+
+int CRemoteZ_Base::FinishFirmware(const TRemoteInfo &ri)
+{
+       return 0;
+}
+
+int CRemoteZ_Base::PrepConfig(const TRemoteInfo &ri)
+{
+       return 0;
+}
+
+int CRemoteZ_Base::FinishConfig(const TRemoteInfo &ri)
 {
        return 0;
 }
Index: libconcord/bindings/perl/test.pl
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/bindings/perl/test.pl,v
retrieving revision 1.2
diff -u -p -r1.2 test.pl
--- libconcord/bindings/perl/test.pl    14 Feb 2009 13:34:54 -0000      1.2
+++ libconcord/bindings/perl/test.pl    25 Jul 2010 01:55:19 -0000
@@ -115,10 +115,17 @@ sub upload_config
                exit(1);
        }
        print "done\n";
+       print "Preparing for config update ";
+       concord::prep_config();
+       if ($err) {
+               print "Failed to prepare for config update";
+               exit(1);
+       }
+       print "done\n";
        print "Invalidating flash ";
        concord::invalidate_flash();
        if ($err) {
-               print "Failed to invlidate flash";
+               print "Failed to invalidate flash";
                exit(1);
        }
        print "done\n";
@@ -142,6 +149,13 @@ sub upload_config
                print "Failed to write config to remote";
                exit(1);
        }
+       print "Finalizing config update ";
+       concord::finish_config();
+       if ($err) {
+               print "Failed to finalize config update";
+               exit(1);
+       }
+       print "done\n";
 
        concord::delete_blob($blob);
        print "done\n";
Index: libconcord/bindings/python/libconcord.py
===================================================================
RCS file: 
/cvsroot/concordance/concordance/libconcord/bindings/python/libconcord.py,v
retrieving revision 1.7
diff -u -p -r1.7 libconcord.py
--- libconcord/bindings/python/libconcord.py    16 Jul 2010 00:11:43 -0000      
1.7
+++ libconcord/bindings/python/libconcord.py    25 Jul 2010 01:55:19 -0000
@@ -636,6 +636,18 @@ verify_remote_config = _create_func(
     _in('cb_arg', py_object)
 )
 
+# int prep_config();
+prep_config = _create_func(
+    'prep_config',
+    _ret_lc_concord()
+)
+
+# int finish_config();
+finish_config = _create_func(
+    'finish_config',
+    _ret_lc_concord()
+)
+
 # int erase_config(uint32_t size, lc_callback cb, void *cb_arg);
 erase_config = _create_func(
     'erase_config',
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel

Reply via email to