| 1 |
|
| 2 |
|
| 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> |
| 8 |
|
| 9 |
#define DALBOZ_DB_HDMI 0x1 |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
static void update_audio_configuration(void) |
| 16 |
{ |
| 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; |
| 20 |
|
| 21 |
|
| 22 |
if (google_chromeec_cbi_get_board_version(&board_version) != 0) |
| 23 |
board_version = 1; |
| 24 |
|
| 25 |
if (board_version >= 2) |
| 26 |
return; |
| 27 |
|
| 28 |
cfg = config_of(i2c_tunnel_dev); |
| 29 |
cfg->remote_bus = 5; |
| 30 |
} |
| 31 |
|
| 32 |
void variant_devtree_update(void) |
| 33 |
{ |
| 34 |
uint32_t board_version; |
| 35 |
struct soc_amd_picasso_config *cfg; |
| 36 |
|
| 37 |
cfg = config_of_soc(); |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
if (google_chromeec_cbi_get_board_version(&board_version) != 0) |
| 44 |
board_version = 1; |
| 45 |
|
| 46 |
if (variant_has_emmc() || boot_is_factory_unprovisioned()) { |
| 47 |
if (board_version <= 2) { |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
cfg->emmc_config.timing = SD_EMMC_EMMC_HS200; |
| 61 |
} |
| 62 |
} else { |
| 63 |
DEV_PTR(emmc)->enabled = 0; |
| 64 |
} |
| 65 |
|
| 66 |
update_audio_configuration(); |
| 67 |
} |
| 68 |
|
| 69 |
|
| 70 |
static const fsp_ddi_descriptor non_hdmi_ddi_descriptors[] = { |
| 71 |
{ |
| 72 |
|
| 73 |
.connector_type = EDP, |
| 74 |
.aux_index = AUX1, |
| 75 |
.hdp_index = HDP1 |
| 76 |
}, |
| 77 |
{ |
| 78 |
|
| 79 |
.connector_type = DP, |
| 80 |
.aux_index = AUX2, |
| 81 |
.hdp_index = HDP2 |
| 82 |
}, |
| 83 |
{ |
| 84 |
|
| 85 |
|
| 86 |
.connector_type = DP, |
| 87 |
.aux_index = AUX4, |
| 88 |
.hdp_index = HDP4, |
| 89 |
} |
| 90 |
}; |
| 91 |
|
| 92 |
static const fsp_ddi_descriptor hdmi_ddi_descriptors[] = { |
| 93 |
{ |
| 94 |
.connector_type = EDP, |
| 95 |
.aux_index = AUX1, |
| 96 |
.hdp_index = HDP1 |
| 97 |
}, |
| 98 |
{ |
| 99 |
.connector_type = HDMI, |
| 100 |
.aux_index = AUX2, |
| 101 |
.hdp_index = HDP2 |
| 102 |
}, |
| 103 |
|
| 104 |
{ |
| 105 |
.connector_type = DP, |
| 106 |
.aux_index = AUX4, |
| 107 |
.hdp_index = HDP4, |
| 108 |
} |
| 109 |
}; |
| 110 |
|
| 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) |
| 115 |
{ |
| 116 |
uint32_t daughterboard_id = variant_get_daughterboard_id(); |
| 117 |
|
| 118 |
*dxio_descs = baseboard_get_dxio_descriptors(dxio_num); |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 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); |
| 130 |
} |
| 131 |
} |