From fd5c30f555012d8e93621e86d6eb918359532529 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 10 Jul 2019 22:51:42 +0200 Subject: [PATCH] jtag tools: add config for RaspberryPi --- tools/jtag_openocd/interface-raspberrypi.cfg | 37 +++++++++++++++++++ tools/jtag_openocd/interface-raspberrypi2.cfg | 37 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 tools/jtag_openocd/interface-raspberrypi.cfg create mode 100644 tools/jtag_openocd/interface-raspberrypi2.cfg diff --git a/tools/jtag_openocd/interface-raspberrypi.cfg b/tools/jtag_openocd/interface-raspberrypi.cfg new file mode 100644 index 000000000..984afe41b --- /dev/null +++ b/tools/jtag_openocd/interface-raspberrypi.cfg @@ -0,0 +1,37 @@ +# Config for using Raspberry Pi's expansion header +# Using BCM2835 chip present in models Pi1, Pi2 and Pi Zero + +# Use short cables! +# Make sure the CPU is not busy with other processes! +# Connect pm3 before booting to avoid power loss & reboot problems +# Pinouts: +# 22 <> TMS +# 19 <> TDI +# 21 <> TDO +# 23 <> TCK +# 6 <> GND +# 1 <> 3.3 + +interface bcm2835gpio + +# This file is meant for first versions of Raspberry Pi +# You can check yours with: +# dd if=/proc/device-tree/soc/ranges bs=4 skip=1 count=1 2>/dev/null|xxd -p +# if it returns 20000000, you're fine +# if it returns 3F000000, use interface-raspberrypi2.cfg +bcm2835gpio_peripheral_base 0x20000000 + +# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET +# These depend on system clock, calibrated for stock 700MHz +# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET +bcm2835gpio_speed_coeffs 113714 28 + +# Each of the JTAG lines need a gpio number set: tck tms tdi tdo +# Header pin numbers: 23 22 19 21 +bcm2835gpio_jtag_nums 11 25 10 9 + +bcm2835gpio_srst_num 18 +reset_config srst_only srst_push_pull + +transport select jtag +adapter_khz 1000 diff --git a/tools/jtag_openocd/interface-raspberrypi2.cfg b/tools/jtag_openocd/interface-raspberrypi2.cfg new file mode 100644 index 000000000..b779cd290 --- /dev/null +++ b/tools/jtag_openocd/interface-raspberrypi2.cfg @@ -0,0 +1,37 @@ +# Config for using Raspberry Pi's expansion header +# Using BCM2835 chip present in models 2+ and above + +# Use short cables! +# Make sure the CPU is not busy with other processes! +# Connect pm3 before booting to avoid power loss & reboot problems +# Pinouts: +# 22 <> TMS +# 19 <> TDI +# 21 <> TDO +# 23 <> TCK +# 6 <> GND +# 1 <> 3.3 + +interface bcm2835gpio + +# This file is meant for recent versions of Raspberry Pi +# You can check yours with: +# dd if=/proc/device-tree/soc/ranges bs=4 skip=1 count=1 2>/dev/null|xxd -p +# if it returns 20000000, use interface-raspberrypi2.cfg +# if it returns 3F000000, you're fine +bcm2835gpio_peripheral_base 0x3F000000 + +# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET +# These depend on system clock, calibrated for stock 700MHz +# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET +bcm2835gpio_speed_coeffs 146203 36 + +# Each of the JTAG lines need a gpio number set: tck tms tdi tdo +# Header pin numbers: 23 22 19 21 +bcm2835gpio_jtag_nums 11 25 10 9 + +bcm2835gpio_srst_num 18 +reset_config srst_only srst_push_pull + +transport select jtag +adapter_khz 1000