From df060bc362c060a72b9493a68d7dff8f48a7b6c6 Mon Sep 17 00:00:00 2001 From: David Wu Date: Thu, 15 Jul 2021 17:07:52 +0800 Subject: [PATCH] mb/google/dedede/var/magolor: Add custom Wifi SAR for magister Add wifi sar for magister. Due to fw-config cannot distinguish between magolor and magister. Using sku_id to decide to load magister custom wifi sar. BUG=b:192290227 TEST=build and test on magolor/magister Cq-Depend: chrome-internal:3986580 Signed-off-by: David Wu Change-Id: I4510cc2ad42a11ec802ecd439b353f8e87d63868 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56334 Tested-by: build bot (Jenkins) Reviewed-by: Karthik Ramasubramanian --- .../google/dedede/variants/magolor/variant.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/dedede/variants/magolor/variant.c b/src/mainboard/google/dedede/variants/magolor/variant.c index bb9cf087f6..ccea87385e 100644 --- a/src/mainboard/google/dedede/variants/magolor/variant.c +++ b/src/mainboard/google/dedede/variants/magolor/variant.c @@ -1,13 +1,27 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include +enum { + MAGOLOR_SKU_START = 0x70000, + MAGOLOR_SKU_END = 0x7ffff, + MAGLIA_SKU_START = 0x80000, + MAGLIA_SKU_END = 0x8ffff, + MAGISTER_SKU_START = 0xc0000, + MAGISTER_SKU_END = 0xcffff, +}; + const char *get_wifi_sar_cbfs_filename(void) { - if (fw_config_probe(FW_CONFIG(TABLETMODE, TABLETMODE_ENABLED))) + uint32_t sku_id = google_chromeec_get_board_sku(); + + if (sku_id >= MAGOLOR_SKU_START && sku_id <= MAGLIA_SKU_END) return "wifi_sar-magolor.hex"; + if (sku_id >= MAGISTER_SKU_START && sku_id <= MAGISTER_SKU_END) + return "wifi_sar-magister.hex"; return WIFI_SAR_CBFS_DEFAULT_FILENAME; }