How switch uboot behaviour with simple wire connecting two pins on J21 header?


I want to change uboot behaviour (boot from dhcp or from flash) and for development I want to control it via simple wire on pins on J21 header.

So when there is no wire between two pins, it should boot from internal flash. When I put wire, it enters “diskless” mode and start dhcp.

Is it possible to do in uboot? I tried different ways, but I cannot achieve predictable button-like behaviour from pins.