| 1 |
|
| 2 |
|
| 3 |
#include <amdblocks/apob_cache.h> |
| 4 |
#include <commonlib/helpers.h> |
| 5 |
#include <console/uart.h> |
| 6 |
#include <device/device.h> |
| 7 |
#include <fsp/api.h> |
| 8 |
#include <soc/platform_descriptors.h> |
| 9 |
#include <soc/pci_devs.h> |
| 10 |
#include <soc/fsp.h> |
| 11 |
#include <static.h> |
| 12 |
#include <types.h> |
| 13 |
#include "chip.h" |
| 14 |
|
| 15 |
void __weak mainboard_updm_update(FSP_M_CONFIG *mupd) {} |
| 16 |
|
| 17 |
void __weak mb_pre_fspm(void) {} |
| 18 |
|
| 19 |
void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd, uint32_t version) |
| 20 |
{ |
| 21 |
FSP_M_CONFIG *mcfg = &mupd->FspmConfig; |
| 22 |
const struct soc_amd_picasso_config *config = config_of_soc(); |
| 23 |
|
| 24 |
mupd->FspmArchUpd.NvsBufferPtr = (uintptr_t)soc_fill_apob_cache(); |
| 25 |
|
| 26 |
mcfg->pci_express_base_addr = CONFIG_ECAM_MMCONF_BASE_ADDRESS; |
| 27 |
mcfg->tseg_size = CONFIG_SMM_TSEG_SIZE; |
| 28 |
mcfg->serial_port_base = uart_platform_base(CONFIG_UART_FOR_CONSOLE); |
| 29 |
mcfg->serial_port_use_mmio = CONFIG(DRIVERS_UART_8250MEM); |
| 30 |
mcfg->serial_port_stride = CONFIG(DRIVERS_UART_8250MEM_32) ? 4 : 1; |
| 31 |
mcfg->serial_port_baudrate = get_uart_baudrate(); |
| 32 |
mcfg->serial_port_refclk = uart_platform_refclk(); |
| 33 |
|
| 34 |
mcfg->system_config = config->system_config; |
| 35 |
|
| 36 |
if ((config->slow_ppt_limit_mW) && |
| 37 |
(config->fast_ppt_limit_mW) && |
| 38 |
(config->slow_ppt_time_constant_s) && |
| 39 |
(config->stapm_time_constant_s)) { |
| 40 |
mcfg->slow_ppt_limit_mW = config->slow_ppt_limit_mW; |
| 41 |
mcfg->fast_ppt_limit_mW = config->fast_ppt_limit_mW; |
| 42 |
mcfg->slow_ppt_time_constant_s = config->slow_ppt_time_constant_s; |
| 43 |
mcfg->stapm_time_constant_s = config->stapm_time_constant_s; |
| 44 |
} |
| 45 |
|
| 46 |
mcfg->ccx_down_core_mode = config->downcore_mode; |
| 47 |
mcfg->ccx_disable_smt = config->smt_disable; |
| 48 |
|
| 49 |
mcfg->sustained_power_limit_mW = config->sustained_power_limit_mW; |
| 50 |
mcfg->prochot_l_deassertion_ramp_time_ms = config->prochot_l_deassertion_ramp_time_ms; |
| 51 |
mcfg->thermctl_limit_degreeC = config->thermctl_limit_degreeC; |
| 52 |
mcfg->psi0_current_limit_mA = config->psi0_current_limit_mA; |
| 53 |
mcfg->psi0_soc_current_limit_mA = config->psi0_soc_current_limit_mA; |
| 54 |
mcfg->vddcr_soc_voltage_margin_mV = config->vddcr_soc_voltage_margin_mV; |
| 55 |
mcfg->vddcr_vdd_voltage_margin_mV = config->vddcr_vdd_voltage_margin_mV; |
| 56 |
mcfg->vrm_maximum_current_limit_mA = config->vrm_maximum_current_limit_mA; |
| 57 |
mcfg->vrm_soc_maximum_current_limit_mA = config->vrm_soc_maximum_current_limit_mA; |
| 58 |
mcfg->vrm_current_limit_mA = config->vrm_current_limit_mA; |
| 59 |
mcfg->vrm_soc_current_limit_mA = config->vrm_soc_current_limit_mA; |
| 60 |
mcfg->sb_tsi_alert_comparator_mode_en = config->sb_tsi_alert_comparator_mode_en; |
| 61 |
mcfg->core_dldo_bypass = config->core_dldo_bypass; |
| 62 |
mcfg->min_soc_vid_offset = config->min_soc_vid_offset; |
| 63 |
mcfg->aclk_dpm0_freq_400MHz = config->aclk_dpm0_freq_400MHz; |
| 64 |
mcfg->telemetry_vddcr_vdd_slope_mA = config->telemetry_vddcr_vdd_slope_mA; |
| 65 |
mcfg->telemetry_vddcr_vdd_offset = config->telemetry_vddcr_vdd_offset; |
| 66 |
mcfg->telemetry_vddcr_soc_slope_mA = config->telemetry_vddcr_soc_slope_mA; |
| 67 |
mcfg->telemetry_vddcr_soc_offset = config->telemetry_vddcr_soc_offset; |
| 68 |
mcfg->hd_audio_enable = is_dev_enabled(DEV_PTR(hda)); |
| 69 |
mcfg->sata_enable = is_dev_enabled(DEV_PTR(sata)); |
| 70 |
mcfg->hdmi2_disable = config->hdmi2_disable; |
| 71 |
|
| 72 |
|
| 73 |
mcfg->pspp_policy = config->pspp_policy; |
| 74 |
|
| 75 |
mainboard_updm_update(mcfg); |
| 76 |
mb_pre_fspm(); |
| 77 |
} |