1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/variants.h>
4 #include <device/device.h>
5 #include <ec/google/chromeec/ec.h>
6 #include <ec/google/chromeec/i2c_tunnel/chip.h>
9 #define DALBOZ_DB_HDMI 0x1
12 * This is to allow support for audio on older board versions (< 2). [b/153458561]. This
13 * should be removed once these boards are phased out.
15 static void update_audio_configuration(void)
17 uint32_t board_version
;
18 const struct device
*i2c_tunnel_dev
= DEV_PTR(audio_rt5682
);
19 struct ec_google_chromeec_i2c_tunnel_config
*cfg
;
21 /* If CBI board version cannot be read, assume this is an older revision of hardware. */
22 if (google_chromeec_cbi_get_board_version(&board_version
) != 0)
25 if (board_version
>= 2)
28 cfg
= config_of(i2c_tunnel_dev
);
32 void variant_devtree_update(void)
34 uint32_t board_version
;
35 struct soc_amd_picasso_config
*cfg
;
37 cfg
= config_of_soc();
40 * If CBI board version cannot be read, assume this is an older revision
43 if (google_chromeec_cbi_get_board_version(&board_version
) != 0)
46 if (variant_has_emmc() || boot_is_factory_unprovisioned()) {
47 if (board_version
<= 2) {
49 * rev0 and rev1 boards have issues with HS400
51 * There is a tuning fix with ES which shows promise
52 * for some boards, and a HW fix with stitching vias.
53 * There were also concerns that these boards did not
54 * have good margins for certain skus.
56 * But these original boards have none of these fixes.
57 * So we keep the speed low here, with the intent that
58 * other variants implement these corrections.
60 cfg
->emmc_config
.timing
= SD_EMMC_EMMC_HS200
;
63 DEV_PTR(emmc
)->enabled
= 0;
66 update_audio_configuration();
69 /* FIXME: Comments seem to suggest these are not entirely correct. */
70 static const fsp_ddi_descriptor non_hdmi_ddi_descriptors
[] = {
73 .connector_type
= EDP
,
78 // DDI1, DP1, DB OPT2 USB-C1 / DB OPT3 MST hub
84 // DP2 pins not connected on Dali
92 static const fsp_ddi_descriptor hdmi_ddi_descriptors
[] = {
94 .connector_type
= EDP
,
98 { // DDI1, DP1, DB OPT2 USB-C1 / DB OPT3 MST hub
99 .connector_type
= HDMI
,
103 // DP2 pins not connected on Dali
104 { // DDI2, DP3, USB-C0
105 .connector_type
= DP
,
111 void variant_get_dxio_ddi_descriptors(const fsp_dxio_descriptor
**dxio_descs
,
113 const fsp_ddi_descriptor
**ddi_descs
,
116 uint32_t daughterboard_id
= variant_get_daughterboard_id();
118 *dxio_descs
= baseboard_get_dxio_descriptors(dxio_num
);
121 * Get daughterboard id from FW_CONFIG and configure descriptors accordingly.
122 * For unprovisioned boards use DB_HDMI as default.
124 if ((daughterboard_id
== DALBOZ_DB_HDMI
) || boot_is_factory_unprovisioned()) {
125 *ddi_descs
= &hdmi_ddi_descriptors
[0];
126 *ddi_num
= ARRAY_SIZE(hdmi_ddi_descriptors
);
128 *ddi_descs
= &non_hdmi_ddi_descriptors
[0];
129 *ddi_num
= ARRAY_SIZE(non_hdmi_ddi_descriptors
);