<p>Tristan Hsieh has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/27114">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mediatek/mt8183: Remove temporary hack of flash code.<br><br>BUG=b:80501386<br>BRANCH=none<br>TEST=work fine on Kukui<br><br>Change-Id: If29869461fc8c2efe26bb8c901737ee85935d27f<br>Signed-off-by: Tristan Shieh <tristan.shieh@mediatek.com><br>---<br>M src/soc/mediatek/mt8183/Makefile.inc<br>D src/soc/mediatek/mt8183/flash_controller.c<br>M src/soc/mediatek/mt8183/spi.c<br>3 files changed, 0 insertions(+), 64 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/27114/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/mediatek/mt8183/Makefile.inc b/src/soc/mediatek/mt8183/Makefile.inc</span><br><span>index 9f80500..a0e4a60 100644</span><br><span>--- a/src/soc/mediatek/mt8183/Makefile.inc</span><br><span>+++ b/src/soc/mediatek/mt8183/Makefile.inc</span><br><span>@@ -1,24 +1,20 @@</span><br><span> ifeq ($(CONFIG_SOC_MEDIATEK_MT8183),y)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-bootblock-$(CONFIG_SPI_FLASH) += flash_controller.c</span><br><span> bootblock-$(CONFIG_SPI_FLASH) += spi.c</span><br><span> bootblock-y += ../common/timer.c</span><br><span> ifeq ($(CONFIG_BOOTBLOCK_CONSOLE),y)</span><br><span> bootblock-$(CONFIG_DRIVERS_UART) += ../common/uart.c</span><br><span> endif</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-verstage-$(CONFIG_SPI_FLASH) += flash_controller.c</span><br><span> verstage-$(CONFIG_SPI_FLASH) += spi.c</span><br><span> verstage-y += ../common/timer.c</span><br><span> verstage-$(CONFIG_DRIVERS_UART) += ../common/uart.c</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-romstage-$(CONFIG_SPI_FLASH) += flash_controller.c</span><br><span> romstage-$(CONFIG_SPI_FLASH) += spi.c</span><br><span> romstage-y += ../common/timer.c</span><br><span> romstage-$(CONFIG_DRIVERS_UART) += ../common/uart.c</span><br><span> </span><br><span> ramstage-y += ../common/cbmem.c emi.c</span><br><span style="color: hsl(0, 100%, 40%);">-ramstage-$(CONFIG_SPI_FLASH) += flash_controller.c</span><br><span> ramstage-$(CONFIG_SPI_FLASH) += spi.c</span><br><span> ramstage-y += ../common/timer.c</span><br><span> ramstage-$(CONFIG_DRIVERS_UART) += ../common/uart.c</span><br><span>diff --git a/src/soc/mediatek/mt8183/flash_controller.c b/src/soc/mediatek/mt8183/flash_controller.c</span><br><span>deleted file mode 100644</span><br><span>index a6a816f..0000000</span><br><span>--- a/src/soc/mediatek/mt8183/flash_controller.c</span><br><span>+++ /dev/null</span><br><span>@@ -1,59 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-/*</span><br><span style="color: hsl(0, 100%, 40%);">- * This file is part of the coreboot project.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * Copyright 2018 MediaTek Inc.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(0, 100%, 40%);">- * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(0, 100%, 40%);">- * the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(0, 100%, 40%);">- * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(0, 100%, 40%);">- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(0, 100%, 40%);">- * GNU General Public License for more details.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/* this is a spi driver which adapts emmc to fake spi flash */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#include <soc/flash_controller.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <spi_flash.h></span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static void init_io(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int emmc_adapter_read(const struct spi_flash *flash, u32 addr,</span><br><span style="color: hsl(0, 100%, 40%);">-             size_t len, void *buf)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int emmc_adapter_write(const struct spi_flash *flash, u32 addr,</span><br><span style="color: hsl(0, 100%, 40%);">-                size_t len, const void *buf)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-   return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int emmc_adapter_erase(const struct spi_flash *flash, u32 offset,</span><br><span style="color: hsl(0, 100%, 40%);">-              size_t len)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-    return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-const struct spi_flash_ops spi_emmc_flash_ops = {</span><br><span style="color: hsl(0, 100%, 40%);">-     .read = emmc_adapter_read,</span><br><span style="color: hsl(0, 100%, 40%);">-      .write = emmc_adapter_write,</span><br><span style="color: hsl(0, 100%, 40%);">-    .erase = emmc_adapter_erase,</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-int mtk_spi_flash_probe(const struct spi_slave *spi, struct spi_flash *flash)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-    init_io();</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      flash->name = "spi emmc flash controller";</span><br><span style="color: hsl(0, 100%, 40%);">- flash->sector_size = 0x800;</span><br><span style="color: hsl(0, 100%, 40%);">-  flash->size = CONFIG_ROM_SIZE;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       flash->ops = &spi_emmc_flash_ops;</span><br><span style="color: hsl(0, 100%, 40%);">-        return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span>diff --git a/src/soc/mediatek/mt8183/spi.c b/src/soc/mediatek/mt8183/spi.c</span><br><span>index 78821d1..d85138c 100644</span><br><span>--- a/src/soc/mediatek/mt8183/spi.c</span><br><span>+++ b/src/soc/mediatek/mt8183/spi.c</span><br><span>@@ -18,7 +18,6 @@</span><br><span> </span><br><span> static const struct spi_ctrlr spi_flash_ctrlr = {</span><br><span>     .max_xfer_size = 65535,</span><br><span style="color: hsl(0, 100%, 40%);">- .flash_probe = mtk_spi_flash_probe,</span><br><span> };</span><br><span> </span><br><span> const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/27114">change 27114</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/27114"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: If29869461fc8c2efe26bb8c901737ee85935d27f </div>
<div style="display:none"> Gerrit-Change-Number: 27114 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Tristan Hsieh <tristan.shieh@mediatek.com> </div>