Start by '''identifying the [[Micro-USB Interface Controller]]''' used in your device. The MUIC is what handles things like USB-OTG - it usually figures out what a cable is supposed to do by checking the resistance between the ground pin and the ID pin. Most MUICs implement an ''UART jig mode'' as part of the Carkit standard (see the [[Micro-USB Interface Controller]] page), which allows the USB port to be used as a serial input/output port.
You can try looking for kernel options with "MUIC", "USB" or "UART" in the name in the downstream kernel's defconfig - if you find a seemingly SOC-specific option, grep through the kernel source to find the driver (hint: don't include the CONFIG_ part). Once you've found the model of your MUIC, look for similar chips in the [[Micro-USB Interface Controller|MUIC]] page to find the resistance values you should use for your cable. If you're unsure, look up your MUIC chip's datasheet; if you can't find one, or the datasheet does not have the resistance value table, use the default values.
=== Finding the UART ports on your device's main board ===