drivers/spi/spi_flash: organize spi flash by sector topology
By grouping the spi flash parts by their {vendor, sector topology}
tuple one can use a common probe function for looking up the part
instead of having per-vendor probe functions. Additionally, by
grouping by the command set one can save more space as well. SST
is the exception that requires after_probe() function to unlock the
parts.
2KiB of savings in each of verstage, romstage, and ramstage
on Aleena Chrome OS Build.
Change-Id: I9cc20ca0f3d0a1b97154b000c95ff2e7e87f3375
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38379
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
			
			
This commit is contained in:
		@@ -91,6 +91,8 @@ struct spi_flash_protection_ops {
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct spi_flash_part_id;
 | 
			
		||||
 | 
			
		||||
struct spi_flash {
 | 
			
		||||
	struct spi_slave spi;
 | 
			
		||||
	u8 vendor;
 | 
			
		||||
@@ -113,6 +115,7 @@ struct spi_flash {
 | 
			
		||||
	const struct spi_flash_ops *ops;
 | 
			
		||||
	/* If !NULL all protection callbacks exist. */
 | 
			
		||||
	const struct spi_flash_protection_ops *prot_ops;
 | 
			
		||||
	const struct spi_flash_part_id *part;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void lb_spi_flash(struct lb_header *header);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user