2021-09-19 18:04:39 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
from m1n1.hv import TraceMode
|
2022-08-13 09:48:07 +00:00
|
|
|
from m1n1.hw.dwc3 import XhciRegs, Dwc3CoreRegs, PipehandlerRegs
|
2022-08-10 20:36:49 +00:00
|
|
|
from m1n1.hw.atc import Usb2PhyRegs, AtcPhyRegs
|
2021-09-19 18:04:39 +00:00
|
|
|
from m1n1.trace import ADTDevTracer
|
|
|
|
from m1n1.utils import *
|
|
|
|
|
2022-08-10 20:36:49 +00:00
|
|
|
|
2021-09-19 18:04:39 +00:00
|
|
|
class PhyTracer(ADTDevTracer):
|
2022-08-10 20:36:49 +00:00
|
|
|
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),
|
|
|
|
]
|
2021-09-19 18:04:39 +00:00
|
|
|
|
|
|
|
|
2022-08-13 09:48:07 +00:00
|
|
|
class Dwc3VerboseTracer(ADTDevTracer):
|
|
|
|
REGMAPS = [XhciRegs, None, Dwc3CoreRegs, PipehandlerRegs]
|
|
|
|
NAMES = ["xhci", None, "dwc-core", "pipehandler"]
|
|
|
|
|
|
|
|
|
2021-09-19 18:04:39 +00:00
|
|
|
class Dwc3Tracer(ADTDevTracer):
|
2022-08-13 09:48:07 +00:00
|
|
|
REGMAPS = [None, None, Dwc3CoreRegs, PipehandlerRegs]
|
|
|
|
NAMES = [None, None, "dwc-core", "pipehandler"]
|
2021-09-19 18:04:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
PhyTracer = PhyTracer._reloadcls()
|
|
|
|
Dwc3Tracer = Dwc3Tracer._reloadcls()
|
2022-08-13 09:48:07 +00:00
|
|
|
Dwc3VerboseTracer = Dwc3VerboseTracer._reloadcls()
|
|
|
|
|
|
|
|
phy_tracer = PhyTracer(hv, "/arm-io/atc-phy1", verbose=2)
|
2021-09-19 18:04:39 +00:00
|
|
|
dwc3_tracer = Dwc3Tracer(hv, "/arm-io/usb-drd1", verbose=2)
|
2022-08-13 09:48:07 +00:00
|
|
|
|
|
|
|
phy_tracer.start()
|
|
|
|
dwc3_tracer.start()
|