mb/starlabs/labtop: Define CCD Port in Kconfig

Define the CCD (aka "Webcam") USB port in the devicetree as
it is used in multiple places. It is used in devtree to
disable it based on the CMOS setting "webcam", and in the
devicetree to configure the port tuning.

This also corrects the port that is disabled on CML, from
usb2_port[6] to usb2_port[3].

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I16e368fc7965f978f2302633122ba63038603c1e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64704
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Sean Rhodes 2022-05-26 20:56:14 +01:00 committed by Felix Held
parent 2e21725fd5
commit 2eb2dcebc7
7 changed files with 16 additions and 14 deletions

View File

@ -53,6 +53,11 @@ config BOARD_STARLABS_STARBOOK_TGL
if BOARD_STARLABS_LABTOP_SERIES if BOARD_STARLABS_LABTOP_SERIES
config CCD_PORT
int
default 6 if BOARD_STARLABS_LABTOP_CML
default 3
config DEVICETREE config DEVICETREE
default "variants/\$(CONFIG_VARIANT_DIR)/devicetree.cb" default "variants/\$(CONFIG_VARIANT_DIR)/devicetree.cb"

View File

@ -79,8 +79,8 @@ chip soc/intel/cannonlake
register "usb2_ports[5]" = "USB2_PORT_MID(OC_SKIP)" register "usb2_ports[5]" = "USB2_PORT_MID(OC_SKIP)"
register "usb3_ports[2]" = "USB3_PORT_DEFAULT(OC_SKIP)" register "usb3_ports[2]" = "USB3_PORT_DEFAULT(OC_SKIP)"
# Internal Webcam # Webcam
register "usb2_ports[6]" = "USB2_PORT_MID(OC_SKIP)" register "usb2_ports[CONFIG_CCD_PORT]" = "USB2_PORT_MID(OC_SKIP)"
# Internal Bluetooth # Internal Bluetooth
register "usb2_ports[9]" = "USB2_PORT_MID(OC_SKIP)" register "usb2_ports[9]" = "USB2_PORT_MID(OC_SKIP)"

View File

@ -41,6 +41,5 @@ void devtree_update(void)
nic_dev->enabled = 0; nic_dev->enabled = 0;
/* Enable/Disable Webcam based on CMOS settings */ /* Enable/Disable Webcam based on CMOS settings */
if (get_uint_option("webcam", 1) == 0) cfg->usb2_ports[CONFIG_CCD_PORT].enable = get_uint_option("webcam", 1);
cfg->usb2_ports[3].enable = 0;
} }

View File

@ -70,12 +70,12 @@ chip soc/intel/skylake
register "usb2_ports[2]" = "USB2_PORT_MID(OC_SKIP)" register "usb2_ports[2]" = "USB2_PORT_MID(OC_SKIP)"
register "usb3_ports[2]" = "USB3_PORT_DEFAULT(OC_SKIP)" register "usb3_ports[2]" = "USB3_PORT_DEFAULT(OC_SKIP)"
# Internal Webcam
register "usb2_ports[3]" = "USB2_PORT_MID(OC_SKIP)"
# Daughterboard SD Card # Daughterboard SD Card
register "usb2_ports[6]" = "USB2_PORT_MID(OC_SKIP)" register "usb2_ports[6]" = "USB2_PORT_MID(OC_SKIP)"
# Webcam
register "usb2_ports[CONFIG_CCD_PORT]" = "USB2_PORT_MID(OC_SKIP)"
# Internal Bluetooth # Internal Bluetooth
register "usb2_ports[9]" = "USB2_PORT_MID(OC_SKIP)" register "usb2_ports[9]" = "USB2_PORT_MID(OC_SKIP)"
end end

View File

@ -38,6 +38,5 @@ void devtree_update(void)
nic_dev->enabled = 0; nic_dev->enabled = 0;
/* Enable/Disable Webcam based on CMOS settings */ /* Enable/Disable Webcam based on CMOS settings */
if (get_uint_option("webcam", 1) == 0) cfg->usb2_ports[CONFIG_CCD_PORT].enable = get_uint_option("webcam", 1);
cfg->usb2_ports[3].enable = 0;
} }

View File

@ -113,12 +113,12 @@ chip soc/intel/tigerlake
register "usb2_ports[2]" = "USB2_PORT_MID(OC_SKIP)" register "usb2_ports[2]" = "USB2_PORT_MID(OC_SKIP)"
register "usb3_ports[1]" = "USB3_PORT_DEFAULT(OC_SKIP)" register "usb3_ports[1]" = "USB3_PORT_DEFAULT(OC_SKIP)"
# Internal Webcam
register "usb2_ports[3]" = "USB2_PORT_MID(OC_SKIP)"
# Daughterboard SD Card # Daughterboard SD Card
register "usb2_ports[5]" = "USB2_PORT_MID(OC_SKIP)" register "usb2_ports[5]" = "USB2_PORT_MID(OC_SKIP)"
# Webcam
register "usb2_ports[CONFIG_CCD_PORT]" = "USB2_PORT_MID(OC_SKIP)"
# Internal Bluetooth # Internal Bluetooth
register "usb2_ports[9]" = "USB2_PORT_MID(OC_SKIP)" register "usb2_ports[9]" = "USB2_PORT_MID(OC_SKIP)"
end end

View File

@ -54,8 +54,7 @@ void devtree_update(void)
nic_dev->enabled = 0; nic_dev->enabled = 0;
/* Enable/Disable Webcam based on CMOS settings */ /* Enable/Disable Webcam based on CMOS settings */
if (get_uint_option("webcam", 1) == 0) cfg->usb2_ports[CONFIG_CCD_PORT].enable = get_uint_option("webcam", 1);
cfg->usb2_ports[3].enable = 0;
/* Enable/Disable Thunderbolt based on CMOS settings */ /* Enable/Disable Thunderbolt based on CMOS settings */
if (get_uint_option("thunderbolt", 1) == 0) { if (get_uint_option("thunderbolt", 1) == 0) {