diff options
author | Kane Chen <kane_chen@pegatron.corp-partner.google.com> | 2021-03-16 19:21:58 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-05-13 19:22:48 +0000 |
commit | 880ac43a85b7e16d4fda065f61b6e04a57d11b3c (patch) | |
tree | cd8974cbf7b5cdc5242a1e59093476183d497d87 | |
parent | c8d3b9160a3c33a1bcdd2c417db6fc402ac82c02 (diff) | |
download | coreboot-880ac43a85b7e16d4fda065f61b6e04a57d11b3c.tar.gz coreboot-880ac43a85b7e16d4fda065f61b6e04a57d11b3c.tar.bz2 coreboot-880ac43a85b7e16d4fda065f61b6e04a57d11b3c.zip |
mb/google/zork/var/shuboz: update USB OC pin mapping
modify USB OC pin setting for Shuboz/Jelboz/Jelboz360
Shuboz/Jelboz:
usb_port_overcurrent_pin[0] = "USB_OC_PIN_0" # USB C0
usb_port_overcurrent_pin[1] = "USB_OC_PIN_0" # USB A0
usb_port_overcurrent_pin[2] = "USB_OC_PIN_1" # USB A1
usb_port_overcurrent_pin[3] = "USB_OC_PIN_1" # USB C1
Jelboz360:
usb_port_overcurrent_pin[0] = "USB_OC_PIN_0" # USB C0
usb_port_overcurrent_pin[1] = "USB_OC_PIN_0" # USB A0
usb_port_overcurrent_pin[2] = "USB_OC_NONE" # NONE
usb_port_overcurrent_pin[3] = "USB_OC_PIN_1" # USB C1
BUG=b:182879559
BRANCH=zork
TEST=emerge-zork coreboot, validate the OC mapping.
Signed-off-by: Kane Chen <kane_chen@pegatron.corp-partner.google.com>
Change-Id: Icc1fa090109e6be54e2a5f49e364f5502f53aca2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51523
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kangheui Won <khwon@chromium.org>
4 files changed, 41 insertions, 0 deletions
diff --git a/src/mainboard/google/zork/variants/baseboard/helpers.c b/src/mainboard/google/zork/variants/baseboard/helpers.c index 9af015946fd5..d6c5e4824fc3 100644 --- a/src/mainboard/google/zork/variants/baseboard/helpers.c +++ b/src/mainboard/google/zork/variants/baseboard/helpers.c @@ -112,6 +112,12 @@ int variant_has_wwan(void) return !!extract_field(FW_CONFIG_MASK_WWAN, FW_CONFIG_SHIFT_WWAN); } +int variant_is_convertible(void) +{ + return !!extract_field(FW_CONFIG_MASK_LID_ANGLE_TABLET_MODE, + FW_CONFIG_LID_ANGLE_TABLET_MODE_SHIFT); +} + bool variant_uses_v3_schematics(void) { uint32_t board_version; diff --git a/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h index c8873abec99b..43ae7150ddfb 100644 --- a/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h @@ -72,6 +72,8 @@ int variant_has_emmc(void); int variant_has_nvme(void); /* Return 0 if non-existent, 1 if present. */ int variant_has_wwan(void); +/* Add variant is_convertible to identify convertible sku */ +int variant_is_convertible(void); /* Determine if booting in factory by using CROS_SKU_UNPROVISIONED. */ int boot_is_factory_unprovisioned(void); diff --git a/src/mainboard/google/zork/variants/shuboz/overridetree.cb b/src/mainboard/google/zork/variants/shuboz/overridetree.cb index 6eb761e37f77..704706241d92 100644 --- a/src/mainboard/google/zork/variants/shuboz/overridetree.cb +++ b/src/mainboard/google/zork/variants/shuboz/overridetree.cb @@ -23,6 +23,13 @@ chip soc/amd/picasso register "telemetry_vddcr_soc_slope_mA" = "24063" register "telemetry_vddcr_soc_offset" = "105" + # USB OC pin mapping + + register "usb_port_overcurrent_pin[0]" = "USB_OC_PIN_0" # USB C0 + register "usb_port_overcurrent_pin[1]" = "USB_OC_PIN_0" # USB A0 + register "usb_port_overcurrent_pin[2]" = "USB_OC_PIN_1" # USB C1 + register "usb_port_overcurrent_pin[3]" = "USB_OC_PIN_1" # USB C1 + # I2C2 for touchscreen and trackpad register "i2c[2]" = "{ diff --git a/src/mainboard/google/zork/variants/shuboz/variant.c b/src/mainboard/google/zork/variants/shuboz/variant.c index 8a84a75f2fb6..9907c7219a74 100644 --- a/src/mainboard/google/zork/variants/shuboz/variant.c +++ b/src/mainboard/google/zork/variants/shuboz/variant.c @@ -2,6 +2,16 @@ #include <baseboard/variants.h> #include <soc/pci_devs.h> +#include "chip.h" + +uint32_t usb_oc_map_override[USB_PORT_COUNT] = { + USB_OC_PIN_0, + USB_OC_PIN_0, + USB_OC_NONE, //for camera + USB_OC_PIN_1, + USB_OC_NONE, + USB_OC_NONE +}; static const fsp_ddi_descriptor hdmi_ddi_descriptors[] = { { // DDI0, DP0, eDP @@ -31,3 +41,19 @@ void variant_get_dxio_ddi_descriptors(const fsp_dxio_descriptor **dxio_descs, *ddi_descs = &hdmi_ddi_descriptors[0]; *ddi_num = ARRAY_SIZE(hdmi_ddi_descriptors); } + +void variant_devtree_update(void) +{ + struct soc_amd_picasso_config *soc_cfg; + soc_cfg = config_of_soc(); + uint8_t i; + + /* + For convertible SKU, it will support additional camera on USB1, + so we need the different OC map to support. + */ + if (variant_is_convertible()) { + for (i = 0; i < USB_PORT_COUNT; i++) + soc_cfg->usb_port_overcurrent_pin[i] = usb_oc_map_override[i]; + } +} |