Robert Chen | 151a48d | 2022-03-25 16:33:11 +0800 | [diff] [blame] | 1 | /* 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 | |
| 7 | static 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 Chen | 67a9690 | 2024-05-08 22:05:21 -0400 | [diff] [blame] | 14 | static 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 Chen | c40e3c9 | 2024-06-12 03:25:52 -0400 | [diff] [blame^] | 27 | 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 Chen | 67a9690 | 2024-05-08 22:05:21 -0400 | [diff] [blame] | 33 | } |
| 34 | |
Robert Chen | 151a48d | 2022-03-25 16:33:11 +0800 | [diff] [blame] | 35 | void variant_devtree_update(void) |
| 36 | { |
| 37 | ext_vr_update(); |
Robert Chen | 67a9690 | 2024-05-08 22:05:21 -0400 | [diff] [blame] | 38 | usb_port_update(); |
Robert Chen | 151a48d | 2022-03-25 16:33:11 +0800 | [diff] [blame] | 39 | } |