Re: Barebox as first and second stage bootloader

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/26/2020 03:28 PM, Ahmad Fatoum wrote:
Hello,

On 2/26/20 12:57 PM, gianluca wrote:
Hello,
I was wondering if it possible to program Barebox (2020.01 or later) as first and second stage bootloader using the STM32 Programmer CLI tool.

FSBL is not supported at the moment. We use TF-A for that.

OK, I suppose that.


I have the stm32mp157 evk-dk2 and I would like to have a working bootloader (running from SDRAM) via USB programming.

I do not know how the OTP Fuses are set for trusted boot or simple SPL.

Not sure how this relates to booting over USB? You shouldn't need any
fuses burnt (but you can probably burn some to stop fallback to DFU)


I was trying to say that I didn't know how the fallback is managed DFU via serial, usb or whatever or it is managed by some OTP fuses.


I suppose they are TF-A for first stage bootloader and SPL for the second one.

The images built by Barebox (start_stm32mp157c_dk2.pblb[.stm32] and barebox-stm32mp157c-dk2.img) are suitable to be used as first stage bootloader running from internal SRAM and the .img as the second stage bootloader running from external SDRAM DDR???

No, they aren't. The current barebox implementation doesn't set up SDRAM and doesn't install
a secure monitor.


So I need a simple implementation of a SDRAM setup, a secure monitor (TF-A). What do you are using at the moment?

My goals are to setup the SDRAM and the secure monitor via USB (with DFU STM32 Cube Programmer), then loading via usb (using the same STM32 Cube Programmer) the barebox-stm32mp157c-dk2.img in the external SDRAM addresses.

When barebox is done, it will download from a TFTP server the production stuff (SDRAM setup, secure monitor, barebox-stm32mp157c-dk2-PRODUCTION.img) and write those stuff into eMMC partitions.

USB on the STM32MP1 is not yet complete. I posted some basic patches for the PHY, but we still
need host USB driver adjustments and a gadget driver for the DWC2.


Using the above procedure the USB support is given only by ROM Code written by ST, not by Barebox.

Is there somebody who is working with STM32 Cube Programmer or DFU-Utils to obtain this boot??

I don't think so. We will want to have a solution for this eventually though. Probably some
wrapper script that uses DFU to talk to BootROM, then to vendor TF-A, then to barebox.


Having this wrapper script will be great. I will be grateful for the rest of my (working) life. ;-P


As I understood, that's what the STM32CubeProgrammer is doing and it's shipped with
a FSBL and SSBL already for bootstrapping a system. Have you tried using that to
flash barebox?


Not really. I will check asap. In that way I could run barebox from a bootstrapped system using STM32CubeProgrammer FSBL and SSBL and hooking at the procedure as explained above.


Thanks a lot

Gianluca Renzi
--
Eurek s.r.l.                          |
Electronic Engineering                | http://www.eurek.it
via Celletta 8/B, 40026 Imola, Italy  | Phone: +39-(0)542-609120
p.iva 00690621206 - c.f. 04020030377  | Fax:   +39-(0)542-609212

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux