[U-Boot] SPL Dfu update

Michael Trimarchi michael at amarulasolutions.com
Wed Oct 30 09:38:14 CET 2013


Hi

On Wed, Oct 30, 2013 at 9:28 AM, Michael Trimarchi
<michael at amarulasolutions.com> wrote:
> Hi Lukasz
>
> We have discussed during the u-boot mini-summit the possibility to have
> the dfu update from SPL. Right now I'm trying to understand what is the best
> way to do:
>
>
> void spl_dfu_load_image()
> {
>         int rv;
>
>         env_init();
>         env_relocate();
>         setenv("dfu_alt_info", DFU_BOARD_FLASHINFO);
>         board_usb_init();
>         g_dnl_register(s);
>
> One option could be do the same of do_dfu command and let upload
> all the image that is needed to flash and the issue a usb reset. I don't sure
> if the reset can be triggered and then do a cpu board reset and let it boot
> from the booting device.
>
> What is for you the best approch?
>

better pseudo code

void spl_dfu_load_image()
{
        ret = dfu_config_entities(DFU_BOARD_FLASHINFO, DFU_BOARD_INTERFACE,
                                  DFU_BOARD_NUMBER);
        board_usb_init();
        g_dnl_register(s);
        while(1) {
                if (ctrlc())
                        goto exit;
                ret = usb_gadget_handle_interrupts();
                if (ret)
                        goto exit;
        }

exit:
        g_dnl_unregister();
        dfu_free_entities();
        board_reset();
}

Michael

> Michael


More information about the U-Boot mailing list