I went ahead and implemented the "blink whenever you can" version (it was actually
suggested by ahull). This will probably not make it into CHDK, but I post it anyway.
I have compiled a table that contains an LED address, P-ID location, and the P-ID for every camera that can execute the resulting DISKBOOT. If the startup check fails, a routine will use this table to get the camera's P-ID (there is a slim chance that it will find an incorrect P-ID due to the different P-ID locations in ROM). When a value that looks like a P-ID is found, it will blink using the corresponding LED address.
DISKBOOT compatibility depends on the cameras' "dancing bits" encoding. Cameras with the same encoding can start each others diskboot files. Diskboot files with different encodings will result in the previously mentioned nonsense, which we can't control. It also looks like unencoded diskboot files are ignored by later cameras (they fail a check).
Now for the table data:
Several cameras are left out for one or more of the following reasons:
- the P-ID location is unknown (early Vx cameras with short available firmware dumps)
- no LED address can be determined ( debug_led() uses firmware functions and/or no-one has found correct LED addresses)
- strange LED operating requirements (on DIGIC 5 cams)
The rest isn't absolutely sure either: some cameras may require two GPIOs to operate certain LEDs (the print LED didn't work on the ixus30/40, s80 for example).
The patch contains the needed changes for a few cameras. check_compat() is now the first subroutine that gets executed - entry.S is easier to change (with a script), and it also avoids setting a potentially wrong GPIO (SD power).
The "sub CPU" cameras don't let the DIGIC loop indefinitely, the other CPU shuts down the camera a few seconds later.
Unrelated finding: shutdown() in platform/camera/lib.c can be declared unusable. Many ports have nonsense code here (unless I'm misunderstanding something). This should switch off the DIGIC's main power directly by using a GPIO. Some ports try to operate an LED instead, others use mis-calculated offsets.