sparc: Serial baud rate register support multiple buses with different frequency
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
diff --git a/arch/sparc/cpu/leon2/serial.c b/arch/sparc/cpu/leon2/serial.c
index 603364e..460abd1 100644
--- a/arch/sparc/cpu/leon2/serial.c
+++ b/arch/sparc/cpu/leon2/serial.c
@@ -120,7 +120,7 @@
if (!gd->baudrate)
gd->baudrate = CONFIG_BAUDRATE;
- scaler = leon2_serial_calc_scaler(CONFIG_SYS_CLK_FREQ, CONFIG_BAUDRATE);
+ scaler = leon2_serial_calc_scaler(CONFIG_SYS_CLK_FREQ, gd->baudrate);
writel(scaler, &uart->UART_Scaler);
}