From patchwork Wed Sep 5 10:56:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 145985 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4779431ljw; Wed, 5 Sep 2018 03:57:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY25u8N/DMct7XPHpe60eipwkpa2s/Wb4vJLVBAsJo2KEGOt7DHOqX9X+gsqqohwDFxHdJN X-Received: by 2002:aa7:c2cd:: with SMTP id m13-v6mr41662840edp.79.1536145072602; Wed, 05 Sep 2018 03:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536145072; cv=none; d=google.com; s=arc-20160816; b=M2mIIijoVPSepNjLkjU8pE8Ql6s89EZ7raFcR3eryGzKLLUe8ti62Shz/yOldVtnVG IRSAqvgBQLGuXUlfeYbFcTBPneka+OaqXEunaYp9N+STlv27wODq5mljZuqJINll0Z2N 32Kl8dX2QLA6Tn6yFIGcDee1vcpHzjFsaMZ01TxAp2PlGwHFwirnf7k8LqgKJsMldIoc sLCYmYb4fl6h5ZTq+n6XgUIeh3Hkz7LEifODKo/MeqV57wmfVzHJ2fOw4foALQqr6oap V6qHZ54VJmNxjTzKspkhCHVn4l31BD+ZcoLMIFGj6MhiVk0+C3jOmLOFT8sM+7XfWi9H Zhvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature; bh=h8RwTewS8cyknZH0/1ZWUB+OuyjVNN84eaWdPwIgNtI=; b=LdjxJZ8nVuIjGHq/Sl0e19mZRBpaPEVK1aFBCsDlWUB99avvIDg3vwUOGEMd/TFRo0 rdLAqGnO3WUAT2I+ZFifGgk9OEn2KTgCRe9KifDRwiPW6FAQenWwMnpCkD+xCWMOXbWw o4NsAqRj7SKwCdhvjOBrvTIUr8ZRWOt23aoiz+guKF6DD1fP3liFZLYuJP62Rcj4poVU NgSaaEga/duGp2izrDKgnixROyVoCl44CZ/w7l/B4U4nGNLvqBsAQD2zMuzEG9sDBPEk QcNXNvX+B2Wm3B7WTtqduv5PaKomLhI2TuGa3OflRzEy3z2UXUeP2AYFFVbXvlQI49c8 llWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HYTQso2x; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id t26-v6si1021977eda.7.2018.09.05.03.57.52; Wed, 05 Sep 2018 03:57:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HYTQso2x; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 1A685C21DD7; Wed, 5 Sep 2018 10:56:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id CE799C21DF3; Wed, 5 Sep 2018 10:56:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AED7BC21C29; Wed, 5 Sep 2018 10:56:13 +0000 (UTC) Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by lists.denx.de (Postfix) with ESMTPS id 6462DC21BE5 for ; Wed, 5 Sep 2018 10:56:13 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id d8-v6so5736767edv.0 for ; Wed, 05 Sep 2018 03:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Iih8kw504awwFJaAvW5xezZBx9SSWG2n8Hawv4FvErM=; b=HYTQso2xt/UbXxWrTH6b+gTkdT3J4yVcQF1vDrTM0/WM0/nqSzkljyoK52GWBVj2Y0 z2Eja4jpzZgKnljbakwN4gH7MLAxGvn+fKiJnWdrPo1XsaBloefN3Fsr5qrQQFHO10nK 8P+PFHs+iY+V5y6qZbqJ5WFNe5PJkl0nwZ/Y0= 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:in-reply-to :references; bh=Iih8kw504awwFJaAvW5xezZBx9SSWG2n8Hawv4FvErM=; b=oCsX8vOrHyLtskDGgxoHIf0NVk0TOaN7aVX2jUTrSMW7SqP8/TXqT7HZxgn3xmFBle F/tM2PrYO7wrWfPqEGeZCerzwMkps8fV7twPDD5Rj42chRDXXWtYOkNsepgkm+sdblZj xemE5/3UluX2b4VvZmQoEivCOHDy7NxpdHmOfg0WlCaTS6H9eq3Z4NAY/W0rAlAfnVhY FuYwUcKWHGr+nsepmxd68MxMm4e66vp3/obqEXiYg+cZa8awstAhBCdS1WEIhO9VCD/Y e42yZ7y75o1lc8KeoVgC9kKatIvtdWuIeNnTnYLFEyuNIKkINTAUyPAIHCRc2G/WxC5a diAQ== X-Gm-Message-State: APzg51ARxjgWnN9TF2oagqJp1MuFOtTVHneIbtLbaZWRtF0rXkGT08na XNfLM31Jq4Yiwa8j8QNqDJtynqi0+O0= X-Received: by 2002:a50:96c4:: with SMTP id z4-v6mr41734792eda.14.1536144972911; Wed, 05 Sep 2018 03:56:12 -0700 (PDT) Received: from event-horizon.net ([80.111.179.123]) by smtp.gmail.com with ESMTPSA id h34-v6sm1052235eda.58.2018.09.05.03.56.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 03:56:12 -0700 (PDT) From: Bryan O'Donoghue To: u-boot@lists.denx.de, fabio.estevam@nxp.com Date: Wed, 5 Sep 2018 11:56:06 +0100 Message-Id: <20180905105608.453-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180905105608.453-1-bryan.odonoghue@linaro.org> References: <20180905105608.453-1-bryan.odonoghue@linaro.org> Cc: Rui Miguel Silva Subject: [U-Boot] [PATCH 2/4] optee: adjust dependencies and default values for dram X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Rui Miguel Silva We may have, the not yet considered, scenario where OPTEE is loaded before u-boot and *not* by u-boot, e.g, the boot flow using the ARM Trusted Firmware (ATF), where in the 32bit flow is: BootRom->ATF(BL2)->Optee(BL32)->u-boot(BL33) In this case we need still to reserve the memory used by optee, to avoid for example to realocate ourself to the same address at the end of DRAM. So, we change here the dependencies on the OPTEE lib and we set the default size and base of TZRAM to zero. Signed-off-by: Rui Miguel Silva Signed-off-by: Bryan O'Donoghue Cc: Fabio Estevam Cc: Ryan Harkin Cc: u-boot@lists.denx.de --- configs/warp7_defconfig | 2 ++ lib/optee/Kconfig | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index 15a66739f8..a1c0b69ea8 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -46,5 +46,7 @@ CONFIG_USB_ETH_CDC=y CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00" CONFIG_OF_LIBFDT=y CONFIG_OPTEE=y +CONFIG_OPTEE_TZDRAM_SIZE=0x3000000 +CONFIG_OPTEE_TZDRAM_BASE=0x9d000000 CONFIG_OPTEE_LOAD_ADDR=0x84000000 CONFIG_BOOTM_OPTEE=y diff --git a/lib/optee/Kconfig b/lib/optee/Kconfig index 1e5ab45c3d..3773d89c31 100644 --- a/lib/optee/Kconfig +++ b/lib/optee/Kconfig @@ -10,21 +10,20 @@ config OPTEE config OPTEE_LOAD_ADDR hex "OPTEE load address" default 0x00000000 + depends on OPTEE help The load address of the bootable OPTEE binary. config OPTEE_TZDRAM_SIZE hex "Amount of Trust-Zone RAM for the OPTEE image" - depends on OPTEE - default 0x3000000 + default 0x0000000 help The size of pre-allocated Trust Zone DRAM to allocate for the OPTEE runtime. config OPTEE_TZDRAM_BASE hex "Base address of Trust-Zone RAM for the OPTEE image" - depends on OPTEE - default 0x9d000000 + default 0x00000000 help The base address of pre-allocated Trust Zone DRAM for the OPTEE runtime. @@ -32,6 +31,7 @@ config OPTEE_TZDRAM_BASE config BOOTM_OPTEE bool "Support OPTEE bootm command" select BOOTM_LINUX + depends on OPTEE default n help Select this command to enable chain-loading of a Linux kernel