aboutsummaryrefslogtreecommitdiff
path: root/libflash/libffs.c
diff options
context:
space:
mode:
authorMichael Tritz <mtritz@us.ibm.com>2017-07-12 15:31:49 -0500
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-07-19 15:49:39 +1000
commitf2c87a3d2f6df0886124636239d9950ef0abcab0 (patch)
treef696ffe06dc199d5f339f9a0e14ba034002a27f9 /libflash/libffs.c
parenteae86789c72e61288514eace206588d9d1633a25 (diff)
downloadskiboot-f2c87a3d2f6df0886124636239d9950ef0abcab0.zip
skiboot-f2c87a3d2f6df0886124636239d9950ef0abcab0.tar.gz
skiboot-f2c87a3d2f6df0886124636239d9950ef0abcab0.tar.bz2
pflash option to retrieve PNOR partition flags
This commit extends pflash with an option to retrieve and print information for a particular partition, including the content from "pflash -i" and a verbose list of set miscellaneous flags. -i option is also updated to print a short list of flags in addition to the ECC flag, with one character per flag. A test of the new option is included in libflash/test. Signed-off-by: Michael Tritz <mtritz@us.ibm.com> Reviewed-by: Cyril Bur <cyril.bur@au1.ibm.com> [stewart@linux.vnet.ibm.com: various test fixes, enable gcov] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash/libffs.c')
-rw-r--r--libflash/libffs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libflash/libffs.c b/libflash/libffs.c
index 9b940ec..754245f 100644
--- a/libflash/libffs.c
+++ b/libflash/libffs.c
@@ -188,7 +188,12 @@ static int ffs_entry_to_cpu(struct ffs_hdr *hdr,
return rc;
}
-static struct ffs_entry *ffs_get_part(struct ffs_handle *ffs, uint32_t index)
+bool has_flag(struct ffs_entry *ent, uint16_t flag)
+{
+ return ((ent->user.miscflags & flag) != 0);
+}
+
+struct ffs_entry *ffs_entry_get(struct ffs_handle *ffs, uint32_t index)
{
int i = 0;
struct ffs_entry *ent = NULL;
@@ -379,7 +384,7 @@ int ffs_part_info(struct ffs_handle *ffs, uint32_t part_idx,
struct ffs_entry *ent;
char *n;
- ent = ffs_get_part(ffs, part_idx);
+ ent = ffs_entry_get(ffs, part_idx);
if (!ent)
return FFS_ERR_PART_NOT_FOUND;
@@ -794,7 +799,7 @@ int ffs_update_act_size(struct ffs_handle *ffs, uint32_t part_idx,
uint32_t offset;
int rc;
- ent = ffs_get_part(ffs, part_idx);
+ ent = ffs_entry_get(ffs, part_idx);
if (!ent) {
FL_DBG("FFS: Entry not found\n");
return FFS_ERR_PART_NOT_FOUND;