From mboxrd@z Thu Jan 1 00:00:00 1970 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 1EE3BC54EE9 for ; Tue, 20 Sep 2022 12:44:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2EC4D84C45; Tue, 20 Sep 2022 14:44:29 +0200 (CEST) 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="eFYxjyKj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B760C84C5E; Tue, 20 Sep 2022 14:44:26 +0200 (CEST) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (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 ED2A084C44 for ; Tue, 20 Sep 2022 14:44:23 +0200 (CEST) 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=5262ab0752=patrice.chotard@foss.st.com Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28KBbbWd015377; Tue, 20 Sep 2022 14:44:23 +0200 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=+9nVtAWmzdMluYFQGWYSw7GcWOmcISqNXMyjf4nc2H0=; b=eFYxjyKjr0Dgb4ms78GH8Eku8sK1m7RwTEcx781zEmIhGSTeKzZYI7jUwDwCZqVRWol4 60mzjoilU1I299jMIflJ8PrSGaRmdMdPBUnmICZvAFQbA8WITcrVn9WL7BQgrJh4jlNz oRaKW2iUlj5oZD+Sr59VcUUdOnyn1oMpSV1ymxsSAwjoRfG/cFtbRONNUyImFKrfz+vo 6PCgpOfDwNMqDik2iFBmvRAb7/MMZNt7HWXiWlnmIA0ye9iNJVyhuezKKCQqA8G7aQRR uaqYfBmK0QkIgbJW4L5H2xa5JGsoJ2KpRXgdeum2hlg2r4+4SjqzqE4+bSSE5SYI3cjN Gg== 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 3jn6a0tvhy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Sep 2022 14:44:23 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5300410002A; Tue, 20 Sep 2022 14:44:22 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 46AE222F7D3; Tue, 20 Sep 2022 14:44:22 +0200 (CEST) Received: from [10.201.21.72] (10.75.127.120) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.31; Tue, 20 Sep 2022 14:44:21 +0200 Message-ID: <3d44c5b0-2cab-ca8a-8647-044eafb021d3@foss.st.com> Date: Tue, 20 Sep 2022 14:44:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: u-boot 2022-07 on STM32F746G-DISCO Content-Language: en-US To: Waldemar Brodkorb CC: U-Boot Mailing List References: <0b15585a-74c7-8b17-d119-2409cb78f139@foss.st.com> From: Patrice CHOTARD In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.120] X-ClientProxiedBy: GPXDAG2NODE4.st.com (10.75.127.68) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-20_04,2022-09-20_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 Waldemar On 9/20/22 12:53, Waldemar Brodkorb wrote: > Hi Patrice, > Patrice CHOTARD wrote, > >> Hi Waldemar >> >> On 9/19/22 23:03, Waldemar Brodkorb wrote: >>> Hi Patrice, >>> Patrice CHOTARD wrote, >>> >>>> Waldemar, >>>> >>>> You can applied the following series on current U-Boot master >>>> branch (a0759684e015bd7252be3af508c0fcfdbb8ec5dc): >>>> >>>> https://patchwork.ozlabs.org/project/uboot/list/?series=318991 >>>> >>> >>> I applied the patches on top of u-boot master and the non-SPL >>> build still works fine. It seems only 2022.07 is broken, master is fine. >>> >>> The SPL build compiles, but I get no output via serial console after >>> flashing. I changed the openocd command to use 0x8009000 for u-boot. >>> >>> /home/wbx/openadk/host_x86_64-linux-gnu/usr/bin/openocd \ >>> -f interface/stlink.cfg -f board/stm32f7discovery.cfg \ >>> -c "init" \ >>> -c "reset init" \ >>> -c "flash probe 0" \ >>> -c "flash info 0" \ >>> -c "flash write_image erase spl/u-boot-spl.bin 0x08000000" \ >>> -c "flash write_image erase u-boot-dtb.bin 0x08009000" \ >>> -c "reset run" \ >>> -c "shutdown" >>> >>> Is this change correct or do I misread your patches? >> >> Due to the flash layout (the 4 first sectors size is 32KB) using >> "flash write_image erase" command, as you did, can't be used anymore due >> to the SPL size increase. >> >> SPL size is over 32KB (0x8000), so SPL binary occupies the first and a part >> of the second 32KB sectors. >> >> When you execute "flash write_image erase u-boot-dtb.bin 0x08009000", >> this command erase the second 32KB sector (where a part of SPL has been >> previously copied) before copying the u-boot-dtb.bin binary. >> >> So i advice you to use the method described in doc/board/st/stm32_MCU.rst >> Copy directly the generated binary u-boot-with-spl.bin into the mass-storage >> exposed by the board. >> >> Example, under Ubuntu you should see the following directory /media/$USER/DIS_F746NG > > When I copy u-boot-with-spl.bin to the mass-storage device I get > following output on the serial console: > U-Boot SPL 2022.10-rc5-00009-g41530b5b3e (Sep 20 2022 - 12:37:40 > +0200) > Trying to boot from XIP > fdt_root: FDT_ERR_BADMAGIC > Hard fault > pc : 08009000 lr : 0800070b xPSR : 41000000 > r12 : 2004f108 r3 : 40011000 r2 : 080c0000 > r1 : ffffffff r0 : 00000000 > Resetting CPU ... > > resetting ... > > How is it supposed to work to start the full u-boot-dtb.bin and > u-boot-with-spl.bin? When I copy both files I get no output, it > seems this is not supported, right? u-boot-with-spl.bin is the concatenation of 2 binaries: u-boot-with-spl.bin = u-boot-spl.bin + u-boot.bin You should only copy u-boot-with-spl.bin in the board mass-storage. At the end of u-boot-spl.bin binary, some padding is added to make sure that u-boot.bin will be located at the expected offset, in our case offset 0x9000 (see CONFIG_SPL_PAD_TO 0x9000 in stm32f746-disco-spl_defconfig) So u-boot-spl.bin is first executed, located at offset 0 (0x08000000), then jump in u-boot.bin located at offset 0x9000 (0x08009000). it's weird because everything looks correct in your log, pc is set with 0x08009000 but i can't understand why u-boot.bin is not executed in your case .... > > Maybe I should stick with the normal non-SPL boot, I see no > advantage to have the SPL boot. What is the advantage of the SPL > build? At the very beginning of stm32f746-disco support, Vikas Manocha introduces SPL mode to use falcon mode (see doc/README.falcon) With this mode you can jump directly in kernel after U-Boot SPL execution : U-Boot SPL -> Kernel (previously flashed at offset 0x9000 and configured in XIP) If during boot, you maintain the "c" key pressed, the SPL flow will be: U-Boot SPL -> U-Boot (located in flash) -> Kernel (located in SD-card) Have you try with stm32f746_disco_defconfig ? in this case, you have to copy u-boot.bin binary in board mass-storage. Patrice > > best regards > Waldemar