mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: soc/intel/apollolake: Implement SPI flash status register read
This was a dummy implementation until now which returned -1 always. Add support for reading SPI flash status register (srp0). BUG=chrome-os-partner:59267 BRANCH=None TEST=Verified by enabling and disabling write-protect on reef that the value of SRP0 changes accordingly in status register read. Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/17205 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Change-Id: Ib1349605dd87c4a087e416f52a8256b1eaac4f4c Reviewed-on: https://chromium-review.googlesource.com/407195 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
428873a5aa
commit
25d0564ecb
1 changed files with 10 additions and 2 deletions
|
@ -313,8 +313,16 @@ static int nuclear_spi_write(struct spi_flash *flash,
|
|||
|
||||
static int nuclear_spi_status(struct spi_flash *flash, uint8_t *reg)
|
||||
{
|
||||
printk(BIOS_DEBUG, "NOT IMPLEMENTED: %s() !!!\n", __func__);
|
||||
return E_NOT_IMPLEMENTED;
|
||||
int ret;
|
||||
BOILERPLATE_CREATE_CTX(ctx);
|
||||
|
||||
ret = exec_sync_hwseq_xfer(ctx, SPIBAR_HSFSTS_CYCLE_RD_STATUS, 0,
|
||||
sizeof(*reg));
|
||||
if (ret != SUCCESS)
|
||||
return ret;
|
||||
|
||||
drain_xfer_fifo(ctx, reg, sizeof(*reg));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct spi_slave boot_spi CAR_GLOBAL;
|
||||
|
|
Loading…
Add table
Reference in a new issue