soc/intel/apollolake: Use the new SPI driver interface

1. Define controller for fast SPI.
2. Separate out functions that are specific to SPI and flash controller
in different files.

BUG=chrome-os-partner:59832
BRANCH=None
TEST=Compiles successfully for reef.

Change-Id: If07db9d27bbf4f4eb6024175cb7753c6cf4fb793
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/17562
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
This commit is contained in:
Furquan Shaikh
2016-11-21 12:41:20 -08:00
committed by Martin Roth
parent b5d41cb063
commit d6c555971b
8 changed files with 439 additions and 406 deletions

View File

@@ -28,6 +28,7 @@
#include <romstage_handoff.h>
#include <soc/iomap.h>
#include <soc/cpu.h>
#include <soc/flash_ctrlr.h>
#include <soc/intel/common/vbt.h>
#include <soc/itss.h>
#include <soc/nvs.h>
@@ -497,14 +498,14 @@ void platform_fsp_notify_status(enum fsp_notify_phase phase)
}
/*
* spi_init() needs to run unconditionally on every boot (including resume) to
* allow write protect to be disabled for eventlog and nvram updates. This needs
* to be done as early as possible in ramstage. Thus, add a callback for entry
* into BS_PRE_DEVICE.
* spi_flash init() needs to run unconditionally on every boot (including
* resume) to allow write protect to be disabled for eventlog and nvram
* updates. This needs to be done as early as possible in ramstage. Thus, add a
* callback for entry into BS_PRE_DEVICE.
*/
static void spi_init_cb(void *unused)
static void spi_flash_init_cb(void *unused)
{
spi_init();
spi_flash_init();
}
BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_ENTRY, spi_init_cb, NULL);
BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_ENTRY, spi_flash_init_cb, NULL);