mirror of
https://github.com/linux-msm/openocd.git
synced 2026-02-25 13:15:07 -08:00
imx_gpio: add mmap based jtag interface for IMX processors
For some targets (like nrf51) sysfs driver is too slow. This patch implements memory maped driver for IMX processors. Mostly based on bcm2835gpio. Tested on imx6ul CPU. However, it should work on any NXP IMX CPU. Change-Id: Idace4c98181c6e9c64dd158bfa52631204b5c4a7 Signed-off-by: Grzegorz Kostka <kostka.grzegorz@gmail.com> Reviewed-on: http://openocd.zylin.com/4106 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
This commit is contained in:
committed by
Paul Fertser
parent
f6449a7cba
commit
83c67b7ac7
12
configure.ac
12
configure.ac
@@ -298,11 +298,15 @@ AS_CASE(["${host_cpu}"],
|
||||
AC_ARG_ENABLE([bcm2835gpio],
|
||||
AS_HELP_STRING([--enable-bcm2835gpio], [Enable building support for bitbanging on BCM2835 (as found in Raspberry Pi)]),
|
||||
[build_bcm2835gpio=$enableval], [build_bcm2835gpio=no])
|
||||
AC_ARG_ENABLE([imx_gpio],
|
||||
AS_HELP_STRING([--enable-imx_gpio], [Enable building support for bitbanging on NXP IMX processors]),
|
||||
[build_imx_gpio=$enableval], [build_imx_gpio=no])
|
||||
],
|
||||
[
|
||||
build_ep93xx=no
|
||||
build_at91rm9200=no
|
||||
build_bcm2835gpio=no
|
||||
build_imx_gpio=no
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE([gw16012],
|
||||
@@ -516,6 +520,13 @@ AS_IF([test "x$build_bcm2835gpio" = "xyes"], [
|
||||
AC_DEFINE([BUILD_BCM2835GPIO], [0], [0 if you don't want bcm2835gpio.])
|
||||
])
|
||||
|
||||
AS_IF([test "x$build_imx_gpio" = "xyes"], [
|
||||
build_bitbang=yes
|
||||
AC_DEFINE([BUILD_IMX_GPIO], [1], [1 if you want imx_gpio.])
|
||||
], [
|
||||
AC_DEFINE([BUILD_IMX_GPIO], [0], [0 if you don't want imx_gpio.])
|
||||
])
|
||||
|
||||
AS_IF([test "x$parport_use_ppdev" = "xyes"], [
|
||||
AC_DEFINE([PARPORT_USE_PPDEV], [1], [1 if you want parport to use ppdev.])
|
||||
], [
|
||||
@@ -686,6 +697,7 @@ AM_CONDITIONAL([ZY1000_MASTER], [test "x$build_zy1000_master" = "xyes"])
|
||||
AM_CONDITIONAL([IOUTIL], [test "x$build_ioutil" = "xyes"])
|
||||
AM_CONDITIONAL([AT91RM9200], [test "x$build_at91rm9200" = "xyes"])
|
||||
AM_CONDITIONAL([BCM2835GPIO], [test "x$build_bcm2835gpio" = "xyes"])
|
||||
AM_CONDITIONAL([IMX_GPIO], [test "x$build_imx_gpio" = "xyes"])
|
||||
AM_CONDITIONAL([BITBANG], [test "x$build_bitbang" = "xyes"])
|
||||
AM_CONDITIONAL([JTAG_VPI], [test "x$build_jtag_vpi" = "xyes" -o "x$build_jtag_vpi" = "xyes"])
|
||||
AM_CONDITIONAL([USB_BLASTER_DRIVER], [test "x$enable_usb_blaster" != "xno" -o "x$enable_usb_blaster_2" != "xno"])
|
||||
|
||||
@@ -595,6 +595,9 @@ produced, PDF schematics are easily found and it is easy to make.
|
||||
@item @b{bcm2835gpio}
|
||||
@* A BCM2835-based board (e.g. Raspberry Pi) using the GPIO pins of the expansion header.
|
||||
|
||||
@item @b{imx_gpio}
|
||||
@* A NXP i.MX-based board (e.g. Wandboard) using the GPIO pins (should work on any i.MX processor).
|
||||
|
||||
@item @b{jtag_vpi}
|
||||
@* A JTAG driver acting as a client for the JTAG VPI server interface.
|
||||
@* Link: @url{http://github.com/fjullien/jtag_vpi}
|
||||
@@ -2992,6 +2995,18 @@ pinout.
|
||||
|
||||
@end deffn
|
||||
|
||||
@deffn {Interface Driver} {imx_gpio}
|
||||
i.MX SoC is present in many community boards. Wandboard is an example
|
||||
of the one which is most popular.
|
||||
|
||||
This driver is mostly the same as bcm2835gpio.
|
||||
|
||||
See @file{interface/imx-native.cfg} for a sample config and
|
||||
pinout.
|
||||
|
||||
@end deffn
|
||||
|
||||
|
||||
@deffn {Interface Driver} {openjtag}
|
||||
OpenJTAG compatible USB adapter.
|
||||
This defines some driver-specific commands:
|
||||
|
||||
@@ -144,14 +144,15 @@ endif
|
||||
if BCM2835GPIO
|
||||
DRIVERFILES += %D%/bcm2835gpio.c
|
||||
endif
|
||||
|
||||
if OPENJTAG
|
||||
DRIVERFILES += %D%/openjtag.c
|
||||
endif
|
||||
|
||||
if CMSIS_DAP
|
||||
DRIVERFILES += %D%/cmsis_dap_usb.c
|
||||
endif
|
||||
if IMX_GPIO
|
||||
DRIVERFILES += %D%/imx_gpio.c
|
||||
endif
|
||||
|
||||
if KITPROG
|
||||
DRIVERFILES += %D%/kitprog.c
|
||||
|
||||
552
src/jtag/drivers/imx_gpio.c
Normal file
552
src/jtag/drivers/imx_gpio.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -126,6 +126,9 @@ extern struct jtag_interface cmsis_dap_interface;
|
||||
#if BUILD_KITPROG == 1
|
||||
extern struct jtag_interface kitprog_interface;
|
||||
#endif
|
||||
#if BUILD_IMX_GPIO == 1
|
||||
extern struct jtag_interface imx_gpio_interface;
|
||||
#endif
|
||||
#endif /* standard drivers */
|
||||
|
||||
/**
|
||||
@@ -222,6 +225,9 @@ struct jtag_interface *jtag_interfaces[] = {
|
||||
#if BUILD_KITPROG == 1
|
||||
&kitprog_interface,
|
||||
#endif
|
||||
#if BUILD_IMX_GPIO == 1
|
||||
&imx_gpio_interface,
|
||||
#endif
|
||||
#endif /* standard drivers */
|
||||
NULL,
|
||||
};
|
||||
|
||||
35
tcl/interface/imx-native.cfg
Normal file
35
tcl/interface/imx-native.cfg
Normal file
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# Config for using NXP IMX CPU
|
||||
#
|
||||
# This is best used with a fast enough buffer but also
|
||||
# is suitable for direct connection if the target voltage
|
||||
# matches to host voltage and the cable is short enough.
|
||||
#
|
||||
#
|
||||
|
||||
interface imx_gpio
|
||||
|
||||
# For most IMX processors 0x0209c000
|
||||
imx_gpio_peripheral_base 0x0209c000
|
||||
|
||||
# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET
|
||||
# These depend on system clock, calibrated for IMX6UL@528MHz
|
||||
# imx_gpio_speed SPEED_COEFF SPEED_OFFSET
|
||||
imx_gpio_speed_coeffs 50000 50
|
||||
|
||||
# Each of the JTAG lines need a gpio number set: tck tms tdi tdo.
|
||||
# Example configuration:
|
||||
# imx_gpio_jtag_nums 6 7 8 9
|
||||
|
||||
# SWD interface pins: swclk swdio
|
||||
# Example configuration:
|
||||
imx_gpio_swd_nums 1 6
|
||||
|
||||
# imx_gpio_trst_num 10
|
||||
# reset_config trst_only
|
||||
|
||||
# imx_gpio_srst_num 11
|
||||
# reset_config srst_only srst_push_pull
|
||||
|
||||
# or if you have both connected,
|
||||
# reset_config trst_and_srst srst_push_pull
|
||||
Reference in New Issue
Block a user