/*1* Copyright (C) 2004 Florian Schirmer <[email protected]>2*3* This program is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License as published by the5* Free Software Foundation; either version 2 of the License, or (at your6* option) any later version.7*8* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED9* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF10* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN11* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,12* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT13* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF14* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON15* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT16* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF17* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.18*19* You should have received a copy of the GNU General Public License along20* with this program; if not, write to the Free Software Foundation, Inc.,21* 675 Mass Ave, Cambridge, MA 02139, USA.22*/232425#include <linux/init.h>26#include <linux/ssb/ssb.h>27#include <asm/time.h>28#include <bcm47xx.h>2930void __init plat_time_init(void)31{32unsigned long hz;3334/*35* Use deterministic values for initial counter interrupt36* so that calibrate delay avoids encountering a counter wrap.37*/38write_c0_count(0);39write_c0_compare(0xffff);4041hz = ssb_cpu_clock(&ssb_bcm47xx.mipscore) / 2;42if (!hz)43hz = 100000000;4445/* Set MIPS counter frequency for fixed_rate_gettimeoffset() */46mips_hpt_frequency = hz;47}484950