@@ -117,7 +117,7 @@ static int flash_nvram_probe(struct flash *flash, struct ffs_handle *ffs)
}
rc = ffs_part_info(ffs, part, NULL,
- &start, &size, NULL);
+ &start, &size, NULL, NULL);
if (rc) {
prlog(PR_ERR, "FLASH: Can't parse ffs info for NVRAM\n");
return OPAL_HARDWARE;
@@ -172,7 +172,7 @@ static void flash_add_dt_node(struct flash *flash, int id,
char *name;
int rc;
- rc = ffs_part_info(ffs, i, &name, &start, NULL, &size);
+ rc = ffs_part_info(ffs, i, &name, &start, NULL, &size, NULL);
if (rc)
break;
@@ -483,7 +483,7 @@ bool flash_load_resource(enum resource_id id, uint32_t subid,
goto out_free_ffs;
}
rc = ffs_part_info(ffs, part_num, NULL,
- &part_start, &part_size, NULL);
+ &part_start, &part_size, NULL, NULL);
if (rc) {
prerror("FLASH: Failed to get %s partition info\n", name);
goto out_free_ffs;
@@ -101,7 +101,7 @@ static void print_flash_info(void)
uint32_t start, size, act, end;
char *name;
- rc = ffs_part_info(ffsh, i, &name, &start, &size, &act);
+ rc = ffs_part_info(ffsh, i, &name, &start, &size, &act, NULL);
if (rc == FFS_ERR_PART_NOT_FOUND)
break;
if (rc) {
@@ -723,7 +723,7 @@ int main(int argc, char *argv[])
int rc;
rc = ffs_part_info(ffsh, ffs_index, NULL,
- &pstart, &pmaxsz, &pactsize);
+ &pstart, &pmaxsz, &pactsize, NULL);
if (rc) {
fprintf(stderr,"Failed to get partition info\n");
exit(1);
@@ -215,7 +215,7 @@ int ffs_lookup_part(struct ffs_handle *ffs, const char *name,
int ffs_part_info(struct ffs_handle *ffs, uint32_t part_idx,
char **name, uint32_t *start,
- uint32_t *total_size, uint32_t *act_size)
+ uint32_t *total_size, uint32_t *act_size, bool *ecc)
{
struct ffs_entry *raw_ent;
struct ffs_entry ent;
@@ -240,6 +240,9 @@ int ffs_part_info(struct ffs_handle *ffs, uint32_t part_idx,
*total_size = ent.size * ffs->hdr.block_size;
if (act_size)
*act_size = ent.actual;
+ if (ecc)
+ *ecc = ((ent.user.datainteg & FFS_ENRY_INTEG_ECC) != 0);
+
if (name) {
n = malloc(PART_NAME_MAX + 1);
memset(n, 0, PART_NAME_MAX + 1);
@@ -47,7 +47,7 @@ int ffs_lookup_part(struct ffs_handle *ffs, const char *name,
int ffs_part_info(struct ffs_handle *ffs, uint32_t part_idx,
char **name, uint32_t *start,
- uint32_t *total_size, uint32_t *act_size);
+ uint32_t *total_size, uint32_t *act_size, bool *ecc);
int ffs_update_act_size(struct ffs_handle *ffs, uint32_t part_idx,
uint32_t act_size);
Add ecc parmenter to ffs_part_info() to indicate if the partition is ECC protected or not. Fix all call sites. Signed-off-by: Michael Neuling <mikey@neuling.org> --- core/flash.c | 6 +++--- external/pflash/pflash.c | 4 ++-- libflash/libffs.c | 5 ++++- libflash/libffs.h | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-)