mb/purism/librem_cnl: move setting of FSP-M UPDs into variant.c

The upcoming Librem 14 variant won't use the same SATA HSIO adjustments
as the Librem Mini, so move these settings into a variant-specific file.

Rename existing gpio.h to variant.h, move to board root directory, and
use for all variant-specific declarations; adjust references as needed.

Add newly-created variant.c to Makefile.

Test: build/boot Librem Mini, verify SATA functionality unchanged.

Change-Id: Ie8f714cc759675c692ad6e3f20e50adad8d09d4b
Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48519
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Matt DeVillier 2020-11-16 15:36:23 -06:00 committed by Hung-Te Lin
parent 77509be2c8
commit d8a4dd0b32
6 changed files with 23 additions and 10 deletions

View File

@ -1,5 +1,7 @@
## SPDX-License-Identifier: GPL-2.0-only
romstage-y += variants/$(VARIANT_DIR)/variant.c
ramstage-y += variants/$(VARIANT_DIR)/gpio.c
ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
ramstage-y += ramstage.c

View File

@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <soc/ramstage.h>
#include <variant/gpio.h>
#include "variant.h"
void mainboard_silicon_init_params(FSP_S_CONFIG *params)
{

View File

@ -2,6 +2,7 @@
#include <soc/cnl_memcfg_init.h>
#include <soc/romstage.h>
#include "variant.h"
static const struct cnl_mb_cfg memcfg = {
@ -50,10 +51,5 @@ void mainboard_memory_init_params(FSPM_UPD *memupd)
{
FSP_M_CONFIG *mem_cfg = &memupd->FspmConfig;
cannonlake_memcfg_init(mem_cfg, &memcfg);
/* Enable and set SATA HSIO adjustments for ports 0 and 2 */
mem_cfg->PchSataHsioRxGen3EqBoostMagEnable[0] = 1;
mem_cfg->PchSataHsioRxGen3EqBoostMagEnable[2] = 1;
mem_cfg->PchSataHsioRxGen3EqBoostMag[0] = 2;
mem_cfg->PchSataHsioRxGen3EqBoostMag[2] = 1;
variant_memory_init_params(mem_cfg);
}

View File

@ -1,11 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef VARIANT_GPIO_H
#define VARIANT_GPIO_H
#ifndef VARIANT_H
#define VARIANT_H
#include <soc/gpe.h>
#include <soc/gpio.h>
#include <soc/romstage.h>
const struct pad_config *variant_gpio_table(size_t *num);
void variant_memory_init_params(FSP_M_CONFIG *mem_cfg);
#endif

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <variant/gpio.h>
#include "../../variant.h"
/* Pad configuration was generated automatically using intelp2m utility */
static const struct pad_config gpio_table[] = {

View File

@ -0,0 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include "../../variant.h"
void variant_memory_init_params(FSP_M_CONFIG *mem_cfg)
{
/* Enable and set SATA HSIO adjustments for ports 0 and 2 */
mem_cfg->PchSataHsioRxGen3EqBoostMagEnable[0] = 1;
mem_cfg->PchSataHsioRxGen3EqBoostMagEnable[2] = 1;
mem_cfg->PchSataHsioRxGen3EqBoostMag[0] = 2;
mem_cfg->PchSataHsioRxGen3EqBoostMag[2] = 1;
}