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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4507BC46467 for ; Sat, 7 Jan 2023 21:58:32 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 65A4B8554F; Sat, 7 Jan 2023 22:58:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="qydw6NZ9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 74B7985565; Sat, 7 Jan 2023 22:58:22 +0100 (CET) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (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 5477785563 for ; Sat, 7 Jan 2023 22:58:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-ej1-x629.google.com with SMTP id u9so11242166ejo.0 for ; Sat, 07 Jan 2023 13:58:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=TSe4HzY2YOG/YWLL3xs56MrIwEBQTxkUmm3xkNGgLf8=; b=qydw6NZ9NqBHRW/G/cJyrblzbvgGE+oZQHao/z+06ayhEzJ+IywEF0xe82413v0LC7 UcKfKjr/OxSZhY50BAgrdNUiERLSLut7vYu2twdxzGDwncjaVTNJCisOz0fDUis9Vlrn rgygIddAgWoFnOOZ8J/iHeJ3o/JTc7KLHUxSsJhf3OHDXxWO3wtUtSPHv2hVK0dFMue9 bKoEXLHmh/F8qiTEVyFbhSwVlzABnBGykTtmOqZ2r0CvBD2UOLSQThu4iqHSYEyFC3iQ HQicJ6oHPoEGIbzZ0KzB7zpk0G2U+L4UfcQ6EQrsG3vlb1EXmr/7vqFXHR+hBvXoIwN4 sEeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TSe4HzY2YOG/YWLL3xs56MrIwEBQTxkUmm3xkNGgLf8=; b=tIYWDnAkDOxUJf+r3LK3TI1D6gmBfooepDp4ARI1c4gheDsJCmqwRYdoSZu4bjOYm7 6uV9yMfZrT8iipdI9Erbcix/5VSk/riYSA5i8lD+tdj3TEggJ4PQ0kZrJbKHMTPtvQJz UvVUkgM7DuagkuwXGQQIqzYetZtSe2P9idJsbmVE0K5UtVgN8gRvL9ivsm0erpdAqauq uM9MIUM0noSNk+w/6SzX6c7Egxx11fL3IBOnR9+cAFX1EiLE6v2ArFaNsiS49xKnHmWO bIvb29c2oR8wNQCBFL+vPoACug2Jtsan1vJczCuhen0Om4j1BY+dKhtUf2Ou4H3B+1+I qCGg== X-Gm-Message-State: AFqh2kosJpZQoT+lOM2KfB8efKGSBtat+SOq6In0QI31CSgb0H/gbAEQ gi7CUzhyrv74gTCedJ4OYn0pOQ== X-Google-Smtp-Source: AMrXdXvyYKBno1igtcm/TtwCyEKxJDysczcJtq4YCCmEFNIuGDUAuRdGZlI2+Phgjv8S/5xOgNmoGg== X-Received: by 2002:a17:906:82d6:b0:84d:397c:8ba with SMTP id a22-20020a17090682d600b0084d397c08bamr1236763ejy.22.1673128694815; Sat, 07 Jan 2023 13:58:14 -0800 (PST) Received: from ?IPV6:2a01:e0a:3cb:7bb0:e4fb:51a5:f121:8512? ([2a01:e0a:3cb:7bb0:e4fb:51a5:f121:8512]) by smtp.gmail.com with ESMTPSA id 18-20020a170906201200b00846734faa9asm1804844ejo.164.2023.01.07.13.58.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Jan 2023 13:58:14 -0800 (PST) Message-ID: Date: Sat, 7 Jan 2023 22:58:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v8 06/13] binman: Support new op-tee binary format Content-Language: en-US To: Simon Glass Cc: U-Boot Mailing List , Tom Rini , huang lin , Jeffy Chen , Kever Yang , Quentin Schulz , Roger Quadros , Philippe Reynes , Alper Nebi Yasak , Peter Geis References: <20221221230726.638740-1-sjg@chromium.org> <20221221230726.638740-7-sjg@chromium.org> <39733f31-347a-53fe-6186-1891354413c6@linaro.org> <040aed51-90e8-8751-6161-056dd391d634@linaro.org> From: Jerome Forissier In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean On 1/7/23 19:55, Simon Glass wrote: > Hi Jerome, > > On Thu, 22 Dec 2022 at 15:20, Jerome Forissier > wrote: >> >> >> >> On 12/22/22 21:23, Simon Glass wrote: >>> (dropping the two bounces from cc) >>> >>> On Thu, 22 Dec 2022 at 13:18, Simon Glass wrote: >>>> >>>> Hi Jerome, >>>> >>>> On Thu, 22 Dec 2022 at 08:36, Jerome Forissier >>>> wrote: >>>>> >>>>> >>>>> >>>>> On 12/22/22 00:07, Simon Glass wrote: >>>>>> OP-TEE has a format with a binary header that can be used instead of the >>>>>> ELF file. With newer versions of OP-TEE this may be required on some >>>>>> platforms. >>>>>> >>>>>> Add support for this in binman. First, add a method to obtain the ELF >>>>>> sections from an entry, then use that in the FIT support. We then end up >>>>>> with the ability to support both types of OP-TEE files, depending on which >>>>>> one is passed in with the entry argument (TEE=xxx in the U-Boot build). >>>>> >>>>> So, with: >>>>> >>>>> BL31=/path/to/bl31.elf TEE=/path/to/tee.bin make -C u-boot \ >>>>> CROSS_COMPILE=aarch64-linux-gnu- CC=aarch64-linux-gnu-gcc \ >>>>> HOSTCC=gcc BINMAN_DEBUG=1 BINMAN_VERBOSE=4 >>>>> >>>>> >>>>> ...I get: >>>>> >>>>> Entry '/binman/simple-bin/fit/images/@tee-SEQ/tee-os' marked absent: uses v1 format which must be in a FIT > > OK, this is expected. It means that the contents are not provided. I > will add some more comments. > > We can refine this later, but we are a year into this conversion of > rk3399 to binman and I really want to land this right away before I > lose interest and it sits here for another year. I commented that in my other reply. That would break my use case. > Do you have an influence on OP-TEE? I am one of the core maintainers ;) > I think the way they are adding a > header here is a really back idea. We should look at packaging these > blobs in a FIT complete with all the metadata that is needed, with a > standard schema. Isn't that what this patch series is trying to accomplish? Using a different tool (binman instead of a custom python script) to package a blob into a FIT? As I said in my other reply, tee.bin is the output of the OP-TEE build, it has to be loaded in memory at a specific address, that you can discover be reading the binary itself -- no need for metadata... How infrequent is such a use case for a bootloader? to deal with? :O Thanks, -- Jerome >>>>> >>>>> >>>>> More complete log at https://pastebin.com/UZzZeicQ >>>> >>>> Thanks. >>>> >>>> Is this file in the v1 binary format (with the custom header), >> >> Yes >> >>>> or is >>>> is a plain binary file? At present only the former is supported, as I >>>> thought that it can only be the elf or the v1 binary format these >>>> days? >> Correct >> >>>> Actually can you please send me the tee.bin ? >> >> Sure, here you go: https://ufile.io/f/ex5oy >> >> I have added bl31.elf too, although I suppose it is handled properly >> being an ELF file. > > It seems to work for me. > > [..] > > Regards, > Simon