summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Wu <wuyang5@huaqin.corp-partner.google.com>2024-09-12 19:55:50 +0800
committerYu-Ping Wu <yupingso@google.com>2024-09-23 04:07:41 +0000
commit8031de24d42e8d08b9caf9b26d11e022b9c5a8e3 (patch)
treebb9824e01ac1cffe5cdcda309c4a9bfb671c2fb0
parent44907f28ec3a5daaecdef4d8569cae53cb86d333 (diff)
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>
-rw-r--r--src/mainboard/google/corsola/boardid.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/mainboard/google/corsola/boardid.c b/src/mainboard/google/corsola/boardid.c
index 443c3d1149..b0aa888347 100644
--- a/src/mainboard/google/corsola/boardid.c
+++ b/src/mainboard/google/corsola/boardid.c
@@ -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);