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>
This commit is contained in:
Kane Chen 2021-03-16 19:21:58 +08:00 committed by Patrick Georgi
parent c8d3b9160a
commit 880ac43a85
4 changed files with 41 additions and 0 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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]" = "{

View File

@ -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];
}
}