2 * Copyright (C) ADMtek Incorporated.
3 * Creator : daniell@admtek.com.tw
4 * Copyright 1999, 2000 MIPS Technologies, Inc.
5 * Copyright Jeroen Vreeken (pe1rxq@amsat.org), 2005
8 #include <linux/autoconf.h>
9 #include <linux/init.h>
10 #include <linux/device.h>
11 #include <linux/platform_device.h>
13 #include <asm/reboot.h>
17 #include <adm5120_info.h>
19 #define ADM5120_SOFTRESET 0x12000004
20 #define STATUS_IE 0x00000001
21 #define ALLINTS (IE_IRQ0 | IE_IRQ5 | STATUS_IE)
23 void mips_time_init(void);
25 extern unsigned int mips_counter_frequency
;
27 void adm5120_restart(char *command
)
29 *(u32
*)KSEG1ADDR(ADM5120_SOFTRESET
)=1;
33 void adm5120_halt(void)
35 printk(KERN_NOTICE
"\n** You can safely turn off the power\n");
40 void adm5120_power_off(void)
45 void __init
adm5120_time_init(void)
47 mips_counter_frequency
= adm5120_info
.cpu_speed
>> 1;
50 void __init
plat_timer_setup(struct irqaction
*irq
)
52 /* to generate the first timer interrupt */
53 write_c0_compare(read_c0_count()+ mips_counter_frequency
/HZ
);
54 clear_c0_status(ST0_BEV
);
55 set_c0_status(ALLINTS
);
58 void __init
plat_mem_setup(void)
60 printk(KERN_INFO
"ADM5120 board setup\n");
62 board_time_init
= adm5120_time_init
;
63 //board_timer_setup = mips_timer_setup;
65 _machine_restart
= adm5120_restart
;
66 _machine_halt
= adm5120_halt
;
67 pm_power_off
= adm5120_power_off
;
69 set_io_port_base(KSEG1
);
72 const char *get_system_type(void)
74 return "ADM5120 Board";
77 static struct resource adm5120_hcd_resources
[] = {
81 .flags
= IORESOURCE_MEM
,
86 .flags
= IORESOURCE_IRQ
,
90 static struct platform_device adm5120hcd_device
= {
91 .name
= "adm5120-hcd",
93 .num_resources
= ARRAY_SIZE(adm5120_hcd_resources
),
94 .resource
= adm5120_hcd_resources
,
97 static struct platform_device
*devices
[] __initdata
= {
101 static int __init
adm5120_init(void)
103 return platform_add_devices(devices
, ARRAY_SIZE(devices
));
106 subsys_initcall(adm5120_init
);