Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From upstream #942

Merged
merged 51 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8d1dcf2
target/espressif: add application tracing functionality over JTAG
erhankur Aug 25, 2022
1c31f62
src/server: Fix memory leak of reg_list
Mar 31, 2023
1e6df16
rtos/linux.c: Fix Linux user space border check
Apr 2, 2023
95c2773
flash/rsl10: fix typo
zqb-all Apr 10, 2023
91bd431
pld: move file sanity checks to pld.c
danselmi Dec 14, 2022
0bb0056
target:armv8: aarch32 do not try to restore same EL
Jan 12, 2022
2096afc
aarch64: Add support for ARMv8-R
Feb 1, 2022
3dfc033
tcl/target: renesas gen3 Set target to armv8r for Cortex-R52
Jan 12, 2022
babec0f
server/ipdbg: add error checks after allocating memory
danselmi Apr 11, 2023
bb073f8
src: fix clang15 compiler warnings
erhankur Apr 1, 2023
c1dc793
target/espressif: fix clang report on use of garbage value
borneoa Apr 14, 2023
8670ad4
target/espressif: fix clang report on list use
borneoa Apr 14, 2023
d35faaa
pld: add support for lattice ecp2 and ecp3 devices
danselmi Dec 12, 2022
cf596a6
pld: add support for lattice ecp5 devices
danselmi Dec 12, 2022
e33eae3
pld: add support for lattice certus devices
danselmi Dec 12, 2022
7c6d446
pld: add support for efinix devices
danselmi Dec 12, 2022
db0609a
pld: add support for altera/intel devices
danselmi Dec 12, 2022
4b56c73
pld: add support for gowin devices
danselmi Dec 12, 2022
682f927
pld: add support for cologne chip gatemate fpgas
danselmi Feb 24, 2023
411dfa2
jtag: drivers: add static to local symbols
borneoa Apr 8, 2023
07e1ebc
jtag: drivers: with pointers, use NULL instead of 0
borneoa Apr 8, 2023
6e4000d
flash: nor: use 'ULL' suffix for long constants
borneoa Apr 8, 2023
d4fe63e
flash: nor: add static to local symbols
borneoa Apr 8, 2023
aa12142
flash: with pointers, use NULL instead of 0
borneoa Apr 8, 2023
9dc1d90
helper: util: include util.h
borneoa Apr 8, 2023
cd44c6c
helper: with pointers, use NULL instead of 0
borneoa Apr 8, 2023
314f4c6
rtos: with pointers, use NULL instead of 0
borneoa Apr 8, 2023
ea62f8e
target: use 'ULL' suffix for long constants
borneoa Apr 8, 2023
4b7dc55
target: rtt: include rtt.h
borneoa Apr 8, 2023
d771d7f
target: with pointers, use NULL instead of 0
borneoa Apr 8, 2023
57f7ce6
pld: gatemate: fix memory leak
borneoa Apr 30, 2023
dd9137d
pld/virtex2: add missing error checks
danselmi Apr 12, 2023
92c1bee
jtag: xds110: fix check on malloc() returned pointer
borneoa May 6, 2023
329b107
target: etm: fix check trace status
borneoa Apr 8, 2023
1602881
xtensa: fix build with gcc 13.1.1
borneoa May 8, 2023
599f1cf
openocd: trivial replace of jim-nvp with new nvp
borneoa Dec 26, 2022
4bf994f
jtag: rewrite command 'drscan' as COMMAND_HANDLER
borneoa Jan 2, 2023
7319eb3
jtag: rewrite command 'pathmove' as COMMAND_HANDLER
borneoa Jan 2, 2023
219412f
target: rewrite command 'arp_poll' as COMMAND_HANDLER
borneoa Mar 27, 2023
b931286
target: rewrite command 'arp_halt' as COMMAND_HANDLER
borneoa Mar 27, 2023
85b5c51
target: rewrite command 'arp_reset' as COMMAND_HANDLER
borneoa Mar 27, 2023
8d12ae7
jtag: tcl: change drscan usage to show at least one value is required
paulfertser May 2, 2023
3a4f445
jtag: tcl: show error message when attempting manual "drscan" on a by…
paulfertser May 2, 2023
ed46188
target: move in target_type.h the target_type's declaration
borneoa Apr 30, 2023
f07efff
rtos: move in rtos.h the rtos_type's declaration
borneoa Apr 30, 2023
5d77897
nand: move in driver.h the nand_flash_controller's declaration
borneoa Apr 30, 2023
20005eb
nor: move in driver.h the flash_driver's declaration
borneoa Apr 30, 2023
177bafd
pld: move in pld.h the pld_driver's declaration
borneoa Apr 30, 2023
e17fe4d
pld: validate exported functions by including its own .h
borneoa Apr 30, 2023
af08d58
Merge commit 'e17fe4db0f256ee4fb97dcfd6b9f7f55c966b190' into from_ups…
timsifive Oct 23, 2023
03fff0f
Fix build.
timsifive Oct 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/loaders/flash/rsl10/rom_launcher.S
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
.global _start
_start:
launch_program_in_rom:
// variables are already set, addres to jump is in r3
// variables are already set, address to jump is in r3
blx r3
exit:
// Wait for OpenOCD
Expand Down
119 changes: 118 additions & 1 deletion doc/openocd.texi
Original file line number Diff line number Diff line change
Expand Up @@ -8519,13 +8519,90 @@ openocd -f board/digilent_zedboard.cfg -c "init" \
@end example



@deffn {Command} {virtex2 read_stat} num
Reads and displays the Virtex-II status register (STAT)
for FPGA @var{num}.
@end deffn
@end deffn



@deffn {FPGA Driver} {lattice} [family]
The FGPA families ECP2, ECP3, ECP5, Certus and CertusPro by Lattice are supported.
This driver can be used to load the bitstream into the FPGA or read the status register and read/write the usercode register.

The option @option{family} is one of @var{ecp2 ecp3 ecp5 certus}. This is needed when the JTAG ID of the device is not known by openocd (newer NX devices).

@deffn {Command} {lattice read_status} num
Reads and displays the status register
for FPGA @var{num}.
@end deffn

@deffn {Command} {lattice read_user} num
Reads and displays the user register
for FPGA @var{num}.
@end deffn

@deffn {Command} {lattice write_user} num val
Writes the user register.
for FPGA @var{num} with value @var{val}.
@end deffn

@deffn {Command} {lattice set_preload} num length
Set the length of the register for the preload. This is needed when the JTAG ID of the device is not known by openocd (newer NX devices).
The load command for the FPGA @var{num} will use a length for the preload of @var{length}.
@end deffn
@end deffn


@deffn {FPGA Driver} {efinix}
Both families (Trion and Titanium) sold by Efinix are supported as both use the same protocol for In-System Configuration.
This driver can be used to load the bitstream into the FPGA.
@end deffn


@deffn {FPGA Driver} {intel} [@option{family}]
This driver can be used to load the bitstream into Intel (former Altera) FPGAs.
The families Cyclone III, Cyclone IV, Cyclone V, Cyclone 10, Arria II are supported.
@c Arria V and Arria 10, MAX II, MAX V, MAX10)

The option @option{family} is one of @var{cycloneiii cycloneiv cyclonev cyclone10 arriaii}.
This is needed when the JTAG ID of the device is ambiguous (same ID is used for chips in different families).

As input file format the driver supports a '.rbf' (raw bitstream file) file. The '.rbf' file can be generated
from a '.sof' file with @verb{|quartus_cpf -c blinker.sof blinker.rbf|}

Defines a new PLD device, an FPGA of the Cyclone III family, using the TAP named @verb{|cycloneiii.tap|}:
@example
pld device intel cycloneiii.tap cycloneiii
@end example

@deffn {Command} {intel set_bscan} num len
Set boundary scan register length of FPGA @var{num} to @var{len}. This is needed because the
length can vary between chips with the same JTAG ID.
@end deffn

@deffn {Command} {intel set_check_pos} num pos
Selects the position @var{pos} in the boundary-scan register. The bit at this
position is checked after loading the bitstream and must be '1', which is the case when no error occurred.
With a value of -1 for @var{pos} the check will be omitted.
@end deffn
@end deffn


@deffn {FPGA Driver} {gowin}
This driver can be used to load the bitstream into FPGAs from Gowin.
It is possible to program the SRAM. Programming the flash is not supported.
The files @verb{|.fs|} and @verb{|.bin|} generated by Gowin FPGA Designer are supported.
@end deffn


@deffn {FPGA Driver} {gatemate}
This driver can be used to load the bitstream into GateMate FPGAs form CologneChip.
The files @verb{|.bit|} and @verb{|.cfg|} both generated by p_r tool from CologneChip are supported.
@end deffn


@node General Commands
@chapter General Commands
@cindex commands
Expand Down Expand Up @@ -11370,6 +11447,46 @@ Stop current trace as started by the tracestart command.
Dump trace memory to a file.
@end deffn

@section Espressif Specific Commands

@deffn {Command} {esp apptrace} (start <destination> [<poll_period> [<trace_size> [<stop_tmo> [<wait4halt> [<skip_size>]]]]])
Starts
@uref{https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html#application-level-tracing-library, application level tracing}.
Data will be stored to specified destination. Available destinations are:
@itemize @bullet
@item @code{file://<outfile>} - Save trace logs into file.
@item @code{tcp://<host>:<port>} - Send trace logs to tcp port on specified host. OpenOCD will act as a tcp client.
@item @code{con:} - Print trace logs to the stdout.
@end itemize
Other parameters will be same for each destination.
@itemize @bullet
@item @code{poll_period} - trace data polling period in ms.
@item @code{trace_size} - maximum trace data size.
Tracing will be stopped automatically when that amount is reached.
Use "-1" to disable the limitation.
@item @code{stop_tmo} - Data reception timeout in ms.
Tracing will be stopped automatically when no data is received within that period.
@item @code{wait4halt} - if non-zero then wait for target to be halted before tracing start.
@item @code{skip_size} - amount of tracing data to be skipped before writing it to destination.
@end itemize
@end deffn

@deffn {Command} {esp apptrace} (stop)
Stops tracing started with above command.
@end deffn

@deffn {Command} {esp apptrace} (status)
Requests ongoing tracing status.
@end deffn

@deffn {Command} {esp apptrace} (dump file://<outfile>)
Dumps tracing data from target buffer. It can be useful to dump the latest data
buffered on target for post-mortem analysis. For example when target starts tracing automatically
w/o OpenOCD command and keeps only the latest data window which fit into the buffer.
@uref{https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html#application-level-tracing-library, application level tracing}.
Data will be stored to specified destination.
@end deffn

@anchor{softwaredebugmessagesandtracing}
@section Software Debug Messages and Tracing
@cindex Linux-ARM DCC support
Expand Down
20 changes: 0 additions & 20 deletions src/flash/nand/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,6 @@
#include "core.h"
#include "driver.h"

/* NAND flash controller
*/
extern struct nand_flash_controller nonce_nand_controller;
extern struct nand_flash_controller davinci_nand_controller;
extern struct nand_flash_controller lpc3180_nand_controller;
extern struct nand_flash_controller lpc32xx_nand_controller;
extern struct nand_flash_controller orion_nand_controller;
extern struct nand_flash_controller s3c2410_nand_controller;
extern struct nand_flash_controller s3c2412_nand_controller;
extern struct nand_flash_controller s3c2440_nand_controller;
extern struct nand_flash_controller s3c2443_nand_controller;
extern struct nand_flash_controller s3c6400_nand_controller;
extern struct nand_flash_controller mxc_nand_flash_controller;
extern struct nand_flash_controller imx31_nand_flash_controller;
extern struct nand_flash_controller at91sam9_nand_controller;
extern struct nand_flash_controller nuc910_nand_controller;

/* extern struct nand_flash_controller boundary_scan_nand_controller; */

static struct nand_flash_controller *nand_flash_controllers[] = {
&nonce_nand_controller,
&davinci_nand_controller,
Expand All @@ -47,7 +28,6 @@ static struct nand_flash_controller *nand_flash_controllers[] = {
&imx31_nand_flash_controller,
&at91sam9_nand_controller,
&nuc910_nand_controller,
/* &boundary_scan_nand_controller, */
NULL
};

Expand Down
15 changes: 15 additions & 0 deletions src/flash/nand/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,19 @@ typedef int (*nand_driver_walker_t)(struct nand_flash_controller *c, void *);
*/
int nand_driver_walk(nand_driver_walker_t f, void *x);

extern struct nand_flash_controller at91sam9_nand_controller;
extern struct nand_flash_controller davinci_nand_controller;
extern struct nand_flash_controller imx31_nand_flash_controller;
extern struct nand_flash_controller lpc3180_nand_controller;
extern struct nand_flash_controller lpc32xx_nand_controller;
extern struct nand_flash_controller mxc_nand_flash_controller;
extern struct nand_flash_controller nonce_nand_controller;
extern struct nand_flash_controller nuc910_nand_controller;
extern struct nand_flash_controller orion_nand_controller;
extern struct nand_flash_controller s3c2410_nand_controller;
extern struct nand_flash_controller s3c2412_nand_controller;
extern struct nand_flash_controller s3c2440_nand_controller;
extern struct nand_flash_controller s3c2443_nand_controller;
extern struct nand_flash_controller s3c6400_nand_controller;

#endif /* OPENOCD_FLASH_NAND_DRIVER_H */
2 changes: 1 addition & 1 deletion src/flash/nand/lpc32xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ static int lpc32xx_write_page_slc(struct nand_device *nand,

LOG_DEBUG("SLC write page %" PRIx32 " data=%d, oob=%d, "
"data_size=%" PRIu32 ", oob_size=%" PRIu32,
page, data != 0, oob != 0, data_size, oob_size);
page, !!data, !!oob, data_size, oob_size);

target_mem_base = pworking_area->address;
/*
Expand Down
2 changes: 0 additions & 2 deletions src/flash/nor/at91sam3.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@
#define OFFSET_EFC_FSR 8
#define OFFSET_EFC_FRR 12

extern const struct flash_driver at91sam3_flash;

static float _tomhz(uint32_t freq_hz)
{
float f;
Expand Down
2 changes: 0 additions & 2 deletions src/flash/nor/at91sam4.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@
#define OFFSET_EFC_FSR 8
#define OFFSET_EFC_FRR 12

extern const struct flash_driver at91sam4_flash;

static float _tomhz(uint32_t freq_hz)
{
float f;
Expand Down
20 changes: 10 additions & 10 deletions src/flash/nor/at91samd.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
#define SAMD_GET_DEVSEL(id) (id & 0xFF)

/* Bits to mask out lockbits in user row */
#define NVMUSERROW_LOCKBIT_MASK ((uint64_t)0x0000FFFFFFFFFFFF)
#define NVMUSERROW_LOCKBIT_MASK 0x0000FFFFFFFFFFFFULL

struct samd_part {
uint8_t id;
Expand Down Expand Up @@ -316,31 +316,31 @@ struct samd_family {
static const struct samd_family samd_families[] = {
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_D, SAMD_SERIES_20,
samd20_parts, ARRAY_SIZE(samd20_parts),
(uint64_t)0xFFFF01FFFE01FF77 },
0xFFFF01FFFE01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_D, SAMD_SERIES_21,
samd21_parts, ARRAY_SIZE(samd21_parts),
(uint64_t)0xFFFF01FFFE01FF77 },
0xFFFF01FFFE01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_D, SAMD_SERIES_09,
samd09_parts, ARRAY_SIZE(samd09_parts),
(uint64_t)0xFFFF01FFFE01FF77 },
0xFFFF01FFFE01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_D, SAMD_SERIES_10,
samd10_parts, ARRAY_SIZE(samd10_parts),
(uint64_t)0xFFFF01FFFE01FF77 },
0xFFFF01FFFE01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_D, SAMD_SERIES_11,
samd11_parts, ARRAY_SIZE(samd11_parts),
(uint64_t)0xFFFF01FFFE01FF77 },
0xFFFF01FFFE01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_L, SAMD_SERIES_21,
saml21_parts, ARRAY_SIZE(saml21_parts),
(uint64_t)0xFFFF03FFFC01FF77 },
0xFFFF03FFFC01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_L, SAMD_SERIES_22,
saml22_parts, ARRAY_SIZE(saml22_parts),
(uint64_t)0xFFFF03FFFC01FF77 },
0xFFFF03FFFC01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_C, SAMD_SERIES_20,
samc20_parts, ARRAY_SIZE(samc20_parts),
(uint64_t)0xFFFF03FFFC01FF77 },
0xFFFF03FFFC01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_C, SAMD_SERIES_21,
samc21_parts, ARRAY_SIZE(samc21_parts),
(uint64_t)0xFFFF03FFFC01FF77 },
0xFFFF03FFFC01FF77ULL },
};

struct samd_info {
Expand Down
2 changes: 1 addition & 1 deletion src/flash/nor/atsame5.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
#define SAMD_GET_DEVSEL(id) (id & 0xFF)

/* Bits to mask user row */
#define NVMUSERROW_SAM_E5_D5_MASK ((uint64_t)0x7FFF00FF3C007FFF)
#define NVMUSERROW_SAM_E5_D5_MASK 0x7FFF00FF3C007FFFULL

struct samd_part {
uint8_t id;
Expand Down
2 changes: 0 additions & 2 deletions src/flash/nor/atsamv.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
#define SAMV_PAGE_SIZE 512
#define SAMV_FLASH_BASE 0x00400000

extern const struct flash_driver atsamv_flash;

struct samv_flash_bank {
bool probed;
unsigned size_bytes;
Expand Down
72 changes: 72 additions & 0 deletions src/flash/nor/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,76 @@ struct flash_driver {
*/
const struct flash_driver *flash_driver_find_by_name(const char *name);

extern const struct flash_driver aduc702x_flash;
extern const struct flash_driver aducm360_flash;
extern const struct flash_driver ambiqmicro_flash;
extern const struct flash_driver at91sam3_flash;
extern const struct flash_driver at91sam4_flash;
extern const struct flash_driver at91sam4l_flash;
extern const struct flash_driver at91sam7_flash;
extern const struct flash_driver at91samd_flash;
extern const struct flash_driver ath79_flash;
extern const struct flash_driver atsame5_flash;
extern const struct flash_driver atsamv_flash;
extern const struct flash_driver avr_flash;
extern const struct flash_driver bluenrgx_flash;
extern const struct flash_driver cc26xx_flash;
extern const struct flash_driver cc3220sf_flash;
extern const struct flash_driver cfi_flash;
extern const struct flash_driver dsp5680xx_flash;
extern const struct flash_driver efm32_flash;
extern const struct flash_driver em357_flash;
extern const struct flash_driver esirisc_flash;
extern const struct flash_driver faux_flash;
extern const struct flash_driver fespi_flash;
extern const struct flash_driver gd32vf103_flash;
extern const struct flash_driver fm3_flash;
extern const struct flash_driver fm4_flash;
extern const struct flash_driver jtagspi_flash;
extern const struct flash_driver kinetis_flash;
extern const struct flash_driver kinetis_ke_flash;
extern const struct flash_driver lpc2000_flash;
extern const struct flash_driver lpc288x_flash;
extern const struct flash_driver lpc2900_flash;
extern const struct flash_driver lpcspifi_flash;
extern const struct flash_driver max32xxx_flash;
extern const struct flash_driver mdr_flash;
extern const struct flash_driver mrvlqspi_flash;
extern const struct flash_driver msp432_flash;
extern const struct flash_driver niietcm4_flash;
extern const struct flash_driver npcx_flash;
extern const struct flash_driver nrf51_flash;
extern const struct flash_driver nrf5_flash;
extern const struct flash_driver numicro_flash;
extern const struct flash_driver ocl_flash;
extern const struct flash_driver pic32mx_flash;
extern const struct flash_driver psoc4_flash;
extern const struct flash_driver psoc5lp_eeprom_flash;
extern const struct flash_driver psoc5lp_flash;
extern const struct flash_driver psoc5lp_nvl_flash;
extern const struct flash_driver psoc6_flash;
extern const struct flash_driver renesas_rpchf_flash;
extern const struct flash_driver rp2040_flash;
extern const struct flash_driver rsl10_flash;
extern const struct flash_driver sh_qspi_flash;
extern const struct flash_driver sim3x_flash;
extern const struct flash_driver stellaris_flash;
extern const struct flash_driver stm32f1x_flash;
extern const struct flash_driver stm32f2x_flash;
extern const struct flash_driver stm32h7x_flash;
extern const struct flash_driver stm32l4x_flash;
extern const struct flash_driver stm32lx_flash;
extern const struct flash_driver stmqspi_flash;
extern const struct flash_driver stmsmi_flash;
extern const struct flash_driver str7x_flash;
extern const struct flash_driver str9x_flash;
extern const struct flash_driver str9xpec_flash;
extern const struct flash_driver swm050_flash;
extern const struct flash_driver tms470_flash;
extern const struct flash_driver virtual_flash;
extern const struct flash_driver w600_flash;
extern const struct flash_driver xcf_flash;
extern const struct flash_driver xmc1xxx_flash;
extern const struct flash_driver xmc4xxx_flash;

#endif /* OPENOCD_FLASH_NOR_DRIVER_H */
Loading
Loading