Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion proxyclient/experiments/aes.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_custom_key(key, keygen=0):
aes.R_CONTROL.set(STOP=1)


p.pmgr_adt_clocks_enable("/arm-io/aes")
p.pmgr_adt_power_enable("/arm-io/aes")

dart = DART.from_adt(u, "/arm-io/dart-sio")
dart.initialize()
Expand Down
6 changes: 3 additions & 3 deletions proxyclient/experiments/agx_1tri.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from m1n1.agx import AGX
from m1n1.agx.context import *

p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
p.pmgr_adt_clocks_enable("/arm-io/sgx")
#p.pmgr_adt_clocks_enable("/arm-io/pmp")
p.pmgr_adt_power_enable("/arm-io/gfx-asc")
p.pmgr_adt_power_enable("/arm-io/sgx")
#p.pmgr_adt_power_enable("/arm-io/pmp")

# [cpu0] [0xfffffe00124bf5c0] MMIO: R.4 0x204d14000 (sgx, offset 0xd14000) = 0x0
p.read32(0x204000000 + 0xd14000)
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/agx_boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

from m1n1.fw.agx import Agx

p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
p.pmgr_adt_clocks_enable("/arm-io/sgx")
p.pmgr_adt_power_enable("/arm-io/gfx-asc")
p.pmgr_adt_power_enable("/arm-io/sgx")

agx = Agx(u)
agx.verbose = 10
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/agx_cancel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

analyzer_cpu = 1

p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
p.pmgr_adt_clocks_enable("/arm-io/sgx")
p.pmgr_adt_power_enable("/arm-io/gfx-asc")
p.pmgr_adt_power_enable("/arm-io/sgx")
p.smp_start_secondaries()
p.mmu_init_secondary(analyzer_cpu)
iface.dev.timeout = 42
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/agx_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

analyzer_cpu = 1

p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
p.pmgr_adt_clocks_enable("/arm-io/sgx")
p.pmgr_adt_power_enable("/arm-io/gfx-asc")
p.pmgr_adt_power_enable("/arm-io/sgx")
p.smp_start_secondaries()
p.mmu_init_secondary(analyzer_cpu)
iface.dev.timeout = 42
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/agx_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

analyzer_cpu = 1

p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
p.pmgr_adt_clocks_enable("/arm-io/sgx")
p.pmgr_adt_power_enable("/arm-io/gfx-asc")
p.pmgr_adt_power_enable("/arm-io/sgx")
p.smp_start_secondaries()
p.mmu_init_secondary(analyzer_cpu)
iface.dev.timeout = 42
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/agx_renderframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

from m1n1 import asm

p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
p.pmgr_adt_clocks_enable("/arm-io/sgx")
p.pmgr_adt_power_enable("/arm-io/gfx-asc")
p.pmgr_adt_power_enable("/arm-io/sgx")

agx = AGX(u)
mon = RegMonitor(u, ascii=True, bufsize=0x8000000)
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/agx_tlb.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

analyzer_cpu = 1

p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
p.pmgr_adt_clocks_enable("/arm-io/sgx")
p.pmgr_adt_power_enable("/arm-io/gfx-asc")
p.pmgr_adt_power_enable("/arm-io/sgx")
p.smp_start_secondaries()
p.mmu_init_secondary(analyzer_cpu)
iface.dev.timeout = 42
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/agx_tracetimings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

analyzer_cpu = 1

p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
p.pmgr_adt_clocks_enable("/arm-io/sgx")
p.pmgr_adt_power_enable("/arm-io/gfx-asc")
p.pmgr_adt_power_enable("/arm-io/sgx")
p.smp_start_secondaries()
p.mmu_init_secondary(analyzer_cpu)
iface.dev.timeout = 10
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/agx_xtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from m1n1.setup import *
from m1n1 import asm

p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
p.pmgr_adt_clocks_enable("/arm-io/sgx")
p.pmgr_adt_power_enable("/arm-io/gfx-asc")
p.pmgr_adt_power_enable("/arm-io/sgx")

agx = AGX(u)
agx.mon = mon
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/aop_als.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from m1n1.fw.aop.ipc import *

# aop nodes have no clocks described in adt for j293. it does it itself
p.pmgr_adt_clocks_enable("/arm-io/aop")
p.pmgr_adt_clocks_enable("/arm-io/dart-aop")
p.pmgr_adt_power_enable("/arm-io/aop")
p.pmgr_adt_power_enable("/arm-io/dart-aop")

dart = DART.from_adt(u, "/arm-io/dart-aop",
iova_range=(u.adt["/arm-io/dart-aop"].vm_base, 0x1000000000))
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/aop_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
# see povik's commit #fc66046

# aop nodes have no clocks described in adt for j293. it does it itself
p.pmgr_adt_clocks_enable("/arm-io/aop")
p.pmgr_adt_clocks_enable("/arm-io/dart-aop")
p.pmgr_adt_power_enable("/arm-io/aop")
p.pmgr_adt_power_enable("/arm-io/dart-aop")

# Set up a secondary proxy channel so that we can stream
# the microphone samples
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/aop_vt.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from m1n1.fw.aop.ipc import *

# aop nodes have no clocks described in adt for j293. it does it itself
p.pmgr_adt_clocks_enable("/arm-io/aop")
p.pmgr_adt_clocks_enable("/arm-io/dart-aop")
p.pmgr_adt_power_enable("/arm-io/aop")
p.pmgr_adt_power_enable("/arm-io/dart-aop")

p.usb_iodev_vuart_setup(p.iodev_whoami())
p.iodev_set_usage(IODEV.USB_VUART, USAGE.UARTPROXY)
Expand Down
10 changes: 5 additions & 5 deletions proxyclient/experiments/audio_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
from m1n1.hw.admac import *
from m1n1.hw.mca import *

p.pmgr_adt_clocks_enable("/arm-io/i2c2")
p.pmgr_adt_clocks_enable("/arm-io/admac-sio")
p.pmgr_adt_clocks_enable("/arm-io/dart-sio")
p.pmgr_adt_clocks_enable("/arm-io/mca-switch")
p.pmgr_adt_clocks_enable("/arm-io/mca3")
p.pmgr_adt_power_enable("/arm-io/i2c2")
p.pmgr_adt_power_enable("/arm-io/admac-sio")
p.pmgr_adt_power_enable("/arm-io/dart-sio")
p.pmgr_adt_power_enable("/arm-io/mca-switch")
p.pmgr_adt_power_enable("/arm-io/mca3")

# reset AUDIO_P
PS_AUDIO_P = PMGR(u).regs[0].PS4[10]
Expand Down
2 changes: 1 addition & 1 deletion proxyclient/experiments/i2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def tps6598x_exec_cmd(addr, cmd, data_in, out_len):
return i2c_read_reg(addr, 0x09, out_len)


print("make sure to run pmgr_adt_clocks_enable for /arm-io/i2c0 before this script.")
print("make sure to run pmgr_adt_power_enable for /arm-io/i2c0 before this script.")

# apple-specific command to bring the power state to zero
# (or any other value specified as an argument)
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/jpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ def rgb2yuv(r, g, b):
print(f"Using size {output_mem_sz:08X} for output data")

# Turn on the JPEG block
p.pmgr_adt_clocks_enable(f'/arm-io/dart-{args.which_jpeg}')
p.pmgr_adt_clocks_enable(f'/arm-io/{args.which_jpeg}')
p.pmgr_adt_power_enable(f'/arm-io/dart-{args.which_jpeg}')
p.pmgr_adt_power_enable(f'/arm-io/{args.which_jpeg}')

dart = DART.from_adt(u, f'/arm-io/dart-{args.which_jpeg}')
dart.initialize()
Expand Down
2 changes: 1 addition & 1 deletion proxyclient/experiments/ohmmeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def wait_for_unplug():
time.sleep(0.001)


p.pmgr_adt_clocks_enable("/arm-io/i2c2")
p.pmgr_adt_power_enable("/arm-io/i2c2")
i2c2 = I2C(u, "/arm-io/i2c2")

p.write32(0x2921f0010, 0x76a02) # invoke reset
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/prores.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def bswp16(x):
image_data_luma = im_data[:im_W*im_H]
image_data_chroma = im_data[im_W*im_H:]

p.pmgr_adt_clocks_enable(f'/arm-io/dart-apr0')
p.pmgr_adt_clocks_enable(f'/arm-io/apr0')
p.pmgr_adt_power_enable(f'/arm-io/dart-apr0')
p.pmgr_adt_power_enable(f'/arm-io/apr0')

dart = DART8110.from_adt(u, f'/arm-io/dart-apr0')
dart.initialize()
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/experiments/scaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
SCALER_ADT = '/arm-io/scaler0'
DART_ADT = '/arm-io/dart-scaler0'

p.pmgr_adt_clocks_enable(DART_ADT)
p.pmgr_adt_clocks_enable(SCALER_ADT)
p.pmgr_adt_power_enable(DART_ADT)
p.pmgr_adt_power_enable(SCALER_ADT)

dart = DART.from_adt(u, DART_ADT)
dart.initialize()
Expand Down
8 changes: 4 additions & 4 deletions proxyclient/experiments/speaker_amp.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
inputf = open(args.file, "rb") if args.file is not None \
else sys.stdin.buffer

p.pmgr_adt_clocks_enable("/arm-io/i2c1")
p.pmgr_adt_clocks_enable("/arm-io/admac-sio")
p.pmgr_adt_clocks_enable("/arm-io/dart-sio")
p.pmgr_adt_clocks_enable("/arm-io/mca-switch")
p.pmgr_adt_power_enable("/arm-io/i2c1")
p.pmgr_adt_power_enable("/arm-io/admac-sio")
p.pmgr_adt_power_enable("/arm-io/dart-sio")
p.pmgr_adt_power_enable("/arm-io/mca-switch")

# reset AUDIO_P
PS_AUDIO_P = PMGR(u).regs[0].PS4[5]
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/hv/trace_avd.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ def save_firmware(self, path="fw.bin"):
firmware = self.read_regs(self.base + 0x1080000, 0x10000)
open(path, "wb").write(firmware)

p.pmgr_adt_clocks_enable('/arm-io/dart-avd')
p.pmgr_adt_clocks_enable('/arm-io/avd')
p.pmgr_adt_power_enable('/arm-io/dart-avd')
p.pmgr_adt_power_enable('/arm-io/avd')
dart_tracer = DARTTracer(hv, "/arm-io/dart-avd", verbose=0)
dart_tracer.start()
dart = dart_tracer.dart
Expand Down
8 changes: 4 additions & 4 deletions proxyclient/hv/trace_prores.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from m1n1.utils import *
import struct

p.pmgr_adt_clocks_enable('/arm-io/dart-apr0')
p.pmgr_adt_clocks_enable('/arm-io/dart-apr1')
p.pmgr_adt_power_enable('/arm-io/dart-apr0')
p.pmgr_adt_power_enable('/arm-io/dart-apr1')

dart0_tracer = DART8110Tracer(hv, "/arm-io/dart-apr0", verbose=1)
dart0_tracer.start()
Expand Down Expand Up @@ -77,8 +77,8 @@ def w_DR_HEAD(self, val):

ProResTracer = ProResTracer._reloadcls()

p.pmgr_adt_clocks_enable('/arm-io/apr0')
p.pmgr_adt_clocks_enable('/arm-io/apr1')
p.pmgr_adt_power_enable('/arm-io/apr0')
p.pmgr_adt_power_enable('/arm-io/apr1')

tracer0 = ProResTracer(hv, '/arm-io/apr0', dart0_tracer)
tracer0.start()
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/m1n1/agx/shim.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def read_buf(self, ptr, size):
def init_agx(self):
from m1n1.setup import p, u, iface

p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
p.pmgr_adt_clocks_enable("/arm-io/sgx")
p.pmgr_adt_power_enable("/arm-io/gfx-asc")
p.pmgr_adt_power_enable("/arm-io/sgx")

self.agx = agx = AGX(u)

Expand Down
8 changes: 4 additions & 4 deletions proxyclient/m1n1/fw/ane.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def __init__(self, u):
self.p = u.proxy

self.name = "ane"
self.p.pmgr_adt_clocks_enable(f'/arm-io/{self.name}')
self.p.pmgr_adt_clocks_enable(f'/arm-io/dart-{self.name}')
self.p.pmgr_adt_power_enable(f'/arm-io/{self.name}')
self.p.pmgr_adt_power_enable(f'/arm-io/dart-{self.name}')

self.base_addr = u.adt[f'arm-io/{self.name}'].get_reg(0)[0]
self.regs = ANERegs(self.u, self.base_addr)
Expand Down Expand Up @@ -64,8 +64,8 @@ def apply_static_tunables(self): # this cost me a solid week
self.p.write32(self.base_addr + offset, value)

def power_up(self):
self.p.pmgr_adt_clocks_enable(f'/arm-io/{self.name}')
self.p.pmgr_adt_clocks_enable(f'/arm-io/dart-{self.name}')
self.p.pmgr_adt_power_enable(f'/arm-io/{self.name}')
self.p.pmgr_adt_power_enable(f'/arm-io/dart-{self.name}')
self.power_down()
for offset in range(0x0, 0x30+0x8, 0x8):
self.p.write32(self.ps_base_addr + offset, 0xf)
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/m1n1/fw/avd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def __init__(self, u, dev_path="/arm-io/avd", dart_path="/arm-io/dart-avd"):
self.base = u.adt[dev_path].get_reg(0)[0] # 0x268000000
self.node = u.adt[dev_path]

self.p.pmgr_adt_clocks_enable(dev_path)
self.p.pmgr_adt_clocks_enable(dart_path)
self.p.pmgr_adt_power_enable(dev_path)
self.p.pmgr_adt_power_enable(dart_path)
dart = DART.from_adt(u, dart_path)
dart.initialize()
self.dart = dart
Expand Down
8 changes: 4 additions & 4 deletions proxyclient/m1n1/fw/isp/isp_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def __init__(self, u):
self.PAGE_SIZE = 0x4000
self.page_size = self.PAGE_SIZE

self.p.pmgr_adt_clocks_enable("/arm-io/isp")
self.p.pmgr_adt_clocks_enable("/arm-io/dart-isp")
self.p.pmgr_adt_power_enable("/arm-io/isp")
self.p.pmgr_adt_power_enable("/arm-io/dart-isp")
self.dart = DART.from_adt(self.u, "/arm-io/dart-isp",
iova_range=(0x3a28000, 0x20000000)) # +0x4000 extra heap
self.dart.initialize()
Expand Down Expand Up @@ -244,8 +244,8 @@ def sync_ttbr(self):
self.p.write32(self.isp_dart2_base + 0x200, self.dart.dart.regs.TTBR[0, 0].val)

def power_on(self):
self.p.pmgr_adt_clocks_enable("/arm-io/isp")
self.p.pmgr_adt_clocks_enable("/arm-io/dart-isp")
self.p.pmgr_adt_power_enable("/arm-io/isp")
self.p.pmgr_adt_power_enable("/arm-io/dart-isp")

# power domains, low -> high
self.ps.ISP_PS_00 = 0xf
Expand Down
24 changes: 12 additions & 12 deletions proxyclient/m1n1/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,10 @@ class M1N1Proxy(Reloadable):
P_KBOOT_PREPARE_DT = 0x703
P_KBOOT_SET_UBOOT = 0x704

P_PMGR_CLOCK_ENABLE = 0x800
P_PMGR_CLOCK_DISABLE = 0x801
P_PMGR_ADT_CLOCKS_ENABLE = 0x802
P_PMGR_ADT_CLOCKS_DISABLE = 0x803
P_PMGR_POWER_ENABLE = 0x800
P_PMGR_POWER_DISABLE = 0x801
P_PMGR_ADT_POWER_ENABLE = 0x802
P_PMGR_ADT_POWER_DISABLE = 0x803
P_PMGR_RESET = 0x804

P_IODEV_SET_USAGE = 0x900
Expand Down Expand Up @@ -1016,14 +1016,14 @@ def kboot_prepare_dt(self, dt_addr):
def kboot_set_uboot(self, name, value):
self.request(self.P_KBOOT_SET_UBOOT, name, value)

def pmgr_clock_enable(self, clkid):
return self.request(self.P_PMGR_CLOCK_ENABLE, clkid)
def pmgr_clock_disable(self, clkid):
return self.request(self.P_PMGR_CLOCK_DISABLE, clkid)
def pmgr_adt_clocks_enable(self, path):
return self.request(self.P_PMGR_ADT_CLOCKS_ENABLE, path)
def pmgr_adt_clocks_disable(self, path):
return self.request(self.P_PMGR_ADT_CLOCKS_DISABLE, path)
def pmgr_power_enable(self, clkid):
return self.request(self.P_PMGR_POWER_ENABLE, clkid)
def pmgr_power_disable(self, clkid):
return self.request(self.P_PMGR_POWER_DISABLE, clkid)
def pmgr_adt_power_enable(self, path):
return self.request(self.P_PMGR_ADT_POWER_ENABLE, path)
def pmgr_adt_power_disable(self, path):
return self.request(self.P_PMGR_ADT_POWER_DISABLE, path)
def pmgr_reset(self, die, name):
return self.request(self.P_PMGR_RESET, die, name)

Expand Down
2 changes: 1 addition & 1 deletion proxyclient/m1n1/trace/isp.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class ISPTracer(ADTDevTracer):

def __init__(self, hv, dev_path, dart_dev_path, verbose):
super().__init__(hv, dev_path, verbose)
hv.p.pmgr_adt_clocks_enable(dart_dev_path)
hv.p.pmgr_adt_power_enable(dart_dev_path)
self.dart_tracer = DARTTracer(hv, dart_dev_path, verbose=0)
self.dart_tracer.start()
self.dart = self.dart_tracer.dart
Expand Down
4 changes: 2 additions & 2 deletions proxyclient/tools/admac_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
print(f"Found {path}", file=sys.stderr)
if "clock-gates" in node._properties:
print(f"Enabling {path}", file=sys.stderr)
p.pmgr_adt_clocks_enable(path)
p.pmgr_adt_power_enable(path)
break

if path is None:
Expand All @@ -50,7 +50,7 @@

if "clock-gates" in u.adt[dart_path]._properties:
print(f"Enabling {dart_path}", file=sys.stderr)
p.pmgr_adt_clocks_enable(path)
p.pmgr_adt_power_enable(path)

dart = DART.from_adt(u, dart_path)
admac = ADMAC(u, admac_node.get_reg(0)[0], dart,
Expand Down