public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/5] RFC: sunxi: WIP FEL support
Date: Thu, 5 Feb 2015 12:21:33 +0200	[thread overview]
Message-ID: <20150205122133.2800005d@i7> (raw)
In-Reply-To: <1423023534-4318-5-git-send-email-sjg@chromium.org>

On Tue,  3 Feb 2015 21:18:54 -0700
Simon Glass <sjg@chromium.org> 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

  parent reply	other threads:[~2015-02-05 10:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04  4:18 [U-Boot] [PATCH 1/5] arm: Use r2 instead of r0 in start.S Simon Glass
2015-02-04  4:18 ` [U-Boot] [PATCH 2/5] arm: Allow reset init to be controlled Simon Glass
2015-02-04  8:50   ` Albert ARIBAUD
2015-02-05  2:51     ` Simon Glass
2015-02-04  4:18 ` [U-Boot] [PATCH 3/5] arm: Allow lr to be saved by board code Simon Glass
2015-02-04  8:59   ` Albert ARIBAUD
2015-02-05  2:51     ` Simon Glass
2015-02-05 14:15       ` Albert ARIBAUD
2015-02-05 14:19         ` Simon Glass
2015-02-05 21:40       ` Tom Rini
2015-02-04  4:18 ` [U-Boot] [PATCH 4/5] arm: spl: Provide for a board-specific loader Simon Glass
2015-02-04  4:18 ` [U-Boot] [PATCH 5/5] RFC: sunxi: WIP FEL support Simon Glass
2015-02-04  8:47   ` Hans de Goede
2015-02-04  9:04     ` Albert ARIBAUD
2015-02-05  2:52     ` Simon Glass
2015-02-05  8:40       ` Hans de Goede
2015-02-05 10:21   ` Siarhei Siamashka [this message]
2015-02-06  5:45     ` Simon Glass
2015-02-04  8:57 ` [U-Boot] [PATCH 1/5] arm: Use r2 instead of r0 in start.S Albert ARIBAUD
2015-02-05  2:51   ` Simon Glass

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=20150205122133.2800005d@i7 \
    --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