1 From a4dd91006d4fdbd5c0f32e48eb7babc98ebc37f2 Mon Sep 17 00:00:00 2001
2 From: Luke Hinds <7058938+lukehinds@users.noreply.github.com>
3 Date: Wed, 22 Jan 2020 16:03:00 +0000
4 Subject: [PATCH] Initialise rpi-firmware before clk-bcm2835
6 The IMA (Integrity Measurement Architecture) looks for a TPM (Trusted
7 Platform Module) having been registered when it initialises; otherwise
8 it assumes there is no TPM. It has been observed on BCM2835 that IMA
9 is initialised before TPM, and that initialising the BCM2835 clock
10 driver before the firmware driver has the effect of reversing this
13 Change the firmware driver to initialise at core_initcall, delaying the
14 BCM2835 clock driver to postcore_initcall.
16 See: https://github.com/raspberrypi/linux/issues/3291
17 https://github.com/raspberrypi/linux/pull/3297
19 Signed-off-by: Luke Hinds <lhinds@redhat.com>
20 Co-authored-by: Phil Elwell <phil@raspberrypi.org>
22 drivers/clk/bcm/clk-bcm2835.c | 2 +-
23 drivers/firmware/raspberrypi.c | 2 +-
24 2 files changed, 2 insertions(+), 2 deletions(-)
26 --- a/drivers/clk/bcm/clk-bcm2835.c
27 +++ b/drivers/clk/bcm/clk-bcm2835.c
28 @@ -2424,7 +2424,7 @@ static int __init __bcm2835_clk_driver_i
30 return platform_driver_register(&bcm2835_clk_driver);
32 -core_initcall(__bcm2835_clk_driver_init);
33 +postcore_initcall(__bcm2835_clk_driver_init);
35 MODULE_AUTHOR("Eric Anholt <eric@anholt.net>");
36 MODULE_DESCRIPTION("BCM2835 clock driver");
37 --- a/drivers/firmware/raspberrypi.c
38 +++ b/drivers/firmware/raspberrypi.c
39 @@ -468,7 +468,7 @@ out2:
43 -subsys_initcall(rpi_firmware_init);
44 +core_initcall(rpi_firmware_init);
46 static void __init rpi_firmware_exit(void)