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

Merge commit '05ee88915520d1dd82da94a016a9374a1f3a8129' from upstream #954

Merged
merged 50 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
d8c9f66
jep106: update to revision JEP106BG May 2023
borneoa Jun 1, 2023
63f4e7c
target/ti-cjtag: make switching to JTAG more reliable
lorenz Dec 24, 2022
eebcf3c
riscv/semihosting: Fix ebreak skip on fileio mode
MarekVCodasip Jun 5, 2023
6ef7535
semihosting: improve semihosting opcode debug messages
MarekVCodasip May 30, 2023
56fd048
semihosting: fix handling of errno
MarekVCodasip Jun 1, 2023
7335fbd
tcl/board/bemicro: source cycloneiii.cfg from correct path
danselmi Jun 19, 2023
5ae0264
pld: give devices a name for referencing in scripts
danselmi Jun 3, 2023
9cb09f8
pld/xilinx: make instruction codes configurable
danselmi Apr 14, 2023
d654e52
tcl/cpld: add config files for more xilinx fpga families
danselmi Nov 17, 2022
e95f8e2
pld/gowin: add missing documentation
danselmi Jun 6, 2023
373d7ea
pld/virtex2: add program/refresh command
danselmi Apr 14, 2023
a27907a
ipdbg/pld: ipdbg can get tap and hub/ir from pld driver.
danselmi Apr 14, 2023
4a96776
jtag/stlink: add STLINK-V3PWR support
LLESTM Dec 13, 2022
1a3bd45
target/espressif: fix build issue with older gcc versions
erhankur Jul 13, 2023
659f2e0
tcl/cpld: add config files for virtex-7 devices with ir-length > 6
danselmi Apr 14, 2023
ddf5e3f
tcl/ultrascale: add more ultrascale devices
danselmi Apr 14, 2023
05da04a
flash/nor/stm32l4x: Add revision 'V' for STM32L4R/S devices
zapb-0 Jul 5, 2023
965730d
ipdbg: fix 'double free' in case of failed start
danselmi Jul 10, 2023
886d6c3
doc:usb_adapters: add lsusb dump of STLINK-V3PWR
borneoa Jul 10, 2023
c97b905
tcl/target: move Espressif shared functions to esp_common.cfg
erhankur Jun 18, 2023
d70fd7c
tcl/target: update esp32.cfg to reference shared functions in the esp…
erhankur Jun 18, 2023
93002a8
tcl/target: update esp32s2.cfg to reference shared functions in the e…
erhankur Jun 18, 2023
78daf24
tcl/target: update esp32s3.cfg to reference shared functions in the e…
erhankur Jun 18, 2023
29b0240
target/esp_xtensa: add xtensa on_halt handler
erhankur Jul 4, 2023
9fd754c
target/espressif: read entry addresses of pre-defined stub functions
erhankur Jul 3, 2023
698adc0
target/espressif: cleanup unused macro definitions
erhankur Jul 4, 2023
1107af0
tcl/interface: add Espressif builtin usb_jtag config file.
erhankur Jun 18, 2023
2c57d11
tcl/board: add esp32s3-builtin.cfg file
erhankur Jun 18, 2023
d57b244
target/arc: fix off-by-one error in arc_save_context()
artemiy-volkov Jul 5, 2023
218f6c0
target/riscv: Add null pointer check before right shift for bscan tun…
eosea Jun 22, 2023
7023deb
jtag/drivers/xds110: Fix compiler warning.
timsifive Jul 13, 2023
a510824
target: fix messages and return values of failed op because not halted
tom-van Jul 20, 2023
bab8b8c
register: refactor register_cache_invalidate()
MarekVCodasip Jun 6, 2023
a64928c
pld/virtex2: allow calling set_instr_codes and set_user_codes before …
danselmi Jul 23, 2023
2ca6d25
doc: port "0" requests any available port for usage by OpenOCD server
aap-sc Aug 1, 2023
2cd8ebf
breakpoints: use 64-bit type for watchpoint mask and value
aap-sc Jul 28, 2023
51be311
LICENSES: Add the LGPL-2.1 license
KAGA-KOKO Jun 18, 2023
3b78b5c
libusb_helper: split error and returned value
borneoa Jul 2, 2023
9c91ce8
contrib/firmware: add new adapter ANGIE's firmware/bitstream code
Jun 16, 2023
94686ee
jtag/drivers: Add new driver for ANGIE USB-JTAG Adapter
Jun 16, 2023
8774fd6
tcl/interface/ftdi: support for SIPEED RV-Debugger
gudvinr Jul 27, 2023
3c558fd
tcl: add configuration files for the ARC HSDK-4xD board
artemiy-volkov Jul 17, 2023
307a3ca
target/aarch64: add missing aarch64_poll() calls
dgoehring-ampere Jun 6, 2023
1233de5
pld: fix sparser warnings
danselmi Jul 25, 2023
c2d44c3
pld: allow calling of configuration functions before 'init'
danselmi Jul 31, 2023
3a34000
flash/nor/spi: add zetta zd25q16
picmaster Aug 3, 2023
2e60e2e
flash/nor/spi: Improve erase performance on zd25q16
picmaster Aug 4, 2023
a4b4750
efm32: drop unnecessary and incomplete checks
karlp Aug 2, 2023
05ee889
target/cortex_m: check core implementor field
karlp Aug 2, 2023
b5bd884
Merge commit '05ee88915520d1dd82da94a016a9374a1f3a8129' into from_ups…
timsifive Nov 3, 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
503 changes: 503 additions & 0 deletions LICENSES/preferred/LGPL-2.1

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ EXTRA_DIST += \
LICENSES/preferred/GFDL-1.2 \
LICENSES/preferred/gfdl-1.2.texi.readme \
LICENSES/preferred/GPL-2.0 \
LICENSES/preferred/LGPL-2.1 \
LICENSES/preferred/MIT \
LICENSES/stand-alone/GPL-3.0 \
tools/logger.pl \
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ m4_define([USB1_ADAPTERS],
[[stlink], [ST-Link Programmer], [HLADAPTER_STLINK]],
[[ti_icdi], [TI ICDI JTAG Programmer], [HLADAPTER_ICDI]],
[[ulink], [Keil ULINK JTAG Programmer], [ULINK]],
[[angie], [ANGIE Adapter], [ANGIE]],
[[usb_blaster_2], [Altera USB-Blaster II Compatible], [USB_BLASTER_2]],
[[ft232r], [Bitbang mode of FT232R based devices], [FT232R]],
[[vsllink], [Versaloon-Link JTAG Programmer], [VSLLINK]],
Expand Down
6 changes: 6 additions & 0 deletions contrib/60-openocd.rules
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", MODE="660", GROUP="plugdev",
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374f", MODE="660", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3753", MODE="660", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3754", MODE="660", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3755", MODE="660", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3757", MODE="660", GROUP="plugdev", TAG+="uaccess"

# Cypress SuperSpeed Explorer Kit
ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="0007", MODE="660", GROUP="plugdev", TAG+="uaccess"
Expand Down Expand Up @@ -222,6 +224,10 @@ ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="1106", MODE="660", GROUP="plugdev",
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", MODE="660", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1002", MODE="660", GROUP="plugdev", TAG+="uaccess"

# ANGIE USB-JTAG Adapter
ATTRS{idVendor}=="584e", ATTRS{idProduct}=="424e", MODE="660", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="584e", ATTRS{idProduct}=="4a55", MODE="660", GROUP="plugdev", TAG+="uaccess"

# Marvell Sheevaplug
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="660", GROUP="plugdev", TAG+="uaccess"

Expand Down
75 changes: 75 additions & 0 deletions contrib/firmware/angie/c/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#****************************************************************************
# File : Makefile *
# Contents : Code for NanoXplore USB-JTAG ANGIE adapter hardware. *
# Based on openULINK project by: Martin Schmoelzer. *
# Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. *
# <[email protected]> *
# <[email protected]> *
# ***************************************************************************/

# Define the name of tools.
PREFIX =

# Small Device C Compiler: http://sdcc.sourceforge.net/
CC = $(PREFIX)sdcc

# 8051 assembler, part of the SDCC software package.
AS = $(PREFIX)sdas8051

# SDCC produces quite messy Intel HEX files. This tool is be used to re-format
# those files. It is not required for the firmware download functionality in
# the OpenOCD driver, but the resulting file is smaller.
PACKIHX = $(PREFIX)packihx

# GNU binutils size. Used to print the size of the IHX file generated by SDCC.
SIZE = size

# Source and header directories.
SRC_DIR = src
INCLUDE_DIR = include

CODE_SIZE = 0x3C00
XRAM_LOC = 0x3C00
XRAM_SIZE = 0x0400

CFLAGS = --std-sdcc99 --opt-code-size --model-small
LDFLAGS = --code-loc 0x0000 --code-size $(CODE_SIZE) --xram-loc $(XRAM_LOC) \
--xram-size $(XRAM_SIZE) --iram-size 256 --model-small

# list of base object files
OBJECTS = main.rel usb.rel protocol.rel jtag.rel delay.rel USBJmpTb.rel serial.rel gpif.rel
HEADERS = $(INCLUDE_DIR)/usb.h \
$(INCLUDE_DIR)/protocol.h \
$(INCLUDE_DIR)/jtag.h \
$(INCLUDE_DIR)/delay.h \
$(INCLUDE_DIR)/reg_ezusb.h \
$(INCLUDE_DIR)/io.h \
$(INCLUDE_DIR)/serial.h \
$(INCLUDE_DIR)/fx2macros.h \
$(INCLUDE_DIR)/msgtypes.h

# Disable all built-in rules.
.SUFFIXES:

# Targets which are executed even when identically named file is present.
.PHONY: all, clean

all: angie_firmware.ihx
$(SIZE) angie_firmware.ihx

angie_firmware.ihx: $(OBJECTS)
$(CC) -mmcs51 $(LDFLAGS) -o $@ $^

# Rebuild every C module (there are only 5 of them) if any header changes.
%.rel: $(SRC_DIR)/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -mmcs51 -I$(INCLUDE_DIR) -o $@ $<

%.rel: $(SRC_DIR)/%.a51
$(AS) -lsgo $@ $<

clean:
rm -f *.asm *.lst *.rel *.rst *.sym *.ihx *.lk *.map *.mem

bin: angie_firmware.ihx
makebin -p angie_firmware.ihx angie_firmware.bin
37 changes: 37 additions & 0 deletions contrib/firmware/angie/c/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#SPDX-License-Identifier: GPL-2.0-or-later

This is the ANGIE firmware for ANGIE USB-JTAG adapter.

The main components of ANGIE adapter are:
- Cypress EZ-USB FX2 microcontroller
- Spartan-6 FPGA
- SRAM memory chip
- Pin headers for various JTAG pin assignments

To compile the firmware, the SDCC compiler package is required. Most Linux
distributions include SDCC in their official package repositories. The SDCC
source code can be found at http://sdcc.sourceforge.net/

Simply type "make hex" in the ANGIE directory to compile the firmware.
"make clean" will remove all generated files except the Intel HEX file
required for downloading the firmware to ANGIE.

Note that the EZ-USB FX2 microcontroller does not have on-chip flash,
ANGIE include on-board EEPROM memory to store the firmware program of
the FX2, but we are not going to use this method.

Instead, upon initial connection of the ANGIE adapter to the host PC
via USB, the EZ-USB FX2 core has enough intelligence to act as a
stand-alone USB device, responding to USB control requests and allowing
firmware download via a special VENDOR-type control request. Then, the
EZ-USB microcontroller simulates a disconnect and re-connect to the USB bus.
It may take up to two seconds for the host to recognize the newly connected
device before OpenOCD can proceed to execute JTAG commands. This delay is
only visible when OpenOCD first uses a blank (unconfigured) ANGIE device.

Once the firmware downloaded, the FX2 microcontroller activate its GPIF mode,
download the Spartan-6 FPGA's bitstream, program the FPGA rapidly, and switch
back to default io mode.

Once the user disconnects the ANGIE adapter, all its memory contents are lost
and the firmware & bitstream download process has to be executed again.
50 changes: 50 additions & 0 deletions contrib/firmware/angie/c/include/delay.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/****************************************************************
File : delay.h *
Contents : Delays handling header file for NanoXplore *
USB-JTAG ANGIE adapter hardware. *
Based on openULINK project code by: Martin Schmoelzer. *
Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. *
<[email protected]> *
<[email protected]> *
*****************************************************************/

#ifndef __DELAY_H
#define __DELAY_H

#include <stdint.h>

void syncdelay(uint8_t count);
void delay_5us(void);
void delay_1ms(void);
void delay_us(uint16_t delay);
void delay_ms(uint16_t delay);

#ifndef _IFREQ
#define _IFREQ 48000 /* IFCLK frequency in kHz */
#endif

/* CFREQ can be any one of: 48000, 24000, or 12000 */
#ifndef _CFREQ
#define _CFREQ 48000 /* CLKOUT frequency in kHz */
#endif

#if (_IFREQ < 5000)
#error "_IFREQ too small! Valid Range: 5000 to 48000..."
#endif

#if (_IFREQ > 48000)
#error "_IFREQ too large! Valid Range: 5000 to 48000..."
#endif

#if (_CFREQ != 48000)
#if (_CFREQ != 24000)
#if (_CFREQ != 12000)
#error "_CFREQ invalid! Valid values: 48000, 24000, 12000..."
#endif
#endif
#endif

/* Synchronization Delay formula: see TRM section 15-14 */
#define _SCYCL (3 * (_CFREQ) + 5 * (_IFREQ) - 1) / (2 * (_IFREQ))
#endif
31 changes: 31 additions & 0 deletions contrib/firmware/angie/c/include/fx2macros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */

/*
* This code was taken from the fx2lib project from this link:
* https://github.com/djmuhlestein/fx2lib
*
* Copyright (C) 2009 Ubixum, Inc.
*/

/*! \file
* Macros for simple common tasks in fx2 firmware.
* */

#ifndef FX2MACROS_H
#define FX2MACROS_H

#include "reg_ezusb.h"

typedef enum {FALSE = 0, TRUE} BOOL_VALS;

/**
* \brief Used for getting and setting the CPU clock speed.
**/
typedef enum {CLK_12M = 0, CLK_24M, CLK_48M} CLK_SPD;

/**
* \brief Evaluates to a CLK_SPD enum.
**/
#define CPUFREQ (CLK_SPD)((CPUCS & bmclkspd) >> 3)

#endif
65 changes: 65 additions & 0 deletions contrib/firmware/angie/c/include/io.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/****************************************************************************
File : io.h *
Contents : input/output declaration header file for NanoXplore *
USB-JTAG ANGIE adapter hardware. *
Based on openULINK project code by: Martin Schmoelzer. *
Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. *
<[email protected]> *
<[email protected]> *
*****************************************************************************/

#ifndef __IO_H
#define __IO_H

#include "reg_ezusb.h"

/***************************************************************************
* JTAG Signals: *
***************************************************************************
* TMS ....... Test Mode Select *
* TCK ....... Test Clock *
* TDI ....... Test Data Input (from device point of view, not JTAG *
* adapter point of view!) *
* TDO ....... Test Data Output (from device point of view, not JTAG *
* adapter point of view!) *
* TRST ...... Test Reset: Used to reset the TAP Finite State Machine *
* into the Test Logic Reset state *
* SRST ..... Chip Reset *
***************************************************************************/

/* PORT A */
/* PA0 Not Connected */
/* PA1 Not Connected */
#define PIN_RDWR_B IOA2
#define PIN_CSI_B IOA3
#define PIN_INIT_B IOA4
#define PIN_PROGRAM_B IOA5
/* PA6 Not Connected */
/* PA7 Not Connected */

/* PORT B */
#define PIN_TRST IOB0
#define PIN_TMS IOB1
#define PIN_TCK IOB2
#define PIN_TDI IOB3
#define PIN_TDO IOB4
#define PIN_SRST IOB5
/* PA6 Not Connected */
/* PA7 Not Connected */

/* JTAG Signals with direction 'OUT' on port B */
/* PIN_TDI - PIN_TCK - PIN_TMS - PIN_TRST - PIN_SRST */
#define MASK_PORTB_DIRECTION_OUT (bmbit0 | bmbit1 | bmbit2 | bmbit3 | bmbit5)

/* PORT C */ // Debug:
#define PIN_T0 IOC0
#define PIN_T1 IOC1
#define PIN_T2 IOC2
#define PIN_T3 IOC3
#define PIN_T4 IOC4
/* PC5 Not Connected */
/* PC6 Not Connected */
/* PC7 Not Connected */

#endif
31 changes: 31 additions & 0 deletions contrib/firmware/angie/c/include/jtag.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/****************************************************************************
File : jtag.h *
Contents : Jtag handling functions header file for NanoXplore *
USB-JTAG ANGIE adapter hardware. *
Based on openULINK project code by: Martin Schmoelzer. *
Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. *
<[email protected]> *
<[email protected]> *
*****************************************************************************/

#ifndef __JTAG_H
#define __JTAG_H

#include <stdint.h>

uint16_t jtag_get_signals(void);
void jtag_configure_tck_delay(uint8_t scan_in, uint8_t scan_out,
uint8_t scan_io, uint8_t tck, uint8_t tms);
void jtag_clock_tms(uint8_t count, uint8_t sequence);
void jtag_slow_clock_tms(uint8_t count, uint8_t sequence);
void jtag_set_signals(uint8_t low, uint8_t high);
void jtag_clock_tck(uint16_t count);
void jtag_slow_clock_tck(uint16_t count);
void jtag_scan_in(uint8_t out_offset, uint8_t in_offset);
void jtag_scan_out(uint8_t out_offset);
void jtag_scan_io(uint8_t out_offset, uint8_t in_offset);
void jtag_slow_scan_in(uint8_t out_offset, uint8_t in_offset);
void jtag_slow_scan_out(uint8_t out_offset);
void jtag_slow_scan_io(uint8_t out_offset, uint8_t in_offset);
#endif
Loading
Loading