From: Daniel Schwierzeck Date: Tue, 11 Apr 2017 23:50:41 +0200 Subject: [U-Boot] qemu_mips - CONFIG_SYS_MONITOR_LEN is too small In-Reply-To: <22a0a787-0c4e-312d-354f-14029a87cdbb@gmail.com> References: <22a0a787-0c4e-312d-354f-14029a87cdbb@gmail.com> Message-ID: <5a75cc35-577d-c924-dc1f-3fc5aa99931a@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 09.04.2017 um 20:19 schrieb Kyle Edwards: > Hi all, > > I recently tried to use u-boot on the qemu_mips platform, and running > the saveenv command causes u-boot to not boot after a reset. I followed > these steps: > > $ git clone git://git.denx.de/u-boot.git > $ cd u-boot > $ git checkout v2017.05-rc1 > $ export CROSS_COMPILE=mips-linux-gnu- > $ make qemu_mips_defconfig > $ make > $ dd if=/dev/zero of=../flash.bin bs=1k count=4k > $ dd if=u-boot.bin of=../flash.bin bs=1k conv=notrunc > $ qemu-system-mips -nographic -M mips -pflash ../flash.bin > > At this point I stopped autoboot, ran "saveenv" inside U-Boot, and reset > qemu. After reset, U-Boot did not print any messages, and is stuck. > > I tracked this down to an invalid CONFIG_SYS_MONITOR_LEN. It's currently > configured for 196608 (192 << 10), but running "ls -l u-boot.bin" shows > a size of 232296. When the environment is being saved, it overwrites > part of the U-Boot code. good catch, but your description is a little bit misleading. CONFIG_SYS_MONITOR_LEN is not used any more on MIPS. The main problem is the wrong env offset which is currently derived from CONFIG_SYS_MONITOR_LEN: #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN) > > I am willing to write a patch for this bug, but I thought I would report > it here first. > please do. Patches are always preferred to bug reports because we only have a patch-tracking system. Thus bug reports likely go missing whereas patches get picked up by a maintainer eventually. -- - Daniel -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: