Refresh patches Signed-off-by: Joshua Covington <joshuacov@gmail.com> Link: https://github.com/openwrt/openwrt/pull/23703 Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
84 lines
2.8 KiB
Diff
84 lines
2.8 KiB
Diff
From 12e9c59f814c233ae735c7fde1bd7dfa82ba7461 Mon Sep 17 00:00:00 2001
|
|
From: Martin Sperl <kernel@martin.sperl.org>
|
|
Date: Fri, 2 Sep 2016 16:45:27 +0100
|
|
Subject: [PATCH] clk: clk-bcm2835: Register the clocks early during the boot
|
|
process
|
|
|
|
so that special/critical clocks can get enabled early on in the
|
|
boot process avoiding the risk of disabling a clock, pll_divider
|
|
or pll when a claiming driver fails to install propperly - maybe it needs to defer.
|
|
|
|
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
|
|
|
|
clk: clk-bcm2835: Use %zd when printing size_t
|
|
|
|
The debug text for how many clocks have been registered
|
|
uses "%d" with a size_t. Correct it to "%zd".
|
|
|
|
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
|
|
|
Initialise rpi-firmware before clk-bcm2835
|
|
|
|
The IMA (Integrity Measurement Architecture) looks for a TPM (Trusted
|
|
Platform Module) having been registered when it initialises; otherwise
|
|
it assumes there is no TPM. It has been observed on BCM2835 that IMA
|
|
is initialised before TPM, and that initialising the BCM2835 clock
|
|
driver before the firmware driver has the effect of reversing this
|
|
order.
|
|
|
|
Change the firmware driver to initialise at core_initcall, delaying the
|
|
BCM2835 clock driver to postcore_initcall.
|
|
|
|
See: https://github.com/raspberrypi/linux/issues/3291
|
|
https://github.com/raspberrypi/linux/pull/3297
|
|
|
|
Signed-off-by: Luke Hinds <lhinds@redhat.com>
|
|
Co-authored-by: Phil Elwell <phil@raspberrypi.org>
|
|
|
|
clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled
|
|
|
|
Co-authored-by: Davide Scovotto <scovottodavide@gmail.com>
|
|
Co-developed-by: Davide Scovotto <scovottodavide@gmail.com>
|
|
Signed-off-by: Davide Scovotto <scovottodavide@gmail.com>
|
|
Signed-off-by: Alberto Solavagione <albertosolavagione30@gmail.com>
|
|
---
|
|
drivers/clk/bcm/clk-bcm2835.c | 19 +++++++++++++++++--
|
|
1 file changed, 17 insertions(+), 2 deletions(-)
|
|
|
|
--- a/drivers/clk/bcm/clk-bcm2835.c
|
|
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
|
@@ -2324,8 +2324,15 @@ static int bcm2835_clk_probe(struct plat
|
|
if (ret)
|
|
return ret;
|
|
|
|
- return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
|
|
+ ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
|
|
&cprman->onecell);
|
|
+ if (ret)
|
|
+ return ret;
|
|
+
|
|
+ /* note that we have registered all the clocks */
|
|
+ dev_dbg(dev, "registered %zd clocks\n", asize);
|
|
+
|
|
+ return 0;
|
|
}
|
|
|
|
static const struct cprman_plat_data cprman_bcm2835_plat_data = {
|
|
@@ -2351,7 +2358,15 @@ static struct platform_driver bcm2835_cl
|
|
.probe = bcm2835_clk_probe,
|
|
};
|
|
|
|
-builtin_platform_driver(bcm2835_clk_driver);
|
|
+static int __init __bcm2835_clk_driver_init(void)
|
|
+{
|
|
+ return platform_driver_register(&bcm2835_clk_driver);
|
|
+}
|
|
+#ifdef CONFIG_IMA
|
|
+subsys_initcall(__bcm2835_clk_driver_init);
|
|
+#else
|
|
+postcore_initcall(__bcm2835_clk_driver_init);
|
|
+#endif
|
|
|
|
MODULE_AUTHOR("Eric Anholt <eric@anholt.net>");
|
|
MODULE_DESCRIPTION("BCM2835 clock driver");
|