rpi3: Do prescaler and control setup in C
authorAndre Przywara <andre.przywara@arm.com>
Mon, 15 Jul 2019 08:02:15 +0000 (09:02 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Fri, 13 Sep 2019 15:54:21 +0000 (16:54 +0100)
commitdcf6d4f8edfe76b3a01cbb80549499444ff3c7bd
tree9fb4595b7177270317919d1a14da102fdfa527b1
parente6fd00ab0a52fcdb130c343e0748f440200d9ae2
rpi3: Do prescaler and control setup in C

To initialise the arch timer configuration and some clock prescaler, we
need to do two MMIO access *once*, early during boot.

As tempting as it may sound, plat_reset_handler() is not the right place
to do this, as it will be called on every CPU coming up, both for
secondary cores as well as during warmboots. So this access will be done
multiple times, and even during a rich OS' runtime. Whether doing so anyway
is actually harmful is hard to say, but we should definitely avoid this if
possible.

Move the initialisation of these registers to C code in
bl1_early_platform_setup(), where it will still be executed early enough
(before enabling the console), but only once during the whole boot
process.

Change-Id: I081c41a5476d424411411488ff8f633e87d3bcc5
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
plat/rpi/rpi3/aarch64/plat_helpers.S
plat/rpi/rpi3/rpi3_bl1_setup.c