diff options
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]; + } +} |