This adds some missing fixes for M1/T8103 and reworks the code to split
off common parts, and also handle per-revision bits.
Signed-off-by: Hector Martin <marcan@marcan.st>
For now we compute this as phys_base aligned down to a 4GiB boundary.
Hopefully that works for future SoCs too.
Signed-off-by: Hector Martin <marcan@marcan.st>
The M1 Pro/Max Macs use a different base address for the UART and the
WDT than earlier models.
Remove hardcoded base addresses constants and replace them with loads
from the ADT.
- The base address of the WDT is already retrieved in wdt_disable; also
use this address when triggering a reboot.
- Retrieve the base address of uart0 in uart_init. If the operation
fails, the error will be signaled on the early uart (if not disabled).
- The early debug UART can’t use the ADT (or shouldn’t) so it is now
disabled by default. To enable it, add
-DEARLY_UART -DEARLY_UART_BASE=0xuart_address
to the CFLAGS.
Signed-off-by: Vincent Duvert <vincent@duvert.net>
This enables parent devices that are required by active child devices,
because iBoot leaves behind some broken dependencies.
Signed-off-by: Hector Martin <marcan@marcan.st>
This unbreaks dcp.py and other things that need to access reserved
regions. This way we don't have to start doing manual MMU maps, but
we're still safe from SErrors caused by hitting TZ carveouts.
Signed-off-by: Hector Martin <marcan@marcan.st>
We saw some crazy speculation running in the HV breaking things by
reading from invalid RAM, so let's actually map only what's available.
For now we do map all lowmem as we haven't seen SErrors there yet, but
we stop at the high boundary.
Fixes: #97
Signed-off-by: Hector Martin <marcan@marcan.st>
Add a basic SMC client and a script in experiments/ using it to enable
the radios. Running this before booting Linux will make the network
controller devices show up in lspci, even if Linux lacks an SMC driver.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Also capture config at cpu0 guest entry time, to make sure we don't
carry over guest changes to EL1 regs after that.
Signed-off-by: Hector Martin <marcan@marcan.st>
Little clean-up of unused proxyclient code.
Code used/referenced by commented out sections were taken
into account and left behind to be used by it at a later point.
Signed-off-by: TophEvich <84676511+TophEvich@users.noreply.github.com>
Add initial code for driving the ADMAC hw blocks, also add a script
which shows it in action by streaming audio to the Mac mini's embedded
speaker.
Signed-off-by: Martin Povišer <povik@protonmail.com>