[U-Boot] [linux-sunxi] Re: A23 u-boot with SPL / dram init available in my personal git repo

Siarhei Siamashka siarhei.siamashka at gmail.com
Mon Dec 15 10:36:36 CET 2014


On Sun, 14 Dec 2014 22:01:29 -0800 (PST)
Ricky Xian <szricky at gmail.com> wrote:

> Hi,
> 
> I'm trying to boot from usb fel mode on A23. I have rebuilt your sunxi-wip 
> branch, and try to run on my A23 (q88?) board, but it's failed in fel mode 
> in executing.
> 
> I think the u-boot-spl.bin can be used as A20, this's the website I refer 
> to: 
> http://docs.cubieboard.org/tutorials/cb2/development/booting_from_usb_in_fel_mode
> 
> my testing instructions are:
> 
> fel write address  u-boot-spl.bin
> fel exec address
> 
> the address for A20 is 0x2000, so that the DRAM will be initialized. but 
> it's incorrect for A23 if the size reach 0x4000. 
> 
> can you please let me know how to use fel and your u-boot-spl.bin? 

The size 0x4000 is just too large for the SPL binary. You can have a
look at the SRAM memory map that is used in the FEL mode here:
    https://github.com/hno/Allwinner-Info/blob/master/FEL-usb/USB-protocol.txt

Basically, there are two areas. One starts at 0x2000 and ends somewhere
around 0x5D00 (may be slightly different for different SoC variants).
The stack pointer is set right at the end of this area by the BROM
code before passing control to SPL. So in practice it means that SPL
code, data and stack must all fit there in just ~15K.

Another free area is around 0x8000-0xbfff, at least on A10/A13/A20.

The rest of SRAM is used by the BROM code for implementing FEL USB
protocol and we should not touch it.

In order to provide more room for SPL in the FEL mode, the following
things can be done:
1) Compile the FEL SPL in Thumb2 mode instead of ARM mode, that's going
to save around 30% of code size (depending on the compiler version).
2) Take the extra 0x8000-0xbfff area into use.

I had a patch for this earlier (it is currently self-NAKED):
    http://lists.denx.de/pipermail/u-boot/2014-July/183985.html

Switching to Thumb2 should be perfectly safe. But before using the
0x8000-0xbfff area, we need to confirm that it is really free to
use on every Allwinner SoC variant and does not clash with the
data structures used by the FEL BROM code. The FEL SRAM memory map
details can be probably clarified by the Allwinner representatives.

I was kind of reluctant to settle with the Thumb2 part alone until
the sunxi custodians acknowledge that the SPL code size is actually
a real practical problem. For example, this is important for making
other decisions and having some progress with
    http://lists.denx.de/pipermail/u-boot/2014-August/185722.html    

To sum it up. Just try to reduce the SPL size. Maybe try a different
gcc version to compile it. Maybe try to apply the Thumb2 tweak.

-- 
Best regards,
Siarhei Siamashka


More information about the U-Boot mailing list