[Skiboot] [PATCH v2 2/6] libffs: add the offset of the TOC to partition entry addresses

Cyril Bur cyril.bur at au1.ibm.com
Thu May 14 12:02:35 AEST 2015


The accessor for ffs partition entries should be adding the offset of the TOC
to the absolute address of the partition entries as the TOC is not necessarily
at 0 within in the flash.

Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 libflash/libffs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libflash/libffs.c b/libflash/libffs.c
index 1f5cd94..55e6895 100644
--- a/libflash/libffs.c
+++ b/libflash/libffs.c
@@ -244,7 +244,7 @@ static struct ffs_entry *ffs_get_part(struct ffs_handle *ffs, uint32_t index,
 	if (index > ffs->hdr.entry_count)
 		return NULL;
 	if (out_offset)
-		*out_offset = offset;
+		*out_offset = ffs->toc_offset + offset;
 	return (struct ffs_entry *)(ffs->cache + offset);
 }
 
-- 
1.9.1



More information about the Skiboot mailing list