]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - sitara-dss-files/am43xx-dss-files.git/commitdiff
Add script for scraping all padconf registers
authorBrad Griffis <bgriffis@ti.com>
Tue, 8 Jan 2019 22:27:12 +0000 (16:27 -0600)
committerBrad Griffis <bgriffis@ti.com>
Tue, 8 Jan 2019 22:27:12 +0000 (16:27 -0600)
am43xx-padconf.dss [new file with mode: 0755]

diff --git a/am43xx-padconf.dss b/am43xx-padconf.dss
new file mode 100755 (executable)
index 0000000..074c28f
--- /dev/null
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2017, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+var padconf_registers = [
+       0x44E10800,
+       0x44E10804,
+       0x44E10808,
+       0x44E1080C,
+       0x44E10810,
+       0x44E10814,
+       0x44E10818,
+       0x44E1081C,
+       0x44E10820,
+       0x44E10824,
+       0x44E10828,
+       0x44E1082C,
+       0x44E10830,
+       0x44E10834,
+       0x44E10838,
+       0x44E1083C,
+       0x44E10840,
+       0x44E10844,
+       0x44E10848,
+       0x44E1084C,
+       0x44E10850,
+       0x44E10854,
+       0x44E10858,
+       0x44E1085C,
+       0x44E10860,
+       0x44E10864,
+       0x44E10868,
+       0x44E1086C,
+       0x44E10870,
+       0x44E10874,
+       0x44E10878,
+       0x44E1087C,
+       0x44E10880,
+       0x44E10884,
+       0x44E10888,
+       0x44E1088C,
+       0x44E10890,
+       0x44E10894,
+       0x44E10898,
+       0x44E1089C,
+       0x44E108A0,
+       0x44E108A4,
+       0x44E108A8,
+       0x44E108AC,
+       0x44E108B0,
+       0x44E108B4,
+       0x44E108B8,
+       0x44E108BC,
+       0x44E108C0,
+       0x44E108C4,
+       0x44E108C8,
+       0x44E108CC,
+       0x44E108D0,
+       0x44E108D4,
+       0x44E108D8,
+       0x44E108DC,
+       0x44E108E0,
+       0x44E108E4,
+       0x44E108E8,
+       0x44E108EC,
+       0x44E108F0,
+       0x44E108F4,
+       0x44E108F8,
+       0x44E108FC,
+       0x44E10900,
+       0x44E10904,
+       0x44E10908,
+       0x44E1090C,
+       0x44E10910,
+       0x44E10914,
+       0x44E10918,
+       0x44E1091C,
+       0x44E10920,
+       0x44E10924,
+       0x44E10928,
+       0x44E1092C,
+       0x44E10930,
+       0x44E10934,
+       0x44E10938,
+       0x44E1093C,
+       0x44E10940,
+       0x44E10944,
+       0x44E10948,
+       0x44E1094C,
+       0x44E10950,
+       0x44E10954,
+       0x44E10958,
+       0x44E1095C,
+       0x44E10960,
+       0x44E10964,
+       0x44E10968,
+       0x44E1096C,
+       0x44E10970,
+       0x44E10974,
+       0x44E10978,
+       0x44E1097C,
+       0x44E10980,
+       0x44E10984,
+       0x44E10988,
+       0x44E1098C,
+       0x44E10990,
+       0x44E10994,
+       0x44E10998,
+       0x44E1099C,
+       0x44E109A0,
+       0x44E109A4,
+       0x44E109A8,
+       0x44E109AC,
+       0x44E109B0,
+       0x44E109B4,
+       0x44E109B8,
+       0x44E109BC,
+       0x44E109C0,
+       0x44E109C4,
+       0x44E109C8,
+       0x44E109CC,
+       0x44E109D0,
+       0x44E109D4,
+       0x44E109D8,
+       0x44E109DC,
+       0x44E109E0,
+       0x44E109E4,
+       0x44E109E8,
+       0x44E109EC,
+       0x44E109F0,
+       0x44E109F4,
+       0x44E109F8,
+       0x44E109FC,
+       0x44E10A00,
+       0x44E10A04,
+       0x44E10A08,
+       0x44E10A0C,
+       0x44E10A10,
+       0x44E10A14,
+       0x44E10A18,
+       0x44E10A1C,
+       0x44E10A20,
+       0x44E10A24,
+       0x44E10A28,
+       0x44E10A2C,
+       0x44E10A30,
+       0x44E10A34,
+       0x44E10A38,
+       0x44E10A3C,
+       0x44E10A40,
+       0x44E10A44,
+       0x44E10A48,
+       0x44E10A4C,
+       0x44E10A50,
+       0x44E10A54,
+       0x44E10A58,
+       0x44E10A5C,
+       0x44E10A60,
+       0x44E10A64,
+       0x44E10A68,
+       0x44E10A6C,
+       0x44E10A70,
+       0x44E10A74,
+       0x44E10A78,
+       0x44E10A7C,
+       0x44E10A84,
+       0x44E10A90,
+       0x44E10A94,
+       0x44E10A98,
+       0x44E10A9C,
+       0x44E10AA0,
+       0x44E10AA4,
+       0x44E10AA8,
+       0x44E10AAC,
+       0x44E10AB0,
+       0x44E10AB4,
+       0x44E10AB8,
+       0x44E10ABC,
+       0x44E10AC0,
+       0x44E10AC4
+];
+
+debugSessionDAP = ds.openSession("*","CS_DAP_M3");
+debugSessionDAP.target.connect();
+
+// Check connection by reading a location known to be non-zero (PRCM_CM_WKUP_DBGSS_CLKCTRL)
+value = debugSessionDAP.memory.readWord(0,0x44df2820,false);
+if (value == 0) {
+       // Use DebugSS instead
+       debugSessionDAP.target.disconnect();
+       debugSessionDAP = ds.openSession("*","CS_DAP_DebugSS");
+       debugSessionDAP.target.connect();
+       value = debugSessionDAP.memory.readWord(0,0x44df2820,false);
+       if (value == 0) {
+               print("ERROR: Trouble reading sane values from memory.");
+               print("PRCM_CM_WKUP_DBGSS_CLKCTRL = 0x" + d2h(value));
+       }
+}
+
+
+//Build a filename that includes date/time
+var today = new Date();
+var year4digit = today.getFullYear();
+var month2digit = ("0" + (today.getMonth()+1)).slice(-2);
+var day2digit = ("0" + today.getDate()).slice(-2);
+var hour2digit = ("0" + today.getHours()).slice(-2);
+var minutes2digit = ("0" + today.getMinutes()).slice(-2);
+var seconds2digit = ("0" + today.getSeconds()).slice(-2);
+var filename_date = '_' + year4digit + '-' + month2digit + '-' + day2digit + '_' + hour2digit + minutes2digit + seconds2digit; 
+var userHomeFolder = System.getProperty("user.home");
+var filename = userHomeFolder + '/Desktop/' + 'am43xx-padconf' + filename_date + '.rd1';
+
+file = new java.io.FileWriter(filename);
+file.write("PadConf AM43xx_SR1.x\n");
+
+// helper function to create 8-digit hex numbers in ascii format
+function d2h(d) {return ("00000000" + (+d).toString(16)).slice(-8);}
+
+// read CTT data from physical addresses
+for(i=0; i<padconf_registers.length; i++)
+{
+       try {
+               value = debugSessionDAP.memory.readWord(0,padconf_registers[i],false);
+               value_string = d2h(value);
+               file.write('0x' + ("0000" + padconf_registers[i].toString(16)).slice(-8) + " 0x" + value_string + "\n");
+       } catch (ex) {
+               print("\n Trouble reading address 0x" + d2h(padconf_registers[i]) + ". Skipping register.\n");
+       }
+}
+print("Data collection complete.");
+
+file.close();
+debugSessionDAP.target.disconnect();
+print("Created file " + filename);
+