Skip to content

Commit e0236ca

Browse files
committed
Merge up to 6834f02 from upstream
Change-Id: Idaef3f5911bde237bd47d1d921acc186a06ea8f8
2 parents c9866d0 + 6834f02 commit e0236ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1949
-400
lines changed

configure.ac

Lines changed: 37 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ m4_define([LIBFTDI_USB1_ADAPTERS],
165165
m4_define([LIBGPIOD_ADAPTERS],
166166
[[[linuxgpiod], [Linux GPIO bitbang through libgpiod], [LINUXGPIOD]]])
167167

168+
m4_define([REMOTE_BITBANG_ADAPTER],
169+
[[[remote_bitbang], [Remote Bitbang driver], [REMOTE_BITBANG]]])
170+
168171
m4_define([LIBJAYLINK_ADAPTERS],
169172
[[[jlink], [SEGGER J-Link Programmer], [JLINK]]])
170173

@@ -179,6 +182,15 @@ m4_define([LINUXSPIDEV_ADAPTER],
179182
m4_define([VDEBUG_ADAPTER],
180183
[[[vdebug], [Cadence Virtual Debug Interface], [VDEBUG]]])
181184

185+
m4_define([JTAG_DPI_ADAPTER],
186+
[[[jtag_dpi], [JTAG DPI Adapter], [JTAG_DPI]]])
187+
188+
m4_define([JTAG_VPI_ADAPTER],
189+
[[[jtag_vpi], [JTAG VPI Adapter], [JTAG_VPI]]])
190+
191+
m4_define([RSHIM_ADAPTER],
192+
[[[rshim], [BlueField SoC via rshim], [RSHIM]]])
193+
182194
# The word 'Adapter' in "Dummy Adapter" below must begin with a capital letter
183195
# because there is an M4 macro called 'adapter'.
184196
m4_define([DUMMY_ADAPTER],
@@ -277,10 +289,6 @@ AS_IF([test "x$debug_malloc" = "xyes" -a "x$have_glibc" = "xyes"], [
277289
AC_DEFINE([_DEBUG_FREE_SPACE_],[1], [Include malloc free space in logging])
278290
])
279291

280-
AC_ARG_ENABLE([rshim],
281-
AS_HELP_STRING([--enable-rshim], [Enable building the rshim driver]),
282-
[build_rshim=$enableval], [build_rshim=no])
283-
284292
AC_ARG_ENABLE([dmem],
285293
AS_HELP_STRING([--enable-dmem], [Enable building the dmem driver]),
286294
[build_dmem=$enableval], [build_dmem=no])
@@ -305,10 +313,14 @@ AC_ARG_ADAPTERS([
305313
LIBFTDI_ADAPTERS,
306314
LIBFTDI_USB1_ADAPTERS,
307315
LIBGPIOD_ADAPTERS,
316+
REMOTE_BITBANG_ADAPTER,
308317
LINUXSPIDEV_ADAPTER,
309318
SERIAL_PORT_ADAPTERS,
310319
DUMMY_ADAPTER,
311320
VDEBUG_ADAPTER,
321+
JTAG_DPI_ADAPTER,
322+
JTAG_VPI_ADAPTER,
323+
RSHIM_ADAPTER,
312324
PCIE_ADAPTERS,
313325
LIBJAYLINK_ADAPTERS
314326
],[auto])
@@ -327,14 +339,6 @@ AC_ARG_ENABLE([parport_giveio],
327339
[Enable use of giveio for parport (for CygWin only)]),
328340
[parport_use_giveio=$enableval], [parport_use_giveio=])
329341

330-
AC_ARG_ENABLE([jtag_vpi],
331-
AS_HELP_STRING([--enable-jtag_vpi], [Enable building support for JTAG VPI]),
332-
[build_jtag_vpi=$enableval], [build_jtag_vpi=no])
333-
334-
AC_ARG_ENABLE([jtag_dpi],
335-
AS_HELP_STRING([--enable-jtag_dpi], [Enable building support for JTAG DPI]),
336-
[build_jtag_dpi=$enableval], [build_jtag_dpi=no])
337-
338342
AC_ARG_ENABLE([amtjtagaccel],
339343
AS_HELP_STRING([--enable-amtjtagaccel], [Enable building the Amontec JTAG-Accelerator driver]),
340344
[build_amtjtagaccel=$enableval], [build_amtjtagaccel=no])
@@ -380,19 +384,24 @@ AC_ARG_ENABLE([sysfsgpio],
380384
AS_HELP_STRING([--enable-sysfsgpio], [Enable building support for programming driven via sysfs gpios.]),
381385
[build_sysfsgpio=$enableval], [build_sysfsgpio=no])
382386

387+
can_build_rshim=no
388+
383389
AS_CASE([$host_os],
384390
[linux*], [
385391
is_linux=yes
392+
can_build_rshim=yes
386393
],
387394
[
388395
AS_IF([test "x$build_sysfsgpio" = "xyes"], [
389396
AC_MSG_ERROR([sysfsgpio is only available on linux])
390397
])
391398
392-
AS_CASE([$host_os], [freebsd*], [],
399+
AS_CASE([$host_os], [freebsd*], [
400+
can_build_rshim=yes
401+
],
393402
[
394-
AS_IF([test "x$build_rshim" = "xyes"], [
395-
AC_MSG_ERROR([build_rshim is only available on linux or freebsd])
403+
AS_IF([test "x$enable_rshim" = "xyes"], [
404+
AC_MSG_ERROR([rshim is only available on linux or freebsd])
396405
])
397406
])
398407
@@ -414,10 +423,6 @@ AC_ARG_ENABLE([internal-libjaylink],
414423
[Enable building internal libjaylink]),
415424
[use_internal_libjaylink=$enableval], [use_internal_libjaylink=no])
416425

417-
AC_ARG_ENABLE([remote-bitbang],
418-
AS_HELP_STRING([--enable-remote-bitbang], [Enable building support for the Remote Bitbang driver]),
419-
[build_remote_bitbang=$enableval], [build_remote_bitbang=no])
420-
421426
AS_CASE(["${host_cpu}"],
422427
[i?86|x86*], [],
423428
[
@@ -515,12 +520,6 @@ AS_IF([test "x$build_parport" = "xyes"], [
515520
AC_DEFINE([BUILD_PARPORT], [0], [0 if you don't want parport.])
516521
])
517522

518-
AS_IF([test "x$build_rshim" = "xyes"], [
519-
AC_DEFINE([BUILD_RSHIM], [1], [1 if you want to debug BlueField SoC via rshim.])
520-
], [
521-
AC_DEFINE([BUILD_RSHIM], [0], [0 if you don't want to debug BlueField SoC via rshim.])
522-
])
523-
524523
AS_IF([test "x$build_dmem" = "xyes"], [
525524
AC_DEFINE([BUILD_DMEM], [1], [1 if you want to debug via Direct Mem.])
526525
], [
@@ -578,19 +577,6 @@ AS_IF([test "x$parport_use_giveio" = "xyes"], [
578577
AC_DEFINE([PARPORT_USE_GIVEIO], [0], [0 if you don't want parport to use giveio.])
579578
])
580579

581-
AS_IF([test "x$build_jtag_vpi" = "xyes"], [
582-
AC_DEFINE([BUILD_JTAG_VPI], [1], [1 if you want JTAG VPI.])
583-
], [
584-
AC_DEFINE([BUILD_JTAG_VPI], [0], [0 if you don't want JTAG VPI.])
585-
])
586-
587-
AS_IF([test "x$build_jtag_dpi" = "xyes"], [
588-
AC_DEFINE([BUILD_JTAG_DPI], [1], [1 if you want JTAG DPI.])
589-
], [
590-
AC_DEFINE([BUILD_JTAG_DPI], [0], [0 if you don't want JTAG DPI.])
591-
])
592-
593-
594580
AS_IF([test "x$build_amtjtagaccel" = "xyes"], [
595581
AC_DEFINE([BUILD_AMTJTAGACCEL], [1], [1 if you want the Amontec JTAG-Accelerator driver.])
596582
], [
@@ -625,13 +611,6 @@ AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
625611
])
626612
])
627613

628-
AS_IF([test "x$build_remote_bitbang" = "xyes"], [
629-
build_bitbang=yes
630-
AC_DEFINE([BUILD_REMOTE_BITBANG], [1], [1 if you want the Remote Bitbang driver.])
631-
], [
632-
AC_DEFINE([BUILD_REMOTE_BITBANG], [0], [0 if you don't want the Remote Bitbang driver.])
633-
])
634-
635614
AS_IF([test "x$build_sysfsgpio" = "xyes"], [
636615
build_bitbang=yes
637616
AC_DEFINE([BUILD_SYSFSGPIO], [1], [1 if you want the SysfsGPIO driver.])
@@ -730,18 +709,27 @@ PROCESS_ADAPTERS([HIDAPI_USB1_ADAPTERS], ["x$use_hidapi" = "xyes" -a "x$use_libu
730709
PROCESS_ADAPTERS([LIBFTDI_ADAPTERS], ["x$use_libftdi" = "xyes"], [libftdi])
731710
PROCESS_ADAPTERS([LIBFTDI_USB1_ADAPTERS], ["x$use_libftdi" = "xyes" -a "x$use_libusb1" = "xyes"], [libftdi and libusb-1.x])
732711
PROCESS_ADAPTERS([LIBGPIOD_ADAPTERS], ["x$use_libgpiod" = "xyes"], [Linux libgpiod])
712+
PROCESS_ADAPTERS([REMOTE_BITBANG_ADAPTER], [true], [unused])
733713
PROCESS_ADAPTERS([LIBJAYLINK_ADAPTERS], ["x$use_internal_libjaylink" = "xyes" -o "x$use_libjaylink" = "xyes"], [libjaylink-0.2])
734714
PROCESS_ADAPTERS([PCIE_ADAPTERS], ["x$is_linux" = "xyes"], [Linux build])
735715
PROCESS_ADAPTERS([SERIAL_PORT_ADAPTERS], ["x$can_build_buspirate" = "xyes"],
736716
[internal error: validation should happen beforehand])
737717
PROCESS_ADAPTERS([LINUXSPIDEV_ADAPTER], ["x$is_linux" = "xyes"], [Linux spidev])
738718
PROCESS_ADAPTERS([VDEBUG_ADAPTER], [true], [unused])
719+
PROCESS_ADAPTERS([JTAG_DPI_ADAPTER], [true], [unused])
720+
PROCESS_ADAPTERS([JTAG_VPI_ADAPTER], [true], [unused])
721+
PROCESS_ADAPTERS([RSHIM_ADAPTER], ["x$can_build_rshim" = "xyes"],
722+
[internal error: validation should happen beforehand])
739723
PROCESS_ADAPTERS([DUMMY_ADAPTER], [true], [unused])
740724

741725
AS_IF([test "x$enable_linuxgpiod" != "xno"], [
742726
build_bitbang=yes
743727
])
744728

729+
AS_IF([test "x$enable_remote_bitbang" != "xno"], [
730+
build_bitbang=yes
731+
])
732+
745733
AS_IF([test "x$enable_stlink" != "xno" -o "x$enable_ti_icdi" != "xno" -o "x$enable_nulink" != "xno"], [
746734
AC_DEFINE([BUILD_HLADAPTER], [1], [1 if you want the High Level JTAG driver.])
747735
AM_CONDITIONAL([HLADAPTER], [true])
@@ -783,12 +771,9 @@ AM_CONDITIONAL([BCM2835GPIO], [test "x$build_bcm2835gpio" = "xyes"])
783771
AM_CONDITIONAL([IMX_GPIO], [test "x$build_imx_gpio" = "xyes"])
784772
AM_CONDITIONAL([AM335XGPIO], [test "x$build_am335xgpio" = "xyes"])
785773
AM_CONDITIONAL([BITBANG], [test "x$build_bitbang" = "xyes"])
786-
AM_CONDITIONAL([JTAG_VPI], [test "x$build_jtag_vpi" = "xyes"])
787-
AM_CONDITIONAL([JTAG_DPI], [test "x$build_jtag_dpi" = "xyes"])
788774
AM_CONDITIONAL([USB_BLASTER_DRIVER], [test "x$enable_usb_blaster" != "xno" -o "x$enable_usb_blaster_2" != "xno"])
789775
AM_CONDITIONAL([AMTJTAGACCEL], [test "x$build_amtjtagaccel" = "xyes"])
790776
AM_CONDITIONAL([GW16012], [test "x$build_gw16012" = "xyes"])
791-
AM_CONDITIONAL([REMOTE_BITBANG], [test "x$build_remote_bitbang" = "xyes"])
792777
AM_CONDITIONAL([SYSFSGPIO], [test "x$build_sysfsgpio" = "xyes"])
793778
AM_CONDITIONAL([USE_LIBUSB1], [test "x$use_libusb1" = "xyes"])
794779
AM_CONDITIONAL([IS_CYGWIN], [test "x$is_cygwin" = "xyes"])
@@ -800,7 +785,6 @@ AM_CONDITIONAL([USE_LIBFTDI], [test "x$use_libftdi" = "xyes"])
800785
AM_CONDITIONAL([USE_LIBGPIOD], [test "x$use_libgpiod" = "xyes"])
801786
AM_CONDITIONAL([USE_HIDAPI], [test "x$use_hidapi" = "xyes"])
802787
AM_CONDITIONAL([USE_LIBJAYLINK], [test "x$use_libjaylink" = "xyes"])
803-
AM_CONDITIONAL([RSHIM], [test "x$build_rshim" = "xyes"])
804788
AM_CONDITIONAL([DMEM], [test "x$build_dmem" = "xyes"])
805789
AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$enable_capstone" != "xno"])
806790

@@ -887,9 +871,13 @@ m4_foreach([adapter], [USB1_ADAPTERS,
887871
HIDAPI_ADAPTERS, HIDAPI_USB1_ADAPTERS, LIBFTDI_ADAPTERS,
888872
LIBFTDI_USB1_ADAPTERS,
889873
LIBGPIOD_ADAPTERS,
874+
REMOTE_BITBANG_ADAPTER,
890875
LIBJAYLINK_ADAPTERS, PCIE_ADAPTERS, SERIAL_PORT_ADAPTERS,
891876
LINUXSPIDEV_ADAPTER,
892877
VDEBUG_ADAPTER,
878+
JTAG_DPI_ADAPTER,
879+
JTAG_VPI_ADAPTER,
880+
RSHIM_ADAPTER,
893881
DUMMY_ADAPTER,
894882
OPTIONAL_LIBRARIES,
895883
COVERAGE],

doc/openocd.texi

Lines changed: 70 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,12 +2415,6 @@ target.
24152415
List the debug adapter drivers that have been built into
24162416
the running copy of OpenOCD.
24172417
@end deffn
2418-
@deffn {Config Command} {adapter transports} transport_name+
2419-
Specifies the transports supported by this debug adapter.
2420-
The adapter driver builds-in similar knowledge; use this only
2421-
when external configuration (such as jumpering) changes what
2422-
the hardware can support.
2423-
@end deffn
24242418

24252419
@anchor{adapter gpio}
24262420
@deffn {Config Command} {adapter gpio [ @
@@ -3845,13 +3839,6 @@ Not all adapters and adapter drivers support SWD multi-drop. Only the following
38453839
adapter drivers are SWD multi-drop capable:
38463840
cmsis_dap (use an adapter with CMSIS-DAP version 2.0), ftdi, all bitbang based.
38473841

3848-
@subsection SPI Transport
3849-
@cindex SPI
3850-
@cindex Serial Peripheral Interface
3851-
The Serial Peripheral Interface (SPI) is a general purpose transport
3852-
which uses four wire signaling. Some processors use it as part of a
3853-
solution for flash programming.
3854-
38553842
@anchor{swimtransport}
38563843
@subsection SWIM Transport
38573844
@cindex SWIM
@@ -7430,6 +7417,76 @@ msp432 bsl lock
74307417
@end deffn
74317418
@end deffn
74327419

7420+
@deffn {Flash Driver} {mspm0}
7421+
7422+
All Arm Cortex-M0+ MSPM0 microcontroller versions from Texas Instruments
7423+
include internal flash. The mspm0 flash driver automatically recognizes the
7424+
specific version's flash parameters and autoconfigures itself. The main
7425+
program flash starts at address 0x0. Non-main flash starts at 0x41c00000.
7426+
If present on the device, the optional region called "Data" starts at
7427+
0x41d00000.
7428+
7429+
@b{Warning}:
7430+
7431+
@itemize @bullet
7432+
@item @b{Reset while MCU operation:} When erasing all of MAIN memory, if the
7433+
MCU is still executing from MAIN memory do not reset the device as it could
7434+
cause a double hard-fault due to the missing interrupt vector table at the
7435+
start of memory. To recover from such scenario reset or power-cycle the MCU.
7436+
7437+
@item @b{No explicit protection support:} MSPM0 flash controller auto-protect
7438+
themselves after every flash operation. As a result of this, OpenOCD does not
7439+
explicitly provide any protection function and automatically un-protects
7440+
required sections as flash operations are requested.
7441+
@end itemize
7442+
7443+
@b{Examples}:
7444+
7445+
@itemize @bullet
7446+
7447+
@item @b{Flash bank description:}
7448+
@example
7449+
flash bank $_FLASHNAME mspm0 0 0 0 0 $_TARGETNAME
7450+
@end example
7451+
7452+
@item @b{To erase and program the MAIN region:}
7453+
@example
7454+
halt
7455+
flash erase_sector 0 0 last
7456+
flash write_image MAIN.bin 0x0
7457+
mspm0_board_reset
7458+
@end example
7459+
7460+
@item @b{To erase and program the NONMAIN region:}
7461+
@example
7462+
halt
7463+
flash erase_sector 1 0 last
7464+
flash write_image NONMAIN.bin 0x41C00000
7465+
mspm0_board_reset
7466+
@end example
7467+
7468+
@end itemize
7469+
7470+
@deffn {TCL proc} {mspm0_board_reset}
7471+
Performs an nRST toggle on the device.
7472+
@end deffn
7473+
7474+
@deffn {TCL proc} {mspm0_mass_erase}
7475+
Sends the mass erase command to the SEC-AP mailbox and then performs
7476+
an nRST toggle. Once the command has been fully processed by the ROM,
7477+
all MAIN memory will be erased. NOTE: This command is not supported
7478+
on MSPM0C* family of devices.
7479+
@end deffn
7480+
7481+
@deffn {TCL proc} {mspm0_factory_reset}
7482+
Sends the factory reset command to the SEC-AP mailbox and then performs
7483+
an nRST toggle. Once the command has been fully processed by the ROM,
7484+
all MAIN memory will be erased and NONMAIN will be reset to its default
7485+
values.
7486+
@end deffn
7487+
7488+
@end deffn
7489+
74337490
@deffn {Flash Driver} {niietcm4}
74347491
This drivers handles the integrated NOR flash on NIIET Cortex-M4
74357492
based controllers. Flash size and sector layout are auto-configured by the driver.

src/Makefile.am

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ if RELEASE
3434
else
3535
%C%_libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
3636
%C%_libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
37-
%C%_libopenocd_la_CPPFLAGS += -DPKGBLDDATE=\"`date +%F-%R`\"
37+
%C%_libopenocd_la_CPPFLAGS += -DPKGBLDDATE=\"`DATE_FMT=+%F-%R; \
38+
SOURCE_DATE_EPOCH="$${SOURCE_DATE_EPOCH:-$$(date +%s)}"; \
39+
date -u -d "@$$SOURCE_DATE_EPOCH" "$$DATE_FMT" 2>/dev/null || \
40+
date -u -r "$$SOURCE_DATE_EPOCH" "$$DATE_FMT" 2>/dev/null || date -u "$$DATE_FMT"`\"
3841
endif
3942

4043
# add default CPPFLAGS

src/flash/nor/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ NOR_DRIVERS = \
4545
%D%/max32xxx.c \
4646
%D%/mdr.c \
4747
%D%/msp432.c \
48+
%D%/mspm0.c \
4849
%D%/mrvlqspi.c \
4950
%D%/niietcm4.c \
5051
%D%/non_cfi.c \

src/flash/nor/driver.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ extern const struct flash_driver max32xxx_flash;
274274
extern const struct flash_driver mdr_flash;
275275
extern const struct flash_driver mrvlqspi_flash;
276276
extern const struct flash_driver msp432_flash;
277+
extern const struct flash_driver mspm0_flash;
277278
extern const struct flash_driver niietcm4_flash;
278279
extern const struct flash_driver npcx_flash;
279280
extern const struct flash_driver nrf51_flash;

src/flash/nor/drivers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ static const struct flash_driver * const flash_drivers[] = {
5151
&mdr_flash,
5252
&mrvlqspi_flash,
5353
&msp432_flash,
54+
&mspm0_flash,
5455
&niietcm4_flash,
5556
&npcx_flash,
5657
&nrf5_flash,

0 commit comments

Comments
 (0)