Tao Xia has uploaded this change for review.

View Change

mb/google/kukui: Fix no firmware beep issue

There are no two beeps during the developer screen after changing
from the normal mode to the developer mode. The RT1015 amplifier
works with I2C mode on Kakadu. So the SCL6/SDA6 should be
configured as I2C function instead of GPIO function. And the RT1015
amplifier initialization should be done through I2C6 interface.

BUG=b:171763469
BRANCH=kukui
TEST=There are two beeps during the developer screen after changing
from the normal mode to the developer mode.

Signed-off-by: Tao Xia <xiatao5@huaqin.corp-partner.google.com>
Change-Id: If07674d94a0b63ac3174d16d11bf371e0bd8c8cf
---
M src/mainboard/google/kukui/Kconfig
M src/mainboard/google/kukui/chromeos.c
M src/mainboard/google/kukui/mainboard.c
3 files changed, 26 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/47586/1
diff --git a/src/mainboard/google/kukui/Kconfig b/src/mainboard/google/kukui/Kconfig
index cff94da..358d445 100644
--- a/src/mainboard/google/kukui/Kconfig
+++ b/src/mainboard/google/kukui/Kconfig
@@ -17,6 +17,12 @@
select EC_GOOGLE_CHROMEEC_SWITCHES
select VBOOT_VBNV_FLASH

+config RT1015_I2C_MODE
+ bool
+ default n
+ help
+ The platform that uses rt1015 I2C mode should select this option to enable it.
+
config BOARD_SPECIFIC_OPTIONS
def_bool y
select RTC
@@ -37,6 +43,7 @@
select MAINBOARD_FORCE_NATIVE_VGA_INIT
select HAVE_LINEAR_FRAMEBUFFER
select MT8183_DRAM_EMCP if BOARD_GOOGLE_KRANE || BOARD_GOOGLE_KAKADU
+ select RT1015_I2C_MODE if BOARD_GOOGLE_KAKADU

config MAINBOARD_DIR
string
diff --git a/src/mainboard/google/kukui/chromeos.c b/src/mainboard/google/kukui/chromeos.c
index c5810d1..6fce1c3 100644
--- a/src/mainboard/google/kukui/chromeos.c
+++ b/src/mainboard/google/kukui/chromeos.c
@@ -25,7 +25,20 @@
{CR50_IRQ.id, ACTIVE_HIGH, -1, "TPM interrupt"},
{GPIO_EN_SPK_AMP.id, ACTIVE_HIGH, -1, "speaker enable"},
};
- lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
+
+ struct lb_gpio chromeos_gpios_1[] = {
+ {GPIO_WP.id, ACTIVE_LOW,
+ !get_write_protect_state(), "write protect"},
+ {EC_IN_RW.id, ACTIVE_HIGH, -1, "EC in RW"},
+ {EC_IRQ.id, ACTIVE_LOW, -1, "EC interrupt"},
+ {CR50_IRQ.id, ACTIVE_HIGH, -1, "TPM interrupt"},
+ };
+
+ if (CONFIG(RT1015_I2C_MODE))
+ lb_add_gpios(gpios, chromeos_gpios_1, ARRAY_SIZE(chromeos_gpios_1));
+ else
+ lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
+
}

int get_write_protect_state(void)
diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c
index 268b7ca..746b3af 100644
--- a/src/mainboard/google/kukui/mainboard.c
+++ b/src/mainboard/google/kukui/mainboard.c
@@ -18,6 +18,7 @@
#include <soc/mtcmos.h>
#include <soc/spm.h>
#include <soc/usb.h>
+#include <soc/i2c.h>
#include <string.h>

#include "gpio.h"
@@ -54,6 +55,9 @@
gpio_set_mode(GPIO(CAM_PDN1), PAD_CAM_PDN1_FUNC_I2S2_BCK);
gpio_set_mode(GPIO(CAM_PDN0), PAD_CAM_PDN0_FUNC_I2S2_MCK);
gpio_set_mode(GPIO(EINT3), PAD_EINT3_FUNC_I2S3_DO);
+
+ if (CONFIG(RT1015_I2C_MODE))
+ mtk_i2c_bus_init(6);
}

static void configure_ec(void)
@@ -91,7 +95,7 @@
gpio_output(GPIO_PPVARN_LCD_EN, 1);
gpio_output(GPIO_PP1800_LCM_EN, 1);
gpio_output(GPIO_PP3300_LCM_EN, 1);
- mdelay(6);
+ mdelay(15);
gpio_output(GPIO_LCM_RST_1V8, 1);
mdelay(6);
}

To view, visit change 47586. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If07674d94a0b63ac3174d16d11bf371e0bd8c8cf
Gerrit-Change-Number: 47586
Gerrit-PatchSet: 1
Gerrit-Owner: Tao Xia <xiatao5@huaqin.corp-partner.google.com>
Gerrit-MessageType: newchange