[coreboot-gerrit] Change in coreboot[master]: google/snappy: Override USB2 strength by SKUID
Kevin Chiu (Code Review)
gerrit at coreboot.org
Mon Oct 16 10:48:15 CEST 2017
Kevin Chiu has uploaded this change for review. ( https://review.coreboot.org/22037
Change subject: google/snappy: Override USB2 strength by SKUID
......................................................................
google/snappy: Override USB2 strength by SKUID
14" BigDaddy needs to override USB2 TxiSet additionally to
enhance driving strength.
Otherwise EA test will be failed on USB2 eye pattern.
BUG=b:67820719
BRANCH=reef
TEST=emerge-snappy coreboot
Change-Id: I674c121a71866a5d44439eeb49e07f917d816de8
Signed-off-by: Kevin Chiu <Kevin.Chiu at quantatw.com>
---
M src/mainboard/google/reef/mainboard.c
M src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h
M src/mainboard/google/reef/variants/snappy/mainboard.c
3 files changed, 49 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/37/22037/1
diff --git a/src/mainboard/google/reef/mainboard.c b/src/mainboard/google/reef/mainboard.c
index 3de383a..196d6d3 100644
--- a/src/mainboard/google/reef/mainboard.c
+++ b/src/mainboard/google/reef/mainboard.c
@@ -44,6 +44,8 @@
mainboard_ec_init();
variant_board_ec_set_skuid();
+
+ variant_board_usb_set(variant_board_sku());
}
/*
@@ -72,6 +74,11 @@
return board_sku_num;
}
+/* Set variabnt board USB strength by sku id */
+void __attribute__((weak)) variant_board_usb_set(int skuid)
+{
+}
+
/* Set variabnt board sku to ec by sku id */
void __attribute__((weak)) variant_board_ec_set_skuid(void)
{
diff --git a/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h
index 18fbf54..3658019 100644
--- a/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h
@@ -40,6 +40,7 @@
uint8_t variant_board_sku(void);
/* Set variabnt board sku to ec by sku id */
void variant_board_ec_set_skuid(void);
+void variant_board_usb_set(int skuid);
/* Return ChromeOS gpio table and fill in number of entries. */
const struct cros_gpio *variant_cros_gpios(size_t *num);
diff --git a/src/mainboard/google/reef/variants/snappy/mainboard.c b/src/mainboard/google/reef/variants/snappy/mainboard.c
index 2767df2..a6c0ab8 100644
--- a/src/mainboard/google/reef/variants/snappy/mainboard.c
+++ b/src/mainboard/google/reef/variants/snappy/mainboard.c
@@ -17,6 +17,26 @@
#include <baseboard/variants.h>
#include <ec/google/chromeec/ec.h>
#include <vendorcode/google/chromeos/cros_vpd.h>
+#include <console/console.h>
+#include <device/pci.h>
+#include <soc/pci_devs.h>
+#include <soc/usb.h>
+#include <soc/intel/apollolake/chip.h>
+
+/* SKU ID enumeration */
+enum snappy_sku {
+ SKU_UNKNOWN = -1,
+ SKU_RESERVED0,
+ SKU_RESERVED1,
+ SKU_BIGDADDY_KBDBKLIGHT,
+ SKU_RESERVED3,
+ SKU_RESERVED4,
+ SKU_BIGDADDY,
+ SKU_RESERVED6,
+ SKU_ALAN,
+ SKU_SNAPPY,
+ SKU_COUNT,
+};
void variant_board_ec_set_skuid(void)
{
@@ -63,3 +83,24 @@
return board_sku_num;
}
+
+void variant_board_usb_set(int skuid)
+{
+ struct device *dev = NB_DEV_ROOT;
+ static struct soc_intel_apollolake_config *cfg;
+
+ if (!dev || !dev->chip_info) {
+ printk(BIOS_ERR, "BUG! Could not find SOC devicetree config\n");
+ return;
+ }
+
+ cfg = dev->chip_info;
+
+ if ((skuid == SKU_BIGDADDY_KBDBKLIGHT) || (skuid == SKU_BIGDADDY)) {
+ /* override USB2#1 left PARA per port setting */
+ cfg->usb2eye[1].Usb20PerPortPeTxiSet = 7;
+ cfg->usb2eye[1].Usb20PerPortTxiSet = 7;
+ cfg->usb2eye[1].Usb20IUsbTxEmphasisEn = 3;
+ cfg->usb2eye[1].Usb20PerPortTxPeHalf = 0;
+ }
+}
--
To view, visit https://review.coreboot.org/22037
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I674c121a71866a5d44439eeb49e07f917d816de8
Gerrit-Change-Number: 22037
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Chiu <Kevin.Chiu at quantatw.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171016/f4647e98/attachment.html>
More information about the coreboot-gerrit
mailing list