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/boot/m1n1/build b/boot/m1n1/build index c6672f163..bb9ecc2ba 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,7 @@ 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")/" sha256sum "$output" 2>/dev/null || shasum -a 256 "$output" echo "Loader: $output" 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..e95ed1f32 --- /dev/null +++ b/devices/n42/README.md @@ -0,0 +1,69 @@ +# 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 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 boots like every 32-bit board: the `ibss` route and its +`ibss-m1n1` method (`docs/platforms-and-builds.md`, "32-bit boot"), a +patched iBSS and iBEC, Apple's DeviceTree, then the 32-bit m1n1 with `bootx`. +The tested starting point was an iPhone5,2 already jailbroken on iOS 8.4.1 +(12H321), entering kDFU with kloader (OrchardLinux/m1n1#17). 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 | 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. | +| 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. + +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 +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..d8db8310d 100644 --- a/devices/n42/boot.json +++ b/devices/n42/boot.json @@ -4,37 +4,57 @@ "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": "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)" + } }, - "selected_by": "newest", "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 ac9699969..2e448ba09 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,6 +6,7 @@ kind = "hardware.device" profile = "n42" name = "iPhone 5 (Global)" apple_products = ["iPhone5,2"] +dt_compatible = ["apple,n42ap"] [match.dfu] chip = 0x8950 @@ -15,3 +15,57 @@ board = 0x02 [boot] methods = ["ibss-m1n1"] entries = ["pico-checkm8", "kdfu"] +# The 32-bit boards' ibss route (routes.toml): booted from a jailbroken iOS 8.4.1 +# (12H321), where kloader enters kDFU; a patched iBSS and iBEC follow, and iBEC +# starts the 32-bit m1n1 with bootx (README.md, OrchardLinux/m1n1#17). + +[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" + +# iOS prepares the LwVM split separately. The install kernel restricts writes +# to Linux partitions in the released space. +[storage] +reclaims = false + +[support] +status = "supported" + +# States: working, untested, missing, none (features.toml). +# 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 = "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" # AP3GDL gyroscope: OrchardLinux/linux#63 (not in armv7 yet). +light_sensor = "missing" +touch_id = "none" +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 = "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" +usb_serial = "working" # ttyGS0 shell, no clk_ignore_unused. +usb_network = "working" +usb_host = "missing" +audio_output = "missing" +audio_input = "missing" +camera = "missing" # Front and rear cameras: OrchardLinux/linux#66 (not in armv7 yet). +video_decode_hevc = "missing" diff --git a/devices/n42/firmware.json b/devices/n42/firmware.json new file mode 100644 index 000000000..bba3b5ec4 --- /dev/null +++ b/devices/n42/firmware.json @@ -0,0 +1,126 @@ +{ + "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" + }, + "sha256": "dcee499a26e387a7503369402f308947cb54530ec905530b68389d120b528e94" + }, + "gl-event.pds": { + "ipsw": { + "rootfs": "System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv7s", + "range": [ + 4676568, + 168 + ] + }, + "sha256": "a1b855d41993968b40005e886f7ac11c8c3abb42aa0987e005eec4e6cb2a2285" + } + }, + "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" + } + ] + }, + { + "destination": "lib/firmware/apple/sgx543-n42/gl-event.pds", + "sha256": "a1b855d41993968b40005e886f7ac11c8c3abb42aa0987e005eec4e6cb2a2285", + "steps": [ + { + "step": "copy@1", + "input": "gl-event.pds" + } + ] + } + ] +} diff --git a/docs/compatibility.md b/docs/compatibility.md index efd688621..581cfdee6 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 | – | 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 | known | – | ibss-m1n1 | – | – | 14G61 | +| 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 new file mode 100644 index 000000000..ce6da2ba2 --- /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 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**: AP3GDL gyroscope: OrchardLinux/linux#63 (not in armv7 yet). +- ❌ **Light sensor** +- – **Touch ID** +- ❌ **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: 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** +- ✅ **USB serial**: ttyGS0 shell, no clk_ignore_unused. +- ✅ **USB network** +- ❌ **USB host** +- ❌ **Speakers** +- ❌ **Microphone** +- ❌ **Cameras**: Front and rear cameras: OrchardLinux/linux#66 (not in armv7 yet). +- ❌ **Hardware H.265 video decoding** + +## Boot + +- **Methods:** ibss-m1n1 +- **Entries:** pico-checkm8, kdfu +- **Platform:** apple-armv7, –-byte pages +- **Firmware recipe:** yes +- **Device tree:** `s5l8950x-n42` +- **boot.json build:** 12H321 + +## Tested by + +Nobody yet. 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. | diff --git a/producers/platforms_index.py b/producers/platforms_index.py index c25f550dd..eb30f5fa5 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): 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", 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):