]> git.proxmox.com Git - mirror_qemu.git/commit
hw/arm/npcm7xx: add board setup stub for CPU and UART clocks
authorHavard Skinnemoen <hskinnemoen@google.com>
Fri, 11 Sep 2020 05:20:59 +0000 (22:20 -0700)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 14 Sep 2020 13:24:59 +0000 (14:24 +0100)
commit2ddae9cc042408f75c5d5fd3bfc3d927707700d2
tree4d4c51d584c5459e388ac0d816d8e8b34029aff4
parent0eb73f23461fb468667b66de61632be1c2462a3a
hw/arm/npcm7xx: add board setup stub for CPU and UART clocks

When booting directly into a kernel, bypassing the boot loader, the CPU and
UART clocks are not set up correctly. This makes the system appear very
slow, and causes the initrd boot test to fail when optimization is off.

The UART clock must run at 24 MHz. The default 25 MHz reference clock
cannot achieve this, so switch to PLL2/2 @ 480 MHz, which works
perfectly with the default /20 divider.

The CPU clock should run at 800 MHz, so switch it to PLL1/2. PLL1 runs
at 800 MHz by default, so we need to double the feedback divider as well
to make it run at 1600 MHz (so PLL1/2 runs at 800 MHz).

We don't bother checking for PLL lock because we know our emulated PLLs
lock instantly.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Havard Skinnemoen <hskinnemoen@google.com>
Message-id: 20200911052101.2602693-13-hskinnemoen@google.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/npcm7xx.c
include/hw/arm/npcm7xx.h