X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/14f5c350584f1b0f282cfe7724965fb44494b3eb..8b2c7d0c931af2ea427f3a22d2b7b373f8d6cd1a:/target/linux/adm5120-2.6/files/arch/mips/adm5120/setup.c?ds=inline diff --git a/target/linux/adm5120-2.6/files/arch/mips/adm5120/setup.c b/target/linux/adm5120-2.6/files/arch/mips/adm5120/setup.c index 23e668411..aa30dc5c8 100644 --- a/target/linux/adm5120-2.6/files/arch/mips/adm5120/setup.c +++ b/target/linux/adm5120-2.6/files/arch/mips/adm5120/setup.c @@ -3,6 +3,7 @@ * Creator : daniell@admtek.com.tw * Copyright 1999, 2000 MIPS Technologies, Inc. * Copyright Jeroen Vreeken (pe1rxq@amsat.org), 2005 + * Copyright (C) 2007 OpenWrt.org */ #include @@ -14,20 +15,13 @@ #include #include -#define ADM5120_SOFTRESET 0x12000004 -#define STATUS_IE 0x00000001 -#define ALLINTS (IE_IRQ0 | IE_IRQ5 | STATUS_IE) - -#define ADM5120_CODEREG 0x12000000 -#define ADM5120_CPU_CLK_MASK 0x00300000 -#define ADM5120_CPU_CLK_175 0x00000000 -#define ADM5120_CPU_CLK_200 0x00100000 -#define ADM5120_CPU_CLK_225 0x00200000 -#define ADM5120_CPU_CLK_250 0x00300000 +#include +#include +#include -void mips_time_init(void); +extern void adm5120_time_init(void) __init; -extern unsigned int mips_counter_frequency; +#define ADM5120_SOFTRESET 0x12000004 void adm5120_restart(char *command) { @@ -47,46 +41,11 @@ void adm5120_power_off(void) adm5120_halt(); } -void __init mips_time_init(void) -{ - u32 clock; - - clock = *(u32*)KSEG1ADDR(ADM5120_CODEREG); - - switch (clock & ADM5120_CPU_CLK_MASK) { - case ADM5120_CPU_CLK_175: - mips_counter_frequency = 87500000; - printk("CPU clock: 175MHz\n"); - break; - case ADM5120_CPU_CLK_200: - mips_counter_frequency = 100000000; - printk("CPU clock: 200MHz\n"); - break; - case ADM5120_CPU_CLK_225: - mips_counter_frequency = 112500000; - printk("CPU clock: 225MHz\n"); - break; - case ADM5120_CPU_CLK_250: - mips_counter_frequency = 125000000; - printk("CPU clock: 250MHz\n"); - break; - } -} - -void __init plat_timer_setup(struct irqaction *irq) -{ - /* to generate the first timer interrupt */ - write_c0_compare(read_c0_count()+ mips_counter_frequency/HZ); - clear_c0_status(ST0_BEV); - set_c0_status(ALLINTS); -} - void __init plat_mem_setup(void) { printk(KERN_INFO "ADM5120 board setup\n"); - board_time_init = mips_time_init; - //board_timer_setup = mips_timer_setup; + board_time_init = adm5120_time_init; _machine_restart = adm5120_restart; _machine_halt = adm5120_halt; @@ -97,18 +56,18 @@ void __init plat_mem_setup(void) const char *get_system_type(void) { - return "ADM5120 Board"; + return adm5120_board_name(); } static struct resource adm5120_hcd_resources[] = { [0] = { - .start = 0x11200000, - .end = 0x11200084, + .start = ADM5120_USBC_BASE, + .end = ADM5120_USBC_BASE+ADM5120_USBC_SIZE-1, .flags = IORESOURCE_MEM, }, [1] = { - .start = 0x3, - .end = 0x3, + .start = ADM5120_IRQ_USBC, + .end = ADM5120_IRQ_USBC, .flags = IORESOURCE_IRQ, }, };