On 2019.04 SPL, we enabled DM gadget driver for QM/QXP to support
dual USB ports. The CI_UDC DM gadget driver will call init function
inside EHCI mx6 driver, so when building SPL on iMX8QM/QXP with CI UDC
enabled, we have to enable usb host driver as well, and this introduces
about more than 40KB size to SPL.
Move the common codes to a independent file, so that both host driver
and gadget driver can call it, then decouple the host and gadget driver.
Note: the patch only applies to ci_udc gadget DM driver. For non-DM gadget
driver, it still depends ehci host interfaces.
Signed-off-by: Ye Li
Acked-by: Peng Fan
(cherry picked from commit 1afed171a77b4c95cd4ea76f29d5a0a6bb199820)