app: aboot: set current LUN before reading partition.
Set LUN before reading partition.
Change-Id: I241b3abf670138800add90959c639aab2a0aba05
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 504cb82..55b1181 100755
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -1032,6 +1032,7 @@
return ret;
}
buf = (char *) memalign(CACHE_LINE, ROUNDUP(page_size, CACHE_LINE));
+ mmc_set_lun(partition_get_lun(index));
ASSERT(buf);
if (mmc_read(offset, (uint32_t *)buf, page_size))
{
@@ -1968,6 +1969,9 @@
ptn_size = partition_get_size(index);
offset = ptn_size - blocksize;
+ /* Set Lun for partition */
+ mmc_set_lun(partition_get_lun(index));
+
if (mmc_read(ptn + offset, (void *)buf, blocksize))
{
dprintf(CRITICAL, "Reading MMC failed\n");
@@ -2002,6 +2006,7 @@
ptn = partition_get_offset(index);
ptn_size = partition_get_size(index);
offset = ptn_size - blocksize;
+ mmc_set_lun(partition_get_lun(index));
if (mmc_read(ptn + offset, (void *)buf, blocksize))
{
diff --git a/app/tests/kauth_test.c b/app/tests/kauth_test.c
index e92922e..a4c8d01 100644
--- a/app/tests/kauth_test.c
+++ b/app/tests/kauth_test.c
@@ -73,6 +73,7 @@
#if !VERIFIED_BOOT
index = partition_get_index("system");
ptn = partition_get_offset(index);
+ mmc_set_lun(partition_get_lun(index));
if(!ptn)
{