summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2022-05-26 20:56:14 +0100
committerFelix Held <felix-coreboot@felixheld.de>2022-07-05 13:06:21 +0000
commit2eb2dcebc7b09a315b4f7c6bdc8f4abf4220de61 (patch)
tree0fdaa682c8e47c61b5f16d2b952bab36e4a156fc /src
parent2e21725fd5c8e65dcb1ffb898df7088b33455fff (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/starlabs/labtop/Kconfig5
-rw-r--r--src/mainboard/starlabs/labtop/variants/cml/devicetree.cb4
-rw-r--r--src/mainboard/starlabs/labtop/variants/cml/devtree.c3
-rw-r--r--src/mainboard/starlabs/labtop/variants/kbl/devicetree.cb6
-rw-r--r--src/mainboard/starlabs/labtop/variants/kbl/devtree.c3
-rw-r--r--src/mainboard/starlabs/labtop/variants/tgl/devicetree.cb6
-rw-r--r--src/mainboard/starlabs/labtop/variants/tgl/devtree.c3
7 files changed, 16 insertions, 14 deletions
diff --git a/src/mainboard/starlabs/labtop/Kconfig b/src/mainboard/starlabs/labtop/Kconfig
index 828e452849..e2454bc744 100644
--- a/src/mainboard/starlabs/labtop/Kconfig
+++ b/src/mainboard/starlabs/labtop/Kconfig
@@ -53,6 +53,11 @@ config BOARD_STARLABS_STARBOOK_TGL
if BOARD_STARLABS_LABTOP_SERIES
+config CCD_PORT
+ int
+ default 6 if BOARD_STARLABS_LABTOP_CML
+ default 3
+
config DEVICETREE
default "variants/\$(CONFIG_VARIANT_DIR)/devicetree.cb"
diff --git a/src/mainboard/starlabs/labtop/variants/cml/devicetree.cb b/src/mainboard/starlabs/labtop/variants/cml/devicetree.cb
index 74125488f8..1d98612e33 100644
--- a/src/mainboard/starlabs/labtop/variants/cml/devicetree.cb
+++ b/src/mainboard/starlabs/labtop/variants/cml/devicetree.cb
@@ -79,8 +79,8 @@ chip soc/intel/cannonlake
register "usb2_ports[5]" = "USB2_PORT_MID(OC_SKIP)"
register "usb3_ports[2]" = "USB3_PORT_DEFAULT(OC_SKIP)"
- # Internal Webcam
- register "usb2_ports[6]" = "USB2_PORT_MID(OC_SKIP)"
+ # Webcam
+ register "usb2_ports[CONFIG_CCD_PORT]" = "USB2_PORT_MID(OC_SKIP)"
# Internal Bluetooth
register "usb2_ports[9]" = "USB2_PORT_MID(OC_SKIP)"
diff --git a/src/mainboard/starlabs/labtop/variants/cml/devtree.c b/src/mainboard/starlabs/labtop/variants/cml/devtree.c
index 93d55c58ae..95a5d44ea3 100644
--- a/src/mainboard/starlabs/labtop/variants/cml/devtree.c
+++ b/src/mainboard/starlabs/labtop/variants/cml/devtree.c
@@ -41,6 +41,5 @@ void devtree_update(void)
nic_dev->enabled = 0;
/* Enable/Disable Webcam based on CMOS settings */
- if (get_uint_option("webcam", 1) == 0)
- cfg->usb2_ports[3].enable = 0;
+ cfg->usb2_ports[CONFIG_CCD_PORT].enable = get_uint_option("webcam", 1);
}
diff --git a/src/mainboard/starlabs/labtop/variants/kbl/devicetree.cb b/src/mainboard/starlabs/labtop/variants/kbl/devicetree.cb
index 3e7771d666..04dabb9d27 100644
--- a/src/mainboard/starlabs/labtop/variants/kbl/devicetree.cb
+++ b/src/mainboard/starlabs/labtop/variants/kbl/devicetree.cb
@@ -70,12 +70,12 @@ chip soc/intel/skylake
register "usb2_ports[2]" = "USB2_PORT_MID(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
register "usb2_ports[6]" = "USB2_PORT_MID(OC_SKIP)"
+ # Webcam
+ register "usb2_ports[CONFIG_CCD_PORT]" = "USB2_PORT_MID(OC_SKIP)"
+
# Internal Bluetooth
register "usb2_ports[9]" = "USB2_PORT_MID(OC_SKIP)"
end
diff --git a/src/mainboard/starlabs/labtop/variants/kbl/devtree.c b/src/mainboard/starlabs/labtop/variants/kbl/devtree.c
index 566b0328e7..898519e876 100644
--- a/src/mainboard/starlabs/labtop/variants/kbl/devtree.c
+++ b/src/mainboard/starlabs/labtop/variants/kbl/devtree.c
@@ -38,6 +38,5 @@ void devtree_update(void)
nic_dev->enabled = 0;
/* Enable/Disable Webcam based on CMOS settings */
- if (get_uint_option("webcam", 1) == 0)
- cfg->usb2_ports[3].enable = 0;
+ cfg->usb2_ports[CONFIG_CCD_PORT].enable = get_uint_option("webcam", 1);
}
diff --git a/src/mainboard/starlabs/labtop/variants/tgl/devicetree.cb b/src/mainboard/starlabs/labtop/variants/tgl/devicetree.cb
index cf886cb166..cab707dea4 100644
--- a/src/mainboard/starlabs/labtop/variants/tgl/devicetree.cb
+++ b/src/mainboard/starlabs/labtop/variants/tgl/devicetree.cb
@@ -113,12 +113,12 @@ chip soc/intel/tigerlake
register "usb2_ports[2]" = "USB2_PORT_MID(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
register "usb2_ports[5]" = "USB2_PORT_MID(OC_SKIP)"
+ # Webcam
+ register "usb2_ports[CONFIG_CCD_PORT]" = "USB2_PORT_MID(OC_SKIP)"
+
# Internal Bluetooth
register "usb2_ports[9]" = "USB2_PORT_MID(OC_SKIP)"
end
diff --git a/src/mainboard/starlabs/labtop/variants/tgl/devtree.c b/src/mainboard/starlabs/labtop/variants/tgl/devtree.c
index 51243da7a6..1c280c4a34 100644
--- a/src/mainboard/starlabs/labtop/variants/tgl/devtree.c
+++ b/src/mainboard/starlabs/labtop/variants/tgl/devtree.c
@@ -54,8 +54,7 @@ void devtree_update(void)
nic_dev->enabled = 0;
/* Enable/Disable Webcam based on CMOS settings */
- if (get_uint_option("webcam", 1) == 0)
- cfg->usb2_ports[3].enable = 0;
+ cfg->usb2_ports[CONFIG_CCD_PORT].enable = get_uint_option("webcam", 1);
/* Enable/Disable Thunderbolt based on CMOS settings */
if (get_uint_option("thunderbolt", 1) == 0) {