1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

ramips: implement clock API for RT305X

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25124 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg
2011-01-26 20:48:35 +00:00
parent b2dc6c86ee
commit 86f7e2834f
7 changed files with 148 additions and 41 deletions

View File

@@ -1,7 +1,7 @@
/*
* Ralink RT305x SoC specific setup
*
* Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
*
* Parts of this file are based on Ralink's 2.6.21 BSP
@@ -20,12 +20,6 @@
#include <asm/mach-ralink/rt305x.h>
#include <asm/mach-ralink/rt305x_regs.h>
unsigned long rt305x_cpu_freq;
EXPORT_SYMBOL_GPL(rt305x_cpu_freq);
unsigned long rt305x_sys_freq;
EXPORT_SYMBOL_GPL(rt305x_sys_freq);
void __iomem * rt305x_sysc_base;
void __iomem * rt305x_memc_base;
@@ -49,25 +43,6 @@ void __init rt305x_detect_sys_type(void)
(id & CHIP_ID_REV_MASK));
}
void __init rt305x_detect_sys_freq(void)
{
u32 t;
t = rt305x_sysc_rr(SYSC_REG_SYSTEM_CONFIG);
t = ((t >> SYSTEM_CONFIG_CPUCLK_SHIFT) & SYSTEM_CONFIG_CPUCLK_MASK);
switch (t) {
case SYSTEM_CONFIG_CPUCLK_320:
rt305x_cpu_freq = 320000000;
break;
case SYSTEM_CONFIG_CPUCLK_384:
rt305x_cpu_freq = 384000000;
break;
}
rt305x_sys_freq = rt305x_cpu_freq / 3;
}
static void rt305x_gpio_reserve(int first, int last)
{
for (; first <= last; first++)