From: Camelia Groza Date: Tue, 11 Jul 2023 12:49:20 +0000 (+0300) Subject: board: freescale: t4240rdb: implement get_serial_clock X-Git-Tag: v2025.01-rc5-pxa1908~935^2~13 X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=a325e7e8bd4e1715e2b701ba1fe534840391dfbf;p=u-boot.git board: freescale: t4240rdb: implement get_serial_clock 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 Signed-off-by: Peng Fan --- diff --git a/board/freescale/t4rdb/t4240rdb.c b/board/freescale/t4rdb/t4240rdb.c index 0035bd796e..ab717769ed 100644 --- a/board/freescale/t4rdb/t4240rdb.c +++ b/board/freescale/t4rdb/t4240rdb.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2014 Freescale Semiconductor, Inc. + * Copyright 2023 NXP */ #include @@ -20,6 +21,7 @@ #include #include #include +#include #include #include "t4rdb.h" @@ -28,6 +30,13 @@ DECLARE_GLOBAL_DATA_PTR; +#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; diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h index 506f1b7e26..78e136224e 100644 --- a/include/configs/T4240RDB.h +++ b/include/configs/T4240RDB.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2014 Freescale Semiconductor, Inc. - * Copyright 2020-2021 NXP + * Copyright 2020-2023 NXP */ /* @@ -77,7 +77,9 @@ * open - index 2 * shorted - index 1 */ +#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}