blob: f27155bc2d9ad410a8fc9458bcfae1376ba45cd2 [file] [log] [blame]
Ralf Baechle07119622005-09-03 15:56:11 -07001#include <linux/init.h>
2#include <asm/io.h>
3#include <asm/time.h>
4
Thiemo Seuferc5831222006-05-15 18:59:34 +01005extern void qemu_reboot_setup(void);
6
Ralf Baechle07119622005-09-03 15:56:11 -07007#define QEMU_PORT_BASE 0xb4000000
8
Ralf Baechlefd0197d2005-08-15 11:24:34 +00009const char *get_system_type(void)
10{
11 return "Qemu";
12}
13
Ralf Baechle07119622005-09-03 15:56:11 -070014static void __init qemu_timer_setup(struct irqaction *irq)
15{
16 /* set the clock to 100 Hz */
17 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
18 outb_p(LATCH & 0xff , 0x40); /* LSB */
19 outb(LATCH >> 8 , 0x40); /* MSB */
20 setup_irq(0, irq);
21}
22
23void __init plat_setup(void)
24{
25 set_io_port_base(QEMU_PORT_BASE);
26 board_timer_setup = qemu_timer_setup;
Thiemo Seuferc5831222006-05-15 18:59:34 +010027
28 qemu_reboot_setup();
Ralf Baechle07119622005-09-03 15:56:11 -070029}