Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35151 )
Change subject: mb/facebook/watson: Select no UART on SuperIO
......................................................................
mb/facebook/watson: Select no UART on SuperIO
Select NO_UART_ON_SUPERIO as the SoC internal UART is used.
The current code is working, so this is just a cosmetic fix to remove
some unused options from Kconfig.
Change-Id: I206557c397da74b572e669feb1e38f0c8473d0d9
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/mainboard/facebook/watson/Kconfig
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/35151/1
diff --git a/src/mainboard/facebook/watson/Kconfig b/src/mainboard/facebook/watson/Kconfig
index 6c2f954..43b4784 100644
--- a/src/mainboard/facebook/watson/Kconfig
+++ b/src/mainboard/facebook/watson/Kconfig
@@ -11,6 +11,7 @@
select MAINBOARD_USES_IFD_GBE_REGION
select MAINBOARD_HAS_LPC_TPM
select MAINBOARD_HAS_TPM1
+ select NO_UART_ON_SUPERIO
config MAINBOARD_DIR
string
--
To view, visit https://review.coreboot.org/c/coreboot/+/35151
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I206557c397da74b572e669feb1e38f0c8473d0d9
Gerrit-Change-Number: 35151
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
EricR Lai has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35133 )
Change subject: mb/google/drallion: add memory sku id
......................................................................
mb/google/drallion: add memory sku id
Drallion will use soldered down memory and use
GPP_F12 to GPP_F16 indicates mem_id.
BUG=b:139397313
BRANCH=N/A
TEST=N/A
Signed-off-by: Eric Lai <ericr_lai(a)compal.corp-partner.google.com>
Change-Id: Ib5ada54fd2b8f358b59de8089e5405cf3e34825a
---
M src/mainboard/google/drallion/variants/drallion/Makefile.inc
M src/mainboard/google/drallion/variants/drallion/include/variant/gpio.h
M src/mainboard/google/drallion/variants/drallion/include/variant/variant.h
A src/mainboard/google/drallion/variants/drallion/memory.c
4 files changed, 43 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/35133/1
diff --git a/src/mainboard/google/drallion/variants/drallion/Makefile.inc b/src/mainboard/google/drallion/variants/drallion/Makefile.inc
index 0400d33..8e070d2 100644
--- a/src/mainboard/google/drallion/variants/drallion/Makefile.inc
+++ b/src/mainboard/google/drallion/variants/drallion/Makefile.inc
@@ -20,3 +20,5 @@
ramstage-y += gpio.c
romstage-y += gpio.c
verstage-y += gpio.c
+
+romstage-y += memory.c
diff --git a/src/mainboard/google/drallion/variants/drallion/include/variant/gpio.h b/src/mainboard/google/drallion/variants/drallion/include/variant/gpio.h
index f7e0403..20cfbb8 100644
--- a/src/mainboard/google/drallion/variants/drallion/include/variant/gpio.h
+++ b/src/mainboard/google/drallion/variants/drallion/include/variant/gpio.h
@@ -25,6 +25,13 @@
/* Recovery mode */
#define GPIO_REC_MODE GPP_E8
+/* Memory configuration board straps */
+#define GPIO_MEM_CONFIG_0 GPP_F12
+#define GPIO_MEM_CONFIG_1 GPP_F13
+#define GPIO_MEM_CONFIG_2 GPP_F14
+#define GPIO_MEM_CONFIG_3 GPP_F15
+#define GPIO_MEM_CONFIG_4 GPP_F16
+
const struct pad_config *variant_gpio_table(size_t *num);
const struct pad_config *variant_early_gpio_table(size_t *num);
diff --git a/src/mainboard/google/drallion/variants/drallion/include/variant/variant.h b/src/mainboard/google/drallion/variants/drallion/include/variant/variant.h
index d878623..ca54580 100644
--- a/src/mainboard/google/drallion/variants/drallion/include/variant/variant.h
+++ b/src/mainboard/google/drallion/variants/drallion/include/variant/variant.h
@@ -22,4 +22,7 @@
#define VARIANT_SKU_ID_SIGNED_EC 4
#define VARIANT_SKU_NAME_SIGNED_EC "sku4"
+/* Return memory SKU for the variant */
+int variant_memory_sku(void);
+
#endif
diff --git a/src/mainboard/google/drallion/variants/drallion/memory.c b/src/mainboard/google/drallion/variants/drallion/memory.c
new file mode 100644
index 0000000..2a1d8d9
--- /dev/null
+++ b/src/mainboard/google/drallion/variants/drallion/memory.c
@@ -0,0 +1,31 @@
+/*
+ * 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 <variant/variant.h>
+#include <gpio.h>
+#include <variant/gpio.h>
+
+int variant_memory_sku(void)
+{
+ gpio_t spd_gpios[] = {
+ GPIO_MEM_CONFIG_0,
+ GPIO_MEM_CONFIG_1,
+ GPIO_MEM_CONFIG_2,
+ GPIO_MEM_CONFIG_3,
+ GPIO_MEM_CONFIG_4,
+ };
+
+ return gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios));
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/35133
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib5ada54fd2b8f358b59de8089e5405cf3e34825a
Gerrit-Change-Number: 35133
Gerrit-PatchSet: 1
Gerrit-Owner: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-MessageType: newchange
jonzhang(a)fb.com has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34636 )
Change subject: mb/ocp/monolake: use RW_VPD to configure FSP UPD
......................................................................
mb/ocp/monolake: use RW_VPD to configure FSP UPD
Summary:
This patch adds:
* A framework to use VPD binary blob 2.0 data to configure
FSP UPD.
* A library to configure HyperThreading FSP UPD variable.
The framework is added in romstage to customize FSP UPD settings.
If RW_VPD and binary blob are not found, or if there is no
"HyperThreading" setting in the binary blob, original
configuration is used.
Test Plan:
* Build an OCP MonoLake coreboot image, run following command
to initialize RW_VPD and insert HyperThreading key:
vpd -f build/coreboot.rom -O -i RW_VPD -s 'HyperThreading=0'
* Flash the image to MonoLake, boot and observe following
message in boot log:
Detected 16 CPU threads
If RW_VPD partition does not exist, or if HyperThreading
key/value pair does not exist, the boot log has:
Detected 32 CPU threads
Signed-off-by: Jonathan Zhang <jonzhang(a)fb.com>
Change-Id: Id66c3a7a0992037f59685c0c9250f90aefc3f105
Change-Id: I799d27734fe4b67cd1f40cae710151a01562b1b2
---
M src/mainboard/ocp/monolake/Makefile.inc
M src/mainboard/ocp/monolake/romstage.c
A src/mainboard/ocp/monolake/vpd_fsp.c
A src/mainboard/ocp/monolake/vpd_fsp.h
4 files changed, 125 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/34636/1
diff --git a/src/mainboard/ocp/monolake/Makefile.inc b/src/mainboard/ocp/monolake/Makefile.inc
index 1606476..ce674e4 100644
--- a/src/mainboard/ocp/monolake/Makefile.inc
+++ b/src/mainboard/ocp/monolake/Makefile.inc
@@ -13,4 +13,5 @@
## GNU General Public License for more details.
##
+romstage-y += vpd_fsp.c
ramstage-y += irqroute.c
diff --git a/src/mainboard/ocp/monolake/romstage.c b/src/mainboard/ocp/monolake/romstage.c
index f3ec7e3..4add5f1 100644
--- a/src/mainboard/ocp/monolake/romstage.c
+++ b/src/mainboard/ocp/monolake/romstage.c
@@ -23,6 +23,9 @@
#include <device/pci_ops.h>
#include <soc/pci_devs.h>
#include <soc/lpc.h>
+#include <fmap.h>
+
+#include "vpd_fsp.h"
/**
* /brief mainboard call for setup that needs to be done before fsp init
@@ -57,9 +60,61 @@
0x0c0ca1);
}
+/*
+ * This function uses a key/value pair to configure UPD.
+ */
+static int board_configure_upd(
+ const uint8_t *key, int32_t key_len,
+ const uint8_t *value, int32_t value_len,
+ void *UpdData)
+{
+ set_upd_hyper_threading(key, key_len, value, value_len, UpdData);
+
+ return VPD_OK;
+}
+
/**
- * /brief customize fsp parameters here if needed
+ * /brief customize fsp parameters, use data stored in VPD binary blob
+ * to configure FSP UPD variables.
*/
void romstage_fsp_rt_buffer_callback(FSP_INIT_RT_BUFFER *FspRtBuffer)
{
+ struct region_device rdev;
+ void *rw_vpd_addr = NULL;
+ size_t rw_vpd_size = -1;
+ int32_t consumed;
+ UPD_DATA_REGION *UpdData = FspRtBuffer->Common.UpdDataRgnPtr;
+
+ /*
+ * If RW_VPD VPD partition exists, search key/value pairs
+ * to see if there are relevant FSP UPD variable setting(s).
+ * If so, use such setting(s) to customize FSP behavior.
+ */
+ if (CONFIG(VPD)) {
+ if (!fmap_locate_area_as_rdev("RW_VPD", &rdev)) {
+ rdev_chain(&rdev, &rdev, GOOGLE_VPD_2_0_OFFSET,
+ region_device_sz(&rdev) - GOOGLE_VPD_2_0_OFFSET);
+ rw_vpd_addr = rdev_mmap_full(&rdev);
+ if (rw_vpd_addr != NULL) {
+ rw_vpd_size = region_device_sz(&rdev);
+ /* Skip the VPD info header */
+ rw_vpd_addr += sizeof(struct google_vpd_info);
+ rw_vpd_size -= sizeof(struct google_vpd_info);
+ /*
+ * decodeVpdString() is called iteratively to process
+ * key/value pairs in RW_VPD iteratively. In such
+ * processing, callback function board_configure_upd()
+ * is called to process a pair and update FSP UPD
+ * variable.
+ */
+ for (consumed = 0; consumed < rw_vpd_size; ) {
+ if (decodeVpdString(rw_vpd_size, rw_vpd_addr, &consumed,
+ board_configure_upd, (void *)UpdData) == VPD_FAIL)
+ break;
+ }
+ printk(FSP_INFO_LEVEL,
+ "Found and Processed VPD binary blob in RW_VPD.\n");
+ }
+ }
+ };
}
diff --git a/src/mainboard/ocp/monolake/vpd_fsp.c b/src/mainboard/ocp/monolake/vpd_fsp.c
new file mode 100644
index 0000000..ee5c9ca
--- /dev/null
+++ b/src/mainboard/ocp/monolake/vpd_fsp.c
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 The coreboot Authors.
+ *
+ * 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.
+ * This file is part of the coreboot project.
+ */
+#include <string.h>
+#include <drivers/vpd/vpd_fsp.h>
+#include "vpd_fsp.h"
+
+/*
+ * For "HyperThreading" UPD variable, given a key/value
+ * pair, use the value to set the variable if there is match.
+ */
+void set_upd_hyper_threading(const uint8_t *key,
+ const int32_t key_len, const uint8_t *value, const int32_t value_len,
+ UPD_DATA_REGION *UpdData)
+{
+ uint8_t val;
+ if (set_upd_bool(FSP_VAR_HYPERTHREADING, key, key_len, value,
+ value_len, &val) == true) {
+ UpdData->HyperThreading = val;
+ }
+}
diff --git a/src/mainboard/ocp/monolake/vpd_fsp.h b/src/mainboard/ocp/monolake/vpd_fsp.h
new file mode 100644
index 0000000..1e0965a
--- /dev/null
+++ b/src/mainboard/ocp/monolake/vpd_fsp.h
@@ -0,0 +1,35 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 The coreboot Authors.
+ *
+ * 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.
+ */
+
+#ifndef __MB_OCP_MONOLAKE_VPD_FSP__
+#define __MB_OCP_MONOLAKE_VPD_FSP__
+
+#include <drivers/vpd/lib_vpd.h>
+#include <drivers/vpd/vpd_fsp.h>
+#include <drivers/vpd/vpd_tables.h>
+#include <inttypes.h>
+#include <fsp.h>
+
+/* Define the strings for UPD variables that could be customized */
+#define FSP_VAR_HYPERTHREADING "HyperThreading"
+
+/*
+ * For "HyperThreading" UPD variable, given a key/value
+ * pair, use the value to set the variable if there is match.
+ */
+void set_upd_hyper_threading(const uint8_t *key,
+ const int32_t key_len, const uint8_t *value, const int32_t value_len,
+ UPD_DATA_REGION *UpdData);
+#endif /* __MB_OCP_MONOLAKE_VPD_FSP__ */
--
To view, visit https://review.coreboot.org/c/coreboot/+/34636
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I799d27734fe4b67cd1f40cae710151a01562b1b2
Gerrit-Change-Number: 34636
Gerrit-PatchSet: 1
Gerrit-Owner: jonzhang(a)fb.com
Gerrit-MessageType: newchange