I'm trying to have arduino pro micro with 32u4 attached to USB port and power a raspberry pi 0w that's connected to arduino. I want to do this properly, only turning on pi after 32u4 finishes USB configuration as 500mA device. So I need a P-MOSFET. The tricky part is arduino is connected to pi via SPI so pi can update arduino's firmware. When arduino reboots after firmware upload or due to programmatically rebooting to enumerate a different USB descriptor, I don't want pi to lose power. I wish 32u4 has some strapping pins that I can set before external reset so it would hold the gate of the P-MOSFET low but there isn't. What should I do to hold the gate?
I thought about caps but that's not proper. I need a steady logic level. Should I add an IC say an I2C GPIO expender that has hi-Z state at power on so I can have the MOSFET gate pull up for initial power on but then have 32u4 set the IC output pin to output low? This way arduino can reset and the IC will keep rpi power steady.
Any suggestions? Thanks.