summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8173/spi.c
diff options
context:
space:
mode:
authormtk05962 <bayi.cheng@mediatek.com>2015-10-16 13:42:49 +0800
committerPatrick Georgi <pgeorgi@google.com>2016-03-12 08:59:20 +0100
commita3f7fe8219654aa90ab2ea9458267e5136a03a01 (patch)
tree7fedcab8b44dfde41513f1e5f6133c4a7eeb9d5f /src/soc/mediatek/mt8173/spi.c
parentf14f640168ee0269b3c443cd2bba2fc8ee66e419 (diff)
downloadcoreboot-a3f7fe8219654aa90ab2ea9458267e5136a03a01.tar.xz
mt8173: add SPI NOR support
BRANCH=none BUG=none TEST=boot oak to kernel on rev1 Change-Id: I0773c81398df445aec16bcfcd0c5a8fe5a588b5c Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: ae15c42c2f7d9c2a716e5b6098d85e17279f5eae Original-Change-Id: I65abf810d35ae5e7156cf6f5730117e690183d18 Original-Signed-off-by: mtk05962 <bayi.cheng@mediatek.com> Original-Reviewed-on: https://chromium-review.googlesource.com/292693 Original-Commit-Ready: Yidi Lin <yidi.lin@mediatek.com> Original-Tested-by: Yidi Lin <yidi.lin@mediatek.com> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/13102 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/mediatek/mt8173/spi.c')
-rw-r--r--src/soc/mediatek/mt8173/spi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8173/spi.c b/src/soc/mediatek/mt8173/spi.c
index c3c71c3db2..dc674f371e 100644
--- a/src/soc/mediatek/mt8173/spi.c
+++ b/src/soc/mediatek/mt8173/spi.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <timer.h>
#include <soc/addressmap.h>
+#include <soc/flash_controller.h>
#include <soc/gpio.h>
#include <soc/pinmux.h>
#include <soc/pll.h>
@@ -161,6 +162,7 @@ static void mtk_spi_dump_data(const char *name, const uint8_t *data,
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
{
struct mtk_spi_bus *eslave;
+ static struct spi_slave slave;
switch (bus) {
case CONFIG_EC_GOOGLE_CHROMEEC_SPI_BUS:
@@ -168,6 +170,12 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
assert(read32(&eslave->regs->spi_cfg0_reg) != 0);
spi_sw_reset(eslave->regs);
return &eslave->slave;
+ case CONFIG_BOOT_MEDIA_SPI_BUS:
+ slave.bus = bus;
+ slave.cs = cs;
+ slave.force_programmer_specific = 1;
+ slave.programmer_specific_probe = &mt8173_nor_flash_probe;
+ return &slave;
default:
die ("wrong bus number.\n");
};