1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/device.h>
4 #include <soc/amd/phoenix/chip.h>
5 #include <soc/soc_util.h>
7 #include <vendorcode/amd/opensil/chip/mpio/chip.h>
8 #include "display_card_type.h"
9 #include "update_devicetree.h"
11 static void mainboard_update_mpio(void)
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 vendorcode_amd_opensil_chip_mpio_config
*mxm_bridge_cfg
= config_of(mxm_bridge
);
18 struct vendorcode_amd_opensil_chip_mpio_config
*ssd1_bridge_cfg
= config_of(ssd1_bridge
);
19 struct vendorcode_amd_opensil_chip_mpio_config
*wwan_bridge_cfg
= config_of(wwan_bridge
);
20 struct vendorcode_amd_opensil_chip_mpio_config
*wlan_bridge_cfg
= config_of(wlan_bridge
);
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;
27 if (!CONFIG(ENABLE_EVAL_CARD
)) {
28 mxm_bridge
->enabled
= false;
30 if (CONFIG(DISABLE_DT_M2
)) {
31 ssd1_bridge
->enabled
= false;
33 /* When the WLAN card uses 2 lanes, the WWAN card can't be used */
35 wwan_bridge
->enabled
= false;
36 wlan_bridge_cfg
->end_lane
= 14;
38 /* When the WWAN card uses 2 lanes, the WLAN card can't be used */
40 wlan_bridge
->enabled
= false;
41 wwan_bridge_cfg
->end_lane
= 15;
45 static void mainboard_update_ddi(void)
47 struct soc_amd_phoenix_config
*cfg
= config_of_soc();
48 cfg
->ddi
[1].connector_type
= get_ddi1_type();
51 void mainboard_update_devicetree_opensil(void)
53 mainboard_update_mpio();
54 mainboard_update_ddi();