blob: afd218e637b62f3fb81a9ddf58de5e95ca7c902b [file] [log] [blame]
Robert Chen151a48d2022-03-25 16:33:11 +08001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3#include <baseboard/variants.h>
4#include <fw_config.h>
5#include <soc/soc_chip.h>
6
7static void ext_vr_update(void)
8{
9 struct soc_intel_jasperlake_config *cfg = config_of_soc();
10 if (fw_config_probe(FW_CONFIG(EXT_VR, EXT_VR_ABSENT)))
11 cfg->disable_external_bypass_vr = 1;
12}
13
Robert Chen67a96902024-05-08 22:05:21 -040014static void usb_port_update(void)
15{
16 struct soc_intel_jasperlake_config *cfg = config_of_soc();
17
18 if (fw_config_is_provisioned() &&
19 fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_NONE))) {
20 /* Disable USB C1 port */
21 cfg->usb2_ports[1].enable = 0;
22 cfg->usb3_ports[1].enable = 0;
23 /* Disable USB A1 port */
24 cfg->usb2_ports[3].enable = 0;
25 cfg->usb3_ports[3].enable = 0;
26 }
Robert Chenc40e3c92024-06-12 03:25:52 -040027 if (fw_config_is_provisioned() &&
28 fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_LTE))) {
29 /* Disable USB C1 port */
30 cfg->usb2_ports[1].enable = 0;
31 cfg->usb3_ports[1].enable = 0;
32 }
Robert Chen67a96902024-05-08 22:05:21 -040033}
34
Robert Chen151a48d2022-03-25 16:33:11 +080035void variant_devtree_update(void)
36{
37 ext_vr_update();
Robert Chen67a96902024-05-08 22:05:21 -040038 usb_port_update();
Robert Chen151a48d2022-03-25 16:33:11 +080039}