Worked on the firmware side a bit. Now the microcontroller reads the VSA-100 I2C temperature sensor, internal temperature sensor, and monitors the PGOOD signals of the PSUs.
If the VSA or MCU temperature are greater than a certain threshold, or if one of the power rails goes down (eg. due to overtemperature) the MCU immediately turns off the power rails and sends an emergency shutdown signal to the laptop. This is tested and works fine.
Fan is now controlled depending on the VSA-100 temperature. For now, it's just a simple LUT, I'll implement some hysteresis.
Backlight control was switched back to the MCU, and the scaler backlight control is fed into the MCU. The scaler can override the MCU backlight control only when it wants to turn it off.
Now for the more interesting part. The PCIe to PCI bridge has 5 GPIOs. Two of them are used for the I2C EEPROM that stores the bridge configuration. 3 GPIOs are left, and I used them to implement a bidirectional communication bus between the bridge and the MCU. These pins are set as RX, TX and CLOCK. On the MCU and host side there are two state machines implemented that are basically a shift register, and package/parse the data.
On the host side, by reading/writing the PCI configuration registers of the PCIe-PCI bridge, the GPIOs are configured as input/output and their values can be set or read. The MCU also stores configuration persistently in the FRAM.
Now, this is the first time I write a GUI application, (or a Windows application for that matter ), so the design maybe isn't the prettiest thing, but it works.
I wrote this in Visual Studio Express C# 2008, which, unexpectedly , was a joy to use.
It also runs in the system tray when minimized:
Now backlight control from the OS works, the VSA-100 frequency can be changed, VSA-100 core voltage can be changed from 2.5V to 3.1V, and Framebuffer Size can be changed between 32MB and 64MB without tearing down the laptop and flipping a switch.
It can also read back the data that's persistently stored on the card, card model and revision, temperature sensors.