qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* hw/misc/mos6522: What is VIA_TIMER_FREQ value?
@ 2023-02-06 16:22 Philippe Mathieu-Daudé
  2023-02-06 16:25 ` Philippe Mathieu-Daudé
  2023-02-06 22:14 ` Mark Cave-Ayland
  0 siblings, 2 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-02-06 16:22 UTC (permalink / raw)
  To: Mark Cave-Ayland, Laurent Vivier; +Cc: QEMU Developers, BALATON Zoltan

Hi Mark & Laurent,

In commit d811d61fbc6 Mark defined VIA_TIMER_FREQ as 4700000 / 6
(783333.33) and in commit 6dca62a0000 Laurent defined it as 783360.

What is the correct value?

Could we define it once in include/hw/misc/mac_via.h or
even include/hw/misc/mos6522.h?

Thanks,

Phil.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: hw/misc/mos6522: What is VIA_TIMER_FREQ value?
  2023-02-06 16:22 hw/misc/mos6522: What is VIA_TIMER_FREQ value? Philippe Mathieu-Daudé
@ 2023-02-06 16:25 ` Philippe Mathieu-Daudé
  2023-02-06 22:14 ` Mark Cave-Ayland
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-02-06 16:25 UTC (permalink / raw)
  To: Mark Cave-Ayland, Laurent Vivier
  Cc: QEMU Developers, BALATON Zoltan, open list:PReP

On 6/2/23 17:22, Philippe Mathieu-Daudé wrote:
> Hi Mark & Laurent,
> 
> In commit d811d61fbc6 Mark defined VIA_TIMER_FREQ as 4700000 / 6
> (783333.33) and in commit 6dca62a0000 Laurent defined it as 783360.

Also 4700000 / 6 in hw/misc/macio/cuda.c (commit 267002cd28).

> What is the correct value?
> 
> Could we define it once in include/hw/misc/mac_via.h or
> even include/hw/misc/mos6522.h?
> 
> Thanks,
> 
> Phil.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: hw/misc/mos6522: What is VIA_TIMER_FREQ value?
  2023-02-06 16:22 hw/misc/mos6522: What is VIA_TIMER_FREQ value? Philippe Mathieu-Daudé
  2023-02-06 16:25 ` Philippe Mathieu-Daudé
@ 2023-02-06 22:14 ` Mark Cave-Ayland
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Cave-Ayland @ 2023-02-06 22:14 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Laurent Vivier
  Cc: QEMU Developers, BALATON Zoltan

On 06/02/2023 16:22, Philippe Mathieu-Daudé wrote:

> Hi Mark & Laurent,
> 
> In commit d811d61fbc6 Mark defined VIA_TIMER_FREQ as 4700000 / 6
> (783333.33) and in commit 6dca62a0000 Laurent defined it as 783360.
> 
> What is the correct value?
> 
> Could we define it once in include/hw/misc/mac_via.h or
> even include/hw/misc/mos6522.h?
> 
> Thanks,
> 
> Phil.

Hi Phil,

The 6522 VIA has a 16-bit counter which is driven by an external clock crystal which 
is set to 783kHz for Macs. Commit 6dca62a0000 is the correct value since that was 
given in the Macintosh hardware documentation, and needs to be accurate since it was 
used for timing in older Macs. The value in commit d811d61fbc6 came from Ben, and it 
may be that this is how it is implemented on real PMU hardware by dividing a 4.7MHz 
clock for compatibility purposes: certainly newer Macs have a much more accurate 
hardware timer that would be used by the OS instead.


ATB,

Mark.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-06 22:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-06 16:22 hw/misc/mos6522: What is VIA_TIMER_FREQ value? Philippe Mathieu-Daudé
2023-02-06 16:25 ` Philippe Mathieu-Daudé
2023-02-06 22:14 ` Mark Cave-Ayland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).