Skip to content

Conversation

@lukehinds
Copy link

This change seeks to correct the load order of a TPM and
IMA (Integrity Measurement Architecture).

Currently IMA loads first, which results in it not seeing the TPM
and using the TPM as a means to store measurements.

The order of core_initcall and subsys_initcall are reversed
within drivers/clk/bcm/clk-bcm2835.c and
drivers/firmware/raspberrypi.c to achieve this.

Resolves: #3291
Signed-off-by: Luke Hinds [email protected]

This change seeks to correct the load order of a TPM and
IMA (Integrity Measurement Architecture).

Currently IMA loads first, which results in it not seeing the TPM
and using the TPM as a means to store measurements.

The order of `core_initcall` and `subsys_initcall` are reversed
within `drivers/clk/bcm/clk-bcm2835.c` and
`drivers/firmware/raspberrypi.c` to achieve this.

Resolves: #3291
Signed-off-by: Luke Hinds <[email protected]>
@pelwell
Copy link
Contributor

pelwell commented Nov 5, 2019

I have two problems with this commit:

  1. The commit message claims it changes the initialisation order of two things, but actually changes the order of two other things. You need to explain how the commit actually does what it claims to.
  2. If your aim is just to get the firmware driver initialised before the clock driver, do you need to delay the clock driver initialisation as far as initcall_subsys? The initcall sequence is:
  • early
  • core
  • postcore
  • arch
  • subsys
  • fs
  • device
  • late

I think it would be safer to delay the clock driver to initcall_postcore, as that is less likely to have unintended consequences.

@JamesH65
Copy link
Contributor

@lukehinds Any comment on the @pelwell comment?

@pelwell
Copy link
Contributor

pelwell commented Jan 6, 2020

I've added a commit that moves the clock driver to postcore_initcall. If there are no objections I'll merge this once the next stable snapshot has been taken.

@pelwell pelwell added Assigned for implementation/action Waiting for internal comment Waiting for comment from a member of the Raspberry Pi engineering team labels Jan 6, 2020
@lukehinds
Copy link
Author

looks good to me.

@pelwell pelwell merged commit 4385796 into raspberrypi:rpi-4.19.y Jan 22, 2020
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jan 22, 2020
kernel: sound: Add the HiFiBerry DAC+HD version
See: raspberrypi/linux#3418

kernel: Fixup rpimem to cleanly unload and reload, and make checkpatch clean
See: raspberrypi/linux#3419

kernel: Amend init order of TPM and IMA modules
See: raspberrypi/linux#3297

kernel: net: usb: lan78xx: Add .ndo_features_check
See: raspberrypi/linux#3395

firmware: platform: Only throttle down from arm_freq

firmware: platform: Bump desired ring osc to 3.7 on Pi3/CM3

firmware: arm_loader: Add 2ms delay before resetting SD_IO
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Jan 22, 2020
kernel: sound: Add the HiFiBerry DAC+HD version
See: raspberrypi/linux#3418

kernel: Fixup rpimem to cleanly unload and reload, and make checkpatch clean
See: raspberrypi/linux#3419

kernel: Amend init order of TPM and IMA modules
See: raspberrypi/linux#3297

kernel: net: usb: lan78xx: Add .ndo_features_check
See: raspberrypi/linux#3395

firmware: platform: Only throttle down from arm_freq

firmware: platform: Bump desired ring osc to 3.7 on Pi3/CM3

firmware: arm_loader: Add 2ms delay before resetting SD_IO
pelwell pushed a commit that referenced this pull request Jan 23, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
pelwell pushed a commit that referenced this pull request Jan 24, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Jan 30, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Jan 30, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Feb 6, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Feb 6, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Feb 20, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Feb 20, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Feb 25, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Feb 25, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
kraj pushed a commit to kraj/linux-raspberrypi that referenced this pull request Feb 25, 2020
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: raspberrypi#3291
     raspberrypi#3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Mar 6, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Mar 10, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Mar 10, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Mar 23, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Mar 23, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Mar 23, 2020
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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Aug 19, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Aug 19, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Aug 19, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Aug 22, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Aug 25, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Aug 26, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Aug 26, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Aug 29, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Sep 3, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Sep 5, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Sep 15, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Sep 15, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Sep 22, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Sep 22, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Sep 25, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Sep 29, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 3, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 6, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 6, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 14, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 14, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 15, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 20, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 20, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 24, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 27, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 27, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 30, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Nov 3, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
popcornmix pushed a commit that referenced this pull request Nov 3, 2025
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 <[email protected]>

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 <[email protected]>

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: #3291
     #3297

Signed-off-by: Luke Hinds <[email protected]>
Co-authored-by: Phil Elwell <[email protected]>

clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <[email protected]>
Co-developed-by: Davide Scovotto <[email protected]>
Signed-off-by: Davide Scovotto <[email protected]>
Signed-off-by: Alberto Solavagione <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Assigned for implementation/action Waiting for internal comment Waiting for comment from a member of the Raspberry Pi engineering team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IMA & TPM load order broken, resulting in no hardware root of trust for Integrity Measurement Architecture

4 participants