Re: [Qemu-devel] [PATCH V2] [PowerPC][RFC] booke timers

2011-07-05 Thread Scott Wood
On Tue, 5 Jul 2011 18:41:13 +0200 Fabien Chouteau wrote: > On 05/07/2011 18:02, Scott Wood wrote: > > On Mon, 4 Jul 2011 17:06:54 +0200 > > Fabien Chouteau wrote: > >> Do you mean "lapse = period - ((tb - (1 << target_bit)) & (period - 1));" ? > > > > Yes. > > > > Or more simply: > > > > laps

Re: [Qemu-devel] [PATCH V2] [PowerPC][RFC] booke timers

2011-07-05 Thread Fabien Chouteau
On 05/07/2011 18:02, Scott Wood wrote: > On Mon, 4 Jul 2011 17:06:54 +0200 > Fabien Chouteau wrote: > >> On 01/07/2011 22:22, Scott Wood wrote: >>> On Fri, 1 Jul 2011 16:13:41 +0200 >>> Fabien Chouteau wrote: +static void booke_update_fixed_timer(CPUState *env, +

Re: [Qemu-devel] [PATCH V2] [PowerPC][RFC] booke timers

2011-07-05 Thread Scott Wood
On Mon, 4 Jul 2011 17:06:54 +0200 Fabien Chouteau wrote: > On 01/07/2011 22:22, Scott Wood wrote: > > On Fri, 1 Jul 2011 16:13:41 +0200 > > Fabien Chouteau wrote: > >> +static void booke_update_fixed_timer(CPUState *env, > >> + uint8_t target

Re: [Qemu-devel] [PATCH V2] [PowerPC][RFC] booke timers

2011-07-04 Thread Fabien Chouteau
On 01/07/2011 22:22, Scott Wood wrote: > On Fri, 1 Jul 2011 16:13:41 +0200 > Fabien Chouteau wrote: >> +static void booke_update_fixed_timer(CPUState *env, >> + uint8_t target_bit, >> + uint64_t *nex

Re: [Qemu-devel] [PATCH V2] [PowerPC][RFC] booke timers

2011-07-01 Thread Scott Wood
On Fri, 1 Jul 2011 16:13:41 +0200 Fabien Chouteau wrote: > +uint64_t cpu_ppc_get_tb(ppc_tb_t *tb_env, uint64_t vmclk, int64_t tb_offset) > { > /* TB time in tb periods */ > return muldiv64(vmclk, tb_env->tb_freq, get_ticks_per_sec()) + tb_offset; > @@ -678,18 +661,23 @@ static void __c

[Qemu-devel] [PATCH V2] [PowerPC][RFC] booke timers

2011-07-01 Thread Fabien Chouteau
While working on the emulation of the freescale p2010 (e500v2) I realized that there's no implementation of booke's timers features. Currently mpc8544 uses ppc_emb (ppc_emb_timers_init) which is close but not exactly like booke (for example booke uses different SPR). This is a first attempt for a