]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
pexor dma support added
authorhadaq <hadaq>
Sun, 22 May 2011 20:49:31 +0000 (20:49 +0000)
committerhadaq <hadaq>
Sun, 22 May 2011 20:49:31 +0000 (20:49 +0000)
libtrbnet/trbflash.c

index fab3c05cef2df52058c21dc04a9035d845f801a9..6646b56963ae28949d8a837676f0caaa336d64c2 100644 (file)
@@ -75,7 +75,8 @@ typedef enum
     FLASH_SHOWER_ADDON_V2_FPGA3 = 10,
 
     FLASH_CTS_FPGA1 = 11,
-    FLASH_CTS_FPGA2 = 12
+    FLASH_CTS_FPGA2 = 12,
+    FLASH_PEXOR = 13
   } FlashType;
 
 static const char FlashTypeStr[16][32] = {
@@ -91,12 +92,13 @@ static const char FlashTypeStr[16][32] = {
   "SHOWER_ADDON_V2_FPGA2",
   "SHOWER_ADDON_V2_FPGA3",
   "CTS_FPGA1",
-  "CTS_FPGA2"
+  "CTS_FPGA2",
+  "PEXOR"
 };
 
 static FlashType flashType = FLASH_INVALID;
 static uint32_t manId = 0;
-static const char trbflash_version[] = "$Revision: 2.29 $";
+static const char trbflash_version[] = "$Revision: 2.30 $";
 
 static uint32_t mdcFlashSelect = 1;
 
@@ -384,6 +386,10 @@ static int initTransfer(uint16_t trb_address)
       fType = FLASH_CTS_FPGA2;
       break;
 
+    case 0x7300:
+      fType = FLASH_PEXOR;
+      break;
+
     default:
       /* Error: Unknown FlashType */
       fprintf(logFile, "Error > initTransfer: "
@@ -444,7 +450,7 @@ static int initTransfer(uint16_t trb_address)
       return -1;
     }
   }
-
+  fprintf(stderr, "manId is: 0x%x\n", manId);
   /* Set NUM_PAGES */
   switch (manId) {
 
@@ -661,7 +667,7 @@ static int programImageBuffer(uint16_t trb_address,
   }
   fprintf(stdout, "Block: 0 1 2 3 4 5 6 7 8 9 A B C D E F");
   fflush(stdout);
-  
+
   errorCtr = 0;
 
   if ((mode != PMODE_VERIFY) && (manId == 0x1520c2)) {
@@ -680,7 +686,7 @@ static int programImageBuffer(uint16_t trb_address,
     }
     fprintf(stdout, ".\b");
     fflush(stdout);
-    
+
     if (!(bytesWritten > 0) && (writeInfoPage == 0)) {
       fprintf(stdout, ". ");
       fflush(stdout);
@@ -959,7 +965,9 @@ static int prepareImageBuffer()
   case FLASH_CTS_FPGA2:
     strId = "cts_fpga2";
     break;
-
+  case FLASH_PEXOR:
+    strId = "pexor";
+    break;
   default:
     abort();
     break;
@@ -1095,7 +1103,6 @@ int main(int argc, char **argv)
 {
   unsigned int i;
   char userInfoStr[256] = "";
-
   trb_debug = 0;
   logFile = stderr;
   mdcFlashSelect = 1;