From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dinh Nguyen Date: Tue, 10 Apr 2018 21:45:59 -0500 Subject: [U-Boot] arm: socfpga: unable to boot cyclone5 devkit or SocKit In-Reply-To: <5849f39e-b8d5-8a7a-0525-0df25846a0f5@kernel.org> References: <75271d91-491c-e0ab-543a-0dbf631d903e@kernel.org> <6a21b85b-6b05-ae5a-0077-eaf39689b500@kernel.org> <54e87513-18b7-ffa7-dc13-871ebe6aaf63@kernel.org> <5849f39e-b8d5-8a7a-0525-0df25846a0f5@kernel.org> Message-ID: <097ca9da-c2cb-b692-93c5-0ef2b457b9c7@kernel.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04/10/2018 09:21 PM, Dinh Nguyen wrote: > > > On 04/10/2018 05:37 PM, Marek Vasut wrote: >> On 04/10/2018 11:36 PM, Dinh Nguyen wrote: >>> >>> >>> On 04/10/2018 02:25 PM, Marek Vasut wrote: >>>> On 04/10/2018 08:56 PM, Dinh Nguyen wrote: >>>>> >>>>> >>>>> On 04/10/2018 01:29 PM, Marek Vasut wrote: >>>>>> On 04/10/2018 08:28 PM, Dinh Nguyen wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I'm seeking advice with an observation that I'm seeing on the Cyclone5 >>>>>>> devkit/sockit. >>>>>>> >>>>>>> I'm working with U-Boot version v2018.05-rc1. Building the >>>>>>> u-boot-with-spl.sfp, then writing the sfp file to the 0xa2 partition on >>>>>>> the SD card, does not boot, all I get is this: >>>>>>> >>>>>>> U-Boot SPL 2018.05-rc1 (Apr 10 2018 - 13:03:48 -0500) >>>>>>> >>>>>>> U-Boot SPL 2018.05-rc1 (Apr 10 2018 - 13:03:48 -0500) >>>>>>> >>>>>>> U-Boot SPL 2018.05-rc1 (Apr 10 2018 - 13:03:48 -0500) >>>>>>> >>>>>>> >>>>>>> This issue doesn't happen at all on the DE0 Nano SoC board. I compared >>>>>>> the defconfig and came across this. If I remove these config options in >>>>>>> the socfpga_sockit_defconfig, then SPL -> U-Boot works fine. >>>>>>> >>>>>>> -CONFIG_SPI_FLASH_MACRONIX=y >>>>>>> -CONFIG_SPI_FLASH_SPANSION=y >>>>>>> -CONFIG_SPI_FLASH_STMICRO=y >>>>>>> >>>>>>> I'll continue to debug of course, but was wondering if anyone might have >>>>>>> a better idea as to what could be happening, I'd appreciate the insight. >>>>>> >>>>>> Check the size of the SPL , could it be too big ? >>>>>> >>>>> >>>>> That's a good thought...it could be. The size of the default >>>>> u-boot-spl-dtb.bin is 58048, removing the SPI, brings that down to >>>>> 55616, that's smaller than the 64k of OCRAM for SPL? >>>> >>>> Right, I think there's something about those last few kiB OR it's the >>>> stack that's overwriting piece of U-Boot or malloc area or something. >>>> How did it grow so big anyway ? >>>> >>> >>> Ah, looks like SYS_MALLOC_F_LEN is set to 8k, thus, we're over the 64k >>> limit. Setting SYS_MALLOC_F_LEN to 4k makes it work again. I'm not sure >>> how the SPL grew so big. >> >> I have a couple of theories, but anyway ... >> >> u-boot$ git reset --hard v2018.01 ; bu socfpga_cyclone5 ; ls -la >> spl/u-boot-spl.bin >> HEAD is now at f3dd87e0b9 Prepare v2018.01 >> -rw-r--r-- 1 marex marex 52902 Apr 11 00:34 spl/u-boot-spl.bin >> >> u-boot$ git reset --hard v2018.03 ; bu socfpga_cyclone5 ; ls -la >> spl/u-boot-spl.bin >> HEAD is now at f95ab1fb6e Prepare v2018.03 >> -rw-r--r-- 1 marex marex 59706 Apr 11 00:34 spl/u-boot-spl.bin >> >> Try bisecting out the commit which caused this 7 kiB growth between >> 2018.01 and 2018.03 . Even those 53 kiB are quite borderline, but it was >> at 53 kiB for a while (2017.05 is also ~53 kiB) >> > > Doing the bisect points me to this commit: > > commit fa2c14676c7c6f3115dd4d9b2a4cc3b35c3ad2a2 > Author: Tom Rini > Date: Sat Feb 10 16:54:38 2018 -0500 > > configs: Re-sync with CONFIG_DISTRO_DEFAULTS > > A number of platforms include config_distro_defaults.h but do not enable > CONFIG_DISTRO_DEFAULTS. As they plainly intended to, set that flag and > re-sync config files. > > Signed-off-by: Tom Rini > > Doing a revert of the above commit shrinks the SPL back down to ~7 kiB. > > Dinh > It looks like the enablement of CONFIG_DISTRO_DEFAULTS, enables these configs: CONFIG_ISO_PARTITION=y CONFIG_SPL_ISO_PARTITION=y # CONFIG_AMIGA_PARTITION is not set # CONFIG_SPL_AMIGA_PARTITION is not set CONFIG_EFI_PARTITION=y CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=128 CONFIG_EFI_PARTITION_ENTRIES_OFF=0 CONFIG_SPL_EFI_PARTITION=y CONFIG_PARTITION_UUIDS=y CONFIG_SPL_PARTITION_UUIDS=y # CONFIG_PARTITION_TYPE_GUID is not set Which is contributing to the SPL growth. Dinh