Commit graph

857 commits

Author SHA1 Message Date
Martin Povišer
f71397abb7 tools/dump_pmgr.py: Show calculated NCO rate
Show the calculated rate for NCO channels' output based on the present
register values.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 17:49:39 +09:00
Martin Povišer
5e5b83e7a2 m1n1.hw.nco: Add NCO driver
Apple SoCs have an NCO block used for generating audio master clocks.

The block performs fractional division of a higher-rate input clock and
contains a counter which is partially implemented as a LFSR. Credit
goes to Hector for reversing the divisor register semantics.

Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 17:49:39 +09:00
Martin Povišer
549dcf8b3a m1n1.hw.admac: Add debug print of estimated rate
Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 17:49:39 +09:00
Martin Povišer
99a0741c87 speaker_amp.py: Clean up
Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 17:49:39 +09:00
Martin Povišer
53be0ec40d speaker_amp.py: Note down TAS2770 as best match
Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 17:49:39 +09:00
Martin Povišer
8833696c69 m1n1.hw.admac: Fix descriptor deserialization
Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 17:49:39 +09:00
Martin Povišer
301ba75b6b m1n1.utils: Remove dead formatting
Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 17:49:39 +09:00
Martin Povišer
145b1101c9 m1n1.utils: Add Register32.fields property
Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 17:49:39 +09:00
Martin Povišer
d65526d326 m1n1.hw.admac: Clear underflow counters on reset
Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 17:49:39 +09:00
Martin Povišer
570107629a m1n1.hw.admac: Fix and extend register defs
Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 17:49:39 +09:00
Martin Povišer
2cebfaab73 m1n1.hw.i2c: Reset status before transaction
Reset the status register before each transaction. This is necessary if
we are taking over the peripheral after the Linux driver (e.g. in paused
hypervisor).

Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 17:49:39 +09:00
Martin Povišer
a40840f13c proxy: Expose usb_iodev_vuart_setup
Expose the usb_iodev_vuart_setup function in uartproxy. This opens
the secondary ACM pipe to new uses outside the hypervisor. E.g. it can
be set up as another stream for sending proxy requests.

Sample usage from proxyclient:

    p.usb_iodev_vuart_setup(p.iodev_whoami())
    p.iodev_set_usage(IODEV.USB_VUART, USAGE.UARTPROXY)
    # the second virtual serial now also serves proxy

Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 15:31:21 +09:00
Hector Martin
98d6e9bb4f tools/chainload.py: Fix 8b/16b copy confusion
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-26 13:58:39 +09:00
Hector Martin
95ef45fd11 usb: Squelch DART error for missing USB devices
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-24 17:17:54 +09:00
Hector Martin
b86574e410 tools/pmgr_adt2dt.py: New script to convert ADT PMGR devs to DT nodes
This still requires manual editing to fix up some issues, since our idea
of always-on devices and parent-child relationships doesn't always match
Apple's.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-24 16:19:01 +09:00
Hector Martin
de6979fc7b Revert "usb: Add usb_idx_from_address() to find a dev by its MMIO addr"
This is no longer needed, so put things back the way they were.

This reverts commit e689ceb263.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-23 23:36:14 +09:00
Hector Martin
be7ff3a062 kboot: Generalize device disable logic, disable i2c & usb devs
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-23 23:36:14 +09:00
Hector Martin
0e3ee31254 m1n1.fw.asc.kdebug: Handle prealloc messages (partially)
Not sure if these need a reply...

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-23 17:27:37 +09:00
Hector Martin
99acc2675b m1n1.fw.asc: Add support for shutting down RTKit links
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-23 17:20:09 +09:00
Hector Martin
0446838460 m1n1.fw.asc.crash: Add a basic crashlog parser
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-23 17:19:38 +09:00
Hector Martin
10dda2550d m1n1.hv: Automatically lower BRKs
This makes Linux BUG()s work out of the box without breaking into the
HV.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-23 14:05:26 +09:00
Jean-Marc Ranger
45a62144ff Set missing execute bits in proxyclient/{experiments|tools}/*.py
Currently, only some scripts in proxyclient/experiments and
proxyclient/tools have their execute bit set. Set it for those
that miss it.

Signed-off-by: Jean-Marc Ranger <jmranger@hotmail.com>
2021-11-23 01:23:11 +09:00
Jean-Marc Ranger
d4f750cb22 experiments/smc.py: Adapt to API change in SMCEndpoint
Update experiments/smc.py to use fw/smc.py's new API.

Fixes: b9ddd74c02 ("hv/trace_smc.py: Add SMC tracer")

Signed-off-by: Jean-Marc Ranger <jmranger@hotmail.com>
2021-11-23 01:22:57 +09:00
Hector Martin
6906af06cc experiments/dcp.py: Use new ADT DART constructor
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-22 18:13:51 +09:00
Hector Martin
8778819831 m1n1.hw.dart: Fix typo
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-22 18:13:32 +09:00
Hector Martin
c8a8946e82 m1n1.hw.dart: Add a constructor that figures out DART type from the ADT
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-22 18:13:10 +09:00
Hector Martin
01e84ecef6 pcie: Document reg ranges better
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-22 16:43:22 +09:00
Hector Martin
555965e98a pcie: Calculate the number of reg entries per port
Turns out this isn't hardware-specific, but rather a change Apple made
retroactively in 12.0 RC. Doesn't look like there's a saner way than
this...

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-22 16:24:37 +09:00
Hector Martin
4027c34c7a proxy: Add proxy ops for pcie_init/shutdown
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-22 16:04:35 +09:00
Hector Martin
660d7482b9 hv/trace_pmgr.py: New script
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-22 07:21:07 +09:00
Hector Martin
23c3617cf2 payload: Complain loudly about devicetree platform mismatches.
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-20 02:26:24 +09:00
Hector Martin
f4e11a78c6 i2c: Add explicit delay to the i2c_xfer_read timeout loop
We now set the timeout at 10ms without any bytes received.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-18 22:29:51 +09:00
Hector Martin
850a669436 tps6598x: Add a delay in the command poll loop
It seems that if we poll too fast, we DoS the poor thing...

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-18 22:15:38 +09:00
Hector Martin
cc1fa67ff2 i2c: Use Repeat-Start condition for SMBus reads
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-18 22:15:13 +09:00
Hector Martin
26f636dbbb fb: Use 128-bitwise copies to speed up FB updates
This makes it almost as fast as it was before the switch to an
uncached framebuffer, as far as I can tell.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-17 19:23:44 +09:00
Hector Martin
3b0d53d7b8 mcc: Guard against MCC count > max
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-17 10:14:15 +09:00
Hector Martin
0df392d0d3 mcc: Fix mcc_num_channels prop on t8103
Bad copy and paste...

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-17 01:45:49 +09:00
Hector Martin
4b80041d6d mcc: New module to initialize the MCC memory controller.
This turns on the system level cache. The carveout unmapping also moves
here, and now it handles T8103/T6000 properly.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-16 21:09:48 +09:00
Hector Martin
ecc80f4b32 kboot: Fix warning/bug introduced by ecb6c82e
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-16 21:09:12 +09:00
Hector Martin
b9ec73b019 smp: Leave the default boot stack for CPU#0 set in case it resets
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-16 17:26:52 +09:00
Hector Martin
33d09cc7c0 hv_exc: Filter out CYC_OVRD_DISABLE_WFI_RET
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-16 17:26:39 +09:00
Hector Martin
5d214606df m1n1.hv: Add flag to hide the CPU prefix in hv.log()
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-16 17:20:47 +09:00
Hector Martin
06975c8b87 m1n1.hv: Add TraceMode.WSYNC to make writes synchronous, but not reads
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-16 17:20:21 +09:00
Hector Martin
ccbe181d75 m1n1.adt: Improve PMGR props parsing, add to dump_pmgr.py
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-16 17:19:42 +09:00
Hector Martin
0f9c0f5dd3 startup: Add a UART print to the RVBAR entry path
This might make it easier to debug CPU sleep modes

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-16 17:18:52 +09:00
Hector Martin
4652ac2098 tools/reg_filter.py: Tool to add IMPDEF sysreg names to a disasm
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-16 17:18:09 +09:00
Hector Martin
ecb6c82e75 kboot: Delete CPU nodes instead of disabling them
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-15 22:48:28 +09:00
Hector Martin
7690fd730c iodev: Bypass locks on all funcs if no MMU
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-15 22:47:45 +09:00
Hector Martin
257f6443a6 kboot: Fix potential bug handling missing/disabled CPUs
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-15 14:52:10 +09:00
Jean-Francois Bortolotti
0131d16c0a Fix aic1 reg size
Signed-off-by: Jean-Francois Bortolotti <jeff@borto.fr>
2021-11-14 11:14:50 +09:00