board: freescale: t2080rdb: implement get_serial_clock
authorCamelia Groza <camelia.groza@nxp.com>
Tue, 11 Jul 2023 12:49:15 +0000 (15:49 +0300)
committerPeng Fan <peng.fan@nxp.com>
Thu, 13 Jul 2023 08:54:14 +0000 (16:54 +0800)
The serial clock is provided by the get_serial_clock() callback on PPC
under DM_SERIAL. Use the same method to compute the clock as for
non-DM_SERIAL use cases.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
board/freescale/t208xrdb/t208xrdb.c
include/configs/T208xRDB.h

index 13a2d3d..e33e5d0 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/fsl_law.h>
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_liodn.h>
+#include <clock_legacy.h>
 #include <fm_eth.h>
 #include "t208xrdb.h"
 #include "cpld.h"
@@ -42,6 +43,13 @@ u8 get_hw_revision(void)
        }
 }
 
+#if CONFIG_IS_ENABLED(DM_SERIAL)
+int get_serial_clock(void)
+{
+       return get_bus_freq(0) / 2;
+}
+#endif
+
 int checkboard(void)
 {
        struct cpu_type *cpu = gd->arch.cpu;
index f213d2d..0b9dde3 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
- * Copyright 2020-2021 NXP
+ * Copyright 2020-2023 NXP
  */
 
 /*
 /*
  * Serial Port
  */
+#if !CONFIG_IS_ENABLED(DM_SERIAL)
 #define CFG_SYS_NS16550_CLK            (get_bus_freq(0)/2)
+#endif
 #define CFG_SYS_BAUDRATE_TABLE \
        {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
 #define CFG_SYS_NS16550_COM1 (CFG_SYS_CCSRBAR+0x11C500)