* Re: [MIPS] Probe for usability of cp0 compare interrupt.
[not found] <S20022491AbXJQLKE/20071017111004Z+82239@ftp.linux-mips.org>
@ 2007-10-17 16:10 ` Atsushi Nemoto
2007-10-17 16:46 ` Ralf Baechle
0 siblings, 1 reply; 6+ messages in thread
From: Atsushi Nemoto @ 2007-10-17 16:10 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
On Wed, 17 Oct 2007 12:09:59 +0100, linux-mips@linux-mips.org wrote:
> Author: Ralf Baechle <ralf@linux-mips.org> Tue Oct 16 23:20:48 2007 +0100
> Commit: b2c9797919e6997e284e30a1e6e443543eb7a1e1
> Gitweb: http://www.linux-mips.org/g/linux/b2c97979
> Branch: master
>
> Some processors offer the option of using the interrupt on which
> normally the count / compare interrupt would be signaled as a normal
> interupt pin. Previously this required some ugly hackery for each
> system which is much easier done by a quick and simple probe.
It seems write_c0_compare(0) will not work as expected if c0_count was
near 0xffffffff. How about write_c0_compare(read_c0_compare()) (or
c0_timer_ack()) ?
Also something calculated from mips_hpt_frequency would be better than
the magic number 0x300000.
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [MIPS] Probe for usability of cp0 compare interrupt.
2007-10-17 16:10 ` [MIPS] Probe for usability of cp0 compare interrupt Atsushi Nemoto
@ 2007-10-17 16:46 ` Ralf Baechle
2007-10-17 17:03 ` Maciej W. Rozycki
0 siblings, 1 reply; 6+ messages in thread
From: Ralf Baechle @ 2007-10-17 16:46 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: linux-mips
On Thu, Oct 18, 2007 at 01:10:33AM +0900, Atsushi Nemoto wrote:
> > Some processors offer the option of using the interrupt on which
> > normally the count / compare interrupt would be signaled as a normal
> > interupt pin. Previously this required some ugly hackery for each
> > system which is much easier done by a quick and simple probe.
>
> It seems write_c0_compare(0) will not work as expected if c0_count was
> near 0xffffffff. How about write_c0_compare(read_c0_compare()) (or
> c0_timer_ack()) ?
The two things are a know lose end. There is a bug in some old MIPS
processors where reading one of the compare or count registers in exactly
the moment when both have identical values in the interrupt getting lost.
Will have to dig up the details on that one again before I can implement
a proper workaround ...
> Also something calculated from mips_hpt_frequency would be better than
> the magic number 0x300000.
Well, we just don't care how long it really takes - but it has to be
slow enough to work even for stuff like qemu. Then busy wait for a
number of cycles long enough to ensure the timer will have expired to
avoid the interrupt bug.
Ralf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [MIPS] Probe for usability of cp0 compare interrupt.
2007-10-17 16:46 ` Ralf Baechle
@ 2007-10-17 17:03 ` Maciej W. Rozycki
2007-10-17 17:23 ` Ralf Baechle
2007-10-17 18:14 ` Ralf Baechle
0 siblings, 2 replies; 6+ messages in thread
From: Maciej W. Rozycki @ 2007-10-17 17:03 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Atsushi Nemoto, linux-mips
On Wed, 17 Oct 2007, Ralf Baechle wrote:
> The two things are a know lose end. There is a bug in some old MIPS
> processors where reading one of the compare or count registers in exactly
> the moment when both have identical values in the interrupt getting lost.
>
> Will have to dig up the details on that one again before I can implement
> a proper workaround ...
This is the erratum #53 of the R4000PC/SC processor and it triggers if
the Count register is read. Conveniently, in the errata sheet as
distributed, the text is covered by a figure (Figure 1a on page 13), so
you can only reach the page with some PostScript magic. I did it a while
ago and now have a separate document available which provides the text of
page 13 with the figure removed. I can provide it if there is interest.
Maciej
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [MIPS] Probe for usability of cp0 compare interrupt.
2007-10-17 17:03 ` Maciej W. Rozycki
@ 2007-10-17 17:23 ` Ralf Baechle
2007-10-17 17:44 ` Maciej W. Rozycki
2007-10-17 18:14 ` Ralf Baechle
1 sibling, 1 reply; 6+ messages in thread
From: Ralf Baechle @ 2007-10-17 17:23 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: Atsushi Nemoto, linux-mips
On Wed, Oct 17, 2007 at 06:03:35PM +0100, Maciej W. Rozycki wrote:
> > The two things are a know lose end. There is a bug in some old MIPS
> > processors where reading one of the compare or count registers in exactly
> > the moment when both have identical values in the interrupt getting lost.
> >
> > Will have to dig up the details on that one again before I can implement
> > a proper workaround ...
>
> This is the erratum #53 of the R4000PC/SC processor and it triggers if
> the Count register is read. Conveniently, in the errata sheet as
> distributed, the text is covered by a figure (Figure 1a on page 13), so
> you can only reach the page with some PostScript magic. I did it a while
> ago and now have a separate document available which provides the text of
> page 13 with the figure removed. I can provide it if there is interest.
Ah. I noticed there was something like white writing on white background
matching when I searched the PDF for keywords. So I guess it would be
nice if somebody could regenerate a PS or PDF file. I also seem to be
missing information on the later R4400 versions.
Ralf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [MIPS] Probe for usability of cp0 compare interrupt.
2007-10-17 17:03 ` Maciej W. Rozycki
2007-10-17 17:23 ` Ralf Baechle
@ 2007-10-17 18:14 ` Ralf Baechle
1 sibling, 0 replies; 6+ messages in thread
From: Ralf Baechle @ 2007-10-17 18:14 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: Atsushi Nemoto, linux-mips
On Wed, Oct 17, 2007 at 06:03:35PM +0100, Maciej W. Rozycki wrote:
> This is the erratum #53 of the R4000PC/SC processor and it triggers if
> the Count register is read. Conveniently, in the errata sheet as
> distributed, the text is covered by a figure (Figure 1a on page 13), so
> you can only reach the page with some PostScript magic. I did it a while
> ago and now have a separate document available which provides the text of
> page 13 with the figure removed. I can provide it if there is interest.
So it's the same text as for later errata. Pretty much what I've been
expecting.
Ralf
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-10-17 18:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <S20022491AbXJQLKE/20071017111004Z+82239@ftp.linux-mips.org>
2007-10-17 16:10 ` [MIPS] Probe for usability of cp0 compare interrupt Atsushi Nemoto
2007-10-17 16:46 ` Ralf Baechle
2007-10-17 17:03 ` Maciej W. Rozycki
2007-10-17 17:23 ` Ralf Baechle
2007-10-17 17:44 ` Maciej W. Rozycki
2007-10-17 18:14 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox