blob: 1f6f66eba2362773d6463e54d8e66bbd37ddf017 [file] [log] [blame]
Matthias Weisser63c36f52010-08-09 13:31:49 +02001/*
2 * (C) Copyright 2010
3 * Matthias Weisser <weisserm@arcor.de>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Matthias Weisser63c36f52010-08-09 13:31:49 +02006 */
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 */
15ulong 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}