mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
aspeed/scu: Introduce a aspeed_scu_get_apb_freq() routine
The APB frequency can be calculated directly when needed from the HPLL_PARAM and CLK_SEL register values. This removes useless state in the model. Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-id: 20190904070506.1052-11-clg@kaod.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
9a937f6cc4
commit
a8f07376c9
3 changed files with 14 additions and 22 deletions
|
@ -93,7 +93,8 @@ static inline uint32_t calculate_rate(struct AspeedTimer *t)
|
|||
{
|
||||
AspeedTimerCtrlState *s = timer_to_ctrl(t);
|
||||
|
||||
return timer_external_clock(t) ? TIMER_CLOCK_EXT_HZ : s->scu->apb_freq;
|
||||
return timer_external_clock(t) ? TIMER_CLOCK_EXT_HZ :
|
||||
aspeed_scu_get_apb_freq(s->scu);
|
||||
}
|
||||
|
||||
static inline uint32_t calculate_ticks(struct AspeedTimer *t, uint64_t now_ns)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue