From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Mon, 02 Feb 2015 09:07:13 +0100 Subject: [U-Boot] [PATCH 2/9] sunxi: Move SPL s_init() code to board_init_f() In-Reply-To: References: <1419361499-31967-1-git-send-email-sjg@chromium.org> <1419361499-31967-3-git-send-email-sjg@chromium.org> <1419758342.13595.28.camel@hellion.org.uk> <20150130195318.410e9dd6@i7> <20150201184543.627b1c11@i7> <20150201203738.0cbc74ae@i7> Message-ID: <54CF3031.7070407@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, Siarhei, On 01-02-15 21:59, Simon Glass wrote: > Hi Siarhei, > > On 1 February 2015 at 11:37, Siarhei Siamashka >> A comprehensive FEL usage guide is supposed to be in the linux-sunxi >> wiki. But it might be not very up to date with the mainline u-boot >> usage. >> >> Anyway, first just clone the https://github.com/linux-sunxi/sunxi-tools >> repository and build it. This will provide you with the x86 binary of >> the 'fel' tool, which is used on your desktop PC to talk with the >> device. >> >> Then connect the device to your PC using a "USB A to USB mini/micro B" >> cable. And reset the board while keeping the "FEL" button pressed. The >> button might be labelled as "UPGRADE" on your pcduino3 board: >> http://linux-sunxi.org/LinkSprite_pcDuino_V3#FEL_mode >> >> Then just run "fel ver" command: >> http://linux-sunxi.org/FEL#Running_the_fel_tool >> >> If everything is fine, it should respond with something like this: >> AWUSBFEX soc=00162500(A13) 00000001 ver=0001 44 08 scratchpad=00007e00 >> 00000000 00000000 >> >> Now you can use "write" commands to upload data to SRAM. And "exe" >> command to execute functions on the device (works as some kind of RPC): >> http://linux-sunxi.org/FEL/USBBoot#Manual_loading >> >> As a simple test, you can upload just a single "bx lr" instruction >> (compiled in ARM mode) to the address 0x2000 and try to execute it. >> In the case if your code screws up something and does not return >> control to the BROM correctly, then the "fel" tool can't communicate >> over USB anymore and just timeouts. Regarding the address space, you >> can use SRAM addresses starting from 0x2000 up to something like 0x5E00 >> (that's where the stack pointer is set). This was a description of a >> "bare metal" FEL usage. >> >> Now as for the u-boot support. You can compile and run u-boot in the FEL >> mode configuration on pcduino3 in the following way: >> >> make CROSS_COMPILE=arm-none-gnueabi- Linksprite_pcDuino3_felconfig >> make CROSS_COMPILE=arm-none-gnueabi- -j2 >> >> fel write 0x2000 spl/u-boot-spl.bin >> fel exe 0x2000 >> >> sleep 1 # Wait for DRAM initialization to complete > > i.e. wait for U-Boot SPL to return to the BROM? > >> >> fel write 0x4a000000 u-boot.bin >> fel exe 0x4a000000 >> >> Please note the use of '*_felconfig' instead of '*_defconfig'. >> And also right now the FEL mode support is broken. That's why the >> http://lists.denx.de/pipermail/u-boot/2015-January/203282.html >> patchset tried to address this problem. >> > > OK that looks like an excellent guide, thank you. I will make some time to > take a more detailed look at this as soon as I can, but definitely in the > next few days. I've been reading all threads on this, thank you both for looking into this, since you're on it I'm going to leave this be (and not review / apply Siarhei's patches for this), and we can revisit this later, with hopefully a better fix. Thanks & Regards, Hans