diff --git a/devices/n66/device.toml b/devices/n66/device.toml index 71eea464..618d2773 100644 --- a/devices/n66/device.toml +++ b/devices/n66/device.toml @@ -38,8 +38,8 @@ backlight = "working" # dark, bright and normal levels (RAM boot 2026-11-23) gpu_desktop = "untested" touch = "working" # N1 C1F5C, both firmware packets; multitouch, corners checked (RAM boot 2026-11-23) buttons = "working" # home, power, volume up/down, mute switch (RAM boot 2026-11-23) -accelerometer = "untested" # AOP with aopfw-s8000aop; mount-matrix not measured -gyroscope = "untested" +accelerometer = "working" # AOP with aopfw-s8000aop, measured mount matrix diag(1,1,-1); six poses give the right iio-sensor-proxy orientations (RAM boot 2026-11-23) +gyroscope = "working" # AOP MPU6800, identity matrix; rates follow the accelerometer's rotation; x sign weakly fixed, rate scale unchecked (RAM boot 2026-11-23) light_sensor = "working" # CT821 with the unit's LSCI calibration (RAM boot 2026-11-23) touch_id = "missing" storage_read = "working" # NVMe 5 GT/s x2, 1 GiB read, no faults or timeouts (RAM boot 2026-11-22) diff --git a/devices/n66m/device.toml b/devices/n66m/device.toml index 193abe5e..e5d2f02e 100644 --- a/devices/n66m/device.toml +++ b/devices/n66m/device.toml @@ -37,7 +37,7 @@ backlight = "untested" gpu_desktop = "untested" touch = "untested" buttons = "untested" -accelerometer = "untested" # AOP with aopfw-s8000aop; mount-matrix not measured +accelerometer = "untested" # AOP with aopfw-s8000aop; mount matrix measured on the N66 (shared s800x-iphone.dtsi) gyroscope = "untested" light_sensor = "untested" touch_id = "missing" diff --git a/devices/n69/device.toml b/devices/n69/device.toml index fca19548..bbd2b9b4 100644 --- a/devices/n69/device.toml +++ b/devices/n69/device.toml @@ -37,7 +37,7 @@ backlight = "untested" gpu_desktop = "untested" touch = "untested" buttons = "untested" -accelerometer = "untested" # AOP with aopfw-s8000aop; mount-matrix not measured +accelerometer = "untested" # AOP with aopfw-s8000aop; mount matrix measured on the N66 (shared s800x-iphone.dtsi) gyroscope = "untested" light_sensor = "untested" touch_id = "missing" diff --git a/devices/n69u/device.toml b/devices/n69u/device.toml index fbe89203..b2640027 100644 --- a/devices/n69u/device.toml +++ b/devices/n69u/device.toml @@ -37,7 +37,7 @@ backlight = "untested" gpu_desktop = "untested" touch = "untested" buttons = "untested" -accelerometer = "untested" # AOP with aopfw-s8000aop; mount-matrix not measured +accelerometer = "untested" # AOP with aopfw-s8000aop; mount matrix measured on the N66 (shared s800x-iphone.dtsi) gyroscope = "untested" light_sensor = "untested" touch_id = "missing" diff --git a/devices/n71/device.toml b/devices/n71/device.toml index 70d03111..130dfef9 100644 --- a/devices/n71/device.toml +++ b/devices/n71/device.toml @@ -37,7 +37,7 @@ backlight = "untested" gpu_desktop = "untested" touch = "untested" buttons = "untested" -accelerometer = "untested" # AOP with aopfw-s8000aop; mount-matrix not measured +accelerometer = "untested" # AOP with aopfw-s8000aop; mount matrix measured on the N66 (shared s800x-iphone.dtsi) gyroscope = "untested" light_sensor = "untested" touch_id = "missing" diff --git a/devices/n71m/device.toml b/devices/n71m/device.toml index 4b8256ad..f1ebf29f 100644 --- a/devices/n71m/device.toml +++ b/devices/n71m/device.toml @@ -37,7 +37,7 @@ backlight = "untested" gpu_desktop = "untested" touch = "untested" buttons = "untested" -accelerometer = "untested" # AOP with aopfw-s8000aop; mount-matrix not measured +accelerometer = "untested" # AOP with aopfw-s8000aop; mount matrix measured on the N66 (shared s800x-iphone.dtsi) gyroscope = "untested" light_sensor = "untested" touch_id = "missing" diff --git a/docs/compatibility.md b/docs/compatibility.md index 84fc2e37..dc8bf6d2 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -39,7 +39,7 @@ Every device Orchard installs on. ✅ works · ❌ doesn't work yet · – no su | iPad 5 (Wi-Fi) | A9, TSMC | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | [brkosebay](https://github.com/brkosebay) | | iPhone 6s | A9, Samsung | 🤔 | 🤔 | 🤔 | ❌ | ❌ | ❌ | 🤔 | 🤔 | 🤔 | – | | iPhone 6s | A9, TSMC | 🤔 | 🤔 | 🤔 | ❌ | ❌ | ❌ | 🤔 | 🤔 | 🤔 | – | -| iPhone 6s Plus | A9, Samsung | ✅ | 🤔 | ✅ | ❌ | ❌ | ❌ | 🤔 | 🤔 | 🤔 | [ricktav](https://github.com/ricktav) | +| iPhone 6s Plus | A9, Samsung | ✅ | 🤔 | ✅ | ❌ | ❌ | ❌ | 🤔 | 🤔 | ✅ | [ricktav](https://github.com/ricktav) | | iPhone 6s Plus | A9, TSMC | 🤔 | 🤔 | 🤔 | ❌ | ❌ | ❌ | 🤔 | 🤔 | 🤔 | – | | iPhone SE | A9, Samsung | 🤔 | 🤔 | 🤔 | ❌ | ❌ | ❌ | 🤔 | 🤔 | 🤔 | – | | iPhone SE | A9, TSMC | 🤔 | 🤔 | 🤔 | ❌ | ❌ | ❌ | 🤔 | 🤔 | 🤔 | – | @@ -213,7 +213,7 @@ Boards Orchard builds for. States: working, untested, missing, none (no such har | `j82` | untested | untested | untested | missing | untested | untested | missing | missing | missing | missing | untested | untested | untested | untested | untested | missing | untested | untested | untested | untested | untested | untested | untested | missing | untested | missing | missing | missing | | `j71s` | untested | untested | untested | untested | untested | untested | untested | untested | untested | missing | untested | untested | untested | untested | untested | none | untested | untested | untested | untested | untested | untested | untested | untested | untested | untested | missing | untested | | `j72s` | untested | untested | untested | untested | untested | untested | untested | untested | untested | missing | untested | untested | untested | untested | untested | missing | untested | untested | untested | untested | untested | untested | untested | untested | untested | untested | missing | untested | -| `n66` | working | untested | working | untested | working | working | untested | untested | working | missing | working | working | missing | missing | missing | missing | untested | untested | missing | untested | untested | untested | untested | missing | missing | missing | missing | untested | +| `n66` | working | untested | working | untested | working | working | working | working | working | missing | working | working | missing | missing | missing | missing | untested | untested | missing | untested | untested | untested | untested | missing | missing | missing | missing | untested | | `n69u` | untested | untested | untested | untested | untested | untested | untested | untested | untested | missing | untested | untested | missing | missing | missing | missing | untested | untested | missing | untested | untested | untested | untested | missing | missing | missing | missing | untested | | `n71` | untested | untested | untested | untested | untested | untested | untested | untested | untested | missing | untested | untested | missing | missing | missing | missing | untested | untested | missing | untested | untested | untested | untested | missing | missing | missing | missing | untested | | `j71t` | working | working | working | working | working | working | working | working | working | missing | working | working | working | working | untested | none | working | working | working | working | working | working | working | working | working | working | missing | working | diff --git a/kernel/patches/devices/t8010/0041-arm64-dts-apple-s800x-Measured-motion-sensor-mount-m.patch b/kernel/patches/devices/t8010/0041-arm64-dts-apple-s800x-Measured-motion-sensor-mount-m.patch new file mode 100644 index 00000000..fb3702e8 --- /dev/null +++ b/kernel/patches/devices/t8010/0041-arm64-dts-apple-s800x-Measured-motion-sensor-mount-m.patch @@ -0,0 +1,75 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: ricktav <82380971+ricktav@users.noreply.github.com> +Date: Mon, 23 Nov 2026 20:30:50 +0100 +Subject: [PATCH] arm64: dts: apple: s800x: Measured motion sensor mount + matrices for the iPhones + +Held still in six poses on an iPhone 6s Plus (N66), the AOP's raw +accelerometer reads, in g (mean of 14 samples each): + + screen up 0.033 0.006 -0.958 + screen down -0.013 -0.006 1.052 + portrait, home button down 0.002 -0.930 -0.316 + portrait, home button up -0.001 0.974 -0.180 + landscape, home button right -0.938 0.032 -0.307 + landscape, home button left 0.939 -0.004 -0.325 + +(z of about -0.3 in the upright poses is the phone leaning back.) The +axes are the device's, x right, y up, z out of the screen, with gravity's +sign. Of the 48 signed axis permutations, diag(1, 1, -1) puts every pose +where iio-sensor-proxy expects it (normal, bottom-up, right-up, left-up, +face-up, face-down); the next best is 3.75 g^2 worse. It is the iPad 5's +measured matrix, although the ADT's accel-orientation turns the 6s Plus's +sensor 90 degrees against the iPad's: the firmware reports on the device's +axes, so the matrix holds for every A9 iPhone, not only this board. + +The gyroscope is the same MPU6800. During the turns between poses its +rates match the change of the accelerometer's gravity vector best with no +remapping (dg/dt = -w x g over 26 sample pairs: identity fits best of the +48), e.g. +1.6 rad/s about y while the phone flipped over through +x, and ++z while gravity swung from -x to +y. At rest it reads under 0.03 rad/s. +Give it the identity matrix so the device frame is stated. + +Drop the note that the AOP's matrix is not measured yet. + +Assisted-by: LLM +Signed-off-by: ricktav <82380971+ricktav@users.noreply.github.com> +--- + arch/arm64/boot/dts/apple/s800x-iphone.dtsi | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/apple/s800x-iphone.dtsi b/arch/arm64/boot/dts/apple/s800x-iphone.dtsi +index 3498ce5ea..3b9b46dfc 100644 +--- a/arch/arm64/boot/dts/apple/s800x-iphone.dtsi ++++ b/arch/arm64/boot/dts/apple/s800x-iphone.dtsi +@@ -135,8 +135,7 @@ fuel-gauge { + + /* + * Apple's A9 iPhone AOP firmware (aopfw-s8000aop) serves the accelerometer, +- * gyroscope and pressure sensor. Its mount-matrix has not been measured on +- * a phone yet, so the sensors report in the AOP's own frame. ++ * gyroscope and pressure sensor. + */ + &aop { + firmware-name = "apple/aop-s8000.bin", "apple/aop-s8000-ext.bin"; +@@ -146,3 +145,20 @@ &aop { + &aop_mbox { + status = "okay"; + }; ++ ++/* ++ * Measured on an iPhone 6s Plus: the firmware reports on the device's axes ++ * (x right, y up, z out of the screen) with the accelerometer giving ++ * gravity's sign, as on the iPad 5, so the matrices hold for every A9 iPhone. ++ */ ++&aop_accel { ++ mount-matrix = "1", "0", "0", ++ "0", "1", "0", ++ "0", "0", "-1"; ++}; ++ ++&aop_gyro { ++ mount-matrix = "1", "0", "0", ++ "0", "1", "0", ++ "0", "0", "1"; ++}; diff --git a/kernel/patches/drivers/soc-apple/0035-soc-apple-aop-Find-the-boot-arguments-in-version-4-f.patch b/kernel/patches/drivers/soc-apple/0035-soc-apple-aop-Find-the-boot-arguments-in-version-4-f.patch new file mode 100644 index 00000000..94b326bc --- /dev/null +++ b/kernel/patches/drivers/soc-apple/0035-soc-apple-aop-Find-the-boot-arguments-in-version-4-f.patch @@ -0,0 +1,92 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: ricktav <82380971+ricktav@users.noreply.github.com> +Date: Mon, 23 Nov 2026 15:42:23 +0100 +Subject: [PATCH] soc: apple: aop: Find the boot arguments in version 4 + firmware headers + +The AOP firmware's main image starts with an RTKit header: the magic +"uuid", a version and, among other fields, the offset and size of the +boot argument block that the loader fills in. The driver reads them at +0x48, where the iPadOS 16 and 17 images (header version 5) keep them. + +iOS 15's images, such as the A9 iPhones' aopfw-s8000aop (19H422 and +15.8.8), use header version 4, which lacks two words before the boot +argument fields and keeps them at 0x40; the iOS 15 kernel accepts only +that version. In aop-s8000.bin the words at 0x48 and 0x4c are zero, so +the driver finds an empty block, fails with "unexpected boot arguments in +apple/aop-s8000.bin: -2" and never starts the AOP: without this change +the iPhones' enabled AOP cannot come up at all. With it, the block at +0x4f3a8 (0x19a bytes, STKG first) is patched and an iPhone 6s Plus +reports AOP IS READY with its accelerometer, gyroscope and barometer. + +Pick the location by the header version and refuse images without the +magic or with a version that isn't known. + +Assisted-by: LLM +Signed-off-by: ricktav <82380971+ricktav@users.noreply.github.com> +--- + drivers/soc/apple/aop.c | 35 ++++++++++++++++++++++++++++------- + 1 file changed, 28 insertions(+), 7 deletions(-) + +diff --git a/drivers/soc/apple/aop.c b/drivers/soc/apple/aop.c +index 5c23317d1..7990ddb9b 100644 +--- a/drivers/soc/apple/aop.c ++++ b/drivers/soc/apple/aop.c +@@ -54,9 +54,17 @@ + + #define APPLE_AOP_CONTROL_AUTO_BOOT 0x0 + +-/* Main image header: location of the boot argument key/value block */ +-#define APPLE_AOP_IMAGE_BOOTARGS_OFFSET 0x48 +-#define APPLE_AOP_IMAGE_BOOTARGS_SIZE 0x4c ++/* ++ * Main image: an RTKit header ("uuid", then its version) that gives the ++ * offset and size of the boot argument key/value block. Version 5 (iPadOS 16) ++ * has two more words before them than version 4 (iOS 15). ++ */ ++#define APPLE_AOP_IMAGE_MAGIC 0x20 ++#define APPLE_AOP_IMAGE_MAGIC_UUID 0x64697575 /* "uuid" */ ++#define APPLE_AOP_IMAGE_VERSION 0x24 ++#define APPLE_AOP_IMAGE_BOOTARGS_V4 0x40 ++#define APPLE_AOP_IMAGE_BOOTARGS_V5 0x48 ++#define APPLE_AOP_IMAGE_HEADER_SIZE 0x50 + + #define APPLE_AOP_FOURCC(a, b, c, d) \ + (((u32)(a) << 24) | ((u32)(b) << 16) | ((u32)(c) << 8) | (u32)(d)) +@@ -281,11 +289,24 @@ static void apple_aop_add_bootarg(struct apple_aop_bootarg *args, unsigned int * + static int apple_aop_patch_bootargs(struct apple_aop *aop, u8 *image, size_t size, + struct apple_aop_bootarg *args, unsigned int count) + { +- size_t offset, end, pos; ++ size_t offset, end, pos, location; + unsigned int i; + +- offset = get_unaligned_le32(image + APPLE_AOP_IMAGE_BOOTARGS_OFFSET); +- end = get_unaligned_le32(image + APPLE_AOP_IMAGE_BOOTARGS_SIZE); ++ if (get_unaligned_le32(image + APPLE_AOP_IMAGE_MAGIC) != APPLE_AOP_IMAGE_MAGIC_UUID) ++ return -EINVAL; ++ switch (get_unaligned_le32(image + APPLE_AOP_IMAGE_VERSION)) { ++ case 4: ++ location = APPLE_AOP_IMAGE_BOOTARGS_V4; ++ break; ++ case 5: ++ location = APPLE_AOP_IMAGE_BOOTARGS_V5; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ offset = get_unaligned_le32(image + location); ++ end = get_unaligned_le32(image + location + 4); + if (offset >= size || end > size - offset) + return -EINVAL; + end += offset; +@@ -373,7 +394,7 @@ static int apple_aop_load(struct apple_aop *aop, u64 ecid) + goto out_main; + + if (main_fw->size > aop->sram_size || main_fw->size % 4 || +- main_fw->size < APPLE_AOP_IMAGE_BOOTARGS_SIZE + 4 || !ext_fw->size) { ++ main_fw->size < APPLE_AOP_IMAGE_HEADER_SIZE || !ext_fw->size) { + dev_err(aop->dev, "invalid firmware sizes %zu/%zu\n", + main_fw->size, ext_fw->size); + ret = -EINVAL;