q-setup.c 577 B

1234567891011121314151617181920212223242526272829
  1. #include <linux/init.h>
  2. #include <asm/io.h>
  3. #include <asm/time.h>
  4. extern void qemu_reboot_setup(void);
  5. #define QEMU_PORT_BASE 0xb4000000
  6. const char *get_system_type(void)
  7. {
  8. return "Qemu";
  9. }
  10. static void __init qemu_timer_setup(struct irqaction *irq)
  11. {
  12. /* set the clock to 100 Hz */
  13. outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
  14. outb_p(LATCH & 0xff , 0x40); /* LSB */
  15. outb(LATCH >> 8 , 0x40); /* MSB */
  16. setup_irq(0, irq);
  17. }
  18. void __init plat_mem_setup(void)
  19. {
  20. set_io_port_base(QEMU_PORT_BASE);
  21. board_timer_setup = qemu_timer_setup;
  22. qemu_reboot_setup();
  23. }