From 95d8edadcb33cad63460db1176ab565d087f4930 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 6 Nov 2024 01:57:18 +0100 Subject: drivers/spi: add RPMC info to spi_flash struct Fill 'rpmc_caps' struct inside the 'spi_flash' struct with the RPMC info from the SFDP table. TEST=On a board with a W74M12JW SPI flash chip, the 'rpmc_caps' struct has the expected entries (RPMC available, OP2 extended status as polling method, 4 RPMC counters, OP1 is 0x9b, and OP2 is 0x96). Signed-off-by: Felix Held Change-Id: I3a8332bffe93e1691f6fc87c3936025f158f3ab9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/85009 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier Reviewed-by: Martin Roth --- src/drivers/spi/spi_flash.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/drivers/spi/spi_flash.c') diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c index 6ecd29f773..b7a024c4c2 100644 --- a/src/drivers/spi/spi_flash.c +++ b/src/drivers/spi/spi_flash.c @@ -569,6 +569,11 @@ int spi_flash_probe(unsigned int bus, unsigned int cs, struct spi_flash *flash) spi_flash_cmd(&flash->spi, CMD_EXIT_4BYTE_ADDR_MODE, NULL, 0); } + /* TODO: only do this in stages that will need to call those functions? */ + if (CONFIG(SPI_FLASH_RPMC)) { + spi_flash_fill_rpmc_caps(flash); + } + return 0; } -- cgit v1.2.3