This is a python tool based on pydevicetree (GitHub/PyPI) which generates OpenOCD Configuration Files for Freedom Metal applications.
usage: generate_openocdcfg.py [-h] -d DTS -b BOARD [-o OUTPUT] [-p PROTOCOL]
[-t]
Generate OpenOCD configuration files from Devicetrees
optional arguments:
-h, --help show this help message and exit
-d DTS, --dts DTS The path to the Devicetree for the target
-b BOARD, --board BOARD
The board of the target to generate an OpenOCD config
for. Supported boards include: arty, vc707, hifive
-o OUTPUT, --output OUTPUT
The path of the linker script file to output
-p PROTOCOL, --protocol PROTOCOL
Supported protocols include: jtag, cjtag
-t, --tunnel Enable JTAG tunneling (Xilinx BSCAN)
This linker script generator expects that the Devicetree has annotated the desired memory map
for the resulting linker script through properties in the /chosen
node. Those properties are:
metal,entry
, which describes which memory region read-only data should be placed inmetal,ram
, which describes which memory region should be treated as ram
Each of these properties is a prop-encoded-array
with the following triplet of values:
- A reference to a node which describes memory with the
reg
property - An integer describing which 0-indexed tuple in the
reg
property should be used - An integer describing the offset into the memory region described by the requested
reg
tuple
For example, the chosen node may include the following properties:
chosen {
metal,entry = <&testram0 0 0>;
metal,ram = <&L28 0 0>;
};
Copyright (c) 2020 SiFive Inc.
The contents of this repository are distributed according to the terms described in the LICENSE file.