diff options
author | Rui Miguel Silva <rui.silva@linaro.org> | 2019-12-20 16:24:56 +0000 |
---|---|---|
committer | Tushar Khandelwal <tushar.khandelwal@arm.com> | 2020-01-24 14:41:28 +0000 |
commit | 2943834dd37680f452bd4a23d96dd485c2cf8b40 (patch) | |
tree | 2a28762517853ef155a17813dc9b16496984fc11 | |
parent | 4c7cef28fcd5cec92ad24ce010efa1eca02dce82 (diff) |
use CramFS XIP file Magic in place of CPIO
Removing copying the rootfs to SRAM.
Because the rootfs is a CramFS XIP filesystem
stored in flash, there is no need to copy
it to DDR.
Change-Id: I706d709050ae98a9b07fc00bb97c1d824f9399e6
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
-rw-r--r-- | module/host_boot/include/mod_host_boot.h | 3 | ||||
-rwxr-xr-x | module/host_boot/src/mod_host_boot.c | 16 |
2 files changed, 5 insertions, 14 deletions
diff --git a/module/host_boot/include/mod_host_boot.h b/module/host_boot/include/mod_host_boot.h index ea9fd67..d7fe0c4 100644 --- a/module/host_boot/include/mod_host_boot.h +++ b/module/host_boot/include/mod_host_boot.h @@ -20,7 +20,8 @@ struct se_host_config { }; -#define GZIP_MAGIC 0x8B1F +#define CRAMFS_XIP_MAGIC 0x3D45 + /*! * @} */ diff --git a/module/host_boot/src/mod_host_boot.c b/module/host_boot/src/mod_host_boot.c index e447da2..8dc0db3 100755 --- a/module/host_boot/src/mod_host_boot.c +++ b/module/host_boot/src/mod_host_boot.c @@ -134,21 +134,11 @@ static int load_host_images(void) return FWK_E_DATA; } - /* copy rootfs image from FLASH to SRAM, currently only cpio.gzip format - is supported. - TODO: 4MB of data is copied but once we migrate from SPIToC to GPT we - will copy only till end of file. - */ + /* check for valid rootfs image from FLASH */ rootfs_magic = *((uint16_t*)ROOTFS_FLASH_BASE); - if (rootfs_magic == GZIP_MAGIC) { + if (rootfs_magic != CRAMFS_XIP_MAGIC) { host_ctx.log_api->log(MOD_LOG_GROUP_INFO, - "[RAM] Loading Root FS at 0x%x\n", - (void *) HOST_ROOTFS_BASE); - memcpy((void*) HOST_ROOTFS_BASE, (void*) ROOTFS_FLASH_BASE, - HOST_ROOTFS_SIZE); - } else { - host_ctx.log_api->log(MOD_LOG_GROUP_INFO, - "[RAM] No valid rootfs found. Abort Host BOOT!\n"); + "[FLASH] No valid rootfs found. Abort Host BOOT!\n"); return FWK_E_DATA; } return FWK_SUCCESS; |