1
0
mirror of https://git.code.sf.net/p/openocd/code synced 2024-11-24 19:56:23 +00:00
openocd/tcl/interface/raspberrypi5-gpiod.cfg
Tomas Vanek ac63cd00d7 tcl/interface/raspberrypi5-gpiod: fix string match pattern escaping
Use correct TCL syntax and save string map operation.

Change-Id: Ic2a522bd57cf6610b7df1d9cddd0fbdc2076ed62
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8426
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-16 04:45:11 +00:00

29 lines
919 B
INI

# 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]
if {![string match {*\[performance\]*} $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]