]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/cpu/arm926ejs/mb86r0x/clock.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / arch / arm / cpu / arm926ejs / mb86r0x / clock.c
1 /*
2  * (C) Copyright 2010
3  * Matthias Weisser <weisserm@arcor.de>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <common.h>
9 #include <asm/io.h>
10 #include <asm/arch/hardware.h>
11
12 /*
13  * Get the peripheral bus frequency depending on pll pin settings
14  */
15 ulong get_bus_freq(ulong dummy)
16 {
17         struct mb86r0x_crg * crg = (struct mb86r0x_crg *)
18                                         MB86R0x_CRG_BASE;
19         uint32_t pllmode;
20
21         pllmode = readl(&crg->crpr) & MB86R0x_CRG_CRPR_PLLMODE;
22
23         if (pllmode == MB86R0x_CRG_CRPR_PLLMODE_X20)
24                 return 40000000;
25
26         return 41164767;
27 }