From 6ea31cce0b63398e2a5228d685175bbc63e9072c Mon Sep 17 00:00:00 2001 From: Hamish Guthrie Date: Wed, 15 May 2019 15:15:59 +0200 Subject: ubispl: add support for loading volumes by name The motivation is to use the UBI atomic volume rename functionality to allow double copy software updates on UBI. To that end the SPL is configured to always load the same volume name (e.g. "u-boot"), whereas a software updater always installs into the secondary volume "u-boot_r". After successful installation, these two volume names are switched. This extension is protected by #ifdefs as it will somewhat slow down loading of volumes by id. This is because the code needs to disable the optimization of ignoring all volume ids which are not to-be-loaded, since these can only be resolved after attaching. This adds two vtbl related functions from Linux, which are taken from the same kernel version as the current main U-Boot UBI code (Linux 4.2 64291f7db5bd8). Signed-off-by: Hamish Guthrie Signed-off-by: Markus Klotzbuecher Reviewed-by: Heiko Schocher Cc: Kyungmin Park --- include/ubispl.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/ubispl.h b/include/ubispl.h index 1e5da94eb1f..ecfe0c93c13 100644 --- a/include/ubispl.h +++ b/include/ubispl.h @@ -5,6 +5,8 @@ #ifndef __UBOOT_UBISPL_H #define __UBOOT_UBISPL_H +#define UBI_VOL_NAME_MAX 127 + /* * The following CONFIG options are relevant for UBISPL * @@ -74,6 +76,10 @@ struct ubispl_info { */ struct ubispl_load { int vol_id; +#ifdef CONFIG_SPL_UBI_LOAD_BY_VOLNAME + u32 name_len; + char name[UBI_VOL_NAME_MAX + 1]; +#endif void *load_addr; }; -- cgit v1.2.3