From 2dd7b6b2f9432141e182738f8f779016aaa805b5 Mon Sep 17 00:00:00 2001 From: Nick Vaccaro Date: Thu, 9 Aug 2018 16:18:02 -0700 Subject: mb/google/poppy/variant/nocturne: update PL2 based on CPU sku This patch adds a function to overwrite PL2 setting based on CPU sku. From doc #594883, PL2 is 18W for AML-Y. BUG=b:110890675 BRANCH=None TEST=emerge-nocturne coreboot chromeos-bootimage & test with AML-Y and KBL-Y skus. Change-Id: Idfdc0c2434fdef56a7c25df05e640837a5096973 Signed-off-by: Nick Vaccaro Reviewed-on: https://review.coreboot.org/27997 Reviewed-by: Caveh Jalali Tested-by: build bot (Jenkins) --- .../google/poppy/variants/nocturne/Makefile.inc | 1 + .../google/poppy/variants/nocturne/mainboard.c | 46 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/mainboard/google/poppy/variants/nocturne/mainboard.c (limited to 'src/mainboard/google/poppy') diff --git a/src/mainboard/google/poppy/variants/nocturne/Makefile.inc b/src/mainboard/google/poppy/variants/nocturne/Makefile.inc index b78b7a3c0e..c17a49c08b 100644 --- a/src/mainboard/google/poppy/variants/nocturne/Makefile.inc +++ b/src/mainboard/google/poppy/variants/nocturne/Makefile.inc @@ -19,3 +19,4 @@ romstage-y += memory.c ramstage-y += gpio.c ramstage-y += nhlt.c +ramstage-y += mainboard.c diff --git a/src/mainboard/google/poppy/variants/nocturne/mainboard.c b/src/mainboard/google/poppy/variants/nocturne/mainboard.c new file mode 100644 index 0000000000..28d3d1b24d --- /dev/null +++ b/src/mainboard/google/poppy/variants/nocturne/mainboard.c @@ -0,0 +1,46 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2018 Google Inc. + * Copyright (C) 2018 Intel Corporation. + * + * 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 +#include +#include +#include +#include + +/* PL2 limit in watts for AML and KBL */ +#define PL2_AML 18 +#define PL2_KBL 15 + +static uint32_t get_pl2(void) +{ + uint16_t id; + id = pci_read_config16(SA_DEV_IGD, PCI_DEVICE_ID); + /* Assume we only have KLB-Y and AML-Y SKUs */ + if (id == PCI_DEVICE_ID_INTEL_KBL_GT2_SULXM) + return PL2_KBL; + + return PL2_AML; +} + +/* Override dev tree settings per board */ +void variant_devtree_update(void) +{ + struct device *root = SA_DEV_ROOT; + config_t *cfg = root->chip_info; + + /* Update PL2 based on CPU */ + cfg->tdp_pl2_override = get_pl2(); +} -- cgit v1.2.3