summaryrefslogtreecommitdiff
path: root/src/mainboard/google/poppy/variants
diff options
context:
space:
mode:
authorJohn Su <john_su@compal.corp-partner.google.com>2018-10-25 19:21:15 +0800
committerFurquan Shaikh <furquan@google.com>2018-10-31 03:50:57 +0000
commit2257a35862576b36e89d8f16fb8765913cb06389 (patch)
tree033b62f473e15f6962e53e2941ed4bf88946b99c /src/mainboard/google/poppy/variants
parent7129cbf2f1e7153e3254792ca6cb194a040bf003 (diff)
mb/google/poppy/variants/nami: Perform PL2 setting for syndra
According to syndra thermal table, PL2 need to check cpu id. Set up syndra PL2 value. 1. KBL_U PL2 is 25w. 2. KBL_R PL2 is 29w. Refer to b:116836990#comment10. BUG=b:116836990 TEST=The thermal team verify OK Change-Id: I766a886121a089683565608252b4c176c70e88a3 Signed-off-by: John Su <john_su@compal.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/29269 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com> Reviewed-by: Shelley Chen <shchen@google.com>
Diffstat (limited to 'src/mainboard/google/poppy/variants')
-rw-r--r--src/mainboard/google/poppy/variants/nami/mainboard.c49
1 files changed, 28 insertions, 21 deletions
diff --git a/src/mainboard/google/poppy/variants/nami/mainboard.c b/src/mainboard/google/poppy/variants/nami/mainboard.c
index 7362ba6340..ba994c2383 100644
--- a/src/mainboard/google/poppy/variants/nami/mainboard.c
+++ b/src/mainboard/google/poppy/variants/nami/mainboard.c
@@ -30,7 +30,19 @@
#define PL2_I7_SKU 44
#define PL2_DEFAULT 29
-#define PL2_KBL_R 25
+#define PL2_KBL_U 25
+
+/* PL2 ID define*/
+#define PL2_ID_DEFAULT 0
+#define PL2_ID_SONA_SYNDRA 1
+
+static const struct pl2_config {
+ uint32_t cpuid_y0_pl2;
+ uint32_t cpuid_non_y0_pl2;
+} pl2_config_table[] = {
+ [PL2_ID_DEFAULT] = { PL2_I7_SKU, PL2_DEFAULT },
+ [PL2_ID_SONA_SYNDRA] = { PL2_DEFAULT, PL2_KBL_U },
+};
/* Variant for AKALI */
#define AKALI_SA_AC_LOADLINE 1100
@@ -67,18 +79,13 @@ static const struct {
},
};
-static uint32_t get_pl2(uint32_t sku_id)
+static uint32_t get_pl2(int pl2_id)
{
- if ((sku_id == SKU_0_SONA) || (sku_id == SKU_1_SONA)) {
- if (cpuid_eax(1) == CPUID_KABYLAKE_Y0)
- return PL2_DEFAULT;
-
- return PL2_KBL_R;
- }
+ assert(pl2_id < ARRAY_SIZE(pl2_config_table));
if (cpuid_eax(1) == CPUID_KABYLAKE_Y0)
- return PL2_I7_SKU;
+ return pl2_config_table[pl2_id].cpuid_y0_pl2;
- return PL2_DEFAULT;
+ return pl2_config_table[pl2_id].cpuid_non_y0_pl2;
}
uint32_t variant_board_sku(void)
@@ -220,31 +227,31 @@ void variant_devtree_update(void)
int oem_index;
struct device *root = SA_DEV_ROOT;
config_t *cfg = root->chip_info;
-
- /* Update PL2 based on SKU. */
-
- cfg->tdp_pl2_override = get_pl2(sku_id);
+ uint8_t pl2_id = PL2_ID_DEFAULT;
switch (sku_id) {
- case SKU_0_VAYNE:
- case SKU_1_VAYNE:
- case SKU_2_VAYNE:
- case SKU_0_PANTHEON:
- case SKU_1_PANTHEON:
- case SKU_2_PANTHEON:
case SKU_0_SONA:
case SKU_1_SONA:
case SKU_0_SYNDRA:
case SKU_1_SYNDRA:
case SKU_2_SYNDRA:
case SKU_3_SYNDRA:
- /* Disable unused port USB port */
+ pl2_id = PL2_ID_SONA_SYNDRA;
+ case SKU_0_VAYNE:
+ case SKU_1_VAYNE:
+ case SKU_2_VAYNE:
+ case SKU_0_PANTHEON:
+ case SKU_1_PANTHEON:
+ case SKU_2_PANTHEON:
cfg->usb2_ports[5].enable = 0;
break;
default:
break;
}
+ /* Update PL2 based on SKU. */
+ cfg->tdp_pl2_override = get_pl2(pl2_id);
+
/* Overwrite settings for different projects based on OEM ID*/
oem_index = find_sku_mapping(read_oem_id());