diff options
author | RajithaY <rajithax.yerrumsetty@intel.com> | 2017-04-25 03:31:15 -0700 |
---|---|---|
committer | Rajitha Yerrumchetty <rajithax.yerrumsetty@intel.com> | 2017-05-22 06:48:08 +0000 |
commit | bb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch) | |
tree | ca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/openbios/drivers/timer.c | |
parent | a14b48d18a9ed03ec191cf16b162206998a895ce (diff) |
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to
kvmfornfv repo and make use of the updated latest qemu for the
execution of all testcase
Change-Id: I1280af507a857675c7f81d30c95255635667bdd7
Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/openbios/drivers/timer.c')
-rw-r--r-- | qemu/roms/openbios/drivers/timer.c | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/qemu/roms/openbios/drivers/timer.c b/qemu/roms/openbios/drivers/timer.c deleted file mode 100644 index d6794ae9c..000000000 --- a/qemu/roms/openbios/drivers/timer.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * OpenBIOS native timer driver - * - * (C) 2004 Stefan Reinauer <stepan@openbios.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 - * - */ - -#include "config.h" -#include "drivers/drivers.h" -#include "timer.h" -#include "asm/io.h" - -#if defined(CONFIG_X86) || defined(CONFIG_AMD64) - -void setup_timers(void) -{ - /* nothing to do */ -} - -static void load_timer2(unsigned int ticks) -{ - /* Set up the timer gate, turn off the speaker */ - outb((inb(PPC_PORTB) & ~PPCB_SPKR) | PPCB_T2GATE, PPC_PORTB); - outb(TIMER2_SEL | WORD_ACCESS | MODE0 | BINARY_COUNT, - TIMER_MODE_PORT); - outb(ticks & 0xFF, TIMER2_PORT); - outb(ticks >> 8, TIMER2_PORT); -} - -void udelay(unsigned int usecs) -{ - load_timer2((usecs * TICKS_PER_MS) / 1000); - while ((inb(PPC_PORTB) & PPCB_T2OUT) == 0); -} - -unsigned long currticks(void) -{ - static unsigned long totticks = 0UL; /* High resolution */ - unsigned long ticks = 0; - unsigned char portb = inb(PPC_PORTB); - - /* - * Read the timer, and hope it hasn't wrapped around - * (call this again within 54ms), then restart it - */ - outb(TIMER2_SEL | LATCH_COUNT, TIMER_MODE_PORT); - ticks = inb(TIMER2_PORT); - ticks |= inb(TIMER2_PORT) << 8; - outb(TIMER2_SEL | WORD_ACCESS | MODE0 | BINARY_COUNT, - TIMER_MODE_PORT); - outb(0, TIMER2_PORT); - outb(0, TIMER2_PORT); - - /* - * Check if the timer was running. If not, - * result is rubbish and need to start it - */ - if (portb & PPCB_T2GATE) { - totticks += (0x10000 - ticks); - } else { - /* Set up the timer gate, turn off the speaker */ - outb((portb & ~PPCB_SPKR) | PPCB_T2GATE, PPC_PORTB); - } - return totticks / TICKS_PER_MS; -} -#endif - -#ifdef CONFIG_PPC - -void setup_timers(void) -{ - /* nothing to do */ -} - -/* - * TODO: pass via lb table - */ -unsigned long timer_freq = 10000000 / 4; - -void udelay(unsigned int usecs) -{ - unsigned long ticksperusec = timer_freq / 1000000; - _wait_ticks(ticksperusec * usecs); -} - -#endif - -void ndelay(unsigned int nsecs) -{ - udelay((nsecs + 999) / 1000); -} - -void mdelay(unsigned int msecs) -{ - udelay(msecs * 1000); -} |