[U-Boot] How to update Espressobin (U-Boot) firmware?

Andre Przywara andre.przywara at arm.com
Wed Jul 19 15:19:13 UTC 2017


Hi Kosta,

thanks again for the instructions, though I feel the road there is still
a bit bumpy and has some potholes ;-)

Here is what I did:
1) build u-boot.bin
2) build wtmi.bin (from the utils repo)
3) build ATF
$ make USE_COHERENT_MEM=0 DEBUG=1 LOG_LEVEL=20 DDR_TOPOLOGY=2
BOOTDEV=SPINOR WTMI_IMG=/path/to/wtmi.bin PLAT=a3700 all fip
This breaks after having created fip.bin. I concatenated bl1.bin (padded
to 128K) and fip.bin to atf.bin manually.
4) create the image description file (in the utils repo):
./buildtim.sh 0 SPINOR ./untrusted ./ CPU_800_DDR_800 2 0 1 ntim.txt
5) fixup the filenames in the generated text file (wtmi.bin and atf.bin)
6) create the image (utils repo):
./wtptp_tool/linux/TBB_linux -m 1 -r ntim.txt -V

>From staring at the SPI dump in a hexeditor, I take it that:
a) TIM_ATF.bin goes to 0
b) wtmi.bin goes to 0x4000
c) atf.bin goes to 0x15000

Is that about right? Is it that doimage from the ATF repo is supposed to
glue this together (step 4-6), which for some reason doesn't work for me?

Another issue seems to be that the UART download tool seems to be closed
source only and only available from the Marvell "Extranet" under NDA?

>From looking at the output of the "h" command in UART mode I guess this
tools is just a glorious wrapper around spoon-feeding the generated
binaries in 32-bit chunks into the respective SRAM regions, then execute
them? Possibly also doing all those register setups (via MMIO) described
in the ntim.txt/TIM_ATF.bin file?
Which doesn't look too complicated to hack an Open Source tool for.
Or is this tool actually available somewhere (either as source or as a
binary)?

Cheers,
Andre.


On 18/07/17 16:32, Kostya Porotchkin wrote:
> Hi, Andre,
> 
>> -----Original Message-----
>> From: Andre Przywara [mailto:andre.przywara at arm.com]
>> Sent: Tuesday, July 18, 2017 18:24
>> To: Kostya Porotchkin
>> Cc: Stefan Roese; Marc Zyngier; Thomas Petazzoni; Gregory CLEMENT;
>> Antoine Tenart; Andreas Färber; U-Boot; Benjamin (Guodan) Huang
>> Subject: Re: [EXT] How to update Espressobin (U-Boot) firmware?
>>
>> Hi Kosta,
>>
>> On 18/07/17 16:13, Kostya Porotchkin wrote:
>>> The A37xx SoC does not support boot from SD.
>>
>> Ah!
>>
>>> Only boot from eMMC is supported, however your board probably only has
>> soldering pads for the eMMC and not eMMC chip installed.
>>> If you want to play with the bootloader without jeopardizing your SPI
>> image, you have to use either UART or SATA boot mode.
>>
>> Does SATA boot work like SD boot, where the boot image starts at sector
>> 1? And it needs to be flagged as a SATA boot image, right?
> [Konstantin Porotchkin] Correct. You can put it on LBA-1 or LBA-34 if you use GPT.
> Just remember, this image is very special. It's actually a multipart image
> that we merge into a single blob for easier usage with the u-boot "bubt" command.
> 
>>
>>> For the boot image build you will need to obtain the u-boot, ATF and
>> the image building tools sources.
>>> https://github.com/MarvellEmbeddedProcessors/atf-marvell/tree/atf-v1.3
>>> -armada-17.06
>>> https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell/tree/
>>> A3700_utils-armada-17.06
>>> https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/tree/u-boo
>>> t-2017.03-armada-17.06
>>>
>>> The "utils" git contains also the UART download tool.
>>> It uses a proprietary download protocol and not xmodem one as in KW
>> case.
>>> The flash image structure on this platform also differs from KW, so
>> please do not try to directly burn a "bin" or "kw" file created by the
>> u-boot build system.
>>> The ATF git from above already contains the required changes in the
>> Makefile for running the additional steps of the final flash image
>> formatting.
>>> Additionally, the boot image contains a boot device information in its
>> header, so you cannot move SPI flash image to another boot device.
>>>
>>> For the boot loader build instructions please check the following
>> documents:
>>> https://github.com/MarvellEmbeddedProcessors/atf-marvell/blob/atf-v1.3
>>> -17.04/docs/marvell/build.txt
>>> https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/blob/u-boo
>>> t-2017.03-armada-17.06/doc/mvebu/build.txt
>>>
>>> UART boot details:
>>> https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/blob/u-boo
>>> t-2017.03-armada-17.06/doc/mvebu/uart_boot.txt
>>
>> Thanks a ton for those links and information, that was exactly what I
>> was looking for!
>> Do you mind if I (later ;-) write up those steps in a document which we
>> merge into the repo?
>> Something like [1], which proved useful in the past just to point people
>> to - that would save you some typing as well ;-)
> [Konstantin Porotchkin] Sure, any additional source of information would be great.
> I just notified the Espressobin WIKI team about urgent need for this type of document and for an alternative boot source usage example.
> Hope the new WIKI entry will be ready shortly.
> 
> Regards
> Kosta
>>
>> Cheers,
>> Andre.
>>
>> [1]
>> http://git.denx.de/?p=u-
>> boot.git;a=blob;f=board/sunxi/README.sunxi64;hb=HEAD
>>
>>>
>>>
>>> Regards
>>> Kosta
>>>
>>>> -----Original Message-----
>>>> From: Andre Przywara [mailto:andre.przywara at arm.com]
>>>> Sent: Tuesday, July 18, 2017 17:45
>>>> To: Kostya Porotchkin
>>>> Cc: Stefan Roese; Marc Zyngier; Thomas Petazzoni; Gregory CLEMENT;
>>>> Antoine Tenart; Andreas Färber; U-Boot
>>>> Subject: [EXT] How to update Espressobin (U-Boot) firmware?
>>>>
>>>> External Email
>>>>
>>>> ---------------------------------------------------------------------
>>>> -
>>>> Hi,
>>>>
>>>> I wanted to exploit U-Boot's EFI support on the Espressobin board, to
>>>> use off-the-shelf arm64 distribution installer images. This should
>>>> work with current U-Boot, which has support for the Espressobin board
>>>> (and for UEFI).
>>>>
>>>> The firmware my board ships with seems to be built from older and
>>>> non- upstream sources - and, in contrast to the Macchiatobin board -
>>>> I cannot find either proper sources for all components (mv-ddr, ATF)
>>>> nor
>>>> *any* kind of instructions how to (re-)build and update the firmware.
>>>>
>>>> So I was wondering if there are any instructions or documentation I
>>>> missed on how to update at least U-Boot?
>>>>
>>>> I see some hints that people are apparently chain-loading mainline U-
>>>> Boot, is this the only way?
>>>> I dumped the SPI flash and could identify the ATF FIP image on it,
>>>> but I am a bit wary of bricking the board by just squashing a freshly
>>>> built u- boot.bin into that - which I guess wouldn't work that easily
>> anyway.
>>>>
>>>> And to allow experimentation: Are the boot selection jumpers actually
>>>> working? Setting them to SD card (111) doesn't seem to make a
>>>> difference (it still booted off the SPI flash, apparently). Or does
>>>> it fall back to SPI flash in case the SD image is not valid (I put
>>>> the dumped image at sector 1)?
>>>> I see that selecting "UART" (110) gives me that "E" prompt,
>>>> apparently waiting for some data to be fed, but again can't tell what
>>>> to do from here? I take it that mkimage/kwboot won't work as is, as
>>>> it needs ATF? I found some mentioning of a Windows binary, but hope
>>>> that's not the only way to use this mode?
>>>>
>>>> I'd be very grateful for any insight into this!
>>>>
>>>> Cheers,
>>>> Andre.


More information about the U-Boot mailing list