First of all, I should correct the wrong concept. In USB spec, there are no master or slave. It is called host and peripheral(device).
host and peripheral(device) have no id pin. Only otg mode has one ID pin.
Let's say usb 2.0. 4 pins for host and peripheral(device). 5 pins for otg.
Reflecting to the Linux dts binding guide, they are dr_mode=host,dr_mode=peripheral and dr_mode=otg
Linux/Documentation/devicetree/bindings/usb/generic.txt
dr_mode: tells Dual-Role USB controllers that we want to work on a
particular mode. Valid arguments are "host",
"peripheral" and "otg". In case this attribute isn't
passed via DT, USB DRD controllers should default to
OTG.
From your description, you plan to use the usb port as host. And your question should be how to deal with the download when normal run usb as host mode.
So, in your case, you should have two dts. one for programming(dr_mode=peripheral) and another for normal run(dr_mode=host).
actually, you don't have to do grounding the usb id pin by hardware. Because as above no id pin defined in host and peripheral(device).
If you add dr_mode=host, Linux will never check the id pin.
if you add dr_mode=peripheral, Linux also will never check the id pin.
The same is the i.MX ROM code download mode is work as peripheral(device). It will never check the id pin, either.
i.MX ROM code engineers and the Linux engineers are using the same concept and follow the same usb spec.
No id pin for host and peripheral(device). and otg has id pin.