Skip to content

Commit cabb600

Browse files
committed
Merge up to fd62626 from upstream
Conflicts are related to `unsigned`->`unisgned int` cleanup: * `src/jtag/drivers/ftdi.c` -- between 6749c70 and a64dc23. * `src/rtos/hwthread.c` -- between ef3e61b and 436e6f1. * `src/target/target.c` and `.h` -- between 53ec10b and e72733d. * `src/target/riscv/*` -- due to 957eb74 and fec3b22. Resolved by: * Changing the return type of `riscv_batch_get_dmi_read_op()` to `uint32_t`. * Using RISC-V OpenOCD's version in other cases. Change-Id: Ia6e2129c6fddb1dec26adcd936506af2539412ef
2 parents f9a1292 + fd62626 commit cabb600

File tree

220 files changed

+1428
-1159
lines changed

Some content is hidden

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

220 files changed

+1428
-1159
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ patches
8484
.cproject
8585
.settings
8686

87+
# VSCode stuff
88+
.vscode
89+
8790
# Emacs temp files
8891
*~
8992

HACKING

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,13 @@ Only for <em>exceptional cases</em>, it is allowed to submit patches
313313
to Gerrit with the special field 'Checkpatch-ignore:' in the commit
314314
message. This field will cause checkpatch to ignore the error types
315315
listed in the field, only for the patch itself.
316+
For errors in the commit message, the special field has to be put in
317+
the commit message before the line that produces the error.
318+
The special field must be added <em>before</em> the 'Signed-off-by:'
319+
line, otherwise it is ignored.
320+
To ignore multiple errors, either add multiple lines with the special
321+
field or add multiple error types, separated by space or commas, in a
322+
single line.
316323
The error type is printed by checkpatch on failure.
317324
For example the names of Windows APIs mix lower and upper case chars,
318325
in violation of OpenOCD coding style, triggering a 'CAMELCASE' error:

configure.ac

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,18 @@ AS_IF([test -x "$srcdir/guess-rev.sh"], [
104104
AC_MSG_RESULT([$build_release])
105105

106106
# Adapter drivers
107-
# 1st column -- configure option
108-
# 2nd column -- description
109-
# 3rd column -- symbol used for both config.h and automake
107+
# 1st column -- Basename for the configure option generated with AC_ARG_ENABLE.
108+
# For example, "buspirate" generates options "--enable-buspirate[=yes/no]"
109+
# and "--disable-buspirate".
110+
# 2nd column -- Description for the configure option. For example, "Bus Pirate"
111+
# generates "Enable building support for the Bus Pirate (default is auto)".
112+
# 3rd column -- Basename for the config.h and Automake symbols.
113+
# For example, basename "BUS_PIRATE" generates "BUILD_BUS_PIRATE" with AC_DEFINE
114+
# for config.h and "BUS_PIRATE" with AM_CONDITIONAL for Automake.
110115
m4_define([ADAPTER_ARG], [m4_argn([1], $1)])
111116
m4_define([ADAPTER_DESC], [m4_argn([2], $1)])
112117
m4_define([ADAPTER_SYM], [m4_argn([3], $1)])
118+
# AC_ARG_ENABLE uses prefix "enable_" to name the corresponding option variable.
113119
m4_define([ADAPTER_VAR], [enable_[]ADAPTER_ARG($1)])
114120
m4_define([ADAPTER_OPT], [m4_translit(ADAPTER_ARG($1), [_], [-])])
115121

@@ -265,6 +271,7 @@ AC_ARG_ADAPTERS([
265271
LIBFTDI_USB1_ADAPTERS
266272
LIBGPIOD_ADAPTERS,
267273
SERIAL_PORT_ADAPTERS,
274+
PCIE_ADAPTERS,
268275
LIBJAYLINK_ADAPTERS
269276
],[auto])
270277

@@ -341,12 +348,10 @@ AC_ARG_ENABLE([sysfsgpio],
341348
AS_HELP_STRING([--enable-sysfsgpio], [Enable building support for programming driven via sysfs gpios.]),
342349
[build_sysfsgpio=$enableval], [build_sysfsgpio=no])
343350

344-
AC_ARG_ENABLE([xlnx_pcie_xvc],
345-
AS_HELP_STRING([--enable-xlnx-pcie-xvc], [Enable building support for Xilinx XVC/PCIe.]),
346-
[build_xlnx_pcie_xvc=$enableval], [build_xlnx_pcie_xvc=no])
347-
348351
AS_CASE([$host_os],
349-
[linux*], [],
352+
[linux*], [
353+
is_linux=yes
354+
],
350355
[
351356
AS_IF([test "x$build_sysfsgpio" = "xyes"], [
352357
AC_MSG_ERROR([sysfsgpio is only available on linux])
@@ -356,10 +361,6 @@ AS_CASE([$host_os],
356361
AC_MSG_ERROR([linuxgpiod is only available on linux])
357362
])
358363
359-
AS_IF([test "x$build_xlnx_pcie_xvc" = "xyes"], [
360-
AC_MSG_ERROR([xlnx_pcie_xvc is only available on linux])
361-
])
362-
363364
AS_CASE([$host_os], [freebsd*], [],
364365
[
365366
AS_IF([test "x$build_rshim" = "xyes"], [
@@ -620,13 +621,6 @@ AS_IF([test "x$build_sysfsgpio" = "xyes"], [
620621
AC_DEFINE([BUILD_SYSFSGPIO], [0], [0 if you don't want SysfsGPIO driver.])
621622
])
622623

623-
AS_IF([test "x$build_xlnx_pcie_xvc" = "xyes"], [
624-
build_xlnx_pcie_xvc=yes
625-
AC_DEFINE([BUILD_XLNX_PCIE_XVC], [1], [1 if you want the Xilinx XVC/PCIe driver.])
626-
], [
627-
AC_DEFINE([BUILD_XLNX_PCIE_XVC], [0], [0 if you don't want Xilinx XVC/PCIe driver.])
628-
])
629-
630624
PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [
631625
use_libusb1=yes
632626
AC_DEFINE([HAVE_LIBUSB1], [1], [Define if you have libusb-1.x])
@@ -688,11 +682,11 @@ PKG_CHECK_MODULES([LIBGPIOD], [libgpiod < 2.0], [
688682
PKG_CHECK_MODULES([LIBJAYLINK], [libjaylink >= 0.2],
689683
[use_libjaylink=yes], [use_libjaylink=no])
690684

691-
# Arg $1: The adapter name, used to derive option and variable names for the adapter.
692-
# Arg $2: Whether the adapter can be enabled, for example, because
693-
# its prerequisites are installed in the system.
685+
# Arg $1: An array of adapter triplets, used to derive option and variable names for each adapter.
686+
# Arg $2: Whether the adapters can be enabled, for example, because
687+
# their prerequisites are installed in the system.
694688
# Arg $3: What prerequisites are missing, to be shown in an error message
695-
# if the adapter was requested but cannot be enabled.
689+
# if an adapter was requested but cannot be enabled.
696690
m4_define([PROCESS_ADAPTERS], [
697691
m4_foreach([adapter], [$1], [
698692
AS_IF([test $2], [
@@ -703,7 +697,7 @@ m4_define([PROCESS_ADAPTERS], [
703697
])
704698
], [
705699
AS_IF([test "x$ADAPTER_VAR([adapter])" = "xyes"], [
706-
AC_MSG_ERROR([$3 is required for the ADAPTER_DESC([adapter])])
700+
AC_MSG_ERROR([$3 is required for [adapter] ADAPTER_DESC([adapter]).])
707701
])
708702
ADAPTER_VAR([adapter])=no
709703
AC_DEFINE([BUILD_]ADAPTER_SYM([adapter]), [0], [0 if you do not want the ]ADAPTER_DESC([adapter]).)
@@ -719,6 +713,7 @@ PROCESS_ADAPTERS([LIBFTDI_ADAPTERS], ["x$use_libftdi" = "xyes"], [libftdi])
719713
PROCESS_ADAPTERS([LIBFTDI_USB1_ADAPTERS], ["x$use_libftdi" = "xyes" -a "x$use_libusb1" = "xyes"], [libftdi and libusb-1.x])
720714
PROCESS_ADAPTERS([LIBGPIOD_ADAPTERS], ["x$use_libgpiod" = "xyes"], [libgpiod])
721715
PROCESS_ADAPTERS([LIBJAYLINK_ADAPTERS], ["x$use_internal_libjaylink" = "xyes" -o "x$use_libjaylink" = "xyes"], [libjaylink-0.2])
716+
PROCESS_ADAPTERS([PCIE_ADAPTERS], ["x$is_linux" = "xyes"], [Linux build])
722717
PROCESS_ADAPTERS([DUMMY_ADAPTER], [true], [unused])
723718

724719
AS_IF([test "x$enable_linuxgpiod" != "xno"], [
@@ -775,7 +770,6 @@ AM_CONDITIONAL([GW16012], [test "x$build_gw16012" = "xyes"])
775770
AM_CONDITIONAL([REMOTE_BITBANG], [test "x$build_remote_bitbang" = "xyes"])
776771
AM_CONDITIONAL([BUSPIRATE], [test "x$enable_buspirate" != "xno"])
777772
AM_CONDITIONAL([SYSFSGPIO], [test "x$build_sysfsgpio" = "xyes"])
778-
AM_CONDITIONAL([XLNX_PCIE_XVC], [test "x$build_xlnx_pcie_xvc" = "xyes"])
779773
AM_CONDITIONAL([USE_LIBUSB1], [test "x$use_libusb1" = "xyes"])
780774
AM_CONDITIONAL([IS_CYGWIN], [test "x$is_cygwin" = "xyes"])
781775
AM_CONDITIONAL([IS_MINGW], [test "x$is_mingw" = "xyes"])

contrib/itmdump.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ unsigned int dump_swit;
4343
* NOTE that this specific encoding could be space-optimized; and that
4444
* trace data streams could also be history-sensitive.
4545
*/
46-
static void show_task(int port, unsigned data)
46+
static void show_task(int port, unsigned int data)
4747
{
48-
unsigned code = data >> 16;
48+
unsigned int code = data >> 16;
4949
char buf[16];
5050

5151
if (dump_swit)
@@ -77,7 +77,7 @@ static void show_task(int port, unsigned data)
7777

7878
static void show_reserved(FILE *f, char *label, int c)
7979
{
80-
unsigned i;
80+
unsigned int i;
8181

8282
if (dump_swit)
8383
return;
@@ -96,9 +96,9 @@ static void show_reserved(FILE *f, char *label, int c)
9696
printf("\n");
9797
}
9898

99-
static bool read_varlen(FILE *f, int c, unsigned *value)
99+
static bool read_varlen(FILE *f, int c, unsigned int *value)
100100
{
101-
unsigned size;
101+
unsigned int size;
102102
unsigned char buf[4];
103103

104104
*value = 0;
@@ -135,8 +135,8 @@ static bool read_varlen(FILE *f, int c, unsigned *value)
135135

136136
static void show_hard(FILE *f, int c)
137137
{
138-
unsigned type = c >> 3;
139-
unsigned value;
138+
unsigned int type = c >> 3;
139+
unsigned int value;
140140
char *label;
141141

142142
if (dump_swit)
@@ -230,16 +230,16 @@ static void show_hard(FILE *f, int c)
230230
*/
231231
struct {
232232
int port;
233-
void (*show)(int port, unsigned data);
233+
void (*show)(int port, unsigned int data);
234234
} format[] = {
235235
{ .port = 31, .show = show_task, },
236236
};
237237

238238
static void show_swit(FILE *f, int c)
239239
{
240-
unsigned port = c >> 3;
241-
unsigned value = 0;
242-
unsigned i;
240+
unsigned int port = c >> 3;
241+
unsigned int value = 0;
242+
unsigned int i;
243243

244244
if (port + 1 == dump_swit) {
245245
if (!read_varlen(f, c, &value))
@@ -272,7 +272,7 @@ static void show_swit(FILE *f, int c)
272272

273273
static void show_timestamp(FILE *f, int c)
274274
{
275-
unsigned counter = 0;
275+
unsigned int counter = 0;
276276
char *label = "";
277277
bool delayed = false;
278278

contrib/loaders/flash/fespi/riscv_fespi.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void fespi_disable_hw_mode(volatile uint32_t *ctrl_base);
103103
static void fespi_enable_hw_mode(volatile uint32_t *ctrl_base);
104104
static int fespi_wip(volatile uint32_t *ctrl_base);
105105
static int fespi_write_buffer(volatile uint32_t *ctrl_base,
106-
const uint8_t *buffer, unsigned offset, unsigned len,
106+
const uint8_t *buffer, unsigned int offset, unsigned int len,
107107
uint32_t flash_info);
108108

109109
/* Can set bits 3:0 in result. */
@@ -113,7 +113,7 @@ static int fespi_write_buffer(volatile uint32_t *ctrl_base,
113113
* after pprog_cmd
114114
*/
115115
int flash_fespi(volatile uint32_t *ctrl_base, uint32_t page_size,
116-
const uint8_t *buffer, unsigned offset, uint32_t count,
116+
const uint8_t *buffer, unsigned int offset, uint32_t count,
117117
uint32_t flash_info)
118118
{
119119
int result;
@@ -163,12 +163,12 @@ int flash_fespi(volatile uint32_t *ctrl_base, uint32_t page_size,
163163
return result;
164164
}
165165

166-
static uint32_t fespi_read_reg(volatile uint32_t *ctrl_base, unsigned address)
166+
static uint32_t fespi_read_reg(volatile uint32_t *ctrl_base, unsigned int address)
167167
{
168168
return ctrl_base[address / 4];
169169
}
170170

171-
static void fespi_write_reg(volatile uint32_t *ctrl_base, unsigned address, uint32_t value)
171+
static void fespi_write_reg(volatile uint32_t *ctrl_base, unsigned int address, uint32_t value)
172172
{
173173
ctrl_base[address / 4] = value;
174174
}
@@ -188,7 +188,7 @@ static void fespi_enable_hw_mode(volatile uint32_t *ctrl_base)
188188
/* Can set bits 7:4 in result. */
189189
static int fespi_txwm_wait(volatile uint32_t *ctrl_base)
190190
{
191-
unsigned timeout = TIMEOUT;
191+
unsigned int timeout = TIMEOUT;
192192

193193
while (timeout--) {
194194
uint32_t ip = fespi_read_reg(ctrl_base, FESPI_REG_IP);
@@ -209,7 +209,7 @@ static void fespi_set_dir(volatile uint32_t *ctrl_base, bool dir)
209209
/* Can set bits 11:8 in result. */
210210
static int fespi_tx(volatile uint32_t *ctrl_base, uint8_t in)
211211
{
212-
unsigned timeout = TIMEOUT;
212+
unsigned int timeout = TIMEOUT;
213213

214214
while (timeout--) {
215215
uint32_t txfifo = fespi_read_reg(ctrl_base, FESPI_REG_TXFIFO);
@@ -224,7 +224,7 @@ static int fespi_tx(volatile uint32_t *ctrl_base, uint8_t in)
224224
/* Can set bits 15:12 in result. */
225225
static int fespi_rx(volatile uint32_t *ctrl_base, uint8_t *out)
226226
{
227-
unsigned timeout = TIMEOUT;
227+
unsigned int timeout = TIMEOUT;
228228

229229
while (timeout--) {
230230
uint32_t value = fespi_read_reg(ctrl_base, FESPI_REG_RXFIFO);
@@ -252,7 +252,7 @@ static int fespi_wip(volatile uint32_t *ctrl_base)
252252
if (result != ERROR_OK)
253253
return result | ERROR_STACK(0x20000);
254254

255-
unsigned timeout = TIMEOUT;
255+
unsigned int timeout = TIMEOUT;
256256
while (timeout--) {
257257
result = fespi_tx(ctrl_base, 0);
258258
if (result != ERROR_OK)
@@ -273,7 +273,7 @@ static int fespi_wip(volatile uint32_t *ctrl_base)
273273

274274
/* Can set bits 23:20 in result. */
275275
static int fespi_write_buffer(volatile uint32_t *ctrl_base,
276-
const uint8_t *buffer, unsigned offset, unsigned len,
276+
const uint8_t *buffer, unsigned int offset, unsigned int len,
277277
uint32_t flash_info)
278278
{
279279
int result = fespi_tx(ctrl_base, SPIFLASH_WRITE_ENABLE);
@@ -304,7 +304,7 @@ static int fespi_write_buffer(volatile uint32_t *ctrl_base,
304304
if (result != ERROR_OK)
305305
return result | ERROR_STACK(0x600000);
306306

307-
for (unsigned i = 0; i < len; i++) {
307+
for (unsigned int i = 0; i < len; i++) {
308308
result = fespi_tx(ctrl_base, buffer[i]);
309309
if (result != ERROR_OK)
310310
return result | ERROR_STACK(0x700000);

doc/openocd.texi

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,7 +2489,7 @@ This command is only available if your libusb1 is at least version 1.0.16.
24892489
Specifies the @var{serial_string} of the adapter to use.
24902490
If this command is not specified, serial strings are not checked.
24912491
Only the following adapter drivers use the serial string from this command:
2492-
arm-jtag-ew, cmsis_dap, esp_usb_jtag, ft232r, ftdi, hla (stlink, ti-icdi), jlink, kitprog, opendus,
2492+
arm-jtag-ew, cmsis_dap, esp_usb_jtag, ft232r, ftdi, hla (ti-icdi), jlink, kitprog, opendus,
24932493
openjtag, osbdm, presto, rlink, st-link, usb_blaster (ublast2), usbprog, vsllink, xds110.
24942494
@end deffn
24952495

@@ -3235,23 +3235,14 @@ version reported is V2.J21.S4.
32353235
Currently Not Supported.
32363236
@end deffn
32373237

3238-
@deffn {Config Command} {hla layout} (@option{stlink}|@option{icdi}|@option{nulink})
3238+
@deffn {Config Command} {hla layout} (@option{icdi}|@option{nulink})
32393239
Specifies the adapter layout to use.
32403240
@end deffn
32413241

32423242
@deffn {Config Command} {hla vid_pid} [vid pid]+
32433243
Pairs of vendor IDs and product IDs of the device.
32443244
@end deffn
32453245

3246-
@deffn {Config Command} {hla stlink_backend} (usb | tcp [port])
3247-
@emph{ST-Link only:} Choose between 'exclusive' USB communication (the default backend) or
3248-
'shared' mode using ST-Link TCP server (the default port is 7184).
3249-
3250-
@emph{Note:} ST-Link TCP server is a binary application provided by ST
3251-
available from @url{https://www.st.com/en/development-tools/st-link-server.html,
3252-
ST-LINK server software module}.
3253-
@end deffn
3254-
32553246
@deffn {Command} {hla command} command
32563247
Execute a custom adapter-specific command. The @var{command} string is
32573248
passed as is to the underlying adapter layout handler.
@@ -3261,9 +3252,12 @@ passed as is to the underlying adapter layout handler.
32613252
@anchor{st_link_dap_interface}
32623253
@deffn {Interface Driver} {st-link}
32633254
This is a driver that supports STMicroelectronics adapters ST-LINK/V2
3264-
(from firmware V2J24), STLINK-V3 and STLINK-V3PWR, thanks to a new API that provides
3255+
(from 2015 firmware V2J24), STLINK-V3 and STLINK-V3PWR, thanks to a new API that provides
32653256
directly access the arm ADIv5 DAP.
32663257

3258+
The older API that requires HLA transport is deprecated and will be dropped
3259+
from OpenOCD. In mean time it's still available by using @file{interface/stlink-hla.cfg}.
3260+
32673261
The new API provide access to multiple AP on the same DAP, but the
32683262
maximum number of the AP port is limited by the specific firmware version
32693263
(e.g. firmware V2J29 has 3 as maximum AP number, while V2J32 has 8).
@@ -10706,7 +10700,7 @@ baud with our custom divisor to get 12MHz)
1070610700
@item OpenOCD invocation line:
1070710701
@example
1070810702
openocd -f interface/stlink.cfg \
10709-
-c "transport select hla_swd" \
10703+
-c "transport select dapdirect_swd" \
1071010704
-f target/stm32l1.cfg \
1071110705
-c "stm32l1.tpiu configure -protocol uart" \
1071210706
-c "stm32l1.tpiu configure -traceclk 24000000 -pin-freq 12000000" \

jimtcl

Submodule jimtcl updated 110 files

src/flash/common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111
#include "common.h"
1212
#include <helper/log.h>
1313

14-
unsigned get_flash_name_index(const char *name)
14+
unsigned int get_flash_name_index(const char *name)
1515
{
1616
const char *name_index = strrchr(name, '.');
1717
if (!name_index)
1818
return 0;
1919
if (name_index[1] < '0' || name_index[1] > '9')
2020
return ~0U;
21-
unsigned requested;
21+
unsigned int requested;
2222
int retval = parse_uint(name_index + 1, &requested);
2323
/* detect parsing error by forcing past end of bank list */
2424
return (retval == ERROR_OK) ? requested : ~0U;
2525
}
2626

2727
bool flash_driver_name_matches(const char *name, const char *expected)
2828
{
29-
unsigned blen = strlen(name);
29+
unsigned int blen = strlen(name);
3030
/* only match up to the length of the driver name... */
3131
if (strncmp(name, expected, blen) != 0)
3232
return false;

src/flash/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* name provides a suffix but it does not parse as an unsigned integer,
1818
* the routine returns ~0U. This will prevent further matching.
1919
*/
20-
unsigned get_flash_name_index(const char *name);
20+
unsigned int get_flash_name_index(const char *name);
2121
/**
2222
* Attempt to match the @c expected name with the @c name of a driver.
2323
* @param name The name of the driver (from the bank's device structure).

0 commit comments

Comments
 (0)