From patchwork Thu Mar 5 20:37:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1249881 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=lrkFzFZ4; 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 48YMxs15Jzz9s3x for ; Fri, 6 Mar 2020 07:37:33 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 05BDB80396; Thu, 5 Mar 2020 21:37:23 +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="lrkFzFZ4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EE3C680396; Thu, 5 Mar 2020 21:37:20 +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-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (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 24ACB801A6 for ; Thu, 5 Mar 2020 21:37:18 +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-lf1-x142.google.com with SMTP id j11so38864lfg.4 for ; Thu, 05 Mar 2020 12:37:18 -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; bh=104rpwl92nXx5x0eqW/MV0nOSTQqX2wc5zO27OWTvgs=; b=lrkFzFZ41d/+K+yNKH89+IVbQrvayAh3oSKtHbhkIarihINMa4pnfwnvOBGCDGcQXx /evFpjI9nE+Y0xXJLtnv+aSjbtIrmiBp7ZoEjcyK2XAnRWSQErcy0K7ah2zDScEofudb 1+FWmMjRWgCBs2+fJhYdeMQGKm/zDLyvf3tegmG7Js9JwG+JMlLdwMcOQIZ7EsqM8Fnk AGe1RWN7fiXe0xfiMdYKjlmnZlfwhnnwGxdpEPcMP23IDQcfz+wAW1EVp0w56K9gYN6P DYVUVyaIm4zl2RQMnPyeKgDi+BqmcL5FJq0iA42F+YAAf/tRBVqZTWShNYbKm9PA0oRH aHCA== 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; bh=104rpwl92nXx5x0eqW/MV0nOSTQqX2wc5zO27OWTvgs=; b=hcirTThjq0YLyShdx3HwnZJegEiovt4JNe3tQNzCyseYpmKgUoFwiEq7RB9WUYL5d3 QUGD7HdEEICS1CTNOk8bgIlEWnV7OAAtvaN2dMowwPd31QIEs08FUz9X+lMRVW0o+i6D 0obFEz1HoADTX4wLZtN2NmuMbYOa0x57/y8jr6EMJ5imVfj+Mhwy2zE9Bu1NXKJ80Cvf 1AocODX8qwYWlSOKefR2z60AHihCRMZZGRLv1ohaS0eTlqpwmnAiXC3dWatx9wFN4iE7 3wZOs/kpt9btDZL4xTtbwcsolr6LhP0e/2QsEjx4fY4qk4VJ9UHnDp/66J5pEXrmub6q PrOQ== X-Gm-Message-State: ANhLgQ3khJP9ZcNB9VTcCr04SulJbDmhf01iCa+TCuFesZyxqDdgGBQu YfFCWDgNhUH7LFXdoZPST2+SSdILF0w= X-Google-Smtp-Source: ADFU+vsvy5GYy+YfymnanKnwyO9qS4+yOR/ErWj/l8ocMwYoVDBno3KS0g4lUEybiZzUqxIRjQVPug== X-Received: by 2002:a05:6512:1041:: with SMTP id c1mr247596lfb.14.1583440636940; Thu, 05 Mar 2020 12:37:16 -0800 (PST) Received: from localhost (host-176-37-176-139.la.net.ua. [176.37.176.139]) by smtp.gmail.com with ESMTPSA id y6sm967329lfc.24.2020.03.05.12.37.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Mar 2020 12:37:16 -0800 (PST) From: Igor Opaniuk To: u-boot@lists.denx.de Cc: Marcel Ziswiler , Max Krummenacher , Stefano Babic , Oleksandr Suvorov , Philippe Schenker , Igor Opaniuk Subject: [PATCH v1 1/3] verdin-imx8mm: adjust dram size in case bl32 is used Date: Thu, 5 Mar 2020 22:37:10 +0200 Message-Id: <20200305203712.22734-1-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 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/toradex/verdin-imx8mm/verdin-imx8mm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c index 16b9fa1ec1..cb9b4e3b0a 100644 --- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c +++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -13,7 +14,11 @@ DECLARE_GLOBAL_DATA_PTR; int dram_init(void) { - gd->ram_size = get_ram_size((void *)PHYS_SDRAM, 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; }