libpayload: Take flash parameters from coreboot

Hardware / Coreboot - Dan Ehrenberg [chromium.org] - 17 April 2015 02:21 UTC

A payload may want to run erase operations on SPI NOR flash without re-probing the device to get its properties. This patch passes up three properties of flash to achieve that:- The size of the flash device- The sector size, i.e., the granularity of erase- The command used for erase The patch sends the parameters through coreboot and then libpayload. The patch also includes a minor refactoring of the flash erase code. Parameters are sent up for just one flash device. If multiple SPI flash devices are probed, the second one will "win" and its parameters will be sent up to the payload.

TEST=Observed parameters to be passed up to depthcharge through libpayload and be used to correctly initialize flash and do an erase. TEST=Winbond and Gigadevices spi flash drivers compile with the changes; others don't, for seemingly unrelated reasons. BRANCH=none BUG=chromium:446377

Change-Id: I92b7ff0ce66af8d096ec09a4c900829ef6c867e0

6addd40 libpayload: Take flash parameters from coreboot
payloads/libpayload/include/coreboot_tables.h | 9 +++++++++
payloads/libpayload/include/sysinfo.h | 5 +++++
payloads/libpayload/libc/coreboot.c | 12 ++++++++++++
3 files changed, 26 insertions(+)

Upstream: review.coreboot.org


  • Share