From mboxrd@z Thu Jan 1 00:00:00 1970 From: Siarhei Siamashka Date: Thu, 5 Feb 2015 12:21:33 +0200 Subject: [U-Boot] [PATCH 5/5] RFC: sunxi: WIP FEL support In-Reply-To: <1423023534-4318-5-git-send-email-sjg@chromium.org> References: <1423023534-4318-1-git-send-email-sjg@chromium.org> <1423023534-4318-5-git-send-email-sjg@chromium.org> Message-ID: <20150205122133.2800005d@i7> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 3 Feb 2015 21:18:54 -0700 Simon Glass wrote: > (What does FEL stand for?) That's a good question. I believe that it might be based on the "jump to fel" message from the console output of the Allwinner's BOOT0 bootloader: http://linux-sunxi.org/FEL#Serial_output Other than this, I don't know what this name stands for. In fact the FEL code has a special entry point at 0xffff0020, which is the target of this "jump to fel" action in BOOT0: https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff0000.s#L9 It initializes the USB hardware again, and I believe that this is the reason why I have some problems trying to use this method. So far the flow looks like this: 1. The SPL is uploaded to SRAM and executed (to initialize DRAM) and other things. 2. As the last step in the SPL ('return_to_fel' in your code), we just transfer control directly to 0xffff0020 instead of using the address from the lr register. 3. The USB stack in my PC seems to be a bit confused by the MBUS hardware re-init. For example, the next "fel ver" command fails for me with a timeout. However the follow up fel commands work fine, and I can successfully "write" and "exe" the main u-boot binary. The incomplete demo patch for the fel tool has been posted at http://lists.denx.de/pipermail/u-boot/2015-February/204024.html > This is an attempt to make sunxi's FEL code fit with the normal U-Boot > boot sequence instead of creating its own. > > Most of the FEL special-case code is removed, although I may have gone too > far with my changes to generate a u-boot-sunxi-with-spl.bin file even when > FEL is enabled. This may not be possible since the MMC stack makes SPL > too large for FEL anyway, although it may be possible for other boot > mediums. This is actually very good. If we can resolve the jump to 0xffff0020 problems (try to perform a clean USB shutdown before doing this?), then the SPL size limitation for USB booting is gone and we get a unified SPL binary for both SD card boot and boot over USB. With no need for a lot of special sunxi things in the U-Boot boot sequence. I'm going to have another look at it today in the evening to see if the remaining problems can be resolved. > This series is available at u-boot-dm, branch sunxi-working. Thanks a lot for this work. -- Best regards, Siarhei Siamashka