From e56b4b494cd92def577969f9678395aa22d34c9f Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Wed, 9 Jan 2008 14:35:26 -0600 Subject: [PATCH] 85xx,86xx: Determine I2C clock frequencies and store in global_data Update global_data to define i2c1_clk and i2c2_clk to 85xx and 86xx. Update the get_clocks() function in 85xx and 86xx to determine the I2C clock frequency and store it in gd->i2c1_clk and gd->i2c2_clk. Signed-off-by: Timur Tabi --- cpu/mpc85xx/speed.c | 3 +++ cpu/mpc86xx/speed.c | 2 ++ include/asm-ppc/global_data.h | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cpu/mpc85xx/speed.c b/cpu/mpc85xx/speed.c index 27de37afa8..952f30cf39 100644 --- a/cpu/mpc85xx/speed.c +++ b/cpu/mpc85xx/speed.c @@ -75,6 +75,9 @@ int get_clocks (void) get_sys_info (&sys_info); gd->cpu_clk = sys_info.freqProcessor; gd->bus_clk = sys_info.freqSystemBus; + gd->i2c1_clk = sys_info.freqSystemBus; + gd->i2c2_clk = sys_info.freqSystemBus; + #if defined(CONFIG_CPM2) gd->vco_out = 2*sys_info.freqSystemBus; gd->cpm_clk = gd->vco_out / 2; diff --git a/cpu/mpc86xx/speed.c b/cpu/mpc86xx/speed.c index 4f7e8f17dc..7e884f8e01 100644 --- a/cpu/mpc86xx/speed.c +++ b/cpu/mpc86xx/speed.c @@ -105,6 +105,8 @@ int get_clocks(void) get_sys_info(&sys_info); gd->cpu_clk = sys_info.freqProcessor; gd->bus_clk = sys_info.freqSystemBus; + gd->i2c1_clk = sys_info.freqSystemBus; + gd->i2c2_clk = sys_info.freqSystemBus; if (gd->cpu_clk != 0) return 0; diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h index aa6384c152..2319b270bf 100644 --- a/include/asm-ppc/global_data.h +++ b/include/asm-ppc/global_data.h @@ -70,8 +70,6 @@ typedef struct global_data { u32 sdhc_clk; #endif u32 core_clk; - u32 i2c1_clk; - u32 i2c2_clk; u32 enc_clk; u32 lbiu_clk; u32 lclk_clk; @@ -88,6 +86,10 @@ typedef struct global_data { u32 ddr_sec_clk; #endif /* CONFIG_MPC8360 */ #endif +#if defined(CONFIG_MPC83XX) || defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) + u32 i2c1_clk; + u32 i2c2_clk; +#endif #if defined(CONFIG_QE) u32 qe_clk; u32 brg_clk; -- 2.25.1