First attempt at flashing the Parade DP855 TCON (13" M1 MBP): No luck
This post kicks off a series where I'll be poking around the TCON flashing process. If it turns into more than a couple of posts, I'll move it to its own thread.
I wrote a small app that uses libAppleTCONUpdater.dylib. The app retrieves TCON information, populates an XML request to obtain a ticket from Apple, receives the ticket, and passes it along with the contents of the firmware file to libAppleTCONUpdater.dylib. The app was thrown together in a couple of hours - it's hacky, and just meant to test the hypothesis.
I also bumped the firmware-ver and bundle-ver version numbers in the firmware file to confirm that the update took place.
ThelibAppleTCONUpdater.dylib library writes a log during the update process; here's the most interesting part:
[TCON LOG]: Dev:deviceid A41032
[TCON LOG]: FW Update Options I:1 S:0
[TCON LOG]: Update to 0x01:0x45
[TCON LOG]: Download comp:0x0000 NumBlocks:16
[TCON LOG]: Download comp:0x5501 NumBlocks:1
[TCON LOG]: Download comp:0x5502 NumBlocks:2
[TCON LOG]: Download comp:0x5503 NumBlocks:1
[TCON LOG]: Download comp:0x5504 NumBlocks:1
[TCON LOG]: Download comp:0x550b NumBlocks:2
[TCON LOG]: Fuse SDOM (1:0)
[TCON LOG]: Reset option 2
[TCON LOG]: AppleTCONUpdateController::execCommand: Exiting execCommand: command = performNextStage, result = 0x0
Great, so it looks like the firmware data is successfully written to the chip, which is why the library returns result = 0x0 (spoiler: there's a catch). A quick note: "Download" here doesn't mean downloading from the network; this is a common term in the microcontroller firmware world for sending data over the bus.
When libAppleTCONUpdater.dylib performs the firmware update, it calls methods from AppleDPDisplayTCON.kext behind the scenes:
AppleParadeDP855TCON::readRegisters(unsigned int, unsigned char*, unsigned int)
AppleParadeDP855TCON::writeRegisters(unsigned int, unsigned char const*, unsigned int)
Nearly 18,000 calls to the writeRegisters method!
I reverse-engineered AppleParadeDP855TCON::writeRegisters. The code shows direct hardware communication via I2C with the DP855 controller. I2C is a simple communication bus commonly used to connect microcontrollers with peripherals like sensors, displays, and memory chips.
This looks like real hardware interaction!
But after rebooting the Mac, neither firmware-ver nor bundle-ver in the I/O Registry had changed.
I also modified the EDID to avoid possible version mismatches. The EDID is present in two sections of the firmware update file. I changed the display name in both places. Then I read the EDID back using BetterDisplay (it reads directly over the I2C bus) after flashing. The EDID did not change.
Bottom line: There is a suspicion that the data is being written only into the TCON SRAM (volatile memory), and then the controller itself is supposed to commit that data into its internal flash memory (non-volatile memory). But for some reason that does not happen.