mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
spl: Add callbacks to invalidate cached devices
Several SPL functions try to avoid performing initialization twice by caching devices. This is fine for regular boot, but does not work with UNIT_TEST, since all devices are torn down after each test. Add some functions to invalidate the caches which can be called before testing these load methods. Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
@@ -20,6 +20,11 @@
|
||||
|
||||
static int fat_registered;
|
||||
|
||||
void spl_fat_force_reregister(void)
|
||||
{
|
||||
fat_registered = 0;
|
||||
}
|
||||
|
||||
static int spl_register_fat_device(struct blk_desc *block_dev, int partition)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@@ -403,13 +403,19 @@ static int spl_mmc_get_mmc_devnum(struct mmc *mmc)
|
||||
return block_dev->devnum;
|
||||
}
|
||||
|
||||
static struct mmc *mmc;
|
||||
|
||||
void spl_mmc_clear_cache(void)
|
||||
{
|
||||
mmc = NULL;
|
||||
}
|
||||
|
||||
int spl_mmc_load(struct spl_image_info *spl_image,
|
||||
struct spl_boot_device *bootdev,
|
||||
const char *filename,
|
||||
int raw_part,
|
||||
unsigned long raw_sect)
|
||||
{
|
||||
static struct mmc *mmc;
|
||||
u32 boot_mode;
|
||||
int err = 0;
|
||||
__maybe_unused int part = 0;
|
||||
|
||||
Reference in New Issue
Block a user