qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] PPC440 bus frequencies and timers


From: luigi burdo
Subject: Re: [Qemu-ppc] PPC440 bus frequencies and timers
Date: Thu, 15 Mar 2018 14:46:57 +0000

Hi Zoltan,

here more info about the issues



1. System time is going slower than expected in AROS (can be seen e.g. in 
Time Prefs). The seconds advance but much slower than they should. (AROS 
boot iso can be downloaded from http://aros.sourceforge.net/nightly1.php)


System time is driven by VBlank interrupt which is emulated by decrementer. The decrementer on AROS runs at 50Hz. It calculates CPU usage once every second and in every decremeter interrupt it fires the VBlank "emulation". 

The decrementer handler is in arch/ppc-sam440/kernel/intr.c (lines 300-339). The setup of all bus clocks (decrementer runs at OPB frequency) and decrementer is done in function SetupClocking440() in arch/ppc-sam440/kernel/kernel_startup.c (lines 376-454). Setup for sam460 follows after this function ;)

BTW. it might also be that the clock setup for sam460 is broken on AROS. I dunno, I was only developing/testing Aros for sam440...


In case this is the thread on amigaworld 

Ciao
Luigi


Da: luigi burdo <address@hidden>
Inviato: giovedì 15 marzo 2018 11:24
A: BALATON Zoltan
Cc: address@hidden
Oggetto: Re: [Qemu-ppc] PPC440 bus frequencies and timers
 

Hi Zoltan,

i had been ask in the amigaos scene plus i ask to Max Tretene (Acube uboot dev) some help about the sam infos that you need.

for now they send me this datasheet links hope it can help your project.


http://pccomponents.com/datasheets/IBM-PPC440.PDF
http://datasheet.octopart.com/PPC460EX-NUB800T-AMCC-datasheet-11553412.pdf

https://www.xilinx.com/support/documentation/user_guides/ug200.pdf


Ciao 
Luigi 

Da: BALATON Zoltan <address@hidden>
Inviato: martedì 13 marzo 2018 23:13
A: luigi burdo
Cc: address@hidden
Oggetto: Re: [Qemu-ppc] PPC440 bus frequencies and timers
 
On Tue, 13 Mar 2018, luigi burdo wrote:
> check in the patched uboot if this utility is included. i found this

I could not find this command either in the old u-boot but also not in the
newer 2015.a version so I'm not sure where is it. But u-boot has bdinfo
command which prints some frequencies.

> message in mos forum
>
>
> Edit: Acube has a nice utility to check the reference clock
> (checkbaseclock). It's included with the new version of uboot. I just
> executed this utility again, and indeed it says my sam has a 50 Mhz.
> clock.

I think we emulate a 50MHz clock as we have this line now:

ppc_booke_timers_init(cpu, 50000000, 0);

Which matches CONFIG_SYS_CLK_FREQ in u-boot Sam460ex_config.

The other part of this forum thread
(https://morph.zone/modules/newbb_plus/viewtopic.php?topic_id=11840&forum=11)
morph.zone
Social network for users of the MorphOS operating system


says:

"My sam runs at 1115 Mhz but, showconfig says it runs at 1265 Mhz.
The boot screen also says it runs at 1265 Mhz."

"1265 MHz is indeed wrong and that is what causes your timing/clock
issues. There have been some Sam460 boards which use a different onboard
reference clock, namely 50Mhz instead of 55Mhz. The [MorphOS] 3.9 boot.img
assumes a 55MHz clock which causes the off by factor 1.1 result."

But I don't see a timing problem of 1.1 times off but more like a 20-30
times slowdown with clock multipliers set to values that result in u-boot
printing 1115 MHz clock. Without the multipliers (SDR0_STRP0 set to 0) it
prints 50 MHz system clock in bdinfo command and seconds advance normally
so I think problem may be with some multipliers but I don't know anything
about this hardware and its registers so some help from someone with more
knowledge would be welcome.

AROS also seems to have 55 MHz hardcoded in
arch/ppc-sam440/kernel/kernel_startup.c:SetupClocking460() so maybe these
should be changed in U-Boot and QEMU to match the expectation from at
least two guests but I don't think this alone will resolve the timing
problem with multipliers or 20-30 times slower clock in AROS so maybe
something else is also needed.

I don't have time for this now but anyone is welcome to test and submit
patches that improve this machine model.

Regards,
BALATON Zoltan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]