blob: 7eafebcff0761ed6a9edcb58b5c5fd97e6b6ebd7 [file] [log] [blame]
Angel Pons27123982020-04-05 13:22:30 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Zhuohao Leefe68ab92018-09-01 17:41:56 +08002
3#include <baseboard/variants.h>
4#include <ec/google/chromeec/ec.h>
5#include <smbios.h>
Elyes Haouasbdd03c22024-05-27 11:20:07 +02006#include <stdio.h>
Zhuohao Leee6f12d02021-03-11 12:07:57 +08007#include <sar.h>
Zhuohao Leefe68ab92018-09-01 17:41:56 +08008
9#define SKU_UNKNOWN 0xFFFFFFFF
10
11uint32_t variant_board_sku(void)
12{
13 static uint32_t sku_id = SKU_UNKNOWN;
14 uint32_t id;
15
16 if (sku_id != SKU_UNKNOWN)
17 return sku_id;
18 if (google_chromeec_cbi_get_sku_id(&id))
19 return SKU_UNKNOWN;
20 sku_id = id;
21
22 return sku_id;
23}
24
Nico Huberebd8a4f2017-11-01 09:49:16 +010025const char *smbios_system_sku(void)
Zhuohao Leefe68ab92018-09-01 17:41:56 +080026{
27 static char sku_str[14]; /* sku{0..4294967295} */
28
29 snprintf(sku_str, sizeof(sku_str), "sku%u", variant_board_sku());
30
31 return sku_str;
32}
Zhuohao Leee6f12d02021-03-11 12:07:57 +080033
34const char *get_wifi_sar_cbfs_filename(void)
35{
Yuchen Hea0833952023-03-22 00:34:35 +010036 const uint32_t sku_id = variant_board_sku();
Zhuohao Leee6f12d02021-03-11 12:07:57 +080037
Zhuohao Leee6f12d02021-03-11 12:07:57 +080038 if (sku_id & 0x200)
Furquan Shaikh7fe5d3d2021-03-13 22:54:16 -080039 return "wifi_sar-shyvana.hex";
Zhuohao Leee6f12d02021-03-11 12:07:57 +080040 else
Furquan Shaikh7fe5d3d2021-03-13 22:54:16 -080041 return "wifi_sar-leona.hex";
Zhuohao Leee6f12d02021-03-11 12:07:57 +080042}