]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/serial/serial-uclass.c
dm: Add support for all targets which requires MANUAL_RELOC
[karo-tx-uboot.git] / drivers / serial / serial-uclass.c
index 9131a8f93d9a5adff359d2940ddfd6a6a05c445e..3fc7104359d3ccfd73e97ab81dd466cc6c62877a 100644 (file)
@@ -258,6 +258,22 @@ static int serial_post_probe(struct udevice *dev)
 #endif
        int ret;
 
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
+       if (ops->setbrg)
+               ops->setbrg += gd->reloc_off;
+       if (ops->getc)
+               ops->getc += gd->reloc_off;
+       if (ops->putc)
+               ops->putc += gd->reloc_off;
+       if (ops->pending)
+               ops->pending += gd->reloc_off;
+       if (ops->clear)
+               ops->clear += gd->reloc_off;
+#if CONFIG_POST & CONFIG_SYS_POST_UART
+       if (ops->loop)
+               ops->loop += gd->reloc_off
+#endif
+#endif
        /* Set the baud rate */
        if (ops->setbrg) {
                ret = ops->setbrg(dev, gd->baudrate);