Skip to content

sync - #5

Closed
ilikecereal1 wants to merge 122 commits into
HoolockLinux:hoolockfrom
ilikecereal1:hoolock
Closed

ilikecereal1 wants to merge 122 commits into
HoolockLinux:hoolockfrom
ilikecereal1:hoolock

Conversation

@ilikecereal1

Copy link
Copy Markdown

No description provided.

asdfugil added 30 commits June 29, 2026 16:59
A10(X), T2 types will be used soon, and the rest are added for
documentation purposes.

The A9 is made in two different fabs and those have different part
numbers, and the TSMC cores are also used in A9X, so it cannot use
the usual naming scheme.

The A10(X), T2 performance/efficiency core pairs appears as single
logical cores to software, so both the performance and efficiency
core codenames needs to be included.

Signed-off-by: Nick Chan <[email protected]>
The Apple A10 family consists of physical performance and efficiency
cores, and only one of them can be active at a given time depending on
the current p-state. This results in logical cores that could switch
between P-mode and E-mode. This results in the logical core being variable
depending on the current p-state.

For example, only the physical P-core can execute 32-bit EL0, and the
physical cores have different MPIDR values.

Add a feature to denote this situation, and the workarounds for this will
be added later.

Signed-off-by: Nick Chan <[email protected]>
…bit EL0

The Apple A10 family consists of physical performance and efficiency
cores, and only one of them can be active at a given time depending on
the current p-state. However, only the performance cores can execute
32-bit EL0. This results in logical cores that can only execute 32-bit
EL0 in high p-states.

Trying to support 32-bit EL0 on a CPU that can only execute it in certain
states is a bad idea. The A10 family only supports 16KB page size anyway
so many AArch32 executables won't run anyways. Pretend that it does not
support 32-bit EL0 at all.

Signed-off-by: Nick Chan <[email protected]>
Document the dwc2 compatibles for Apple A7-A11 SoCs.

Some A9X and A10X devices support USB 3, so a -dwc2 prefix is used to
indicate these bindings are for dwc2 (as opposed to -usb).

Signed-off-by: Nick Chan <[email protected]>
Add params for Apple A7-A11 SoCs.

Signed-off-by: Nick Chan <[email protected]>
Add the OHCI compatibles for Apple A7-A11 SoCs.

Signed-off-by: Nick Chan <[email protected]>
Add the EHCI compatibles for Apple A7-A11 SoCs.

Signed-off-by: Nick Chan <[email protected]>
Add xHCI compatible for the Apple A10X SoC.

Signed-off-by: Nick Chan <[email protected]>
Export of_dma_range_parser_init() alias to allow non-PCI drivers to sanely
parse dma-ranges.

Signed-off-by: Nick Chan <[email protected]>
Add bindings for Apple USB Complex used to allow 32-bit DMA to work
without a real IOMMU.

Signed-off-by: Nick Chan <[email protected]>
Apple USB Complex has a dma remapper that allows using 32-bit DMA
without having a real IOMMU. One 4GiB sized remap can be made per device.
Add driver to support this function and model it as a bus.

Signed-off-by: Nick Chan <[email protected]>
Add driver for Apple AUSB PHY which is the USB PHY before Apple Type-C
PHY is introduced as found on Apple devices with A7 - A11 SoCs.

Signed-off-by: Nick Chan <[email protected]>
This series adds support for the CPU PMU in the older Apple A7-A11, T2
SoCs. These PMUs may have a different event layout, less counters, or
deliver their interrupts via IRQ instead of a FIQ. Since some of those
older SoCs support 32-bit EL0, counting for 32-bit EL0 also need to
be enabled by the driver where applicable.

Patch 1 adds the DT bindings.
Patch 2-7 prepares the driver to allow adding support for those
older SoCs.
Patch 8-12 adds support for the older SoCs.
Patch 13-21 are the DT changes.

To: Will Deacon <[email protected]>
To: Mark Rutland <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
To: Catalin Marinas <[email protected]>
To: Janne Grunau <[email protected]>
To: Neal Gompa <[email protected]>
To: Sven Peter <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Nick Chan <[email protected]>
---
Changes in v10:
- Modify apple_pmu_get_event_idx() to take the number of counters supported
  on the current PMU, which allows `perf record` to work correctly on A7-A9
  with 8 counters in the PMU.
- Rename the added counters to nr_counters in apple_pmu_init()
- Link to v9: https://lore.kernel.org/r/[email protected]

Changes in v9:
- Rebased on top of v6.19-rc1
- Removed non-existent "INST_A32" and "INST_T32" events from Apple A11
- Added "INST_A32" and "INST_T32" event affinities for A9 and A10
- Link to v8: https://lore.kernel.org/r/[email protected]

Changes in v8:
- Rebased on top of v6.17-rc1
- Collect Ivaylo's Tested-by
- Drop #define PMCR1_COUNT_A64_EL3_0_7
- Reword reason to not initialize PMUv3 remap in EL1
- Link to v7: https://lore.kernel.org/r/[email protected]

Changes in v7:
- Fix a W=1 compile warning in apple_pmu_get_event_idx() as appearently using GENMASK()
in a function prototype causes a warning in GCC.
- Link to v6: https://lore.kernel.org/r/[email protected]

Changes in v6:
- Rebased on top of v6.15-rc1 (Conflict with FEAT_PMUv3 support for KVM on Apple Hardware)
- Add patch to skip initialization of PMUv3 remap in EL1 even though not strictly needed
- Include DT patches
- Link to v5: https://lore.kernel.org/r/[email protected]

Changes in v5:
- Slightly change "drivers/perf: apple_m1: Add Apple A11 Support", to keep things in
chronological order.
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Support per-implementation event attr group
- Fix Apple A7 event attr groups
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Configure PMC8 and PMC9 for 32-bit EL0
- Remove redundant _common suffix from shared functions
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Remove unused flags parameter from apple_pmu_init_common()
- Link to v1: https://lore.kernel.org/r/[email protected]

--- b4-submit-tracking ---
# This section is used internally by b4 prep for tracking purposes.
{
  "series": {
    "revision": 10,
    "change-id": "20250211-apple-cpmu-5a5a3da39483",
    "prefixes": [],
    "history": {
      "v1": [
        "[email protected]"
      ],
      "v2": [
        "[email protected]"
      ],
      "v3": [
        "[email protected]"
      ],
      "v4": [
        "[email protected]"
      ],
      "v5": [
        "[email protected]"
      ],
      "v6": [
        "[email protected]"
      ],
      "v7": [
        "[email protected]"
      ],
      "v8": [
        "[email protected]"
      ],
      "v9": [
        "[email protected]"
      ]
    }
  }
}
Document the compatibles for Apple A7-A11 SoC CPU PMU.

Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Nick Chan <[email protected]>
The events in the Apple A7 PMU is very different from the ones in M1, and
EL2 is not available on Apple A7. Instead of assigning the wrong PMUv3
remap on A7 or declaring a new PMUv3 remap that would never be used in
practice, skip initializing PMUv3 remap altogther when EL2 is unavailable.

Signed-off-by: Nick Chan <[email protected]>
Use per-implementation event tables to allow supporting implementations
with a different list of events and event affinities.

Signed-off-by: Nick Chan <[email protected]>
Support a per-implementation number of counters to allow adding support
for implementations with less counters.

Signed-off-by: Nick Chan <[email protected]>
Add support for configuring counters for 32-bit EL0 to allow adding support
for implementations with 32-bit EL0.

Signed-off-by: Nick Chan <[email protected]>
Support for implementations that deliver its interrupts in ways other than
FIQ will be added, which requires a per-implementation startup function.

Signed-off-by: Nick Chan <[email protected]>
To support implementations with different event numbers for cycles or
instruction events, event attr groups needs to be per-implementation.

Signed-off-by: Nick Chan <[email protected]>
Add support for the CPU PMU found in the Apple A7 SoC. The PMU has 8
counters and a very different event layout compared to the M1 PMU.
Interrupts are delivered as IRQs instead of FIQs like on the M1.

Signed-off-by: Nick Chan <[email protected]>
Add support for the CPU PMU found on the Apple A8, A8X SoCs.

Tested-by: Ivaylo Ivanov <[email protected]>
Signed-off-by: Nick Chan <[email protected]>
Add support for CPU PMU found in the Apple A9 and A9X SoCs.

Signed-off-by: Nick Chan <[email protected]>
Add support for the CPU PMU found in the Apple A10, A10X, T2 SoCs.

Tested-by: Ivaylo Ivanov <[email protected]>
Signed-off-by: Nick Chan <[email protected]>
Add support for the CPU PMU found attached to the performance and
efficiency cores of the Apple A11 SoCs. This PMU can deliver its
interrupt via IRQ or FIQ. Use FIQ as that is faster.

Signed-off-by: Nick Chan <[email protected]>
Add CPU PMU nodes for Apple A7 SoC.

Signed-off-by: Nick Chan <[email protected]>
Add CPU PMU nodes for Apple A8 SoC.

Signed-off-by: Nick Chan <[email protected]>
Add CPU PMU nodes for Apple A8X SoC.

Signed-off-by: Nick Chan <[email protected]>
Add CPU PMU nodes for Apple A9 SoC.

Signed-off-by: Nick Chan <[email protected]>
asdfugil and others added 29 commits August 7, 2026 00:28
Add support for protocol version 10 used from iOS 11-13. In
protocol version 10, epmap is always completed within a single
message, and app endpoints start at 0x6 instead of 0x20.

Signed-off-by: Nick Chan <[email protected]>
Instead of hardcoding the SMC endpoint number, use
apple_rtkit_app_ep_to_ep() to convert a relative endpoint number to
an absolute endpoint number in order to support protocol versions
with a different start of app endpoint number.

Signed-off-by: Nick Chan <[email protected]>
The config option in the Makefile was wrong so this driver was never
compiled. The driver itself also has a missing include so add it to fix
compilation.

Signed-off-by: Nick Chan <[email protected]>
Support Apple A11 by checking keys that may not exist or have a different
type.

Signed-off-by: Nick Chan <[email protected]>
Add wireless charger events as seen on Apple A11.

Signed-off-by: Nick Chan <[email protected]>
Fixes an SError on iOS 16, Apple A11.

Signed-off-by: Nick Chan <[email protected]>
Write to the keys controlling AC power input to allow T8015-based
devices to charge on AC.

Signed-off-by: Nick Chan <[email protected]>
The SMC in T8015-based devices provides access to various hardware
sensors through SMC keys which can then be exposed via hwmon.

Currently, all supported sensors are the same across T8015-based devices.
Add the subdevice, compatible and the sensor keys to expose them.

Signed-off-by: Nick Chan <[email protected]>
Add the binding for shutting down with SMC on Apple A11 SoC. PRC SKUs has
requires different behaivor when attempting to power off when the device is
connected to power, so add a `prc-poweroff` property, which may be filled in
by loader.

Signed-off-by: Nick Chan <[email protected]>
The SMC on T8012 and T8015 SoCs works in the same way. However, there
are differences in reboot and RTC handling that cannot be probed at
runtime. Add support for these SMCs by declaring a different list of
subdevices for them.

Signed-off-by: Nick Chan <[email protected]>
Add support for powering off with SMC on T8015 which uses 'off0' in MBSE
and require different handling for shutdown_flag.

Signed-off-by: Nick Chan <[email protected]>
Add the nodes required to power-off the system.

Signed-off-by: Nick Chan <[email protected]>
In iOS, asserting force reset causes the device to restart, not poweroff.
Match that behavior here.

Signed-off-by: Nick Chan <[email protected]>
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.

4 participants