]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - sitara-dss-files/am335x-dss-files.git/blobdiff - am335x-ctt.dss
am335x-bbb-pru-startup.js initial commit
[sitara-dss-files/am335x-dss-files.git] / am335x-ctt.dss
index b46b51d66a979dc9eb21537cec7ad3861efe9330..83fbd0a6189038dd90ecbe276cdee615fa3fae79 100644 (file)
@@ -1,12 +1,46 @@
+/*\r
+ * Copyright (c) 2006-2014, Texas Instruments Incorporated\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ *\r
+ * *  Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ *\r
+ * *  Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ *\r
+ * *  Neither the name of Texas Instruments Incorporated nor the names of\r
+ *    its contributors may be used to endorse or promote products derived\r
+ *    from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ */\r
 \r
 var ctt_registers = [\r
        0x44e00000,\r
        0x44e00004,\r
        0x44e00008,\r
        0x44e0000c,\r
+       0x44e00010,\r
        0x44e00014,\r
        0x44e00018,\r
        0x44e0001c,\r
+       0x44e00020,\r
        0x44e00024,\r
        0x44e00028,\r
        0x44e0002c,\r
@@ -19,6 +53,8 @@ var ctt_registers = [
        0x44e00048,\r
        0x44e0004c,\r
        0x44e00050,\r
+       0x44e00054,\r
+       0x44e00058,\r
        0x44e00060,\r
        0x44e00064,\r
        0x44e00068,\r
@@ -30,9 +66,18 @@ var ctt_registers = [
        0x44e00080,\r
        0x44e00084,\r
        0x44e00088,\r
+       0x44e0008c,\r
+       0x44e00090,\r
+       0x44e00094,\r
+       0x44e00098,\r
+       0x44e0009c,\r
+       0x44e000a0,\r
+       0x44e000a4,\r
+       0x44e000a8,\r
        0x44e000ac,\r
        0x44e000b0,\r
        0x44e000b4,\r
+       0x44e000b8,\r
        0x44e000bc,\r
        0x44e000c0,\r
        0x44e000c4,\r
@@ -51,10 +96,18 @@ var ctt_registers = [
        0x44e000f8,\r
        0x44e000fc,\r
        0x44e00100,\r
+       0x44e00104,\r
        0x44e0010c,\r
        0x44e00110,\r
        0x44e0011c,\r
        0x44e00120,\r
+       0x44e00124,\r
+       0x44e00128,\r
+       0x44e0012c,\r
+       0x44e00130,\r
+       0x44e00134,\r
+       0x44e00138,\r
+       0x44e0013c,\r
        0x44e00140,\r
        0x44e00144,\r
        0x44e00148,\r
@@ -67,10 +120,31 @@ var ctt_registers = [
        0x44e00410,\r
        0x44e00414,\r
        0x44e00418,\r
+       0x44e0041c,\r
+       0x44e00420,\r
+       0x44e00424,\r
+       0x44e00428,\r
        0x44e0042c,\r
+       0x44e00430,\r
+       0x44e00434,\r
+       0x44e00438,\r
+       0x44e0043c,\r
        0x44e00440,\r
+       0x44e00444,\r
+       0x44e00448,\r
+       0x44e0044c,\r
+       0x44e00450,\r
        0x44e00454,\r
+       0x44e00458,\r
+       0x44e0045c,\r
+       0x44e00460,\r
+       0x44e00464,\r
        0x44e00468,\r
+       0x44e0046c,\r
+       0x44e00470,\r
+       0x44e00474,\r
+       0x44e00478,\r
+       0x44e0047c,\r
        0x44e00480,\r
        0x44e00484,\r
        0x44e00488,\r
@@ -93,6 +167,7 @@ var ctt_registers = [
        0x44e004cc,\r
        0x44e004d0,\r
        0x44e004d4,\r
+       0x44e004d8,\r
        0x44e00504,\r
        0x44e00508,\r
        0x44e0050c,\r
@@ -114,25 +189,48 @@ var ctt_registers = [
        0x44e00804,\r
        0x44e00900,\r
        0x44e00904,\r
+       0x44e00908,\r
        0x44e0090c,\r
        0x44e00910,\r
        0x44e00914,\r
+       0x44e00a00,\r
+       0x44e00a20,\r
+       0x44e00b00,\r
+       0x44e00b04,\r
+       0x44e00b08,\r
+       0x44e00b0c,\r
+       0x44e00b10,\r
+       0x44e00c00,\r
+       0x44e00c04,\r
+       0x44e00c08,\r
+       0x44e00c0c,\r
+       0x44e00d00,\r
+       0x44e00d04,\r
+       0x44e00d08,\r
+       0x44e00d0c,\r
+       0x44e00e00,\r
+       0x44e00e04,\r
+       0x44e00e08,\r
+       0x44e00f00,\r
+       0x44e00f04,\r
+       0x44e00f08,\r
+       0x44e00f0c,\r
+       0x44e00f10,\r
+       0x44e00f14,\r
+       0x44e00f18,\r
+       0x44e00f1c,\r
+       0x44e01000,\r
+       0x44e01004,\r
+       0x44e01100,\r
+       0x44e01104,\r
+       0x44e01110,\r
+       0x44e01114,\r
+       0x44e01200,\r
+       0x44e01204,\r
        0x44e10040];\r
 \r
-// Check if we're connected to the A8\r
-var debugTarget = activeDS.getName();\r
-var debugTargetA8 = false;\r
-if (debugTarget.indexOf('A8') >= 0) {\r
-       var debugTargetA8 = true;\r
-       print("Connected to Cortex A8");\r
-}\r
-\r
-// Check if MMU is enabled\r
-var mmuEnabled = false;\r
-if (debugTargetA8 == true) {\r
-       print("Getting MMU Status.");\r
-       mmuEnabled = activeDS.armAdvancedFeatures.options.getBoolean("MMUEnabled");\r
-}\r
+debugSessionDAP = ds.openSession("*","CS_DAP_M3");\r
+debugSessionDAP.target.connect();\r
 \r
 //Build a filename that includes date/time\r
 var today = new Date();\r
@@ -152,30 +250,16 @@ file.write("DeviceName AM335x1.0\n");
 // helper function to create 8-digit hex numbers in ascii format\r
 function d2h(d) {return ("00000000" + (+d).toString(16)).slice(-8);}\r
 \r
-// If connected to the Cortex A8 then make sure the MMU is off\r
-// so we can read physical addresses\r
-if (mmuEnabled == true) {\r
-       print("MMU was originally enabled.");\r
-       activeDS.armAdvancedFeatures.options.setBoolean("MMUEnabled",false);\r
-       print("MMU now disabled.");\r
-}\r
-\r
 // read CTT data from physical addresses\r
 for(i=0; i<ctt_registers.length; i++)\r
 {\r
-       value_array = readWord(ctt_registers[i],0,1,false);\r
-       value = d2h(value_array[0]);\r
-       file.write('0x' + ("0000" + ctt_registers[i].toString(16)).slice(-8) + " 0x" + value + "\n");\r
+       value = debugSessionDAP.memory.readWord(0,ctt_registers[i],false);\r
+       value_string = d2h(value);\r
+       file.write('0x' + ("0000" + ctt_registers[i].toString(16)).slice(-8) + " 0x" + value_string + "\n");\r
 }\r
 print("Data collection complete.");\r
 \r
-// Restore the status of the MMU\r
-if (mmuEnabled == true) {\r
-       activeDS.armAdvancedFeatures.options.setBoolean("MMUEnabled",true);\r
-       print("MMU now re-enabled.");\r
-}\r
-\r
-\r
 file.close();\r
+debugSessionDAP.target.disconnect();\r
 print("Created file " + filename);\r
 \r