q-setup.c 457 B

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