[coreboot-gerrit] Change in coreboot[master]: mb/google/poppy/variants/nami: Perform PL2 setting in variant_devtree...

Furquan Shaikh (Code Review) gerrit at coreboot.org
Thu May 24 06:30:57 CEST 2018


Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/26499


Change subject: mb/google/poppy/variants/nami: Perform PL2 setting in variant_devtree_udpate
......................................................................

mb/google/poppy/variants/nami: Perform PL2 setting in variant_devtree_udpate

This change moves PL2 override to variant_devtree_update for two reasons:
1. This function was added to basically override devtree settings in
variant specific code. So, it would be a good idea to perform all the
overrides in a single place.
2. Adding a device for performing nami_enable would require changes to
devicetree and special handling for calling this device enable. Thus,
nami_enable was never getting called.

BUG=b:80148703

Change-Id: Ifa24a7b6e99cad2368b3d656a757f26297373121
Signed-off-by: Furquan Shaikh <furquan at google.com>
---
M src/mainboard/google/poppy/variants/nami/Makefile.inc
M src/mainboard/google/poppy/variants/nami/mainboard.c
D src/mainboard/google/poppy/variants/nami/pl2.c
3 files changed, 22 insertions(+), 51 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/26499/1

diff --git a/src/mainboard/google/poppy/variants/nami/Makefile.inc b/src/mainboard/google/poppy/variants/nami/Makefile.inc
index e9e90f5..618011c 100644
--- a/src/mainboard/google/poppy/variants/nami/Makefile.inc
+++ b/src/mainboard/google/poppy/variants/nami/Makefile.inc
@@ -33,7 +33,6 @@
 
 ramstage-y += gpio.c
 ramstage-y += nhlt.c
-ramstage-y += pl2.c
 ramstage-y += mainboard.c
 
 # Add OEM ID table
diff --git a/src/mainboard/google/poppy/variants/nami/mainboard.c b/src/mainboard/google/poppy/variants/nami/mainboard.c
index 6ff2960..19a5604 100644
--- a/src/mainboard/google/poppy/variants/nami/mainboard.c
+++ b/src/mainboard/google/poppy/variants/nami/mainboard.c
@@ -23,11 +23,26 @@
 #include <device/device.h>
 #include <drivers/intel/gma/opregion.h>
 #include <ec/google/chromeec/ec.h>
+#include <intelblocks/mp_init.h>
 #include <smbios.h>
 #include <soc/ramstage.h>
 #include <string.h>
 #include <variant/sku.h>
 
+#define PL2_I7_SKU	44
+#define PL2_DEFAULT	29
+
+static uint32_t get_pl2(void)
+{
+	struct cpuid_result cpuidr;
+
+	cpuidr = cpuid(1);
+	if (cpuidr.eax == CPUID_KABYLAKE_Y0)
+		return PL2_I7_SKU;
+
+	return PL2_DEFAULT;
+}
+
 uint32_t variant_board_sku(void)
 {
 	static uint32_t sku_id = SKU_UNKNOWN;
@@ -42,16 +57,21 @@
 	return sku_id;
 }
 
+/* Override dev tree settings per board */
 void variant_devtree_update(void)
 {
-	/* Override dev tree settings per board */
 	uint32_t sku_id = variant_board_sku();
 	struct device *root = SA_DEV_ROOT;
 	config_t *cfg = root->chip_info;
+
+	/* Update PL2 based on SKU. */
+	cfg->tdp_pl2_override = get_pl2();
+
 	switch (sku_id) {
 	case SKU_1_VAYNE:
 	case SKU_2_VAYNE:
-		cfg->usb2_ports[5].enable = 0;//rear camera
+		/* Disable unused port USB port */
+		cfg->usb2_ports[5].enable = 0;
 		break;
 	default:
 		break;
diff --git a/src/mainboard/google/poppy/variants/nami/pl2.c b/src/mainboard/google/poppy/variants/nami/pl2.c
deleted file mode 100644
index 6744f2c..0000000
--- a/src/mainboard/google/poppy/variants/nami/pl2.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2017 Google Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <arch/cpu.h>
-#include <chip.h>
-#include <device/device.h>
-#include <intelblocks/mp_init.h>
-
-#define PL2_I7_SKU	44
-#define PL2_DEFAULT	29
-
-static uint32_t nami_get_pl2(void)
-{
-	struct cpuid_result cpuidr;
-
-	cpuidr = cpuid(1);
-	if (cpuidr.eax == CPUID_KABYLAKE_Y0)
-		return PL2_I7_SKU;
-
-	return PL2_DEFAULT;
-}
-
-static void nami_enable(device_t dev)
-{
-	struct device *root = SA_DEV_ROOT;
-	config_t *conf = root->chip_info;
-
-	if (!conf)
-		return;
-
-	conf->tdp_pl2_override = nami_get_pl2();
-}
-
-struct chip_operations nami_ops = {
-	.enable_dev = nami_enable,
-};

-- 
To view, visit https://review.coreboot.org/26499
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa24a7b6e99cad2368b3d656a757f26297373121
Gerrit-Change-Number: 26499
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180524/217cee72/attachment.html>


More information about the coreboot-gerrit mailing list