Mengqi Zhang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32460
Change subject: mediatek/mt8183: Add SPI GPIO driving setting ......................................................................
mediatek/mt8183: Add SPI GPIO driving setting
Set SPI GPIO driving to support SPI FLASH.
BUG=b:80501386 BRANCH=none TEST=emerge-kukui coreboot; emerge-elm coreboot
Change-Id: I95002ec71abd751c33c089185db04ed4a8686699 Signed-off-by: Mengqi Zhang Mengqi.Zhang@mediatek.com --- M src/soc/mediatek/mt8183/gpio.c M src/soc/mediatek/mt8183/include/soc/gpio.h M src/soc/mediatek/mt8183/mt8183.c 3 files changed, 15 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/32460/1
diff --git a/src/soc/mediatek/mt8183/gpio.c b/src/soc/mediatek/mt8183/gpio.c index 327d389..2bff3d0 100644 --- a/src/soc/mediatek/mt8183/gpio.c +++ b/src/soc/mediatek/mt8183/gpio.c @@ -20,6 +20,7 @@ EN_OFFSET = 0x60, SEL_OFFSET = 0x80, EH_RSEL_OFFSET = 0xF0, + SPI_GPIO_DRV_OFFSET = 0xA0, };
static void gpio_set_pull_pupd(gpio_t gpio, enum pull_enable enable, @@ -128,3 +129,14 @@ I2C_EH_RSL_MASK(SCL5) | I2C_EH_RSL_MASK(SDA5), I2C_EH_RSL_VAL(SCL5) | I2C_EH_RSL_VAL(SDA5)); } + +enum { + SPI_GPIO_DRV_MASK = 0xf, +}; + +void gpio_set_spi_driving(void) +{ + clrsetbits_le32((void *)IOCFG_LM_BASE + SPI_GPIO_DRV_OFFSET, + SPI_GPIO_DRV_MASK, 0x4); +} + diff --git a/src/soc/mediatek/mt8183/include/soc/gpio.h b/src/soc/mediatek/mt8183/include/soc/gpio.h index 5a98953..e446853 100644 --- a/src/soc/mediatek/mt8183/include/soc/gpio.h +++ b/src/soc/mediatek/mt8183/include/soc/gpio.h @@ -617,5 +617,6 @@
static struct gpio_regs *const mtk_gpio = (void *)(GPIO_BASE); void gpio_set_i2c_eh_rsel(void); +void gpio_set_spi_driving(void);
#endif diff --git a/src/soc/mediatek/mt8183/mt8183.c b/src/soc/mediatek/mt8183/mt8183.c index c441980..7ceeb90 100644 --- a/src/soc/mediatek/mt8183/mt8183.c +++ b/src/soc/mediatek/mt8183/mt8183.c @@ -15,8 +15,10 @@
#include <soc/mt8183.h> #include <soc/wdt.h> +#include <soc/gpio.h>
void mt8183_early_init(void) { mtk_wdt_init(); + gpio_set_spi_driving(); }