From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [linux-sunxi] Re: A23 u-boot with SPL / dram init available in my personal git repo
Date: Mon, 15 Dec 2014 11:36:36 +0200 [thread overview]
Message-ID: <20141215113636.1caaa166@t61> (raw)
In-Reply-To: <39582012-4f2a-4ff7-a170-a160af3d0d49@googlegroups.com>
On Sun, 14 Dec 2014 22:01:29 -0800 (PST)
Ricky Xian <szricky@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
next prev parent reply other threads:[~2014-12-15 9:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-07 20:27 [U-Boot] A23 u-boot with SPL / dram init available in my personal git repo Hans de Goede
2014-12-08 12:59 ` mike.valk at gmail.com
2014-12-08 14:28 ` Chen-Yu Tsai
2014-12-08 18:53 ` Hans de Goede
2014-12-09 10:17 ` Chen-Yu Tsai
2014-12-09 10:25 ` Hans de Goede
2014-12-09 12:31 ` Chen-Yu Tsai
2014-12-13 13:58 ` Hans de Goede
2014-12-13 16:07 ` Chen-Yu Tsai
2014-12-14 9:44 ` Hans de Goede
2014-12-15 6:01 ` Ricky Xian
2014-12-15 9:36 ` Siarhei Siamashka [this message]
2014-12-15 14:59 ` [U-Boot] [linux-sunxi] " Ricky Xian
2014-12-18 11:41 ` [U-Boot] " Hans de Goede
2014-12-08 22:12 ` Maxime Ripard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141215113636.1caaa166@t61 \
--to=siarhei.siamashka@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox