Debian Codegraph @

src/mainboard/amd/birman/update_devicetree_phoenix_opensil.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <device/device.h>
4 #include <soc/amd/phoenix/chip.h>
5 #include <soc/soc_util.h>
6 #include <static.h>
7 #include <drivers/amd/opensil/mpio/chip.h>
8 #include "display_card_type.h"
9 #include "update_devicetree.h"
10
11 static void mainboard_update_mpio(void)
12 {
13 struct device *mxm_bridge = DEV_PTR(gpp_bridge_1_1);
14 struct device *ssd1_bridge = DEV_PTR(gpp_bridge_1_2);
15 struct device *wwan_bridge = DEV_PTR(gpp_bridge_2_2);
16 struct device *wlan_bridge = DEV_PTR(gpp_bridge_2_3);
17 struct drivers_amd_opensil_mpio_config *mxm_bridge_cfg = config_of(mxm_bridge);
18 struct drivers_amd_opensil_mpio_config *ssd1_bridge_cfg = config_of(ssd1_bridge);
19 struct drivers_amd_opensil_mpio_config *wwan_bridge_cfg = config_of(wwan_bridge);
20 struct drivers_amd_opensil_mpio_config *wlan_bridge_cfg = config_of(wlan_bridge);
21
22 /* Phoenix 2 has less PCIe lanes than Phoenix */
23 if (get_soc_type() == SOC_PHOENIX2) {
24 mxm_bridge_cfg->end_lane = 3;
25 ssd1_bridge_cfg->end_lane = 9;
26 }
27 if (!CONFIG(ENABLE_EVAL_CARD)) {
28 mxm_bridge->enabled = false;
29 }
30 if (CONFIG(DISABLE_DT_M2)) {
31 ssd1_bridge->enabled = false;
32 }
33 /* When the WLAN card uses 2 lanes, the WWAN card can't be used */
34 if (CONFIG(WLAN01)) {
35 wwan_bridge->enabled = false;
36 wlan_bridge_cfg->end_lane = 14;
37 }
38 /* When the WWAN card uses 2 lanes, the WLAN card can't be used */
39 if (CONFIG(WWAN01)) {
40 wlan_bridge->enabled = false;
41 wwan_bridge_cfg->end_lane = 15;
42 }
43 }
44
45 static void mainboard_update_ddi(void)
46 {
47 struct soc_amd_phoenix_config *cfg = config_of_soc();
48 cfg->ddi[1].connector_type = get_ddi1_type();
49 }
50
51 void mainboard_update_devicetree_opensil(void)
52 {
53 mainboard_update_mpio();
54 mainboard_update_ddi();
55 }