Matthias Weisser | 63c36f5 | 2010-08-09 13:31:49 +0200 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2010 |
| 3 | * Matthias Weisser <weisserm@arcor.de> |
| 4 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Matthias Weisser | 63c36f5 | 2010-08-09 13:31:49 +0200 | [diff] [blame] | 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 | } |