Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F6AAC433F5 for ; Mon, 4 Oct 2021 20:54:47 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20F5661357 for ; Mon, 4 Oct 2021 20:54:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 20F5661357 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0D58680303; Mon, 4 Oct 2021 22:54:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CNvQux2x"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 57115807DA; Mon, 4 Oct 2021 22:54:40 +0200 (CEST) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3E5528029E for ; Mon, 4 Oct 2021 22:54:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mr.nuke.me@gmail.com Received: by mail-ot1-x330.google.com with SMTP id h9-20020a9d2f09000000b005453f95356cso23279933otb.11 for ; Mon, 04 Oct 2021 13:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=uaXPP4W40r6a6Kz+JB14MTSVs+w5taRImjckiR57kKo=; b=CNvQux2xhz/RWPWZJHbQn7nyXY8APQD5iK8B8018pWjDF2LZTehVw1uLDCRLIv3Vkl U+9+A/OyHB1f656Ce+YRJ2rlVQi1ay0TIbzlgUd8w+t7V+Q3Edf1WNY3ykhYPfXHxTQP yw7Kkr/UPZkPI25TdZASSfcKjgdvfB0/zv3ffc56x4wjiKOg9XJBERMmS8OUud244s8C 2rUai3lKW19IlclU5T2DcSfYO/z2q7cwwSfwY8apzTk8v2g1+RZID6bxEEiTOs2S7LuP onEO0LpsYtxS+wO/Beb98gS6cCURN2QA5+59Lrg1mPNUnAObSLHk8X0OWX3TIA+JpH2X Cqdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uaXPP4W40r6a6Kz+JB14MTSVs+w5taRImjckiR57kKo=; b=Q6ajlHRJc94nhlfzARE7FNQDJd7S/I9BY2yGklHYcYq5G+OYDmgDLzg9naehWA4pZf SRxgcdobfDpkGJYF7iig28tACPhbUpiybyDru2mSL6X28r/JmD9vuw2guJxzEzc57r/P pi4JGRiGgv2RwZjIsJSEuz9FRGMrN7DSDkpWnSWRBUKgmi/eNxJxGRIjHdFKVeDr84wq P96OTAIsFD7Vk+de7T2F+fJ6flMEw7/0JG9bushyIIJwumaYyPaFscaLnpycGr7jZ/bD YIHJxTkFseM4n7wYGCrgYn+xPVGvnRHu49wsZy64ysf1FnfHjnX1ynAeIrOsuPPAPdNZ Y7LQ== X-Gm-Message-State: AOAM530pZXESNN65qmJlyqNIuIRNmmx7To7f0AlD430/6/z5p3YMU8I6 VJsk8zUz93NRZ+7pAwx+hfI= X-Google-Smtp-Source: ABdhPJyK36SqGpK7iRzJZOqmH6XiEv0OJ5MHr76TymB81na/64FHxRj2rDnZnk6i42LGWaesgz1yLw== X-Received: by 2002:a05:6830:2706:: with SMTP id j6mr11377943otu.82.1633380874480; Mon, 04 Oct 2021 13:54:34 -0700 (PDT) Received: from nuclearis3.gtech (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id u2sm3144136otg.51.2021.10.04.13.54.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Oct 2021 13:54:33 -0700 (PDT) Subject: Re: FIT image: load secure FPGA To: "Jorge Ramirez-Ortiz, Foundries" , michal.simek@xilinx.com, trini@konsulko.com, sjg@chromium.org Cc: u-boot@lists.denx.de, ricardo@foundries.io, mike@foundries.io, igor.opaniuk@foundries.io References: <20211004203226.GA4704@trex> From: "Alex G." Message-ID: Date: Mon, 4 Oct 2021 15:54:32 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20211004203226.GA4704@trex> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 10/4/21 3:32 PM, Jorge Ramirez-Ortiz, Foundries wrote: > Hello, > > We are enabling secure boot on Zynqmp with SPL. > > The issue however is that during secure boot, the bootrom not only > validates the first loader (SPL and PMUFW combo) but it will also > expect a signed bitstream during load(FPGA). > > Since currently the SPL load of an FPGA image from FIT does not > support loading images for authentication (fpga_loads), I'd like to > discuss how to best implement such support. What do you mean by "loading images for authentication" ? > > A pretty standard file.its description of the FPGA loadable looks like > this: > > fpga { > description = "FPGA binary"; > data = /incbin/("${DEPLOY_DIR_IMAGE}/${SPL_FPGA_BINARY}"); > type = "fpga"; > arch = "${UBOOT_ARCH}"; > compression = "none"; > load = <${fpgaloadaddr}>; > hash-1 { > algo = "${FIT_HASH_ALG}"; > }; > }; > > We could extend imagetool.h struct image_tool_params to add more > params or perhpas just define different 'types' of fpga? Check "4) '/images' node" in doc/uImage.FIT/source_file_format.txt The intent is to give either: * loadaddr="$(addr)" : copy image to $(addr), Done * compatible="": Use this driver to upload the FPGA It seems to me like the right way to go is to make a new compatible="" FPGA loader is for fpga_load(): fpga { description = "FPGA binary"; data = /incbin/("${YOCTO_BS_PATH}"); type = "fpga"; compression = "none"; compatible = "zynqmp-fancy-fpga", hash-1 { algo = "${FIT_HASHISH}"; }; }; > Something like: > "fpga" > "fpga-auth" : authenticated > "fpga-enc" : encrypted > "fpga-sec" : encrypted and authenticated Can these properties be inferred from the FPGA image? If not, they could be required when using a new fpga loader. I don't think they should be added to "fpga-legacy". Alex > Then it would be a matter of modifying > https://github.com/u-boot/u-boot/blob/master/common/spl/spl_fit.c#L572 > > any thoughts? > > TIA > Jorge >