Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48519 )
Change subject: mb/purism/librem_cnl: move setting of FSP-M UPDs into variant.c ......................................................................
mb/purism/librem_cnl: move setting of FSP-M UPDs into variant.c
The upcoming Librem 14 variant will not 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 and use for all variant-specific declarations; adjust references as needed. Add 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 --- M src/mainboard/purism/librem_cnl/Makefile.inc M src/mainboard/purism/librem_cnl/ramstage.c M src/mainboard/purism/librem_cnl/romstage.c M src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c D src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h A src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/variant.h A src/mainboard/purism/librem_cnl/variants/librem_mini/variant.c 7 files changed, 33 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/48519/1
diff --git a/src/mainboard/purism/librem_cnl/Makefile.inc b/src/mainboard/purism/librem_cnl/Makefile.inc index ba157df..fa28c52 100644 --- a/src/mainboard/purism/librem_cnl/Makefile.inc +++ b/src/mainboard/purism/librem_cnl/Makefile.inc @@ -1,5 +1,8 @@ ## 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 diff --git a/src/mainboard/purism/librem_cnl/ramstage.c b/src/mainboard/purism/librem_cnl/ramstage.c index 56ed1b7..3936a18 100644 --- a/src/mainboard/purism/librem_cnl/ramstage.c +++ b/src/mainboard/purism/librem_cnl/ramstage.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <soc/ramstage.h> -#include <variant/gpio.h> +#include <variant/variant.h>
void mainboard_silicon_init_params(FSP_S_CONFIG *params) { diff --git a/src/mainboard/purism/librem_cnl/romstage.c b/src/mainboard/purism/librem_cnl/romstage.c index 3a3ca6b..a926d19 100644 --- a/src/mainboard/purism/librem_cnl/romstage.c +++ b/src/mainboard/purism/librem_cnl/romstage.c @@ -2,6 +2,7 @@
#include <soc/cnl_memcfg_init.h> #include <soc/romstage.h> +#include <variant/variant.h>
static const struct cnl_mb_cfg memcfg = {
@@ -50,10 +51,5 @@ { 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); } diff --git a/src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c b/src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c index 8fa4ac5..270ef2d 100644 --- a/src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c +++ b/src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */
-#include <variant/gpio.h> +#include <variant/variant.h>
/* Pad configuration was generated automatically using intelp2m utility */ static const struct pad_config gpio_table[] = { diff --git a/src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h b/src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h deleted file mode 100644 index 9094b04..0000000 --- a/src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef VARIANT_GPIO_H -#define VARIANT_GPIO_H - -#include <soc/gpe.h> -#include <soc/gpio.h> - -const struct pad_config *variant_gpio_table(size_t *num); - -#endif diff --git a/src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/variant.h b/src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/variant.h new file mode 100644 index 0000000..79a3241 --- /dev/null +++ b/src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/variant.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#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 diff --git a/src/mainboard/purism/librem_cnl/variants/librem_mini/variant.c b/src/mainboard/purism/librem_cnl/variants/librem_mini/variant.c new file mode 100644 index 0000000..c086e8d --- /dev/null +++ b/src/mainboard/purism/librem_cnl/variants/librem_mini/variant.c @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <variant/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; +}
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48519 )
Change subject: mb/purism/librem_cnl: move setting of FSP-M UPDs into variant.c ......................................................................
Patch Set 1: Code-Review+1
(3 comments)
https://review.coreboot.org/c/coreboot/+/48519/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/48519/1//COMMIT_MSG@9 PS1, Line 9: will not nit: use `won't` so that this line doesn't exceed 72 chars
https://review.coreboot.org/c/coreboot/+/48519/1/src/mainboard/purism/librem... File src/mainboard/purism/librem_cnl/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/48519/1/src/mainboard/purism/librem... PS1, Line 3: double blank line
https://review.coreboot.org/c/coreboot/+/48519/1/src/mainboard/purism/librem... File src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/variant.h:
PS1: You'd want to move this file to: mb/purism/librem_cnl/include/variant.h Otherwise, you need to copy it to every variant, and its contents are not variant-specific. See kontron/bsl6 for a good example.
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Angel Pons, Michael Niewöhner,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48519
to look at the new patch set (#2).
Change subject: mb/purism/librem_cnl: move setting of FSP-M UPDs into variant.c ......................................................................
mb/purism/librem_cnl: move setting of FSP-M UPDs into variant.c
The upcoming Librem 14 variant will not 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 --- M src/mainboard/purism/librem_cnl/Makefile.inc M src/mainboard/purism/librem_cnl/ramstage.c M src/mainboard/purism/librem_cnl/romstage.c A src/mainboard/purism/librem_cnl/variant.h M src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c D src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h A src/mainboard/purism/librem_cnl/variants/librem_mini/variant.c 7 files changed, 32 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/48519/2
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Angel Pons, Michael Niewöhner,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48519
to look at the new patch set (#3).
Change subject: mb/purism/librem_cnl: move setting of FSP-M UPDs into variant.c ......................................................................
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 --- M src/mainboard/purism/librem_cnl/Makefile.inc M src/mainboard/purism/librem_cnl/ramstage.c M src/mainboard/purism/librem_cnl/romstage.c A src/mainboard/purism/librem_cnl/variant.h M src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c D src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h A src/mainboard/purism/librem_cnl/variants/librem_mini/variant.c 7 files changed, 32 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/48519/3
Matt DeVillier has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48519 )
Change subject: mb/purism/librem_cnl: move setting of FSP-M UPDs into variant.c ......................................................................
Patch Set 3:
(3 comments)
https://review.coreboot.org/c/coreboot/+/48519/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/48519/1//COMMIT_MSG@9 PS1, Line 9: will not
nit: use `won't` so that this line doesn't exceed 72 chars
Done
https://review.coreboot.org/c/coreboot/+/48519/1/src/mainboard/purism/librem... File src/mainboard/purism/librem_cnl/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/48519/1/src/mainboard/purism/librem... PS1, Line 3:
double blank line
Done
https://review.coreboot.org/c/coreboot/+/48519/1/src/mainboard/purism/librem... File src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/variant.h:
PS1:
You'd want to move this file to: mb/purism/librem_cnl/include/variant.h […]
Done
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48519 )
Change subject: mb/purism/librem_cnl: move setting of FSP-M UPDs into variant.c ......................................................................
Patch Set 4: Code-Review+2
Hung-Te Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/48519 )
Change subject: mb/purism/librem_cnl: move setting of FSP-M UPDs into variant.c ......................................................................
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 --- M src/mainboard/purism/librem_cnl/Makefile.inc M src/mainboard/purism/librem_cnl/ramstage.c M src/mainboard/purism/librem_cnl/romstage.c A src/mainboard/purism/librem_cnl/variant.h M src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c D src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h A src/mainboard/purism/librem_cnl/variants/librem_mini/variant.c 7 files changed, 32 insertions(+), 19 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/src/mainboard/purism/librem_cnl/Makefile.inc b/src/mainboard/purism/librem_cnl/Makefile.inc index ba157df..8e3b5a6 100644 --- a/src/mainboard/purism/librem_cnl/Makefile.inc +++ b/src/mainboard/purism/librem_cnl/Makefile.inc @@ -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 diff --git a/src/mainboard/purism/librem_cnl/ramstage.c b/src/mainboard/purism/librem_cnl/ramstage.c index 56ed1b7..e93911e 100644 --- a/src/mainboard/purism/librem_cnl/ramstage.c +++ b/src/mainboard/purism/librem_cnl/ramstage.c @@ -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) { diff --git a/src/mainboard/purism/librem_cnl/romstage.c b/src/mainboard/purism/librem_cnl/romstage.c index 3a3ca6b..b7c57ee 100644 --- a/src/mainboard/purism/librem_cnl/romstage.c +++ b/src/mainboard/purism/librem_cnl/romstage.c @@ -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 @@ { 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); } diff --git a/src/mainboard/purism/librem_cnl/variant.h b/src/mainboard/purism/librem_cnl/variant.h new file mode 100644 index 0000000..79a3241 --- /dev/null +++ b/src/mainboard/purism/librem_cnl/variant.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#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 diff --git a/src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c b/src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c index 8fa4ac5..08134e0 100644 --- a/src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c +++ b/src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c @@ -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[] = { diff --git a/src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h b/src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h deleted file mode 100644 index 9094b04..0000000 --- a/src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef VARIANT_GPIO_H -#define VARIANT_GPIO_H - -#include <soc/gpe.h> -#include <soc/gpio.h> - -const struct pad_config *variant_gpio_table(size_t *num); - -#endif diff --git a/src/mainboard/purism/librem_cnl/variants/librem_mini/variant.c b/src/mainboard/purism/librem_cnl/variants/librem_mini/variant.c new file mode 100644 index 0000000..9d7e27f --- /dev/null +++ b/src/mainboard/purism/librem_cnl/variants/librem_mini/variant.c @@ -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; +}