aboutsummaryrefslogtreecommitdiff
path: root/tcl/target/snps_hsdk_4xd.cfg
blob: 1520e3d7c977cc7e6bddcf6acbec72bd2fa245c2 (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
# SPDX-License-Identifier: GPL-2.0-or-later

# Copyright (C) 2023 Synopsys, Inc.
# Artemiy Volkov <artemiy@synopsys.com>

# Adapted from tcl/target/snps_hsdk.cfg.

#
# HS Development Kit SoC.
#
# Contains quad-core ARC HS47D.
#

source [find cpu/arc/hs.tcl]

set _coreid 0
set _dbgbase [expr {$_coreid << 13}]

# CHIPNAME will be used to choose core family (600, 700 or EM). As far as
# OpenOCD is concerned EM and HS are identical.
set _CHIPNAME arc-em


proc setup_cpu {core_index expected_id} {
	global _coreid
	global _dbgbase
	global _CHIPNAME

	set _TARGETNAME $_CHIPNAME.cpu$core_index
	jtag newtap $_CHIPNAME cpu$core_index -irlen 4 -ircapture 0x1 -expected-id $expected_id

	target create $_TARGETNAME arcv2 -chain-position $_TARGETNAME
	$_TARGETNAME configure -coreid $_coreid
	$_TARGETNAME configure -dbgbase $_dbgbase
	$_TARGETNAME configure -event reset-assert "arc_hs_reset $_TARGETNAME"

	arc_hs_init_regs

	$_TARGETNAME arc cache l2 auto 1

	set _coreid [expr {$_coreid + 1}]
	set _dbgbase [expr {$_coreid << 13}]
}

# OpenOCD discovers JTAG TAPs in reverse order.

setup_cpu 4 0x100c54b1
setup_cpu 3 0x100854b1
setup_cpu 2 0x100454b1
setup_cpu 1 0x100054b1