From 7f9bca73286c393a919112133d50a767500cfa95 Mon Sep 17 00:00:00 2001 From: Ronak Kanabar Date: Mon, 4 May 2020 17:54:48 +0530 Subject: soc/intel/jasperlake: Add SATA related UPDs configuration This patch control SATA related UPDs based on the devicetree configuration as per each board's requirement. BUG=b:155595624 BRANCH=None TEST=Build, boot JSLRVP, Verified UPD values from FSP log Change-Id: I4f7e7508b8cd483508293ee3e7b760574d8f025f Signed-off-by: Ronak Kanabar Reviewed-on: https://review.coreboot.org/c/coreboot/+/41029 Tested-by: build bot (Jenkins) Reviewed-by: Karthik Ramasubramanian Reviewed-by: Aamir Bohra Reviewed-by: V Sowmya Reviewed-by: Maulik V Vaghela --- src/soc/intel/jasperlake/chip.h | 1 - src/soc/intel/jasperlake/fsp_params.c | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/soc/intel/jasperlake/chip.h b/src/soc/intel/jasperlake/chip.h index 548d0ee2d1..7a6a7fd0dd 100644 --- a/src/soc/intel/jasperlake/chip.h +++ b/src/soc/intel/jasperlake/chip.h @@ -83,7 +83,6 @@ struct soc_intel_jasperlake_config { uint16_t usb3_wake_enable_bitmap; /* SATA related */ - uint8_t SataEnable; uint8_t SataMode; uint8_t SataSalpSupport; uint8_t SataPortsEnable[8]; diff --git a/src/soc/intel/jasperlake/fsp_params.c b/src/soc/intel/jasperlake/fsp_params.c index d9e8261de7..45162f91f2 100644 --- a/src/soc/intel/jasperlake/fsp_params.c +++ b/src/soc/intel/jasperlake/fsp_params.c @@ -148,6 +148,26 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd) } } + /* SATA */ + dev = pcidev_path_on_root(PCH_DEVFN_SATA); + if (dev) { + params->SataEnable = dev->enabled; + params->SataMode = config->SataMode; + params->SataSalpSupport = config->SataSalpSupport; + + _Static_assert(ARRAY_SIZE(params->SataPortsEnable) >= + ARRAY_SIZE(config->SataPortsEnable), "copy buffer overflow!"); + memcpy(params->SataPortsEnable, config->SataPortsEnable, + sizeof(params->SataPortsEnable)); + + _Static_assert(ARRAY_SIZE(params->SataPortsDevSlp) >= + ARRAY_SIZE(config->SataPortsDevSlp), "copy buffer overflow!"); + memcpy(params->SataPortsDevSlp, config->SataPortsDevSlp, + sizeof(params->SataPortsDevSlp)); + } else { + params->SataEnable = 0; + } + /* SDCard related configuration */ dev = pcidev_path_on_root(PCH_DEVFN_SDCARD); if (!dev) { -- cgit v1.2.3