summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainboard/google/geralt/boardid.c19
-rw-r--r--src/mainboard/google/geralt/panel_geralt.c7
2 files changed, 14 insertions, 12 deletions
diff --git a/src/mainboard/google/geralt/boardid.c b/src/mainboard/google/geralt/boardid.c
index 7a627416be..3a08c6d5cb 100644
--- a/src/mainboard/google/geralt/boardid.c
+++ b/src/mainboard/google/geralt/boardid.c
@@ -15,10 +15,9 @@ enum {
/* RAM IDs */
RAM_ID_LOW_CHANNEL = 2,
RAM_ID_HIGH_CHANNEL = 3,
- /* SKU ID */
- SKU_ID_CHANNEL = 4,
- /* PANEL ID */
- PANEL_ID_CHANNEL = 5,
+ /* PANEL IDs */
+ PANEL_ID_HIGH_CHANNEL = 4,
+ PANEL_ID_LOW_CHANNEL = 5,
};
static const unsigned int ram_voltages[ADC_LEVELS] = {
@@ -56,8 +55,8 @@ static const unsigned int panel_voltages[ADC_LEVELS] = {
static const unsigned int *adc_voltages[] = {
[RAM_ID_LOW_CHANNEL] = ram_voltages,
[RAM_ID_HIGH_CHANNEL] = ram_voltages,
- [SKU_ID_CHANNEL] = ram_voltages,
- [PANEL_ID_CHANNEL] = panel_voltages,
+ [PANEL_ID_HIGH_CHANNEL] = panel_voltages,
+ [PANEL_ID_LOW_CHANNEL] = panel_voltages,
};
static uint32_t get_adc_index(unsigned int channel)
@@ -84,7 +83,8 @@ uint32_t panel_id(void)
static uint32_t cached_panel_id = BOARD_ID_INIT;
if (cached_panel_id == BOARD_ID_INIT)
- cached_panel_id = get_adc_index(PANEL_ID_CHANNEL);
+ cached_panel_id = get_adc_index(PANEL_ID_HIGH_CHANNEL) << 4 |
+ get_adc_index(PANEL_ID_LOW_CHANNEL);
return cached_panel_id;
}
@@ -101,9 +101,8 @@ uint32_t sku_id(void)
printk(BIOS_WARNING, "SKU code from EC: %s\n",
(cached_sku_code == CROS_SKU_UNKNOWN) ?
"CROS_SKU_UNKNOWN" : "CROS_SKU_UNPROVISIONED");
- /* Reserve last 8 bits to report SKU_ID and PANEL_ID */
- cached_sku_code = 0x7FFFFF00UL | get_adc_index(SKU_ID_CHANNEL) << 4 |
- panel_id();
+ /* Reserve last 8 bits to report PANEL_IDs */
+ cached_sku_code = 0x7FFFFF00UL | panel_id();
}
printk(BIOS_DEBUG, "SKU Code: %#02x\n", cached_sku_code);
}
diff --git a/src/mainboard/google/geralt/panel_geralt.c b/src/mainboard/google/geralt/panel_geralt.c
index 7828651397..1cb8e47d2a 100644
--- a/src/mainboard/google/geralt/panel_geralt.c
+++ b/src/mainboard/google/geralt/panel_geralt.c
@@ -72,10 +72,13 @@ static struct panel_description panels[] = {
struct panel_description *get_panel_description(uint32_t panel_id)
{
- if (panel_id >= ARRAY_SIZE(panels))
+ /* Only PANEL_ID_LOW_CHANNEL value is valid for the reference board. */
+ uint32_t id = panel_id & 0xF;
+
+ if (id >= ARRAY_SIZE(panels))
return NULL;
- return &panels[panel_id];
+ return &panels[id];
}
void fill_lp_backlight_gpios(struct lb_gpios *gpios)