mac_via: extend timer calibration hack to work with A/UX
commitb4d3a83b89fba814613f7ead6b6ea92e0b2c3cd8
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Wed, 4 Oct 2023 08:38:06 +0000 (4 09:38 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Fri, 6 Oct 2023 08:33:43 +0000 (6 10:33 +0200)
tree7dd35771fa3a0e8422a7976f5354c5e8d01331ec
parent9d35c6ade54c05754a1cac99df5c9a8ce6252bbe
mac_via: extend timer calibration hack to work with A/UX

The A/UX timer calibration loop runs continuously until 2 consecutive iterations
differ by at least 0x492 timer ticks. Modern hosts execute the timer calibration
loop so fast that this situation never occurs causing a hang on boot.

Use a similar method to Shoebill which is to randomly add 0x500 to the T2
counter value during calibration to enable it to eventually succeed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-ID: <20231004083806.757242-21-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/misc/mac_via.c