forked from mit-pdos/xv6-riscv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned up SBI start process (a0 contains hart id), test and verify t…
…he bpif3 native uart rx, another pass on README documentation, add sbif3 single hart jtag config file, default make is now vf2 board but v0.31 release will have all board binaries precompiled.
- Loading branch information
ipacman
committed
Nov 24, 2024
1 parent
8c9332d
commit 3fffcca
Showing
9 changed files
with
206 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
set _SPEED 8000 | ||
# | ||
# FTDI MiniModule | ||
# | ||
# http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_FT2232H_Mini_Module.pdf | ||
# | ||
adapter speed 4000 | ||
adapter driver ftdi | ||
ftdi_device_desc "FT2232H-56Q MiniModule" | ||
ftdi_vid_pid 0x0403 0x6010 | ||
reset_config trst_only | ||
transport select jtag | ||
|
||
# Every pin set as high impedance except TCK, TDI, TDO and TMS | ||
ftdi_layout_init 0x0008 0x000b | ||
|
||
# nTRST defined on pin CN2-14 of the MiniModule (pin ADBUS5 [AD5] on the FT2232H chip) | ||
# This choice is arbitrary. Use other GPIO pin if desired. | ||
#ftdi_layout_signal nSRST -data 0x0020 -oe 0x0020 | ||
ftdi_layout_signal nTRST -data 0x0020 -oe 0x0020 | ||
|
||
set _CHIPNAME riscv | ||
|
||
jtag newtap pre unknown -irlen 1 -expected-id 0x00000000 -disable | ||
jtag configure pre.unknown -event tap-enable "" | ||
|
||
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x10000E21 -disable | ||
jtag configure $_CHIPNAME.cpu -event tap-enable "" | ||
|
||
jtag newtap post unknown -irlen 9 -expected-id 0x08501C0D | ||
|
||
set _TARGETNAME $_CHIPNAME.cpu | ||
|
||
# cluster 0 | ||
target create $_TARGETNAME.0 riscv -chain-position $_TARGETNAME -coreid 0 -rtos hwthread | ||
#target create $_TARGETNAME.1 riscv -chain-position $_TARGETNAME -coreid 1 | ||
#target create $_TARGETNAME.2 riscv -chain-position $_TARGETNAME -coreid 2 | ||
#target create $_TARGETNAME.3 riscv -chain-position $_TARGETNAME -coreid 3 | ||
|
||
# cluster 1 | ||
#target create $_TARGETNAME.4 riscv -chain-position $_TARGETNAME -coreid 0 -dbgbase 0x400 -rtos hwthread | ||
#target create $_TARGETNAME.5 riscv -chain-position $_TARGETNAME -coreid 1 -dbgbase 0x400 | ||
#target create $_TARGETNAME.6 riscv -chain-position $_TARGETNAME -coreid 2 -dbgbase 0x400 | ||
#target create $_TARGETNAME.7 riscv -chain-position $_TARGETNAME -coreid 3 -dbgbase 0x400 | ||
|
||
# cerate smp then we can use one gdb to debug all harts | ||
# harts on same smp will halt/resume together, if don't want it, just comment out all "target smp" lines, | ||
# then each hart needs one gdb to debug, means we need 8 gdb for 8 harts. | ||
#target smp $_TARGETNAME.0 $_TARGETNAME.1 $_TARGETNAME.2 $_TARGETNAME.3 $_TARGETNAME.4 $_TARGETNAME.5 $_TARGETNAME.6 $_TARGETNAME.7 | ||
|
||
$_TARGETNAME.0 configure -event examine-end { | ||
puts [ adapter speed ] | ||
puts [ scan_chain ] | ||
puts [ targets ] | ||
} | ||
|
||
proc default_mem_access {} { | ||
foreach t [target names] { | ||
# $t riscv set_mem_access sysbus progbuf | ||
$t riscv set_mem_access progbuf | ||
} | ||
} | ||
|
||
jtag configure post.unknown -event setup { | ||
global _CHIPNAME | ||
global _SPEED | ||
|
||
irscan post.unknown 0x98 | ||
drscan post.unknown 16 0xa | ||
|
||
jtag tapenable pre.unknown | ||
jtag tapenable $_CHIPNAME.cpu | ||
|
||
adapter speed $_SPEED | ||
} | ||
|
||
# TAP riscv.cpu is disabled, can't be the current target, use $t configure.. | ||
default_mem_access | ||
|
||
foreach t [target names] { | ||
# read in gdb: i r csr1498 | ||
$t riscv expose_csrs 1498-1499,1520-1521,1984-2003,2032-2039,3008-3023,3064-3071,4040-4041,4048-4051 | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.