1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <baseboard/gpio.h>
5 #include <baseboard/variants.h>
6 #include <cpu/intel/cpu_ids.h>
7 #include <device/device.h>
8 #include <drivers/intel/gma/opregion.h>
15 #include <fw_config.h>
17 const char *smbios_system_sku(void)
19 static char sku_str
[7] = "";
20 uint8_t sku_id
= get_board_id();
22 snprintf(sku_str
, sizeof(sku_str
), "sku%u", sku_id
);
26 static void mainboard_init(void *chip_info
)
28 variant_configure_gpio_pads();
30 if (CONFIG(EC_GOOGLE_CHROMEEC
))
33 variant_devtree_update();
36 void __weak
variant_devtree_update(void)
38 /* Override dev tree settings per board */
41 #if CONFIG(BOARD_INTEL_ADLRVP_M_EXT_EC) || CONFIG(BOARD_INTEL_ADLRVP_N_EXT_EC)
42 static void add_fw_config_oem_string(const struct fw_config
*config
, void *arg
)
44 struct smbios_type11
*t
;
47 t
= (struct smbios_type11
*)arg
;
49 snprintf(buffer
, sizeof(buffer
), "%s-%s", config
->field_name
, config
->option_name
);
50 t
->count
= smbios_add_string(t
->eos
, buffer
);
53 static void mainboard_smbios_strings(struct device
*dev
, struct smbios_type11
*t
)
55 fw_config_for_each_found(add_fw_config_oem_string
, t
);
59 static void mainboard_enable(struct device
*dev
)
61 #if CONFIG(BOARD_INTEL_ADLRVP_M_EXT_EC) || CONFIG(BOARD_INTEL_ADLRVP_N_EXT_EC)
62 dev
->ops
->get_smbios_strings
= mainboard_smbios_strings
;
66 struct chip_operations mainboard_ops
= {
67 .init
= mainboard_init
,
68 .enable_dev
= mainboard_enable
,
71 const char *mainboard_vbt_filename(void)
73 if (!CONFIG(CHROMEOS
))
76 uint32_t cpu_id
= cpu_get_cpuid();
77 uint8_t sku_id
= get_board_id();
81 if (cpu_id
== CPUID_RAPTORLAKE_P_J0
)
82 return "vbt_adlrvp_rpl_lp5.bin";
83 return "vbt_adlrvp_lp5.bin";
85 return "vbt_adlrvp_m_lp5.bin";
88 return "vbt_adlrvp_ddr5.bin";
90 return "vbt_adlrvp_m_lp4.bin";