From patchwork Wed Jan 20 16:46:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 1429323 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Nc+V1QEO; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DLWds5Zh5z9s24 for ; Thu, 21 Jan 2021 03:47:13 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F055182849; Wed, 20 Jan 2021 17:47:05 +0100 (CET) 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="Nc+V1QEO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B2A8382818; Wed, 20 Jan 2021 17:47:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) (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 819A3827A4 for ; Wed, 20 Jan 2021 17:47:00 +0100 (CET) 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-oi1-x235.google.com with SMTP id f132so25652320oib.12 for ; Wed, 20 Jan 2021 08:47:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EIsH1XZaN4ehM7hf/28BG9wS8CvDVnmRKl4qbh1tM/8=; b=Nc+V1QEONlWwsLpPQ+c1simJRenVIL+Wfn2HiZJflYDO78uN+YXUyhG7Uxz7g590wP i3+CbW99t+OUYycSlGptjMF9QDFLCjBL/Aq8Vu/ryjRNHLlRZmK1rQlbDd/ebGayCMds 6mOmo2NSjq7kI6eOkj3BLqijzw55Tbsg2Tb12cEF+QNcm+Y40gej/8nuXc4a1n26uobM 7IfW34vZaRF/y1L4JjL/zoqssN7Xhnwbj0QQo7rdm7C/ANDpVw+lM6O1Bi+8NG7gVi1t jNJQW8DbBJrE4UzF/2JHIHYztpx4UzJnyucinXuOQsYExSXv2a3FIteXBuQeZZeVpNvQ jTCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EIsH1XZaN4ehM7hf/28BG9wS8CvDVnmRKl4qbh1tM/8=; b=HYXict3MGQMvX1gEJNXRvHcYBNr9bTG+jwRH417wu0uyAhYM3yhZ3R1O5oc7kKZwdv cnhvJcHY+IAfEPTPc5DGsDLh1Mo6qVq7ryPQk65IgWCAVKBcLJVDuY27TAWD99Uhbve7 e3c+wLn/mq5guQx/dcbIVpRnSRQEiJI5uemsQ05ylMnyv+ylHuAPeRotz5JHH+2pTuo2 9qc/gFtAZ9VmU/3Njvc8c6u81OKzNQfN/ZfjMv1/oS88bMFvwoy3KPwsMw821EY/vX1i bug30SOLZ7pWxaLrMz5f9CxaudWZUpZkwnSeWiXmkUlG1LeRHd+ZZQMB7acJWCDSX6cq 5yeQ== X-Gm-Message-State: AOAM532pnFEmh+f4Fv5E0RkP1y8zKybKM6LQJ5ycnGcFpGxsnaMj98vz j3B2Tqm0sgScxy2Txt9JI/K/977bOzY= X-Google-Smtp-Source: ABdhPJxL5uTnWGepIw6/9H+h2KukUG0Uzs/euQ2cBk7ighbF8nAsiICluPU2YozTp1lxnUoIcSAbYA== X-Received: by 2002:a05:6808:d3:: with SMTP id t19mr3417583oic.104.1611161218964; Wed, 20 Jan 2021 08:46:58 -0800 (PST) Received: from nuclearis2-1.lan (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id i9sm462972oii.34.2021.01.20.08.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 08:46:58 -0800 (PST) From: Alexandru Gagniuc To: u-boot@lists.denx.de Cc: Alexandru Gagniuc , trini@konsulko.com, marex@denx.de, sjg@chromium.org Subject: [PATCH v4 0/8] spl: fit: Play nicely with OP-TEE and Linux Date: Wed, 20 Jan 2021 10:46:48 -0600 Message-Id: <20210120164656.1396639-1-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 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.102.3 at phobos.denx.de X-Virus-Status: Clean The purpose of this series is to allow SPL to boot an image with both OP-TEE and Linux. The "simple" fit code was mostly ready for this, albeit quite unreadable. To be able to make these changes reviewable, some major refactoring had to be done. In fact, of the eight changes, (6) are refactoring patches, and (2) are functional changes. I wish I could have written this with a negative line count. I have unfortunately failed at that, and this series will be adding 5 lines to u-boot. The takeaway is that the following type FIT can be loaded from SPL directly: images { optee@1 { type = "tee"; os = "tee"; ... }; kernel@1 { type = "kernel"; os = "linux"; ... }; fdt@devicetree.dtb { ... } fdt@overlay.dto { ... }; }; configurations { conf@quickboot { kernel = "optee@1"; fdt = "fdt@stm32mp157c-ev1.dtb", "fdt@overlay.dto"; loadables = "kernel@1"; }; }; Changes since v2: * Fix copmiler error for IMX spl.c Changes since v2: * Fixed embarrasing rebase mishap on one of the patches. Changes since v1: * Added struct comments (Simon Glass) * Added comment do describe args of board_spl_fit_post_load() (Simon Glass) * Fixed predicate of if clause on spl_load_simple_fit() (me) Alexandru Gagniuc (8): spl: fit: Drop 'length' argument to board_spl_fit_post_load() spl: fit: Factor out FIT parsing and use a context struct spl: fit: Pass FIT context via a structure pointer spl: fit: Remove useless loop in spl_fit_get_image_name() spl: fit: Only look up FIT configuration node once image: Do not #if guard board_fit_image_post_process() prototype spl: fit: Replace #ifdef blocks with more readable constructs spl: fit: Load devicetree when a Linux payload is found arch/arm/mach-imx/spl.c | 7 +- common/spl/spl_fit.c | 261 +++++++++++++++++++++------------------- include/image.h | 7 -- include/spl.h | 4 +- 4 files changed, 142 insertions(+), 137 deletions(-)