Skip to content

Commit eb008cb

Browse files
authored
Merge branch 'syntacore' into fk-sc/from_upstream
2 parents eb01c63 + b5a9765 commit eb008cb

Some content is hidden

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

46 files changed

+4796
-528
lines changed

.github/workflows/linux-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install required packages (apt-get)
1515
run: |
1616
sudo apt-get update
17-
sudo apt-get install clang gcc-multilib
17+
sudo apt-get install clang gcc-multilib expect
1818
- name: Get 32-bit JIM TCL from cache
1919
id: cache-libjim32
2020
uses: actions/cache@v4
@@ -60,7 +60,7 @@ jobs:
6060
- name: Install required packages (apt-get)
6161
run: |
6262
sudo apt-get update
63-
sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev libjim-dev
63+
sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev libjim-dev expect
6464
- run: ./bootstrap
6565
- run: ./configure --enable-remote-bitbang --enable-jtag_vpi --enable-ftdi-cjtag --prefix /tmp/${{ env.NAME }}
6666
- run: make -j`nproc`

.github/workflows/snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install needed packages
2020
run: |
2121
sudo apt-get update
22-
sudo apt-get install autotools-dev autoconf automake libtool pkg-config cmake texinfo texlive g++-mingw-w64-i686
22+
sudo apt-get install autotools-dev autoconf automake libtool pkg-config cmake texinfo texlive g++-mingw-w64-i686 expect
2323
- name: Checkout Code
2424
uses: actions/checkout@v4
2525
- run: ./bootstrap

.github/workflows/spike-openocd-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install packages
3434
run: |
3535
sudo apt-get update
36-
sudo apt-get install -y device-tree-compiler build-essential libjim-dev
36+
sudo apt-get install -y device-tree-compiler build-essential libjim-dev expect
3737
3838
- name: Get revisions of dependencies
3939
run: |

.gitmodules

Lines changed: 0 additions & 6 deletions
This file was deleted.

Makefile.am

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ AUTOMAKE_OPTIONS = gnu 1.6
1010
AM_DISTCHECK_CONFIGURE_FLAGS = --disable-install-jim
1111

1212
# do not run Jim Tcl tests (esp. during distcheck)
13-
check-recursive: SUBDIRS :=
13+
check-recursive: SUBDIRS := $(SUBDIRS:jimtcl=)
1414

1515
nobase_dist_pkgdata_DATA = \
1616
contrib/libdcc/dcc_stdio.c \
@@ -28,30 +28,25 @@ dist_man_MANS =
2828
EXTRA_DIST =
2929
DISTCLEANFILES =
3030

31-
if INTERNAL_JIMTCL
32-
SUBDIRS += jimtcl
33-
DIST_SUBDIRS += jimtcl
34-
EXTRA_DIST += jimtcl/configure.gnu
35-
# jimtcl from 0.79 to 0.82 miss cleaning jsmn.o
36-
DISTCLEANFILES += jimtcl/jsmn/jsmn.o
37-
endif
31+
SUBDIRS += testing
32+
DIST_SUBDIRS += testing
33+
34+
SUBDIRS += tools/syntacore
35+
DIST_SUBDIRS += tools/syntacore
36+
37+
SUBDIRS += testing
38+
DIST_SUBDIRS += testing
3839

3940
# common flags used in openocd build
4041
AM_CFLAGS = $(GCC_WARNINGS)
4142
AM_LDFLAGS =
4243

43-
AM_CPPFLAGS = $(HOST_CPPFLAGS)\
44-
-I$(top_srcdir)/src \
45-
-I$(top_builddir)/src \
46-
-DPKGDATADIR=\"$(pkgdatadir)\" \
47-
-DBINDIR=\"$(bindir)\"
48-
49-
if INTERNAL_JIMTCL
50-
AM_CPPFLAGS += -I$(top_srcdir)/jimtcl \
51-
-I$(top_builddir)/jimtcl
52-
else
53-
AM_CPPFLAGS += $(JIMTCL_CFLAGS)
54-
endif
44+
AM_CPPFLAGS = $(HOST_CPPFLAGS) \
45+
-I$(top_srcdir)/src \
46+
-I$(top_builddir)/src \
47+
-DPKGDATADIR=\"$(pkgdatadir)\" \
48+
-DBINDIR=\"$(bindir)\" \
49+
$(JIMTCL_CFLAGS)
5550

5651
if USE_GCOV
5752
AM_CFLAGS += --coverage

configure.ac

Lines changed: 12 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -406,19 +406,6 @@ AS_CASE([$host_os],
406406
])
407407
])
408408

409-
AC_ARG_ENABLE([internal-jimtcl],
410-
AS_HELP_STRING([--enable-internal-jimtcl], [Enable building internal jimtcl (deprecated)]),
411-
[use_internal_jimtcl=$enableval], [use_internal_jimtcl=no])
412-
413-
AC_ARG_ENABLE([jimtcl-maintainer],
414-
AS_HELP_STRING([--enable-jimtcl-maintainer], [Enable maintainer mode when building internal jimtcl]),
415-
[use_internal_jimtcl_maintainer=$enableval], [use_internal_jimtcl_maintainer=no])
416-
417-
AC_ARG_ENABLE([internal-libjaylink],
418-
AS_HELP_STRING([--enable-internal-libjaylink],
419-
[Enable building internal libjaylink]),
420-
[use_internal_libjaylink=$enableval], [use_internal_libjaylink=no])
421-
422409
AS_CASE(["${host_cpu}"],
423410
[i?86|x86*], [],
424411
[
@@ -579,26 +566,13 @@ AS_IF([test "x$build_gw16012" = "xyes"], [
579566
AC_DEFINE([BUILD_GW16012], [0], [0 if you don't want the Gateworks GW16012 driver.])
580567
])
581568

582-
AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
583-
AS_IF([test -f "$srcdir/jimtcl/configure"], [
584-
AS_IF([test "x$use_internal_jimtcl_maintainer" = "xyes"], [
585-
jimtcl_config_options="--disable-install-jim --with-ext=json --minimal --disable-ssl --maintainer"
586-
], [
587-
jimtcl_config_options="--disable-install-jim --with-ext=json --minimal --disable-ssl"
588-
])
589-
AX_CONFIG_SUBDIR_OPTION([jimtcl], [$jimtcl_config_options])
569+
PKG_CHECK_MODULES([JIMTCL], [jimtcl >= 0.79], [
570+
have_jimtcl_pkg_config=yes
590571
], [
591-
AC_MSG_ERROR([jimtcl not found, run git submodule init and git submodule update.])
592-
])
593-
], [
594-
PKG_CHECK_MODULES([JIMTCL], [jimtcl >= 0.79], [
595-
have_jimtcl_pkg_config=yes
596-
], [
597-
have_jimtcl_pkg_config=no
598-
AC_CHECK_HEADER([jim.h], [], [
599-
AC_MSG_ERROR([jimtcl is required but not found via pkg-config and system includes])
600-
])
601-
])
572+
have_jimtcl_pkg_config=no
573+
AC_CHECK_HEADER([jim.h], [], [
574+
AC_MSG_ERROR([jimtcl is required but not found via pkg-config and system includes])
575+
])
602576
])
603577

604578
PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [
@@ -694,7 +668,7 @@ PROCESS_ADAPTERS([LIBFTDI_USB1_ADAPTERS], ["x$use_libftdi" = "xyes" -a "x$use_li
694668
PROCESS_ADAPTERS([LIBGPIOD_ADAPTERS], ["x$use_libgpiod" = "xyes"], [Linux libgpiod])
695669
PROCESS_ADAPTERS([SYSFSGPIO_ADAPTER], ["x$is_linux" = "xyes"], [Linux sysfs])
696670
PROCESS_ADAPTERS([REMOTE_BITBANG_ADAPTER], [true], [unused])
697-
PROCESS_ADAPTERS([LIBJAYLINK_ADAPTERS], ["x$use_internal_libjaylink" = "xyes" -o "x$use_libjaylink" = "xyes"], [libjaylink-0.2])
671+
PROCESS_ADAPTERS([LIBJAYLINK_ADAPTERS], ["x$use_libjaylink" = "xyes"], [libjaylink-0.2])
698672
PROCESS_ADAPTERS([PCIE_ADAPTERS], ["x$is_linux" = "xyes"], [Linux build])
699673
PROCESS_ADAPTERS([SERIAL_PORT_ADAPTERS], ["x$can_build_buspirate" = "xyes"],
700674
[internal error: validation should happen beforehand])
@@ -730,17 +704,6 @@ AM_CONDITIONAL([HLADAPTER_STLINK], [test "x$enable_stlink" != "xno"])
730704
AM_CONDITIONAL([HLADAPTER_ICDI], [test "x$enable_ti_icdi" != "xno"])
731705
AM_CONDITIONAL([HLADAPTER_NULINK], [test "x$enable_nulink" != "xno"])
732706

733-
AS_IF([test "x$enable_jlink" != "xno"], [
734-
AS_IF([test "x$use_internal_libjaylink" = "xyes"], [
735-
AS_IF([test -f "$srcdir/src/jtag/drivers/libjaylink/configure.ac"], [
736-
AX_CONFIG_SUBDIR_OPTION([src/jtag/drivers/libjaylink],
737-
[--enable-subproject-build])
738-
], [
739-
AC_MSG_ERROR([Internal libjaylink not found, run 'git submodule init' and 'git submodule update'.])
740-
])
741-
])
742-
])
743-
744707
# Presto needs the bitq module
745708
AS_IF([test "x$enable_presto" != "xno"], [
746709
build_bitq=yes
@@ -775,9 +738,7 @@ AM_CONDITIONAL([USE_LIBJAYLINK], [test "x$use_libjaylink" = "xyes"])
775738
AM_CONDITIONAL([DMEM], [test "x$build_dmem" = "xyes"])
776739
AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$enable_capstone" != "xno"])
777740

778-
AM_CONDITIONAL([INTERNAL_JIMTCL], [test "x$use_internal_jimtcl" = "xyes"])
779741
AM_CONDITIONAL([HAVE_JIMTCL_PKG_CONFIG], [test "x$have_jimtcl_pkg_config" = "xyes"])
780-
AM_CONDITIONAL([INTERNAL_LIBJAYLINK], [test "x$use_internal_libjaylink" = "xyes"])
781742

782743
AM_CONDITIONAL([USE_GCOV], [test "x$enable_gcov" = "xyes"])
783744

@@ -836,15 +797,14 @@ AS_IF([test "x$gcc_warnings" = "xyes"], [
836797
AC_SUBST(EXTRA_DIST_NEWS, ["$(echo $srcdir/NEWS-*)"])
837798

838799
AC_CONFIG_FILES([
839-
Makefile
800+
Makefile \
801+
testing/Makefile \
802+
testing/tcl_commands/Makefile \
803+
tools/syntacore/Makefile
840804
])
805+
AM_CONDITIONAL([BUILD_USB_RESET], [test "x$is_linux" = "xyes"])
841806
AC_OUTPUT
842807

843-
AS_IF([test "x$enable_jlink" != "xno"], [
844-
AS_IF([test "x$use_internal_libjaylink" = "xyes"], [
845-
AC_MSG_WARN([Using the internal libjaylink is deprecated and will not be possible in the future.])
846-
]])
847-
)
848808

849809
AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
850810
AC_MSG_WARN([Using the internal jimtcl is deprecated and will not be possible in the future.])

doc/openocd.texi

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5092,6 +5092,7 @@ And two debug interfaces cores:
50925092
@item @code{quark_d20xx} -- an Intel Quark D20xx core.
50935093
@item @code{quark_x10xx} -- an Intel Quark X10xx core.
50945094
@item @code{riscv} -- a RISC-V core.
5095+
@item @code{scr5} -- Syntacore SCR5 core.
50955096
@item @code{stm8} -- implements an STM8 core.
50965097
@item @code{testee} -- a dummy target for cases without a real CPU, e.g. CPLD.
50975098
@item @code{xscale} -- this is actually an architecture,
@@ -11873,6 +11874,33 @@ using the @var{riscv exec_progbuf} command to execute fences or CMO instructions
1187311874
(RISC-V Cache Management Operations).
1187411875
@end deffn
1187511876

11877+
@deffn {Command} {riscv re_examine}
11878+
Enforce (re)examination of target.
11879+
@end deffn
11880+
11881+
@subsection Syntacore SCR5 target type
11882+
11883+
Syntacore SCR5 processors implement custom TLB interface. This interface makes
11884+
it possible to set up translation without standart page tables by manipulating
11885+
TLB entries directly.
11886+
11887+
To make OpenOCD aware of this additional interface, Syntacore SCR5 CPUs should
11888+
use target type @code{scr5}. To configure TLB parameters, the following
11889+
@code{$target_name configure} options are awailable:
11890+
11891+
@itemize
11892+
@item @code{-scr5-tlb-csr-base} @var{address}
11893+
Specifies the start address of SCR5 TLB CSRs. Defaults to @code{0xbc0}.
11894+
11895+
@item @code{-scr5-tlb-n-entries} @var{number}
11896+
The number of entries in the cache per chanel. There is no default -- the
11897+
option should be configured.
11898+
11899+
@item @code{"-scr5-tlb-lookup"} [@option{disable}|@option{enable}]
11900+
Controls TLB lookup. Defaults to @option{enable}.
11901+
11902+
@end itemize
11903+
1187611904
@section ARC Architecture
1187711905
@cindex ARC
1187811906

@@ -12522,6 +12550,32 @@ Instructions often need some time
1252212550
to execute before they take effect.
1252312551
@end deffn
1252412552

12553+
@deffn {Command} {jtag execute} [@option{scan} @var{tap_name}+
12554+
[@option{-ir} @var{ir_value}+ [@option{-endstate} @var{tap_state}]]
12555+
[@option{-dr} @var{scan_fields}+ [@option{-endstate} @var{tap_state}]]]
12556+
12557+
Executes a queue of commands:
12558+
@itemize @bullet
12559+
@item @option{scan} queues a JTAG scan.
12560+
@itemize @bullet
12561+
@item A list of TAP names (@var{tap_name}) specifyes active TAPs for the scan.
12562+
@item @option{-ir} indicates instruction register scan.
12563+
@item For an instruction register scan, a single @var{ir_value} should be
12564+
specified for each active TAP.
12565+
@item For an instruction register scan, inactive TAPs are placed into bypass.
12566+
@item @option{-dr} indicates data register scan.
12567+
@item For a data register scan, a single list of fields to scan should be
12568+
specified for each active TAP. Each element of this list (@var{scan_fields})
12569+
should be a coma-separated list of pairs of numbers, separated by a semicolon
12570+
(e.g. 32:0 or 31:0,1:1). The first number in a pair is the number of bits in
12571+
the field. The second one is the value.
12572+
@item For a data register scan, a single bit is shifted into inactive TAPs.
12573+
@item @var{tap_state} specifies the state the in which the chain should end up
12574+
after the scan.
12575+
@end itemize
12576+
@end itemize
12577+
@end deffn
12578+
1252512579
@c tms_sequence (short|long)
1252612580
@c ... temporary, debug-only, other than USBprog bug workaround...
1252712581

@@ -12543,8 +12597,8 @@ Default is enabled.
1254312597
@cindex TAP state names
1254412598

1254512599
The @var{tap_state} names used by OpenOCD in the @command{drscan},
12546-
@command{irscan}, and @command{pathmove} commands are the same
12547-
as those used in SVF boundary scan documents, except that
12600+
@command{irscan}, @command{pathmove}, and @command{jtag execute} commands
12601+
are the same as those used in SVF boundary scan documents, except that
1254812602
SVF uses @sc{idle} instead of @sc{run/idle}.
1254912603

1255012604
@itemize @bullet

jimtcl

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Makefile.am

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ bin_PROGRAMS += %D%/openocd
1414

1515
%C%_openocd_LDADD += $(MINGWLDADD)
1616

17-
if INTERNAL_JIMTCL
18-
%C%_openocd_LDADD += $(top_builddir)/jimtcl/libjim.a
19-
else
2017
if HAVE_JIMTCL_PKG_CONFIG
2118
%C%_openocd_LDADD += $(JIMTCL_LIBS)
2219
else
2320
%C%_openocd_LDADD += -ljim
2421
endif
25-
endif
2622

2723
%C%_libopenocd_la_CPPFLAGS =
2824

@@ -32,12 +28,15 @@ if RELEASE
3228
%C%_libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
3329
%C%_libopenocd_la_CPPFLAGS += -DGITVERSION=\"\"
3430
else
35-
%C%_libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
36-
%C%_libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
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"`\"
31+
mpy_hints_path = $(top_builddir)/makepy_hints.json
32+
get_version = "import json; print(json.load(open('$(mpy_hints_path)'))['version'])"
33+
branch = $$(python -c $(get_version) | cut -d'+' -f2- | tr -c '[:alnum:]\n' _)
34+
revision = $$(git -C $(top_srcdir) rev-parse HEAD | head -c 8)
35+
maybe_dirty = $$([ -z "$$(git status --untracked-files=no --porcelain)" ] || echo -dirty)
36+
%C%_libopenocd_la_CPPFLAGS += -DRELSTR=\"-$(branch)-g$(revision)$(maybe_dirty)\"
37+
riscv_base = $$(git -C $(top_srcdir) merge-base origin/riscv HEAD | head -c 8)
38+
%C%_libopenocd_la_CPPFLAGS += -DGITVERSION=\"riscv-upstream-$(riscv_base)-cs-$(revision)$(maybe_dirty)\"
39+
%C%_libopenocd_la_CPPFLAGS += -DPKGBLDDATE=\"`date +%F-%R`\"
4140
endif
4241

4342
# add default CPPFLAGS

0 commit comments

Comments
 (0)