From patchwork Wed Feb 3 15:21:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 1435406 X-Patchwork-Delegate: patrick.delaunay73@gmail.com 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=P8Wzm+kF; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DW54f2n0jz9sWR for ; Thu, 4 Feb 2021 02:21:32 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 275DC82884; Wed, 3 Feb 2021 16:21:20 +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="P8Wzm+kF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ED44482884; Wed, 3 Feb 2021 16:21:17 +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-oo1-xc2f.google.com (mail-oo1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) (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 1EBFB82842 for ; Wed, 3 Feb 2021 16:21:15 +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-oo1-xc2f.google.com with SMTP id n19so6079803ooj.11 for ; Wed, 03 Feb 2021 07:21:15 -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=RN5LowTs7BdAQtuu/MIvcQ35qtTHyEiD2PyFD85mYjM=; b=P8Wzm+kFRFwUiVpXGvCbgsq0vrFYTEKasnLz0fZ3ZTeazld8st+IeuxPsurTJ4tWOR Us5nd1xboRGtFYBFu7cFd5i89/VpotjutfXmmnyy/MYFiR2UQpVyaWO1/a3KEfvFt5// TRR7ZAzUT+FMFNY+GaB6mgI9pFosKGxBhucW0pgkzptegEKnIWQcFuboInFcgBwZ8ymO uSjcEGC7R5IxMh/4QoKBWPlC4cL4RNVSPbQY6GUA0xDAVCajRcRcRfWQwW2NcoXSYHMY Q5qpvt2yU9Qs0RZCgLXsbM0WcSTCL/aZmJ1m5zEJPV4JPiuqIJUjE5V7yn5l2tnmTwtD AkMg== 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=RN5LowTs7BdAQtuu/MIvcQ35qtTHyEiD2PyFD85mYjM=; b=lWtX0NOeSyUE5ZlY0D3n6WSx2Tdyd7FJ/sFvXg1JQI6/cXUmM8GTQjR3HT8XcIE8EP lcyEnrCJ4LNktS9eNrBSIKY5VIU53aoe0uLpGt512EcM3FPJvYkkKkDYYMhxFWP5808W ElJlc+b/2Pvor+HsYW3nmziqS9PcWS/nZpv6DiRWPoUAkMlI9cpZKTomB4nbN1NKHnQr AeF6XVM2DVqI9i21756YHAYY/WPyXYAT7lg9D0b5aolNfFLdlTm+4SNQvR2Da/m1S9VY trWUakC9ceDDN68lmtmVV+IRd00cWj+lwEdxBBKQM5CdRmVw6S76T2IiL7V6XM4lFsqi MSag== X-Gm-Message-State: AOAM530B7U3Pz/s2eVk0e4IPdkZA8BO5KTUBu/s3BVaXdTcLkYJ6odRN o3wyg1Qf2U5cpLOuyYDySJcU0RcAZlc2+g== X-Google-Smtp-Source: ABdhPJxMvF3cox8zWRnYIiERpqrASTUlxZc0D+WdcBdhjrEKpxG0ODJ9e4fWLxGy6GkP9Km8pmwM+A== X-Received: by 2002:a4a:d30d:: with SMTP id g13mr2430959oos.54.1612365673559; Wed, 03 Feb 2021 07:21:13 -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 u126sm498459oig.55.2021.02.03.07.21.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 07:21:13 -0800 (PST) From: Alexandru Gagniuc To: u-boot@lists.denx.de, sjg@chromium.org Cc: Alexandru Gagniuc , trini@konsulko.com, marex@denx.de Subject: [PATCH 1/5] spl: mmc: Support OP-TEE payloads in Falcon mode Date: Wed, 3 Feb 2021 09:21:07 -0600 Message-Id: <20210203152111.1972017-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 In general, Falcon mode means we're booting a linux kernel directly. With FIT images, however, an OP-TEE secure kernel can be booted before linux. Thus, if the next stage is an IH_OS_TEE, this isn't necessarily a problem. Of course, a general solution would involve mmc_load_image_raw_os() only loading the binary, and leaving the decision of suitability to someone else. However, a rework of the boot flow is beyond the scope of this patch. Accept IH_OS_TEE as a valid OS value. Signed-off-by: Alexandru Gagniuc Reviewed-by: Tom Rini --- common/spl/spl_mmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index add2785b4e..bab558d055 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -230,8 +230,10 @@ static int mmc_load_image_raw_os(struct spl_image_info *spl_image, if (ret) return ret; - if (spl_image->os != IH_OS_LINUX) { - puts("Expected Linux image is not found. Trying to start U-boot\n"); + if (spl_image->os != IH_OS_LINUX && spl_image->os != IH_OS_TEE) { + puts("Expected OS image is not found. Instead found "); + puts(genimg_get_os_name(spl_image->os)); + puts(". Trying to start U-boot\n"); return -ENOENT; }