Skip to content

Commit ae87b82

Browse files
committed
Add LiteX based setup.
1 parent 657fe2e commit ae87b82

22 files changed

Lines changed: 1466 additions & 0 deletions

.gitmodules

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,18 @@
1010
[submodule "deps/luna"]
1111
path = deps/luna
1212
url = https://github.com/greatscottgadgets/luna.git
13+
[submodule "deps/migen"]
14+
path = deps/migen
15+
url = https://github.com/m-labs/migen.git
16+
[submodule "deps/litex-boards"]
17+
path = deps/litex-boards
18+
url = https://github.com/litex-hub/litex-boards.git
19+
[submodule "deps/litex"]
20+
path = deps/litex
21+
url = https://github.com/enjoy-digital/litex.git
22+
[submodule "deps/pythondata-cpu-vexriscv"]
23+
path = deps/pythondata-cpu-vexriscv
24+
url = https://github.com/litex-hub/pythondata-cpu-vexriscv.git
25+
[submodule "deps/pythondata-software-compiler_rt"]
26+
path = deps/pythondata-software-compiler_rt
27+
url = https://github.com/litex-hub/pythondata-software-compiler_rt.git

deps/litex

Submodule litex added at 15cf4d7

deps/litex-boards

Submodule litex-boards added at d830ef8

deps/migen

Submodule migen added at 3ffd64c

deps/pythondata-cpu-vexriscv

Submodule pythondata-cpu-vexriscv added at 7f9db48

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/source/conf.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'Orbtrace'
21+
copyright = '2021, Orbcode'
22+
author = 'Orbcode'
23+
24+
25+
# -- General configuration ---------------------------------------------------
26+
27+
# Add any Sphinx extension module names here, as strings. They can be
28+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29+
# ones.
30+
extensions = [
31+
]
32+
33+
# Add any paths that contain templates here, relative to this directory.
34+
templates_path = ['_templates']
35+
36+
# List of patterns, relative to source directory, that match files and
37+
# directories to ignore when looking for source files.
38+
# This pattern also affects html_static_path and html_extra_path.
39+
exclude_patterns = []
40+
41+
42+
# -- Options for HTML output -------------------------------------------------
43+
44+
# The theme to use for HTML and HTML Help pages. See the documentation for
45+
# a list of builtin themes.
46+
#
47+
html_theme = 'sphinx_rtd_theme'
48+
49+
# Add any paths that contain custom static files (such as style sheets) here,
50+
# relative to this directory. They are copied after the builtin static files,
51+
# so a file named "default.css" will overwrite the builtin "default.css".
52+
html_static_path = ['_static']

docs/source/index.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. Orbtrace documentation master file, created by
2+
sphinx-quickstart on Sun Apr 18 10:24:10 2021.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to Orbtrace's documentation!
7+
====================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
usb_trace_interface
14+
15+
16+
Indices and tables
17+
==================
18+
19+
* :ref:`genindex`
20+
* :ref:`modindex`
21+
* :ref:`search`
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
USB Trace Interface
2+
===================
3+
4+
The trace interface is identified by ``bInterfaceClass = 0xff`` and ``bInterfaceSubclass = 0x54 ('T')``.
5+
It may have multiple alternate settings with different ``bInterfaceProtocol`` values to support different trace protocols.
6+
Host software negotiates protocol by reading the list of supported alternate settings and selecting the preferred one.
7+
8+
Control Requests
9+
----------------
10+
11+
Control requests are vendor-specific interface-directed, i.e. with ``bmRequestType = 0x41 or 0xc1``
12+
and the lower half of ``wIndex`` containing ``bInterfaceNumber``.
13+
14+
Set Trace Type
15+
^^^^^^^^^^^^^^
16+
17+
============= ======== ====== ================ =======
18+
bmRequestType bRequest wValue wIndex wLength
19+
============= ======== ====== ================ =======
20+
0x41 0x01 Type bInterfaceNumber 0
21+
============= ======== ====== ================ =======
22+
23+
24+
===== =======================
25+
Type Description
26+
===== =======================
27+
0x00 Disabled
28+
0x01 1-bit synchronous
29+
0x02 2-bit synchronous
30+
0x03 4-bit synchronous
31+
0x80 NRZ asynchronous
32+
0x81 Manchester asynchronous
33+
===== =======================
34+
35+
Set Async Baudrate
36+
^^^^^^^^^^^^^^^^^^
37+
38+
TBD
39+
40+
Protocols
41+
---------
42+
43+
TPIU
44+
^^^^
45+
46+
================== ================== ==================
47+
bInterfaceClass bInterfaceSubclass bInterfaceProtocol
48+
================== ================== ==================
49+
0xff 0x54 0x01
50+
================== ================== ==================
51+
52+
This protocol uses one endpoint that will send one or more 16-byte TPIU frames per transfer.
53+
TPIU frames are aligned to USB transfer boundaries.
54+
55+
..
56+
TODO: Insert reference to TPIU frame structure in ARM spec.
57+
58+
.. _usb_itm:
59+
60+
ITM
61+
^^^
62+
63+
================== ================== ==================
64+
bInterfaceClass bInterfaceSubclass bInterfaceProtocol
65+
================== ================== ==================
66+
0xff 0x54 TBD
67+
================== ================== ==================
68+
69+
TBD
70+
71+
.. _usb_etm:
72+
73+
ETM
74+
^^^
75+
76+
================== ================== ==================
77+
bInterfaceClass bInterfaceSubclass bInterfaceProtocol
78+
================== ================== ==================
79+
0xff 0x54 TBD
80+
================== ================== ==================
81+
82+
TBD
83+
84+
ITM + ETM
85+
^^^^^^^^^
86+
87+
================== ================== ==================
88+
bInterfaceClass bInterfaceSubclass bInterfaceProtocol
89+
================== ================== ==================
90+
0xff 0x54 TBD
91+
================== ================== ==================
92+
93+
This protocol provides both an :ref:`usb_itm` and an :ref:`usb_etm` endpoint.
94+
Refer to the respective sections for details.

0 commit comments

Comments
 (0)