+ struct uartlite *regs = userial_ports[port];
+
+ if (regs) {
+ out_be32(®s->control, 0);
+ out_be32(®s->control,
+ ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX);
+ in_be32(®s->control);
+ return 0;
+ }
+
+ return -1;
+}
+
+/* Multi serial device functions */
+#define DECLARE_ESERIAL_FUNCTIONS(port) \
+ static int userial##port##_init(void) \
+ { return uartlite_serial_init(port); } \
+ static void userial##port##_setbrg(void) {} \
+ static int userial##port##_getc(void) \
+ { return uartlite_serial_getc(port); } \
+ static int userial##port##_tstc(void) \
+ { return uartlite_serial_tstc(port); } \
+ static void userial##port##_putc(const char c) \
+ { uartlite_serial_putc(c, port); } \
+ static void userial##port##_puts(const char *s) \
+ { uartlite_serial_puts(s, port); }
+
+/* Serial device descriptor */
+#define INIT_ESERIAL_STRUCTURE(port, __name) { \
+ .name = __name, \
+ .start = userial##port##_init, \
+ .stop = NULL, \
+ .setbrg = userial##port##_setbrg, \
+ .getc = userial##port##_getc, \
+ .tstc = userial##port##_tstc, \
+ .putc = userial##port##_putc, \
+ .puts = userial##port##_puts, \