On Thu, 27 Jan 2022 17:12:29 +0000 Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 27/01/2022 16:13, BALATON Zoltan wrote:
Looking at ciface_milliseconds I did spot one obvious issue: TIMER_FREQUENCY is hardcoded to 16600000ULL (166MHz) which is correct for g3beige, but not mac99 which uses a 100MHz timebase frequency.
As a quick hack if you alter TIMER_FREQUENCY to 100MHz does that get you close to the required 10s interval on a mac99 machine?
Isn't there an FW_CFG variable for this already that could be used to get the correct freq? (Other than that my idea for a more complete solution for all similar issues was to drop hard coded device-tree hacks from OpenBIOS and replace FW_CFG with generating the device-tree in QEMU and pass that as SLOF does which I've ported to OpenBIOS as an experiment but this was too big a change so I did not carry on with it and it was abandoned. I've done the same for OpenFirmware too but then did not finish that as I've ended up with VOF for pegasos2 which was simpler to do and still has device tree in QEMU so nothing is needed in the firmware. This is just a side note not really related to the milliseconds issue so I digress.)
Yes indeed, that's correct - rather than using the fixed constant, it should be using the timer_freq variable which is populated in arch/ppc/qemu/init.c.
Yes, using the timer_freq variable does the trick. Do you want to create the patch or should I?
Glenn