ubispl: add support for loading volumes by name
authorHamish Guthrie <hamish.guthrie@kistler.com>
Wed, 15 May 2019 13:15:59 +0000 (15:15 +0200)
committerHeiko Schocher <hs@denx.de>
Tue, 9 Jul 2019 05:00:25 +0000 (07:00 +0200)
commit6ea31cce0b63398e2a5228d685175bbc63e9072c
treec2c228967160253bdbc3413abac1e6ab4faf9add
parent4bae76d7331cf959af2c35254260476d098d2846
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 <hamish.guthrie@kistler.com>
Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kmpark@infradead.org>
common/spl/Kconfig
common/spl/spl_ubi.c
drivers/mtd/ubispl/ubispl.c
drivers/mtd/ubispl/ubispl.h
include/ubispl.h