From patchwork Mon Oct 11 22:15:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Harvey X-Patchwork-Id: 1539528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gateworks-com.20210112.gappssmtp.com header.i=@gateworks-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=J2Qa1iCs; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HStRb6YL0z9sP7 for ; Tue, 12 Oct 2021 09:16:09 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DE75E82C7D; Tue, 12 Oct 2021 00:15:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.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=gateworks-com.20210112.gappssmtp.com header.i=@gateworks-com.20210112.gappssmtp.com header.b="J2Qa1iCs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 944DD80ECC; Tue, 12 Oct 2021 00:15:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS,SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.2 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (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 F0AA780ECC for ; Tue, 12 Oct 2021 00:15:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tharvey@gateworks.com Received: by mail-pj1-x102e.google.com with SMTP id ls18so14243975pjb.3 for ; Mon, 11 Oct 2021 15:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gateworks-com.20210112.gappssmtp.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=f4s5HCT9t2jEdYSKLQScgAsJ1XPEMxnFqkYKcOIvEQA=; b=J2Qa1iCshW61JCEpSTldq1Z62XtVk9Z4bacDvXIermPtZjOB6VjqAQcszjjF2dYvQG NEVwmmyqj6DLfKKQ1TFx2+Q5ZZEJqNumreuNriSCrAAwr9IJYknw78flTb3uVEAILPya /9l8wMKz8ela7/zVIKG95N9NWGNXEEovB+rNgKtUFjM/h5NjPz0Ik3n+oXMDYhg8upzn u0MXtdMqu9K+mhokmA9wj3ghkCxIpxQe7miGbHI7q18I5IvV5qBb85r+c0rxtvC9Psn2 HD8CwAftw78yNnhwUtZRxsRSOxY2ob7aoWeRu73oGcE4WtqlZcbJuZy7CTSSAeq5PajD qBZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=f4s5HCT9t2jEdYSKLQScgAsJ1XPEMxnFqkYKcOIvEQA=; b=T/CM1RD7uqI8q5I68Laz3/fFLU3YJopmiXMZhWRismj1rXUX0+G7k5sHlxVa5L/98B BNCoA1+VsyQLytJuTdMQDWeESBaR9F7ElZguF5xJaOOMAEtLdUr+ht4/rmBt/ZBCExYY /8D0m42YPCv7sGDaX7xZy4IlsPJhavBK7BWhgOH+6kWT7aJNw4UL+eckv0JMpauOvD7n 8qi4upTOU9lszdMv6SxoY1zIerZ4mef92aYFFaFdJtPGvkAfMDHmsfdBCbHzFoPsUVhc HA03EKmT4cQs+tOCdHZMXH1P1gIMb5Ei0dLXAsJzV6K7RujwOQYVaqOphKkTlM9i+PSa J6xg== X-Gm-Message-State: AOAM5315EKMstn6GYQVpdwO/Y5NUSJlzCby0ulNNDHViecFLuq8y6BnR mLka0cuXhL2yjMEWW9y90Pk3hgc8dvA7vIX7SjoGljz5YBG9rA== X-Google-Smtp-Source: ABdhPJz3VQczvA5fQQhhscqd2Uw9aga5cgvHv+GB2kKuT7lLVic5TuuuI88Kivhdmp0cRiRdBMIpK5lZy7+9Y2aAZzY= X-Received: by 2002:a17:90a:dc81:: with SMTP id j1mr1770132pjv.155.1633990550138; Mon, 11 Oct 2021 15:15:50 -0700 (PDT) MIME-Version: 1.0 From: Tim Harvey Date: Mon, 11 Oct 2021 15:15:39 -0700 Message-ID: Subject: IMX8M OP-TEE To: u-boot , Marcel Ziswiler , Simon Glass , Fabio Estevam 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 Greetings, Is anyone successfully booting U-Boot with OP-TEE support on the IMX8M? My understanding is that you need to add tee.bin to the images in the FIT image and include it in loadables following the ATF. While this was done with arch/arm/mach-imx/mkimage_fit_atf.sh before the switch to binman by simply having tee.bin in the U-Boot directory and passing in TEE_LOAD_ADDR (or accepting the default of 0xfe000000) once you switch to binman it needs to be added for your board. Additionally in order to use OP-TEE from U-Boot (ie for dek_blob command) you need to add a node with compatible=linaro,optee-tz as well. I've done the following to add OP-TEE for imx8mm_venice: However, when I attempt to boot I hang when the ATF is run. Where does the TEE_LOAD_ADDR come from specifically? I would think this needs to be defined when building tee and needs to match the load address used in the FIT image. It appears that perhaps this is supped to be DDR_BASE + DDR_SIZE - 32MIB but I'm not entirely sure. I'm currently using NXP's ATF (imx_5.4.3_2.0.0) and NXP's TEE (imx_5.4.70_2.3.0) and would also like to understand if NXP's branches are strictly required here and if so what the pros and cons of using them are. Anyone using IMX8MM OP-TEE that could point me in the right direction? Best regards, Tim diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig index d85827b588..85d2b20810 100644 -u-boot.dtsi index e0fa9ff4bf..7a71b974e1 100644 --- a/arch/arm/dts/imx8mm-venice-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-venice-u-boot.dtsi @@ -10,6 +10,13 @@ multiple-images; }; + firmware { + optee { + compatible = "linaro,optee-tz"; + method = "smc"; + }; + }; + wdt-reboot { compatible = "wdt-reboot"; wdt = <&wdog1>; @@ -152,6 +159,16 @@ }; }; + tee { + description = "TEE firmware"; + type = "firmware"; + arch = "arm64"; + compression = "none"; + data = "tee.bin"; + load = <0xbe000000>; + entry = <0xbe000000>; + }; + @fdt-SEQ { description = "NAME"; type = "flat_dt"; @@ -165,7 +182,7 @@ @config-SEQ { description = "NAME"; firmware = "uboot"; - loadables = "atf"; + loadables = "atf", "tee"; fdt = "fdt-SEQ"; }; };