Repository navigation
iPhone 5s (N51): touchscreen and Wi-Fi - #151
Merged
Merged
Conversation
The iPhone 5s's Amber (D2045) PMIC switches the touchscreen's core supply. Add its compatible. Assisted-by: LLM Signed-off-by: ashtonamory <287786029+ashtonamory@users.noreply.github.com>
The iPhone 5s's ADT gives the multi-touch node function-power_ldo = pmuL(0x20e), LDO index 14 on the D2045. In iOS 12.5.8 (16H88), AppleD2045PMU::_setLDO indexes a table of 12-byte entries; entry 14 is an enable-only switch at register 0x85 bit 1, set by read/modify/write. Tested on an iPhone 5s (N51): the touchscreen powers up and boots. Assisted-by: LLM Signed-off-by: ashtonamory <287786029+ashtonamory@users.noreply.github.com>
The iPhone 5s touchscreen takes the iPhone 6's properties: analog and core supplies, the touch clock and the loader's calibration. Assisted-by: LLM Signed-off-by: ashtonamory <287786029+ashtonamory@users.noreply.github.com>
The iPhone 5s (N51 and N53) runs the iPhone 6's generation-1 protocol. Its iOS 12.5.8 personality "C1,N51" (C1F57,3) is AppleMultitouchN1SPI with the N61's calibration download (0x10009000) and proximity (0x10009600) addresses, fll-mval 6099, ref-clk-div 2, clk32 enable and execute address 0x10003400. Reuse the N61 variant and its SPI timings. Tested on an iPhone 5s (N51): multi-touch reports cover the panel in the right orientation. Assisted-by: LLM Signed-off-by: ashtonamory <287786029+ashtonamory@users.noreply.github.com>
Describe the N1 on SPI1 from the N51 ADT (/arm-io/spi1/multi-touch): attention GPIO 22, reset GPIO 23, the PWM touch clock, the analog supply on the Chestnut display PMU (dpLE(0x302)) and the core supply on the D2045 (pmuL(0x20e)). N51 and N53 share their kernelcache, whose only 5s touch personality matches multi-touch,n51, and identical mtprops, so the node goes in the shared 5s dtsi. Tested on an iPhone 5s (N51). Assisted-by: LLM Signed-off-by: ashtonamory <287786029+ashtonamory@users.noreply.github.com>
…dio identity The iPhone 5s puts its HSIC radio's reset on another PMIC and line than the A7 iPads, and its boot ROM is another chip with another USB product ID. Add apple,pmu-reset, apple,rom-chip and apple,usb-pid; without them the iPads' values apply. Assisted-by: LLM Signed-off-by: ashtonamory <287786029+ashtonamory@users.noreply.github.com>
…device tree The reset was GPIO 3 of the D2089 at I2C 0x3c and the boot ROM 0a5c:bd1c reporting chip 0x4324, as on every A7 iPad. The iPhone 5s resets its BCM43342 with GPIO 10 of the D2045 at 0x74, and its ROM is 0a5c:bd21, chip 0xa94e. Read apple,pmu-reset, apple,rom-chip and apple,usb-pid, keeping the iPads' values as defaults. iOS's D2045 and D2089 drivers both configure PMU GPIO n at register 0x400 | n (n <= 15); the 5s reset reads the same 0x09 baseline, so the measured 09/0b/09 sequence and its gates are unchanged. Tested on an iPhone 5s (N51): the radio enumerates and its ROM reports a94e rev 1, 0x80000 bytes at 0x60000000. Assisted-by: LLM Signed-off-by: ashtonamory <287786029+ashtonamory@users.noreply.github.com>
Look the HSIC radio up in a table of boot ROM chip IDs, firmware names and RAM bounds instead of assuming the BCM43241, add the BCM43342 (0a5c:bd21, ROM chip 43342) and name its firmware brcmfmac43342-<board>-usb. Tested on an iPhone 5s (N51): firmware 6.46.79 starts and a scan finds 2.4 and 5 GHz networks. Assisted-by: LLM Signed-off-by: ashtonamory <287786029+ashtonamory@users.noreply.github.com>
The N51 ADT puts the BCM43342 (module chardonnay, wifi-chipset 43342) on EHCI1 port 1 with its HSIC PHY at usb-complex +0x60, HOST_READY on GPIO 166, DEVICE_READY on GPIO 167 and the reset on the D2045's GPIO 10. Tested on an iPhone 5s (N51). Assisted-by: LLM Signed-off-by: ashtonamory <287786029+ashtonamory@users.noreply.github.com>
Resolve the apple,z2-multitouch binding next to the D79 touchscreen. Assisted-by: LLM Signed-off-by: Henrik Klee <henrik@goat-code.com>
|
Thank you, Ashton, this is a great first contribution: careful work straight from the iOS drivers and the ADT, in clean upstream-style commits. Merged. What it brings:
Changed on your branch: one merge of current Next: orchard takes this kernel and lands #544 with the device data (N51 touch, Wi-Fi and storage working; N53 touch and Wi-Fi untested). One request: please use your real name in the sign-offs ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
iPhone 5s (N51): touchscreen and Wi-Fi
Brings up the touchscreen and Wi-Fi on the iPhone 5s (S5L8960X). Both are verified on an N51 running installed Omarchy A 0.4.8. The orchard side (device data, firmware recipes, docs) follows in OrchardLinux/orchard and needs this merged first.
Touchscreen (5 commits)
AppleD2045PMU::_setLDOtable (the ADT's pmuL 0x20e, LDO 14). Binding in its own patch.apple,n51-touchscreentakes the N61 Gen1 variant (the iOS personality is C1F57,3, "AppleMultitouchSPI - C1,N51"), with a 1000 µs CS delay. Binding in its own patch.touchscreen0alias lets m1n1 copy the calibration from the ADT.Wi-Fi (4 commits)
apple,pmu-reset,apple,rom-chip,apple,usb-pid). The A7 iPads keep their old values as defaults, so their DTs don't change. On the 5s the BCM43342 reset is GPIO 10 of the D2045 (register 0x40a, the same0x400 | nlayout iOS uses for the D2089), and its boot ROM is 0a5c:bd21, chip 0xa94e.brcmfmac43342-<board>-usb).Testing
orchard build hardware-check --device n51 --kernel <this branch>.