Skip to content

Commit

Permalink
Merge up to a168c63 from upstream
Browse files Browse the repository at this point in the history
There was a bunch of conflicts due to commit
297844c ("target: Use 'bool' data type
in target_{step,resume}")

Resolved by updating the corresponding data types throughout the
codebase.

Change-Id: I9574deeda754b2843b69b4afe80b293d4b357ddd
Signed-off-by: Evgeniy Naydanov <[email protected]>
  • Loading branch information
en-sc committed Mar 5, 2025
2 parents fa7e235 + a168c63 commit 8c82210
Show file tree
Hide file tree
Showing 62 changed files with 661 additions and 393 deletions.
13 changes: 8 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,19 @@ m4_define([USB1_ADAPTERS],
[[ft232r], [Bitbang mode of FT232R based devices], [FT232R]],
[[vsllink], [Versaloon-Link JTAG Programmer], [VSLLINK]],
[[xds110], [TI XDS110 Debug Probe], [XDS110]],
[[cmsis_dap_v2], [CMSIS-DAP v2 Compliant Debugger], [CMSIS_DAP_USB]],
[[osbdm], [OSBDM (JTAG only) Programmer], [OSBDM]],
[[opendous], [eStick/opendous JTAG Programmer], [OPENDOUS]],
[[armjtagew], [Olimex ARM-JTAG-EW Programmer], [ARMJTAGEW]],
[[rlink], [Raisonance RLink JTAG Programmer], [RLINK]],
[[usbprog], [USBProg JTAG Programmer], [USBPROG]],
[[esp_usb_jtag], [Espressif JTAG Programmer], [ESP_USB_JTAG]]])
[[esp_usb_jtag], [Espressif JTAG Programmer], [ESP_USB_JTAG]],
[[cmsis_dap_v2], [CMSIS-DAP v2 compliant dongle (USB bulk)], [CMSIS_DAP_USB]]])

# Please keep cmsis_dap_v2 the last in USB1_ADAPTERS
# and cmsis_dap the first in HIDAPI_ADAPTERS

m4_define([HIDAPI_ADAPTERS],
[[[cmsis_dap], [CMSIS-DAP Compliant Debugger], [CMSIS_DAP_HID]],
[[[cmsis_dap], [CMSIS-DAP v1 compliant dongle (HID)], [CMSIS_DAP_HID]],
[[nulink], [Nu-Link Programmer], [HLADAPTER_NULINK]]])

m4_define([HIDAPI_USB1_ADAPTERS],
Expand Down Expand Up @@ -879,7 +882,7 @@ AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
echo
echo
echo OpenOCD configuration summary
echo --------------------------------------------------
echo ---------------------------------------------------
m4_foreach([adapter], [USB1_ADAPTERS,
HIDAPI_ADAPTERS, HIDAPI_USB1_ADAPTERS, LIBFTDI_ADAPTERS,
LIBFTDI_USB1_ADAPTERS,
Expand All @@ -890,7 +893,7 @@ m4_foreach([adapter], [USB1_ADAPTERS,
DUMMY_ADAPTER,
OPTIONAL_LIBRARIES,
COVERAGE],
[s=m4_format(["%-40s"], ADAPTER_DESC([adapter]))
[s=m4_format(["%-41s"], ADAPTER_DESC([adapter]))
AS_CASE([$ADAPTER_VAR([adapter])],
[auto], [
echo "$s"yes '(auto)'
Expand Down
5 changes: 0 additions & 5 deletions src/flash/nor/rsl10.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ static int rsl10_get_probed_chip_if_halted(struct flash_bank *bank, struct rsl10

static int rsl10_protect_check(struct flash_bank *bank)
{
struct rsl10_bank *nbank = bank->driver_priv;
struct rsl10_info *chip = nbank->chip;

assert(chip);

uint32_t status;

int retval = target_read_u32(bank->target, RSL10_FLASH_REG_IF_STATUS, &status);
Expand Down
49 changes: 41 additions & 8 deletions src/helper/jep106.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

/*
* The manufacturer's standard identification code list appears in JEP106.
* Copyright (c) 2024 JEDEC. All rights reserved.
* Copyright (c) 2025 JEDEC. All rights reserved.
*
* JEP106 is regularly updated. For the current manufacturer's standard
* identification code list, please visit the JEDEC website at www.jedec.org .
*/

/* This file is aligned to revision JEP106BK September 2024. */
/* This file is aligned to revision JEP106BL February 2025. */

[0][0x01 - 1] = "AMD",
[0][0x02 - 1] = "AMI",
[0][0x03 - 1] = "Fairchild",
[0][0x04 - 1] = "Fujitsu",
[0][0x04 - 1] = "RAMXEED Limited",
[0][0x05 - 1] = "GTE",
[0][0x06 - 1] = "Harris",
[0][0x07 - 1] = "Hitachi",
Expand Down Expand Up @@ -1373,7 +1373,7 @@
[10][0x65 - 1] = "Esperanto Technologies",
[10][0x66 - 1] = "JinSheng Electronic (Shenzhen) Co Ltd",
[10][0x67 - 1] = "Shenzhen Shi Bolunshuai Technology",
[10][0x68 - 1] = "Shanghai Rui Xuan Information Tech",
[10][0x68 - 1] = "Shanghai Ruixuan Information Tech",
[10][0x69 - 1] = "Fraunhofer IIS",
[10][0x6a - 1] = "Kandou Bus SA",
[10][0x6b - 1] = "Acer",
Expand Down Expand Up @@ -1745,7 +1745,7 @@
[13][0x5f - 1] = "Guangdong OPPO Mobile Telecommunication",
[13][0x60 - 1] = "Akeana",
[13][0x61 - 1] = "Lyczar",
[13][0x62 - 1] = "Shenzhen Qiji Technology Co Ltd",
[13][0x62 - 1] = "QJTEK",
[13][0x63 - 1] = "Shenzhen Shangzhaoyuan Technology",
[13][0x64 - 1] = "Han Stor",
[13][0x65 - 1] = "China Micro Semicon Co., Ltd.",
Expand Down Expand Up @@ -1893,7 +1893,7 @@
[14][0x75 - 1] = "HOGE Technology Co Ltd",
[14][0x76 - 1] = "United Micro Technology (Shenzhen) Co",
[14][0x77 - 1] = "Fabric of Truth Inc",
[14][0x78 - 1] = "Epitech",
[14][0x78 - 1] = "Elpitech",
[14][0x79 - 1] = "Elitestek",
[14][0x7a - 1] = "Cornelis Networks Inc",
[14][0x7b - 1] = "WingSemi Technologies Co Ltd",
Expand All @@ -1916,7 +1916,7 @@
[15][0x0e - 1] = "Shenzhen Ranshuo Technology Co Limited",
[15][0x0f - 1] = "ScaleFlux",
[15][0x10 - 1] = "XC Memory",
[15][0x11 - 1] = "Guangzhou Beimu Technology Co., Ltd",
[15][0x11 - 1] = "Guangzhou Beimu Technology Co Ltd",
[15][0x12 - 1] = "Rays Semiconductor Nanjing Co Ltd",
[15][0x13 - 1] = "Milli-Centi Intelligence Technology Jiangsu",
[15][0x14 - 1] = "Zilia Technologies",
Expand All @@ -1925,7 +1925,7 @@
[15][0x17 - 1] = "Nanjing Houmo Technology Co Ltd",
[15][0x18 - 1] = "Suzhou Yige Technology Co Ltd",
[15][0x19 - 1] = "Shenzhen Techwinsemi Technology Co Ltd",
[15][0x1a - 1] = "Pure Array Technology (Shanghai) Co. Ltd",
[15][0x1a - 1] = "Pure Array Technology (Shanghai) Co Ltd",
[15][0x1b - 1] = "Shenzhen Techwinsemi Technology Udstore",
[15][0x1c - 1] = "RISE MODE",
[15][0x1d - 1] = "NEWREESTAR",
Expand Down Expand Up @@ -2016,4 +2016,37 @@
[15][0x72 - 1] = "KEYSOM",
[15][0x73 - 1] = "Shenzhen YYF Info Tech Co Ltd",
[15][0x74 - 1] = "Sharetronics Data Technology Co Ltd",
[15][0x75 - 1] = "AptCore Limited",
[15][0x76 - 1] = "Uchampion Semiconductor Co Ltd",
[15][0x77 - 1] = "YCT Semiconductor",
[15][0x78 - 1] = "FADU Inc",
[15][0x79 - 1] = "Hefei CLT Microelectronics Co LTD",
[15][0x7a - 1] = "Smart Technologies (BD) Ltd",
[15][0x7b - 1] = "Zhangdian District Qunyuan Computer Firm",
[15][0x7c - 1] = "Silicon Xpandas Electronics Co Ltd",
[15][0x7d - 1] = "PC Components Y Multimedia S",
[15][0x7e - 1] = "Shenzhen Tanlr Technology Group Co Ltd",
[16][0x01 - 1] = "Shenzhen JIEQING Technology Co Ltd",
[16][0x02 - 1] = "Orionix",
[16][0x03 - 1] = "JoulWatt Technology Co Ltd",
[16][0x04 - 1] = "Tenstorrent",
[16][0x05 - 1] = "Unis Flash Memory Technology (Chengdu)",
[16][0x06 - 1] = "Huatu Stars",
[16][0x07 - 1] = "Ardor Gaming",
[16][0x08 - 1] = "QuanZhou KunFang Semiconductor Co Ltd",
[16][0x09 - 1] = "EIAI PLANET",
[16][0x0a - 1] = "Ningbo Lingkai Semiconductor Technology Inc",
[16][0x0b - 1] = "Shenzhen Hancun Technology Co Ltd",
[16][0x0c - 1] = "Hongkong Manyi Technology Co Limited",
[16][0x0d - 1] = "Shenzhen Storgon Technology Co Ltd",
[16][0x0e - 1] = "YUNTU Microelectronics",
[16][0x0f - 1] = "Essencore",
[16][0x10 - 1] = "Shenzhen Xingyun Lianchuang Computer Tech",
[16][0x11 - 1] = "ShenZhen Aoscar Digital Tech Co Ltd",
[16][0x12 - 1] = "XOC Technologies Inc",
[16][0x13 - 1] = "BOS Semiconductors",
[16][0x14 - 1] = "Eliyan Corp",
[16][0x15 - 1] = "Hangzhou Lishu Technology Co Ltd",
[16][0x16 - 1] = "Tier IV Inc",
[16][0x17 - 1] = "Wuhan Xuanluzhe Network Technology Co",
/* EOF */
68 changes: 44 additions & 24 deletions src/jtag/drivers/cmsis_dap.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,22 @@
#include "cmsis_dap.h"
#include "libusb_helper.h"

static const struct cmsis_dap_backend *const cmsis_dap_backends[] = {
#if BUILD_CMSIS_DAP_USB == 1
&cmsis_dap_usb_backend,
/* Create a dummy backend for 'backend' command if real one does not build */
#if BUILD_CMSIS_DAP_USB == 0
const struct cmsis_dap_backend cmsis_dap_usb_backend = {
.name = "usb_bulk",
};
#endif

#if BUILD_CMSIS_DAP_HID == 1
&cmsis_dap_hid_backend,
#if BUILD_CMSIS_DAP_HID == 0
const struct cmsis_dap_backend cmsis_dap_hid_backend = {
.name = "hid"
};
#endif

static const struct cmsis_dap_backend *const cmsis_dap_backends[] = {
&cmsis_dap_usb_backend,
&cmsis_dap_hid_backend,
};

/* USB Config */
Expand Down Expand Up @@ -261,26 +269,32 @@ static int cmsis_dap_open(void)
return ERROR_FAIL;
}

int retval = ERROR_FAIL;
if (cmsis_dap_backend >= 0) {
/* Use forced backend */
backend = cmsis_dap_backends[cmsis_dap_backend];
if (backend->open(dap, cmsis_dap_vid, cmsis_dap_pid, adapter_get_required_serial()) != ERROR_OK)
backend = NULL;
if (backend->open)
retval = backend->open(dap, cmsis_dap_vid, cmsis_dap_pid, adapter_get_required_serial());
else
LOG_ERROR("Requested CMSIS-DAP backend is disabled by configure");

} else {
/* Try all backends */
for (unsigned int i = 0; i < ARRAY_SIZE(cmsis_dap_backends); i++) {
backend = cmsis_dap_backends[i];
if (backend->open(dap, cmsis_dap_vid, cmsis_dap_pid, adapter_get_required_serial()) == ERROR_OK)
if (!backend->open)
continue;

retval = backend->open(dap, cmsis_dap_vid, cmsis_dap_pid, adapter_get_required_serial());
if (retval == ERROR_OK)
break;
else
backend = NULL;
}
}

if (!backend) {
if (retval != ERROR_OK) {
LOG_ERROR("unable to find a matching CMSIS-DAP device");
free(dap);
return ERROR_FAIL;
return retval;
}

dap->backend = backend;
Expand All @@ -293,7 +307,8 @@ static int cmsis_dap_open(void)
static void cmsis_dap_close(struct cmsis_dap *dap)
{
if (dap->backend) {
dap->backend->close(dap);
if (dap->backend->close)
dap->backend->close(dap);
dap->backend = NULL;
}

Expand Down Expand Up @@ -2192,22 +2207,27 @@ COMMAND_HANDLER(cmsis_dap_handle_vid_pid_command)

COMMAND_HANDLER(cmsis_dap_handle_backend_command)
{
if (CMD_ARGC == 1) {
if (strcmp(CMD_ARGV[0], "auto") == 0) {
cmsis_dap_backend = -1; /* autoselect */
} else {
for (unsigned int i = 0; i < ARRAY_SIZE(cmsis_dap_backends); i++) {
if (strcasecmp(cmsis_dap_backends[i]->name, CMD_ARGV[0]) == 0) {
if (CMD_ARGC != 1)
return ERROR_COMMAND_SYNTAX_ERROR;

if (strcmp(CMD_ARGV[0], "auto") == 0) {
cmsis_dap_backend = -1; /* autoselect */
} else {
for (unsigned int i = 0; i < ARRAY_SIZE(cmsis_dap_backends); i++) {
if (strcasecmp(cmsis_dap_backends[i]->name, CMD_ARGV[0]) == 0) {
if (cmsis_dap_backends[i]->open) {
cmsis_dap_backend = i;
return ERROR_OK;
}
}

command_print(CMD, "invalid backend argument to cmsis-dap backend <backend>");
return ERROR_COMMAND_ARGUMENT_INVALID;
command_print(CMD, "Requested cmsis-dap backend %s is disabled by configure",
cmsis_dap_backends[i]->name);
return ERROR_NOT_IMPLEMENTED;
}
}
} else {
return ERROR_COMMAND_SYNTAX_ERROR;

command_print(CMD, "invalid argument %s to cmsis-dap backend", CMD_ARGV[0]);
return ERROR_COMMAND_ARGUMENT_INVALID;
}

return ERROR_OK;
Expand Down
14 changes: 13 additions & 1 deletion src/jtag/drivers/linuxspidev.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,20 @@ static int spidev_init(void)
return ERROR_JTAG_INIT_FAILED;
}

int ret;
// Set SPI mode.
int ret = ioctl(spi_fd, SPI_IOC_WR_MODE32, &spi_mode);
#ifdef SPI_IOC_WR_MODE32
ret = ioctl(spi_fd, SPI_IOC_WR_MODE32, &spi_mode);
#else
// Linux pre 3.15 does not support MODE32, use 8-bit ioctl
if (spi_mode & ~0xff) {
LOG_ERROR("SPI mode 0x%" PRIx32 ", system permits 8 bits only", spi_mode);
return ERROR_JTAG_INIT_FAILED;
}

uint8_t mode = (uint8_t)spi_mode;
ret = ioctl(spi_fd, SPI_IOC_WR_MODE, &mode);
#endif
if (ret == -1) {
LOG_ERROR("Failed to set SPI mode 0x%" PRIx32, spi_mode);
return ERROR_JTAG_INIT_FAILED;
Expand Down
10 changes: 5 additions & 5 deletions src/rtos/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ noinst_LTLIBRARIES += %D%/librtos.la
%D%/rtos_ucos_iii_stackings.c \
%D%/rtos_riot_stackings.c \
%D%/rtos_nuttx_stackings.c \
%D%/FreeRTOS.c \
%D%/ThreadX.c \
%D%/eCos.c \
%D%/freertos.c \
%D%/threadx.c \
%D%/ecos.c \
%D%/linux.c \
%D%/chibios.c \
%D%/chromium-ec.c \
%D%/embKernel.c \
%D%/embkernel.c \
%D%/mqx.c \
%D%/uCOS-III.c \
%D%/ucos_iii.c \
%D%/nuttx.c \
%D%/rtkernel.c \
%D%/hwthread.c \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8c82210

Please sign in to comment.