From patchwork Thu Mar 5 20:37:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1249882 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=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; dmarc=pass (p=none dis=none) header.from=gmail.com 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=Y1K3+/Ys; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48YMxx0pCfz9s3x for ; Fri, 6 Mar 2020 07:37:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CA31981260; Thu, 5 Mar 2020 21:37:25 +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="Y1K3+/Ys"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 60E57801F1; Thu, 5 Mar 2020 21:37:22 +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,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) (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 97B3C801F1 for ; Thu, 5 Mar 2020 21:37:19 +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=igor.opaniuk@gmail.com Received: by mail-lj1-x241.google.com with SMTP id h18so7593919ljl.13 for ; Thu, 05 Mar 2020 12:37:19 -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:in-reply-to:references; bh=u9e4fjY7NcI4lKSvvRQ5XTQLTb2GGYdSjmD2MXLaJxA=; b=Y1K3+/YsPWV+OAMaQ8GpmECWgzu31xFOwQW9MBd6JDYeVFXNeMLVHN/ddOlIZ+YCWE +lgidtph3fcRN9irGdtoauWlOzKC0UvEigT02Hs5zd0OBhy445LpLm0FLYXebh/fvJCr CJDbb8J/6WUtuS21/8K+/1aZzyiqKfWtdR35tprxabwOXHOhs1n/0qkzAxEjltMIOihT O/ToltTbxz2qzZP8jzRvbW5jM+hTmbOiQSmR+e0eydNR9H9thVgB/KOnSQobCoiKavJQ h/5VNKghRKuvSzf8ai7iKG8cI4iVOlAFuyXLuuwXJNOfFb5RCW+V2psqhzTxoSegAOjz Doqw== 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=u9e4fjY7NcI4lKSvvRQ5XTQLTb2GGYdSjmD2MXLaJxA=; b=uSuWGI56cPdEjcbtAXtZGl9BpwgZRSHLV2hDYJiNnbzgUv9hPnjqqWf78NpwrIfU3L HlcXvhRhhIDGxew4lPjHIgbdinNaU95owpChRnmmA4rM6WhXE3DQtm5WC99+EV7thwAL /JqocklBmrcE1/zZrBlCZ4uK3IjBDgrYWHc+3f0NgSIGuFxP85Q2Eji8ttEQYEy8s8tG Pv2G1g+z57YrGIrLxzaehWfodGifbwNYEtYUsI7fl70ZNiX6hRsZna1AOfJtMIxlcILf 7Y8ERl/JKUQEKEItZ0FsN3f7HJYnQ/czVU7yZ3hK1ikbwezc2QS3GE/v9SLb8L4FbK18 k+mA== X-Gm-Message-State: ANhLgQ2irIJPn3k2NqMDA9ergxrhOhnIuzcc24iD94uB/QCpwr67Fgqg RtMGeUW+GBG4oexedW1mGfPiqrWrNuM= X-Google-Smtp-Source: ADFU+vsyuVjkKDB8b6AWhNqxY3WinqwK1RtfST7gNYA5C5QdQYu1HfuYY0/GPkXKu2cgDmVyNwICdw== X-Received: by 2002:a2e:9a01:: with SMTP id o1mr6416287lji.247.1583440638592; Thu, 05 Mar 2020 12:37:18 -0800 (PST) Received: from localhost (host-176-37-176-139.la.net.ua. [176.37.176.139]) by smtp.gmail.com with ESMTPSA id j24sm1433247lji.76.2020.03.05.12.37.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Mar 2020 12:37:17 -0800 (PST) From: Igor Opaniuk To: u-boot@lists.denx.de Cc: Marcel Ziswiler , Max Krummenacher , Stefano Babic , Oleksandr Suvorov , Philippe Schenker , Igor Opaniuk , Fabio Estevam , "NXP i.MX U-Boot Team" , Peng Fan Subject: [PATCH v1 2/3] imx8mm_evk: adjust dram size in case bl32 is used Date: Thu, 5 Mar 2020 22:37:11 +0200 Message-Id: <20200305203712.22734-2-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200305203712.22734-1-igor.opaniuk@gmail.com> References: <20200305203712.22734-1-igor.opaniuk@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean From: Igor Opaniuk Adjust DRAM size in case BL32 secure payload is loaded (OP-TEE/Trusty), so during MMU initialization U-Boot won't touch this mem area. BL32 is loaded to the end of DRAM, bl32 payload size is read from rom_pointer[1]. This relates to the issue described in 59efa6b52b("imx8m: Fix MMU table issue for OPTEE memory"). Signed-off-by: Igor Opaniuk --- board/freescale/imx8mm_evk/imx8mm_evk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/board/freescale/imx8mm_evk/imx8mm_evk.c b/board/freescale/imx8mm_evk/imx8mm_evk.c index c5fd940eeb..53ebb949df 100644 --- a/board/freescale/imx8mm_evk/imx8mm_evk.c +++ b/board/freescale/imx8mm_evk/imx8mm_evk.c @@ -15,7 +15,11 @@ DECLARE_GLOBAL_DATA_PTR; int dram_init(void) { - gd->ram_size = PHYS_SDRAM_SIZE; + /* rom_pointer[1] contains the size of TEE occupies */ + if (rom_pointer[1]) + gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1]; + else + gd->ram_size = PHYS_SDRAM_SIZE; return 0; }