]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/fpgaloader.c
Eradicate all occurences of hardcoded memory addresses from all sources files, except...
[proxmark3-svn] / armsrc / fpgaloader.c
index e07c25420afd1a3fd22b2fdace468b6bb9c9d218..58385588b417affa07ef1b0adeac5b7668a14159 100644 (file)
@@ -275,14 +275,45 @@ void FpgaDownloadAndGo(void)
        }\r
        \r
        /* Fallback for the old flash image format: Check for the magic marker 0xFFFFFFFF\r
-        * 0xAA995566 at address 0x2000. This is raw bitstream with a size of 336,768 bits \r
+        * 0xAA995566 at address 0x102000. This is raw bitstream with a size of 336,768 bits \r
         * = 10,524 DWORDs, stored as DWORDS e.g. little-endian in memory, but each DWORD\r
         * is still to be transmitted in MSBit first order. Set the invert flag to indicate\r
         * that the DownloadFPGA function should invert every 4 byte sequence when doing\r
         * the bytewise download.
         */\r
-       if( *(DWORD*)0x2000 == 0xFFFFFFFF && *(DWORD*)0x2004 == 0xAA995566 )\r
-               DownloadFPGA((DWORD *)0x2000, 10524, 1);\r
+       if( *(DWORD*)0x102000 == 0xFFFFFFFF && *(DWORD*)0x102004 == 0xAA995566 )\r
+               DownloadFPGA((DWORD *)0x102000, 10524, 1);\r
+}\r
+\r
+void FpgaGatherVersion(char *dst, int len)\r
+{\r
+       char *fpga_info; \r
+       unsigned int fpga_info_len;\r
+       dst[0] = 0;\r
+       if(!bitparse_find_section('e', (void**)&fpga_info, &fpga_info_len)) {\r
+               strncat(dst, "FPGA image: legacy image without version information", len-1);\r
+       } else {\r
+               strncat(dst, "FPGA image built", len-1);\r
+               /* USB packets only have 48 bytes data payload, so be terse */\r
+#if 0\r
+               if(bitparse_find_section('a', (void**)&fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {\r
+                       strncat(dst, " from ", len-1);\r
+                       strncat(dst, fpga_info, len-1);\r
+               }\r
+               if(bitparse_find_section('b', (void**)&fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {\r
+                       strncat(dst, " for ", len-1);\r
+                       strncat(dst, fpga_info, len-1);\r
+               }\r
+#endif\r
+               if(bitparse_find_section('c', (void**)&fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {\r
+                       strncat(dst, " on ", len-1);\r
+                       strncat(dst, fpga_info, len-1);\r
+               }\r
+               if(bitparse_find_section('d', (void**)&fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {\r
+                       strncat(dst, " at ", len-1);\r
+                       strncat(dst, fpga_info, len-1);\r
+               }\r
+       }\r
 }\r
 \r
 //-----------------------------------------------------------------------------\r
Impressum, Datenschutz