board: freescale: t104xrdb: 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 <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Camelia Groza 2023-07-11 15:49:25 +03:00 committed by Peng Fan
parent 4e69a447fa
commit 3a359c5000
2 changed files with 12 additions and 1 deletions

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+ // SPDX-License-Identifier: GPL-2.0+
/* /*
* Copyright 2013 Freescale Semiconductor, Inc. * Copyright 2013 Freescale Semiconductor, Inc.
* Copyright 2023 NXP
*/ */
#include <common.h> #include <common.h>
@ -22,6 +23,7 @@
#include <asm/fsl_law.h> #include <asm/fsl_law.h>
#include <asm/fsl_serdes.h> #include <asm/fsl_serdes.h>
#include <asm/fsl_liodn.h> #include <asm/fsl_liodn.h>
#include <clock_legacy.h>
#include <fm_eth.h> #include <fm_eth.h>
#include "../common/sleep.h" #include "../common/sleep.h"
#include "t104xrdb.h" #include "t104xrdb.h"
@ -29,6 +31,13 @@
DECLARE_GLOBAL_DATA_PTR; 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) int checkboard(void)
{ {
struct cpu_type *cpu = gd->arch.cpu; struct cpu_type *cpu = gd->arch.cpu;

View file

@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0+ */ /* SPDX-License-Identifier: GPL-2.0+ */
/* /*
* Copyright 2014 Freescale Semiconductor, Inc. * Copyright 2014 Freescale Semiconductor, Inc.
* Copyright 2020-2021 NXP * Copyright 2020-2023 NXP
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -238,7 +238,9 @@
* open - index 2 * open - index 2
* shorted - index 1 * shorted - index 1
*/ */
#if !CONFIG_IS_ENABLED(DM_SERIAL)
#define CFG_SYS_NS16550_CLK (get_bus_freq(0)/2) #define CFG_SYS_NS16550_CLK (get_bus_freq(0)/2)
#endif
#define CFG_SYS_BAUDRATE_TABLE \ #define CFG_SYS_BAUDRATE_TABLE \
{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200} {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}