]>
git.ipfire.org Git - people/ms/u-boot.git/blob - arch/powerpc/cpu/mpc8xx/speed.c
2 * (C) Copyright 2000-2004
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/processor.h>
12 DECLARE_GLOBAL_DATA_PTR
;
14 void get_brgclk(uint sccr
)
18 switch((sccr
&SCCR_DFBRG11
)>>11){
32 gd
->arch
.brg_clk
= gd
->cpu_clk
/divider
;
36 * get_clocks() fills in gd->cpu_clock depending on CONFIG_8xx_GCLK_FREQ
40 uint immr
= get_immr (0); /* Return full IMMR contents */
41 volatile immap_t
*immap
= (immap_t
*) (immr
& 0xFFFF0000);
42 uint sccr
= immap
->im_clkrst
.car_sccr
;
44 * If for some reason measuring the gclk frequency won't
45 * work, we return the hardwired value.
46 * (For example, the cogent CMA286-60 CPU module has no
47 * separate oscillator for PITRTCLK)
49 gd
->cpu_clk
= CONFIG_8xx_GCLK_FREQ
;
51 if ((sccr
& SCCR_EBDF11
) == 0) {
52 /* No Bus Divider active */
53 gd
->bus_clk
= gd
->cpu_clk
;
55 /* The MPC8xx has only one BDF: half clock speed */
56 gd
->bus_clk
= gd
->cpu_clk
/ 2;