X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fmips%2Fvr41xx%2Fcommon%2Finit.c;h=707bd0933eedc2da82dd174bb408818da586aafc;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=ffc8e1c36b674b3e28be8c4bf5317895b19c06e6;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/arch/mips/vr41xx/common/init.c b/arch/mips/vr41xx/common/init.c index ffc8e1c36..707bd0933 100644 --- a/arch/mips/vr41xx/common/init.c +++ b/arch/mips/vr41xx/common/init.c @@ -1,7 +1,7 @@ /* * init.c, Common initialization routines for NEC VR4100 series. * - * Copyright (C) 2003-2004 Yoichi Yuasa + * Copyright (C) 2003-2005 Yoichi Yuasa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,9 +18,53 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include +#include #include #include +#include +#include + +#define IO_MEM_RESOURCE_START 0UL +#define IO_MEM_RESOURCE_END 0x1fffffffUL + +static void __init iomem_resource_init(void) +{ + iomem_resource.start = IO_MEM_RESOURCE_START; + iomem_resource.end = IO_MEM_RESOURCE_END; +} + +static void __init setup_timer_frequency(void) +{ + unsigned long tclock; + + tclock = vr41xx_get_tclock_frequency(); + if (current_cpu_data.processor_id == PRID_VR4131_REV2_0 || + current_cpu_data.processor_id == PRID_VR4131_REV2_1) + mips_hpt_frequency = tclock / 2; + else + mips_hpt_frequency = tclock / 4; +} + +static void __init setup_timer_irq(struct irqaction *irq) +{ + setup_irq(TIMER_IRQ, irq); +} + +static void __init timer_init(void) +{ + board_time_init = setup_timer_frequency; + board_timer_setup = setup_timer_irq; +} + +void __init plat_setup(void) +{ + vr41xx_calculate_clock_frequency(); + + timer_init(); + iomem_resource_init(); +} void __init prom_init(void) {