From patchwork Mon Sep 2 21:21:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Salveti X-Patchwork-Id: 1156733 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=foundries-io.20150623.gappssmtp.com header.i=@foundries-io.20150623.gappssmtp.com header.b="L0tU7lGo"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46MlJ95lbQz9sP3 for ; Tue, 3 Sep 2019 08:34:33 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EE030C21C50; Mon, 2 Sep 2019 22:33:50 +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_H3, RCVD_IN_MSPIKE_WL, 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 65BA9C21DB6; Mon, 2 Sep 2019 22:33:31 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 29BFAC21C50; Mon, 2 Sep 2019 21:21:43 +0000 (UTC) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) by lists.denx.de (Postfix) with ESMTPS id 19664C21BE5 for ; Mon, 2 Sep 2019 21:21:41 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id b2so13531316qtq.5 for ; Mon, 02 Sep 2019 14:21:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=p4nz4dJHA0j6RFHvSPH0b6wtLhG4PssVQFpUwjnaq3o=; b=L0tU7lGolsjvNc5Z0SFZRpHjMyw35aLXz4aIi+YCFGhkGA12ThrAZgvvMQDtrk8ox3 S/mXjQIx6qwunXXvxKoA1JTHRlPvhLBbIthq756gQZUwycJBtpRl+yr3iA3E1ufcR3b3 vhKguaB/G1TiBX65rmXfDKLkuEO1KJIfM0jd8h/fG6k/UCVUxuKIIYo0CjUMe2GGj06q Y5RjFF/EOlFz/h7KpX5uurEjEXk20v390aNIy9v3dmWsiEGF/XZesND3vILj/UPlxTpC ua1XaG+iTMjp3Pk0cxYs7bKnfNhYGTlfPMEYs+DzP01XiKGCcgyyHhOwPO6MpCv5qlhJ Tudg== 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=p4nz4dJHA0j6RFHvSPH0b6wtLhG4PssVQFpUwjnaq3o=; b=Xqa6vme726PLki1ZW4N3vJUavOFJ2pdiKu/KE/f8nDrd0/gl+82MXyTkrSXIlodIdI 8289NYNQI4FEPrSv19l21EZGO2T+WqboNqgQdyPc2plpyDuVqaMpCUSUPwKBpQ8YU65I eH9q2ybQe5vAKEA72rkYeHeQ4I8I3CCxpt32ccir4jn26JFtOBQhzeMNXruG9WYOixHo rw+TyqLUUSw/mlQmlX6VjMXva+ZlNrnIM0uUNRUjX4CNbfCrYLtUFB3iPvoIGuOzRUo+ t4RRzTSYQLHAdyYx5vjjV5JdxC0ZC29ybPRTzkZWvEV0p4owq4jTMPQyevCyx1fuXHOt H8YQ== X-Gm-Message-State: APjAAAVGxvUQ6cU0lESNBpzUPtTyGrRuW0yxaVbgasklZrDy/Vd70os/ U3krEEDdAO8/kLF5rMpghGa3vw8Fcg== X-Google-Smtp-Source: APXvYqzCzghpmM4c9gWFYl7w1E8VAfzaCwRbWbQ4mvwNyr44faMKg30gnjkUfte/pQ9baHNud/n/og== X-Received: by 2002:ac8:3a84:: with SMTP id x4mr7413414qte.334.1567459299790; Mon, 02 Sep 2019 14:21:39 -0700 (PDT) Received: from localhost.localdomain ([2804:14d:badc:8822:d03d:f48e:97da:9d51]) by smtp.gmail.com with ESMTPSA id d45sm4430582qtc.70.2019.09.02.14.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 14:21:39 -0700 (PDT) From: Ricardo Salveti To: u-boot@lists.denx.de Date: Mon, 2 Sep 2019 18:21:35 -0300 Message-Id: <20190902212135.8031-1-ricardo@foundries.io> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 02 Sep 2019 22:33:28 +0000 Cc: stefan.agner@toradex.com, max.krummenacher@toradex.com, uboot-imx@nxp.com Subject: [U-Boot] [PATCH] apalis_imx6: allocate specific region of memory to OP-TEE 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" OP-TEE uses the memory region defined by the maximum DRAM address minus CONFIG_OPTEE_TZDRAM_SIZE, so subtract CONFIG_OPTEE_TZDRAM_SIZE from the available DRAM size to avoid conflicts. Signed-off-by: Ricardo Salveti Acked-by: Max Krummenacher --- board/toradex/apalis_imx6/apalis_imx6.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index 6421a22c25..fa7fcc8d46 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -75,6 +75,11 @@ int dram_init(void) gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE, (ulong)imx_ddr_size()); + /* Subtract the defined OPTEE runtime firmware length */ +#ifdef CONFIG_OPTEE_TZDRAM_SIZE + gd->ram_size -= CONFIG_OPTEE_TZDRAM_SIZE; +#endif + return 0; }