Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
e7f9187
arm: apple: map T8132 resources and use the shared EFI boot flow
erykwieliczko Oct 19, 2026
44c8133
arm: apple: retain a fully described J713 input session for Linux
erykwieliczko Oct 19, 2026
9d3b7c5
doc: describe J713 boot and retained input handoff
erykwieliczko Oct 19, 2026
3e6bd0e
arm: apple: import the live J713 handoff into per-kernel device trees
erykwieliczko Oct 19, 2026
6c1d2d1
efi: apple: import J713 USB3 and Bluetooth calibration
erykwieliczko Oct 21, 2026
cc47d3b
input: apple_mtp: support the J713 built-in keyboard console
erykwieliczko Oct 21, 2026
cba741a
Merge pull request #7 from aurora-silicon/m4/pr1-basic-bringup
RyanTheTide Oct 23, 2026
c9d8521
arm: apple: Keep booting when the helper OS fixup fails outside J713
RyanTheTide Oct 23, 2026
7680260
Merge pull request #10 from aurora-silicon/m4/j713-boot-guard-20261023
RyanTheTide Oct 23, 2026
9182193
board: apple: Name the SPI keyboard spikbd in stdin
maralcbr Oct 23, 2026
12538ef
Merge pull request #12 from aurora-silicon/fix/mac-env-spikbd-aurora-wip
RyanTheTide Oct 25, 2026
22adb96
arm: apple: reference m1n1's J713 AOP reservations from the OS tree
erikwb Oct 25, 2026
fe79799
Merge branch 'main' into aurora-wip
RyanTheTide Oct 25, 2026
29557f5
arm: apple: carry the J713 SEP boot manifests into the OS tree
erikwb Oct 25, 2026
c21ef1a
arm: apple: add T6040 (M4 Pro, J616s) boot support
RyanTheTide Oct 26, 2026
985f872
nvme: apple: support the T6040 (M4 Pro) controller
RyanTheTide Oct 26, 2026
9dbd5ae
serial: apple_dockchannel: use the data window a Linux-style DT names
RyanTheTide Oct 26, 2026
172ce2b
arm: apple: boot from the ESP that holds the EFI boot loader
RyanTheTide Oct 26, 2026
b1e8c22
arm: apple: map the T6040 PCIe ECAM and windows
RyanTheTide Oct 26, 2026
104d103
nvme: apple: give post-M4 firmware both TCB arrays before enabling
RyanTheTide Oct 26, 2026
91d0f5c
nvme: apple: wake a T6040 ANS handed over asleep
RyanTheTide Oct 26, 2026
216fd2f
nvme: apple: run the T6040 ANS handshake and hand the session on live
RyanTheTide Oct 26, 2026
f5cd324
arm: apple: let the J713 import take a 192 KiB m1n1 tree
erikwb Oct 25, 2026
d032fb2
nvme: apple: on T6040, adopt unless the ANS is fresh from iBoot
RyanTheTide Oct 26, 2026
cf48be6
Merge pull request #16 from aurora-silicon/j616s/t6040-prod-boot
RyanTheTide Oct 28, 2026
2a03f0c
configs: apple_m1: boot without a serial console
RyanTheTide Oct 28, 2026
fa3af56
Merge pull request #17 from aurora-silicon/fix/apple-no-serial-console
RyanTheTide Oct 28, 2026
14bc514
video: start the console below the logo
RyanTheTide Oct 28, 2026
41f9f87
video: keep the console beside the logo instead of below it
RyanTheTide Oct 28, 2026
bbdf2ff
arm: apple: boot without a countdown on the Aurora EFI path
RyanTheTide Oct 28, 2026
63dc1ea
input: apple_mtp_kbd: start the keyboard before autoboot without a co…
RyanTheTide Oct 29, 2026
bd9f30c
Merge pull request #18 from aurora-silicon/fix/video-console-below-logo
RyanTheTide Oct 29, 2026
9d14b0d
Merge pull request #19 from aurora-silicon/fix/apple-fast-autoboot
RyanTheTide Oct 29, 2026
cbb2afa
Merge pull request #13 from erikwb/j713/aop-import
RyanTheTide Oct 29, 2026
2409ad5
Merge pull request #14 from erikwb/j713/sep-manifests
RyanTheTide Oct 29, 2026
00df3c7
Merge branch 'aurora-wip' into j713/fdt-source-limit
RyanTheTide Oct 30, 2026
badc1de
Merge pull request #15 from erikwb/j713/fdt-source-limit
RyanTheTide Oct 30, 2026
1502cd1
test/py: apple_mtp_keyboard: model the deferred keyboard enable
RyanTheTide Oct 30, 2026
6e68f97
Merge pull request #20 from aurora-silicon/test/mtpkbd-quiet-enable
RyanTheTide Oct 30, 2026
a696b1c
arm: apple: only leave the named ESP when it belongs to no install
RyanTheTide Oct 30, 2026
1e4bda3
arm: apple: leave the USB-C ports to the OS on machines with a keyboard
RyanTheTide Oct 30, 2026
e0d0cbb
nvme: apple: restart a pre-M4 ANS that the previous stage left running
RyanTheTide Oct 30, 2026
b9c3480
arm: apple: read the DRAM ranges in one pass of the device tree
RyanTheTide Oct 30, 2026
d70694a
Merge pull request #23 from aurora-silicon/fix/nvme-apple-recover-ans
RyanTheTide Oct 30, 2026
0f9b75d
Merge pull request #24 from aurora-silicon/fix/apple-dram-banksize-on…
RyanTheTide Oct 30, 2026
f22cbc0
Merge pull request #22 from aurora-silicon/fix/t6000-no-auto-usb-star…
RyanTheTide Oct 30, 2026
d5d709f
Revert "nvme: apple: restart a pre-M4 ANS that the previous stage lef…
RyanTheTide Oct 30, 2026
01f255b
Merge pull request #25 from aurora-silicon/revert/nvme-apple-recover-ans
RyanTheTide Oct 30, 2026
4ece59f
nvme: apple: Don't set a DMA direction for commands without a data tr…
jannau Sep 4, 2026
6ca70eb
nvme: apple: Never set the opcode in the NVMMU TCB
jannau Sep 4, 2026
e3c7970
nvme: apple: Add WARN_ON_ONCE for non page-aligned admin queue buffers
jannau Sep 4, 2026
7e340d9
nvme: apple: Drop the PRP null check chicken bit
jannau Sep 4, 2026
0b0d0c0
armv8: sysinfo: name Apple as a CPU implementer
RyanTheTide Oct 31, 2026
27d73e3
armv8: sysinfo: count the cores from the device tree
RyanTheTide Oct 31, 2026
2063656
armv8: sysinfo: report MIDR_EL1 as the processor ID
RyanTheTide Oct 31, 2026
238d9ed
armv8: sysinfo: size caches from their ways and decode FEAT_CCIDX
RyanTheTide Oct 31, 2026
127f4ad
smbios: fix the default cache configuration level
RyanTheTide Oct 31, 2026
b5f66a1
smbios: link described memory devices to their memory array
RyanTheTide Oct 31, 2026
9640c5d
smbios: describe caches from the device tree when the CPU cannot
RyanTheTide Nov 1, 2026
d2c0d0d
smbios: take more of the platform description from the device tree
RyanTheTide Nov 1, 2026
b6eaecf
smbios: add the Firmware Inventory (type 45)
RyanTheTide Nov 1, 2026
6e3c9b3
smbios: let device tree caches replace the CPU's description
RyanTheTide Nov 1, 2026
32e2682
efi_loader: pass the boot timings to the payload's device tree
RyanTheTide Oct 31, 2026
f4fa7ab
configs: apple_m1: boot without a countdown on every Apple machine
RyanTheTide Oct 31, 2026
15bf221
arm64: relocate_code: drop stale I-cache lines with the D-cache off
RyanTheTide Oct 30, 2026
f19e070
arm: apple: turn the I-cache on at entry
RyanTheTide Oct 30, 2026
7d97eb1
arm: apple: keep the boot quiet on the panel
RyanTheTide Nov 1, 2026
d041983
smbios: let the platform describe U-Boot's own firmware inventory entry
RyanTheTide Nov 1, 2026
d30213e
Merge pull request #28 from aurora-silicon/pr/apple-boot-speed-smbios
RyanTheTide Nov 1, 2026
11f3e37
arm: apple: hand off J614s MTP input to Linux
notmysegv Nov 1, 2026
3592858
arm: apple: match the T8122 MTP helper compatible
satchlj Nov 2, 2026
6780e23
arm: apple: hand the running J613 MTP session to Linux
satchlj Nov 2, 2026
3c3b759
arm: apple: start the J613 keyboard before autoboot
satchlj Nov 2, 2026
279c4af
Merge pull request #29 from mchalunderscore/codex/j614s-mtp-handoff
RyanTheTide Nov 4, 2026
15882e5
arm: apple: import the J713 external DCP handoff
erikwb Nov 3, 2026
b95bcf8
Merge pull request #31 from erikwb/j713/dcpext-import-pr
RyanTheTide Nov 5, 2026
34832c1
arm: apple: keep Linux inside the CTXR executable window
DjDeveloperr Nov 5, 2026
0b70e14
Merge branch 'aurora-wip' into j613/mtp-live-handoff
satchlj Nov 5, 2026
e988922
test/py: apple: model the J613 MTP handoff calls
satchlj Nov 5, 2026
385b16c
arm: apple: import the J713 speaker amps configuration
erikwb Nov 5, 2026
d4c2218
arm: apple: import the J713 ISP handoff
erikwb Nov 5, 2026
37f6ad6
boot: relocate U-Boot's image into the CTXR window
DjDeveloperr Nov 6, 2026
80270d9
efi_loader: allocate runtime code inside the CTXR window
DjDeveloperr Nov 6, 2026
d510822
efi_loader: free all of a kernel placed in the CTXR window
DjDeveloperr Nov 6, 2026
0c8f416
Merge pull request #34 from erikwb/j713/isp-import
RyanTheTide Nov 6, 2026
c2992df
Merge aurora-wip into j713/amp-import
RyanTheTide Nov 6, 2026
51867ea
lmb: set the CTXR window aside until something needs it
DjDeveloperr Nov 6, 2026
23830a2
Merge pull request #35 from aurora-silicon/merge-train/ub33-j713-amp-…
RyanTheTide Nov 6, 2026
50d879a
efi_loader: keep a kernel a UKI loads itself in the CTXR window
DjDeveloperr Nov 6, 2026
9534afa
boot: ctxr: follow the kernel's window checks and warn instead of ref…
DjDeveloperr Nov 6, 2026
11bc03e
boot: ctxr: place U-Boot's image once the rest of its memory is reserved
DjDeveloperr Nov 6, 2026
9bd67f3
lmb: keep the CTXR window in struct lmb and test it
DjDeveloperr Nov 6, 2026
bc25256
efi_loader: keep device-tree reservations out of the CTXR window
DjDeveloperr Nov 7, 2026
db201ad
boot: ctxr: give back the window place a failed booti took
DjDeveloperr Nov 7, 2026
ab2adea
efi_loader: serve only a UKI's kernel from the CTXR window
DjDeveloperr Nov 7, 2026
b67f7a6
efi_loader: give runtime code in the CTXR window whole 64 KiB blocks
DjDeveloperr Nov 7, 2026
53df873
efi_loader: free a PE image's pages when measuring it fails
DjDeveloperr Nov 7, 2026
bb6e1e3
doc: apple: describe the CTXR window support as it is
DjDeveloperr Nov 7, 2026
f0b57d9
efi_loader: warn for a UKI's zboot kernel and its runtime code
DjDeveloperr Nov 7, 2026
870faee
boot: bootm: don't reserve a load address the window holds
DjDeveloperr Nov 7, 2026
4c218cc
boot: ctxr: treat an image larger than the window as not fitting
DjDeveloperr Nov 7, 2026
faafafd
efi_loader: free only what runtime code in the CTXR window asked for
DjDeveloperr Nov 7, 2026
5532454
boot: ctxr: keep U-Boot's image clear of the early gd and malloc area
DjDeveloperr Nov 7, 2026
cecaa61
test: lmb: check that lmb_push() saves the CTXR window
DjDeveloperr Nov 7, 2026
7e540a0
doc: apple: say when U-Boot's image stays out of the CTXR window
DjDeveloperr Nov 7, 2026
29ce27c
Revert "efi_loader: free only what runtime code in the CTXR window as…
DjDeveloperr Nov 7, 2026
7791f7a
doc: apple: note what freeing part of CTXR runtime code does
DjDeveloperr Nov 7, 2026
62ee470
Merge pull request #32 from aurora-silicon/feat/ctxr-exec-window
RyanTheTide Nov 7, 2026
e1ef8b6
Merge pull request #36 from aurora-silicon/feat/ctxr-exec-window-foll…
DjDeveloperr Nov 7, 2026
7a68531
arm: apple: Boot the T6050 (M5 Max, J714c) from NVMe
edimoldovan Nov 7, 2026
70e9908
nvme: apple: T6050: adopt the live ANS session an m1n1 stage 2 hands …
edimoldovan Nov 7, 2026
1b67d29
boot: ctxr: read reserved-memory regions without fdt_get_resource()
jgoyvaerts Nov 8, 2026
1f80013
Merge pull request #41 from aurora-silicon/j714c/t6050-adopt
RyanTheTide Nov 9, 2026
9e483da
arm: apple: boot the M4 Max (T6041) like the M4 Pro (T6040)
joske Nov 9, 2026
48c6b2c
Merge pull request #42 from joske/t6041-boot
DjDeveloperr Nov 9, 2026
1eb642e
efi_loader: record loaded images for the OS; apple: Secure Boot config
RyanTheTide Nov 9, 2026
aab6ca9
Merge pull request #26 from aurora-silicon/fix/apple-nvme-macos15-fir…
RyanTheTide Nov 9, 2026
e08ab5e
input: apple_mtp_kbd: leave the J604's MTP to Linux
Nov 10, 2026
21b22a7
Merge pull request #44 from aeries0x/j604-mtp-os-pr
RyanTheTide Nov 10, 2026
eb0eb94
efi_loader: decompress a zboot kernel into the CTXR window (#45)
RyanTheTide Nov 10, 2026
fb4bcdf
Merge pull request #39 from aurora-silicon/fix/ctxr-reserved-scan
RyanTheTide Nov 10, 2026
6363e77
Merge pull request #30 from aurora-silicon/j613/mtp-live-handoff
RyanTheTide Nov 10, 2026
c9d8972
Merge remote-tracking branch 'origin/aurora-wip' into fix/esp-fallbac…
RyanTheTide Nov 10, 2026
ece5d4c
Merge pull request #21 from aurora-silicon/fix/esp-fallback-fail-safe
RyanTheTide Nov 10, 2026
d6420d8
video: keep the loader's picture on a quiet boot
RyanTheTide Nov 10, 2026
250385f
Merge pull request #46 from aurora-silicon/bootux/quiet-boot
RyanTheTide Nov 10, 2026
23fd92d
efi_loader: Secure Boot audit mode; apple: audit by default, no Micro…
RyanTheTide Nov 11, 2026
1e4ff90
Merge remote-tracking branch 'origin/aurora-wip' into feat/secboot-me…
RyanTheTide Nov 11, 2026
d5433e7
apple: Secure Boot: keep the signed-only bootcmd, no saved environment
RyanTheTide Nov 11, 2026
e51e647
Merge pull request #43 from aurora-silicon/feat/secboot-measured-efi
RyanTheTide Nov 11, 2026
73f9ffb
nvme: apple: bind the T8140 and T8142 controllers
gig3m Nov 12, 2026
25cbb0f
Merge pull request #47 from gig3m/nvme-t8142-compat-pr
RyanTheTide Nov 12, 2026
d7ee44c
arm: apple: import the J713 ISP address filter windows
erikwb Nov 19, 2026
a59fb24
serial: apple_dockchannel: require the named data window
RyanTheTide Nov 19, 2026
5cb7611
power: apple-pmgr: Bound a power-state change in milliseconds
RyanTheTide Nov 19, 2026
21e9d04
phy: apple: atc: Name the A18 Pro eUSB2 repeater settle time
RyanTheTide Nov 19, 2026
b701638
apple: pick the ESP on every Apple NVMe controller
root800080 Nov 19, 2026
37baf8f
Merge pull request #52 from erikwb/j713/isp-dapf-import
DjDeveloperr Nov 19, 2026
024107e
arm: apple: hand the T8112 MTP over running on macOS 27 firmware
satchlj Nov 20, 2026
c342228
arm: apple: give the T8112 27.x trackpad the two-stage power command
satchlj Nov 20, 2026
6f50fc2
arm: apple: hand an MTP over running when its device tree says so
satchlj Nov 20, 2026
11bf692
Merge pull request #67 from aurora-silicon/satchlj/t8112-mtp-live-han…
DjDeveloperr Nov 20, 2026
dc6c095
power: domain: apple: allow 10 ms for a power-state change
RyanTheTide Nov 21, 2026
359941d
Merge pull request #59 from aurora-silicon/deadweight/dockchannel-nam…
RyanTheTide Nov 21, 2026
5266dce
Merge pull request #64 from aurora-silicon/hack/boot-sweep
RyanTheTide Nov 21, 2026
5445237
Merge pull request #50 from root800080/uboot-esp-by-driver
RyanTheTide Nov 21, 2026
91e33f5
input: apple_mtp_kbd: leave every T8142 MTP to the OS
m0d16l14n1 Nov 14, 2026
da9bad5
input: apple_mtp_kbd: leave an MTP handed to the OS halted alone
kazuhidet Nov 22, 2026
91409c2
Merge pull request #69 from kazuhidet/j715/mtp-cold
DjDeveloperr Nov 25, 2026
a77367c
video: vidconsole: keep the line start on ANSI cursor moves
RyanTheTide Nov 25, 2026
d6298e3
video: show a blinking text cursor on the video console
RyanTheTide Nov 25, 2026
c2a5cbc
Merge pull request #74 from aurora-silicon/feat/video-blinking-cursor
DjDeveloperr Nov 25, 2026
e5b8826
fdt: decode /reserved-memory reg directly when ranges is empty
jgoyvaerts Nov 25, 2026
0f65cb4
Merge pull request #75 from aurora-silicon/feat/fdt-reserved-memory-d…
DjDeveloperr Nov 26, 2026
6d29270
apple: follow Aura's enforce policy in the default build
DjDeveloperr Nov 26, 2026
931d73d
Merge remote-tracking branch 'origin/aurora-wip' into j815/mtp-kbd
m0d16l14n1 Nov 26, 2026
84382f6
Merge pull request #78 from aurora-silicon/fix/aura-enforce-policy
DjDeveloperr Nov 26, 2026
944606d
arm: apple: ignore non-RAM apple,dma-range for bypass RTKit helper al…
satchlj Nov 28, 2026
641c39f
usb: xhci: implement non-blocking interrupt IN transfers
sithglan Nov 30, 2026
e7aecd4
efi_loader: advance overdue periodic timers past current time
sithglan Nov 30, 2026
1ee10f7
Merge pull request #79 from aurora-silicon/satchlj/rtkit-helper-dma-r…
RyanTheTide Dec 1, 2026
5c0d5fe
Merge pull request #81 from aurora-silicon/fix/xhci-nonblock-int
DjDeveloperr Dec 1, 2026
5f28264
Merge pull request #51 from m0d16l14n1/j815/mtp-kbd
RyanTheTide Dec 2, 2026
41e527f
input: apple_mtp_kbd: leave the T6020 MTP to the OS
DjDeveloperr Dec 2, 2026
6476b5b
Merge origin/aurora-wip into feat/t6020-mtp-untouched
DjDeveloperr Dec 2, 2026
82260b6
Merge pull request #82 from aurora-silicon/feat/t6020-mtp-untouched
DjDeveloperr Dec 2, 2026
8777ae7
input: apple_mtp_kbd: leave keep-running MTPs to the OS
ParaN3xus Dec 2, 2026
0eb95ea
Merge pull request #83 from ParaN3xus/fix/mtp-keep-running
RyanTheTide Dec 2, 2026
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: 2 additions & 0 deletions .github/workflows/apple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
make O="build-$config" CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm -j2
python3 tools/aurora_release.py --version "$RELEASE_VERSION" --config "$config" --build-dir "build-$config" --compiler aarch64-linux-gnu-gcc
done
# aurora-secboot fills this region before it signs Stage 2.
python3 tools/aurora_uefi_seed.py build-apple_m1/u-boot-nodtb.bin
cd dist
sha256sum --check SHA256SUMS
- uses: actions/upload-artifact@v7
Expand Down
86 changes: 71 additions & 15 deletions arch/arm/cpu/armv8/sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Author: Raymond Mao <raymond.mao@linaro.org>
*/
#include <dm.h>
#include <dm/ofnode.h>
#include <linux/string.h>
#include <smbios_plat.h>
#include <stdio.h>
#include <sysinfo.h>
Expand Down Expand Up @@ -79,6 +81,7 @@ enum {
VENDOR_AMCC = 0x50,
VENDOR_QUALCOMM = 0x51,
VENDOR_MARVELL = 0x56,
VENDOR_APPLE = 0x61,
VENDOR_INTEL = 0x69,
VENDOR_AMPERE = 0xc0,
};
Expand All @@ -98,9 +101,9 @@ enum {
*/
int sysinfo_get_cache_info(u8 level, struct cache_info *cinfo)
{
u64 clidr_el1;
u64 clidr_el1, mmfr2_el1;
u32 csselr_el1;
u32 num_sets;
u32 num_sets, ways;
union ccsidr_el1 creg;
int cache_type;

Expand Down Expand Up @@ -140,11 +143,24 @@ int sysinfo_get_cache_info(u8 level, struct cache_info *cinfo)
asm volatile("mrs %0, ccsidr_el1" : "=r" (creg.data));
debug("CCSIDR_EL1 (Level %d): 0x%llx\n", level + 1, creg.data);

/* Extract cache size and associativity */
cinfo->line_size = 1 << (creg.no_ccidx.linesize + 4);
/*
* Extract cache size and associativity. With FEAT_CCIDX
* (ID_AA64MMFR2_EL1.CCIDX), CCSIDR_EL1 has wider fields at other
* positions.
*/
asm volatile("mrs %0, id_aa64mmfr2_el1" : "=r" (mmfr2_el1));
if ((mmfr2_el1 >> 20) & 0xf) {
cinfo->line_size = 1 << (creg.ccidx_aarch64.linesize + 4);
ways = creg.ccidx_aarch64.associativity + 1;
num_sets = creg.ccidx_aarch64.numsets + 1;
} else {
cinfo->line_size = 1 << (creg.no_ccidx.linesize + 4);
ways = creg.no_ccidx.associativity + 1;
num_sets = creg.no_ccidx.numsets + 1;
}

/* Map the associativity value */
switch (creg.no_ccidx.associativity + 1) {
switch (ways) {
case CACHE_ASSOC_DIRECT_MAPPED:
cinfo->associativity = SMBIOS_CACHE_ASSOC_DMAPPED;
break;
Expand Down Expand Up @@ -183,14 +199,18 @@ int sysinfo_get_cache_info(u8 level, struct cache_info *cinfo)
break;
}

num_sets = creg.no_ccidx.numsets + 1;
/* Size in KB */
cinfo->max_size = (cinfo->associativity * num_sets * cinfo->line_size) /
1024;
/* Size in KB, from the number of ways, not the SMBIOS code for it */
cinfo->max_size = (ways * num_sets * cinfo->line_size) / 1024;
/*
* Some cores, Apple's among them, leave the geometry fields empty.
* Describe no level rather than a cache of 0 KiB.
*/
if (!cinfo->max_size)
return -1;

debug("L%d Cache:\n", level + 1);
debug("Number of bytes in cache line:%u\n", cinfo->line_size);
debug("Associativity of cache:%u\n", cinfo->associativity);
debug("Associativity of cache:%u\n", ways);
debug("Number of sets in cache:%u\n", num_sets);
debug("Cache size in KB:%u\n", cinfo->max_size);

Expand All @@ -207,6 +227,26 @@ int sysinfo_get_cache_info(u8 level, struct cache_info *cinfo)
return 0;
}

/* Count the enabled CPU nodes of the device tree, or return 0 if it has none */
static int sysinfo_count_dt_cpus(void)
{
ofnode cpus, node;
int count = 0;

cpus = ofnode_path("/cpus");
if (!ofnode_valid(cpus))
return 0;

ofnode_for_each_subnode(node, cpus) {
const char *type = ofnode_read_string(node, "device_type");

if (type && !strcmp(type, "cpu") && ofnode_is_enabled(node))
count++;
}

return count;
}

int sysinfo_get_processor_info(struct processor_info *pinfo)
{
u64 mpidr, core_count;
Expand Down Expand Up @@ -256,6 +296,9 @@ int sysinfo_get_processor_info(struct processor_info *pinfo)
case VENDOR_MARVELL:
pinfo->manufacturer = "Marvell International Ltd";
break;
case VENDOR_APPLE:
pinfo->manufacturer = "Apple Inc.";
break;
case VENDOR_INTEL:
pinfo->manufacturer = "Intel Corporation";
break;
Expand All @@ -271,17 +314,30 @@ int sysinfo_get_processor_info(struct processor_info *pinfo)
debug("CPU architecture: 0x%x\n", midr.fields.architecture);
debug("CPU variant: 0x%x\n", midr.fields.variant);

/* Extract number of cores */
core_count = (mpidr >> 0) & 0xFF;
pinfo->core_count = core_count + 1;
/*
* Count the cores in the device tree. MPIDR_EL1 only identifies the
* boot core, so its Aff0 is a guess kept for boards without CPU nodes.
*/
core_count = sysinfo_count_dt_cpus();
if (!core_count)
core_count = ((mpidr >> 0) & 0xFF) + 1;
pinfo->core_count = core_count;
debug("CPU Core Count: %d\n", pinfo->core_count);

pinfo->core_enabled = pinfo->core_count;
pinfo->characteristics = SMBIOS_PROCESSOR_64BIT |
SMBIOS_PROCESSOR_ARM64_SOCID;
pinfo->characteristics = SMBIOS_PROCESSOR_64BIT;
if (pinfo->core_count > 1)
pinfo->characteristics |= SMBIOS_PROCESSOR_MULTICORE;

/*
* The Processor ID of an Arm64 processor is the SMCCC_ARCH_SOC_ID
* value when the "Arm64 SoC ID" characteristic is set and MIDR_EL1
* otherwise. Nothing here queries SMCCC_ARCH_SOC_ID, so report
* MIDR_EL1 rather than claim an SoC ID and leave the field empty.
*/
pinfo->id[0] = (u32)midr.data;
pinfo->id[1] = 0;

/*
* Below fields with common values are placed under DT smbios node
* version, processor-type, processor-status, upgrade, family2,
Expand Down
18 changes: 18 additions & 0 deletions arch/arm/include/asm/arch-apple/j713_fdt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* SPDX-License-Identifier: GPL-2.0-or-later OR MIT */
#ifndef _APPLE_J713_FDT_H
#define _APPLE_J713_FDT_H

#define J713_FDT_MAX_SOURCE (192 * 1024)
#define J713_FDT_EXTRA_PAD (16 * 1024)
#define J713_FDT_MIN_PAD (J713_FDT_MAX_SOURCE + J713_FDT_EXTRA_PAD)

#if !defined(J713_FDT_HOST_TEST) && defined(CONFIG_APPLE_J713_FDT)
#if CONFIG_SYS_FDT_PAD < J713_FDT_MIN_PAD
#error "J713 per-UKI FDT import requires CONFIG_SYS_FDT_PAD >= 208 KiB"
#endif
#endif

int apple_j713_import_fdt(void *blob, const void *source);
int apple_j713_complete_fdt(void *blob);

#endif
12 changes: 12 additions & 0 deletions arch/arm/include/asm/arch-apple/nvme_apple.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0+ */
#ifndef __ASM_ARCH_APPLE_NVME_APPLE_H
#define __ASM_ARCH_APPLE_NVME_APPLE_H

/* Reserve, in the OS devicetree, RTKit buffers of an ANS session handed on live. */
#if IS_ENABLED(CONFIG_NVME_APPLE)
int apple_nvme_fdt_fixup(void *blob);
#else
static inline int apple_nvme_fdt_fixup(void *blob) { return 0; }
#endif

#endif
15 changes: 15 additions & 0 deletions arch/arm/include/asm/arch-apple/rtkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,28 @@ struct apple_rtkit *apple_rtkit_init(struct mbox_chan *chan, void *cookie,
apple_rtkit_shmem_setup shmem_setup,
apple_rtkit_shmem_destroy shmem_destroy);
void apple_rtkit_free(struct apple_rtkit *rtk);
int apple_rtkit_get_buffers(struct apple_rtkit *rtk,
struct apple_rtkit_buffer *buffers, size_t count);
int apple_rtkit_boot(struct apple_rtkit *rtk);
int apple_rtkit_boot_with_sys_ep_mask(struct apple_rtkit *rtk, u32 system_eps);
int apple_rtkit_set_ap_power(struct apple_rtkit *rtk, int pwrstate);
int apple_rtkit_poll(struct apple_rtkit *rtk, ulong timeout);
int apple_rtkit_shutdown(struct apple_rtkit *rtk, int pwrstate);

int apple_rtkit_helper_poll(struct udevice *dev, ulong timeout);
/* Only publish a J713 session after its first HID discovery header is pending. */
void apple_rtkit_helper_input_ready(struct udevice *dev);
bool apple_rtkit_helper_input_prepared(struct udevice *dev);
bool apple_rtkit_helper_input_retained(struct udevice *dev);
void apple_rtkit_helper_input_failed(struct udevice *dev);

bool apple_rtkit_helper_allowed(ofnode node);
#if IS_ENABLED(CONFIG_APPLE_MTP_KEYB)
bool apple_rtkit_helper_keeps_running(ofnode node);
bool apple_rtkit_helper_any_keeps_running(void);
#else
static inline bool apple_rtkit_helper_keeps_running(ofnode node) { return false; }
static inline bool apple_rtkit_helper_any_keeps_running(void) { return false; }
#endif
/* Describe a helper the OS must adopt while it runs (OS device tree fixup). */
int apple_rtkit_helper_fdt_fixup(void *blob);
8 changes: 8 additions & 0 deletions arch/arm/lib/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*/

#include <ctxr_exec_window.h>
#include <image.h>
#include <mapmem.h>
#include <asm/global_data.h>
Expand Down Expand Up @@ -31,6 +32,7 @@ struct Image_header {
int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
bool force_reloc)
{
struct ctxr_exec_window win;
struct Image_header *ih;
uint64_t dst;
uint64_t image_size, text_offset;
Expand Down Expand Up @@ -71,6 +73,12 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
else
dst = gd->bd->bi_dram[0].start;

/* Outside its window, a kernel keeps its secondary CPUs offline */
if (ctxr_exec_window_get(&win) &&
(text_offset > win.size || image_size > win.size - text_offset ||
ctxr_exec_place_booti(&win, text_offset + image_size, &dst)))
ctxr_exec_warn_outside(&win, "no free 2 MiB aligned range fits the Linux image");

*relocated_addr = ALIGN(dst, SZ_2M) + text_offset;

unmap_sysmem(ih);
Expand Down
13 changes: 12 additions & 1 deletion arch/arm/lib/relocate_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,24 @@ relocate_done:
2: mrs x0, sctlr_el2
b 0f
1: mrs x0, sctlr_el1
0: tbz w0, #2, 5f /* skip flushing cache if disabled */
0: tbz w0, #2, 6f /* skip flushing cache if disabled */
tbz w0, #12, 4f /* skip invalidating i-cache if disabled */
ic iallu /* i-cache invalidate all */
isb sy
4: ldp x0, x1, [sp, #16]
bl __asm_flush_dcache_range
bl __asm_flush_l3_dcache
b 5f
/*
* The I-cache can be on while the D-cache is still off. The copy
* went straight to memory then, but the I-cache may hold lines of
* the destination, so drop them before running the new copy.
*/
6: tbz w0, #12, 5f /* skip invalidating i-cache if disabled */
dsb sy
ic iallu /* i-cache invalidate all */
dsb sy
isb sy
5: ldp x29, x30, [sp],#32
ret
ENDPROC(relocate_code)
9 changes: 9 additions & 0 deletions arch/arm/mach-apple/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@ config SYS_MALLOC_F_LEN
config LNX_KRNL_IMG_TEXT_OFFSET_BASE
default TEXT_BASE

config APPLE_J713_FDT
bool "Support J713 per-kernel device-tree handoff"
depends on OF_BOARD_SETUP && APPLE_MTP_KEYB
help
Import the live J713 firmware resources into an explicitly selected
kernel device tree. This requires the retained MTP helper and at least
208 KiB of SYS_FDT_PAD. Enable this for the shared Apple boot image;
other Apple configurations can keep their existing FDT allocation.

endif
1 change: 1 addition & 0 deletions arch/arm/mach-apple/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0+

obj-y += board.o
obj-$(CONFIG_APPLE_J713_FDT) += j713_fdt.o
obj-y += lowlevel_init.o
obj-y += rtkit.o
obj-$(CONFIG_APPLE_MTP_KEYB) += rtkit_helper.o
Expand Down
Loading
Loading