[Skiboot] [PATCH v2 4/6] external/pflash: show the partitions on the second side flash

Alistair Popple alistair at popple.id.au
Fri May 22 12:23:07 AEST 2015


On Thu, 14 May 2015 12:02:37 Cyril Bur wrote:
> Currently pflash is unaware that that some platforms can have two sides of
> flash and therefore doesn't include the ability to print it.
> 
> The ffs TOC at the start of the flash may contain a partition called
> "OTHER_SIDE" which will start with the TOC for the second side. If
> OTHER_SIDE is found pflash will dump that flash information too.
> 
> Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>

<snip>

> ---
>  external/pflash/pflash.c | 52
>  	}
> +
> +	ffs_close(ffs_handle);
> +
> +	if (other_side_offset)
> +		print_ffs_info(other_side_offset);

This looks like it relies on the OTHER_SIDE partition offset eventually 
pointing to 0 to avoid infinite recursion.

Patrick can you confirm that if we follow the OTHER_SIDE TOC entries we will 
eventually find one that points back to a TOC at offset 0? Is there ever going 
to be a setup where this isn't the case?

> +}
> +
> +
> +static void print_flash_info(void)
> +{
> +	printf("Flash info:\n");
> +	printf("-----------\n");
> +	printf("Name          = %s\n", fl_name);
> +	printf("Total size    = %dMB \n", fl_total_size >> 20);
> +	printf("Erase granule = %dKB \n", fl_erase_granule >> 10);
> +
> +	if (bmc_flash)
> +		return;
> +
> +	print_ffs_info(0);
>  }
> 
>  static void lookup_partition(const char *name)



More information about the Skiboot mailing list