+static const struct dm_serial_ops altera_uart_ops = {
+ .putc = altera_uart_putc,
+ .pending = altera_uart_pending,
+ .getc = altera_uart_getc,
+ .setbrg = altera_uart_setbrg,
+};
+
+static const struct udevice_id altera_uart_ids[] = {
+ { .compatible = "altr,uart-1.0" },
+ {}
+};
+
+U_BOOT_DRIVER(altera_uart) = {
+ .name = "altera_uart",
+ .id = UCLASS_SERIAL,
+ .of_match = altera_uart_ids,
+ .ofdata_to_platdata = altera_uart_ofdata_to_platdata,
+ .platdata_auto_alloc_size = sizeof(struct altera_uart_platdata),
+ .probe = altera_uart_probe,
+ .ops = &altera_uart_ops,
+ .flags = DM_FLAG_PRE_RELOC,
+};
+
+#ifdef CONFIG_DEBUG_UART_ALTERA_UART
+
+#include <debug_uart.h>
+
+static inline void _debug_uart_init(void)