mb/starlabs/lite: Remove webcam USB port from devicetree
Remove the Webcam USB port form the devicetree and handle it solely in
devtree, which will enable or disable it based on the CMOS option.
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I9c89c7103aca5c3d42215122e9d94c83947b6fee
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64544
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@tutanota.com>
diff --git a/src/mainboard/starlabs/lite/Kconfig b/src/mainboard/starlabs/lite/Kconfig
index 14ddfc4..4fc2469 100644
--- a/src/mainboard/starlabs/lite/Kconfig
+++ b/src/mainboard/starlabs/lite/Kconfig
@@ -75,4 +75,9 @@
config VARIANT_DIR
default "glk" if BOARD_STARLABS_LITE_GLK
default "glkr" if BOARD_STARLABS_LITE_GLKR
+
+config WEBCAM_USB_PORT
+ int
+ default 4 if BOARD_STARLABS_LITE_GLK
+ default 7 if BOARD_STARLABS_LITE_GLKR
endif
diff --git a/src/mainboard/starlabs/lite/devtree.c b/src/mainboard/starlabs/lite/devtree.c
index 221eb43..0bd1cf8 100644
--- a/src/mainboard/starlabs/lite/devtree.c
+++ b/src/mainboard/starlabs/lite/devtree.c
@@ -47,6 +47,5 @@
nic_dev->enabled = 0;
/* Enable/Disable Webcam based on CMOS settings */
- if (get_uint_option("webcam", 1) == 0)
- cfg->usb2_port[4].enable = 0;
+ cfg->usb2_port[CONFIG_WEBCAM_USB_PORT].enable = get_uint_option("webcam", 1);
}
diff --git a/src/mainboard/starlabs/lite/variants/glk/devicetree.cb b/src/mainboard/starlabs/lite/variants/glk/devicetree.cb
index b1b8b44..67083a0 100644
--- a/src/mainboard/starlabs/lite/variants/glk/devicetree.cb
+++ b/src/mainboard/starlabs/lite/variants/glk/devicetree.cb
@@ -89,8 +89,6 @@
register "usb2_port[0]" = "PORT_EN(OC_SKIP)"
# Motherboard USB 3.0
register "usb2_port[3]" = "PORT_EN(OC1)"
- # Internal Webcam
- register "usb2_port[4]" = "PORT_EN(OC_SKIP)"
# Daughterboard USB 3.0
register "usb2_port[5]" = "PORT_EN(OC_SKIP)"
# Daughterboard SD Card
diff --git a/src/mainboard/starlabs/lite/variants/glkr/devicetree.cb b/src/mainboard/starlabs/lite/variants/glkr/devicetree.cb
index dad2a43..8a2f15a 100644
--- a/src/mainboard/starlabs/lite/variants/glkr/devicetree.cb
+++ b/src/mainboard/starlabs/lite/variants/glkr/devicetree.cb
@@ -91,8 +91,6 @@
register "usb2_port[3]" = "PORT_EN(OC1)"
# Daughterboard SD Card
register "usb2_port[5]" = "PORT_EN(OC_SKIP)"
- # Internal Webcam
- register "usb2_port[7]" = "PORT_EN(OC_SKIP)"
### USB 3.0 Devices
# Motherboard USB 3.0