bcm27xx-gpu-fw: update to latest version
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0398-Initialise-rpi-firmware-before-clk-bcm2835.patch
1 From 2c1a5dae2fb127729773685e3cd1e48934edf1f2 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
5
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
11 order.
12
13 Change the firmware driver to initialise at core_initcall, delaying the
14 BCM2835 clock driver to postcore_initcall.
15
16 See: https://github.com/raspberrypi/linux/issues/3291
17 https://github.com/raspberrypi/linux/pull/3297
18
19 Signed-off-by: Luke Hinds <lhinds@redhat.com>
20 Co-authored-by: Phil Elwell <phil@raspberrypi.org>
21 ---
22 drivers/clk/bcm/clk-bcm2835.c | 2 +-
23 drivers/firmware/raspberrypi.c | 2 +-
24 2 files changed, 2 insertions(+), 2 deletions(-)
25
26 --- a/drivers/clk/bcm/clk-bcm2835.c
27 +++ b/drivers/clk/bcm/clk-bcm2835.c
28 @@ -2382,7 +2382,7 @@ static int __init __bcm2835_clk_driver_i
29 {
30 return platform_driver_register(&bcm2835_clk_driver);
31 }
32 -core_initcall(__bcm2835_clk_driver_init);
33 +postcore_initcall(__bcm2835_clk_driver_init);
34
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 @@ -416,7 +416,7 @@ out2:
40 out1:
41 return ret;
42 }
43 -subsys_initcall(rpi_firmware_init);
44 +core_initcall(rpi_firmware_init);
45
46 static void __init rpi_firmware_exit(void)
47 {