mb/google/geralt: Correct auxadc channel for SKU ID

According to ID table(go/geralt-id), geralt only uses channel 4 for SKU
ID.

BUG=b:244208960
TEST=emerge-geralt coreboot

Change-Id: I0f7303b8809e6000e3e16228b00b525a77feee87
Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70401
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Bo-Chen Chen 2022-12-01 16:34:04 +08:00 committed by Yu-Ping Wu
parent 5aabdf6e12
commit 7e11dcb510
1 changed files with 4 additions and 7 deletions

View File

@ -14,9 +14,8 @@ enum {
/* RAM IDs */ /* RAM IDs */
RAM_ID_LOW_CHANNEL = 2, RAM_ID_LOW_CHANNEL = 2,
RAM_ID_HIGH_CHANNEL = 3, RAM_ID_HIGH_CHANNEL = 3,
/* SKU IDs */ /* SKU ID */
SKU_ID_LOW_CHANNEL = 4, SKU_ID_CHANNEL = 4,
SKU_ID_HIGH_CHANNEL = 5,
}; };
static const unsigned int ram_voltages[ADC_LEVELS] = { static const unsigned int ram_voltages[ADC_LEVELS] = {
@ -38,8 +37,7 @@ static const unsigned int ram_voltages[ADC_LEVELS] = {
static const unsigned int *adc_voltages[] = { static const unsigned int *adc_voltages[] = {
[RAM_ID_LOW_CHANNEL] = ram_voltages, [RAM_ID_LOW_CHANNEL] = ram_voltages,
[RAM_ID_HIGH_CHANNEL] = ram_voltages, [RAM_ID_HIGH_CHANNEL] = ram_voltages,
[SKU_ID_LOW_CHANNEL] = ram_voltages, [SKU_ID_CHANNEL] = ram_voltages,
[SKU_ID_HIGH_CHANNEL] = ram_voltages,
}; };
static uint32_t get_adc_index(unsigned int channel) static uint32_t get_adc_index(unsigned int channel)
@ -69,8 +67,7 @@ uint32_t sku_id(void)
if (cached_sku_code == CROS_SKU_UNKNOWN) { if (cached_sku_code == CROS_SKU_UNKNOWN) {
printk(BIOS_WARNING, "Failed to get SKU code from EC\n"); printk(BIOS_WARNING, "Failed to get SKU code from EC\n");
cached_sku_code = (get_adc_index(SKU_ID_HIGH_CHANNEL) << 4 | cached_sku_code = get_adc_index(SKU_ID_CHANNEL);
get_adc_index(SKU_ID_LOW_CHANNEL));
} }
printk(BIOS_DEBUG, "SKU Code: %#02x\n", cached_sku_code); printk(BIOS_DEBUG, "SKU Code: %#02x\n", cached_sku_code);
} }