diff mbox series

[v3,2/3] ARM: dts: Add nvmem node for BCM2711 bootloader public key

Message ID 20230420122924.37997-3-iivanov@suse.de (mailing list archive)
State New, archived
Headers show
Series Add nvmem node for BCM2711 bootloader public key | expand

Commit Message

Ivan T. Ivanov April 20, 2023, 12:29 p.m. UTC
From: Tim Gover <tim.gover@raspberrypi.com>

Make a copy of the bootloader secure-boot public key available to the OS
via an nvmem node. The placement information is populated by the
Raspberry Pi firmware[1] if a public key is present in the BCM2711
bootloader EEPROM.

[1] https://www.raspberrypi.com/documentation/computers/configuration.html#nvmem-nodes

Signed-off-by: Tim Gover <tim.gover@raspberrypi.com>
[iivanov] Added link to documentation.
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
---
 arch/arm/boot/dts/bcm2711-rpi.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Krzysztof Kozlowski April 21, 2023, 7:55 a.m. UTC | #1
On 20/04/2023 14:29, Ivan T. Ivanov wrote:
> From: Tim Gover <tim.gover@raspberrypi.com>
> 
> Make a copy of the bootloader secure-boot public key available to the OS
> via an nvmem node. The placement information is populated by the
> Raspberry Pi firmware[1] if a public key is present in the BCM2711
> bootloader EEPROM.
> 
> [1] https://www.raspberrypi.com/documentation/computers/configuration.html#nvmem-nodes
> 
> Signed-off-by: Tim Gover <tim.gover@raspberrypi.com>
> [iivanov] Added link to documentation.
> Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
> ---
>  arch/arm/boot/dts/bcm2711-rpi.dtsi | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/bcm2711-rpi.dtsi b/arch/arm/boot/dts/bcm2711-rpi.dtsi
> index 98817a6675b9..e30fbe84f9c3 100644
> --- a/arch/arm/boot/dts/bcm2711-rpi.dtsi
> +++ b/arch/arm/boot/dts/bcm2711-rpi.dtsi
> @@ -15,6 +15,7 @@ aliases {
>  		ethernet0 = &genet;
>  		pcie0 = &pcie0;
>  		blconfig = &blconfig;
> +		blpubkey = &blpubkey;
>  	};
>  };
>  
> @@ -67,6 +68,19 @@ blconfig: nvram@0 {
>  		no-map;
>  		status = "disabled";
>  	};
> +
> +	/*
> +	 * RPi4 will copy the binary public key blob (if present) from the bootloader
> +	 * into memory for use by the OS.
> +	 */
> +	blpubkey: nvram@1 {
> +		compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		reg = <0x0 0x0 0x0>;
> +		no-map;
> +		status = "disabled";

Why this is disabled? What external resources are missing?

Best regards,
Krzysztof
Tim Gover April 21, 2023, 7:59 a.m. UTC | #2
On Fri, 21 Apr 2023 at 08:55, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 20/04/2023 14:29, Ivan T. Ivanov wrote:
> > From: Tim Gover <tim.gover@raspberrypi.com>
> >
> > Make a copy of the bootloader secure-boot public key available to the OS
> > via an nvmem node. The placement information is populated by the
> > Raspberry Pi firmware[1] if a public key is present in the BCM2711
> > bootloader EEPROM.
> >
> > [1] https://www.raspberrypi.com/documentation/computers/configuration.html#nvmem-nodes
> >
> > Signed-off-by: Tim Gover <tim.gover@raspberrypi.com>
> > [iivanov] Added link to documentation.
> > Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
> > ---
> >  arch/arm/boot/dts/bcm2711-rpi.dtsi | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/bcm2711-rpi.dtsi b/arch/arm/boot/dts/bcm2711-rpi.dtsi
> > index 98817a6675b9..e30fbe84f9c3 100644
> > --- a/arch/arm/boot/dts/bcm2711-rpi.dtsi
> > +++ b/arch/arm/boot/dts/bcm2711-rpi.dtsi
> > @@ -15,6 +15,7 @@ aliases {
> >               ethernet0 = &genet;
> >               pcie0 = &pcie0;
> >               blconfig = &blconfig;
> > +             blpubkey = &blpubkey;
> >       };
> >  };
> >
> > @@ -67,6 +68,19 @@ blconfig: nvram@0 {
> >               no-map;
> >               status = "disabled";
> >       };
> > +
> > +     /*
> > +      * RPi4 will copy the binary public key blob (if present) from the bootloader
> > +      * into memory for use by the OS.
> > +      */
> > +     blpubkey: nvram@1 {
> > +             compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem";
> > +             #address-cells = <1>;
> > +             #size-cells = <1>;
> > +             reg = <0x0 0x0 0x0>;
> > +             no-map;
> > +             status = "disabled";
>
> Why this is disabled? What external resources are missing?
>
> Best regards,
> Krzysztof

These nodes default to disabled because the firmware will not populate
them if the public-key or configuration file are not present.
e.g. There's no requirement to have a bootloader EEPROM on BCM2711.

Tim
Stefan Wahren April 25, 2023, 4:02 p.m. UTC | #3
Hi Tim,

Am 20.04.23 um 14:29 schrieb Ivan T. Ivanov:
> From: Tim Gover <tim.gover@raspberrypi.com>
> 
> Make a copy of the bootloader secure-boot public key available to the OS
> via an nvmem node. The placement information is populated by the
> Raspberry Pi firmware[1] if a public key is present in the BCM2711
> bootloader EEPROM.
> 
> [1] https://www.raspberrypi.com/documentation/computers/configuration.html#nvmem-nodes
> 
> Signed-off-by: Tim Gover <tim.gover@raspberrypi.com>
> [iivanov] Added link to documentation.
> Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
> ---
>   arch/arm/boot/dts/bcm2711-rpi.dtsi | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/bcm2711-rpi.dtsi b/arch/arm/boot/dts/bcm2711-rpi.dtsi
> index 98817a6675b9..e30fbe84f9c3 100644
> --- a/arch/arm/boot/dts/bcm2711-rpi.dtsi
> +++ b/arch/arm/boot/dts/bcm2711-rpi.dtsi
> @@ -15,6 +15,7 @@ aliases {
>   		ethernet0 = &genet;
>   		pcie0 = &pcie0;
>   		blconfig = &blconfig;
> +		blpubkey = &blpubkey;
>   	};
>   };
>   
> @@ -67,6 +68,19 @@ blconfig: nvram@0 {
>   		no-map;
>   		status = "disabled";
>   	};
> +
> +	/*
> +	 * RPi4 will copy the binary public key blob (if present) from the bootloader
> +	 * into memory for use by the OS.

is the public key also possibly available for CM4 and RPi 400?

> +	 */
> +	blpubkey: nvram@1 {
> +		compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		reg = <0x0 0x0 0x0>;
> +		no-map;
> +		status = "disabled";
> +	};
>   };
>   
>   &v3d {
Tim Gover April 25, 2023, 4:24 p.m. UTC | #4
On Tue, 25 Apr 2023 at 17:02, Stefan Wahren <stefan.wahren@i2se.com> wrote:
>
> Hi Tim,
>
> Am 20.04.23 um 14:29 schrieb Ivan T. Ivanov:
> > From: Tim Gover <tim.gover@raspberrypi.com>
> >
> > Make a copy of the bootloader secure-boot public key available to the OS
> > via an nvmem node. The placement information is populated by the
> > Raspberry Pi firmware[1] if a public key is present in the BCM2711
> > bootloader EEPROM.
> >
> > [1] https://www.raspberrypi.com/documentation/computers/configuration.html#nvmem-nodes
> >
> > Signed-off-by: Tim Gover <tim.gover@raspberrypi.com>
> > [iivanov] Added link to documentation.
> > Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
> > ---
> >   arch/arm/boot/dts/bcm2711-rpi.dtsi | 14 ++++++++++++++
> >   1 file changed, 14 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/bcm2711-rpi.dtsi b/arch/arm/boot/dts/bcm2711-rpi.dtsi
> > index 98817a6675b9..e30fbe84f9c3 100644
> > --- a/arch/arm/boot/dts/bcm2711-rpi.dtsi
> > +++ b/arch/arm/boot/dts/bcm2711-rpi.dtsi
> > @@ -15,6 +15,7 @@ aliases {
> >               ethernet0 = &genet;
> >               pcie0 = &pcie0;
> >               blconfig = &blconfig;
> > +             blpubkey = &blpubkey;
> >       };
> >   };
> >
> > @@ -67,6 +68,19 @@ blconfig: nvram@0 {
> >               no-map;
> >               status = "disabled";
> >       };
> > +
> > +     /*
> > +      * RPi4 will copy the binary public key blob (if present) from the bootloader
> > +      * into memory for use by the OS.
>
> is the public key also possibly available for CM4 and RPi 400?

Yes, the public key is potentially available on CM4 and RPi 400.  If
there is no public-key then the firmware will leave the status field
as "disabled".

>
> > +      */
> > +     blpubkey: nvram@1 {
> > +             compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem";
> > +             #address-cells = <1>;
> > +             #size-cells = <1>;
> > +             reg = <0x0 0x0 0x0>;
> > +             no-map;
> > +             status = "disabled";
> > +     };
> >   };
> >
> >   &v3d {
Ivan T. Ivanov May 18, 2023, 11:56 a.m. UTC | #5
On 04-20 15:29, Ivan T. Ivanov wrote:
> Message-Id: <20230420122924.37997-3-iivanov@suse.de>
> 
> From: Tim Gover <tim.gover@raspberrypi.com>
> 
> Make a copy of the bootloader secure-boot public key available to the OS
> via an nvmem node. The placement information is populated by the
> Raspberry Pi firmware[1] if a public key is present in the BCM2711
> bootloader EEPROM.
> 
> [1] https://www.raspberrypi.com/documentation/computers/configuration.html#nvmem-nodes
> 
> Signed-off-by: Tim Gover <tim.gover@raspberrypi.com>
> [iivanov] Added link to documentation.
> Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>


Hi Rob, Krzysztof,

Do you have any more question on this or it could be merged as is?

Regards,
Ivan


> ---
>  arch/arm/boot/dts/bcm2711-rpi.dtsi | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/bcm2711-rpi.dtsi b/arch/arm/boot/dts/bcm2711-rpi.dtsi
> index 98817a6675b9..e30fbe84f9c3 100644
> --- a/arch/arm/boot/dts/bcm2711-rpi.dtsi
> +++ b/arch/arm/boot/dts/bcm2711-rpi.dtsi
> @@ -15,6 +15,7 @@ aliases {
>  		ethernet0 = &genet;
>  		pcie0 = &pcie0;
>  		blconfig = &blconfig;
> +		blpubkey = &blpubkey;
>  	};
>  };
>  
> @@ -67,6 +68,19 @@ blconfig: nvram@0 {
>  		no-map;
>  		status = "disabled";
>  	};
> +
> +	/*
> +	 * RPi4 will copy the binary public key blob (if present) from the bootloader
> +	 * into memory for use by the OS.
> +	 */
> +	blpubkey: nvram@1 {
> +		compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		reg = <0x0 0x0 0x0>;
> +		no-map;
> +		status = "disabled";
> +	};
>  };
>  
>  &v3d {
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/bcm2711-rpi.dtsi b/arch/arm/boot/dts/bcm2711-rpi.dtsi
index 98817a6675b9..e30fbe84f9c3 100644
--- a/arch/arm/boot/dts/bcm2711-rpi.dtsi
+++ b/arch/arm/boot/dts/bcm2711-rpi.dtsi
@@ -15,6 +15,7 @@  aliases {
 		ethernet0 = &genet;
 		pcie0 = &pcie0;
 		blconfig = &blconfig;
+		blpubkey = &blpubkey;
 	};
 };
 
@@ -67,6 +68,19 @@  blconfig: nvram@0 {
 		no-map;
 		status = "disabled";
 	};
+
+	/*
+	 * RPi4 will copy the binary public key blob (if present) from the bootloader
+	 * into memory for use by the OS.
+	 */
+	blpubkey: nvram@1 {
+		compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0x0 0x0 0x0>;
+		no-map;
+		status = "disabled";
+	};
 };
 
 &v3d {