Now that the driver defaults to BAUD_AUTO this can happen if the early uart !=
console or if early printk isn't in use.
The following division by zero causes a trap but that uses regular printk and
not early_printk, so it is never seen.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
{
/* Baud rate already set: read it out from the divisor latch. */
divisor = (pl011_read(uart, IBRD) << 6) | (pl011_read(uart, FBRD));
+ if (!divisor)
+ early_panic("pl011: No Baud rate configured\n");
uart->baud = (uart->clock_hz << 2) / divisor;
}
/* This write must follow FBRD and IBRD writes. */