diff options
author | David Wu <david_wu@quanta.corp-partner.google.com> | 2021-07-15 17:07:52 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-07-28 11:40:50 +0000 |
commit | df060bc362c060a72b9493a68d7dff8f48a7b6c6 (patch) | |
tree | 1d7e4c4c4ac4df8c1c3327fc6935516782f71835 /src/mainboard | |
parent | df520855ca14095729fdb9a10c26852f397879de (diff) |
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 <david_wu@quanta.corp-partner.google.com>
Change-Id: I4510cc2ad42a11ec802ecd439b353f8e87d63868
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56334
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r-- | src/mainboard/google/dedede/variants/magolor/variant.c | 16 |
1 files changed, 15 insertions, 1 deletions
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 <drivers/intel/gma/opregion.h> +#include <ec/google/chromeec/ec.h> #include <fw_config.h> #include <sar.h> +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; } |