Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFE19C5479D for ; Fri, 6 Jan 2023 09:13:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 03B21855FA; Fri, 6 Jan 2023 10:13:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.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=foss.st.com header.i=@foss.st.com header.b="iJCQCwFM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3197C855FA; Fri, 6 Jan 2023 10:13:47 +0100 (CET) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DFBDC853EB for ; Fri, 6 Jan 2023 10:13:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=9370c8b137=patrick.delaunay@foss.st.com Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30680I3P013565; Fri, 6 Jan 2023 10:13:36 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=s1cvf+psrKyMr35OM8GWu3P3pZVTBrTSv1GrZWW+vro=; b=iJCQCwFM0n4sKsK2Ybtvd9pgyYym5L6+t2+5+9sYeqXcoosISBiNkJX/7dESWE3Xhpn5 Ur3OY6Gwd6bVZ17RYyFUknCISMtMZla1XHeuM21YYpu1WOm8ioeBXb2mOZyUjMetzLTb lD9UD/xNVb4P4sB7jGzBbuhLpDSvwneEJStaFhnj5aP7+q8nW2C10WxkuD5OAs5+5ftP D4BX3rr7m2i+d5CT6CwIwKdFJRpXvKfVb1xmYK3JJhAupFsG1D7Zqn8oeq90+aa2uAAC B1TB92Ykp5l0U9m00Vz30A+JK2RzHGe+3dGY93pWXN+p8zoQYr2VSPgcLpdY+PfnasBP JA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3mtbcqeca1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Jan 2023 10:13:36 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8EFFF10002A; Fri, 6 Jan 2023 10:13:35 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 87F6D2171F8; Fri, 6 Jan 2023 10:13:35 +0100 (CET) Received: from [10.48.0.157] (10.48.0.157) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.13; Fri, 6 Jan 2023 10:13:34 +0100 Message-ID: <8bb39f70-b36d-bfb7-d962-aab91a1065f5@foss.st.com> Date: Fri, 6 Jan 2023 10:13:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] arm: stm32mp: Fix board_get_usable_ram_top() again Content-Language: en-US To: Pali Rohar , Tom Rini CC: Marek Vasut , , Patrice Chotard , Simon Glass References: <20230105012222.238075-1-marex@denx.de> <99e68254-e6a1-9653-54fb-61d64d8e02e1@foss.st.com> <300a8101-2395-f04d-827e-dea622470f95@foss.st.com> <20230105192541.5bybysemi6yivdd4@pali> From: Patrick DELAUNAY In-Reply-To: <20230105192541.5bybysemi6yivdd4@pali> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.48.0.157] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-06_05,2023-01-05_02,2022-06-22_01 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Hi, On 1/5/23 20:25, Pali Rohar wrote: > Ok, so it is working... > > On Thursday 05 January 2023 19:31:19 Patrick DELAUNAY wrote: >> I tested on STM32MP157C-EV1 on my side... >> >> with 1GiB mermory size >> >> U-Boot is booting on next TOP (for trusted boot with TF-A and OP-TEE) >> >> >> >> U-Boot 2023.01-rc4-00386-gb429e78942de (Jan 05 2023 - 17:44:04 +0100) >> >> stm32_smc: Failed to exec svc=82001003 op=1 in secure mode (err = -1) >> stm32_smc: Failed to exec svc=82001003 op=1 in secure mode (err = -1) >> CPU: STM32MP157C?? Rev.Z >> Model: STMicroelectronics STM32MP157C eval daughter on eval mother >> Board: stm32mp1 in trusted mode (st,stm32mp157c-ev1) >> stm32_smc: Failed to exec svc=82001003 op=1 in secure mode (err = -1) >> DRAM:  1 GiB >> .... >> >> >> STM32MP> bdinfo >> boot_params = 0x00000000 >> DRAM bank   = 0x00000000 >> -> start    = 0xc0000000 >> -> size     = 0x3ffff000         <<<<<< the patch is applied - 4kiB here !!! > But this is wrong. DRAM bank size should not be changed. I think that in > U-Boot is another issue which propagates mapped U-Boot RAM size/range to > the places where should be real DDR size. Yes it is wrong and it is introduced by your patch... in the STM32MP15x platfrorm are using the genric weak function ./common/board_f.c:267 __weak int dram_init_banksize(void) {     gd->bd->bi_dram[0].start = gd->ram_base;     gd->bd->bi_dram[0].size = get_effective_memsize();     return 0; } For me: get_effective_memsize() must return the effective size of the DDR and NOT -4KiB to avoid side effects in other part of the code (LMB for example) I think today we need to revert your patch. regards Patrick