Commit b0816f88 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Li Yang

serial: ucc_uart: limit brg-frequency workaround to PPC32

According to Timur Tabi

    This bug in older U-Boots is definitely PowerPC-specific

So before allowing this driver to be built for platforms other than
PPC32, make sure that we don't accept malformed device trees on those
other platforms.
Suggested-by: default avatarTimur Tabi <timur@kernel.org>
Reviewed-by: default avatarTimur Tabi <timur@kernel.org>
Acked-by: default avatarTimur Tabi <timur@kernel.org>
Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarLi Yang <leoyang.li@nxp.com>
parent 89ad26f5
...@@ -1392,6 +1392,13 @@ static int ucc_uart_probe(struct platform_device *ofdev) ...@@ -1392,6 +1392,13 @@ static int ucc_uart_probe(struct platform_device *ofdev)
if (val) if (val)
qe_port->port.uartclk = val; qe_port->port.uartclk = val;
else { else {
if (!IS_ENABLED(CONFIG_PPC32)) {
dev_err(&ofdev->dev,
"invalid brg-frequency in device tree\n");
ret = -EINVAL;
goto out_np;
}
/* /*
* Older versions of U-Boot do not initialize the brg-frequency * Older versions of U-Boot do not initialize the brg-frequency
* property, so in this case we assume the BRG frequency is * property, so in this case we assume the BRG frequency is
......
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