Create AM57xx clock tree tool script
authorBrad Griffis <bgriffis@ti.com>
Wed, 26 Dec 2018 21:48:11 +0000 (15:48 -0600)
committerBrad Griffis <bgriffis@ti.com>
Wed, 26 Dec 2018 21:57:55 +0000 (15:57 -0600)
Used Sitara CTT 1.0.0.5 for outputting a valid rd1 file to
determine which addresses need to be read for which devices.

Initial testing was performed on AM572x IDK.  Code is structured
to work across all AM57xx variants but will test other flavors
in the future.

am57xx-ctt.dss [new file with mode: 0755]

diff --git a/am57xx-ctt.dss b/am57xx-ctt.dss
new file mode 100755 (executable)
index 0000000..e6aba6e
--- /dev/null
@@ -0,0 +1,1000 @@
+/*
+ * Copyright (c) 2018, 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 ctt_registers_am570x= [
+       0x4a005560,
+       0x4ae06118,
+       0x4a008920,
+       0x4ae06190,
+       0x4a0052e4,
+       0x4ae061c8,
+       0x4ae06174,
+       0x4a009848,
+       0x4ae07888,
+       0x4a005228,
+       0x4a002360,
+       0x4a0051ec,
+       0x4a009770,
+       0x4a009908,
+       0x4a005254,
+       0x4a009858,
+       0x4a00521c,
+       0x4ae061bc,
+       0x4a009750,
+       0x4a009780,
+       0x4a0097a8,
+       0x4a008778,
+       0x4a009328,
+       0x4a005234,
+       0x4a005244,
+       0x4a0052b8,
+       0x4a005130,
+       0x4a005154,
+       0x4a0098e8,
+       0x4a008e40,
+       0x4a005550,
+       0x4a0093e8,
+       0x4ae07830,
+       0x4a00516c,
+       0x4a009620,
+       0x4a005520,
+       0x4a005580,
+       0x4a008210,
+       0x4a008e28,
+       0x4ae061a0,
+       0x4a009738,
+       0x4a005248,
+       0x4a009800,
+       0x4a0052c8,
+       0x4a0052d8,
+       0x4a005140,
+       0x4a0052e8,
+       0x4a0098a8,
+       0x4a009798,
+       0x4a0051e0,
+       0x4ae06108,
+       0x4a0051f0,
+       0x4ae07840,
+       0x4ae06170,
+       0x4a0097d8,
+       0x4a005210,
+       0x4a0098f0,
+       0x4ae07838,
+       0x4a005220,
+       0x4a009868,
+       0x4a008158,
+       0x4a00519c,
+       0x4a0086a0,
+       0x4ae06138,
+       0x4ae061c4,
+       0x4a0051f4,
+       0x4ae06114,
+       0x4a008e50,
+       0x4a009760,
+       0x4a009720,
+       0x4ae061d0,
+       0x4a009878,
+       0x4a00814c,
+       0x4a008200,
+       0x4a005160,
+       0x4a0093b0,
+       0x4a005170,
+       0x4ae061d8,
+       0x4a009120,
+       0x4a008b30,
+       0x4a0052c0,
+       0x4a0051ac,
+       0x4ae061a8,
+       0x4a00815c,
+       0x4a005568,
+       0x4a0093d0,
+       0x4a009820,
+       0x4a009220,
+       0x4a002534,
+       0x4a009020,
+       0x4a0098d0,
+       0x4a0093e0,
+       0x4a009130,
+       0x4a009850,
+       0x4a005158,
+       0x4a005764,
+       0x4a009788,
+       0x4a008160,
+       0x4ae07878,
+       0x4a009890,
+       0x4a009870,
+       0x4a0097f0,
+       0x4ae06194,
+       0x4a009340,
+       0x4a009028,
+       0x4a0097c4,
+       0x4a009810,
+       0x4a0097b0,
+       0x4a0051dc,
+       0x4a008780,
+       0x4a005144,
+       0x4a008164,
+       0x4a008140,
+       0x4a0097c8,
+       0x4a008150,
+       0x4ae0610c,
+       0x4a0098c8,
+       0x4ae06198,
+       0x4ae06168,
+       0x4ae06184,
+       0x4ae06148,
+       0x4a0051a0,
+       0x4a0051b0,
+       0x4ae0619c,
+       0x4a009740,
+       0x4a00821c,
+       0x4a009808,
+       0x4a009728,
+       0x4ae061cc,
+       0x4a005558,
+       0x4ae0612c,
+       0x4ae06178,
+       0x4a009830,
+       0x4a00818c,
+       0x4a00820c,
+       0x4a008f28,
+       0x4a002544,
+       0x4a009898,
+       0x4ae06124,
+       0x4ae061b0,
+       0x4a009840,
+       0x4a009768,
+       0x4a009904,
+       0x4a00515c,
+       0x4ae061b8,
+       0x4a0052bc,
+       0x4ae061b4,
+       0x4a009778,
+       0x4a005570,
+       0x4a0097a0,
+       0x4ae06110,
+       0x4a009828,
+       0x4ae06164,
+       0x4a008b40,
+       0x4ae06160,
+       0x4ae0615c,
+       0x4ae06158,
+       0x4a0098e0,
+       0x4a009330,
+       0x4ae0614c,
+       0x4a005420,
+       0x4a0093f0,
+       0x4a008180,
+       0x4a0052b4,
+       0x4a008190,
+       0x4a00512c,
+       0x4a005100,
+       0x4a0097f8,
+       0x4a008f20,
+       0x4ae0618c,
+       0x4a0098a0,
+       0x4a0098c0,
+       0x4a009790,
+       0x4a009838,
+       0x4a009818,
+       0x4a0097b8,
+       0x4a008728,
+       0x4a0097d0,
+       0x4a008e20,
+       0x4a0098f8,
+       0x4ae07880,
+       0x4a009860,
+       0x4ae061ac,
+       0x4a0098b0,
+       0x4a0052c4,
+       0x4a00513c,
+       0x4ae06120,
+       0x4a009748,
+       0x4ae06144,
+       0x4a005578,
+       0x4a005240,
+       0x4a009718,
+       0x4a009730,
+       0x4a0052a8,
+       0x4a005120,
+       0x4a0086b0,
+       0x4ae06188,
+       0x4ae061a4,
+       0x4ae06128
+];
+
+var ctt_registers_am571x = [
+       0x4a005560,
+       0x4ae06118,
+       0x4a008920,
+       0x4ae06190,
+       0x4a0052e4,
+       0x4ae061c8,
+       0x4ae06174,
+       0x4a009848,
+       0x4ae07888,
+       0x4a005228,
+       0x4a002360,
+       0x4a0051ec,
+       0x4a009770,
+       0x4a009908,
+       0x4ae07a04,
+       0x4a005254,
+       0x4a009858,
+       0x4a00521c,
+       0x4ae061bc,
+       0x4a009750,
+       0x4a009780,
+       0x4a0097a8,
+       0x4a008778,
+       0x4a009328,
+       0x4a005234,
+       0x4a005244,
+       0x4a0052b8,
+       0x4a009388,
+       0x4a005130,
+       0x4a005154,
+       0x4a0098e8,
+       0x4a008e40,
+       0x4a005550,
+       0x4a0093e8,
+       0x4ae07830,
+       0x4a00516c,
+       0x4a009620,
+       0x4a005520,
+       0x4a005580,
+       0x4a008210,
+       0x4a008e28,
+       0x4ae061a0,
+       0x4a009738,
+       0x4a005248,
+       0x4a009800,
+       0x4a0052c8,
+       0x4a0052d8,
+       0x4a005140,
+       0x4a0052e8,
+       0x4a0098a8,
+       0x4a009798,
+       0x4ae061c0,
+       0x4a0051e0,
+       0x4ae06108,
+       0x4a0051f0,
+       0x4ae07840,
+       0x4ae06170,
+       0x4a0097d8,
+       0x4a005210,
+       0x4a0098f0,
+       0x4ae07838,
+       0x4a005220,
+       0x4a009868,
+       0x4a008158,
+       0x4a00519c,
+       0x4a0086a0,
+       0x4ae06138,
+       0x4ae061c4,
+       0x4a0051f4,
+       0x4ae06114,
+       0x4a008e50,
+       0x4a009760,
+       0x4a009720,
+       0x4ae061d0,
+       0x4a009878,
+       0x4a00814c,
+       0x4a008200,
+       0x4a005160,
+       0x4a0093b0,
+       0x4a005170,
+       0x4ae061d8,
+       0x4a009120,
+       0x4a008b30,
+       0x4a0052c0,
+       0x4a0051ac,
+       0x4ae061a8,
+       0x4a00815c,
+       0x4a005568,
+       0x4a0093d0,
+       0x4a009820,
+       0x4a009220,
+       0x4a002534,
+       0x4a009020,
+       0x4a0098d0,
+       0x4a0093e0,
+       0x4a009130,
+       0x4a009850,
+       0x4a005158,
+       0x4a005764,
+       0x4a009788,
+       0x4a008160,
+       0x4ae07878,
+       0x4a005744,
+       0x4a009890,
+       0x4a009870,
+       0x4a0097f0,
+       0x4ae06194,
+       0x4a009340,
+       0x4a009028,
+       0x4a0097c4,
+       0x4a009810,
+       0x4a0097b0,
+       0x4a0051dc,
+       0x4a008780,
+       0x4a005144,
+       0x4a008164,
+       0x4a008140,
+       0x4a0097c8,
+       0x4a008150,
+       0x4ae0610c,
+       0x4a0098c8,
+       0x4ae06198,
+       0x4ae06168,
+       0x4ae06184,
+       0x4ae06148,
+       0x4a0051a0,
+       0x4a0051b0,
+       0x4ae0619c,
+       0x4a009740,
+       0x4a00821c,
+       0x4a009808,
+       0x4a009728,
+       0x4ae061cc,
+       0x4a005558,
+       0x4ae0612c,
+       0x4ae06178,
+       0x4a009830,
+       0x4a00818c,
+       0x4a00820c,
+       0x4a008f28,
+       0x4a002544,
+       0x4a009898,
+       0x4ae06124,
+       0x4ae061b0,
+       0x4a009840,
+       0x4a009768,
+       0x4a009904,
+       0x4a00515c,
+       0x4ae061b8,
+       0x4a0052bc,
+       0x4a0093b8,
+       0x4ae061b4,
+       0x4a009778,
+       0x4a005570,
+       0x4a0097a0,
+       0x4ae06110,
+       0x4a009828,
+       0x4ae06164,
+       0x4a008b40,
+       0x4ae06160,
+       0x4ae0615c,
+       0x4ae06158,
+       0x4a0098e0,
+       0x4a009330,
+       0x4ae0614c,
+       0x4a005420,
+       0x4a0093f0,
+       0x4a008180,
+       0x4a0052b4,
+       0x4a008190,
+       0x4a00512c,
+       0x4a005100,
+       0x4a0097f8,
+       0x4a008f20,
+       0x4ae0618c,
+       0x4a0098a0,
+       0x4a0098c0,
+       0x4a009790,
+       0x4a009838,
+       0x4a009818,
+       0x4a0097b8,
+       0x4a008728,
+       0x4a0097d0,
+       0x4a008e20,
+       0x4a0098f8,
+       0x4ae07880,
+       0x4a009860,
+       0x4ae061ac,
+       0x4a0098b0,
+       0x4a0052c4,
+       0x4a00513c,
+       0x4ae06120,
+       0x4a009748,
+       0x4ae06144,
+       0x4a005578,
+       0x4a005240,
+       0x4a009718,
+       0x4a009730,
+       0x4a0052a8,
+       0x4a005120,
+       0x4a0086b0,
+       0x4ae06188,
+       0x4ae061a4,
+       0x4ae06128
+];
+
+var ctt_registers_am572x = [
+       0x4a005560,
+       0x4ae06118,
+       0x4a008920,
+       0x4ae06190,
+       0x4a0052e4,
+       0x4ae061c8,
+       0x4ae06174,
+       0x4a009848,
+       0x4ae07888,
+       0x4a005228,
+       0x4a002360,
+       0x4a0051ec,
+       0x4a009770,
+       0x4a009908,
+       0x4ae07a04,
+       0x4a005254,
+       0x4ae06154,
+       0x4a009858,
+       0x4a00521c,
+       0x4ae061bc,
+       0x4a009750,
+       0x4a009780,
+       0x4a0097a8,
+       0x4a008778,
+       0x4a009328,
+       0x4a005234,
+       0x4a005244,
+       0x4a0052b8,
+       0x4a009388,
+       0x4a005130,
+       0x4a005154,
+       0x4a0098e8,
+       0x4a008e40,
+       0x4a005550,
+       0x4a0093e8,
+       0x4ae07830,
+       0x4a00516c,
+       0x4a009620,
+       0x4a005520,
+       0x4a005580,
+       0x4a008210,
+       0x4a008e28,
+       0x4ae061a0,
+       0x4a009738,
+       0x4a005248,
+       0x4a009800,
+       0x4a0052c8,
+       0x4a0052d8,
+       0x4a005140,
+       0x4a0052e8,
+       0x4a0098a8,
+       0x4a005720,
+       0x4ae06180,
+       0x4a009798,
+       0x4ae061c0,
+       0x4a0051e0,
+       0x4ae06108,
+       0x4a0051f0,
+       0x4ae07840,
+       0x4ae06170,
+       0x4a009200,
+       0x4a0097d8,
+       0x4a005210,
+       0x4a0098f0,
+       0x4ae07838,
+       0x4a005220,
+       0x4a009868,
+       0x4a008158,
+       0x4a00519c,
+       0x4a0086a0,
+       0x4ae061d4,
+       0x4ae06138,
+       0x4ae061c4,
+       0x4a0051f4,
+       0x4ae06114,
+       0x4a008e50,
+       0x4a009760,
+       0x4a009720,
+       0x4ae061d0,
+       0x4a009878,
+       0x4a00814c,
+       0x4a008200,
+       0x4a005160,
+       0x4a0093b0,
+       0x4a005170,
+       0x4ae061d8,
+       0x4a009120,
+       0x4a008b30,
+       0x4a0052c0,
+       0x4a0051ac,
+       0x4ae061a8,
+       0x4a00815c,
+       0x4a005568,
+       0x4a0093d0,
+       0x4a009820,
+       0x4a009220,
+       0x4a002534,
+       0x4a009020,
+       0x4a0098d0,
+       0x4a0056e0,
+       0x4a0093e0,
+       0x4a009130,
+       0x4a009850,
+       0x4a005158,
+       0x4a005764,
+       0x4a009788,
+       0x4a008160,
+       0x4ae07878,
+       0x4a009030,
+       0x4a009890,
+       0x4a009870,
+       0x4a0097f0,
+       0x4ae06194,
+       0x4a009340,
+       0x4a0097c4,
+       0x4a009810,
+       0x4a0097b0,
+       0x4a0051dc,
+       0x4a008780,
+       0x4a005144,
+       0x4a008164,
+       0x4a008140,
+       0x4a0097c8,
+       0x4a008150,
+       0x4ae0610c,
+       0x4a0098c8,
+       0x4ae06198,
+       0x4ae06168,
+       0x4ae06184,
+       0x4ae06148,
+       0x4a0051a0,
+       0x4a0051b0,
+       0x4ae0619c,
+       0x4a0056a0,
+       0x4a009740,
+       0x4a00821c,
+       0x4a009808,
+       0x4a009728,
+       0x4a005290,
+       0x4ae061cc,
+       0x4a005558,
+       0x4ae0612c,
+       0x4ae06178,
+       0x4a005620,
+       0x4a009830,
+       0x4a00818c,
+       0x4a00820c,
+       0x4a008f28,
+       0x4a002544,
+       0x4a009898,
+       0x4ae061b0,
+       0x4a009840,
+       0x4a009768,
+       0x4a009904,
+       0x4a00515c,
+       0x4ae061b8,
+       0x4a0052bc,
+       0x4a0093b8,
+       0x4a008b38,
+       0x4ae061b4,
+       0x4a009778,
+       0x4a005570,
+       0x4a0097a0,
+       0x4a0052a4,
+       0x4a005660,
+       0x4ae06110,
+       0x4a009828,
+       0x4ae06164,
+       0x4a008b40,
+       0x4ae06160,
+       0x4ae0615c,
+       0x4ae06158,
+       0x4a009028,
+       0x4a0098e0,
+       0x4a005284,
+       0x4a005294,
+       0x4a009330,
+       0x4ae0614c,
+       0x4a005420,
+       0x4a0093f0,
+       0x4ae06150,
+       0x4a008180,
+       0x4a0052b4,
+       0x4a008190,
+       0x4a00512c,
+       0x4a005100,
+       0x4a0097f8,
+       0x4a008f20,
+       0x4ae0618c,
+       0x4a0098a0,
+       0x4ae061e0,
+       0x4a0098c0,
+       0x4a009790,
+       0x4a009838,
+       0x4a009818,
+       0x4a0097b8,
+       0x4a008728,
+       0x4a0097d0,
+       0x4a008e20,
+       0x4a0098f8,
+       0x4ae07880,
+       0x4ae0616c,
+       0x4a009860,
+       0x4ae061ac,
+       0x4a0098b0,
+       0x4a0052c4,
+       0x4a00513c,
+       0x4ae06120,
+       0x4a009748,
+       0x4ae06144,
+       0x4a005578,
+       0x4a005240,
+       0x4a009718,
+       0x4a009730,
+       0x4a0052a8,
+       0x4a005120,
+       0x4a0086b0,
+       0x4ae06188,
+       0x4ae061a4,
+       0x4ae06128
+];
+
+var ctt_registers_am574x = [
+       0x4a005560,
+       0x4ae06118,
+       0x4a008920,
+       0x4ae06190,
+       0x4a0052e4,
+       0x4ae061c8,
+       0x4ae06174,
+       0x4a009848,
+       0x4ae07888,
+       0x4a005228,
+       0x4a002360,
+       0x4a0051ec,
+       0x4a009770,
+       0x4a009908,
+       0x4ae07a04,
+       0x4a005254,
+       0x4ae06154,
+       0x4a009858,
+       0x4a00521c,
+       0x4ae061bc,
+       0x4a009750,
+       0x4a009780,
+       0x4a0097a8,
+       0x4a008778,
+       0x4a009328,
+       0x4a005234,
+       0x4a005244,
+       0x4a0052b8,
+       0x4a009388,
+       0x4a005130,
+       0x4a005154,
+       0x4a0098e8,
+       0x4a008e40,
+       0x4a005550,
+       0x4a0093e8,
+       0x4ae07830,
+       0x4a00516c,
+       0x4a009620,
+       0x4a005520,
+       0x4a005580,
+       0x4a008210,
+       0x4a008e28,
+       0x4ae061a0,
+       0x4a009738,
+       0x4a009800,
+       0x4a0052c8,
+       0x4a0052d8,
+       0x4a005140,
+       0x4a0052e8,
+       0x4a0098a8,
+       0x4ae06180,
+       0x4a009798,
+       0x4ae061c0,
+       0x4a0051e0,
+       0x4ae06108,
+       0x4a0051f0,
+       0x4ae07840,
+       0x4ae06170,
+       0x4a009200,
+       0x4a0097d8,
+       0x4a005210,
+       0x4a0098f0,
+       0x4ae07838,
+       0x4a005220,
+       0x4a009868,
+       0x4a008158,
+       0x4a00519c,
+       0x4a0086a0,
+       0x4ae061d4,
+       0x4ae06138,
+       0x4ae061c4,
+       0x4a0051f4,
+       0x4ae06114,
+       0x4a008e50,
+       0x4a009760,
+       0x4a009720,
+       0x4ae061d0,
+       0x4a009878,
+       0x4a00814c,
+       0x4a008200,
+       0x4a005160,
+       0x4a0093b0,
+       0x4a005170,
+       0x4ae061d8,
+       0x4a009120,
+       0x4a008b30,
+       0x4a0052c0,
+       0x4a0051ac,
+       0x4ae061a8,
+       0x4a00815c,
+       0x4a005568,
+       0x4a0093d0,
+       0x4a009820,
+       0x4a009220,
+       0x4a002534,
+       0x4a0023fc,
+       0x4a009020,
+       0x4a0098d0,
+       0x4a0093e0,
+       0x4a009130,
+       0x4a009850,
+       0x4a005158,
+       0x4a005764,
+       0x4a009788,
+       0x4a008160,
+       0x4ae07878,
+       0x4a009890,
+       0x4a009870,
+       0x4a0097f0,
+       0x4ae06194,
+       0x4a009340,
+       0x4a0097c4,
+       0x4a009810,
+       0x4a0097b0,
+       0x4a0051dc,
+       0x4a008780,
+       0x4a005144,
+       0x4a008164,
+       0x4a008140,
+       0x4a0097c8,
+       0x4a008150,
+       0x4ae0610c,
+       0x4a0098c8,
+       0x4ae06198,
+       0x4ae06168,
+       0x4ae06184,
+       0x4ae06148,
+       0x4a0051a0,
+       0x4a0051b0,
+       0x4ae0619c,
+       0x4a0056a0,
+       0x4a009740,
+       0x4a00821c,
+       0x4a009808,
+       0x4a009728,
+       0x4ae061cc,
+       0x4a005558,
+       0x4ae0612c,
+       0x4ae06178,
+       0x4a005620,
+       0x4a009830,
+       0x4a00818c,
+       0x4a00820c,
+       0x4a008f28,
+       0x4a002544,
+       0x4a009898,
+       0x4ae061b0,
+       0x4a009840,
+       0x4a009768,
+       0x4a009904,
+       0x4a00515c,
+       0x4ae061b8,
+       0x4a0052bc,
+       0x4a0093b8,
+       0x4a008b38,
+       0x4ae061b4,
+       0x4a009778,
+       0x4a005570,
+       0x4a0097a0,
+       0x4a005660,
+       0x4ae06110,
+       0x4a009828,
+       0x4ae06164,
+       0x4a008b40,
+       0x4ae06160,
+       0x4ae0615c,
+       0x4ae06158,
+       0x4a009028,
+       0x4a0098e0,
+       0x4a009330,
+       0x4ae078a0,
+       0x4ae0614c,
+       0x4a005420,
+       0x4a0093f0,
+       0x4ae06150,
+       0x4a008180,
+       0x4a0052b4,
+       0x4a008190,
+       0x4a00512c,
+       0x4a005100,
+       0x4a0097f8,
+       0x4a008f20,
+       0x4ae0618c,
+       0x4a0098a0,
+       0x4a0098c0,
+       0x4a009790,
+       0x4a009838,
+       0x4a009818,
+       0x4a0097b8,
+       0x4a008728,
+       0x4a0097d0,
+       0x4a008e20,
+       0x4a0098f8,
+       0x4ae07880,
+       0x4ae0616c,
+       0x4a009860,
+       0x4ae061ac,
+       0x4a0098b0,
+       0x4a0052c4,
+       0x4a00513c,
+       0x4ae06120,
+       0x4a009748,
+       0x4ae06144,
+       0x4a005578,
+       0x4a005240,
+       0x4a009718,
+       0x4a009730,
+       0x4a0052a8,
+       0x4a005120,
+       0x4a0086b0,
+       0x4ae06188,
+       0x4ae061a4,
+       0x4ae06128
+];
+
+debugSessionDAP = ds.openSession("*","CS_DAP_DebugSS");
+debugSessionDAP.target.connect();
+
+/* Check ID_CODE register (address 0x4AE0C204) to determine which 
+   AM57xx variant is being used */
+try {
+       id_code = debugSessionDAP.memory.readWord(0,0x4AE0C204,false);
+} catch(ex) {
+       print("\n Trouble reading ID_CODE.\n");
+}
+
+print("ID_CODE = 0x" + d2h(id_code));
+
+// Check STD_FUSE_ID_2 register (address 0x4AE0C20C) for package type
+try {
+       fuse_id_2 = debugSessionDAP.memory.readWord(0,0x4AE0C20C,false);
+} catch(ex) {
+       print("\n Trouble reading STD_FUSE_ID_2.\n");
+}
+pkg_type = (fuse_id_2 & 0x00030000) >> 16;  // FUSE_ID_2[17:16] = pkg_type
+
+switch(id_code) {
+       case 0x0B9BC02F:
+               print("AM571x SR1.0 detected.\n");
+               device_type = 571;
+               break;
+       case 0x1B9BC02F:
+               if(pkg_type == 1) {
+                       print("AM570x SR2.0 detected.\n");
+                       device_type = 570;
+               } else if(pkg_type == 2) {
+                       print("AM571x SR2.0 detected.\n");
+                       device_type = 571;
+               } else
+                       print("AM571x/AM570x SR2.0 unrecognized package type\n")
+               break;
+       case 0x2B9BC02F:
+               if(pkg_type == 1) {
+                       print("AM570x SR2.1 detected.\n");
+                       device_type = 570;
+               } else if(pkg_type == 2) {
+                       print("AM571x SR2.1 detected.\n");
+                       device_type = 571;
+               } else
+                       print("AM571x/AM570x SR2.1 unrecognized package type\n")
+               break;
+       case 0x0B99002F:
+               print("AM572x SR1.0 detected.\n");
+               device_type = 572;
+               break;
+       case 0x1B99002F:
+               print("AM572x SR1.1 detected.\n");
+               device_type = 572;
+               break;
+       case 0x2B99002F:
+               print("AM572x SR2.0 detected.\n");
+               device_type = 572;
+               break;
+       case 0x0BB5002F:
+               print("AM574x SR1.0 detected.\n");
+               device_type = 574;
+               break;
+       default:
+               print("Unable to identify which AM57xx variant.\n");
+               debugSessionDAP.target.disconnect();
+               throw("Terminating script.\n")
+               break;
+}
+
+//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/' + 'am57xx-ctt' + filename_date + '.rd1';
+
+file = new java.io.FileWriter(filename);
+
+if (device_type == 570) {
+       file.write("DeviceName AM570x_SR2.1_SR2.0\n");
+       ctt_registers = ctt_registers_am570x;
+} else if (device_type == 571) {
+       file.write("DeviceName AM571x_SR2.0_SR1.0\n");
+       ctt_registers = ctt_registers_am571x;
+} else if (device_type == 572) {
+       file.write("DeviceName AM572x_SR2.0_SR1.1\n");
+       ctt_registers = ctt_registers_am572x;
+} else if (device_type == 574) {
+       file.write("DeviceName AM574x_SR1.0\n");
+       ctt_registers = ctt_registers_am574x;
+} else {
+       throw("Error -- code shouldn't get here.")
+}
+
+// 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<ctt_registers.length; i++)
+{
+       try {
+               value = debugSessionDAP.memory.readWord(0,ctt_registers[i],false);
+               value_string = d2h(value);
+               file.write('0x' + ("0000" + ctt_registers[i].toString(16)).slice(-8) + " 0x" + value_string + "\n");
+       } catch (ex) {
+               print("\n Trouble reading address 0x" + d2h(ctt_registers[i]) + ". Skipping register.\n");
+       }
+}
+print("Data collection complete.");
+
+file.close();
+debugSessionDAP.target.disconnect();
+print("Created file " + filename);
+