q-setup.c 512 B

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