Message ID | 1464356373-8375-6-git-send-email-ravibabu@ti.com |
---|---|
State | Accepted |
Delegated to: | Tom Rini |
Headers | show |
Hi Ravi, > Adding SPL-DFU support for dra7x platform. The DFU > support for dra7x includes QSPI, MMC/SD and eMMC > memory devices. The SPL-DFU memory devices can be > selected through meunconfig->Boot Images. > > Signed-off-by: Ravi Babu <ravibabu@ti.com> > --- > board/ti/dra7xx/evm.c | 20 ++++++++++++++++++++ > include/configs/dra7xx_evm.h | 3 +-- > include/configs/ti_omap5_common.h | 2 -- > 3 files changed, 21 insertions(+), 4 deletions(-) > > diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c > index f194999..0ce0e97 100644 > --- a/board/ti/dra7xx/evm.c > +++ b/board/ti/dra7xx/evm.c > @@ -30,6 +30,7 @@ > #include <miiphy.h> > #include <spl.h> > #include <pcf8575.h> > +#include <dfu.h> > > #include "mux_data.h" > #include "../common/board_detect.h" > @@ -619,6 +620,25 @@ int spl_start_uboot(void) > } > #endif > > +#ifdef CONFIG_SPL_DFU > +int spl_run_dfu(void) > +{ > +#ifdef CONFIG_SPL_DFU_EMMC > + return dfu_run_mmc(0, 1, "dfu_alt_info_emmc"); Maybe dfu_run_mmc() -> dfu_spl_flash_mmc()? Which would be dfu tunned command with minimal space footprint? > +#endif > + > +#ifdef CONFIG_SPL_DFU_MMC > + return dfu_run_mmc(0, 0, "dfu_alt_info_mmc"); > +#endif > + > +#ifdef CONFIG_SPL_DFU > + return dfu_run_cmd("dfu_alt_info_qspi", > + "dfu 0 sf 0:0:64000000:0"); I do feel like running commands in SPL context is the overkill. However, I do not know what would be the SPL binary size reduction if we re-implement the dfu_run_cmd() as a set of dedicated commands (like dfu_spl_flash_sf(0, X, <sf proper alt setting @ envs>, dfu_spl_flash_nand(0, X, <nand proper alt setting @ envs>), etc.). If the difference is minimal, then we could leave dfu_run_cmd() in the presented form. As I've asked previously - what is the u-boot SPL binary size increase after adding DFU SPL support to your platform? > +#endif > + return 0; > +} > +#endif > + > #ifdef CONFIG_DRIVER_TI_CPSW > extern u32 *const omap_si_rev; > > diff --git a/include/configs/dra7xx_evm.h > b/include/configs/dra7xx_evm.h index da84f1c..ec10cd8 100644 > --- a/include/configs/dra7xx_evm.h > +++ b/include/configs/dra7xx_evm.h > @@ -44,7 +44,6 @@ > > #define CONFIG_SYS_OMAP_ABE_SYSCK > > -#ifndef CONFIG_SPL_BUILD > /* Define the default GPT table for eMMC */ > #define PARTS_DEFAULT \ > /* Linux partitions */ \ > @@ -122,6 +121,7 @@ > DFU_ALT_INFO_QSPI > > /* Fastboot */ > +#ifndef CONFIG_SPL_BUILD > #define CONFIG_USB_FUNCTION_FASTBOOT > #define CONFIG_CMD_FASTBOOT > #define CONFIG_ANDROID_BOOT_IMAGE > @@ -331,5 +331,4 @@ > /* pcf support */ > #define CONFIG_PCF8575 > #define CONFIG_SYS_I2C_PCF8575_CHIP { {0x21, 0xeaf7} } > - > #endif /* __CONFIG_DRA7XX_EVM_H */ > diff --git a/include/configs/ti_omap5_common.h > b/include/configs/ti_omap5_common.h index 59f0f70..f9c6576 100644 > --- a/include/configs/ti_omap5_common.h > +++ b/include/configs/ti_omap5_common.h > @@ -66,7 +66,6 @@ > #define DFUARGS > #endif > > -#ifndef CONFIG_SPL_BUILD > #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG > #define CONFIG_EXTRA_ENV_SETTINGS \ > DEFAULT_LINUX_BOOT_ENV \ > @@ -136,7 +135,6 @@ > "setenv mmcroot /dev/mmcblk0p2 rw; " \ > "run mmcboot;" \ > "" > -#endif > > /* > * SPL related defines. The Public RAM memory map the ROM defines > the
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index f194999..0ce0e97 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -30,6 +30,7 @@ #include <miiphy.h> #include <spl.h> #include <pcf8575.h> +#include <dfu.h> #include "mux_data.h" #include "../common/board_detect.h" @@ -619,6 +620,25 @@ int spl_start_uboot(void) } #endif +#ifdef CONFIG_SPL_DFU +int spl_run_dfu(void) +{ +#ifdef CONFIG_SPL_DFU_EMMC + return dfu_run_mmc(0, 1, "dfu_alt_info_emmc"); +#endif + +#ifdef CONFIG_SPL_DFU_MMC + return dfu_run_mmc(0, 0, "dfu_alt_info_mmc"); +#endif + +#ifdef CONFIG_SPL_DFU + return dfu_run_cmd("dfu_alt_info_qspi", + "dfu 0 sf 0:0:64000000:0"); +#endif + return 0; +} +#endif + #ifdef CONFIG_DRIVER_TI_CPSW extern u32 *const omap_si_rev; diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index da84f1c..ec10cd8 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -44,7 +44,6 @@ #define CONFIG_SYS_OMAP_ABE_SYSCK -#ifndef CONFIG_SPL_BUILD /* Define the default GPT table for eMMC */ #define PARTS_DEFAULT \ /* Linux partitions */ \ @@ -122,6 +121,7 @@ DFU_ALT_INFO_QSPI /* Fastboot */ +#ifndef CONFIG_SPL_BUILD #define CONFIG_USB_FUNCTION_FASTBOOT #define CONFIG_CMD_FASTBOOT #define CONFIG_ANDROID_BOOT_IMAGE @@ -331,5 +331,4 @@ /* pcf support */ #define CONFIG_PCF8575 #define CONFIG_SYS_I2C_PCF8575_CHIP { {0x21, 0xeaf7} } - #endif /* __CONFIG_DRA7XX_EVM_H */ diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h index 59f0f70..f9c6576 100644 --- a/include/configs/ti_omap5_common.h +++ b/include/configs/ti_omap5_common.h @@ -66,7 +66,6 @@ #define DFUARGS #endif -#ifndef CONFIG_SPL_BUILD #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define CONFIG_EXTRA_ENV_SETTINGS \ DEFAULT_LINUX_BOOT_ENV \ @@ -136,7 +135,6 @@ "setenv mmcroot /dev/mmcblk0p2 rw; " \ "run mmcboot;" \ "" -#endif /* * SPL related defines. The Public RAM memory map the ROM defines the
Adding SPL-DFU support for dra7x platform. The DFU support for dra7x includes QSPI, MMC/SD and eMMC memory devices. The SPL-DFU memory devices can be selected through meunconfig->Boot Images. Signed-off-by: Ravi Babu <ravibabu@ti.com> --- board/ti/dra7xx/evm.c | 20 ++++++++++++++++++++ include/configs/dra7xx_evm.h | 3 +-- include/configs/ti_omap5_common.h | 2 -- 3 files changed, 21 insertions(+), 4 deletions(-)