Hung-Te Lin submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Hung-Te Lin: Looks good to me, approved Yu-Ping Wu: Looks good to me, approved
mb/google/kukui: change Jacuzzi followers LCMID to fixed value

The LCM ID is not really used on Jacuzzi followers and the reference
design expects ADC to return 0. However, there were hardware design
issues so the returned value became unexpected numbers.

- Juniper and Kappa returns 1.
- Burnet and Esche returns 1 on normal boot, and 0 on recovery boot.
- Cerise and Stern usually returns 0, and sometimes 1.

To fix that, we are changing LCM ID to fixed value for Jacuzzi followers.

BUG=b:170916885,b:171365301
BRANCH=kukui
TEST=1. emerge-jacuzzi coreboot
2. check burnet/esche skuid correctly

Change-Id: I3b43b9153315ec65e9168c4e84ea844dff14d446
Signed-off-by: Kevin Chiu <kevin.chiu@quantatw.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46442
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
---
M src/mainboard/google/kukui/Kconfig
M src/mainboard/google/kukui/boardid.c
2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/mainboard/google/kukui/Kconfig b/src/mainboard/google/kukui/Kconfig
index 2237efa..23a4169 100644
--- a/src/mainboard/google/kukui/Kconfig
+++ b/src/mainboard/google/kukui/Kconfig
@@ -77,4 +77,10 @@
default 0x10 if BOARD_GOOGLE_BURNET || BOARD_GOOGLE_ESCHE || BOARD_GOOGLE_FENNEL || BOARD_GOOGLE_CERISE || BOARD_GOOGLE_STERN
default 0x0

+config BOARD_OVERRIDE_LCM_ID
+ hex
+ default 0x1 if BOARD_GOOGLE_JUNIPER || BOARD_GOOGLE_KAPPA || BOARD_GOOGLE_DAMU
+ default 0x1 if BOARD_GOOGLE_BURNET || BOARD_GOOGLE_ESCHE
+ default 0x0
+
endif
diff --git a/src/mainboard/google/kukui/boardid.c b/src/mainboard/google/kukui/boardid.c
index 47b0d9b..6c7547c 100644
--- a/src/mainboard/google/kukui/boardid.c
+++ b/src/mainboard/google/kukui/boardid.c
@@ -1,5 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only */

+/*
+ * The boardid.c should provide board_id, sku_id, and ram_code.
+ * board_id is provided by ec/google/chromeec/ec_boardid.c.
+ * sku_id and ram_code are defined in this file.
+ */
+
#include <assert.h>
#include <boardid.h>
#include <console/console.h>
@@ -169,7 +175,15 @@
return 0;
}

-/* board_id is provided by ec/google/chromeec/ec_boardid.c */
+/* Returns the ID for LCD module (type of panel). */
+static uint8_t lcm_id(void)
+{
+ /* LCM is unused on Jacuzzi followers. */
+ if (CONFIG(BOARD_GOOGLE_JACUZZI_COMMON))
+ return CONFIG_BOARD_OVERRIDE_LCM_ID;
+
+ return get_adc_index(LCM_ID_CHANNEL);
+}

uint32_t sku_id(void)
{
@@ -200,7 +214,7 @@
* ADC4[4bit/L] = SKU ID from board straps.
*/
cached_sku_id = (wfc_id() << 8 |
- get_adc_index(LCM_ID_CHANNEL) << 4 |
+ lcm_id() << 4 |
get_adc_index(SKU_ID_CHANNEL));

return cached_sku_id;

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3b43b9153315ec65e9168c4e84ea844dff14d446
Gerrit-Change-Number: 46442
Gerrit-PatchSet: 15
Gerrit-Owner: Kevin Chiu <Kevin.Chiu@quantatw.com>
Gerrit-Reviewer: Hung-Te Lin <hungte@chromium.org>
Gerrit-Reviewer: Yu-Ping Wu <yupingso@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Chen-Tsung Hsieh <chentsung@chromium.org>
Gerrit-CC: KU-TENG HSU <kuten@google.com>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: merged