diff mbox series

[PATCHv3,4/6] fpga: of-fpga-region: add authenticate-fpga-config property

Message ID 1611608188-25621-5-git-send-email-richard.gong@linux.intel.com (mailing list archive)
State Superseded, archived
Headers show
Series Extend Intel service layer, FPGA manager and region | expand

Commit Message

Richard Gong Jan. 25, 2021, 8:56 p.m. UTC
From: Richard Gong <richard.gong@intel.com>

Add authenticate-fpga-config property to support FPGA bitstream
authentication, which makes sure a signed bitstream has valid signatures.

Signed-off-by: Richard Gong <richard.gong@intel.com>
---
v3: no change
v2: changed in alphabetical order
---
 drivers/fpga/of-fpga-region.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Moritz Fischer Jan. 26, 2021, 5:10 a.m. UTC | #1
On Mon, Jan 25, 2021 at 02:56:26PM -0600, richard.gong@linux.intel.com wrote:
> From: Richard Gong <richard.gong@intel.com>
> 
> Add authenticate-fpga-config property to support FPGA bitstream
> authentication, which makes sure a signed bitstream has valid signatures.
> 
> Signed-off-by: Richard Gong <richard.gong@intel.com>
> ---
> v3: no change
> v2: changed in alphabetical order
> ---
>  drivers/fpga/of-fpga-region.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
> index e405309..3840883 100644
> --- a/drivers/fpga/of-fpga-region.c
> +++ b/drivers/fpga/of-fpga-region.c
> @@ -219,6 +219,9 @@ static struct fpga_image_info *of_fpga_region_parse_ov(
>  	info->overlay = overlay;
>  
>  	/* Read FPGA region properties from the overlay */
> +	if (of_property_read_bool(overlay, "authenticate-fpga-config"))
> +		info->flags |= FPGA_MGR_BITSTREM_AUTHENTICATION;
> +
Should you check here that no new nodes are being added as you *only*
authenticate?

>  	if (of_property_read_bool(overlay, "partial-fpga-config"))
>  		info->flags |= FPGA_MGR_PARTIAL_RECONFIG;
>  
> -- 
> 2.7.4
> 

Thanks,
Moritz
Richard Gong Jan. 26, 2021, 2:03 p.m. UTC | #2
Hi Moritz,

On 1/25/21 11:10 PM, Moritz Fischer wrote:
> On Mon, Jan 25, 2021 at 02:56:26PM -0600, richard.gong@linux.intel.com wrote:
>> From: Richard Gong <richard.gong@intel.com>
>>
>> Add authenticate-fpga-config property to support FPGA bitstream
>> authentication, which makes sure a signed bitstream has valid signatures.
>>
>> Signed-off-by: Richard Gong <richard.gong@intel.com>
>> ---
>> v3: no change
>> v2: changed in alphabetical order
>> ---
>>   drivers/fpga/of-fpga-region.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
>> index e405309..3840883 100644
>> --- a/drivers/fpga/of-fpga-region.c
>> +++ b/drivers/fpga/of-fpga-region.c
>> @@ -219,6 +219,9 @@ static struct fpga_image_info *of_fpga_region_parse_ov(
>>   	info->overlay = overlay;
>>   
>>   	/* Read FPGA region properties from the overlay */
>> +	if (of_property_read_bool(overlay, "authenticate-fpga-config"))
>> +		info->flags |= FPGA_MGR_BITSTREM_AUTHENTICATION;
>> +
> Should you check here that no new nodes are being added as you *only*
> authenticate?

Sure, I will add additional checks in next submission.

> 
>>   	if (of_property_read_bool(overlay, "partial-fpga-config"))
>>   		info->flags |= FPGA_MGR_PARTIAL_RECONFIG;
>>   
>> -- 
>> 2.7.4
>>
> 
> Thanks,
> Moritz
> 
Regards,
Richard
diff mbox series

Patch

diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
index e405309..3840883 100644
--- a/drivers/fpga/of-fpga-region.c
+++ b/drivers/fpga/of-fpga-region.c
@@ -219,6 +219,9 @@  static struct fpga_image_info *of_fpga_region_parse_ov(
 	info->overlay = overlay;
 
 	/* Read FPGA region properties from the overlay */
+	if (of_property_read_bool(overlay, "authenticate-fpga-config"))
+		info->flags |= FPGA_MGR_BITSTREM_AUTHENTICATION;
+
 	if (of_property_read_bool(overlay, "partial-fpga-config"))
 		info->flags |= FPGA_MGR_PARTIAL_RECONFIG;