mb/google/corsola: Distinguish MT8186T's SKU ID from MT8186

Compared to MT8186, MT8186T requires initializing the PMIC MT6319 in the DTS file, which necessitates using different SKU ID to distinguish between the MT8186 and MT8186T.

For MT8186, factory pre-flashed 0x7fffffff as unprovisioned SKU ID and
kernel can use the corresponding DTS file. To make MT8186T functional
on unprovisioned devices, change the SKU ID to 0x7ffffeff, so that the
correct DTS file will be selected by the payload.

BUG=b:365730137
TEST=1. Pre-flashed 0x7fffffff and boot OS.
     2. Check OS boot normally by 0x7ffffeff.
BRANCH=corsola

Change-Id: I91306d3abd508e104851916882fb36a4fd302036
Signed-off-by: Yang Wu <wuyang5@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84342
Reviewed-by: Knox Chiou <knoxchiou@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
This commit is contained in:
Yang Wu 2024-09-12 19:55:50 +08:00 committed by Yu-Ping Wu
commit 8031de24d4

View file

@ -5,6 +5,7 @@
#include <console/console.h>
#include <ec/google/chromeec/ec.h>
#include <soc/auxadc.h>
#include <soc/cpu_id.h>
#include "panel.h"
@ -12,6 +13,8 @@
#define ADC_LEVELS 12
#define CROS_SKU_UNPROVISIONED_MT8186T 0x7FFFFEFF
enum {
/* RAM IDs */
RAM_ID_LOW_CHANNEL = 2,
@ -112,19 +115,18 @@ uint32_t sku_id(void)
cached_sku_code = google_chromeec_get_board_sku();
if (CONFIG(BOARD_GOOGLE_STARYU_COMMON)) {
if (cached_sku_code == CROS_SKU_UNPROVISIONED ||
cached_sku_code == CROS_SKU_UNKNOWN) {
printk(BIOS_WARNING, "SKU code from EC: %s\n",
(cached_sku_code == CROS_SKU_UNKNOWN) ?
"CROS_SKU_UNKNOWN" : "CROS_SKU_UNPROVISIONED");
if (cached_sku_code == CROS_SKU_UNPROVISIONED ||
cached_sku_code == CROS_SKU_UNKNOWN) {
printk(BIOS_WARNING, "SKU code from EC: 0x%x\n", cached_sku_code);
cached_sku_code = CROS_SKU_UNPROVISIONED;
if (get_cpu_id() == MTK_CPU_ID_MT8186T)
cached_sku_code = CROS_SKU_UNPROVISIONED_MT8186T;
if (CONFIG(BOARD_GOOGLE_STARYU_COMMON)) {
/* Reserve last 4 bits to report PANEL_ID */
cached_sku_code = 0x7FFFFFF0UL | panel_id();
cached_sku_code &= ~0xF;
cached_sku_code |= panel_id();
}
} else if (cached_sku_code == CROS_SKU_UNKNOWN) {
printk(BIOS_WARNING, "Failed to get SKU code from EC\n");
cached_sku_code = (get_adc_index(SKU_ID_HIGH_CHANNEL) << 4 |
get_adc_index(SKU_ID_LOW_CHANNEL));
}
printk(BIOS_DEBUG, "SKU Code: %#02x\n", cached_sku_code);