[Skiboot] [PATCH 1/4] external/pflash: report if a flash partition is ECC protected

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue May 12 14:27:28 AEST 2015


On Fri, 2015-05-08 at 17:58 +1000, Cyril Bur wrote:
> Currently pflash doesn't display if a flash partition contains ECC bits or not
> when dumping the flash layout.  libffs has all this information it's just that
> pflash doesn't relay it.
> 
> Trivial change to add to the information pflash prints about each partition
> 
> Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>

When-below-fixed-Acked-by: Benjamin Herrenschmidt
<benh at kernel.crashing.org>

> ---
>  external/pflash/pflash.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/external/pflash/pflash.c b/external/pflash/pflash.c
> index fb783a2..d6f46d3 100644
> --- a/external/pflash/pflash.c
> +++ b/external/pflash/pflash.c
> @@ -99,9 +99,10 @@ static void print_flash_info(void)
>  
>  	for (i = 0;; i++) {
>  		uint32_t start, size, act, end;
> +		bool ecc;
>  		char *name;
>  
> -		rc = ffs_part_info(ffsh, i, &name, &start, &size, &act, NULL);
> +		rc = ffs_part_info(ffsh, i, &name, &start, &size, &act, &ecc);
>  		if (rc == FFS_ERR_PART_NOT_FOUND)
>  			break;
>  		if (rc) {
> @@ -109,8 +110,12 @@ static void print_flash_info(void)
>  			break;
>  		}
>  		end = start + size;
> -		printf("ID=%02d %15s %08x..%08x (actual=%08x)\n",
> -		       i, name, start, end, act);
> +		printf("ID=%02d %15s %08x..%08x (actual=%08x) %s\n",
> +		       i, name, start, end, act, ecc ? "[ECC]" : "");
> +
> +		if (strcmp(name, "OTHER_SIDE") == 0)
> +			other_side_offset = start;
> +

This hunk should be in the next patch :-)

>  		free(name);
>  	}
>  }




More information about the Skiboot mailing list