summaryrefslogtreecommitdiff
path: root/board/freescale/p2041rdb/p2041rdb.c
diff options
context:
space:
mode:
authorShaohui Xie <Shaohui.Xie@freescale.com>2011-09-13 17:55:11 +0800
committerKumar Gala <galak@kernel.crashing.org>2011-10-03 08:30:02 -0500
commit44d50f0b54ef14534440bc5d789ec65240dfc0f8 (patch)
tree3abda67a24ea3aca853e69ef631d6837c6346329 /board/freescale/p2041rdb/p2041rdb.c
parentba50fee6ae7e626bb2eda9d28403d7d3950f407a (diff)
downloadu-boot-imx-44d50f0b54ef14534440bc5d789ec65240dfc0f8.zip
u-boot-imx-44d50f0b54ef14534440bc5d789ec65240dfc0f8.tar.gz
u-boot-imx-44d50f0b54ef14534440bc5d789ec65240dfc0f8.tar.bz2
powerpc/p2041rdb: set sysclk according to status of physical switch SW1
P2041RDB supports 3 sysclk frequencies, it's selected by SW1[6~8], software need to read the SW1 status to decide what the sysclk needs. SW1[8~6] : frequency 0 0 1 : 83.3MHz 0 1 0 : 100MHz others: 66.667MHz Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'board/freescale/p2041rdb/p2041rdb.c')
-rw-r--r--board/freescale/p2041rdb/p2041rdb.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/board/freescale/p2041rdb/p2041rdb.c b/board/freescale/p2041rdb/p2041rdb.c
index 6ed404f..6461bd7 100644
--- a/board/freescale/p2041rdb/p2041rdb.c
+++ b/board/freescale/p2041rdb/p2041rdb.c
@@ -130,6 +130,20 @@ int board_early_init_r(void)
return 0;
}
+unsigned long get_board_sys_clk(unsigned long dummy)
+{
+ u8 sysclk_conf = CPLD_READ(sysclk_sw1);
+
+ switch (sysclk_conf & 0x7) {
+ case CPLD_SYSCLK_83:
+ return 83333333;
+ case CPLD_SYSCLK_100:
+ return 100000000;
+ default:
+ return 66666666;
+ }
+}
+
static const char *serdes_clock_to_string(u32 clock)
{
switch (clock) {