Thread (29 messages) 29 messages, 10 authors, 2018-06-28

[PATCH 0/5] RFC: Mezzanine handling for 96boards

From: Ard Biesheuvel <hidden>
Date: 2018-06-26 08:19:27
Also in: linux-devicetree

On 26 June 2018 at 10:09, Linus Walleij [off-list ref] wrote:
On Mon, Jun 18, 2018 at 3:22 PM Ard Biesheuvel
[off-list ref] wrote:
quoted
We should also consider firmware use of the mezzanines. For instance,
the Secure96 has a RNG which UEFI may want to use so the early boot
code can access is for KASLR. It also has a TPM, which should not be
reset/reinitialized/etc by the OS if we want to make meaningful use of
it.
This problem: sharing or dedicating a piece of hardware to UEFI or
the TrustZone secure world is a generic problem not related to
mezzanines or plug-in boards specifically.

c.f.
arch/arm64/boot/dts/arm/juno-motherboard.dtsi:

flash at 0,00000000 {
        /* 2 * 32MiB NOR Flash memory mounted on CS0 */
        compatible = "arm,vexpress-flash", "cfi-flash";
        linux,part-probe = "afs";
        reg = <0 0x00000000 0x04000000>;
        bank-width = <4>;
        /*
         * Unfortunately, accessing the flash disturbs
         * the CPU idle states (suspend) and CPU
         * hotplug of the platform. For this reason,
         * flash hardware access is disabled by default.
         */
        status = "disabled";
};

What we need for this is something like

status = "secure-world-exclusive";
status = "UEFI-exclusive";

Or something like the same when using device tree.
I agree that this is *also* a problem. But it is not what I was talking about.

My example is about peripherals that firmware and OS should both drive
natively, and in the TPM case, the OS should be mindful of the fact
that the measured state should be preserved. Also, it means that we
may be duplicating functionality between the OS and firmware [as
usual] so it might make sense to come up with something that takes
both use cases into account.
If people probe this from sysfs (as in my example) they are
obviously not novice users and they know what they are
doing. For a simple user experience, I suspect device tree
is what we want to use to populate defaults.
quoted
So ideally, DTs can be expressed such that older kernels can still use
those peripherals.
That kind of expressions are possible already, such as
putting the TPM DT node inside a SoC-specific I2C bus
node. The boot loader can do that for example.

Then they can't also probe the same board from userspace,
obviously. No matter whether they use the idea I present
here or device tree overlays or anything else.
OK.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help