-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tcl/interface: support for Raspberry Pi 5
Make sure raspberrypi-native.cfg cannot be used on RPi5. Add raspberrypi5-gpiod.cfg which uses linuxgpiod adapter driver. Issue a warning if PCIe is in power save mode. While on it, re-format warnings issued from Tcl to look similar to LOG_WARNING() output. Change-Id: If19b0350bd5fff83d9a0c65999e33b161fb6957a Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8333 Tested-by: jenkins Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
- Loading branch information
Showing
3 changed files
with
51 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
# Config for Raspberry Pi 5 used as a bitbang adapter. | ||
# https://www.raspberrypi.com/documentation/computers/raspberry-pi.html | ||
|
||
# Raspberry Pi 5 is not compatible with bcm2835gpio native GPIO driver. | ||
# The linuxgpiod driver without configurable adapter speed runs at approximately | ||
# 800 kHz (SWD writes) and 360 kHz (SWD reads) | ||
|
||
adapter driver linuxgpiod | ||
|
||
proc read_file { name } { | ||
if {[catch {open $name r} fd]} { | ||
return "" | ||
} | ||
set result [read $fd] | ||
close $fd | ||
return $result | ||
} | ||
|
||
set pcie_aspm [read_file /sys/module/pcie_aspm/parameters/policy] | ||
# escaping [ ] characters in string match pattern does not work in Jim-Tcl | ||
if {![string match "*<performance>*" [string map { "\[" < "\]" > } $pcie_aspm]]} { | ||
echo "Warn : Switch PCIe power saving off or the first couple of pulses gets clocked as fast as 20 MHz" | ||
echo "Warn : Issue 'echo performance | sudo tee /sys/module/pcie_aspm/parameters/policy'" | ||
} | ||
|
||
set GPIO_CHIP 4 | ||
source [find interface/raspberrypi-gpio-connector.cfg] |