[DDR] check if DAP_M3 values are sane
authorBrad Griffis <bgriffis@ti.com>
Tue, 23 Apr 2019 19:57:36 +0000 (14:57 -0500)
committerBrad Griffis <bgriffis@ti.com>
Tue, 23 Apr 2019 19:57:36 +0000 (14:57 -0500)
am335x-ddr-analysis.dss

index a437668cd056d5acf740d0792fe7b907a8a71e59..076a05990e989b970914ecc16c230eaf5062c9ae 100644 (file)
@@ -90,6 +90,17 @@ try {
        print("\n ERROR: Could not connect to DAP_M3.\n");
 }
 
+// Do a test read of Device_ID register at 0x44e10600
+value = debugSessionDAP.memory.readWord(0,0x44e10600,false);
+
+// If it is zero, switch to CS_DAP_DebugSS
+if (value == 0)
+{
+       debugSessionDAP.target.disconnect();
+       debugSessionDAP = ds.openSession("*","CS_DAP_DebugSS");
+       debugSessionDAP.target.connect();
+}
+
 var original_CM_WKUP_DEBUGSS_CLKCTRL = debugSessionDAP.memory.readWord(0,0x44e00414,false);
 var original_CM_PER_L3_CLKSTCTRL = debugSessionDAP.memory.readWord(0,0x44E0000C,false);