aboutsummaryrefslogtreecommitdiff
path: root/tcl/board/ampere_qs_mq_1s.cfg
blob: bc649edb8f24354eb0be586fb373b6ff430f8b0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# SPDX-License-Identifier: GPL-2.0-or-later
#
# OpenOCD Board Configuration for Ampere Altra ("Quicksilver") and
# Ampere Altra Max ("Mystique") processors
#
# Copyright (c) 2019-2021, Ampere Computing LLC

# Argument Description
#
# JTAGFREQ
# Set the JTAG clock frequency
# Syntax: -c "set JTAGFREQ {freq_in_khz}"
#
# SYSNAME
# Set the system name
# If not specified, defaults to "qs"
# Syntax: -c "set SYSNAME {qs}"
#
# Life-Cycle State (LCS)
# If not specified, defaults to "Secure LCS"
# LCS=0, "Secure LCS"
# LCS=1, "Chip Manufacturing LCS"
# Syntax: -c "set LCS {0}"
# Syntax: -c "set LCS {1}"
#
# CORELIST_S0
# Specify available physical cores by number
# Example syntax to connect to physical cores 16 and 17 for S0
# Syntax: -c "set CORELIST_S0 {16 17}"
#
# COREMASK_S0_LO
# Specify available physical cores 0-63 by mask
# Example syntax to connect to physical cores 16 and 17 for S0
# Syntax: -c "set COREMASK_S0_LO {0x0000000000030000}"
#
# COREMASK_S0_HI
# Specify available physical cores 64 and above by mask
# Example syntax to connect to physical cores 94 and 95 for S0
# Syntax: -c "set COREMASK_S0_HI {0x00000000C0000000}"
#
# PHYS_IDX
# Enable OpenOCD ARMv8 core target physical indexing
# If not specified, defaults to OpenOCD ARMv8 core target logical indexing
# Syntax: -c "set PHYS_IDX {}"

#
# Configure JTAG speed
#

if { [info exists JTAGFREQ] } {
	adapter speed $JTAGFREQ
} else {
	adapter speed 100
}

#
# Set the system name
#

if { [info exists SYSNAME] } {
	set _SYSNAME $SYSNAME
} else {
	set _SYSNAME qs
}

#
# Configure Resets
#

jtag_ntrst_delay 100
reset_config trst_only

#
# Configure Targets
#

if { [info exists CORELIST_S0] || [info exists COREMASK_S0_LO] || [info exists COREMASK_S0_HI] } {
	set CHIPNAME ${_SYSNAME}0
	if { [info exists CORELIST_S0] } {
		set CORELIST $CORELIST_S0
	} else {
		if { [info exists COREMASK_S0_LO] } {
			set COREMASK_LO $COREMASK_S0_LO
		} else {
			set COREMASK_LO 0x0
		}

		if { [info exists COREMASK_S0_HI] } {
			set COREMASK_HI $COREMASK_S0_HI
		} else {
			set COREMASK_HI 0x0
		}
	}
} else {
	set CHIPNAME ${_SYSNAME}0
	set COREMASK_LO 0x1
	set COREMASK_HI 0x0
}

source [find target/ampere_qs_mq.cfg]