target: generalize the registry to FPGAs + CPUs, add program dispatch
Restructure in anticipation of programming ARM CPUs (ARM7/9 via EmbeddedICE, e.g. over an Olimex ARM-USB-OCD); FPGA path unchanged. - modules/fpga -> modules/target; fpga_target -> jtag_target with a `kind` (fpga|cpu) and grouped fpga/cpu sub-structs; data/targets.yaml (env BS_TARGETS); API target_*; commands target_list/target_info (kind-aware). Add arm7/arm9 families, arm_flash prog, embeddedice debug, and cpu fields (ram_base/size, flash_base/size). - new program/: `program <dev> <file>` dispatches by the target's prog (svf wired; proxy_spi points at the flash workflow; arm_flash -> arm_debug). - new arm_debug/: EmbeddedICE halt/resume/mem + arm_flash backend declared, not implemented yet. - bscan_* take const jtag_target* and read the fpga sub-struct. - data/probes.yaml: arm-usb-ocd profile slot; data/targets.yaml: an ARM7 example entry. Docs + an ARM-debug design note in CLAUDE.md. Builds; FPGA path re-validated on the IGLOO2 (target_list shows the CPU example; jtag_open/autoinit/program 0 <svf> all work). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,80 +0,0 @@
|
||||
# bs_explorer FPGA registry
|
||||
#
|
||||
# Loaded at runtime by modules/fpga/. Looked up relative to the current
|
||||
# directory (run bs_explorer from the repo root), or via $BS_FPGA_REGISTRY.
|
||||
#
|
||||
# One entry per programmable device. Fields:
|
||||
# name human-readable part name (quoted)
|
||||
# idcode JTAG IDCODE pattern (hex)
|
||||
# idcode_mask bits compared when matching (0x0FFFFFFF on Xilinx
|
||||
# masks the version nibble); default 0xFFFFFFFF
|
||||
# family xilinx_7 | xilinx_us | xilinx_usp |
|
||||
# microsemi_igloo2 | microsemi_smartfusion2 |
|
||||
# lattice_machxo2 | lattice_machxo3
|
||||
# bsdl basename of the .bsd in bsdl_files/
|
||||
# ir_length IR width in bits
|
||||
# ir_cfg_in / ir_user1 / ir_jprogram / ir_jstart / ir_jshutdown /
|
||||
# ir_isc_disable private IR opcodes (hex; from the BSDL on Xilinx)
|
||||
# proxy_bitstream basename of the proxy .bit in bscan_proxies/
|
||||
# (omit if none is available yet)
|
||||
# caveats space/comma-separated flags: cclk_via_startup
|
||||
# (omit if none)
|
||||
# max_tck_khz max safe JTAG TCK in kHz for this part/board; if the
|
||||
# requested clock exceeds it, jtag_autoinit clamps and
|
||||
# re-opens at the cap (omit / 0 = unspecified)
|
||||
# prog programming backend: proxy_spi | svf | none. Omit to
|
||||
# infer (proxy_bitstream -> proxy_spi; Microsemi/Lattice
|
||||
# -> svf; else none).
|
||||
|
||||
fpgas:
|
||||
# Xilinx Kintex UltraScale+ XCKU15P
|
||||
# IDCODE / opcodes from bsdl_files/xcku15p_ffve1517.bsd, IR length 6.
|
||||
- name: "Xilinx Kintex UltraScale+ XCKU15P"
|
||||
idcode: 0x04A56093
|
||||
idcode_mask: 0x0FFFFFFF
|
||||
family: xilinx_usp
|
||||
bsdl: xcku15p_ffve1517.bsd
|
||||
ir_length: 6
|
||||
ir_cfg_in: 0x05
|
||||
ir_user1: 0x02
|
||||
ir_jprogram: 0x0B
|
||||
ir_jstart: 0x0C
|
||||
ir_jshutdown: 0x0D
|
||||
ir_isc_disable: 0x16
|
||||
caveats: cclk_via_startup
|
||||
prog: proxy_spi
|
||||
# proxy_bitstream not yet built for this part (see doc/tutorial.md, Phase 2.5)
|
||||
|
||||
# Xilinx Kintex UltraScale XCKU040 (KCU105 eval board)
|
||||
# IDCODE / opcodes from bsdl_files/xcku040_ffva1156.bsd, IR length 6.
|
||||
- name: "Xilinx Kintex UltraScale XCKU040"
|
||||
idcode: 0x03822093
|
||||
idcode_mask: 0x0FFFFFFF
|
||||
family: xilinx_us
|
||||
bsdl: xcku040_ffva1156.bsd
|
||||
ir_length: 6
|
||||
ir_cfg_in: 0x05
|
||||
ir_user1: 0x02
|
||||
ir_jprogram: 0x0B
|
||||
ir_jstart: 0x0C
|
||||
ir_jshutdown: 0x0D
|
||||
ir_isc_disable: 0x16
|
||||
proxy_bitstream: bscan_spi_xcku040.bit
|
||||
caveats: cclk_via_startup
|
||||
prog: proxy_spi
|
||||
|
||||
# Microsemi IGLOO2 M2GL010T (M2GL-EVAL-KIT)
|
||||
# IDCODE / IR length from bsdl_files/m2gl010t-fg484.bsd
|
||||
# IDCODE_REGISTER "XXXX1111100000000011000111001111" -> 0x0F8031CF
|
||||
# (top nibble = silicon revision, masked off). Shared die with the
|
||||
# SmartFusion2 M2S010, so both report the same IDCODE.
|
||||
# No proxy: IGLOO2 internal flash is programmed by playing an SVF
|
||||
# exported from Libero (SVF player not yet implemented), not via the
|
||||
# Xilinx BSCAN-proxy SPI path — so the ir_*/proxy fields don't apply.
|
||||
- name: "Microsemi IGLOO2 M2GL010T"
|
||||
idcode: 0x0F8031CF
|
||||
idcode_mask: 0x0FFFFFFF
|
||||
family: microsemi_igloo2
|
||||
bsdl: m2gl010t-fg484.bsd
|
||||
ir_length: 8
|
||||
prog: svf
|
||||
@@ -1,6 +1,6 @@
|
||||
# bs_explorer probe-config profiles
|
||||
#
|
||||
# Loaded at runtime by modules/probes/, layered on top of the built-in
|
||||
# Loaded at runtime by src/modules/probes/, layered on top of the built-in
|
||||
# config.script defaults. Looked up CWD-relative (run from the repo
|
||||
# root), or via $BS_PROBES.
|
||||
#
|
||||
@@ -29,3 +29,10 @@ profiles:
|
||||
|
||||
# Plain FT2232H probe: nothing to override beyond the defaults.
|
||||
ft2232h: {}
|
||||
|
||||
# Olimex ARM-USB-OCD (FT2232, OpenOCD-class) — for ARM CPU targets.
|
||||
# The core MPSSE JTAG pins (TCK/TDI/TDO/TMS = ADBUS0-3) match the
|
||||
# defaults; the control pins (nTRST, nSRST, output-buffer enable) are
|
||||
# board-specific. TODO: fill the TRST/SRST/buffer pin numbers from the
|
||||
# Olimex schematic / OpenOCD's interface config before driving a target.
|
||||
arm-usb-ocd: {}
|
||||
|
||||
102
data/targets.yaml
Normal file
102
data/targets.yaml
Normal file
@@ -0,0 +1,102 @@
|
||||
# bs_explorer JTAG target registry (FPGAs and CPUs)
|
||||
#
|
||||
# Loaded at runtime by src/modules/target/. Looked up relative to the
|
||||
# current directory (run bs_explorer from the repo root), or via
|
||||
# $BS_TARGETS.
|
||||
#
|
||||
# One flat entry per device under `targets:`. `kind` selects which
|
||||
# fields apply. Common fields:
|
||||
# name human-readable part name (quoted)
|
||||
# idcode JTAG IDCODE pattern (hex)
|
||||
# idcode_mask bits compared when matching (0x0FFFFFFF masks a
|
||||
# version nibble); default 0xFFFFFFFF
|
||||
# kind fpga | cpu (default fpga)
|
||||
# family xilinx_7/us/usp | microsemi_igloo2/smartfusion2 |
|
||||
# lattice_machxo2/3 | arm7 | arm9
|
||||
# ir_length IR width in bits
|
||||
# prog backend: proxy_spi | svf | arm_flash | none.
|
||||
# Omit to infer (proxy -> proxy_spi; Microsemi/Lattice
|
||||
# -> svf; cpu with a debug iface -> arm_flash).
|
||||
# max_tck_khz max safe JTAG TCK in kHz; jtag_autoinit clamps and
|
||||
# re-opens if exceeded (omit / 0 = unspecified)
|
||||
#
|
||||
# FPGA fields (kind: fpga):
|
||||
# bsdl basename of the .bsd in data/bsdl_files/
|
||||
# ir_cfg_in / ir_user1 / ir_jprogram / ir_jstart / ir_jshutdown /
|
||||
# ir_isc_disable private IR opcodes (hex; from the BSDL on Xilinx)
|
||||
# proxy_bitstream basename of the proxy .bit in data/bscan_proxies/
|
||||
# caveats space/comma-separated flags: cclk_via_startup
|
||||
#
|
||||
# CPU fields (kind: cpu):
|
||||
# debug debug transport: embeddedice (ARM7/ARM9)
|
||||
# ram_base/ram_size on-chip work-RAM for the flash loader (hex)
|
||||
# flash_base/flash_size on-chip flash region (hex)
|
||||
|
||||
targets:
|
||||
# Xilinx Kintex UltraScale+ XCKU15P
|
||||
# IDCODE / opcodes from data/bsdl_files/xcku15p_ffve1517.bsd, IR length 6.
|
||||
- name: "Xilinx Kintex UltraScale+ XCKU15P"
|
||||
kind: fpga
|
||||
idcode: 0x04A56093
|
||||
idcode_mask: 0x0FFFFFFF
|
||||
family: xilinx_usp
|
||||
bsdl: xcku15p_ffve1517.bsd
|
||||
ir_length: 6
|
||||
ir_cfg_in: 0x05
|
||||
ir_user1: 0x02
|
||||
ir_jprogram: 0x0B
|
||||
ir_jstart: 0x0C
|
||||
ir_jshutdown: 0x0D
|
||||
ir_isc_disable: 0x16
|
||||
caveats: cclk_via_startup
|
||||
prog: proxy_spi
|
||||
# proxy_bitstream not yet built for this part (see doc/tutorial.md, Phase 2.5)
|
||||
|
||||
# Xilinx Kintex UltraScale XCKU040 (KCU105 eval board)
|
||||
- name: "Xilinx Kintex UltraScale XCKU040"
|
||||
kind: fpga
|
||||
idcode: 0x03822093
|
||||
idcode_mask: 0x0FFFFFFF
|
||||
family: xilinx_us
|
||||
bsdl: xcku040_ffva1156.bsd
|
||||
ir_length: 6
|
||||
ir_cfg_in: 0x05
|
||||
ir_user1: 0x02
|
||||
ir_jprogram: 0x0B
|
||||
ir_jstart: 0x0C
|
||||
ir_jshutdown: 0x0D
|
||||
ir_isc_disable: 0x16
|
||||
proxy_bitstream: bscan_spi_xcku040.bit
|
||||
caveats: cclk_via_startup
|
||||
prog: proxy_spi
|
||||
|
||||
# Microsemi IGLOO2 M2GL010T (M2GL-EVAL-KIT)
|
||||
# IDCODE / IR length from data/bsdl_files/m2gl010t-fg484.bsd
|
||||
# IDCODE_REGISTER "XXXX1111100000000011000111001111" -> 0x0F8031CF
|
||||
# (top nibble = silicon revision, masked off). Programmed by playing
|
||||
# an SVF exported from Libero, not the Xilinx proxy path.
|
||||
- name: "Microsemi IGLOO2 M2GL010T"
|
||||
kind: fpga
|
||||
idcode: 0x0F8031CF
|
||||
idcode_mask: 0x0FFFFFFF
|
||||
family: microsemi_igloo2
|
||||
bsdl: m2gl010t-fg484.bsd
|
||||
ir_length: 8
|
||||
prog: svf
|
||||
|
||||
# --- CPU example (ARM7TDMI-S, LPC2148-class) ----------------------
|
||||
# EXAMPLE entry: verify the IDCODE, IR length and RAM/flash regions
|
||||
# against your actual part before relying on it. The arm_flash backend
|
||||
# is not implemented yet (see src/modules/arm_debug/ and CLAUDE.md).
|
||||
- name: "ARM7TDMI-S (example, e.g. NXP LPC2148)"
|
||||
kind: cpu
|
||||
idcode: 0x4F1F0F0F
|
||||
idcode_mask: 0x0FFFFFFF
|
||||
family: arm7
|
||||
ir_length: 4
|
||||
debug: embeddedice
|
||||
ram_base: 0x40000000
|
||||
ram_size: 0x8000
|
||||
flash_base: 0x0
|
||||
flash_size: 0x7D000
|
||||
prog: arm_flash
|
||||
Reference in New Issue
Block a user