register values in sp804 timer

Bug #1480562 reported by T-T Yu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Invalid
Undecided
Unassigned

Bug Description

In the arm_timer.c, when first reading the load register, I got 0.

...
case 0: /* TimerLoad */
...

According to the specification at http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0271d/index.html,
"The minimum valid value for TimerXLoad is 1". Is the initial value supposed to be 0xffffffff?

When the 5th and 7th bit in Control Register are set, RIS and MIS remain 0. But should they be enabled (i.e., 0x1 and 0x1) as both interrupt and timer module are set.

Thanks.

Revision history for this message
Peter Maydell (pmaydell) wrote : Re: [Qemu-devel] [Bug 1480562] [NEW] register values in sp804 timer

On 1 August 2015 at 15:46, T-T Yu <email address hidden> wrote:
> Public bug reported:
>
> In the arm_timer.c, when first reading the load register, I got 0.
>
> ...
> case 0: /* TimerLoad */
> ...
>
> According to the specification at http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0271d/index.html,
> "The minimum valid value for TimerXLoad is 1". Is the initial value
> supposed to be 0xffffffff?

No. See the "summary of registers" table 3.1 in section 3.1,
which lists this register's reset value as zero (and also
section 2.2.6 which agrees that on reset the load register
value is zero).

The text you quote is attempting to describe the minimum
value which it is sensible to write to the register -- it
makes no sense for an OS to write 0 to this register because
it would always just interrupt immediately with no actual
timer function, so the shortest possible timeout is
obtained by writing a 1.

> When the 5th and 7th bit in Control Register are set, RIS and MIS
> remain 0. But should they be enabled (i.e., 0x1 and 0x1) as both
> interrupt and timer module are set.

RIS and MIS will only become 1 when the timer generates an
interrupt. They don't get set merely because the OS has
enabled interrupts.

thanks
-- PMM

Peter Maydell (pmaydell)
Changed in qemu:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.