[Solved] Help troubleshooting a WNR3500L USB problem/GPIO problem

I installed LEDE Reboot 17.01.4 r3560-79f57e422d / LuCI lede-17.01 branch (git-17.290.79498-d3f0685) in my WNR3500L, and the USB port gets powered down towards the end of the boot process. It does not happen when booting in failsafe mode.

The USB port is powered thru GPIO12. Something takes control of GPIO12 towards the end of the boot process, and sets it low, preventing USB from working.

In failsafe mode, I can use:

echo 12 > /sys/class/gpio/export
cat /sys/class//gpio/gpio12/value
echo out > /sys/class/gpio/gpio12/direction
echo 1 > /sys/class/gpio/gpio12/value

to turn on and off the GPIO12 pin, and turn on/off power to USB. When I boot normally, even if I send 1 to value, I read it back as 0 and USB has no power

How can I start eliminating modules that take control of GPIO12 by setting it low and keeping it low even if I change it?

I'd be happy to build a custom build if needed, but I wouldn't know where to start eliminating options, either...

Parallel thread: [Solved] USB not working in WNR3500L V1 17.01.4

Final update: it is indeed a NVRAM configuration issue.

nvram set boardflags=0x00000710
nvram commit

followed by a power cycle (reboot is not enough). After that USB has power and everything works as expected