mb/google/nissa/var/rull: add ssd timing and modify ssd GPIO pins of rtd3
[coreboot2.git] / src / mainboard / google / zork / variants / dalboz / variant.c
blobe726a7eb8494d5494f77045b76c7f353fcb016e7
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>
7 #include <static.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)
23 board_version = 1;
25 if (board_version >= 2)
26 return;
28 cfg = config_of(i2c_tunnel_dev);
29 cfg->remote_bus = 5;
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
41 * of hardware.
43 if (google_chromeec_cbi_get_board_version(&board_version) != 0)
44 board_version = 1;
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;
62 } else {
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[] = {
72 // DDI0, DP0, eDP
73 .connector_type = EDP,
74 .aux_index = AUX1,
75 .hdp_index = HDP1
78 // DDI1, DP1, DB OPT2 USB-C1 / DB OPT3 MST hub
79 .connector_type = DP,
80 .aux_index = AUX2,
81 .hdp_index = HDP2
84 // DP2 pins not connected on Dali
85 // DDI2, DP3, USB-C0
86 .connector_type = DP,
87 .aux_index = AUX4,
88 .hdp_index = HDP4,
92 static const fsp_ddi_descriptor hdmi_ddi_descriptors[] = {
93 { // DDI0, DP0, eDP
94 .connector_type = EDP,
95 .aux_index = AUX1,
96 .hdp_index = HDP1
98 { // DDI1, DP1, DB OPT2 USB-C1 / DB OPT3 MST hub
99 .connector_type = HDMI,
100 .aux_index = AUX2,
101 .hdp_index = HDP2
103 // DP2 pins not connected on Dali
104 { // DDI2, DP3, USB-C0
105 .connector_type = DP,
106 .aux_index = AUX4,
107 .hdp_index = HDP4,
111 void variant_get_dxio_ddi_descriptors(const fsp_dxio_descriptor **dxio_descs,
112 size_t *dxio_num,
113 const fsp_ddi_descriptor **ddi_descs,
114 size_t *ddi_num)
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);
127 } else {
128 *ddi_descs = &non_hdmi_ddi_descriptors[0];
129 *ddi_num = ARRAY_SIZE(non_hdmi_ddi_descriptors);