summaryrefslogtreecommitdiffstats
path: root/arch/x86/cpu/ivybridge/mrccache.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-03-26 09:29:26 -0600
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:14 -0600
commitba4575626eddef71b5a8dc26dc4b267918b9438c (patch)
tree60e47b89a76b5d69b41669a4afeb653ec02f8525 /arch/x86/cpu/ivybridge/mrccache.c
parent8d987abc6a8553454b0b602b46a5dc09a4687110 (diff)
downloadtalos-obmc-uboot-ba4575626eddef71b5a8dc26dc4b267918b9438c.tar.gz
talos-obmc-uboot-ba4575626eddef71b5a8dc26dc4b267918b9438c.zip
dm: x86: spi: Convert ICH SPI driver to driver model
Convert this driver over to use driver model. Since all x86 platforms use it, move x86 to use driver model for SPI and SPI flash. Adjust all dependent code and remove the old x86 spi_init() function. Note that this does not make full use of the new PCI uclass as yet. We still scan the bus looking for the device. It should move to finding its details in the device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/cpu/ivybridge/mrccache.c')
-rw-r--r--arch/x86/cpu/ivybridge/mrccache.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/cpu/ivybridge/mrccache.c b/arch/x86/cpu/ivybridge/mrccache.c
index 0f1a64b268..92054948eb 100644
--- a/arch/x86/cpu/ivybridge/mrccache.c
+++ b/arch/x86/cpu/ivybridge/mrccache.c
@@ -105,7 +105,7 @@ static struct mrc_data_container *find_next_mrc_cache(struct fmap_entry *entry,
return cache;
}
-int mrccache_update(struct spi_flash *sf, struct fmap_entry *entry,
+int mrccache_update(struct udevice *sf, struct fmap_entry *entry,
struct mrc_data_container *cur)
{
struct mrc_data_container *cache;
@@ -135,7 +135,7 @@ int mrccache_update(struct spi_flash *sf, struct fmap_entry *entry,
debug("Erasing the MRC cache region of %x bytes at %x\n",
entry->length, entry->offset);
- ret = spi_flash_erase(sf, entry->offset, entry->length);
+ ret = spi_flash_erase_dm(sf, entry->offset, entry->length);
if (ret) {
debug("Failed to erase flash region\n");
return ret;
@@ -146,7 +146,8 @@ int mrccache_update(struct spi_flash *sf, struct fmap_entry *entry,
/* Write the data out */
offset = (ulong)cache - base_addr + entry->offset;
debug("Write MRC cache update to flash at %lx\n", offset);
- ret = spi_flash_write(sf, offset, cur->data_size + sizeof(*cur), cur);
+ ret = spi_flash_write_dm(sf, offset, cur->data_size + sizeof(*cur),
+ cur);
if (ret) {
debug("Failed to write to SPI flash\n");
return ret;
OpenPOWER on IntegriCloud