summaryrefslogtreecommitdiff
path: root/tools/proxyclient/hv/trace_atc.py
blob: f301803d1209d9e725e0567ec09cbb929ec8c4da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# SPDX-License-Identifier: MIT

from m1n1.hv import TraceMode
from m1n1.hw.dwc3 import XhciRegs, Dwc3CoreRegs, PipehandlerRegs
from m1n1.hw.atc import Usb2PhyRegs, AtcPhyRegs
from m1n1.trace import ADTDevTracer
from m1n1.utils import *


class PhyTracer(ADTDevTracer):
    REGMAPS = [
        Usb2PhyRegs,
        None,
        (AtcPhyRegs, 0x20000),
        (AtcPhyRegs, 0x0),
        (AtcPhyRegs, 0x2000),
        (AtcPhyRegs, 0x2200),
        (AtcPhyRegs, 0x2800),
        (AtcPhyRegs, 0x2A00),
        (AtcPhyRegs, 0x7000),
        (AtcPhyRegs, 0xA00),
        (AtcPhyRegs, 0x800),
        (AtcPhyRegs, 0xD000),
        (AtcPhyRegs, 0x14000),
        (AtcPhyRegs, 0xC000),
        (AtcPhyRegs, 0x13000),
        (AtcPhyRegs, 0xB000),
        (AtcPhyRegs, 0x12000),
        (AtcPhyRegs, 0x9000),
        (AtcPhyRegs, 0x10000),
        (AtcPhyRegs, 0x1000),
        (AtcPhyRegs, 0x50000),
        (AtcPhyRegs, 0x50200),
        (AtcPhyRegs, 0x54000),
        None,
        None,
        None,
        (AtcPhyRegs, 0xA000),
        (AtcPhyRegs, 0x11000),
    ]


class Dwc3VerboseTracer(ADTDevTracer):
    REGMAPS = [XhciRegs, None, Dwc3CoreRegs, PipehandlerRegs]
    NAMES = ["xhci", None, "dwc-core", "pipehandler"]


class Dwc3Tracer(ADTDevTracer):
    REGMAPS = [None, None, Dwc3CoreRegs, PipehandlerRegs]
    NAMES = [None, None, "dwc-core", "pipehandler"]


PhyTracer = PhyTracer._reloadcls()
Dwc3Tracer = Dwc3Tracer._reloadcls()
Dwc3VerboseTracer = Dwc3VerboseTracer._reloadcls()

phy_tracer = PhyTracer(hv, "/arm-io/atc-phy1", verbose=2)
dwc3_tracer = Dwc3Tracer(hv, "/arm-io/usb-drd1", verbose=2)

phy_tracer.start()
dwc3_tracer.start()