Commit 384b62c0 authored by Bin Meng's avatar Bin Meng Committed by Simon Glass
Browse files

serial: ns16550: Handle zero <clock-frequency> value

A working device tree node of ns16550 should never be populated
with value zero for the <clock-frequency> property. Unfortunately
this is the case for the QEMU ppce500 target.

Let's try to assign plat->clock to CONFIG_SYS_NS16550_CLK as the
last resort to handle such case.

This commit should be reverted when:

- The following QEMU patch [1] is merged, and
- U-Boot CI has upgraded its QEMU version that contains the fix


Signed-off-by: Bin Meng's avatarBin Meng <>
Reviewed-by: Simon Glass's avatarSimon Glass <>
parent 09bd0840
Pipeline #6611 passed with stages
in 66 minutes and 42 seconds
......@@ -564,6 +564,8 @@ int ns16550_serial_of_to_plat(struct udevice *dev)
if (!plat->clock)
plat->clock = dev_read_u32_default(dev, "clock-frequency",
if (!plat->clock)
plat->clock = CONFIG_SYS_NS16550_CLK;
if (!plat->clock) {
debug("ns16550 clock not defined\n");
return -EINVAL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment