From: openocd-gerrit <ope...@us...> - 2024-12-29 07:28:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 5284a5f3eca63099fc0f3e19e69d1c55a99b214b (commit) from 15d90dd21cfc480714fbefa238998e6b00b9c4b1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5284a5f3eca63099fc0f3e19e69d1c55a99b214b Author: Tomas Vanek <va...@fb...> Date: Fri Oct 25 17:17:22 2024 +0200 tcl/interface: Find proper alias for RP1 on Raspberry Pi 5 Previously, Linux assigned gpiochip numbers sequentially depending on when the chip driver was probed. As RP1 is on the end of a PCIe link, it is probed later than the on-board chips (including expanders connected over SPI/I2C). This meant that RP1's gpiochip assignment was at an offset that could potentially change. A downstream kernel patch now assigns fixed offsets for RP1 and the onboard gpiochips. Query the device tree to get proper GPIO_CHIP index. Change-Id: I759978d4b3021c815a7d9febb41961cd1d3d185c Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/8650 Reviewed-by: Jonathan Bell <jon...@ra...> Tested-by: jenkins diff --git a/tcl/interface/raspberrypi5-gpiod.cfg b/tcl/interface/raspberrypi5-gpiod.cfg index 9624ad511..03f3fdb6e 100644 --- a/tcl/interface/raspberrypi5-gpiod.cfg +++ b/tcl/interface/raspberrypi5-gpiod.cfg @@ -18,11 +18,19 @@ proc read_file { name } { return $result } +proc find_rp1_alias {} { + foreach f [glob -directory "/proc/device-tree/aliases" "gpio\[0-9\]"] { + if {[string match "*/rp1/*" [read_file $f]]} { + return $f + } + } +} + 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 +set GPIO_CHIP [string index [find_rp1_alias] end] source [find interface/raspberrypi-gpio-connector.cfg] ----------------------------------------------------------------------- Summary of changes: tcl/interface/raspberrypi5-gpiod.cfg | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |