public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot,1/2] sunxi: Enable DFU for RAM
Date: Fri, 20 Nov 2015 16:21:33 +0100	[thread overview]
Message-ID: <564F3A7D.3000306@redhat.com> (raw)
In-Reply-To: <1445748287-12421-2-git-send-email-siarhei.siamashka@gmail.com>

Hi,

On 25-10-15 05:44, Siarhei Siamashka wrote:
> The DFU protocol implementation in U-Boot is much faster than the
> FEL protocol implementation in the boot ROM on Allwinner devices.
> Using DFU instead of FEL improves the USB transfer speed from
> 500-900 KB/s to 3.2-3.7 MB/s. This is particularly useful for
> reducing the time needed for booting systems with large initrd
> images.
>
> FEL is still useful for loading the U-Boot bootloader and a boot
> script, which may then activate DFU in the following way:
>
>     setenv dfu_alt_info ${dfu_alt_info_ram}
>     dfu 0 ram 0
>     bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
>
> The rest of the files can be transferred to the device using the
> "dfu-util" tool.
>
> Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>

Thanks, I've applied this series to my tree, and it will be part
of the next pull-req.

Regards,

Hans


> ---
>   include/configs/sunxi-common.h | 30 +++++++++++++++++++++++++-----
>   1 file changed, 25 insertions(+), 5 deletions(-)
>
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index ddcfe94..38c0bc5 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -337,6 +337,7 @@ extern int soft_i2c_gpio_scl;
>   #define CONFIG_USB_GADGET_VBUS_DRAW	0
>
>   #define CONFIG_USB_GADGET_DOWNLOAD
> +#define CONFIG_USB_FUNCTION_DFU
>   #define CONFIG_USB_FUNCTION_FASTBOOT
>   #define CONFIG_USB_FUNCTION_MASS_STORAGE
>   #endif
> @@ -347,6 +348,11 @@ extern int soft_i2c_gpio_scl;
>   #define CONFIG_G_DNL_MANUFACTURER	"Allwinner Technology"
>   #endif
>
> +#ifdef CONFIG_USB_FUNCTION_DFU
> +#define CONFIG_CMD_DFU
> +#define CONFIG_DFU_RAM
> +#endif
> +
>   #ifdef CONFIG_USB_FUNCTION_FASTBOOT
>   #define CONFIG_CMD_FASTBOOT
>   #define CONFIG_FASTBOOT_BUF_ADDR	CONFIG_SYS_LOAD_ADDR
> @@ -394,13 +400,26 @@ extern int soft_i2c_gpio_scl;
>    * 32M uncompressed kernel, 16M compressed kernel, 1M fdt,
>    * 1M script, 1M pxe and the ramdisk at the end.
>    */
> +
> +#define KERNEL_ADDR_R  __stringify(SDRAM_OFFSET(2000000))
> +#define FDT_ADDR_R     __stringify(SDRAM_OFFSET(3000000))
> +#define SCRIPT_ADDR_R  __stringify(SDRAM_OFFSET(3100000))
> +#define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(3200000))
> +#define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(3300000))
> +
>   #define MEM_LAYOUT_ENV_SETTINGS \
>   	"bootm_size=0xa000000\0" \
> -	"kernel_addr_r=" __stringify(SDRAM_OFFSET(2000000)) "\0" \
> -	"fdt_addr_r=" __stringify(SDRAM_OFFSET(3000000)) "\0" \
> -	"scriptaddr=" __stringify(SDRAM_OFFSET(3100000)) "\0" \
> -	"pxefile_addr_r=" __stringify(SDRAM_OFFSET(3200000)) "\0" \
> -	"ramdisk_addr_r=" __stringify(SDRAM_OFFSET(3300000)) "\0"
> +	"kernel_addr_r=" KERNEL_ADDR_R "\0" \
> +	"fdt_addr_r=" FDT_ADDR_R "\0" \
> +	"scriptaddr=" SCRIPT_ADDR_R "\0" \
> +	"pxefile_addr_r=" PXEFILE_ADDR_R "\0" \
> +	"ramdisk_addr_r=" RAMDISK_ADDR_R "\0"
> +
> +#define DFU_ALT_INFO_RAM \
> +	"dfu_alt_info_ram=" \
> +	"kernel ram " KERNEL_ADDR_R " 0x1000000;" \
> +	"fdt ram " FDT_ADDR_R " 0x100000;" \
> +	"ramdisk ram " RAMDISK_ADDR_R " 0x4000000\0"
>
>   #ifdef CONFIG_MMC
>   #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
> @@ -482,6 +501,7 @@ extern int soft_i2c_gpio_scl;
>   #define CONFIG_EXTRA_ENV_SETTINGS \
>   	CONSOLE_ENV_SETTINGS \
>   	MEM_LAYOUT_ENV_SETTINGS \
> +	DFU_ALT_INFO_RAM \
>   	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
>   	"console=ttyS0,115200\0" \
>   	BOOTCMD_SUNXI_COMPAT \
>

  reply	other threads:[~2015-11-20 15:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-25  4:44 [U-Boot] [PATCH 0/2] Enable DFU for RAM on Allwinner devices Siarhei Siamashka
2015-10-25  4:44 ` [U-Boot] [PATCH 1/2] sunxi: Enable DFU for RAM Siarhei Siamashka
2015-11-20 15:21   ` Hans de Goede [this message]
2015-10-25  4:44 ` [U-Boot] [PATCH 2/2] musb: sunxi: Implement dfu_usb_get_reset() Siarhei Siamashka
2015-10-25 11:00   ` Marek Vasut
2015-10-25 11:46     ` Albert ARIBAUD
2015-10-25 12:40       ` Ian Campbell
2015-10-25 13:22         ` Albert ARIBAUD
2015-10-25 13:29           ` Marek Vasut
2015-10-25 14:46             ` Siarhei Siamashka
2015-10-25 16:08               ` Marek Vasut
2015-10-25 19:24               ` Ian Campbell
2015-10-25 20:48                 ` Siarhei Siamashka
2015-10-25 19:22           ` Ian Campbell
2015-10-25 21:16             ` Albert ARIBAUD
2015-10-26 10:07               ` Ian Campbell
2015-10-26 11:32                 ` Albert ARIBAUD
2015-10-25 14:55     ` Siarhei Siamashka
2015-10-25 16:09       ` Marek Vasut
2015-10-25 21:19       ` Albert ARIBAUD
2015-10-26 11:18 ` [U-Boot] [PATCH 0/2] Enable DFU for RAM on Allwinner devices Piotr Król
2015-10-27  4:31   ` Siarhei Siamashka
2015-10-27 23:27     ` Piotr Król
2015-10-28  4:49       ` Siarhei Siamashka

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=564F3A7D.3000306@redhat.com \
    --to=hdegoede@redhat.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