blob: e88b9b41cbbd57f6dab7e43e2e770538be4229b4 (
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
|
adapter speed 10000
adapter driver ftdi
ftdi device_desc "Dual RS232-HS"
ftdi vid_pid 0x0403 0x6010
ftdi layout_init 0x0008 0x001b
ftdi layout_signal nSRST -oe 0x0020
set _CHIPNAME riscv
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x20000913
set _TARGETNAME_0 $_CHIPNAME.cpu0
set _TARGETNAME_1 $_CHIPNAME.cpu1
set _TARGETNAME_2 $_CHIPNAME.cpu2
set _TARGETNAME_3 $_CHIPNAME.cpu3
set _TARGETNAME_4 $_CHIPNAME.cpu4
target create $_TARGETNAME_0 riscv -chain-position $_CHIPNAME.cpu -rtos hwthread
target create $_TARGETNAME_1 riscv -chain-position $_CHIPNAME.cpu -coreid 1
target create $_TARGETNAME_2 riscv -chain-position $_CHIPNAME.cpu -coreid 2
target create $_TARGETNAME_3 riscv -chain-position $_CHIPNAME.cpu -coreid 3
target create $_TARGETNAME_4 riscv -chain-position $_CHIPNAME.cpu -coreid 4
target smp $_TARGETNAME_0 $_TARGETNAME_1 $_TARGETNAME_2 $_TARGETNAME_3 $_TARGETNAME_4
#set _TARGETNAME_0 $_CHIPNAME.cpu
#target create $_TARGETNAME_0 riscv -chain-position $_TARGETNAME_0 -rtos riscv
$_TARGETNAME_0 configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1
gdb_report_data_abort enable
gdb_report_register_access_error enable
# Expose an unimplemented CSR so we can test non-existent register access
# behavior.
riscv expose_csrs 2288
flash bank onboard_spi_flash fespi 0x20000000 0 0 0 $_TARGETNAME_0 0x10040000
init
# Clear reset on these events, because that messes with memory which we don't
# want in these tests. We want gdb be able to "download" to flash as well as
# RAM, and then simply execute the program.
# This must happen after init, where blank events get overwritten with reset.
set targets [target names]
foreach t $targets {
$t configure -event gdb-flash-erase-start ""
$t configure -event gdb-flash-write-end ""
}
reset halt
# Use a modified bootloader to configure the hardware, especially the DDR controller.
load_image targets/SiFive/HiFiveUnleashed_setup.bin 0x08000000
foreach t [target names] {
targets $t
reg pc 0x08000000
arm semihosting enable
}
resume
wait_halt
# Uncomment this if you want to be able to clobber your SPI Flash, which
# probably you don't since you can do it through Linux
#flash protect 0 0 last off
|