Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A7-A11 SoC support #403

Merged
merged 19 commits into from
Oct 30, 2024
Merged

A7-A11 SoC support #403

merged 19 commits into from
Oct 30, 2024

Conversation

asdfugil
Copy link
Contributor

Add support for A7-A11 SoCs found in various iPhones, iPads, iPod touches and Apple TVs.

@asdfugil asdfugil force-pushed the for-upstream branch 8 times, most recently from c755e18 to 9f3f2f0 Compare September 24, 2024 07:55
src/cpu_regs.h Outdated Show resolved Hide resolved
m1n1-raw.ld Outdated Show resolved Hide resolved
src/exception_asm.S Outdated Show resolved Hide resolved
src/utils.c Outdated Show resolved Hide resolved
src/utils.c Outdated Show resolved Hide resolved
src/startup.c Outdated Show resolved Hide resolved
src/exception.c Outdated Show resolved Hide resolved
@asdfugil asdfugil force-pushed the for-upstream branch 2 times, most recently from 22fe601 to a9c572f Compare September 26, 2024 13:28
@asdfugil
Copy link
Contributor Author

asdfugil commented Sep 26, 2024

Changes:

  • Register names are now upper cased
  • EL3 stack is now before main stack, and does not have STACKBOT magic anymore.
  • is_idevice() is replaced by is_mac, cpufeat_fast_ipi and cpufeat_mmu_sprr, or removed entirely when not needed.
    • supports_fipi() removed as well
  • Use macros like S5L8960X for all chip_id comparisons
  • For SMP start offset macros, always use the first SoC with that offset in the macro name.
  • PAN in exception handler now remains unchanged in code but get patched to NOP during init on non-PAN devices.
  • Use common code to parse iBoot versions
  • Add comma to EL list to keep format sane

@asdfugil asdfugil force-pushed the for-upstream branch 2 times, most recently from aa9d2f3 to 2a7f9ef Compare September 30, 2024 07:35
@asdfugil asdfugil force-pushed the for-upstream branch 5 times, most recently from 8a5b70c to 7f56988 Compare October 9, 2024 14:04
Add UART bases for A7-A11, T2 SoCs.

Signed-off-by: Nick Chan <[email protected]>
These functions will be used to skip over parts not supported by A7-A11 SoCs.

Signed-off-by: Nick Chan <[email protected]>
Cyclone and Typhoon are similar enough to share a file.

Hurricane and Zephyr are the physical cores on A10 backing the
Hurricane-Zephyr logical core.

Signed-off-by: Nick Chan <[email protected]>
A7-A9X has an EL3. Handle it (without SMP support).

Signed-off-by: Nick Chan <[email protected]>
This includes
- GXF
- SPRR
- PAN (A7-A9)
- Atomics (A7-A10)
- FIPI (A7-A10)
- DCP

SPRR on T8030 seems to be quite different from M1 (at least according to
qemu-t8030), so keep it disabled for those CPU parts.

Signed-off-by: Nick Chan <[email protected]>
Boot-args version 1 (iOS 12), and version 3 (iOS 18, macOS 15).

Signed-off-by: Nick Chan <[email protected]>
Add support for 4K page sizes, supported by A7-A8X.

Co-developed-by: fenfenS <[email protected]>
Signed-off-by: fenfenS <[email protected]>
Signed-off-by: Nick Chan <[email protected]>
This includes:

- EL3 handling
- "Slow" IPI support
- New start offsets

Signed-off-by: Nick Chan <[email protected]>
Old ADT does not have /cpus/cpu<n>/cpu-impl-reg, and the value is in
/arm-io/pmgr/reg[2*n+2].

Signed-off-by: Nick Chan <[email protected]>
On A7-A11 we have a ROM exploit and we can keep CPU0 RVBAR unlocked.

Signed-off-by: Nick Chan <[email protected]>
@asdfugil
Copy link
Contributor Author

Changes v3:

  • Fixed PMGR on A7-A11 SoCs. These SoC uses a struct layout that has 8-bit device IDs. Seems like at some point between A11 and M1 Apple needs more than 255 devices and switched to 16-bit device IDs.
  • Apple TV HD debug uart is uart6, so account for that
  • Add A7-A9 cache errata workaround
  • Introduce el3_call()
  • Fixed el0_call() and el1_call() when running in EL1

@asdfugil
Copy link
Contributor Author

asdfugil commented Oct 13, 2024

(... for the proxyclient changes that needs to exist to actually interface with m1n1, I don't have anything that looks remotely okay it's all ugly hacks)

This includes:
- Do not treat iPhone 5 buffer as dummy on 5s
- Added support for 24-bit framebuffer
- When we have a vertical display, use whole fb as console

Signed-off-by: Nick Chan <[email protected]>
Account for the differences between the iOS ADT and macOS ADT, and also
some physical differences between Apple Silicon Macs and A7-A11 devoces,
reflected in the ADT.

Signed-off-by: Nick Chan <[email protected]>
The secondary CPU may potentially use the stack after leaving WFE.

Signed-off-by: Nick Chan <[email protected]>
At some point Apple ran out of bits and have to widen the device field
to 16-bit. This adds support for the old 8-bit layout.

Signed-off-by: Nick Chan <[email protected]>
We do not support the USB controller on A7-A11 SoCs yet, but still do not
try to init dwc3 on them.

Signed-off-by: Nick Chan <[email protected]>
@marcan
Copy link
Member

marcan commented Oct 30, 2024

Let's merge, if there are any issues we'll fix as we go along. Thanks!

@marcan marcan merged commit 4bde778 into AsahiLinux:main Oct 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants