Commit 935b402e authored by Valentin Longchamp's avatar Valentin Longchamp Committed by York Sun
Browse files

fsl/mpc85xx: define common serdes_clock_to_string function



This allows to share some common code for the boards that use a corenet
base SoC.

Two different versions of the function are available in
fsl_corenet_serdes.c and fsl_corenet2_serdes.c files.
Signed-off-by: default avatarValentin Longchamp <valentin.longchamp@keymile.com>
[York Sun: fix t1040qds.c]
Acked-by: default avatarYork Sun <yorksun@freescale.com>
parent 2f9e559a
......@@ -201,3 +201,24 @@ void fsl_serdes_init(void)
#endif
}
const char *serdes_clock_to_string(u32 clock)
{
switch (clock) {
case SRDS_PLLCR0_RFCK_SEL_100:
return "100";
case SRDS_PLLCR0_RFCK_SEL_125:
return "125";
case SRDS_PLLCR0_RFCK_SEL_156_25:
return "156.25";
case SRDS_PLLCR0_RFCK_SEL_161_13:
return "161.1328123";
default:
#if defined(CONFIG_T4240QDS)
return "???";
#else
return "122.88";
#endif
}
}
......@@ -858,3 +858,20 @@ void fsl_serdes_init(void)
}
#endif
}
const char *serdes_clock_to_string(u32 clock)
{
switch (clock) {
case SRDS_PLLCR0_RFCK_SEL_100:
return "100";
case SRDS_PLLCR0_RFCK_SEL_125:
return "125";
case SRDS_PLLCR0_RFCK_SEL_156_25:
return "156.25";
case SRDS_PLLCR0_RFCK_SEL_161_13:
return "161.1328123";
default:
return "150";
}
}
......@@ -86,6 +86,7 @@ enum srds {
int is_serdes_configured(enum srds_prtcl device);
void fsl_serdes_init(void);
const char *serdes_clock_to_string(u32 clock);
#ifdef CONFIG_FSL_CORENET
#ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2
......
......@@ -457,22 +457,6 @@ static int serdes_refclock(u8 sw, u8 sdclk)
return ret;
}
static const char *serdes_clock_to_string(u32 clock)
{
switch (clock) {
case SRDS_PLLCR0_RFCK_SEL_100:
return "100";
case SRDS_PLLCR0_RFCK_SEL_125:
return "125";
case SRDS_PLLCR0_RFCK_SEL_156_25:
return "156.25";
case SRDS_PLLCR0_RFCK_SEL_161_13:
return "161.13";
default:
return "122.88";
}
}
#define NUM_SRDS_BANKS 2
int misc_init_r(void)
......
......@@ -127,20 +127,6 @@ int board_early_init_r(void)
return 0;
}
static const char *serdes_clock_to_string(u32 clock)
{
switch(clock) {
case SRDS_PLLCR0_RFCK_SEL_100:
return "100";
case SRDS_PLLCR0_RFCK_SEL_125:
return "125";
case SRDS_PLLCR0_RFCK_SEL_156_25:
return "156.25";
default:
return "150";
}
}
#define NUM_SRDS_BANKS 3
int misc_init_r(void)
......
......@@ -155,20 +155,6 @@ unsigned long get_board_sys_clk(unsigned long dummy)
}
}
static const char *serdes_clock_to_string(u32 clock)
{
switch (clock) {
case SRDS_PLLCR0_RFCK_SEL_100:
return "100";
case SRDS_PLLCR0_RFCK_SEL_125:
return "125";
case SRDS_PLLCR0_RFCK_SEL_156_25:
return "156.25";
default:
return "150";
}
}
#define NUM_SRDS_BANKS 2
int misc_init_r(void)
......
......@@ -160,20 +160,6 @@ unsigned long get_board_ddr_clk(void)
return 66666666;
}
static const char *serdes_clock_to_string(u32 clock)
{
switch (clock) {
case SRDS_PLLCR0_RFCK_SEL_100:
return "100";
case SRDS_PLLCR0_RFCK_SEL_125:
return "125";
case SRDS_PLLCR0_RFCK_SEL_156_25:
return "156.25";
default:
return "Unknown frequency";
}
}
#define NUM_SRDS_BANKS 2
int misc_init_r(void)
{
......
......@@ -608,22 +608,6 @@ unsigned long get_board_ddr_clk(void)
return 66666666;
}
static const char *serdes_clock_to_string(u32 clock)
{
switch (clock) {
case SRDS_PLLCR0_RFCK_SEL_100:
return "100";
case SRDS_PLLCR0_RFCK_SEL_125:
return "125";
case SRDS_PLLCR0_RFCK_SEL_156_25:
return "156.25";
case SRDS_PLLCR0_RFCK_SEL_161_13:
return "161.1328125";
default:
return "???";
}
}
int misc_init_r(void)
{
u8 sw;
......
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