From 7ae5480236b171c077153123e20f3b65f9a0e373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Tue, 1 Dec 2026 18:05:29 +0100 Subject: [PATCH 01/14] devices/n42: describe the iPhone 5 and its firmware recipes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: LLM Signed-off-by: Berkay Kösebay --- chips/s5l8950x.toml | 6 ++- devices/n42/README.md | 58 +++++++++++++++++++++ devices/n42/boot.json | 26 +++++----- devices/n42/device.toml | 60 +++++++++++++++++++++- devices/n42/firmware.json | 105 ++++++++++++++++++++++++++++++++++++++ docs/compatibility.md | 6 +-- docs/devices/n42.md | 56 ++++++++++++++++++++ methods.toml | 7 +++ routes.toml | 8 +-- 9 files changed, 308 insertions(+), 24 deletions(-) create mode 100644 devices/n42/README.md create mode 100644 devices/n42/firmware.json create mode 100644 docs/devices/n42.md diff --git a/chips/s5l8950x.toml b/chips/s5l8950x.toml index da26fbb74..881922292 100644 --- a/chips/s5l8950x.toml +++ b/chips/s5l8950x.toml @@ -7,8 +7,10 @@ soc = "s5l8950x" architecture = "arm" image_format = "img3" platform = "apple-armv7" +reference_version = "8.4.1" stages = ["iBSS", "iBEC"] [evidence] -platform = "32-bit kernelcache in the IPSW; not run" -stages = "iBSS far smaller than iBEC in the IPSW; not run" +platform = "N42 (iPhone5,2) from RAM with the S5L8950X kernel series: both Swift cores, AIC timer per CPU, USB gadget, Wi-Fi, NAND read-only (devices/n42/README.md)" +stages = "N42: kDFU, then a patched iBSS and iBEC from 8.4.1 / 12H321 start the 32-bit m1n1 with bootx" +reference_version = "8.4.1 / 12H321 has public IMG3 keys for the N42 iBSS, iBEC and DeviceTree, and a jailbreak that reaches kDFU" diff --git a/devices/n42/README.md b/devices/n42/README.md new file mode 100644 index 000000000..8c5cec777 --- /dev/null +++ b/devices/n42/README.md @@ -0,0 +1,58 @@ +# iPhone 5 (Global), N42 + +The first A6 (S5L8950X, two Apple Swift ARMv7s cores, 1 GiB) board of the +apple-armv7 platform. The kernel side is the S5L8950X series for +OrchardLinux/linux `armv7`: SoC core, PMGR gates and USB PHY, the iPhone 5 +peripherals, and read-only NAND. The device tree is `s5l8950x-n42.dts`, which +includes `s5l8950x-5.dtsi` (what the N41 and N42 share) and `s5l8950x.dtsi`. + +## Boot method + +The board uses the 32-bit m1n1 loader. The tested starting point was an +iPhone5,2 already jailbroken on iOS 8.4.1 (12H321). The board descriptor +records this as a manual boot method. m1n1 supplies the RAM layout, scanout, +initrd, and per-device wireless addresses and touch calibration to Linux. + +## What ran + +One iPhone5,2 (iOS 8.4.1, 12H321), from RAM, with OrchardLinux/linux `armv7` +plus the S5L8950X series, built with clang 19 in the platform's toolchain +image. + +| Feature | Seen | Notes | +|---|---|---| +| CPUs | both cores online, the USB shell reached | The A6 has no ARM PMU. The clocksource is the 24 MHz watchdog counter; each core has its own AIC timer. | +| USB serial and network | `ttyGS0` shell, CDC networking | No `clk_ignore_unused`: the PHY holds its PMGR gates. | +| Display | simplefb and fbcon on iBoot's 640x1136 scanout | | +| Backlight | LM3534 on, brightness 300 written and read back | | +| NAND | SFTL loads read-only; the System partition's HFS+ mounts read-only | SanDisk PPN, 2 buses x 2 CAUs x 1056 blocks. The Data partition is read but encrypted. | +| Wi-Fi | WPA2 on 5 GHz, DHCP, DNS and HTTP | BCM4334 on HSIC port 4. | +| Bluetooth | the patchram loads, `hci0` answers | Not brought up or scanned yet. | +| Battery | percentage, voltage, current, temperature, capacity and cycles | bq27540 over HDQ on UART5. | +| Charger | VBUS online and the input limit read | The driver runs disarmed and writes nothing. | +| Touch | the kernel boots the digitizer; one-finger frames with moving coordinates | `/dev/input/event0` and multi-touch not checked yet. | +| Buttons | gpio-keys probes | Presses not checked. | + +## Firmware + +`firmware.json` builds the Wi-Fi firmware (`centennial.trx` with the +`heineken-m-ms.txt` NVRAM), the Bluetooth patchram (`BCM4334B1 37.4 MHz +Centennial Murata` from BlueTool) and `N42.mtprops` from the 12H321 IPSW. + +It also takes the GPU's microkernel out of the kernelcache: +`apple/sgx543-s5l8950x.fw`, from the `sgx543-from-kernelcache@1` step. The +A6's GPU kext is another build than the A5's (class `SGXDriver543RC2`, +`__data` 0x14eb4 and `__const` 0x300 bytes), so the A6 has its own file +and the kernel driver its own offsets into it. It needs a tools release +whose step takes that class. + +The touchscreen takes one complete HBPP DATA packet from the `C1F57,1` +profile in N42.mtprops. The recipe checks the output hash and installs the +64,340-byte packet as `apple/z2-n42.bin`. The kernel receives touch and +proximity calibration separately through the device tree. + +## N41 + +The iPhone5,1 (N41) is the same phone without the CDMA bands, which Linux +does not drive. `s5l8950x-n41.dts` uses the same include, but no N41 has run +it. diff --git a/devices/n42/boot.json b/devices/n42/boot.json index 84e0080e5..c0053514f 100644 --- a/devices/n42/boot.json +++ b/devices/n42/boot.json @@ -4,37 +4,37 @@ "firmware": [ { "ipsw": { - "version": "10.3.4", - "build": "14G61", - "url": "https://updates.cdn-apple.com/2019/ios/091-25277-20190722-0C1B94DE-992C-11E9-A2EE-E2C9A77C2E40/iPhone_4.0_32bit_10.3.4_14G61_Restore.ipsw", - "bytes": 2000796302, - "sha256": "31b4e67cdeae511bd27ff8a2a285753f7ac9608b8d848e1dec68efc980108695" + "version": "8.4.1", + "build": "12H321", + "url": "https://secure-appldnld.apple.com/ios8.4.1/031-31065-20150812-7518F132-3C8F-11E5-A96A-A11A3A53DB92/iPhone5,2_8.4.1_12H321_Restore.ipsw", + "bytes": 1656563298, + "sha256": "9757457a242e9e3ce613a10a671e464631777b7d347c7b47c281c8ec1f1d0668" }, - "selected_by": "newest", + "selected_by": "chip-reference", "inputs": { "BuildManifest.plist": { "ipsw": { "zip": "BuildManifest.plist" }, - "sha256": "579ec834734372c9ef66071d12e0cf9e349be0e6ef15912b4ae9e04b0009daf2" + "sha256": "b89d57d025e380799e609b6e3345617a817bcc7ad2c3a7892ec822dc84a4d652" }, "iBSS": { "ipsw": { - "zip": "Firmware/dfu/iBSS.iphone5.RELEASE.dfu" + "zip": "Firmware/dfu/iBSS.n42.RELEASE.dfu" }, - "sha256": "5bbe5e485e00735040da0dbfa705640574f4650af28e959a8ba5be5b6e6fd4b2" + "sha256": "22a1a86d8b2af3a33cbdef4f8a6e925bf0a57d69e9a001578d9ebb3378c5d6f1" }, "iBEC": { "ipsw": { - "zip": "Firmware/dfu/iBEC.iphone5.RELEASE.dfu" + "zip": "Firmware/dfu/iBEC.n42.RELEASE.dfu" }, - "sha256": "68062186f6603179102949253dde530cc0bc347b637d227c42ddf236c98dc38d" + "sha256": "23303f289949f9e098f799304ae1a74daad92a96b2d1189fc2929d7a0a3acf75" }, "DeviceTree": { "ipsw": { - "zip": "Firmware/all_flash/DeviceTree.n42ap.img3" + "zip": "Firmware/all_flash/all_flash.n42ap.production/DeviceTree.n42ap.img3" }, - "sha256": "26a3f0db29d78627698dee1cfc7ef3621b4fab5c748f0529c9e41f3d3871ea07" + "sha256": "41feb6c5372def063433b417b3d089ed773c1bb9330dc3d6c8b6eccf93301d3c" } } } diff --git a/devices/n42/device.toml b/devices/n42/device.toml index 6d0d45f29..efac7e648 100644 --- a/devices/n42/device.toml +++ b/devices/n42/device.toml @@ -1,5 +1,4 @@ -# iPhone 5 (Global) (N42): identity from public sources -# (tools/catalog/generate). No Orchard bring-up yet; see docs/device-bring-up.md. +# iPhone 5 (Global) (N42): identity, kernel and manual boot prerequisites. schema = 1 kind = "hardware.device" @@ -7,7 +6,64 @@ kind = "hardware.device" profile = "n42" name = "iPhone 5 (Global)" apple_products = ["iPhone5,2"] +dt_compatible = ["apple,n42ap"] [match.dfu] chip = 0x8950 board = 0x02 + +[boot] +methods = ["jailbreak-kdfu-m1n1"] +entries = ["kdfu"] +# Booted from a jailbroken iOS 8.4.1 (12H321): kloader enters kDFU, a patched +# iBSS and iBEC follow, and iBEC starts the 32-bit m1n1 with bootx (README.md). +# orchard's launcher does not run this chain yet. + +[kernel] +platform = "apple-armv7" # kernel/series/apple-armv7, kernel/configs/apple-armv7 +dtb = "s5l8950x-n42" # arch/arm/boot/dts/apple/.dtb + +[firmware] +recipe = "firmware.json" + +# The NAND driver and SFTL are read-only on the S5L8950X: no program or erase +# path, and the boot chain lives on the same NAND. +[storage] +reclaims = false + +[support] +status = "supported" + +# States: working, untested, missing, none (features.toml). +# "working" means seen on one iPhone5,2 from RAM, with OrchardLinux/linux +# `armv7` plus the S5L8950X kernel series (README.md), built with clang 19 +# in the platform's toolchain image. They hold once that series is merged. +[features] +display = "working" # simplefb on iBoot's 640x1136 scanout, fbcon. +screen_off = "missing" +backlight = "working" # LM3534 over I2C and DWI; brightness written and read back. +gpu_desktop = "missing" +touch = "untested" # The kernel boots the Z2 digitizer and logs moving one-finger frames; event0 not checked yet. +buttons = "untested" # gpio-keys probes Home, Hold, Volume Up/Down and Ringer; presses not checked. +accelerometer = "missing" +gyroscope = "missing" +light_sensor = "missing" +touch_id = "none" +storage_read = "working" # SFTL loads read-only; the System partition's HFS+ mounts read-only. +storage_write = "missing" +wifi = "working" # BCM4334 on HSIC: WPA2 on 5 GHz, DHCP, DNS and HTTP. +bluetooth_input = "untested" # BCM4334 patchram loads; not brought up or scanned yet. +bluetooth_audio = "missing" +cellular = "missing" +battery = "working" # bq27540 over HDQ on UART5, Apple's transaction. +charging = "untested" # The D1972 reports VBUS online and its input limit. +charging_control = "missing" # The charger driver runs disarmed: it logs and writes nothing. +suspend = "missing" +resume = "missing" +usb_serial = "working" # ttyGS0 shell, no clk_ignore_unused. +usb_network = "working" +usb_host = "missing" +audio_output = "missing" +audio_input = "missing" +camera = "missing" +video_decode_hevc = "missing" diff --git a/devices/n42/firmware.json b/devices/n42/firmware.json new file mode 100644 index 000000000..22b250546 --- /dev/null +++ b/devices/n42/firmware.json @@ -0,0 +1,105 @@ +{ + "schema": 2, + "device": "iPhone5,2", + "ipsw": { + "version": "8.4.1", + "build": "12H321", + "url": "https://secure-appldnld.apple.com/ios8.4.1/031-31065-20150812-7518F132-3C8F-11E5-A96A-A11A3A53DB92/iPhone5,2_8.4.1_12H321_Restore.ipsw", + "bytes": 1656563298, + "sha256": "9757457a242e9e3ce613a10a671e464631777b7d347c7b47c281c8ec1f1d0668" + }, + "inputs": { + "N42.mtprops": { + "ipsw": { + "rootfs": "usr/share/firmware/multitouch/N42.mtprops" + }, + "device": "/usr/share/firmware/multitouch/N42.mtprops", + "sha256": "132c013a1a19b0c6cb5ef2faf9cf0573ee9f9f429379b4912c095f4a8914a0fb" + }, + "centennial.trx": { + "ipsw": { + "rootfs": "usr/share/firmware/wifi/4334b1/centennial.trx" + }, + "device": "/usr/share/firmware/wifi/4334b1/centennial.trx", + "sha256": "c98e4842208de192ea6815c1b3045a388e0cefdf16fb07d4bc261d91594fb889" + }, + "heineken-m-ms.txt": { + "ipsw": { + "rootfs": "usr/share/firmware/wifi/4334b1/heineken-m-ms.txt" + }, + "device": "/usr/share/firmware/wifi/4334b1/heineken-m-ms.txt", + "sha256": "fa774d148d318d754322cbaabfea28532881321652a76f79ac622771a50d11b7" + }, + "BlueTool": { + "ipsw": { + "rootfs": "usr/sbin/BlueTool" + }, + "device": "/usr/sbin/BlueTool", + "sha256": "eb6730996c2bbf158b3599ec45d3fe2e27391f450a51586ab56bca11677d36a7" + }, + "kernelcache": { + "ipsw": { + "kernelcache": true + }, + "device": { + "kernelcache": "active" + } + } + }, + "outputs": [ + { + "destination": "lib/firmware/N42.mtprops", + "sha256": "132c013a1a19b0c6cb5ef2faf9cf0573ee9f9f429379b4912c095f4a8914a0fb", + "steps": [ + { + "step": "copy@1", + "input": "N42.mtprops" + } + ] + }, + { + "destination": "lib/firmware/apple/z2-n42.bin", + "sha256": "af78e1a4033c213747c2e76f7b55e38bfdc4b1f1590a6ab0b07f7fc5ff9420c3", + "steps": [ + { + "step": "z2-packet-from-mtprops@1", + "input": "N42.mtprops", + "profile": "C1F57,1" + } + ] + }, + { + "destination": "lib/firmware/brcm/brcmfmac4334.bin", + "sha256": "ad9be8205becb032ba1dfacfc0fc9d851abfac430b07def944cdc2a3ee7b6b2b", + "steps": [ + { + "step": "trx-add-nvram@1", + "input": "centennial.trx", + "nvram": "heineken-m-ms.txt", + "placeholder_mac": "02:00:00:00:00:00" + } + ] + }, + { + "destination": "lib/firmware/brcm/BCM4334B0.hcd", + "sha256": "9512c1e6494b01c65dafc0c105057d3153b9a8f850d9f3d406e1d7f5704eb816", + "steps": [ + { + "step": "bluetool-hcd@1", + "input": "BlueTool" + } + ] + }, + { + "destination": "lib/firmware/apple/sgx543-s5l8950x.fw", + "sha256": "af28fc9bc72df176768436b2784f4036139f154a95c4f812cfd24f12b4efd5e3", + "steps": [ + { + "step": "sgx543-from-kernelcache@1", + "input": "kernelcache", + "build": "12H321" + } + ] + } + ] +} diff --git a/docs/compatibility.md b/docs/compatibility.md index 06e7c8cad..d90dca45b 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -75,7 +75,7 @@ Every device Orchard installs on. ✅ works · ❌ doesn't work yet · – no su Not working on any device yet: Touch ID, cellular, cameras. -Orchard also builds for [iPad 3 (Wi-Fi)](devices/j1.md), [iPad Pro 12.9-inch (Cellular)](devices/j99a.md), [iPad Pro 12.9-inch (Wi-Fi)](devices/j98a.md), [iPad Pro 9.7-inch (Cellular)](devices/j128.md), [iPad Pro 9.7-inch (Wi-Fi)](devices/j127.md); they do not install yet. Every device links to its page: each feature with its notes and drivers, and how it boots. +Orchard also builds for [iPad 3 (Wi-Fi)](devices/j1.md), [iPad Pro 12.9-inch (Cellular)](devices/j99a.md), [iPad Pro 12.9-inch (Wi-Fi)](devices/j98a.md), [iPad Pro 9.7-inch (Cellular)](devices/j128.md), [iPad Pro 9.7-inch (Wi-Fi)](devices/j127.md), [iPhone 5 (Global)](devices/n42.md); they do not install yet. Every device links to its page: each feature with its notes and drivers, and how it boots. Which A9 do I have? iOS doesn't show it. In DFU mode, `orchard install` names the device before it asks to continue: S8000 or Samsung in the name means Samsung, otherwise TSMC. @@ -86,7 +86,7 @@ Which A9 do I have? iOS doesn't show it. In DFU mode, `orchard install` names th | A5 | S5L8940X | `0x8940` | – | – | apple-armv7 | iBSS + iBEC | – | 4 | 0 | 0 | | A5 | S5L8942X | `0x8942` | – | – | apple-armv7 | iBSS + iBEC | – | 4 | 1 | 1 | | A5X | S5L8945X | `0x8945` | – | – | apple-armv7 | iBSS + iBEC | – | 3 | 1 | 1 | -| A6 | S5L8950X | `0x8950` | – | – | apple-armv7 | iBSS + iBEC | – | 4 | 0 | 0 | +| A6 | S5L8950X | `0x8950` | – | – | apple-armv7 | iBSS + iBEC | – | 4 | 1 | 1 | | A6X | S5L8955X | `0x8955` | – | – | apple-armv7 | iBSS + iBEC | – | 3 | 0 | 0 | | A7 | S5L8960X | `0x8960` | cyclone | 4096 | apple-4k | iBSS + iBEC | – | 11 | 11 | 11 | | A8 | T7000 | `0x7000` | typhoon | 4096 | apple-4k | iBSS + iBEC | – | 5 | 5 | 5 | @@ -117,7 +117,7 @@ Which A9 do I have? iOS doesn't show it. In DFU mode, `orchard install` names th | A5X | iPad 3 (CDMA) | `j2` | iPad3,2 | known | – | – | – | – | 13G37 | | A5X | iPad 3 (GSM) | `j2a` | iPad3,3 | known | – | – | – | – | 13G37 | | A6 | iPhone 5 (GSM) | `n41` | iPhone5,1 | known | – | – | – | – | 14G61 | -| A6 | iPhone 5 (Global) | `n42` | iPhone5,2 | known | – | – | – | – | 14G61 | +| A6 | iPhone 5 (Global) | `n42` | iPhone5,2 | supported | – | jailbreak-kdfu-m1n1 | yes | yes | 12H321 | | A6 | iPhone 5c (GSM) | `n48` | iPhone5,3 | known | – | – | – | – | 14G60 | | A6 | iPhone 5c (Global) | `n49` | iPhone5,4 | known | – | – | – | – | 14G60 | | A6X | iPad 4 (Wi-Fi) | `p101` | iPad3,4 | known | – | – | – | – | 14G60 | diff --git a/docs/devices/n42.md b/docs/devices/n42.md new file mode 100644 index 000000000..7f4eb7155 --- /dev/null +++ b/docs/devices/n42.md @@ -0,0 +1,56 @@ +# iPhone 5 (Global) + +Generated by `tools/catalog/generate matrix` from `devices/n42/device.toml`; do not edit by hand. All devices: [compatibility](../compatibility.md#does-my-device-work). + +- **Chip:** A6 (S5L8950X) +- **Board:** `n42` (iPhone 5 (Global)) +- **Products:** iPhone5,2 +- **Installs:** not yet + +## Features + +✅ works · 🤔 should work · ❌ doesn't work yet · – no such hardware. + +Driver: this board's device tree has not been read yet (`tools/catalog/generate kernel`). + +- ✅ **Display**: simplefb on iBoot's 640x1136 scanout, fbcon. +- ❌ **Screen on/off** +- ✅ **Backlight**: LM3534 over I2C and DWI; brightness written and read back. +- ❌ **GPU desktop** +- 🤔 **Touchscreen**: The kernel boots the Z2 digitizer and logs moving one-finger frames; event0 not checked yet. +- 🤔 **Buttons**: gpio-keys probes Home, Hold, Volume Up/Down and Ringer; presses not checked. +- ❌ **Accelerometer** +- ❌ **Gyroscope** +- ❌ **Light sensor** +- – **Touch ID** +- ✅ **Internal storage read**: SFTL loads read-only; the System partition's HFS+ mounts read-only. +- ❌ **Internal storage write** +- ✅ **Wi-Fi**: BCM4334 on HSIC: WPA2 on 5 GHz, DHCP, DNS and HTTP. +- 🤔 **Bluetooth input devices**: BCM4334 patchram loads; not brought up or scanned yet. +- ❌ **Bluetooth audio** +- ❌ **Cellular** +- ✅ **Battery status**: bq27540 over HDQ on UART5, Apple's transaction. +- 🤔 **Charging**: The D1972 reports VBUS online and its input limit. +- ❌ **Charging control**: The charger driver runs disarmed: it logs and writes nothing. +- ❌ **Suspend** +- ❌ **Resume** +- ✅ **USB serial**: ttyGS0 shell, no clk_ignore_unused. +- ✅ **USB network** +- ❌ **USB host** +- ❌ **Speakers** +- ❌ **Microphone** +- ❌ **Cameras** +- ❌ **Hardware H.265 video decoding** + +## Boot + +- **Methods:** jailbreak-kdfu-m1n1 +- **Entries:** kdfu +- **Platform:** apple-armv7, –-byte pages +- **Firmware recipe:** yes +- **Device tree:** `s5l8950x-n42` +- **boot.json build:** 12H321 + +## Tested by + +Nobody yet. diff --git a/methods.toml b/methods.toml index 2859f1fdc..1520e2e49 100644 --- a/methods.toml +++ b/methods.toml @@ -18,6 +18,13 @@ boot_json = false stages = [] loader = "cascadia" +["jailbreak-kdfu-m1n1"] +entries = ["kdfu"] +description = "kDFU from a jailbroken iOS, a patched iBSS and iBEC, then the 32-bit m1n1 through devicetree and bootx" +boot_json = false +stages = ["iBSS", "iBEC"] +loader = "m1n1" + ["recovery-autogo"] entries = ["pico-checkm8", "kdfu"] description = "Patched iBSS and iBEC with an autogo hook, then an ARM32 staging bundle" diff --git a/routes.toml b/routes.toml index d4d7439a0..9dfc705af 100644 --- a/routes.toml +++ b/routes.toml @@ -22,12 +22,12 @@ ends = "m1n1" fits = [{ chips = ["s5l8960x", "t7000", "t7001", "s8000", "s8001", "s8003", "t8010", "t8011", "t8015"] }] source = "https://checkra.in: iPhone 5s to iPhone X (A7 to A11)" -# On the A5 chips no tool of ours enters the boot ROM: the route starts from one that -# checkm8 from a Pico entered, or from kDFU. +# On the A5 and A6 chips no tool of ours enters the boot ROM: the route starts from one +# that checkm8 from a Pico entered, or from kDFU. [boot.ibss] ends = "m1n1" -fits = [{ chips = ["s5l8960x", "t7000", "t7001", "s8000", "s8001", "s8003", "t8010", "t8011", "t8015", "t8020", "t8027", "s5l8940x", "s5l8942x"] }] -source = "HoolockLinux/remote_boot@e254a58: gaster and a patched iBSS (and iBEC) on A7 to A11; rzxvx/Project-Cascadia@091d441 devices/a5: patched iBSS and iBEC, devicetree and bootx on A5" +fits = [{ chips = ["s5l8960x", "t7000", "t7001", "s8000", "s8001", "s8003", "t8010", "t8011", "t8015", "t8020", "t8027", "s5l8940x", "s5l8942x", "s5l8950x"] }] +source = "HoolockLinux/remote_boot@e254a58: gaster and a patched iBSS (and iBEC) on A7 to A11; rzxvx/Project-Cascadia@091d441 devices/a5: patched iBSS and iBEC, devicetree and bootx on A5; the same, starting the 32-bit m1n1, on the A6 (devices/n42)" [boot.autogo] ends = "cascadia" From 9d3a0b5fb03ab846fe6fe0e0f3ba30b6bb2db723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Tue, 1 Dec 2026 22:28:26 +0100 Subject: [PATCH 02/14] boot: build the N42 watchdog and framebuffer diagnostic loaders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Select the ARMv7 component from the N42 m1n1 review head. Keep the production watchdog loader alongside the generic loader in releases. The local diagnostic enables visible stages and per-stage PRAM records for a bare proxy flight. Assisted-by: LLM Signed-off-by: Berkay Kösebay --- .github/workflows/build.yml | 2 +- boot/m1n1/build | 19 +++++++++++++++++-- boot/m1n1/upstream.lock | 2 +- ci/keys.py | 2 +- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14949287f..fd4bb6d5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -511,7 +511,7 @@ jobs: # orchard launch starts any device with only Pongo and the storage-capable # m1n1; they are release assets of their own. cp out/components/quiet/m1n1.bin out/components/quiet/m1n1-idevice.macho \ - out/components/quiet/monitor-stub.macho out/components/quiet/m1n1-armv7.macho \ + out/components/quiet/monitor-stub.macho out/components/quiet/m1n1-armv7.macho out/components/quiet/m1n1-armv7-n42.macho \ out/components/quiet/pongo.bin out/publication/ # Each platform's finished kernel, the installer's tools, and the index a # distribution builds its release from, so it stops copying any of them. diff --git a/boot/m1n1/build b/boot/m1n1/build index c6672f163..a2f562057 100755 --- a/boot/m1n1/build +++ b/boot/m1n1/build @@ -83,7 +83,7 @@ in_builder() { if [[ -d "$source/build/arm32" ]]; then in_builder make clean; fi in_builder make -j2 USE_CLANG=1 ARCH=aarch64-linux-gnu \ TOOLCHAIN=/usr/lib/llvm-19/bin/ LLDDIR=/usr/lib/llvm-19/bin/ CHAINLOADING=1 \ - EXTRA_CFLAGS="$extra_cflags" + EXTRA_CFLAGS="$extra_cflags -g0" mkdir -p "$(dirname "$output")" cp "$source/build/m1n1.bin" "$output" # The same build as Mach-O, for a chain that starts m1n1 from iBoot as the @@ -94,7 +94,22 @@ cp "$source/build/m1n1-idevice.macho" "$source/build/monitor-stub.macho" "$(dirn in_builder make clean in_builder make -j2 M1N1_ARCH=arm USE_CLANG=1 \ TOOLCHAIN=/usr/lib/llvm-19/bin/ LLDDIR=/usr/lib/llvm-19/bin/ CHAINLOADING=1 \ - EXTRA_CFLAGS="$extra_cflags" + EXTRA_CFLAGS="$extra_cflags -g0" cp "$source/build/m1n1-armv7.macho" "$(dirname "$output")/" +# A6 needs its own watchdog addresses before the ADT is available. The +# diagnostic also records startup stages in N42 PRAM and on the panel. +for variant in n42 n42-diagnostic; do + n42_flags="$extra_cflags -g0" + n42_options=(A32_EARLY_WDT_SECS=20 A32_WDT_LINUX_SECS=170) + if [[ "$variant" == n42-diagnostic ]]; then + n42_flags+=" -UQUIET_BOOT -DM1N1_DIAG_FB" + n42_options+=(A32_CRUMB_PHYS=0xbfffc400) + fi + in_builder make clean + in_builder make -j2 M1N1_ARCH=arm USE_CLANG=1 \ + TOOLCHAIN=/usr/lib/llvm-19/bin/ LLDDIR=/usr/lib/llvm-19/bin/ CHAINLOADING=1 \ + "${n42_options[@]}" EXTRA_CFLAGS="$n42_flags" + cp "$source/build/m1n1-armv7.macho" "$(dirname "$output")/m1n1-armv7-$variant.macho" +done sha256sum "$output" 2>/dev/null || shasum -a 256 "$output" echo "Loader: $output" diff --git a/boot/m1n1/upstream.lock b/boot/m1n1/upstream.lock index e4b4456f7..c11edaae1 100644 --- a/boot/m1n1/upstream.lock +++ b/boot/m1n1/upstream.lock @@ -1,2 +1,2 @@ url=https://github.com/OrchardLinux/m1n1.git -commit=9023d7978e6c0043f7a42371ad4122bf8b86d9f3 +commit=a54e9c8d501d09fc26e9a47223b4d583095c2091 diff --git a/ci/keys.py b/ci/keys.py index bb4a9a923..35d77d4b9 100755 --- a/ci/keys.py +++ b/ci/keys.py @@ -29,7 +29,7 @@ TAG = 'nightly' RELEASES = 'https://github.com/OrchardLinux/orchard/releases/download' # m1n1's published files, all from its one build. -M1N1_FILES = ['m1n1.bin', 'm1n1-idevice.macho', 'monitor-stub.macho', 'm1n1-armv7.macho'] +M1N1_FILES = ['m1n1.bin', 'm1n1-idevice.macho', 'monitor-stub.macho', 'm1n1-armv7.macho', 'm1n1-armv7-n42.macho'] def contract(root): From 0a2f4b41b18791fbb0616ab1491543f33f9f37fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Tue, 1 Dec 2026 22:37:34 +0100 Subject: [PATCH 03/14] kernel: build the fenced N42 installer writer on apple-armv7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: LLM Signed-off-by: Berkay Kösebay --- kernel/configs/apple-armv7/config | 1 + kernel/upstream-armv7.lock | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/configs/apple-armv7/config b/kernel/configs/apple-armv7/config index 1f308fe74..01dbdfa1b 100644 --- a/kernel/configs/apple-armv7/config +++ b/kernel/configs/apple-armv7/config @@ -1458,6 +1458,7 @@ CONFIG_MTD_OF_PARTS=y # CONFIG_MTD_SWAP is not set # CONFIG_MTD_PARTITIONED_MASTER is not set CONFIG_MTD_APPLE_SFTL=y +CONFIG_MTD_APPLE_SFTL_N42_WRITE=y # # RAM/ROM/Flash chip drivers diff --git a/kernel/upstream-armv7.lock b/kernel/upstream-armv7.lock index 881ed6991..529d454ae 100644 --- a/kernel/upstream-armv7.lock +++ b/kernel/upstream-armv7.lock @@ -1,2 +1,2 @@ url=https://github.com/OrchardLinux/linux.git -commit=0188384e8a9bf770a727c302e4daeb9b22a82aa8 +commit=967df736d815da896efb65c88c963c29d18135ac From 01edc5e6074ca81f74582b7c2a5912e9576e0eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Tue, 1 Dec 2026 22:55:46 +0100 Subject: [PATCH 04/14] boot: pin the N42 read-only flash and boot entry reader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: LLM Signed-off-by: Berkay Kösebay --- boot/m1n1/upstream.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/m1n1/upstream.lock b/boot/m1n1/upstream.lock index c11edaae1..c5994f0a7 100644 --- a/boot/m1n1/upstream.lock +++ b/boot/m1n1/upstream.lock @@ -1,2 +1,2 @@ url=https://github.com/OrchardLinux/m1n1.git -commit=a54e9c8d501d09fc26e9a47223b4d583095c2091 +commit=c1b932d8d7a2a19d88b390ebbefb9bb435c176b1 From 5e3827f4e04b7b359f203d1ed2a421b440d6f257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Tue, 1 Dec 2026 23:13:02 +0100 Subject: [PATCH 05/14] n42: derive and install the Mesa SGX event template from 12H321 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: LLM Signed-off-by: Berkay Kösebay --- boot/initramfs/install/install_device.py | 34 +++++++++++++----------- devices/n42/README.md | 9 +++++++ devices/n42/firmware.json | 23 +++++++++++++++- 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/boot/initramfs/install/install_device.py b/boot/initramfs/install/install_device.py index 1a54c60e3..a5d516c42 100644 --- a/boot/initramfs/install/install_device.py +++ b/boot/initramfs/install/install_device.py @@ -681,11 +681,7 @@ def install_kernel(path, root, *, size, sha256, expanded_limit, package=None): def install_firmware(bundle, root, *, size, sha256): - """The private firmware bundle (lib/firmware/... plus mixin.json) into /usr/lib/firmware. - - Arch's /lib is a link to usr/lib, which the extractor never follows, so - firmware paths are mapped explicitly; nothing outside it is written. - """ + """Install verified peripheral firmware and Mesa's N42 userspace event template.""" data = bundle.read(size + 1) if len(data) != size or hashlib.sha256(data).hexdigest() != sha256: raise InstallError('firmware-mismatch', 'Firmware bundle size or hash differs from the plan') @@ -699,16 +695,24 @@ def install_firmware(bundle, root, *, size, sha256): continue if not (member.isfile() and name.startswith('lib/firmware/')): raise InstallError('unsafe-archive', 'Firmware bundle may contain only firmware files') - parent, leaf = parent_fd(root_fd, 'usr/' + name) - try: - fd = os.open(leaf, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644, dir_fd=parent) - with os.fdopen(fd, 'wb') as output: - output.write(archive.extractfile(member).read()) - os.fchown(output.fileno(), 0, 0) - os.fchmod(output.fileno(), 0o644) - count += 1 - finally: - os.close(parent) + blob = archive.extractfile(member).read() + if name == 'lib/firmware/apple/sgx543-n42/gl-event.pds': + # Mesa's UAPI 3 frame builder reads the event program through this manifest. + paths = [('usr/local/lib/sgx2d/gl-event.pds', blob), + ('usr/local/lib/sgx2d/pack.txt', b'pds 0x98956000\nimg 0x98956000 gl-event.pds\n')] + else: + paths = [('usr/' + name, blob)] + for path, content in paths: + parent, leaf = parent_fd(root_fd, path) + try: + fd = os.open(leaf, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644, dir_fd=parent) + with os.fdopen(fd, 'wb') as output: + output.write(content) + os.fchown(output.fileno(), 0, 0) + os.fchmod(output.fileno(), 0o644) + count += 1 + finally: + os.close(parent) finally: os.close(root_fd) return count diff --git a/devices/n42/README.md b/devices/n42/README.md index 8c5cec777..ecfe035e4 100644 --- a/devices/n42/README.md +++ b/devices/n42/README.md @@ -46,6 +46,15 @@ A6's GPU kext is another build than the A5's (class `SGXDriver543RC2`, and the kernel driver its own offsets into it. It needs a tools release whose step takes that class. +For Mesa on kernel UAPI 3 the same peripheral recipe takes 168 bytes of the +GL event program from the 12H321 system volume. The installer writes the +verified program and its two-line manifest to `/usr/local/lib/sgx2d`. +Set `ORCHARD_FIRMWARE_ROOT` to the root of a locally readable copy of the +8.4.1 system volume and `ORCHARD_FIRMWARE_KERNELCACHE` to its decoded +kernelcache before running `orchard fw build n42 --type peripheral --out ./firmware` or +`orchard install`. Each local input must match the recipe hash. The restore +version used for the bootloader is independent of the peripheral firmware. + The touchscreen takes one complete HBPP DATA packet from the `C1F57,1` profile in N42.mtprops. The recipe checks the output hash and installs the 64,340-byte packet as `apple/z2-n42.bin`. The kernel receives touch and diff --git a/devices/n42/firmware.json b/devices/n42/firmware.json index 22b250546..bba3b5ec4 100644 --- a/devices/n42/firmware.json +++ b/devices/n42/firmware.json @@ -43,7 +43,18 @@ }, "device": { "kernelcache": "active" - } + }, + "sha256": "dcee499a26e387a7503369402f308947cb54530ec905530b68389d120b528e94" + }, + "gl-event.pds": { + "ipsw": { + "rootfs": "System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv7s", + "range": [ + 4676568, + 168 + ] + }, + "sha256": "a1b855d41993968b40005e886f7ac11c8c3abb42aa0987e005eec4e6cb2a2285" } }, "outputs": [ @@ -100,6 +111,16 @@ "build": "12H321" } ] + }, + { + "destination": "lib/firmware/apple/sgx543-n42/gl-event.pds", + "sha256": "a1b855d41993968b40005e886f7ac11c8c3abb42aa0987e005eec4e6cb2a2285", + "steps": [ + { + "step": "copy@1", + "input": "gl-event.pds" + } + ] } ] } From 3a09571fe9fa44ba4318044b72d002e8103ae100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Tue, 1 Dec 2026 23:14:33 +0100 Subject: [PATCH 06/14] schemas: describe hash-pinned byte ranges in peripheral recipes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: LLM Signed-off-by: Berkay Kösebay --- schemas/v1/firmware.schema.json | 36 ++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/schemas/v1/firmware.schema.json b/schemas/v1/firmware.schema.json index a8381ca7e..38bd611c7 100644 --- a/schemas/v1/firmware.schema.json +++ b/schemas/v1/firmware.schema.json @@ -120,6 +120,22 @@ "properties": { "rootfs": { "$ref": "#/$defs/relative" + }, + "range": { + "description": "Byte offset and length in the system file. The input hash covers the selected bytes.", + "type": "array", + "minItems": 2, + "maxItems": 2, + "prefixItems": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "integer", + "minimum": 1 + } + ] } } }, @@ -188,7 +204,25 @@ } ] } - } + }, + "allOf": [ + { + "if": { + "properties": { + "ipsw": { + "required": [ + "range" + ] + } + } + }, + "then": { + "required": [ + "sha256" + ] + } + } + ] }, "output": { "type": "object", From 20de872d292bef2f47b98521d5f75efd4b6d7ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Tue, 1 Dec 2026 23:21:04 +0100 Subject: [PATCH 07/14] release: index the board-specific ARMv7 m1n1 Mach-O and its method data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: LLM Signed-off-by: Berkay Kösebay --- .github/workflows/build.yml | 3 ++- devices/n42/README.md | 4 ++-- devices/n42/device.toml | 6 +++--- producers/platforms_index.py | 26 +++++++++++++++++++++----- schemas/v2/install.schema.json | 32 ++++++++++++++++++++++++++++---- src/orchard/manifests.py | 5 +++-- 6 files changed, 59 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd4bb6d5d..ff5e7e20c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -523,7 +523,8 @@ jobs: loaders+=(--loader "$(basename "$(dirname "$loader")")=$loader") done python producers/platforms_index.py out/publication --architecture arm --kernels out/platforms \ - --tools out/components/boot-arm --commit "$GITHUB_SHA" "${loaders[@]}" + --tools out/components/boot-arm --commit "$GITHUB_SHA" "${loaders[@]}" \ + --m1n1-board n42=out/components/quiet/m1n1-armv7-n42.macho # tool-components.tar.gz stays: a distribution build takes its tools from it. rm out/publication/kernel-components-*.tar.gz out/publication/quiet-pongo.tar.gz # Source keys of each platform's kernel, m1n1 and the tools: a distribution build diff --git a/devices/n42/README.md b/devices/n42/README.md index ecfe035e4..cac6499f5 100644 --- a/devices/n42/README.md +++ b/devices/n42/README.md @@ -3,7 +3,7 @@ The first A6 (S5L8950X, two Apple Swift ARMv7s cores, 1 GiB) board of the apple-armv7 platform. The kernel side is the S5L8950X series for OrchardLinux/linux `armv7`: SoC core, PMGR gates and USB PHY, the iPhone 5 -peripherals, and read-only NAND. The device tree is `s5l8950x-n42.dts`, which +peripherals and NAND. The device tree is `s5l8950x-n42.dts`, which includes `s5l8950x-5.dtsi` (what the N41 and N42 share) and `s5l8950x.dtsi`. ## Boot method @@ -25,7 +25,7 @@ image. | USB serial and network | `ttyGS0` shell, CDC networking | No `clk_ignore_unused`: the PHY holds its PMGR gates. | | Display | simplefb and fbcon on iBoot's 640x1136 scanout | | | Backlight | LM3534 on, brightness 300 written and read back | | -| NAND | SFTL loads read-only; the System partition's HFS+ mounts read-only | SanDisk PPN, 2 buses x 2 CAUs x 1056 blocks. The Data partition is read but encrypted. | +| NAND | The iOS System partition mounts read-only; the installer kernel permits writes inside the Linux partition fence | SanDisk PPN, 2 buses x 2 CAUs x 1056 blocks. The Data partition is read but encrypted. | | Wi-Fi | WPA2 on 5 GHz, DHCP, DNS and HTTP | BCM4334 on HSIC port 4. | | Bluetooth | the patchram loads, `hci0` answers | Not brought up or scanned yet. | | Battery | percentage, voltage, current, temperature, capacity and cycles | bq27540 over HDQ on UART5. | diff --git a/devices/n42/device.toml b/devices/n42/device.toml index efac7e648..e4e4a7e38 100644 --- a/devices/n42/device.toml +++ b/devices/n42/device.toml @@ -26,8 +26,8 @@ dtb = "s5l8950x-n42" # arch/arm/boot/dts/apple/.dtb [firmware] recipe = "firmware.json" -# The NAND driver and SFTL are read-only on the S5L8950X: no program or erase -# path, and the boot chain lives on the same NAND. +# iOS prepares the LwVM split separately. The install kernel restricts writes +# to Linux partitions in the released space. [storage] reclaims = false @@ -50,7 +50,7 @@ gyroscope = "missing" light_sensor = "missing" touch_id = "none" storage_read = "working" # SFTL loads read-only; the System partition's HFS+ mounts read-only. -storage_write = "missing" +storage_write = "untested" # Fenced installer writes; this PR kernel still needs a device flight. wifi = "working" # BCM4334 on HSIC: WPA2 on 5 GHz, DHCP, DNS and HTTP. bluetooth_input = "untested" # BCM4334 patchram loads; not brought up or scanned yet. bluetooth_audio = "missing" diff --git a/producers/platforms_index.py b/producers/platforms_index.py index c25f550dd..e01fabfcc 100644 --- a/producers/platforms_index.py +++ b/producers/platforms_index.py @@ -33,7 +33,7 @@ sha = platform.sha # What a release ships for installers that read only the release (board-data.tar.gz). -BOARD_DATA = ('devices', 'chips', 'platforms', 'features.toml', 'routes.toml') +BOARD_DATA = ('devices', 'chips', 'platforms', 'features.toml', 'routes.toml', 'methods.toml') def board_data_files(root=None): @@ -140,7 +140,7 @@ def build(directory, *, kernels, tools, commit, loaders=None): return document -def build_armv7(directory, *, kernels, tools, commit, loaders): +def build_armv7(directory, *, kernels, tools, commit, loaders, m1n1_boards=None): """Write the ARMv7 layers of KERNELS ({platform: bundle}), their install tools and platforms-armv7.toml. TOOLS is the directory of ARMv7 static tools; LOADERS ({board: loader.bin}) the boards' @@ -162,6 +162,14 @@ def build_armv7(directory, *, kernels, tools, commit, loaders): 'install_tools': receipt(directory / 'install-tools-armv7.tar.gz'), 'board_data': receipt(board_data), 'platforms': layers} + covered = {board for layer in layers.values() for board in layer['boards']} + for board, source in sorted((m1n1_boards or {}).items()): + if board not in covered: + raise ValueError(f'No platform layer for m1n1 board {board}') + target = directory / f'm1n1-armv7-{board}.macho' + if Path(source).resolve() != target.resolve(): + shutil.copyfile(source, target) + document['loaders'].setdefault('m1n1_armv7', {})[board] = receipt(target) (directory / INDEX['arm']).write_text(toml(document)) return document @@ -175,6 +183,7 @@ def from_inputs(directory, inputs): if inputs.get('architecture') == 'arm': return build_armv7(directory, kernels={name: Path(row['kernel']) for name, row in inputs['platforms'].items()}, tools=tools, commit=(inputs.get('orchard') or {}).get('commit') or 'unknown', + m1n1_boards=inputs['shared'].get('m1n1_armv7_boards'), loaders={board: Path(path) for row in inputs['platforms'].values() for board, path in row['loaders'].items()}) return build(directory, kernels={name: Path(row['kernel']) for name, row in inputs['platforms'].items()}, @@ -243,6 +252,8 @@ def main(): help='with --release or --kernels: the root architecture whose index to write (default arm64)') parser.add_argument('--loader', action='append', default=[], metavar='BOARD=FILE', help="with --kernels --architecture arm: a board's Cascadia loader; repeat") + parser.add_argument('--m1n1-board', type=lambda value: value.split('=', 1), action='append', default=[], + metavar='BOARD=FILE', help='ARMv7 m1n1 Mach-O for this board') args = parser.parse_args() args.directory.mkdir(parents=True, exist_ok=True) if args.release: @@ -255,15 +266,20 @@ def main(): kernels = {name: args.kernels / name / 'components/kernel' for name in platform.platforms(architecture=args.architecture)} if args.architecture == 'arm64': - if args.loader: + if args.loader or args.m1n1_board: parser.error('--loader is for --architecture arm') build(args.directory, kernels=kernels, tools=args.tools, commit=args.commit) else: loaders = dict(value.split('=', 1) for value in args.loader if '=' in value) - if len(loaders) != len(args.loader) or not loaders: + if any(len(pair) != 2 or not all(pair) for pair in args.m1n1_board): + parser.error('--m1n1-board needs BOARD=FILE') + m1n1_boards = dict(args.m1n1_board) + if len(m1n1_boards) != len(args.m1n1_board): + parser.error('duplicate m1n1 board') + if len(loaders) != len(args.loader) or not (loaders or m1n1_boards): parser.error('--architecture arm needs --loader BOARD=FILE for each board with a Cascadia loader') build_armv7(args.directory, kernels=kernels, tools=args.tools, commit=args.commit, - loaders={board: Path(path) for board, path in loaders.items()}) + loaders={board: Path(path) for board, path in loaders.items()}, m1n1_boards=m1n1_boards) if __name__ == '__main__': diff --git a/schemas/v2/install.schema.json b/schemas/v2/install.schema.json index adfcc754e..2f0e5e6d3 100644 --- a/schemas/v2/install.schema.json +++ b/schemas/v2/install.schema.json @@ -62,7 +62,10 @@ "pattern": "^/(?:[A-Za-z0-9][A-Za-z0-9._-]{0,63})?$" }, "base": { - "enum": ["pacman", "apk"], + "enum": [ + "pacman", + "apk" + ], "description": "The root's package manager; the installer installs the kernel as its package (kernel_packages.py). Without it the installer asks the root." }, "ready": { @@ -168,6 +171,18 @@ "board_data": { "$ref": "#/$defs/receipt", "description": "orchard's board data (devices/, chips/, platforms/, features.toml) for installers that read only the release." + }, + "m1n1_armv7": { + "type": "object", + "description": "ARMv7 m1n1 Mach-O receipt by board.", + "minProperties": 1, + "propertyNames": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9._-]*$" + }, + "additionalProperties": { + "$ref": "#/$defs/receipt" + } } }, "required": [ @@ -204,7 +219,7 @@ } }, { - "description": "A release installs from a block image (root.format), or has a recovery per platform. A block-image release names its loader: m1n1 (arm64 roots) or per board the Cascadia loader (32-bit roots).", + "description": "A release installs from a block image (root.format), or has a recovery per platform. A block-image release names its loader: m1n1 for an arm64 root, or board-specific Cascadia and ARMv7 m1n1 loaders for a 32-bit root.", "if": { "properties": { "root": { @@ -232,8 +247,17 @@ ] }, { - "required": [ - "cascadia" + "anyOf": [ + { + "required": [ + "cascadia" + ] + }, + { + "required": [ + "m1n1_armv7" + ] + } ] } ] diff --git a/src/orchard/manifests.py b/src/orchard/manifests.py index cd154f6ea..6e2f81c30 100644 --- a/src/orchard/manifests.py +++ b/src/orchard/manifests.py @@ -46,8 +46,9 @@ def sources(document): yield name, document[name] if 'map' in document.get('root', {}): yield 'root.map', document['root']['map'] - for board, receipt in document.get('cascadia', {}).items(): - yield f'cascadia.{board}', receipt + for kind in ('cascadia', 'm1n1_armv7'): + for board, receipt in document.get(kind, {}).items(): + yield f'{kind}.{board}', receipt for platform, row in document.get('platforms', {}).items(): for name in ('boot', 'layer'): if name in row: # a release that installs from a block image has no recovery From 3707813c5c7fb15ac8f06feb8fb129476be4e285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Tue, 1 Dec 2026 23:30:40 +0100 Subject: [PATCH 08/14] ci: name board-specific m1n1 files in the producer contract MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: LLM Signed-off-by: Berkay Kösebay --- ci/keys.py | 5 +++-- producers/contract.toml | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ci/keys.py b/ci/keys.py index 35d77d4b9..3853cca72 100755 --- a/ci/keys.py +++ b/ci/keys.py @@ -29,7 +29,7 @@ TAG = 'nightly' RELEASES = 'https://github.com/OrchardLinux/orchard/releases/download' # m1n1's published files, all from its one build. -M1N1_FILES = ['m1n1.bin', 'm1n1-idevice.macho', 'monitor-stub.macho', 'm1n1-armv7.macho', 'm1n1-armv7-n42.macho'] +M1N1_FILES = ['m1n1.bin', 'm1n1-idevice.macho', 'monitor-stub.macho', 'm1n1-armv7.macho'] def contract(root): @@ -95,10 +95,11 @@ def shared_keys(root): def keys(root, platforms): shared = shared_keys(root) + files = M1N1_FILES + [f'm1n1-armv7-{board}.macho' for board in contract(root).get('m1n1-boards', [])] return {'schema': 1, 'platforms': {platform: {'key': source_key(root, platform), 'asset': f'{platform}-components.tar.gz'} for platform in platforms}, - 'shared': {'m1n1': {'key': shared['m1n1'], 'asset': 'm1n1.bin', 'files': M1N1_FILES}, + 'shared': {'m1n1': {'key': shared['m1n1'], 'asset': 'm1n1.bin', 'files': files}, 'tools': {'key': shared['tools'], 'asset': 'tool-components.tar.gz'}}} diff --git a/producers/contract.toml b/producers/contract.toml index 526ccface..eb458a89c 100644 --- a/producers/contract.toml +++ b/producers/contract.toml @@ -17,6 +17,8 @@ board-modules = "kernel/modules" # The files and directories that decide each component, in the order they are # hashed. +m1n1-boards = ["n42"] # additional board-specific Mach-O files in the release + [inputs] # orchard's m1n1, the quiet one every device boots. m1n1 = ["boot/m1n1", "producers/buildenv.py"] From 3adbbb1bf19f5ae6a50b2be9682955c02422f281 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Wed, 2 Dec 2026 21:56:11 +0800 Subject: [PATCH 09/14] Ship methods.toml in the board data the CLI reads, too producers/platforms_index.py puts methods.toml into board-data.tar.gz; src/orchard/hardware.py lists the same files. Assisted-by: LLM --- src/orchard/hardware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/orchard/hardware.py b/src/orchard/hardware.py index 19c182765..3639c6bf7 100644 --- a/src/orchard/hardware.py +++ b/src/orchard/hardware.py @@ -26,7 +26,7 @@ def data_root(): # What a release ships for installers that read only the release (board-data.tar.gz). -BOARD_DATA = ('devices', 'chips', 'platforms', 'features.toml', 'routes.toml') +BOARD_DATA = ('devices', 'chips', 'platforms', 'features.toml', 'routes.toml', 'methods.toml') def board_data_files(root=None): From 2d95ca5056ec4d8fcfc5009c2fd7571fd3ca26ac Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Wed, 2 Dec 2026 21:59:03 +0800 Subject: [PATCH 10/14] boot: one 32-bit m1n1 for every board, no N42-only builds Every 32-bit board starts the same m1n1-armv7.macho. The N42 watchdog and diagnostic builds, their release files and index entries go; m1n1 is to pick its watchdog settings at run time instead. The -g0 builds and methods.toml in the board data stay. Assisted-by: LLM --- .github/workflows/build.yml | 5 ++--- boot/m1n1/build | 15 --------------- ci/keys.py | 3 +-- producers/contract.toml | 2 -- producers/platforms_index.py | 24 ++++-------------------- schemas/v2/install.schema.json | 32 ++++---------------------------- src/orchard/manifests.py | 5 ++--- 7 files changed, 13 insertions(+), 73 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0fb68805..63848f86e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -511,7 +511,7 @@ jobs: # orchard launch starts any device with only Pongo and the storage-capable # m1n1; they are release assets of their own. cp out/components/quiet/m1n1.bin out/components/quiet/m1n1-idevice.macho \ - out/components/quiet/monitor-stub.macho out/components/quiet/m1n1-armv7.macho out/components/quiet/m1n1-armv7-n42.macho \ + out/components/quiet/monitor-stub.macho out/components/quiet/m1n1-armv7.macho \ out/components/quiet/pongo.bin out/publication/ # Each platform's finished kernel, the installer's tools, and the index a # distribution builds its release from, so it stops copying any of them. @@ -523,8 +523,7 @@ jobs: loaders+=(--loader "$(basename "$(dirname "$loader")")=$loader") done python producers/platforms_index.py out/publication --architecture arm --kernels out/platforms \ - --tools out/components/boot-arm --commit "$GITHUB_SHA" "${loaders[@]}" \ - --m1n1-board n42=out/components/quiet/m1n1-armv7-n42.macho + --tools out/components/boot-arm --commit "$GITHUB_SHA" "${loaders[@]}" # tool-components.tar.gz stays: a distribution build takes its tools from it. rm out/publication/kernel-components-*.tar.gz out/publication/quiet-pongo.tar.gz # Source keys of each platform's kernel, m1n1 and the tools: a distribution build diff --git a/boot/m1n1/build b/boot/m1n1/build index a2f562057..bb9ecc2ba 100755 --- a/boot/m1n1/build +++ b/boot/m1n1/build @@ -96,20 +96,5 @@ in_builder make -j2 M1N1_ARCH=arm USE_CLANG=1 \ TOOLCHAIN=/usr/lib/llvm-19/bin/ LLDDIR=/usr/lib/llvm-19/bin/ CHAINLOADING=1 \ EXTRA_CFLAGS="$extra_cflags -g0" cp "$source/build/m1n1-armv7.macho" "$(dirname "$output")/" -# A6 needs its own watchdog addresses before the ADT is available. The -# diagnostic also records startup stages in N42 PRAM and on the panel. -for variant in n42 n42-diagnostic; do - n42_flags="$extra_cflags -g0" - n42_options=(A32_EARLY_WDT_SECS=20 A32_WDT_LINUX_SECS=170) - if [[ "$variant" == n42-diagnostic ]]; then - n42_flags+=" -UQUIET_BOOT -DM1N1_DIAG_FB" - n42_options+=(A32_CRUMB_PHYS=0xbfffc400) - fi - in_builder make clean - in_builder make -j2 M1N1_ARCH=arm USE_CLANG=1 \ - TOOLCHAIN=/usr/lib/llvm-19/bin/ LLDDIR=/usr/lib/llvm-19/bin/ CHAINLOADING=1 \ - "${n42_options[@]}" EXTRA_CFLAGS="$n42_flags" - cp "$source/build/m1n1-armv7.macho" "$(dirname "$output")/m1n1-armv7-$variant.macho" -done sha256sum "$output" 2>/dev/null || shasum -a 256 "$output" echo "Loader: $output" diff --git a/ci/keys.py b/ci/keys.py index 3853cca72..bb4a9a923 100755 --- a/ci/keys.py +++ b/ci/keys.py @@ -95,11 +95,10 @@ def shared_keys(root): def keys(root, platforms): shared = shared_keys(root) - files = M1N1_FILES + [f'm1n1-armv7-{board}.macho' for board in contract(root).get('m1n1-boards', [])] return {'schema': 1, 'platforms': {platform: {'key': source_key(root, platform), 'asset': f'{platform}-components.tar.gz'} for platform in platforms}, - 'shared': {'m1n1': {'key': shared['m1n1'], 'asset': 'm1n1.bin', 'files': files}, + 'shared': {'m1n1': {'key': shared['m1n1'], 'asset': 'm1n1.bin', 'files': M1N1_FILES}, 'tools': {'key': shared['tools'], 'asset': 'tool-components.tar.gz'}}} diff --git a/producers/contract.toml b/producers/contract.toml index eb458a89c..526ccface 100644 --- a/producers/contract.toml +++ b/producers/contract.toml @@ -17,8 +17,6 @@ board-modules = "kernel/modules" # The files and directories that decide each component, in the order they are # hashed. -m1n1-boards = ["n42"] # additional board-specific Mach-O files in the release - [inputs] # orchard's m1n1, the quiet one every device boots. m1n1 = ["boot/m1n1", "producers/buildenv.py"] diff --git a/producers/platforms_index.py b/producers/platforms_index.py index e01fabfcc..eb30f5fa5 100644 --- a/producers/platforms_index.py +++ b/producers/platforms_index.py @@ -140,7 +140,7 @@ def build(directory, *, kernels, tools, commit, loaders=None): return document -def build_armv7(directory, *, kernels, tools, commit, loaders, m1n1_boards=None): +def build_armv7(directory, *, kernels, tools, commit, loaders): """Write the ARMv7 layers of KERNELS ({platform: bundle}), their install tools and platforms-armv7.toml. TOOLS is the directory of ARMv7 static tools; LOADERS ({board: loader.bin}) the boards' @@ -162,14 +162,6 @@ def build_armv7(directory, *, kernels, tools, commit, loaders, m1n1_boards=None) 'install_tools': receipt(directory / 'install-tools-armv7.tar.gz'), 'board_data': receipt(board_data), 'platforms': layers} - covered = {board for layer in layers.values() for board in layer['boards']} - for board, source in sorted((m1n1_boards or {}).items()): - if board not in covered: - raise ValueError(f'No platform layer for m1n1 board {board}') - target = directory / f'm1n1-armv7-{board}.macho' - if Path(source).resolve() != target.resolve(): - shutil.copyfile(source, target) - document['loaders'].setdefault('m1n1_armv7', {})[board] = receipt(target) (directory / INDEX['arm']).write_text(toml(document)) return document @@ -183,7 +175,6 @@ def from_inputs(directory, inputs): if inputs.get('architecture') == 'arm': return build_armv7(directory, kernels={name: Path(row['kernel']) for name, row in inputs['platforms'].items()}, tools=tools, commit=(inputs.get('orchard') or {}).get('commit') or 'unknown', - m1n1_boards=inputs['shared'].get('m1n1_armv7_boards'), loaders={board: Path(path) for row in inputs['platforms'].values() for board, path in row['loaders'].items()}) return build(directory, kernels={name: Path(row['kernel']) for name, row in inputs['platforms'].items()}, @@ -252,8 +243,6 @@ def main(): help='with --release or --kernels: the root architecture whose index to write (default arm64)') parser.add_argument('--loader', action='append', default=[], metavar='BOARD=FILE', help="with --kernels --architecture arm: a board's Cascadia loader; repeat") - parser.add_argument('--m1n1-board', type=lambda value: value.split('=', 1), action='append', default=[], - metavar='BOARD=FILE', help='ARMv7 m1n1 Mach-O for this board') args = parser.parse_args() args.directory.mkdir(parents=True, exist_ok=True) if args.release: @@ -266,20 +255,15 @@ def main(): kernels = {name: args.kernels / name / 'components/kernel' for name in platform.platforms(architecture=args.architecture)} if args.architecture == 'arm64': - if args.loader or args.m1n1_board: + if args.loader: parser.error('--loader is for --architecture arm') build(args.directory, kernels=kernels, tools=args.tools, commit=args.commit) else: loaders = dict(value.split('=', 1) for value in args.loader if '=' in value) - if any(len(pair) != 2 or not all(pair) for pair in args.m1n1_board): - parser.error('--m1n1-board needs BOARD=FILE') - m1n1_boards = dict(args.m1n1_board) - if len(m1n1_boards) != len(args.m1n1_board): - parser.error('duplicate m1n1 board') - if len(loaders) != len(args.loader) or not (loaders or m1n1_boards): + if len(loaders) != len(args.loader) or not loaders: parser.error('--architecture arm needs --loader BOARD=FILE for each board with a Cascadia loader') build_armv7(args.directory, kernels=kernels, tools=args.tools, commit=args.commit, - loaders={board: Path(path) for board, path in loaders.items()}, m1n1_boards=m1n1_boards) + loaders={board: Path(path) for board, path in loaders.items()}) if __name__ == '__main__': diff --git a/schemas/v2/install.schema.json b/schemas/v2/install.schema.json index 2f0e5e6d3..adfcc754e 100644 --- a/schemas/v2/install.schema.json +++ b/schemas/v2/install.schema.json @@ -62,10 +62,7 @@ "pattern": "^/(?:[A-Za-z0-9][A-Za-z0-9._-]{0,63})?$" }, "base": { - "enum": [ - "pacman", - "apk" - ], + "enum": ["pacman", "apk"], "description": "The root's package manager; the installer installs the kernel as its package (kernel_packages.py). Without it the installer asks the root." }, "ready": { @@ -171,18 +168,6 @@ "board_data": { "$ref": "#/$defs/receipt", "description": "orchard's board data (devices/, chips/, platforms/, features.toml) for installers that read only the release." - }, - "m1n1_armv7": { - "type": "object", - "description": "ARMv7 m1n1 Mach-O receipt by board.", - "minProperties": 1, - "propertyNames": { - "type": "string", - "pattern": "^[a-z0-9][a-z0-9._-]*$" - }, - "additionalProperties": { - "$ref": "#/$defs/receipt" - } } }, "required": [ @@ -219,7 +204,7 @@ } }, { - "description": "A release installs from a block image (root.format), or has a recovery per platform. A block-image release names its loader: m1n1 for an arm64 root, or board-specific Cascadia and ARMv7 m1n1 loaders for a 32-bit root.", + "description": "A release installs from a block image (root.format), or has a recovery per platform. A block-image release names its loader: m1n1 (arm64 roots) or per board the Cascadia loader (32-bit roots).", "if": { "properties": { "root": { @@ -247,17 +232,8 @@ ] }, { - "anyOf": [ - { - "required": [ - "cascadia" - ] - }, - { - "required": [ - "m1n1_armv7" - ] - } + "required": [ + "cascadia" ] } ] diff --git a/src/orchard/manifests.py b/src/orchard/manifests.py index 6e2f81c30..cd154f6ea 100644 --- a/src/orchard/manifests.py +++ b/src/orchard/manifests.py @@ -46,9 +46,8 @@ def sources(document): yield name, document[name] if 'map' in document.get('root', {}): yield 'root.map', document['root']['map'] - for kind in ('cascadia', 'm1n1_armv7'): - for board, receipt in document.get(kind, {}).items(): - yield f'{kind}.{board}', receipt + for board, receipt in document.get('cascadia', {}).items(): + yield f'cascadia.{board}', receipt for platform, row in document.get('platforms', {}).items(): for name in ('boot', 'layer'): if name in row: # a release that installs from a block image has no recovery From aac4aae29053afc201dd7ef7b36993ee0fa044ae Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Wed, 2 Dec 2026 22:05:04 +0800 Subject: [PATCH 11/14] n42: public IMG3 keys for the 12H321 iBSS, iBEC and DeviceTree From api.ipsw.me, each checked by decrypting the IPSW member (iBoot-2261.30.37; DeviceTree model iPhone5,2). Assisted-by: LLM --- devices/n42/boot.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/devices/n42/boot.json b/devices/n42/boot.json index c0053514f..d8db8310d 100644 --- a/devices/n42/boot.json +++ b/devices/n42/boot.json @@ -11,6 +11,26 @@ "sha256": "9757457a242e9e3ce613a10a671e464631777b7d347c7b47c281c8ec1f1d0668" }, "selected_by": "chip-reference", + "keys": { + "Firmware/dfu/iBSS.n42.RELEASE.dfu": { + "kind": "img3", + "iv": "fdad2b7a35384fa2ffc7221213ca1082", + "key": "74cd68729b800a20b1f8e8a3cb5517024a09f074eaa05b099db530fb5783275e", + "source": "api.ipsw.me v4 keys (12H321, public firmware keys); checked 2026-12-02 by decrypting this member (iBoot-2261.30.37)" + }, + "Firmware/dfu/iBEC.n42.RELEASE.dfu": { + "kind": "img3", + "iv": "ba178c287f6ce38acbec569f6adbf170", + "key": "888f24c26a13fdb2c8182b156d793b1350428e2b6c31a634d16a61752b236dc9", + "source": "api.ipsw.me v4 keys (12H321, public firmware keys); checked 2026-12-02 by decrypting this member (iBoot-2261.30.37)" + }, + "Firmware/all_flash/all_flash.n42ap.production/DeviceTree.n42ap.img3": { + "kind": "img3", + "iv": "40dc28c4fc1b28df6f44bff7f833b44d", + "key": "dccfcf97891d4fa62fef944ff646ce9a81e821883f2b6bc3cc5ca3a22ee90ce9", + "source": "api.ipsw.me v4 keys (12H321, public firmware keys); checked 2026-12-02 by decrypting this member (model iPhone5,2)" + } + }, "inputs": { "BuildManifest.plist": { "ipsw": { From 141db645e3ceb3f46755fcb4a24811bc518fdf40 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Wed, 2 Dec 2026 22:08:27 +0800 Subject: [PATCH 12/14] Docs: the P105's state as main records it Assisted-by: LLM --- docs/platforms/apple-armv7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/apple-armv7.md b/docs/platforms/apple-armv7.md index 3ad7e346c..fc44ac374 100644 --- a/docs/platforms/apple-armv7.md +++ b/docs/platforms/apple-armv7.md @@ -140,7 +140,7 @@ Only what the data and the linked PRs record: | Board | Chip | Booted by | By whom | What is proven | |---|---|---|---|---| -| iPad mini 1 (`p105`) | A5 | kDFU or Pico, then Cascadia's autogo route | shaynelegault | From RAM: display, USB serial and network, flash read. 64 GB flash writes. 16 GB read-only. The m1n1 route has not run. | +| iPad mini 1 (`p105`) | A5 | kDFU or Pico, then Cascadia's autogo route | shaynelegault | Omarchy A from the 16 GB unit's flash (read-only): display, touch, buttons, rotation, Wi-Fi, sound, battery and charging. 64 GB flash writes; the 16 GB disk is read-only. The m1n1 route has not run. | | iPad 3 (`j1`) | A5X | kDFU (kloader from iOS 9.3.5), then Cascadia's staging loader | – | Linux from RAM with Cascadia's kit (`devices/j1/README.md`). No flash access. The m1n1 route has not run. | | iPad 2 (`k93`) | A5 | – | – | Boot data only (`boot.json`, autogo addresses). | | iPhone 5 (`n42`) | A6 | kDFU, then patched iBSS and iBEC into m1n1 | brkosebay | Linux from RAM through m1n1, and the watchdog handed over (OrchardLinux/m1n1#17). Board data is in orchard#395. | From 2f9cb4bbeb75ac3c947dd142561997eeca80883d Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Wed, 2 Dec 2026 22:18:40 +0800 Subject: [PATCH 13/14] kernel: leave the armv7 lock and config to the kernel lock PR The N42 board data no longer moves the armv7 kernel by hand: the lock pointed at an unmerged OrchardLinux/linux commit and the config was not what that commit's defconfig gives, so the platform build refused it. The lock moves to the merged armv7 tip in its own pull request, with tools/kernel-tree/take. CONFIG_MTD_APPLE_SFTL_N42_WRITE belongs in the armv7 defconfig with the N42 NAND writer (OrchardLinux/linux#69). Assisted-by: LLM --- kernel/configs/apple-armv7/config | 1 - kernel/upstream-armv7.lock | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/configs/apple-armv7/config b/kernel/configs/apple-armv7/config index 01dbdfa1b..1f308fe74 100644 --- a/kernel/configs/apple-armv7/config +++ b/kernel/configs/apple-armv7/config @@ -1458,7 +1458,6 @@ CONFIG_MTD_OF_PARTS=y # CONFIG_MTD_SWAP is not set # CONFIG_MTD_PARTITIONED_MASTER is not set CONFIG_MTD_APPLE_SFTL=y -CONFIG_MTD_APPLE_SFTL_N42_WRITE=y # # RAM/ROM/Flash chip drivers diff --git a/kernel/upstream-armv7.lock b/kernel/upstream-armv7.lock index 529d454ae..640c8636c 100644 --- a/kernel/upstream-armv7.lock +++ b/kernel/upstream-armv7.lock @@ -1,2 +1,2 @@ url=https://github.com/OrchardLinux/linux.git -commit=967df736d815da896efb65c88c963c29d18135ac +commit=30699238bcd5418b03af8b1a55530db7b65f551f From 10135653676e469949d7d1a9de1947d232258ef9 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Wed, 2 Dec 2026 22:26:41 +0800 Subject: [PATCH 14/14] n42: features follow the kernel orchard builds Orchard builds OrchardLinux/linux armv7, which has the A6, the iPhone 5's device tree, both cores, the framebuffer, the USB gadget and the watchdog (linux#88). Those keep their states. What the open kernel PRs bring (flash, touch, buttons, backlight, Wi-Fi, Bluetooth, battery, charging, GPU, gyroscope, cameras) is missing until that PR is in armv7, each with the PR named, so the matrix shows no N42 install yet. Assisted-by: LLM --- devices/n42/device.toml | 32 +++++++++++++++++--------------- docs/compatibility.md | 5 ++--- docs/devices/n42.md | 26 +++++++++++++------------- tests/test_catalog.py | 4 ++-- 4 files changed, 34 insertions(+), 33 deletions(-) diff --git a/devices/n42/device.toml b/devices/n42/device.toml index cdea675df..2e448ba09 100644 --- a/devices/n42/device.toml +++ b/devices/n42/device.toml @@ -35,28 +35,30 @@ reclaims = false status = "supported" # States: working, untested, missing, none (features.toml). -# "working" means seen on one iPhone5,2 from RAM, with OrchardLinux/linux -# `armv7` plus the S5L8950X kernel series (README.md), built with clang 19 -# in the platform's toolchain image. They hold once that series is merged. +# States follow the kernel orchard builds (OrchardLinux/linux `armv7`): it has +# the A6, the iPhone 5's device tree with both cores, the framebuffer, the USB +# gadget and the watchdog (OrchardLinux/linux#88). "working" was seen on one +# iPhone5,2 from RAM. What Berkay's open kernel PRs bring is "missing" here, +# with the PR that brings it, until that PR is in armv7. [features] display = "working" # simplefb on iBoot's 640x1136 scanout, fbcon. screen_off = "missing" -backlight = "working" # LM3534 over I2C and DWI; brightness written and read back. -gpu_desktop = "missing" -touch = "untested" # The kernel boots the Z2 digitizer and logs moving one-finger frames; event0 not checked yet. -buttons = "untested" # gpio-keys probes Home, Hold, Volume Up/Down and Ringer; presses not checked. +backlight = "missing" # LM3534 backlight: OrchardLinux/linux#59 (not in armv7 yet); worked on its kernel. +gpu_desktop = "missing" # SGX543MP3: OrchardLinux/linux#61 (not in armv7 yet). +touch = "missing" # Z2 digitizer: OrchardLinux/linux#59 and #65 (not in armv7 yet). +buttons = "missing" # gpio-keys for Home, Hold, Volume and Ringer: OrchardLinux/linux#59 (not in armv7 yet). accelerometer = "missing" -gyroscope = "missing" +gyroscope = "missing" # AP3GDL gyroscope: OrchardLinux/linux#63 (not in armv7 yet). light_sensor = "missing" touch_id = "none" -storage_read = "working" # SFTL loads read-only; the System partition's HFS+ mounts read-only. -storage_write = "untested" # Fenced installer writes; this PR kernel still needs a device flight. -wifi = "working" # BCM4334 on HSIC: WPA2 on 5 GHz, DHCP, DNS and HTTP. -bluetooth_input = "untested" # BCM4334 patchram loads; not brought up or scanned yet. +storage_read = "missing" # N42 NAND reader: OrchardLinux/linux#60 (not in armv7 yet); read on its kernel. +storage_write = "missing" # Fenced N42 NAND writer: OrchardLinux/linux#69 (not in armv7 yet). +wifi = "missing" # BCM4334 on HSIC: OrchardLinux/linux#59 (not in armv7 yet); WPA2, DHCP and HTTP on its kernel. +bluetooth_input = "missing" # BCM4334 Bluetooth: OrchardLinux/linux#59 (not in armv7 yet). bluetooth_audio = "missing" cellular = "missing" -battery = "working" # bq27540 over HDQ on UART5, Apple's transaction. -charging = "untested" # The D1972 reports VBUS online and its input limit. +battery = "missing" # bq27540 over HDQ: OrchardLinux/linux#59 (not in armv7 yet); read on its kernel. +charging = "missing" # D1972 charger: OrchardLinux/linux#59 and #62 (not in armv7 yet). charging_control = "missing" # The charger driver runs disarmed: it logs and writes nothing. suspend = "missing" resume = "missing" @@ -65,5 +67,5 @@ usb_network = "working" usb_host = "missing" audio_output = "missing" audio_input = "missing" -camera = "missing" +camera = "missing" # Front and rear cameras: OrchardLinux/linux#66 (not in armv7 yet). video_decode_hevc = "missing" diff --git a/docs/compatibility.md b/docs/compatibility.md index d5a3d8aa8..581cfdee6 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -16,7 +16,6 @@ Every device Orchard installs on. ✅ works · ❌ doesn't work yet · – no su | Device | Chip | Installs | GPU | Touch | Wi-Fi | Bluetooth | Sound | Charges | Sleep | Rotation | Tested by | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | [iPad mini 1 (Wi-Fi)](devices/p105.md) | A5 | 🤔 | ❌ | ✅ | ✅ | 🤔 | ✅ | ✅ | ❌ | ✅ | [shaynelegault](https://github.com/shaynelegault) | -| [iPhone 5 (Global)](devices/n42.md) | A6 | 🤔 | ❌ | 🤔 | ✅ | 🤔 | ❌ | 🤔 | ❌ | ❌ | – | | [iPad Air (Cellular)](devices/j72.md) | A7 | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | [thisiscamk](https://github.com/thisiscamk) | | [iPad Air (China)](devices/j73.md) | A7 | 🤔 | ❌ | 🤔 | 🤔 | 🤔 | 🤔 | 🤔 | 🤔 | 🤔 | – | | [iPad Air (Wi-Fi)](devices/j71.md) | A7 | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | [ricktav](https://github.com/ricktav) | @@ -76,7 +75,7 @@ Every device Orchard installs on. ✅ works · ❌ doesn't work yet · – no su Not working on any device yet: Touch ID, cellular, cameras. -Orchard also builds for [iPad 3 (Wi-Fi)](devices/j1.md), [iPad Pro 12.9-inch (Cellular)](devices/j99a.md), [iPad Pro 12.9-inch (Wi-Fi)](devices/j98a.md), [iPad Pro 9.7-inch (Cellular)](devices/j128.md), [iPad Pro 9.7-inch (Wi-Fi)](devices/j127.md); they do not install yet. Every device links to its page: each feature with its notes and drivers, and how it boots. +Orchard also builds for [iPad 3 (Wi-Fi)](devices/j1.md), [iPad Pro 12.9-inch (Cellular)](devices/j99a.md), [iPad Pro 12.9-inch (Wi-Fi)](devices/j98a.md), [iPad Pro 9.7-inch (Cellular)](devices/j128.md), [iPad Pro 9.7-inch (Wi-Fi)](devices/j127.md), [iPhone 5 (Global)](devices/n42.md); they do not install yet. Every device links to its page: each feature with its notes and drivers, and how it boots. Which A9 do I have? iOS doesn't show it. In DFU mode, `orchard install` names the device before it asks to continue: S8000 or Samsung in the name means Samsung, otherwise TSMC. @@ -118,7 +117,7 @@ Which A9 do I have? iOS doesn't show it. In DFU mode, `orchard install` names th | A5X | iPad 3 (CDMA) | `j2` | iPad3,2 | known | – | ibss-m1n1 | – | – | 13G37 | | A5X | iPad 3 (GSM) | `j2a` | iPad3,3 | known | – | ibss-m1n1 | – | – | 13G37 | | A6 | iPhone 5 (GSM) | `n41` | iPhone5,1 | known | – | ibss-m1n1 | – | – | 14G61 | -| A6 | iPhone 5 (Global) | `n42` | iPhone5,2 | supported | yes | ibss-m1n1 | yes | yes | 12H321 | +| A6 | iPhone 5 (Global) | `n42` | iPhone5,2 | supported | – | ibss-m1n1 | yes | yes | 12H321 | | A6 | iPhone 5c (GSM) | `n48` | iPhone5,3 | known | – | ibss-m1n1 | – | – | 14G60 | | A6 | iPhone 5c (Global) | `n49` | iPhone5,4 | known | – | ibss-m1n1 | – | – | 14G60 | | A6X | iPad 4 (Wi-Fi) | `p101` | iPad3,4 | known | – | ibss-m1n1 | – | – | 14G60 | diff --git a/docs/devices/n42.md b/docs/devices/n42.md index a715f4be4..ce6da2ba2 100644 --- a/docs/devices/n42.md +++ b/docs/devices/n42.md @@ -5,7 +5,7 @@ Generated by `tools/catalog/generate matrix` from `devices/n42/device.toml`; do - **Chip:** A6 (S5L8950X) - **Board:** `n42` (iPhone 5 (Global)) - **Products:** iPhone5,2 -- **Installs:** yes +- **Installs:** not yet ## Features @@ -15,22 +15,22 @@ Driver: this board's device tree has not been read yet (`tools/catalog/generate - ✅ **Display**: simplefb on iBoot's 640x1136 scanout, fbcon. - ❌ **Screen on/off** -- ✅ **Backlight**: LM3534 over I2C and DWI; brightness written and read back. -- ❌ **GPU desktop** -- 🤔 **Touchscreen**: The kernel boots the Z2 digitizer and logs moving one-finger frames; event0 not checked yet. -- 🤔 **Buttons**: gpio-keys probes Home, Hold, Volume Up/Down and Ringer; presses not checked. +- ❌ **Backlight**: LM3534 backlight: OrchardLinux/linux#59 (not in armv7 yet); worked on its kernel. +- ❌ **GPU desktop**: SGX543MP3: OrchardLinux/linux#61 (not in armv7 yet). +- ❌ **Touchscreen**: Z2 digitizer: OrchardLinux/linux#59 and #65 (not in armv7 yet). +- ❌ **Buttons**: gpio-keys for Home, Hold, Volume and Ringer: OrchardLinux/linux#59 (not in armv7 yet). - ❌ **Accelerometer** -- ❌ **Gyroscope** +- ❌ **Gyroscope**: AP3GDL gyroscope: OrchardLinux/linux#63 (not in armv7 yet). - ❌ **Light sensor** - – **Touch ID** -- ✅ **Internal storage read**: SFTL loads read-only; the System partition's HFS+ mounts read-only. -- 🤔 **Internal storage write**: Fenced installer writes; this PR kernel still needs a device flight. -- ✅ **Wi-Fi**: BCM4334 on HSIC: WPA2 on 5 GHz, DHCP, DNS and HTTP. -- 🤔 **Bluetooth input devices**: BCM4334 patchram loads; not brought up or scanned yet. +- ❌ **Internal storage read**: N42 NAND reader: OrchardLinux/linux#60 (not in armv7 yet); read on its kernel. +- ❌ **Internal storage write**: Fenced N42 NAND writer: OrchardLinux/linux#69 (not in armv7 yet). +- ❌ **Wi-Fi**: BCM4334 on HSIC: OrchardLinux/linux#59 (not in armv7 yet); WPA2, DHCP and HTTP on its kernel. +- ❌ **Bluetooth input devices**: BCM4334 Bluetooth: OrchardLinux/linux#59 (not in armv7 yet). - ❌ **Bluetooth audio** - ❌ **Cellular** -- ✅ **Battery status**: bq27540 over HDQ on UART5, Apple's transaction. -- 🤔 **Charging**: The D1972 reports VBUS online and its input limit. +- ❌ **Battery status**: bq27540 over HDQ: OrchardLinux/linux#59 (not in armv7 yet); read on its kernel. +- ❌ **Charging**: D1972 charger: OrchardLinux/linux#59 and #62 (not in armv7 yet). - ❌ **Charging control**: The charger driver runs disarmed: it logs and writes nothing. - ❌ **Suspend** - ❌ **Resume** @@ -39,7 +39,7 @@ Driver: this board's device tree has not been read yet (`tools/catalog/generate - ❌ **USB host** - ❌ **Speakers** - ❌ **Microphone** -- ❌ **Cameras** +- ❌ **Cameras**: Front and rear cameras: OrchardLinux/linux#66 (not in armv7 yet). - ❌ **Hardware H.265 video decoding** ## Boot diff --git a/tests/test_catalog.py b/tests/test_catalog.py index 14c14dba3..9a6e3a059 100644 --- a/tests/test_catalog.py +++ b/tests/test_catalog.py @@ -524,9 +524,9 @@ def test_the_boards_with_every_requirement_can_install(self): 'j120', 'j121', 'j171', 'j172', 'j207', 'j208', 'j71', 'j71b', 'j71s', 'j71t', 'j72', 'j72b', 'j72s', 'j72t', 'j73', 'j81', 'j82', 'j85', 'j85m', 'j86', 'j86m', 'j87', 'j87m', 'j96', 'j97', 'n102', 'n51', 'n53', 'n56', 'n61', 'n66', 'n66m', 'n69', 'n69u', 'n71', 'n71m', - # prepared by usbliter8 (A12) or a Pico checkm8 stick or kDFU (A5, A6) + # prepared by usbliter8 (A12) or a Pico checkm8 stick or kDFU (A5) 'd321', 'd331', 'd331p', 'j171a', 'j172a', 'j210', 'j211', 'j217', 'j218', 'n841', - 'n42', 'p105'}) + 'p105'}) def test_each_requirement_blocks(self): from orchard import hardware