- Are there any tricks (from within linux) to wait for a GPIO to go high before enabling all power-domains full Core-speed etc?
No. By the time Linux resumes, all power domains should be restored. However, if you configure a lower OPP before entering suspend, Linux will resume with that same lower voltage/frequency (lower power).
- To me it sounds best to do this in the am335x-pm-firmware.bin a8_wake_ds0_handler. Why do you not recommend this?
Yes, if you wish to run code before the power domains are restored, it would have to be done in the M3 firmware in a function like a8_wake_ds0_handler.
We don't recommend this because the M3 code size is limited in the internal SRAM, and the firmware was not designed to drive GPIOs. You would need to implement your own GPIO driver. If you can access the CONTROL_MODULE from M3, you may be able to modify the IO pad configuration to set a GPIO high with the internal pull-up. Of course, the drive strength of this pull-up will be rather weak.
What is your power target? Do you need <10mW while waiting for the GPIO signal from an external source? What is this external source in regards to your system?