Index: kernel/genarch/src/drivers/ns16550/ns16550.c
===================================================================
--- kernel/genarch/src/drivers/ns16550/ns16550.c	(revision 1b7b7aff32d0dd8183160089c5b1fa67735d20ce)
+++ kernel/genarch/src/drivers/ns16550/ns16550.c	(revision a7f7b9c3744bb1a355f84327e6b489c2a79f47c5)
@@ -132,4 +132,28 @@
 };
 
+/** Configure ns16550 transmission format.
+ *
+ * @param instance   NS 16550 driver instance.
+ * @param baud_rate  Transmission speed in bits per second, also known as baud,
+ *                   maximum value is 115200.
+ * @param lcr_format Line Control Register configuration bits, as defined by
+ *                   the @c LCR_ macros.  These configure the word width,
+ *                   parity type, and stop bit count.
+ */
+void ns16550_format_set(ns16550_instance_t *instance,
+    unsigned baud_rate, uint8_t lcr_format)
+{
+	uint16_t divisor;
+
+	divisor = (uint16_t)(NS156440_CLOCK / baud_rate);
+	if (divisor == 0)
+		divisor = 1;  /* Avoid division by zero. */
+
+	ns16550_reg_write(instance, NS16550_REG_LCR, LCR_DLAB);
+	ns16550_reg_write(instance, NS16550_REG_DLL, divisor & 0xFF);
+	ns16550_reg_write(instance, NS16550_REG_DLH, (divisor >> 8) & 0xFF);
+	ns16550_reg_write(instance, NS16550_REG_LCR, lcr_format & ~LCR_DLAB);
+}
+
 /** Initialize ns16550.
  *
