
enable the SPL-DFU support for am335x platform.
Signed-off-by: Ravi Babu ravibabu@ti.com --- Kconfig | 2 +- board/ti/am335x/board.c | 15 +++++++++++++++ common/spl/spl_dfu.c | 1 + include/configs/am335x_evm.h | 17 ++++++++++++++++- 4 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/Kconfig b/Kconfig index 969641e..c4eb4bd 100644 --- a/Kconfig +++ b/Kconfig @@ -287,7 +287,7 @@ config SPL_LOAD_FIT
config SPL_DFU bool "Enable SPL with DFU to load binaries to bootdevices using USB" - depends on USB && CMD_DFU && TARGET_DRA7XX_EVM + depends on USB && CMD_DFU && (TARGET_DRA7XX_EVM || TARGET_AM335X_EVM) help Currently the SPL does not have capability to load the binaries or boot images to boot devices like eMMC,SPI,etc. diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 690c298..fe56004 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -246,6 +246,21 @@ const struct dpll_params dpll_ddr_evm_sk = { const struct dpll_params dpll_ddr_bone_black = { 400, OSC-1, 1, -1, -1, -1, -1};
+#ifdef CONFIG_SPL_DFU +int spl_run_dfu(void) +{ + int os_boot = 0; +#ifdef CONFIG_SPL_DFU_SF + spl_dfu_cmd(0, "dfu_alt_info_qspi", "sf", "0:0:24000000:0"); +#endif +#ifdef CONFIG_SPL_DFU_RAM + spl_dfu_cmd(0, "dfu_alt_info_ram", "ram", "0"); + spl_dfu_ram_load_image(); + os_boot = 1; +#endif + return os_boot; +} +#endif void am33xx_spl_board_init(void) { int mpu_vdd; diff --git a/common/spl/spl_dfu.c b/common/spl/spl_dfu.c index 8b8432b..f2badb6 100644 --- a/common/spl/spl_dfu.c +++ b/common/spl/spl_dfu.c @@ -143,6 +143,7 @@ int spl_dfu_ram_load_image(void) struct spl_load_info load; debug("Found FIT\n"); load.priv = NULL; + load.bl_len = 1; load.read = spl_fit_ram_read;
err = spl_load_simple_fit(&load, (ulong)filename, header); diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index 1139526..558be7b 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -187,6 +187,9 @@ NETARGS \ DFUARGS \ BOOTENV +#else +#define CONFIG_EXTRA_ENV_SETTINGS \ + DFUARGS #endif
/* NS16550 Configuration */ @@ -297,12 +300,14 @@ #define CONFIG_AM335X_USB1_MODE MUSB_HOST
#ifndef CONFIG_SPL_USBETH_SUPPORT +#ifndef CONFIG_SPL_DFU /* Fastboot */ #define CONFIG_USB_FUNCTION_FASTBOOT #define CONFIG_CMD_FASTBOOT #define CONFIG_ANDROID_BOOT_IMAGE #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR #define CONFIG_FASTBOOT_BUF_SIZE 0x07000000 +#endif
/* To support eMMC booting */ #define CONFIG_STORAGE_EMMC @@ -314,9 +319,11 @@ #endif
#ifdef CONFIG_USB_MUSB_GADGET +#ifndef CONFIG_SPL_DFU #define CONFIG_USB_ETHER #define CONFIG_USB_ETH_RNDIS #define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00" +#endif #endif /* CONFIG_USB_MUSB_GADGET */
/* @@ -348,9 +355,9 @@ #endif
/* USB Device Firmware Update support */ -#ifndef CONFIG_SPL_BUILD #define CONFIG_USB_FUNCTION_DFU #define CONFIG_DFU_MMC +#define CONFIG_DFU_RAM #define DFU_ALT_INFO_MMC \ "dfu_alt_info_mmc=" \ "boot part 0 1;" \ @@ -364,6 +371,7 @@ "spl-os-image fat 0 1;" \ "u-boot.img fat 0 1;" \ "uEnv.txt fat 0 1\0" +#ifndef CONFIG_SPL_DFU #ifdef CONFIG_NAND #define CONFIG_DFU_NAND #define DFU_ALT_INFO_NAND \ @@ -379,17 +387,24 @@ #else #define DFU_ALT_INFO_NAND "" #endif +#endif #define CONFIG_DFU_RAM #define DFU_ALT_INFO_RAM \ "dfu_alt_info_ram=" \ "kernel ram 0x80200000 0xD80000;" \ "fdt ram 0x80F80000 0x80000;" \ "ramdisk ram 0x81000000 0x4000000\0" +#ifndef CONFIG_SPL_DFU #define DFUARGS \ "dfu_alt_info_emmc=rawemmc raw 0 3751936\0" \ DFU_ALT_INFO_MMC \ DFU_ALT_INFO_RAM \ DFU_ALT_INFO_NAND +#else +#define DFUARGS \ + "dfu_alt_info_emmc=rawemmc raw 0 3751936\0" \ + DFU_ALT_INFO_MMC \ + DFU_ALT_INFO_RAM #endif
/*