UPSTREAM: spi: Get rid of flash_programmer_probe in spi_slave structure

flash_programmer_probe is a property of the spi flash driver and does
not belong in the spi_slave structure. Thus, make
spi_flash_programmer_probe a callback from the spi_flash_probe
function. Logic still remains the same as before (order matters):
1. Try spi_flash_programmer_probe without force option
2. Try generic flash probing
3. Try spi_flash_programmer_probe with force option

If none of the above steps work, fail probing. Flash controller is
expected to honor force option to decide whether to perform specialized
probing or to defer to generic probing.

BUG=None
BRANCH=None
TEST=Compiles successfully

Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/17465
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>

Change-Id: I4163593eea034fa044ec2216e56d0ea3fbc86c7d
Reviewed-on: https://chromium-review.googlesource.com/415056
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Furquan Shaikh 2016-11-17 20:38:07 -08:00 committed by chrome-bot
commit b6e6fbc554
9 changed files with 65 additions and 53 deletions

View file

@ -354,7 +354,7 @@ static struct spi_flash boot_flash CAR_GLOBAL;
* The size of the flash component is always taken from density field in the
* SFDP table. FLCOMP.C0DEN is no longer used by the Flash Controller.
*/
static struct spi_flash *nuclear_flash_probe(struct spi_slave *spi)
struct spi_flash *spi_flash_programmer_probe(struct spi_slave *spi, int force)
{
BOILERPLATE_CREATE_CTX(ctx);
struct spi_flash *flash;
@ -403,8 +403,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
slave->bus = bus;
slave->cs = cs;
slave->programmer_specific_probe = nuclear_flash_probe;
slave->force_programmer_specific = 1;
return slave;
}

View file

@ -345,7 +345,7 @@ int pch_hwseq_read_status(const struct spi_flash *flash, u8 *reg)
static struct spi_slave boot_spi CAR_GLOBAL;
static struct spi_flash boot_flash CAR_GLOBAL;
static struct spi_flash *spi_flash_hwseq_probe(struct spi_slave *spi)
struct spi_flash *spi_flash_programmer_probe(struct spi_slave *spi, int force)
{
struct spi_flash *flash;
@ -380,8 +380,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
slave->bus = bus;
slave->cs = cs;
slave->force_programmer_specific = 1;
slave->programmer_specific_probe = spi_flash_hwseq_probe;
return slave;
}