From patchwork Tue Feb 9 12:45:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [tiU20.01, 1/2] configs: j721e_evm: Add configs to support DFU boot mode Date: Tue, 09 Feb 2021 18:45:33 -0000 From: Aswath Govindraju X-Patchwork-Id: 59279 Message-Id: <20210209124534.17539-2-a-govindraju@ti.com> Cc: , Praneeth Bajjuri , Lokesh Vutla , Vignesh Raghavendra , Kishon Vijay Abraham I , Pratyush Yadav , Aswath Govindraju On J721e R5 SPL, dfu buffer for loading sysfw.itb image gets allocated before DRAM gets initialized. So, the buffer gets allocated in MCU L3 RAM. The current buffer size to be allocated is 256KB and the available total heap memory is 0x70000 (448KB). This leads to NOMEM errors during allocation. Also, if CONFIG_SYS_DFU_DATA_BUF_SIZE is defined and CONFIG_SYS_DFU_MAX_FILE_SIZE is not defined then in include/dfu.h, the max file size for dfu transfer is defined as CONFIG_SYS_DFU_DATA_BUF_SIZE. Fix these by reducing the dfu buffer size to be allocated in R5 SPL and defining the max file size as 8 MB which is the default dfu buffer size. Signed-off-by: Aswath Govindraju Acked-by: Pratyush Yadav --- include/configs/j721e_evm.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h index 8a9551316846..620728a18b95 100644 --- a/include/configs/j721e_evm.h +++ b/include/configs/j721e_evm.h @@ -51,6 +51,25 @@ /* Image load address in RAM for DFU boot*/ #endif +#if defined(CONFIG_TARGET_J721E_R5_EVM) +/* + * The dfu buffer is allocated for downloading sysfw.itb. + * This limits the allocation to MCU L3 RAM as DRAM is initialized later. + * The total heap memory available is 0x70000 bytes. So, reduce + * the buffer size to avoid NOMEM error. + */ +#define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x5000 +#else +/* Set default dfu buffer size to 256KB (sector size of OSPI) */ +#define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x40000 +#endif + +/* + * If the maximum size is not declared then it is defined as + * CONFIG_SYS_DFU_DATA_BUF_SIZE. + */ +#define CONFIG_SYS_DFU_MAX_FILE_SIZE (1024 * 1024 * 8) /* 8 MiB */ + #ifdef CONFIG_SYS_K3_SPL_ATF #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "tispl.bin" #endif @@ -156,9 +175,7 @@ #define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY #endif -/* set default dfu_bufsiz to 128KB (sector size of OSPI) */ #define EXTRA_ENV_DFUARGS \ - "dfu_bufsiz=0x40000\0" \ DFU_ALT_INFO_MMC \ DFU_ALT_INFO_EMMC \ DFU_ALT_INFO_RAM \