OSDN Git Service

hw/misc/bcm2835_cprman: implement PLLs behaviour
authorLuc Michel <luc@lmichel.fr>
Sat, 10 Oct 2020 13:57:51 +0000 (15:57 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 27 Oct 2020 11:10:44 +0000 (11:10 +0000)
commit6d2b874cf1a6f595df805835325e9124c26f3dbf
tree9faf20be2ff086dbabf8a3f00bec418cc270dd9b
parent1e986e25d03c0d579843c4d3e2915b2f4ac8e47f
hw/misc/bcm2835_cprman: implement PLLs behaviour

The CPRMAN PLLs generate a clock based on a prescaler, a multiplier and
a divider. The prescaler doubles the parent (xosc) frequency, then the
multiplier/divider are applied. The multiplier has an integer and a
fractional part.

This commit also implements the CPRMAN CM_LOCK register. This register
reports which PLL is currently locked. We consider a PLL has being
locked as soon as it is enabled (on real hardware, there is a delay
after turning a PLL on, for it to stabilize).

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Luc Michel <luc@lmichel.fr>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/misc/bcm2835_cprman.c
include/hw/misc/bcm2835_cprman_internals.h