The attached patch adds a field to the remote info structure that tells
the code where to put the 4847 byte sequence in firmware images when
programming them.
? libconcord/.deps
? libconcord/.libconcord.cpp.swp
? libconcord/.libconcord.h.swp
? libconcord/.libs
? libconcord/.remote.cpp.swp
? libconcord/.remote.h.swp
? libconcord/.remote_info.h.swp
? 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
Index: libconcord/libconcord.cpp
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/libconcord.cpp,v
retrieving revision 1.11
diff -u -r1.11 libconcord.cpp
--- libconcord/libconcord.cpp 14 Mar 2008 23:09:36 -0000 1.11
+++ libconcord/libconcord.cpp 16 Mar 2008 20:59:43 -0000
@@ -980,7 +980,7 @@
if (in[0] == 0xFF && in[1] == 0xFF) {
/*
* FIXME: This is HORRIBLE and will only work
- * for the LATEST firmware (at time of writing)
+ * for the LATEST 880 firmware (at time of writing)
* but it's simply a place holder. These two
* bytes are some magic "value" - perhaps
* a checksum, perhaps something else. Until
@@ -989,13 +989,21 @@
in[0] = 0xFB;
in[1] = 0x85;
- /*
- * These two bytes are "always" 0x48 and 0x47, at least
- * for architecture 8, which is all we've thus-far figured
- * out definitively.
- */
- in[4] = 0x48;
- in[5] = 0x47;
+ if (ri.arch->firmware_4847_offset != UINT32_MAX) {
+ /*
+ * There are "always" two bytes at some location that
+ * contain 0x48 and 0x47.
+ *
+ * Note: For some arch's (10 currently) we haven't
+ * investigated where these go, hence the check for
+ * a valid location about.
+ *
+ * Note: Arch 2 may be an exception to rule, and needs
+ * more investigation.
+ */
+ in[ri.arch->firmware_4847_offset] = 0x48;
+ in[ri.arch->firmware_4847_offset + 1] = 0x47;
+ }
}
return 0;
Index: libconcord/libconcord.h
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/libconcord.h,v
retrieving revision 1.8
diff -u -r1.8 libconcord.h
--- libconcord/libconcord.h 14 Mar 2008 09:23:01 -0000 1.8
+++ libconcord/libconcord.h 16 Mar 2008 20:59:43 -0000
@@ -27,6 +27,8 @@
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;
+#define UINT32_MAX 0xFFFFFFFFU;
+
/*
* FIXME: We need to fix the code that is generating these warnings!!
*/
@@ -35,6 +37,7 @@
#endif
#else
+#define __STDC_LIMIT_MACROS 1 // Requests *_MAX macros from stdint.h
#include <stdint.h>
#endif
Index: libconcord/remote.h
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/remote.h,v
retrieving revision 1.13
diff -u -r1.13 remote.h
--- libconcord/remote.h 14 Mar 2008 23:09:36 -0000 1.13
+++ libconcord/remote.h 16 Mar 2008 20:59:43 -0000
@@ -68,6 +68,7 @@
uint32_t firmware_base;
uint32_t config_base;
uint32_t firmware_update_base;
+ uint32_t firmware_4847_offset;
uint32_t cookie;
uint32_t cookie_size;
uint32_t end_vector;
Index: libconcord/remote_info.h
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/remote_info.h,v
retrieving revision 1.4
diff -u -r1.4 remote_info.h
--- libconcord/remote_info.h 9 Mar 2008 01:50:48 -0000 1.4
+++ libconcord/remote_info.h 16 Mar 2008 20:59:43 -0000
@@ -116,18 +116,18 @@
};
static const TArchInfo ArchList[11]={
-// fl_base, fw_base, config_base, fw_up_base, cookie, ck_sz, endvec, micro, fl_sz, ram_sz, ee_sz, usb
- { 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, "" }, // 0
- { 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, "" }, // 1
- { 0x000000, 0, 0x006000, 0, 0x03A5, 2, 2, "PIC16LF877", 8, 368, 256, "USBN9603" }, // 2 - 745
- { 0x000000, 0x010000, 0x020000, 0x020000, 0x0369, 2, 2, "PIC18LC801", 0, 1536, 0, "USBN9604" }, // 3 - 748,768
- { 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, "" }, // 4
- { 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, "" }, // 5
- { 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, "" }, // 6
- { 0x000000, 0x010000, 0x020000, 0x020000, 0x4D424D42, 4, 5, "PIC18LC801", 0, 1536, 0, "USBN9604" }, // 7 - 600 Series
- { 0x000000, 0x010000, 0x020000, 0x1D0000, 0x50545054, 4, 4, "PIC18LC801", 0, 1536, 0, "USBN9604" }, // 8 - 880
- { 0x800000, 0x810000, 0x820000, 0x810000, 0x4D434841, 4, 4, "PIC18LF4550", 16, 2048, 256, "Internal" }, // 9 - 360/520/550
- { 0x000000, 0x010000, 0x020000, 0, 0x1, /*hack*/ 4, 4, "PIC18LC801", 0, 1536, 0, "USBN9604" }, // 10 - 890
+// 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, UINT32_MAX, 0, 0, 0, "", 0, 0, 0, "" }, // 0
+ { 0, 0, 0, 0, UINT32_MAX, 0, 0, 0, "", 0, 0, 0, "" }, // 1
+ { 0x000000, 0, 0x006000, 0, UINT32_MAX, 0x03A5, 2, 2, "PIC16LF877", 8, 368, 256, "USBN9603" }, // 2 - 745
+ { 0x000000, 0x010000, 0x020000, 0x020000, 2, 0x0369, 2, 2, "PIC18LC801", 0, 1536, 0, "USBN9604" }, // 3 - 748,768
+ { 0, 0, 0, 0, UINT32_MAX, 0, 0, 0, "", 0, 0, 0, "" }, // 4
+ { 0, 0, 0, 0, UINT32_MAX, 0, 0, 0, "", 0, 0, 0, "" }, // 5
+ { 0, 0, 0, 0, UINT32_MAX, 0, 0, 0, "", 0, 0, 0, "" }, // 6
+ { 0x000000, 0x010000, 0x020000, 0x020000, 2, 0x4D424D42, 4, 5, "PIC18LC801", 0, 1536, 0, "USBN9604" }, // 7 - 600 Series
+ { 0x000000, 0x010000, 0x020000, 0x1D0000, 4, 0x50545054, 4, 4, "PIC18LC801", 0, 1536, 0, "USBN9604" }, // 8 - 880
+ { 0x800000, 0x810000, 0x820000, 0x810000, 4, 0x4D434841, 4, 4, "PIC18LF4550", 16, 2048, 256, "Internal" }, // 9 - 360/520/550
+ { 0x000000, 0x010000, 0x020000, 0, UINT32_MAX, 0x1, /*hack*/ 4, 4, "PIC18LC801", 0, 1536, 0, "USBN9604" }, // 10 - 890
};
#endif
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel