You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(57) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(14) |
Nov
(36) |
Dec
(7) |
2007 |
Jan
(48) |
Feb
(10) |
Mar
(17) |
Apr
(8) |
May
(35) |
Jun
(28) |
Jul
(50) |
Aug
(71) |
Sep
(40) |
Oct
(19) |
Nov
(22) |
Dec
(143) |
2008 |
Jan
(184) |
Feb
(549) |
Mar
(381) |
Apr
(388) |
May
(148) |
Jun
(128) |
Jul
(502) |
Aug
(243) |
Sep
(136) |
Oct
(327) |
Nov
(252) |
Dec
(475) |
2009 |
Jan
(344) |
Feb
(185) |
Mar
(338) |
Apr
(826) |
May
(1559) |
Jun
(1429) |
Jul
(817) |
Aug
(451) |
Sep
(639) |
Oct
(935) |
Nov
(1222) |
Dec
(826) |
2010 |
Jan
(552) |
Feb
(532) |
Mar
(355) |
Apr
(206) |
May
(162) |
Jun
(203) |
Jul
(168) |
Aug
(232) |
Sep
(270) |
Oct
(259) |
Nov
(439) |
Dec
(468) |
2011 |
Jan
(224) |
Feb
(249) |
Mar
(278) |
Apr
(381) |
May
(316) |
Jun
(637) |
Jul
(544) |
Aug
(465) |
Sep
(159) |
Oct
(440) |
Nov
(139) |
Dec
|
2012 |
Jan
(204) |
Feb
(383) |
Mar
(295) |
Apr
(196) |
May
(590) |
Jun
(158) |
Jul
(167) |
Aug
(177) |
Sep
(179) |
Oct
(301) |
Nov
(144) |
Dec
(173) |
2013 |
Jan
(299) |
Feb
(120) |
Mar
(238) |
Apr
(140) |
May
(69) |
Jun
(133) |
Jul
(160) |
Aug
(107) |
Sep
(164) |
Oct
(196) |
Nov
(105) |
Dec
(74) |
2014 |
Jan
(205) |
Feb
(156) |
Mar
(175) |
Apr
(181) |
May
(162) |
Jun
(158) |
Jul
(117) |
Aug
(109) |
Sep
(148) |
Oct
(106) |
Nov
(82) |
Dec
(72) |
2015 |
Jan
(191) |
Feb
(205) |
Mar
(197) |
Apr
(163) |
May
(136) |
Jun
(36) |
Jul
(79) |
Aug
(55) |
Sep
(64) |
Oct
(146) |
Nov
(142) |
Dec
(78) |
2016 |
Jan
(65) |
Feb
(190) |
Mar
(53) |
Apr
(38) |
May
(95) |
Jun
(53) |
Jul
(58) |
Aug
(113) |
Sep
(96) |
Oct
(59) |
Nov
(136) |
Dec
(124) |
2017 |
Jan
(80) |
Feb
(109) |
Mar
(163) |
Apr
(78) |
May
(61) |
Jun
(73) |
Jul
(29) |
Aug
(47) |
Sep
(60) |
Oct
(76) |
Nov
(48) |
Dec
(35) |
2018 |
Jan
(138) |
Feb
(84) |
Mar
(109) |
Apr
(49) |
May
(24) |
Jun
(62) |
Jul
(96) |
Aug
(116) |
Sep
(53) |
Oct
(99) |
Nov
(80) |
Dec
(88) |
2019 |
Jan
(100) |
Feb
(141) |
Mar
(72) |
Apr
(174) |
May
(129) |
Jun
(102) |
Jul
(52) |
Aug
(45) |
Sep
(28) |
Oct
(43) |
Nov
(78) |
Dec
(47) |
2020 |
Jan
(113) |
Feb
(72) |
Mar
(94) |
Apr
(141) |
May
(82) |
Jun
(68) |
Jul
(125) |
Aug
(76) |
Sep
(33) |
Oct
(184) |
Nov
(61) |
Dec
(95) |
2021 |
Jan
(109) |
Feb
(77) |
Mar
(145) |
Apr
(116) |
May
(134) |
Jun
(113) |
Jul
(71) |
Aug
(118) |
Sep
(116) |
Oct
(92) |
Nov
(124) |
Dec
(68) |
2022 |
Jan
(57) |
Feb
(61) |
Mar
(57) |
Apr
(74) |
May
(86) |
Jun
(80) |
Jul
(43) |
Aug
(85) |
Sep
(120) |
Oct
(88) |
Nov
(100) |
Dec
(108) |
2023 |
Jan
(39) |
Feb
(56) |
Mar
(92) |
Apr
(81) |
May
(84) |
Jun
(72) |
Jul
(182) |
Aug
(82) |
Sep
(54) |
Oct
(68) |
Nov
(67) |
Dec
(75) |
2024 |
Jan
(79) |
Feb
(65) |
Mar
(42) |
Apr
(47) |
May
(68) |
Jun
(111) |
Jul
(43) |
Aug
(73) |
Sep
(100) |
Oct
(35) |
Nov
(100) |
Dec
(99) |
2025 |
Jan
(71) |
Feb
(68) |
Mar
(44) |
Apr
(40) |
May
(92) |
Jun
(45) |
Jul
(86) |
Aug
(60) |
Sep
(72) |
Oct
|
Nov
|
Dec
|
From: Allan M. <all...@us...> - 2025-09-29 17:21:37
|
--- **[tickets:#459] Unable to Access openocd.org from Ubuntu 22.04LTS with Firefox** **Status:** new **Milestone:** 0.12.0 **Created:** Mon Sep 29, 2025 05:21 PM UTC by Allan Macdonald **Last Updated:** Mon Sep 29, 2025 05:21 PM UTC **Owner:** nobody This is a strange one, I admit. I cannot access openocd.org from my Ubuntu PC. ~~~ $ lsb_release --all No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.5 LTS Release: 22.04 Codename: jammy $ uname -a Linux ubox 6.8.0-83-generic #83~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Sep 9 18:19:47 UTC 2 x86_64 x86_64 x86_64 GNU/Linux $ firefox --full-version Mozilla Firefox 143.0.1 20250918214338 20250918214338 $ ~~~ I also cannot access using chrome or chromium! In all cases, the error is timeout. There is probably some piece of common code that these 3 browsers all use but I wish I knew what it was and how to troubleshoot the issue. Strangely, I can ping the site and I can access the web site using lightweight browsers such as lynx, Falcon & palemoon. Plus I can access the web site using any browser on Windows and from home with any browser on my Pop OS 24.04 LTS laptop. So, its something particularly weird with my 22.04 box. I doubt this posting will get me any happiness but hope springs eternal. I am not having any problem with the openocd appliction itself. It is a wonderful program! --- Sent from sourceforge.net because ope...@li... is subscribed to https://sourceforge.net/p/openocd/tickets/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/openocd/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: <ge...@op...> - 2025-09-29 09:31:00
|
This is an automated email from Gerrit. "zapb <de...@za...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9157 -- gerrit commit 6301325c772053866f836526bd9be8a57eb2d3d0 Author: Marc Schink <de...@za...> Date: Mon Sep 29 09:16:06 2025 +0000 adapter/parport: Require device file specification Require that a device file is specified to select the parallel port. This simplifies the code and removes hard-coded device files. Also, it ensures that a device is not selected arbitrarily. In the case of multiple availables devices, this can lead to undesirable behavior. Other drivers such as 'jlink' already implement this behavior. Change-Id: I5a8fd477ef8027ce2a4cfc1e541b34c6436e321b Signed-off-by: Marc Schink <de...@za...> diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index 3fce3129d9..fb06e39b05 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -239,13 +239,8 @@ static int parport_init(void) } if (!parport_device_file) { -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - parport_device_file = strdup("/dev/ppi0"); -#else - parport_device_file = strdup("/dev/parport0"); -#endif - LOG_WARNING("No parallel port specified, using %s", parport_device_file); - LOG_WARNING("DEPRECATED! The lack of a parallel port specification is deprecated and will no longer work in the future"); + LOG_ERROR("No parallel port device file specified"); + goto init_fail; } LOG_DEBUG("Using parallel port %s", parport_device_file); -- |
From: <ka...@as...> - 2025-09-28 22:02:05
|
A got a few emails with theese subjects: Subject: [PATCH]: a796723273 adapter/parport: Drop 'write_on_exit' command Subject: [PATCH]: b8914d0f4a adapter/parport: Deprecate direct I/O support Subject: [PATCH]: 312b631b15 adapter/parport: Drop port number support Subject: [PATCH]: d40b1a5983 adapter/parport: Add device file support Subject: [PATCH]: c2920df668 tcl/interface: Remove chameleon config Subject: [PATCH]: e7cd7498fa tcl/interface: Remove flashlink config Subject: [PATCH]: b88c186a31 adapter/parport: Drop 'parport cable' command Subject: [PATCH]: 02ef01f6ff adapter/parport: Drop direct I/O support All dated: Date: Sun, 28 Sep 2025 18:26:08 +0000 (UTC) It is a little hard of you to: Deprecate direct I/O support and then directly: Drop direct I/O support Not that I particarly care about direct I/O support for parports, but it would be nice if you could send a message like "parport users can you test this, following changes needs to be done to your config, since I want to remove it in say 3 months". /// Regarding Drop 'parport cable' command Drop 'write_on_exit' command which I currently use, what can I use instead ? Regards, /Karl Hammar |
From: <ge...@op...> - 2025-09-28 18:26:27
|
This is an automated email from Gerrit. "zapb <de...@za...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9156 -- gerrit commit 312b631b150b863e9f29efdae79f3e02e0966623 Author: Marc Schink <de...@za...> Date: Sun Sep 21 19:32:35 2025 +0000 adapter/parport: Drop port number support Support for parallel port numbers has been deprecated for one release and can now be dropped. Change-Id: I7ae7b27a65077411d00a622f185344fea24f1ff8 Signed-off-by: Marc Schink <de...@za...> diff --git a/doc/openocd.texi b/doc/openocd.texi index ae434a47c7..def65c46f7 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3228,9 +3228,6 @@ The pin direction is given in the following table. @deffn {Config Command} {parport port} file Specify the device file of the parallel port device. The parallel port device file is usually @file{/dev/parportX} on Linux and @file{/dev/ppiX} on FreeBSD. - -For legacy reason, the port number @var{X} can be specified instead of the device file. -@b{Note:} Using the port number is a deprecated feature and will be removed in the future. @end deffn @deffn {Config Command} {parport toggling_time} time diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index 4f668a4013..3fce3129d9 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -345,24 +345,7 @@ COMMAND_HANDLER(parport_handle_port_command) return ERROR_FAIL; } - char *tmp; - - // We do not use the parse_xxx() or COMMAND_PARSE_xxx() functions here since - // they generate an error message if parsing fails. - char *endptr = NULL; - unsigned long port_number = strtoul(CMD_ARGV[0], &endptr, 0); - - if (*endptr == '\0' && endptr != CMD_ARGV[0]) { - LOG_WARNING("DEPRECATED! Using a port number is deprecated, use the device file instead"); - -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - tmp = alloc_printf("/dev/ppi%lu", port_number); -#else - tmp = alloc_printf("/dev/parport%lu", port_number); -#endif - } else { - tmp = strdup(CMD_ARGV[0]); - } + char *tmp = strdup(CMD_ARGV[0]); if (!tmp) { LOG_ERROR("Failed to allocate memory"); -- |
From: <ge...@op...> - 2025-09-28 18:26:25
|
This is an automated email from Gerrit. "zapb <de...@za...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9155 -- gerrit commit 02ef01f6ff5707e6c10e05859f4ddc8c42c3434a Author: Marc Schink <de...@za...> Date: Sun Aug 17 16:38:01 2025 +0000 adapter/parport: Drop direct I/O support Direct I/O support has been deprecated for one release and can now be dropped. Change-Id: I7247cbed96c52f141d55fdff0749e42250c57713 Signed-off-by: Marc Schink <de...@za...> diff --git a/doc/openocd.texi b/doc/openocd.texi index bdf90bd07d..ae434a47c7 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3231,10 +3231,6 @@ The parallel port device file is usually @file{/dev/parportX} on Linux and @file For legacy reason, the port number @var{X} can be specified instead of the device file. @b{Note:} Using the port number is a deprecated feature and will be removed in the future. - -When using direct I/O, the number is the I/O port number. -The default port number is 0x378 (LTP1). -@b{Note:} Direct I/O support is deprecated and will be removed in the future. @end deffn @deffn {Config Command} {parport toggling_time} time diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index 606b01aedc..4f668a4013 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -24,7 +24,6 @@ i386_set_ioperm((startport), (length), (enable)) #endif /* __FreeBSD__ */ -#if PARPORT_USE_PPDEV == 1 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include <dev/ppbus/ppi.h> #include <dev/ppbus/ppbconf.h> @@ -35,15 +34,6 @@ #include <linux/ppdev.h> #endif #include <sys/ioctl.h> -#else /* not PARPORT_USE_PPDEV */ -#ifndef _WIN32 -#include <sys/io.h> -#endif -#endif - -#if PARPORT_USE_GIVEIO == 1 && IS_CYGWIN == 1 -#include <windows.h> -#endif static const struct adapter_gpio_config *adapter_gpio_config; @@ -54,12 +44,7 @@ static int wait_states; // Interface variables. static uint8_t dataport_value; -#if PARPORT_USE_PPDEV == 1 static int device_handle; -#else -static unsigned long dataport; -static unsigned long statusport; -#endif // Bitmask map for the input pins. static struct { @@ -79,11 +64,7 @@ static enum bb_value parport_read(void) { int data = 0; -#if PARPORT_USE_PPDEV == 1 ioctl(device_handle, PPRSTATUS, &data); -#else - data = inb(statusport); -#endif const struct adapter_gpio_config *gpio_config = &adapter_gpio_config[ADAPTER_GPIO_IDX_TDO]; const bool tdo_state = data & input_pin_bitmask_map[gpio_config->gpio_num].mask; @@ -95,15 +76,7 @@ static void parport_write_data(void) { const uint8_t output = dataport_value; -#if PARPORT_USE_PPDEV == 1 ioctl(device_handle, PPWDATA, &output); -#else -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - outb(dataport, output); -#else - outb(output, dataport); -#endif -#endif } static bool is_gpio_configured(enum adapter_gpio_config_index gpio_index) @@ -186,34 +159,6 @@ static int parport_speed_div(int speed, int *khz) return ERROR_OK; } -#if PARPORT_USE_GIVEIO == 1 -static bool parport_get_giveio_access(void) -{ - OSVERSIONINFO version; - - version.dwOSVersionInfoSize = sizeof(version); - if (!GetVersionEx(&version)) { - errno = EINVAL; - return false; - } - - if (version.dwPlatformId != VER_PLATFORM_WIN32_NT) - return true; - - HANDLE h = CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); - - if (h == INVALID_HANDLE_VALUE) { - errno = ENODEV; - return false; - } - - CloseHandle(h); - - return true; -} -#endif - static const struct bitbang_interface parport_bitbang = { .read = &parport_read, .write = &parport_write, @@ -288,7 +233,6 @@ static int parport_init(void) set_pin_state(gpio_index, false); } -#if PARPORT_USE_PPDEV == 1 if (device_handle > 0) { LOG_ERROR("Parallel port is already open"); goto init_fail; @@ -341,37 +285,6 @@ static int parport_init(void) } #endif /* not __FreeBSD__, __FreeBSD_kernel__ */ -#else /* not PARPORT_USE_PPDEV */ - LOG_WARNING("DEPRECATED: Parallel port access with direct I/O is deprecated and support will be removed in the next release"); - - if (!parport_port) { - parport_port = 0x378; - LOG_WARNING("No parallel port specified, using default 0x378 (LPT1)"); - } - - LOG_DEBUG("Using parallel port 0x%x", parport_port); - - dataport = parport_port; - statusport = parport_port + 1; - -#if PARPORT_USE_GIVEIO == 1 - if (!parport_get_giveio_access()) { -#else /* PARPORT_USE_GIVEIO */ - if (ioperm(dataport, 3, 1) != 0) { -#endif /* PARPORT_USE_GIVEIO */ - LOG_ERROR("Missing privileges for direct I/O"); - goto init_fail; - } - - // Make sure parallel port is in right mode (clear tristate and interrupt). - #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - outb(parport_port + 2, 0x0); - #else - outb(0x0, parport_port + 2); - #endif - -#endif /* PARPORT_USE_PPDEV */ - if (parport_reset(0, 0) != ERROR_OK) goto init_fail; -- |
From: <ge...@op...> - 2025-09-28 18:26:20
|
This is an automated email from Gerrit. "zapb <de...@za...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9154 -- gerrit commit a7967232739f9483a3fbc9cf13d5baa09e384959 Author: Marc Schink <de...@za...> Date: Wed Aug 20 19:20:09 2025 +0000 adapter/parport: Drop 'write_on_exit' command The 'write_on_exit' command has been deprecated for one release and can now be dropped. The functionality can be replaced by the 'adapter gpio' subsystem. Change-Id: I11cf9afbe38fed0ab29da435b04c5365d26cab4f Signed-off-by: Marc Schink <de...@za...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 4f629ab85a..bdf90bd07d 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3237,13 +3237,6 @@ The default port number is 0x378 (LTP1). @b{Note:} Direct I/O support is deprecated and will be removed in the future. @end deffn -@deffn {Config Command} {parport write_on_exit} (@option{on}|@option{off}) -@b{Note:} This command is deprecated and will be removed in the future. -Use the command @command{adapter gpio} to configure the pin states before the adapter terminates its operation. - -Configure whether the driver sets the value specified by @command{adapter gpio} to the output pins on shutdown. -@end deffn - @deffn {Config Command} {parport toggling_time} time Configure how many nanoseconds the hardware needs to toggle TCK. The driver uses this value to obey the @command{adapter speed} configuration. diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index 642d8ba850..606b01aedc 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -414,8 +414,7 @@ static int parport_quit(void) set_pin_state(gpio_index, false); } - if (parport_write_exit_state) - parport_write_data(); + parport_write_data(); if (parport_led(false) != ERROR_OK) return ERROR_FAIL; @@ -463,18 +462,6 @@ COMMAND_HANDLER(parport_handle_port_command) return ERROR_OK; } -COMMAND_HANDLER(parport_handle_write_on_exit_command) -{ - if (CMD_ARGC != 1) - return ERROR_COMMAND_SYNTAX_ERROR; - - LOG_WARNING("DEPRECATED: 'parport write_on_exit' will be removed in the future, use the 'adapter gpio' command to configure the exit state for pins"); - - COMMAND_PARSE_ON_OFF(CMD_ARGV[0], parport_write_exit_state); - - return ERROR_OK; -} - COMMAND_HANDLER(parport_handle_toggling_time_command) { if (CMD_ARGC != 1) @@ -513,13 +500,6 @@ static const struct command_registration parport_subcommand_handlers[] = { .help = "Specify the device file of he parallel port", .usage = "file", }, - { - .name = "write_on_exit", - .handler = parport_handle_write_on_exit_command, - .mode = COMMAND_CONFIG, - .help = "Configure the driver to write a value to the parallel port on shutdown", - .usage = "('on'|'off')", - }, { .name = "toggling_time", .handler = parport_handle_toggling_time_command, -- |
From: <ge...@op...> - 2025-09-28 18:26:20
|
This is an automated email from Gerrit. "zapb <de...@za...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9152 -- gerrit commit d40b1a5983ba8594c7f66d367186d3d627ac4932 Author: Marc Schink <de...@za...> Date: Sun Aug 17 17:09:12 2025 +0000 adapter/parport: Add device file support Allow to specify the parallel port by its device file. Deprecate port number support but keep it for backward compatibility. This is one necessary step to remove direct I/O support for the parallel port driver. While at it, consistently return ERROR_JTAG_INIT_FAILED in case of a failure in parport_init(). Change-Id: Ie68087f05ece4b32ccab9d9bdfbf7e1a779e9031 Signed-off-by: Marc Schink <de...@za...> diff --git a/doc/openocd.texi b/doc/openocd.texi index e5cd907942..4f629ab85a 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3225,15 +3225,15 @@ The pin direction is given in the following table. @tab 2 @end multitable -@deffn {Config Command} {parport port} port_number -Configure the number of the parallel port. +@deffn {Config Command} {parport port} file +Specify the device file of the parallel port device. +The parallel port device file is usually @file{/dev/parportX} on Linux and @file{/dev/ppiX} on FreeBSD. -When using PPDEV to access the parallel port, use the number of the parallel port file @file{/dev/parport} (Linux) or @file{/dev/ppi} (FreeBSD). -The default port number is 0. +For legacy reason, the port number @var{X} can be specified instead of the device file. +@b{Note:} Using the port number is a deprecated feature and will be removed in the future. When using direct I/O, the number is the I/O port number. The default port number is 0x378 (LTP1). - @b{Note:} Direct I/O support is deprecated and will be removed in the future. @end deffn diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index b29562b840..89a70e9f9c 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -47,8 +47,7 @@ static const struct adapter_gpio_config *adapter_gpio_config; -static uint16_t parport_port; -static bool parport_write_exit_state; +static char *parport_device_file; static uint32_t parport_toggling_time_ns = 1000; static int wait_states; @@ -258,13 +257,13 @@ static int parport_init(void) if (gpio.gpio_num < 10 || gpio.gpio_num > 15 || gpio.gpio_num == 14) { LOG_ERROR("The '%s' signal pin must be 10, 11, 12, 13, or 15", adapter_gpio_get_name(gpio_index)); - return ERROR_FAIL; + goto init_fail; } } else { if (gpio.gpio_num < 2 || gpio.gpio_num > 9) { LOG_ERROR("The '%s' signal pin must be 2, 3, 4, 5, 6, 7, 8, or 9", adapter_gpio_get_name(gpio_index)); - return ERROR_FAIL; + goto init_fail; } } } @@ -292,35 +291,37 @@ static int parport_init(void) #if PARPORT_USE_PPDEV == 1 if (device_handle > 0) { LOG_ERROR("Parallel port is already open"); - return ERROR_JTAG_INIT_FAILED; + goto init_fail; } - char device_path[256]; - + if (!parport_device_file) { #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - snprintf(device_path, sizeof(device_path), "/dev/ppi%d", parport_port); + parport_device_file = strdup("/dev/ppi0"); #else - snprintf(device_path, sizeof(device_path), "/dev/parport%d", parport_port); -#endif /* __FreeBSD__, __FreeBSD_kernel__ */ + parport_device_file = strdup("/dev/parport0"); +#endif + LOG_WARNING("No parallel port specified, using %s", parport_device_file); + LOG_WARNING("DEPRECATED! The lack of a parallel port specification is deprecated and will no longer work in the future"); + } - LOG_DEBUG("Using parallel port %s", device_path); + LOG_DEBUG("Using parallel port %s", parport_device_file); - device_handle = open(device_path, O_WRONLY); + device_handle = open(parport_device_file, O_WRONLY); if (device_handle < 0) { int err = errno; - LOG_ERROR("Failed to open parallel port %s (errno = %d)", device_path, - err); + LOG_ERROR("Failed to open parallel port %s (errno = %d)", + parport_device_file, err); LOG_ERROR("Check whether the device exists and if you have the required access rights"); - return ERROR_JTAG_INIT_FAILED; + goto init_fail; } #if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) int retval = ioctl(device_handle, PPCLAIM); if (retval < 0) { - LOG_ERROR("Failed to claim parallel port %s", device_path); - return ERROR_JTAG_INIT_FAILED; + LOG_ERROR("Failed to claim parallel port %s", parport_device_file); + goto init_fail; } int value = PARPORT_MODE_COMPAT; @@ -328,7 +329,7 @@ static int parport_init(void) if (retval < 0) { LOG_ERROR("Cannot set compatible mode to device"); - return ERROR_JTAG_INIT_FAILED; + goto init_fail; } value = IEEE1284_MODE_COMPAT; @@ -336,7 +337,7 @@ static int parport_init(void) if (retval < 0) { LOG_ERROR("Cannot set compatible 1284 mode to device"); - return ERROR_JTAG_INIT_FAILED; + goto init_fail; } #endif /* not __FreeBSD__, __FreeBSD_kernel__ */ @@ -359,7 +360,7 @@ static int parport_init(void) if (ioperm(dataport, 3, 1) != 0) { #endif /* PARPORT_USE_GIVEIO */ LOG_ERROR("Missing privileges for direct I/O"); - return ERROR_JTAG_INIT_FAILED; + goto init_fail; } // Make sure parallel port is in right mode (clear tristate and interrupt). @@ -372,21 +373,27 @@ static int parport_init(void) #endif /* PARPORT_USE_PPDEV */ if (parport_reset(0, 0) != ERROR_OK) - return ERROR_FAIL; + goto init_fail; if (parport_write(0, 0, 0) != ERROR_OK) - return ERROR_FAIL; + goto init_fail; if (parport_led(true) != ERROR_OK) - return ERROR_FAIL; + goto init_fail; bitbang_interface = &parport_bitbang; return ERROR_OK; + +init_fail: + free(parport_device_file); + return ERROR_JTAG_INIT_FAILED; } static int parport_quit(void) { + free(parport_device_file); + // Deinitialize signal pin states. for (size_t i = 0; i < ARRAY_SIZE(all_signals); i++) { const enum adapter_gpio_config_index gpio_index = all_signals[i].gpio_index; @@ -421,13 +428,37 @@ COMMAND_HANDLER(parport_handle_port_command) if (CMD_ARGC != 1) return ERROR_COMMAND_SYNTAX_ERROR; - // Only if the port wasn't overwritten by command-line. - if (parport_port > 0) { - command_print(CMD, "The parallel port is already configured"); + if (parport_device_file) { + LOG_ERROR("The parallel port device file is already configured"); + return ERROR_FAIL; + } + + char *tmp; + + // We do not use the parse_xxx() or COMMAND_PARSE_xxx() functions here since + // they generate an error message if parsing fails. + char *endptr = NULL; + unsigned long port_number = strtoul(CMD_ARGV[0], &endptr, 0); + + if (*endptr == '\0' && endptr != CMD_ARGV[0]) { + LOG_WARNING("DEPRECATED! Using a port number is deprecated, use the device file instead"); + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + tmp = alloc_printf("/dev/ppi%lu", port_number); +#else + tmp = alloc_printf("/dev/parport%lu", port_number); +#endif + } else { + tmp = strdup(CMD_ARGV[0]); + } + + if (!tmp) { + LOG_ERROR("Failed to allocate memory"); return ERROR_FAIL; } - COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], parport_port); + free(parport_device_file); + parport_device_file = tmp; return ERROR_OK; } @@ -489,9 +520,8 @@ static const struct command_registration parport_subcommand_handlers[] = { .name = "port", .handler = parport_handle_port_command, .mode = COMMAND_CONFIG, - .help = "Configure the address of the I/O port (e.g. 0x378) " - "or the number of the '/dev/parport' (Linux) or '/dev/ppi' (FreeBSD) device used", - .usage = "port_number", + .help = "Specify the device file of he parallel port", + .usage = "file", }, { .name = "cable", -- |
From: <ge...@op...> - 2025-09-28 18:26:17
|
This is an automated email from Gerrit. "zapb <de...@za...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9150 -- gerrit commit e7cd7498fabe2efecebc2a6ef2a8a3a13813c585 Author: Marc Schink <de...@za...> Date: Mon Aug 25 15:11:06 2025 +0000 tcl/interface: Remove flashlink config Remove the configuration file, a replacement is already available. Link the old filename to the new configuration file to ensure backwards compatibility. Change-Id: I77cbd62d805b1c9b9bb8f56a823c3f6476d1a5a9 Signed-off-by: Marc Schink <de...@za...> diff --git a/tcl/file_renaming.cfg b/tcl/file_renaming.cfg index 9b5fedbb1e..79932473ea 100644 --- a/tcl/file_renaming.cfg +++ b/tcl/file_renaming.cfg @@ -21,4 +21,5 @@ set _file_renaming { board/stm32mp15x_dk2.cfg board/st/stm32mp157f-dk2.cfg board/sifive-hifive1-revb.cfg board/sifive/hifive1-rev-b.cfg interface/chameleon.cfg interface/parport/chameleon.cfg + interface/flashlink.cfg interface/parport/flashlink.cfg } diff --git a/tcl/interface/flashlink.cfg b/tcl/interface/flashlink.cfg deleted file mode 100644 index d552c50a6b..0000000000 --- a/tcl/interface/flashlink.cfg +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later - -# -# ST FlashLINK JTAG parallel cable -# -# http://www.st.com/internet/evalboard/product/94023.jsp -# http://www.st.com/stonline/products/literature/um/7889.pdf -# - -if { [info exists PARPORTADDR] } { - set _PARPORTADDR $PARPORTADDR -} else { - set _PARPORTADDR 0 -} - -adapter driver parport -parport port $_PARPORTADDR -parport cable flashlink -- |
From: <ge...@op...> - 2025-09-28 18:26:16
|
This is an automated email from Gerrit. "zapb <de...@za...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9149 -- gerrit commit c2920df6681e933085dd158e3cd97a535a88fdd5 Author: Marc Schink <de...@za...> Date: Mon Aug 25 15:09:22 2025 +0000 tcl/interface: Remove chameleon config Remove the configuration file, a replacement is already available. Link the old filename to the new configuration file to ensure backwards compatibility. Change-Id: I11361e471bb7ec277a850f956e51cd7d0fab408d Signed-off-by: Marc Schink <de...@za...> diff --git a/tcl/file_renaming.cfg b/tcl/file_renaming.cfg index 8950f6cd68..9b5fedbb1e 100644 --- a/tcl/file_renaming.cfg +++ b/tcl/file_renaming.cfg @@ -20,4 +20,5 @@ set _file_renaming { board/stm32mp13x_dk.cfg board/st/stm32mp135f-dk.cfg board/stm32mp15x_dk2.cfg board/st/stm32mp157f-dk2.cfg board/sifive-hifive1-revb.cfg board/sifive/hifive1-rev-b.cfg + interface/chameleon.cfg interface/parport/chameleon.cfg } diff --git a/tcl/interface/chameleon.cfg b/tcl/interface/chameleon.cfg deleted file mode 100644 index b73d129f02..0000000000 --- a/tcl/interface/chameleon.cfg +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later - -# -# Amontec Chameleon POD -# -# http://www.amontec.com/chameleon.shtml -# - -adapter driver parport -parport cable chameleon -- |
From: <ge...@op...> - 2025-09-28 18:26:15
|
This is an automated email from Gerrit. "zapb <de...@za...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9153 -- gerrit commit b88c186a31c2346d840587b590fbed64bbaffe16 Author: Marc Schink <de...@za...> Date: Wed Aug 20 19:18:47 2025 +0000 adapter/parport: Drop 'parport cable' command The 'parport cable' command has been deprecated for one release and can now be dropped. Change-Id: Iadfce444e769510c911a3b7c9420455baf9f4b83 Signed-off-by: Marc Schink <de...@za...> diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index 89a70e9f9c..642d8ba850 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -463,16 +463,6 @@ COMMAND_HANDLER(parport_handle_port_command) return ERROR_OK; } -// This command is only for backward compatibility and will be removed in the -// future. -COMMAND_HANDLER(parport_handle_cable_command) -{ - if (CMD_ARGC != 1) - return ERROR_COMMAND_SYNTAX_ERROR; - - return command_run_linef(CMD_CTX, "parport_select_cable %s", CMD_ARGV[0]); -} - COMMAND_HANDLER(parport_handle_write_on_exit_command) { if (CMD_ARGC != 1) @@ -523,14 +513,6 @@ static const struct command_registration parport_subcommand_handlers[] = { .help = "Specify the device file of he parallel port", .usage = "file", }, - { - .name = "cable", - .handler = parport_handle_cable_command, - .mode = COMMAND_CONFIG, - .help = "Set the layout of the parallel port cable " - "used to connect to the target", - .usage = "cable", - }, { .name = "write_on_exit", .handler = parport_handle_write_on_exit_command, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 5c466c628a..c06b7e0343 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -353,33 +353,6 @@ proc parport_port args { eval parport port $args } -lappend _telnet_autocomplete_skip parport_cable -proc parport_cable args { - echo "DEPRECATED! use 'parport cable' not 'parport_cable'" - eval parport cable $args -} - -lappend _telnet_autocomplete_skip parport_select_cable -proc parport_select_cable {cable} { - echo "DEPRECATED! Do not use 'parport cable' but use a cable configuration file in interface/parport" - - switch $cable { - "wiggler" { source [find interface/parport/wiggler.cfg] } - "wiggler2" { source [find interface/parport/wiggler2.cfg] } - "wiggler_ntrst_inverted" { source [find interface/parport/wiggler-ntrst-inverted.cfg] } - "old_amt_wiggler" { source [find interface/parport/amt-wiggler-old.cfg ] } - "arm-jtag" { source [find interface/parport/arm-jtag.cfg] } - "chameleon" { source [find interface/parport/chameleon.cfg] } - "dlc5" { source [find interface/parport/dlc5.cfg] } - "triton" { source [find interface/parport/triton.cfg] } - "lattice" { source [find interface/parport/lattice.cfg] } - "flashlink" { source [find interface/parport/flashlink.cfg] } - "altium" { source [find interface/parport/altium.cfg] } - "aspo" { source [find interface/parport/aspo.cfg] } - default { error "invalid parallel port cable '$cable'" } - } -} - lappend _telnet_autocomplete_skip parport_write_on_exit proc parport_write_on_exit args { echo "DEPRECATED! use 'parport write_on_exit' not 'parport_write_on_exit'" -- |
From: <ge...@op...> - 2025-09-28 18:26:13
|
This is an automated email from Gerrit. "zapb <de...@za...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9151 -- gerrit commit b8914d0f4a1ad3b69d659558e4234d009b3c18a6 Author: Marc Schink <de...@za...> Date: Sun Aug 17 14:11:39 2025 +0000 adapter/parport: Deprecate direct I/O support We deprecate direct I/O support in favor of ppdev for the following reasons: - Linux supports ppdev since ~2.4 (released ~24 years ago) and it is enabled by default on major distros (Ubuntu, Fedora). So it is effectively ubiquitous - FreeBSD provides no direct I/O support, so ppdev (ppi) is the only viable option - Direct I/O requires root/elevated privileges which is inadvisable - Removing direct I/O reduces build and driver complexity and yields a smaller, easier-to-maintain codebase - Supporting only ppdev allows us to simplify the codebase by using device files (e.g., /dev/parport0) instead of numeric identifiers Windows is the only rationale to keep direct I/O, but the user base appears minimal to nonexistent and no active contributors can test the Windows driver. Change-Id: Ia6d5ed6e8c5faa2a9b4919ca97c5cf9033372a64 Signed-off-by: Marc Schink <de...@za...> diff --git a/configure.ac b/configure.ac index ed26d45e12..400463c3d8 100644 --- a/configure.ac +++ b/configure.ac @@ -356,7 +356,7 @@ AC_ARG_ENABLE([parport_ppdev], AC_ARG_ENABLE([parport_giveio], AS_HELP_STRING([--enable-parport-giveio], - [Enable use of giveio for parport (for CygWin only)]), + [Enable use of giveio for parport (deprecated, for CygWin only)]), [parport_use_giveio=$enableval], [parport_use_giveio=]) AC_ARG_ENABLE([gw16012], @@ -825,6 +825,12 @@ AS_IF([test "x$build_gw16012" = "xyes"], [ AC_MSG_WARN([Gateworks GW16012 JTAG adapter is deprecated and support will be removed in the next release!]) ]) +AS_IF([test "x$parport_use_giveio" = "xyes" || test [ "x$enable_parport" != "xno" -a "x$parport_use_ppdev" = "xno"]], [ + echo + echo + AC_MSG_WARN([Parallel port access with direct I/O is deprecated and support will be removed in the next release!]) +]) + echo echo echo OpenOCD configuration summary diff --git a/doc/openocd.texi b/doc/openocd.texi index 7f7c8892fe..e5cd907942 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3233,6 +3233,8 @@ The default port number is 0. When using direct I/O, the number is the I/O port number. The default port number is 0x378 (LTP1). + +@b{Note:} Direct I/O support is deprecated and will be removed in the future. @end deffn @deffn {Config Command} {parport write_on_exit} (@option{on}|@option{off}) diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index 09e312ec28..b29562b840 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -341,6 +341,8 @@ static int parport_init(void) #endif /* not __FreeBSD__, __FreeBSD_kernel__ */ #else /* not PARPORT_USE_PPDEV */ + LOG_WARNING("DEPRECATED: Parallel port access with direct I/O is deprecated and support will be removed in the next release"); + if (!parport_port) { parport_port = 0x378; LOG_WARNING("No parallel port specified, using default 0x378 (LPT1)"); -- |
From: <ge...@op...> - 2025-09-25 15:00:29
|
This is an automated email from Gerrit. "Tomas Vanek <va...@fb...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9148 -- gerrit commit b2f79dc3bc00eeebe3c6cb5d6cfcdfa131a6983b Author: Tomas Vanek <va...@fb...> Date: Thu Sep 25 16:59:00 2025 +0200 target/cortex_m: force trustzone detection DO NOT MERGE! JUST FOR TESTING! Change-Id: I0a88ce2a6c372ddecfe4570bd300089695dc2eb7 Signed-off-by: Tomas Vanek <va...@fb...> diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index c5d668a4de..de49987084 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2560,7 +2560,8 @@ static bool cortex_m_has_tz(struct target *target) LOG_TARGET_WARNING(target, "Error reading DAUTHSTATUS register"); return false; } - return (dauthstatus & DAUTHSTATUS_SID_MASK) != 0; + //return (dauthstatus & DAUTHSTATUS_SID_MASK) != 0; + return true; } int cortex_m_set_secure(struct target *target, struct cortex_m_saved_security *ssec) -- |
From: <ge...@op...> - 2025-09-25 13:59:17
|
This is an automated email from Gerrit. "Brian Kuschak <bku...@gm...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9147 -- gerrit commit 78e0e1b20dfa2baa30c7fbc943f500c1e241a926 Author: Brian Kuschak <bku...@gm...> Date: Thu Sep 25 23:53:38 2025 +1000 jtag/drivers/cmsis_dap_tcp: fix memory leak Fix memory leak related to command handler strdup(). Change-Id: I4c47abbe157ab46736549af3601c88ba87e3c82c Signed-off-by: Brian Kuschak <bku...@gm...> diff --git a/src/jtag/drivers/cmsis_dap_tcp.c b/src/jtag/drivers/cmsis_dap_tcp.c index 8a96cd6244..4d5af80ac8 100644 --- a/src/jtag/drivers/cmsis_dap_tcp.c +++ b/src/jtag/drivers/cmsis_dap_tcp.c @@ -27,6 +27,7 @@ #include <netinet/tcp.h> #endif #include <stdbool.h> +#include <stdlib.h> #include <string.h> #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> @@ -359,6 +360,22 @@ static void cmsis_dap_tcp_cancel_all(struct cmsis_dap *dap) { } + +static void cmsis_dap_tcp_free_strdup(void) +{ + /* Called only at program termination. This function is called even if + * adapter initialization fails for some reason and the adapter driver does + * not call close. + */ + free(cmsis_dap_tcp_host); + cmsis_dap_tcp_host = NULL; + + if (cmsis_dap_tcp_port != cmsis_dap_tcp_port_default) { + free(cmsis_dap_tcp_port); + cmsis_dap_tcp_port = cmsis_dap_tcp_port_default; + } +} + COMMAND_HANDLER(cmsis_dap_handle_tcp_port) { if (CMD_ARGC != 1) @@ -372,6 +389,7 @@ COMMAND_HANDLER(cmsis_dap_handle_tcp_port) LOG_ERROR("CMSIS-DAP: out of memory"); return ERROR_FAIL; } + atexit(cmsis_dap_tcp_free_strdup); return ERROR_OK; } @@ -386,6 +404,7 @@ COMMAND_HANDLER(cmsis_dap_handle_tcp_host) LOG_ERROR("CMSIS-DAP: out of memory"); return ERROR_FAIL; } + atexit(cmsis_dap_tcp_free_strdup); return ERROR_OK; } -- |
From: <ge...@op...> - 2025-09-25 13:15:34
|
This is an automated email from Gerrit. "Alexandra Kulyatskaya <a.k...@sy...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9146 -- gerrit commit ed9a5df85dab8b9ee59f659484983a50bf5a4397 Author: Kulyatskaya Alexandra <a.k...@sy...> Date: Tue Jun 24 15:37:48 2025 +0300 target/breakpoints.c: add breakpoint intersection detection Modify the breakpoint insertion logic to include intersection detection between breakpoints. Change-Id: I294bea83b18335c2f304ddd99361872eadaaa684 Signed-off-by: Kulyatskaya Alexandra <a.k...@sy...> diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c index 54a6145caa..784d46b40f 100644 --- a/src/target/breakpoints.c +++ b/src/target/breakpoints.c @@ -36,6 +36,29 @@ static const char * const watchpoint_rw_strings[] = { /* monotonic counter/id-number for breakpoints and watch points */ static int bpwp_unique_id; +static bool is_memory_regions_intersect(target_addr_t start1, + unsigned int size1, + target_addr_t start2, + unsigned int size2) +{ + /* Two memory regions: [S1,E1] and [S2,E2] where: + * E1 = S1 + size1 - 1, E2 = S2 + size2 - 1 + * + * After normalization: + * Region 1: [0, size1 - 1] + * Region 2: [start2 - start1, (start2 - start1) + size2 - 1] + * + * Intersection cases: + * 1. Normalized region 2 wraps around 0 (unsigned overflow) + * 2. Start of normalized region 2 is within region 1 + */ + start2 -= start1; + target_addr_t end1 = size1 - 1; + target_addr_t end2 = start2 + size2 - 1; + + return start2 > end2 || start2 <= end1; +} + static int breakpoint_add_internal(struct target *target, target_addr_t address, unsigned int length, @@ -56,6 +79,13 @@ static int breakpoint_add_internal(struct target *target, address, breakpoint->unique_id); return ERROR_TARGET_DUPLICATE_BREAKPOINT; } + if (is_memory_regions_intersect(address, length, breakpoint->address, + breakpoint->length)) { + LOG_TARGET_ERROR(target, "Breakpoint intersects with another one at " TARGET_ADDR_FMT + " of length %u (BP %" PRIu32 ")", breakpoint->address, + breakpoint->length, breakpoint->unique_id); + return ERROR_TARGET_INTERSECT_BREAKPOINT; + } breakpoint_p = &breakpoint->next; breakpoint = breakpoint->next; } diff --git a/src/target/target.h b/src/target/target.h index b850b49cf3..84f9f88532 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -796,6 +796,7 @@ int target_profiling_default(struct target *target, uint32_t *samples, uint32_t #define ERROR_TARGET_SIZE_NOT_SUPPORTED (-314) #define ERROR_TARGET_PACKING_NOT_SUPPORTED (-315) #define ERROR_TARGET_HALTED_DO_RESUME (-316) /* used to workaround incorrect debug halt */ +#define ERROR_TARGET_INTERSECT_BREAKPOINT (-317) extern bool get_target_reset_nag(void); -- |
From: <ge...@op...> - 2025-09-23 17:43:39
|
This is an automated email from Gerrit. "Marek Kraus <gam...@ou...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9145 -- gerrit commit df2a7cbb3acfd7a6412659929e11fdbaabf1f1a8 Author: Marek Kraus <gam...@ou...> Date: Sat Mar 22 15:36:45 2025 +0100 tcl/target: add Bouffalo Lab BL616 chip series support Adds support for BL616 series of chips, BL616 and BL618. No flash bank support yet. BL616 in comparison with BL602-series have new architecture, using T-Head E907 RISC-V cores, instead of SiFive ones. As BL602-series, the ndmreset bit in RISC-V Debug Module does not reset the chip as it should, so we need to do it manually with registers almost the same way as in BL602. Additionally, JTAG Debug Transport Module in the chip have wrongly implemented Test-Logic-Reset state, causing automatic chain scan not working at all after initial JTAG usage. This is because Test-Logic-State do not set IR instruction to IDCODE, as it should by JTAG spec. We can fix this by getting state machine to known state and configure IR instruction manually to IDCODE. This bug was so far found in T-Head C906 and E907 IP cores. This patch was tested heavily and works reliably on BL616, BL618 and QCC74X. Change-Id: Idc80a702e817d78fc0ca925572c68d4d0c28ce4e Signed-off-by: Marek Kraus <gam...@ou...> diff --git a/tcl/target/bl616.cfg b/tcl/target/bl616.cfg new file mode 100644 index 0000000000..ee59f18508 --- /dev/null +++ b/tcl/target/bl616.cfg @@ -0,0 +1,145 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Author: Marek Kraus <gam...@ga...> + +# +# Bouffalo Labs BL616 and BL618 target +# +# Default JTAG pins: (if not changed by eFuse configuration) +# TMS - GPIO0 +# TCK - GPIO1 +# TDO - GPIO2 +# TDI - GPIO3 +# + +source [find mem_helper.tcl] + +transport select jtag + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME bl616 +} + +jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x10000b6f + +set _TARGETNAME $_CHIPNAME.cpu +target create $_TARGETNAME riscv -chain-position $_TARGETNAME + +riscv set_mem_access progbuf +riscv set_enable_virt2phys off + +$_TARGETNAME configure -work-area-phys 0x40000000 -work-area-size 0x10000 -work-area-backup 1 + +adapter speed 4000 + +# Useful functions +set dmcontrol 0x10 +set dmcontrol_dmactive [expr {1 << 0}] +set dmcontrol_haltreq [expr {1 << 31}] + +# By spec, ndmreset should reset whole chip. This implementation resets only few parts of the chip. +# CTRL_PWRON_RESET register in GLB core triggers full "power-on like" reset, so we use it instead +# for full software reset. +$_TARGETNAME configure -event reset-assert { + halt + + # To stay in BootROM until JTAG re-attaches, we are using BootROM functionality + # to force ISP mode, so BootROM looks out for external ISP communication. + + # In HBN_RSV2, set HBN_RELEASE_CORE to HBN_RELEASE_CORE_FLAG (4) + # and HBN_USER_BOOT_SEL to 1 (ISP) + mww 0x2000f108 0x44000000 + + # Switch clock to internal RC32M + # In HBN_GLB, set ROOT_CLK_SEL = 0 + mmw 0x2000f030 0x0 0x00000002 + + # In GLB_SYS_CFG0, set REG_BCLK_DIV and REG_HCLK_DIV = 0 + mmw 0x20000090 0x0 0x00FFFF00 + + # Trigger BCLK ACT pulse + # In GLB_SYS_CFG1, set BCLK_DIV_ACT_PULSE = 1 + mmw 0x20000094 0x1 0x00000001 + # In GLB_SYS_CFG1, wait for GLB_STS_BCLK_PROT_DONE to become 1 + while { [expr {[mrw 0x20000094] & 4}] == 0 } { sleep 1 } + + # In GLB_SWRST_CFG2, clear CTRL_PWRON_RESET + mmw 0x20000548 0x0 0x00000001 + + # This Software reset method resets everything, so CPU as well. + # It does that in not much good way, resulting in Debug Module being reset as well. + # This also means, that right after CPU and Debug Module are turned on, we need to + # enable Debug Module and halt CPU if needed. Additionally, we trigger this SW reset + # through program buffer access directly with DMI commands, to avoid errors printed by + # OpenOCD about unsuccessful register write. + + # In GLB_SWRST_CFG2, set CTRL_PWRON_RESET to 1 + set_reg {fp 0x20000548 s1 0x01} + riscv dmi_write 0x20 0x00942023 + riscv dmi_write 0x17 0x40000 + + # We need to wait for chip to finish reset and execute BootROM + sleep 10 + + # JTAG Debug Transport Module is reset as well, so we need to get into RUN/IDLE state + runtest 10 + + # We need to enable Debug Module and halt the CPU, so we can reset Program Counter + # and to do additional clean-ups. If reset was called without halt, resume is handled + # by reset-deassert-post event handler. + + # In Debug Module Control (dmcontrol), set dmactive to 1 and then haltreq to 1 + riscv dmi_write $::dmcontrol $::dmcontrol_dmactive + riscv dmi_write $::dmcontrol [ expr {$::dmcontrol_dmactive | $::dmcontrol_haltreq} ] +} + +$_TARGETNAME configure -event reset-deassert-post { + # Set Program Counter to start of BootROM and execute one instruction + step 0x90000000 + + # When using default JTAG pinout, BOOT pin is the same as JTAG TDO pin. + # Since after reset we set PC to start of the BootROM, + # BootROM will execute also check of BOOT pin, which will disable TDO pin, + # to check the BOOT pin state. This leads to temporary loss of JTAG access + # and causes (recoverable) errors in OpenOCD. We can bypass the BOOT pin check + # function, by forcing booting from Media/SPI Flash. + + # In HBN_RSV2, set HBN_RELEASE_CORE to HBN_RELEASE_CORE_FLAG (4) + # and HBN_USER_BOOT_SEL to 2 (Media/SPI Flash) + mww 0x2000f108 0x48000000 + + # Resume the processor if reset was triggered without halt request + if {$halt == 0} { + resume + } +} + +# According to JTAG spec (IEEE 1149.1), when chip enters "Test-Logic-Reset" state, +# the IR instruction should be set to "IDCODE" or "BYPASS" (when chip does not have IDCODE). +# This is done so automatic chain scan can detect all the chips within JTAG chain without knowing IDCODE. +# JTAG Debug Transport Module (DTM) used in this chip, developed by T-Head (formerly C-Sky) +# does not implement this, so OpenOCD can't detect the chip anymore after the IR instruction is changed. +# This workaround gets chip into known state, and manually set IR instruction to IDCODE, +# which is 0x01, standardized by RISC-V Debug Specification. +proc init_reset { mode } { + if {[using_jtag]} { + # Get JTAG SM to known state + runtest 10 + # Set IR to IDCODE + irscan $::_CHIPNAME.cpu 0x01 + jtag arp_init-reset + } +} + +proc jtag_init {} { + # Get JTAG SM to known state + runtest 10 + # Set IR to IDCODE + irscan $::_CHIPNAME.cpu 0x01 + + if {[catch {jtag arp_init} err]!=0} { + # try resetting additionally + init_reset startup + } +} -- |
From: <ge...@op...> - 2025-09-23 16:54:11
|
This is an automated email from Gerrit. "Tomas Vanek <va...@fb...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9143 -- gerrit commit 1fa033ecb95663c27993bbbb325e82810554a9a4 Author: zhefan.lv <zhe...@sp...> Date: Thu May 15 16:32:19 2025 +0800 target/riscv: fix address translation in hypervisor mode Imported from https://github.com/riscv-collab/riscv-openocd/pull/1258 address translation don't need to care hstatus.HU Checkpatch-ignore: NO_AUTHOR_SIGN_OFF Change-Id: I40a15ec17347dffaa6e663a637150dfb393471a0 Signed-off-by: Tomas Vanek <va...@fb...> diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 44a02a145f..a52e0b9237 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -3045,22 +3045,6 @@ static int riscv_mmu(struct target *target, bool *enabled) unsigned int xlen = riscv_xlen(target); if (v_mode) { - /* vsatp and hgatp registers are considered active for the - * purposes of the address-translation algorithm unless the - * effective privilege mode is U and hstatus.HU=0. */ - if (effective_mode == PRV_U) { - riscv_reg_t hstatus; - if (riscv_reg_get(target, &hstatus, GDB_REGNO_HSTATUS) != ERROR_OK) { - LOG_TARGET_ERROR(target, "Failed to read hstatus register."); - return ERROR_FAIL; - } - - if (get_field(hstatus, HSTATUS_HU) == 0) - /* In hypervisor mode regular satp translation - * doesn't happen. */ - return ERROR_OK; - } - riscv_reg_t vsatp; if (riscv_reg_get(target, &vsatp, GDB_REGNO_VSATP) != ERROR_OK) { LOG_TARGET_ERROR(target, "Failed to read vsatp register; priv=0x%" PRIx64, -- |
From: <ge...@op...> - 2025-09-23 16:54:11
|
This is an automated email from Gerrit. "Tomas Vanek <va...@fb...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9141 -- gerrit commit 67ddd8f64a6fe9d1d840158c0ee2a4b394ba984e Author: Mark Zhuang <mar...@sp...> Date: Thu May 15 14:58:07 2025 +0800 target/riscv: check nextdm address in abits range Imported from https://github.com/riscv-collab/riscv-openocd/pull/1257 When abits not correctly configured, we hope to detect it as soon as possible. Checkpatch-ignore: NO_AUTHOR_SIGN_OFF Change-Id: I0b7b170c39761fb531dda0747f88ace3f39ae03b Signed-off-by: Tomas Vanek <va...@fb...> diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 9da9684e4e..1f34cd1a30 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -538,6 +538,7 @@ static bool check_dbgbase_exists(struct target *target) { uint32_t next_dm = 0; unsigned int count = 1; + riscv013_info_t *info = get_info(target); LOG_TARGET_DEBUG(target, "Searching for DM with DMI base address (dbgbase) = 0x%x", target->dbgbase); while (1) { @@ -552,6 +553,12 @@ static bool check_dbgbase_exists(struct target *target) LOG_TARGET_ERROR(target, "Reached the end of DM chain (detected %u DMs in total).", count); break; } + if (next_dm >> info->abits) { + LOG_TARGET_ERROR(target, "The address of the next Debug Module does not fit into %u bits, " + "which is the width of the DMI bus address. This is a HW bug", + info->abits); + break; + } /* Safety: Avoid looping forever in case of buggy nextdm values in the hardware. */ if (count++ > RISCV_MAX_DMS) { LOG_TARGET_ERROR(target, "Supporting no more than %d DMs on a DMI bus. Aborting", RISCV_MAX_DMS); -- |
From: <ge...@op...> - 2025-09-23 16:54:07
|
This is an automated email from Gerrit. "Tomas Vanek <va...@fb...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9142 -- gerrit commit 557a34c8eeb26e76c8a1c3566ec9d3e5ba24fce5 Author: Sriram Shanmuga <sri...@gm...> Date: Mon Jul 7 18:17:04 2025 +0300 target/riscv: improve error messaging in case `sbasize` is zero Imported from https://github.com/riscv-collab/riscv-openocd/pull/1274 From: Sriram Shanmuga <sri...@gm...> RISC-V Debug Specification v1.0 [3.14.22. System Bus Access Control and Status (`sbcs`, at 0x38)] states in `sbasize` field description: > Width of system bus addresses in bits. (0 indicates there is no bus access support.) Before the patch, the error message did not include the information about `sbcs.sbasize` being zero wich made it quite undescriptive: ``` [riscv.cpu] Turning off memory sampling because it failed. ``` Fixes #1270 Change-Id: I5402dd57dc9a81f65ee4c67d24e11c366006427c Signed-off-by: Sriram Shanmuga <sri...@gm...> Signed-off-by: Evgeniy Naydanov <evg...@sy...> diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 1f34cd1a30..1bb123d6c7 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -2610,8 +2610,8 @@ static int sample_memory_bus_v1(struct target *target, { RISCV013_INFO(info); unsigned int sbasize = get_field(info->sbcs, DM_SBCS_SBASIZE); - if (sbasize > 64) { - LOG_TARGET_ERROR(target, "Memory sampling is only implemented for sbasize <= 64."); + if (sbasize == 0 || sbasize > 64) { + LOG_TARGET_ERROR(target, "Memory sampling is only implemented for non-zero sbasize <= 64."); return ERROR_NOT_IMPLEMENTED; } -- |
From: <ge...@op...> - 2025-09-23 16:54:07
|
This is an automated email from Gerrit. "Tomas Vanek <va...@fb...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9144 -- gerrit commit 4ed9cdfdbc11427fa133fb99535d9e4a7d8a7d14 Author: Mark Zhuang <mar...@sp...> Date: Fri May 16 11:06:10 2025 +0800 target/riscv: fix get mode filed for vsatp and hgatp Imported from https://github.com/riscv-collab/riscv-openocd/pull/1258 Add the necessary get_filed and add a comment to indicate this section is for VU/VS mode Checkpatch-ignore: NO_AUTHOR_SIGN_OFF Change-Id: I898bba6250258c5076a98eb95411fcabccc52b96 Signed-off-by: Tomas Vanek <va...@fb...> diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index a52e0b9237..895550f0ab 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -3045,6 +3045,8 @@ static int riscv_mmu(struct target *target, bool *enabled) unsigned int xlen = riscv_xlen(target); if (v_mode) { + /* In VU or VS mode, MMU is considered enabled when + * either hgatp or vsatp mode is not OFF */ riscv_reg_t vsatp; if (riscv_reg_get(target, &vsatp, GDB_REGNO_VSATP) != ERROR_OK) { LOG_TARGET_ERROR(target, "Failed to read vsatp register; priv=0x%" PRIx64, @@ -3052,7 +3054,7 @@ static int riscv_mmu(struct target *target, bool *enabled) return ERROR_FAIL; } /* vsatp is identical to satp, so we can use the satp macros. */ - if (RISCV_SATP_MODE(xlen) != SATP_MODE_OFF) { + if (get_field(vsatp, RISCV_SATP_MODE(xlen)) != SATP_MODE_OFF) { LOG_TARGET_DEBUG(target, "VS-stage translation is enabled."); *enabled = true; return ERROR_OK; @@ -3064,7 +3066,7 @@ static int riscv_mmu(struct target *target, bool *enabled) priv); return ERROR_FAIL; } - if (RISCV_HGATP_MODE(xlen) != HGATP_MODE_OFF) { + if (get_field(hgatp, RISCV_HGATP_MODE(xlen)) != HGATP_MODE_OFF) { LOG_TARGET_DEBUG(target, "G-stage address translation is enabled."); *enabled = true; } else { -- |
From: <ge...@op...> - 2025-09-23 15:42:01
|
This is an automated email from Gerrit. "Tomasz Motylewski <tom...@gm...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9140 -- gerrit commit 2366263ba5e851f12bf7164bf4a18182eb8c4260 Author: Tomasz Motylewski <tom...@gm...> Date: Tue Sep 23 17:04:16 2025 +0200 drivers/ft232r: support multichannel FTx232H chips using bitbang mode with arbitrary IO pins Add "channel" parameter to use all ports of multiport FTDI bridges. Code borrowed from ftdi.c and mpsse.c. Synchronous bitbang mode in ft232r driver works in all modern FTDI bridges and despite being less efficient, allows full flexibility in assigning functions to IOs. In addition, 4-port FTDI ICs like FT4232H support MPSSE only in the first 2 channels, which does not allow channels 2 and 3 to be used with ftdi.c interface driver. These channels may be used now with ft232r driver. Change-Id: Ifb61e83ba9454abbac819147e41da2147cd3f932 Signed-off-by: Tomasz Motylewski <tom...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 7034c049c5..2ce5ec693e 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2854,6 +2854,8 @@ For example adapter definitions, see the configuration files shipped in the This driver implements JTAG and SWD via synchronous bitbang mode of an FTDI FT232R, FT230X, FT231X and similar USB UART bridge ICs, reusing RS232 signals as GPIO. It currently doesn't support using CBUS pins as GPIO. +It should work with multiport ICs like FT2232 or FT4232 as they support the same +synchronous bitbang mode. List of connections (default physical pin numbers for FT232R in 28-pin SSOP package): @itemize @minus @@ -2878,7 +2880,7 @@ that are sometimes not used like TRST or SRST. SWD lines may share pins with JTAG lines, as the two protocols are not active simultaneously. -FT232R +FT232R, FT2232H and FT4232H bit numbers: @itemize @minus @item bit 7 - RI @item bit 6 - DCD @@ -2898,6 +2900,11 @@ The vendor ID and product ID of the adapter. If not specified, default 0x0403:0x6001 is used. @end deffn +@deffn {Config Command} {ft232r channel} channel +Selects the channel of the FTDI device to use for synchronous bitbang operations. Most +adapters use the default - channel 0, but multiport chips like FTx232 may use other channels. +@end deffn + @deffn {Config Command} {ft232r jtag_nums} @var{tck} @var{tms} @var{tdi} @var{tdo} Set four JTAG GPIO numbers at once. If not specified, default 0 3 1 2 or TXD CTS RXD RTS is used. diff --git a/src/jtag/drivers/ft232r.c b/src/jtag/drivers/ft232r.c index 94568ca32b..2e07b65c50 100644 --- a/src/jtag/drivers/ft232r.c +++ b/src/jtag/drivers/ft232r.c @@ -6,7 +6,9 @@ ***************************************************************************/ /* 2022-05: SWD support added by Michael Hough; - * strongly inspired by bcm2835gpio.c, implements bitbang.c driver + * strongly inspired by bcm2835gpio.c, implements bitbang.c driver. + * 2025-09: channel parameter added by Tomasz Motylewski + * to support FT2232 and FT4232 and possibly other multiport FTDI chips * TODO: SWD bitbang should be optimized to use block transfers, with either: * implementing that feature in bitbang.c SWD like JTAG sample() or * removing dependency on bitbang.c and implementing SWD directly here @@ -44,10 +46,10 @@ */ /* - * USB endpoints. + * USB endpoints. We write to device IN_EP and call it here usb_write_ep */ -#define IN_EP 0x02 -#define OUT_EP 0x81 +#define IN_EP usb_write_ep +#define OUT_EP usb_read_ep /* Control request types: */ #define SIO_RESET 0 /* Reset the port */ @@ -76,7 +78,11 @@ static uint16_t ft232r_vid = 0x0403; /* FTDI */ static uint16_t ft232r_pid = 0x6001; /* FT232R */ +static uint8_t ft232r_channel; /* for other FTx23x chips which have more interfaces */ static struct libusb_device_handle *adapter; +static int usb_read_ep = 0x81; +static int usb_write_ep = 0x02; +static int usb_max_packet_size = 64; // read from USB descriptor, not used yet static uint8_t *ft232r_output; static size_t ft232r_output_len; @@ -107,7 +113,6 @@ static int swclk_gpio = 7; /* Some device connectors share TMS/SDIO and TCK/SWCLK; * this is allowed in configuration. */ - static size_t ft232r_buf_size = FT232R_BUF_SIZE_EXTRA; /* 0xFFFF disables restore by default, after exit serial port will not work. @@ -126,7 +131,7 @@ static int ft232r_set_dirs(unsigned char dir_mask) return jtag_libusb_control_transfer(adapter, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT, SIO_SET_BITMODE, dir_mask | 0x0400, - 0, NULL, 0, 1000, NULL); + ft232r_channel + 1, NULL, 0, 1000, NULL); } /** @@ -154,7 +159,7 @@ static int ft232r_swd_write(int swclk, int swdio) Telling it to nuke buffer is much, much faster than actually reading. */ jtag_libusb_control_transfer(adapter, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT, - SIO_RESET, SIO_RESET_PURGE_TX, 0, NULL, 0, 1000, NULL); + SIO_RESET, SIO_RESET_PURGE_TX, ft232r_channel + 1, NULL, 0, 1000, NULL); runs = 0; } @@ -182,7 +187,7 @@ static int ft232r_swdio_read(void) jtag_libusb_control_transfer(adapter, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_IN, SIO_READ_PINS, 0, - 0, &data, 1, 1000, NULL); + ft232r_channel + 1, &data, 1, 1000, NULL); return (data & swdio_mask) != 0; } @@ -221,7 +226,7 @@ static int ft232r_send_recv(void) if (jtag_libusb_bulk_write(adapter, IN_EP, (char *) ft232r_output + total_written, bytes_to_write, 1000, &n) != ERROR_OK) { - LOG_ERROR("usb bulk write failed"); + LOG_ERROR("usb bulk write failed in send_recv"); return ERROR_JTAG_DEVICE_ERROR; } @@ -335,7 +340,7 @@ static int ft232r_speed(int divisor) if (jtag_libusb_control_transfer(adapter, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT, - SIO_SET_BAUD_RATE, divisor, 0, NULL, 0, 1000, NULL) != ERROR_OK) { + SIO_SET_BAUD_RATE, divisor, ft232r_channel + 1, NULL, 0, 1000, NULL) != ERROR_OK) { LOG_ERROR("cannot set baud rate"); return ERROR_JTAG_DEVICE_ERROR; } @@ -355,6 +360,10 @@ static struct bitbang_interface ft232r_bitbang = { static int ft232r_init(void) { + struct libusb_device_descriptor desc; + struct libusb_config_descriptor *config0; + int err; + bitbang_interface = &ft232r_bitbang; uint16_t avids[] = {ft232r_vid, 0}; @@ -367,13 +376,46 @@ static int ft232r_init(void) } LOG_DEBUG("Device found"); + err = libusb_get_device_descriptor(libusb_get_device(adapter), &desc); + if (err != LIBUSB_SUCCESS) { + LOG_ERROR("libusb_get_device_descriptor() failed with %s", libusb_error_name(err)); + libusb_close(adapter); + return ERROR_JTAG_INIT_FAILED; + } + + err = libusb_get_config_descriptor(libusb_get_device(adapter), 0, &config0); + if (err != LIBUSB_SUCCESS) { + LOG_ERROR("libusb_get_config_descriptor() failed with %s", libusb_error_name(err)); + libusb_close(adapter); + return ERROR_JTAG_INIT_FAILED; + } + + /* Make sure the first configuration is selected */ + int cfg; + err = libusb_get_configuration(adapter, &cfg); + if (err != LIBUSB_SUCCESS) { + LOG_ERROR("libusb_get_configuration() failed with %s", libusb_error_name(err)); + libusb_close(adapter); + return ERROR_JTAG_INIT_FAILED; + } + + if (desc.bNumConfigurations > 0 && cfg != config0->bConfigurationValue) { + err = libusb_set_configuration(adapter, config0->bConfigurationValue); + if (err != LIBUSB_SUCCESS) { + LOG_ERROR("libusb_set_configuration() failed with %s", libusb_error_name(err)); + libusb_close(adapter); + return ERROR_JTAG_INIT_FAILED; + } + } + if (ft232r_restore_bitmode == 0xFFFF) /* serial port will not be restored after jtag: */ - libusb_detach_kernel_driver(adapter, 0); + libusb_detach_kernel_driver(adapter, ft232r_channel); else /* serial port will be restored after jtag: */ libusb_set_auto_detach_kernel_driver(adapter, 1); /* 1: DONT_DETACH_SIO_MODULE */ - if (libusb_claim_interface(adapter, 0)) { + if (libusb_claim_interface(adapter, ft232r_channel)) { LOG_ERROR("unable to claim interface"); + libusb_close(adapter); return ERROR_JTAG_INIT_FAILED; } LOG_DEBUG("Interface claimed"); @@ -381,19 +423,49 @@ static int ft232r_init(void) /* Reset the device. */ if (jtag_libusb_control_transfer(adapter, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT, - SIO_RESET, 0, 0, NULL, 0, 1000, NULL) != ERROR_OK) { + SIO_RESET, 0, ft232r_channel + 1, NULL, 0, 1000, NULL) != ERROR_OK) { LOG_ERROR("unable to reset device"); + libusb_close(adapter); return ERROR_JTAG_INIT_FAILED; } LOG_DEBUG("Device reset"); + /* Determine maximum packet size and endpoint addresses */ + if (!(desc.bNumConfigurations > 0 && ft232r_channel < config0->bNumInterfaces + && config0->interface[ft232r_channel].num_altsetting > 0)) { + goto desc_error; +} + + const struct libusb_interface_descriptor *descriptor; + descriptor = &config0->interface[ft232r_channel].altsetting[0]; + if (descriptor->bNumEndpoints != 2) + goto desc_error; + + usb_read_ep = 0; + usb_write_ep = 0; + for (int i = 0; i < descriptor->bNumEndpoints; i++) { + if (descriptor->endpoint[i].bEndpointAddress & 0x80) { + usb_read_ep = descriptor->endpoint[i].bEndpointAddress; + usb_max_packet_size = + descriptor->endpoint[i].wMaxPacketSize; + } else { + usb_write_ep = descriptor->endpoint[i].bEndpointAddress; + } + } + + if (usb_read_ep == 0 || usb_write_ep == 0) + goto desc_error; + + libusb_free_config_descriptor(config0); + /* Sync bit bang mode. TDO is the only input to start. */ unsigned char dir_mask = ~(1 << tdo_gpio); if (ft232r_set_dirs(dir_mask) != 0) { LOG_ERROR("cannot set sync bitbang mode"); return ERROR_JTAG_INIT_FAILED; } - LOG_DEBUG("Bitbang mode enabled"); + LOG_INFO("Bitbang mode enabled channel %d read_ep 0x%02x write_ep 0x%02x maxsize %d", ft232r_channel, + usb_read_ep, usb_write_ep, usb_max_packet_size); /* Exactly 500 nsec between updates. */ unsigned int divisor = 1; @@ -407,7 +479,7 @@ static int ft232r_init(void) if (jtag_libusb_control_transfer(adapter, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT, - SIO_SET_LATENCY_TIMER, latency_timer, 0, NULL, 0, 1000, NULL) != ERROR_OK) { + SIO_SET_LATENCY_TIMER, latency_timer, ft232r_channel + 1, NULL, 0, 1000, NULL) != ERROR_OK) { LOG_ERROR("unable to set latency timer"); return ERROR_JTAG_INIT_FAILED; } @@ -421,6 +493,11 @@ static int ft232r_init(void) LOG_DEBUG("Buffer allocated"); return ERROR_OK; +desc_error: + LOG_ERROR("unrecognized USB device descriptor"); + libusb_free_config_descriptor(config0); + libusb_close(adapter); + return ERROR_JTAG_INIT_FAILED; } static int ft232r_quit(void) @@ -430,12 +507,12 @@ static int ft232r_quit(void) if (jtag_libusb_control_transfer(adapter, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT, SIO_SET_BITMODE, ft232r_restore_bitmode, - 0, NULL, 0, 1000, NULL) != ERROR_OK) { + ft232r_channel + 1, NULL, 0, 1000, NULL) != ERROR_OK) { LOG_ERROR("cannot set bitmode to restore serial port"); } } - if (libusb_release_interface(adapter, 0) != 0) + if (libusb_release_interface(adapter, ft232r_channel) != 0) LOG_ERROR("usb release interface failed"); jtag_libusb_close(adapter); @@ -516,6 +593,16 @@ COMMAND_HANDLER(ft232r_handle_vid_pid_command) return ERROR_OK; } +COMMAND_HANDLER(ft232r_handle_channel_command) +{ + if (CMD_ARGC == 1) + COMMAND_PARSE_NUMBER(u8, CMD_ARGV[0], ft232r_channel); + else + return ERROR_COMMAND_SYNTAX_ERROR; + + return ERROR_OK; +} + COMMAND_HANDLER(ft232r_handle_jtag_nums_command) { if (CMD_ARGC == 4) { @@ -695,6 +782,13 @@ static const struct command_registration ft232r_subcommand_handlers[] = { .help = "USB VID and PID of the adapter", .usage = "vid pid", }, + { + .name = "channel", + .handler = &ft232r_handle_channel_command, + .mode = COMMAND_CONFIG, + .help = "set the channel of the FTDI device that is used as JTAG/SWD", + .usage = "(0-3)", + }, { .name = "jtag_nums", .handler = ft232r_handle_jtag_nums_command, @@ -1063,5 +1157,3 @@ struct adapter_driver ft232r_adapter_driver = { .jtag_ops = &ft232r_interface, .swd_ops = &bitbang_swd, }; - - -- |
From: <Lia...@mi...> - 2025-09-23 15:03:47
|
Hi, Could I gently request a reviewer/s start looking at patch 8570 (https://review.openocd.org/c/openocd/+/8570) at their convenience please? I would like to start chipping away at any fixes that may be needed. Thank you, Liam. |
From: <ge...@op...> - 2025-09-22 15:02:24
|
This is an automated email from Gerrit. "Antonio Borneo <bor...@gm...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9139 -- gerrit commit 48c26383e3e103987a266ec008d4387e85c2639b Author: Antonio Borneo <bor...@gm...> Date: Mon Sep 22 09:53:43 2025 +0200 target: cortex_m: add comment for breakpoint of length 3 Add a comment in the breakpoint code to clarify the check for the odd breakpoint length of 3 bytes, introduced by [1]. [1]: commit 0a5e03c12aff ("cortex_m.c: Use two byte breakpoint for 32bit Thumb-2 request"). Change-Id: I024863d10078b5d9062c876aa59ccf70a81bf641 Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 83fcd4c8f3..e8163c2163 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2041,6 +2041,15 @@ int cortex_m_unset_breakpoint(struct target *target, struct breakpoint *breakpoi int cortex_m_add_breakpoint(struct target *target, struct breakpoint *breakpoint) { + /* + * GDB packets Z0 and z0 provide the 'kind' parameter that is target-specific + * and typically indicates the size in bytes of the breakpoint. + * But for 32-bit Thumb mode (Thumb-2) breakpoint, GDB provides 'kind = 3' to + * be used to derive the length information. See: + * https://sourceware.org/gdb/current/onlinedocs/gdb.html/ARM-Breakpoint-Kinds.html + * Since a four byte breakpoint could be unaligned, potentially requiring two + * memory accesses to set or remove it, always use two bytes breakpoint. + */ if (breakpoint->length == 3) { LOG_TARGET_DEBUG(target, "Using a two byte breakpoint for 32bit Thumb-2 request"); breakpoint->length = 2; -- |
From: <ge...@op...> - 2025-09-19 15:28:44
|
This is an automated email from Gerrit. "Tomas Vanek <va...@fb...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9138 -- gerrit commit 834a34edde08ee0748c2d7c35351f879356f4981 Author: Tim Newsome <ti...@si...> Date: Thu Sep 14 13:04:39 2023 -0700 gdb_server,rtos: Differentiate rtos_get_gdb_reg failing and not implemented If it fails, then pass that failure on. If it's simply not implemented, then we can fall through and try target_get_gdb_reg_list_noread(). This difference matters when the target representing the current hwthread is unavailable, but the target that is linked to the gdb connection is available. In that case we want the operation to return an error to gdb, instead of reading the register from the target that is available. Change-Id: I9c84ca556f818c5580e25ab349a34a226fcf0f43 Signed-off-by: Tim Newsome <ti...@si...> diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index 0bf1274e26..d2ffa830ff 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -600,7 +600,7 @@ int rtos_get_gdb_reg(struct connection *connection, int reg_num) free(reg_list); } - return ERROR_FAIL; + return ERROR_NOT_IMPLEMENTED; } /** Return a list of general registers. */ diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index b11f57bfac..0833eca2b2 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1429,8 +1429,13 @@ static int gdb_get_register_packet(struct connection *connection, LOG_DEBUG("-"); #endif - if ((target->rtos) && (rtos_get_gdb_reg(connection, reg_num) == ERROR_OK)) - return ERROR_OK; + if (target->rtos) { + retval = rtos_get_gdb_reg(connection, reg_num); + if (retval == ERROR_OK) + return ERROR_OK; + if (retval != ERROR_NOT_IMPLEMENTED) + return gdb_error(connection, retval); + } retval = target_get_gdb_reg_list_noread(target, ®_list, ®_list_size, REG_CLASS_ALL); -- |
From: Bryn H. <bry...@gm...> - 2025-09-19 15:26:30
|
After looking a bit deeper into the code it turns out that OpenOCD already automatically switches to SWD on startup if it is the selected transport, so this can be disregarded. Bryn Hakl |
From: <ge...@op...> - 2025-09-18 08:30:33
|
This is an automated email from Gerrit. "Brian Kuschak <bku...@gm...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9137 -- gerrit commit b54c143327b0e16a98cc46107953861d22a6b071 Author: Brian Kuschak <bku...@gm...> Date: Thu Sep 18 16:19:40 2025 +0800 tools/scripts: symbols added to camelcase.txt Two Windows symbols are camelcase. Change-Id: I2427de43e070592cf0c36c160c53c2bdfe96e524 Signed-off-by: Brian Kuschak <bku...@gm...> diff --git a/tools/scripts/camelcase.txt b/tools/scripts/camelcase.txt index 058df4d808..ad0c40d179 100644 --- a/tools/scripts/camelcase.txt +++ b/tools/scripts/camelcase.txt @@ -172,6 +172,8 @@ Sleep WaitForSingleObject WSACleanup WSAGetLastError +WSAPoll +WSASetLastError WSAStartup dwHighDateTime dwLowDateTime -- |